GithubHelp home page GithubHelp logo

adesuyitolulope / dash-components-archetype Goto Github PK

View Code? Open in Web Editor NEW

This project forked from radovankavicky/dash-components-archetype

0.0 0.0 0.0 140 KB

Deprecated. A Builder archetype for Dash component suites. See the new version here: https://github.com/plotly/dash-component-boilerplate

License: MIT License

JavaScript 88.96% Python 9.08% HTML 1.97%

dash-components-archetype's Introduction

Dash Components Archetype (Deprecated)

Note: This repo, and this way of creating Dash Components, has been deprecated. Please use the new Dash Component Boilerplate: https://github.com/plotly/dash-component-boilerplate/

Overview

This is a Builder archetype for Dash component suites. It defines build- and test configuration, as well as development scripts and a convenient way to generate a new component suite project with all the necessary boilerplate.

๐Ÿ“ฃ Component authors: Subscribe to https://github.com/plotly/dash-components-archetype/issues/40 to be notified of breaking changes ๐Ÿ“ฃ

Generating a component suite project

$ npm install -g builder-init
$ builder-init dash-components-archetype

Answer the prompts, then:

$ cd [YOUR-COMPONENT-SUITE-NAME]
$ npm install

Development

Demo Server

If your component suite project has a demo/ directory following the same structure as the init/demo directory in this archetype, you can start up a demo development server:

$ npm run demo
$ open http://localhost:9000

This lets you see a demo of the rendered components. You have to maintain the list of components in demo/Demo.react.js.

Code quality

To run lint:

$ npm test

TODO: ESLint is not reporting problems https://github.com/plotly/dash-components-archetype/issues/15

Testing your components in Dash

The best way to test your components in the real Dash context is by linking into dash2 and testing them from there.

  1. Prepare your component suite module by linking and watching for changes

     # Symlink module
     $ npm link
    
     # Transpile components to `lib/` and watch for changes
     $ npm start
    
  2. Link module into dash2 project

     # In the `dash2/renderer` project directory:
     $ npm link [YOUR-COMPONENT-SUITE-NAME]
    

Now you should be able to restart the webpack process (in dash2/renderer: ctrl-c, npm start), after which webpack will automatically pick up new changes to the component suite.

Customizing your project

You can override any npm script in the archetype with your own implementation. To see the list of supported scripts, run ./node_modules/bin/builder run. For more details, see Builder Archetypes.

Release

To tag and release a new version of the archetype, follow these instructions. You might be tempted to add some of these steps to NPM's *version lifecycle methods, but that would interfere with versioning and publishing of the actual project depending on the archetype, since Builder merges the project package.json scripts with the archetype's package.json scripts.

# 1. Bump package.json `version` according to [semver][]
vi package.json

# 2. Generate `dev/*` package files
node_modules/.bin/builder-support gen-dev

# 3. Run tests
npm run builder:check

# 4. Commit and tag
git add package.json dev
git commit -m "vx.x.x"
git tag -a "vx.x.x" -m "vx.x.x"
git push --follow-tags

5. Publish main and dev package
npm publish && cd dev && npm publish && cd -

Contributing

You can test component generation with this library with npm link and with the absolute file path option of builder-init.

npm install -g builder-init
git clone https://github.com/plotly/dash-components-archetype.git
cd dash-components-archetype
npm link
cd dev
npm link
cd ../..
builder-init /ABSOLUTE/PATH/TO/dash-components-archetype/
# answer prompts to create new file

# Enter new package folder
cd new-package # replace with the name of your package from the prompt
npm link dash-components-archetype
npm link dash-components-archetype-dev
npm i

dash-components-archetype's People

Contributors

chriddyp avatar coopy avatar rmarren1 avatar chaliy avatar cpsievert avatar akronix avatar robbason avatar ned2 avatar shammamah-zz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.