From c471a2663ae63b8f0acea5e234dee84f381c9c14 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Thu, 29 Aug 2024 08:57:48 +0800 Subject: [PATCH] chore: publish to npm --- .github/workflows/release.yml | 10 ++++++++++ .gitignore | 1 + dprint_plugin/deployment/npm/package.json | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 dprint_plugin/deployment/npm/package.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85a590b..5b21810 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,3 +34,13 @@ jobs: cargo publish -p pretty_yaml env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + - uses: actions/setup-node@v4 + with: + registry-url: "https://registry.npmjs.org" + - name: Publish npm package + run: | + cp target/wasm32-unknown-unknown/release/dprint_plugin_yaml.wasm dprint_plugin/deployment/npm/plugin.wasm + cd dprint_plugin/deployment/npm + npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 988502b..f920b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target dprint_plugin/deployment/plugin.wasm +dprint_plugin/deployment/npm/plugin.wasm docs/book diff --git a/dprint_plugin/deployment/npm/package.json b/dprint_plugin/deployment/npm/package.json new file mode 100644 index 0000000..8bba1d3 --- /dev/null +++ b/dprint_plugin/deployment/npm/package.json @@ -0,0 +1,20 @@ +{ + "name": "dprint-plugin-yaml", + "description": "Pretty YAML as dprint plugin.", + "version": "0.5.0", + "author": "Pig Fang ", + "repository": "g-plane/pretty_yaml", + "license": "MIT", + "type": "module", + "keywords": [ + "dprint", + "dprint-plugin" + ], + "files": [ + "*.wasm" + ], + "exports": { + "./plugin.wasm": "./plugin.wasm", + "./package.json": "./package.json" + } +}