Skip to content

Commit

Permalink
Merge pull request #10 from glsdown/npm-cdn
Browse files Browse the repository at this point in the history
Publish to NPM
  • Loading branch information
glsdown committed Nov 21, 2023
2 parents b904605 + f65c81d commit d64a2d8
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 7 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
25 changes: 25 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions dash_loading_spinners/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 0 additions & 2 deletions docs/docs_app/component_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ def temp(color):


def number_slider(app, component_name, attribute_name, default=0):

app.clientside_callback(
"""
function(value) {
Expand Down Expand Up @@ -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 = []

Expand Down
1 change: 0 additions & 1 deletion examples/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit d64a2d8

Please sign in to comment.