diff --git a/{{cookiecutter.project_shortname}}/MANIFEST.in b/{{cookiecutter.project_shortname}}/MANIFEST.in index 35d3766..353bd1d 100644 --- a/{{cookiecutter.project_shortname}}/MANIFEST.in +++ b/{{cookiecutter.project_shortname}}/MANIFEST.in @@ -1,5 +1,5 @@ include {{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}.min.js include {{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}.dev.js include {{cookiecutter.project_shortname}}/metadata.json -include {{cookiecutter.project_shortname}}/package.json +include package.json include README.md diff --git a/{{cookiecutter.project_shortname}}/README.md b/{{cookiecutter.project_shortname}}/README.md index a33401f..402b892 100644 --- a/{{cookiecutter.project_shortname}}/README.md +++ b/{{cookiecutter.project_shortname}}/README.md @@ -22,7 +22,7 @@ If you have selected install_dependencies during the prompt, you can skip this p 2. Create a virtual env and activate. ``` $ virtualenv venv - $ venv/Scripts/activate + $ venv/bin/activate ``` _Note: venv\Scripts\activate for windows_ @@ -49,7 +49,8 @@ If you have selected install_dependencies during the prompt, you can skip this p ``` - Write tests for your component. - A sample test is available in `tests/test_usage.py`, it will load `usage.py` and you can then automate interactions with selenium. - - Run the tests with `$ pytest tests`. + - Make sure you have [ChromeDriver](http://chromedriver.chromium.org/) available on your PATH. + - Run the tests with `$ pytest tests --driver Chrome`. - The Dash team uses these types of integration tests extensively. Browse the Dash component code on GitHub for more examples of testing (e.g. https://github.com/plotly/dash-core-components) - Add custom styles to your component by putting your custom CSS files into your distribution folder (`{{cookiecutter.project_shortname}}`). - Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component. diff --git a/{{cookiecutter.project_shortname}}/package.json b/{{cookiecutter.project_shortname}}/package.json index 9e18ef8..053542a 100644 --- a/{{cookiecutter.project_shortname}}/package.json +++ b/{{cookiecutter.project_shortname}}/package.json @@ -9,7 +9,7 @@ "prepublish": "npm run validate-init", "build:js-dev": "webpack --mode development", "build:js": "webpack --mode production", - "build:py": "node ./extract-meta.js src/lib/components > {{cookiecutter.project_shortname}}/metadata.json && copyfiles package.json {{cookiecutter.project_shortname}} && %(python_path) -c \"import dash; dash.development.component_loader.generate_classes('{{cookiecutter.project_shortname}}', '{{cookiecutter.project_shortname}}/metadata.json')\"", + "build:py": "node ./extract-meta.js src/lib/components > {{cookiecutter.project_shortname}}/metadata.json && %(python_path) -c \"import dash; dash.development.component_loader.generate_classes('{{cookiecutter.project_shortname}}', '{{cookiecutter.project_shortname}}/metadata.json')\"", "build:all": "npm run build:js & npm run build:js-dev & npm run build:py" }, "author": "{{ cookiecutter.author_name }} {{ cookiecutter.author_email }}", diff --git a/{{cookiecutter.project_shortname}}/setup.py b/{{cookiecutter.project_shortname}}/setup.py index 3b73f40..5aa576f 100644 --- a/{{cookiecutter.project_shortname}}/setup.py +++ b/{{cookiecutter.project_shortname}}/setup.py @@ -1,12 +1,11 @@ import json -import os from setuptools import setup -with open(os.path.join('{{cookiecutter.project_shortname}}', 'package.json')) as f: +with open('package.json') as f: package = json.load(f) -package_name = package["name"].replace(" ", "_").replace("-", "_") +package_name = str(package["name"].replace(" ", "_").replace("-", "_")) setup( name=package_name, diff --git a/{{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}/__init__.py b/{{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}/__init__.py index 4328b22..b1c1d22 100644 --- a/{{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}/__init__.py +++ b/{{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}/__init__.py @@ -17,7 +17,7 @@ _sys.exit(1) _basepath = _os.path.dirname(__file__) -_filepath = _os.path.abspath(_os.path.join(_basepath, 'package.json')) +_filepath = _os.path.abspath(_os.path.join(_basepath, '..','package.json')) with open(_filepath) as f: package = json.load(f) diff --git a/{{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}/package.json b/{{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}/package.json deleted file mode 100644 index 977d2e8..0000000 --- a/{{cookiecutter.project_shortname}}/{{cookiecutter.project_shortname}}/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "{{ cookiecutter.project_shortname }}", - "version": "0.0.1", - "description": "{{ cookiecutter.description }}", - "main": "build/index.js", - "scripts": { - "start": "webpack-serve ./webpack.serve.config.js --open", - "build:js-dev": "webpack --mode development", - "build:js": "webpack --mode production", - "build:py": "node ./extract-meta src/lib/components > {{cookiecutter.project_shortname}}/metadata.json && copyfiles package.json {{cookiecutter.project_shortname}} && python -c \"import dash; dash.development.component_loader.generate_classes('{{cookiecutter.project_shortname}}', '{{cookiecutter.project_shortname}}/metadata.json')\"", - "build:all": "npm run build:js & npm run build:js-dev & npm run build:py" - }, - "author": "{{ cookiecutter.author_name }} {{ cookiecutter.author_email }}", - "license": "{{ cookiecutter.license }}", - "dependencies": { - "ramda": "^0.25.0", - "react": "15.4.2", - "react-dom": "15.4.2" - }, - "devDependencies": { - "babel-core": "^6.26.3", - "babel-eslint": "^8.2.3", - "babel-loader": "^7.1.4", - "copyfiles": "^2.0.0", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "css-loader": "^0.28.11", - "eslint": "^4.19.1", - "eslint-config-prettier": "^2.9.0", - "eslint-plugin-import": "^2.12.0", - "eslint-plugin-react": "^7.9.1", - "npm": "^6.1.0", - "react-docgen": "^2.20.1", - "style-loader": "^0.21.0", - "webpack": "^4.20.2", - "webpack-cli": "^3.1.1", - "webpack-serve": "^1.0.2" - }, - "peerDependencies": { - "react": ">=0.14", - "react-dom": ">=0.14" - }, - "engines": { - "node": ">=8.11.0", - "npm": ">=6.1.0" - } -}