diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c648e6..15a777b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,7 +72,7 @@ jobs: - name: Test Python module run: nox -s test-${{ matrix.python-version }} publish: - name: Publish dash-loading-spinners to TestPyPI and PyPI + name: Publish dash-loading-spinners to TestPyPI, PyPI and NPM runs-on: ubuntu-latest needs: python-test steps: @@ -108,3 +108,15 @@ jobs: uses: pypa/gh-action-pypi-publish@v1.4.2 with: password: ${{ secrets.PYPI_API_TOKEN }} + + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + + - name: Publish dash-loading-spinners to NPM + run: | + npm ci + npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..69227a1 --- /dev/null +++ b/.npmignore @@ -0,0 +1,25 @@ +# dependencies +/node_modules + +# testing +/coverage + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Development folders and files +public +src +scripts +config +.travis.yml +CHANGELOG.md +README.md diff --git a/dash_loading_spinners/__init__.py b/dash_loading_spinners/__init__.py index f4ec627..8dcb160 100644 --- a/dash_loading_spinners/__init__.py +++ b/dash_loading_spinners/__init__.py @@ -35,10 +35,16 @@ _js_dist = [ { "relative_package_path": "dash_loading_spinners.min.js", + "external_url": "https://unpkg.com/{0}@{2}/{1}/{1}.js".format( + package_name, __name__, __version__ + ), "namespace": package_name, }, { "relative_package_path": "dash_loading_spinners.min.js.map", + "external_url": "https://unpkg.com/{0}@{2}/{1}/{1}.js.map".format( + package_name, __name__, __version__ + ), "namespace": package_name, "dynamic": True, }, diff --git a/docs/docs_app/component_parser.py b/docs/docs_app/component_parser.py index b5364fd..c1b7ab9 100644 --- a/docs/docs_app/component_parser.py +++ b/docs/docs_app/component_parser.py @@ -123,7 +123,6 @@ def temp(color): def number_slider(app, component_name, attribute_name, default=0): - app.clientside_callback( """ function(value) { @@ -174,7 +173,6 @@ def number_slider(app, component_name, attribute_name, default=0): def create_adjustable_component(app, component, component_name, attributes): - component_name = component_name.lower() main_components = [] diff --git a/examples/usage.py b/examples/usage.py index aa27f2c..6cdd79f 100644 --- a/examples/usage.py +++ b/examples/usage.py @@ -229,7 +229,6 @@ def change_fullscreen(checked): [Input("loading-button", "n_clicks")], ) def load_output(n): - if n: time.sleep(3) return f"Output loaded {n} times" diff --git a/package-lock.json b/package-lock.json index 59d7403..2c5fd39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dash_loading_spinners", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dash_loading_spinners", - "version": "1.0.0", + "version": "1.0.2", "license": "MIT", "dependencies": { "ramda": "^0.26.1", diff --git a/package.json b/package.json index e14c3de..ec54e31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dash_loading_spinners", - "version": "1.0.0", + "version": "1.0.2", "description": "Fun and funky loading spinners for your Dash apps", "repository": { "type": "git",