diff --git a/.cspell.jsonc b/.cspell.jsonc index 55601ca..127e87b 100644 --- a/.cspell.jsonc +++ b/.cspell.jsonc @@ -12,6 +12,7 @@ "Codacy", "Codecov", "consts", + "deno", "ecies", "eciesjs", "eciespy", @@ -39,7 +40,6 @@ ".gitignore", ".cspell.jsonc", "LICENSE", - "package.json", - "yarn.lock" + "package.json" ] } diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index fa31624..f96ad70 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -12,9 +12,7 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 with: node-version: 22 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10ecff2..ffe7058 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,9 +16,7 @@ jobs: node: [18, 20, 22] steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} @@ -32,6 +30,27 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - run: pnpm run build && npm publish --dry-run - - run: cd example && pnpm install - - run: node example/index.js - - run: node example/import.js + check-runtimes: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: pnpm-lock.yaml + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + - run: pnpm install && pnpm build + - run: cd example/runtime && bun install + - run: bun run example/runtime/main.js + - run: deno run --allow-read example/runtime/main.js + - run: node example/runtime/main.js diff --git a/.gitignore b/.gitignore index 7b588c6..324e0af 100644 --- a/.gitignore +++ b/.gitignore @@ -116,4 +116,8 @@ dist .pnp.* .DS_Store -*.html + +# example +bun.lockb +deno.lock +example/runtime/pnpm-lock.yaml diff --git a/example/README.md b/example/README.md index 3ca7459..6c6885d 100644 --- a/example/README.md +++ b/example/README.md @@ -1,15 +1,21 @@ -# eciesjs-example +# example -Run `pnpm install` first +Make sure `pnpm build` under the parent directory is run before. -## Basic usage +## Browser example -Run `node index.js` +Run `cd browser && pnpm install && pnpm dev` -## Check import +For production, run `pnpm build && pnpm preview` -Run `node import.js` +## Runtime example (Node/Bun/Deno) -## Browser +Run `cd runtime && bun install` -Run `pnpm dev` +### Basic usage + +Run `node main.js` or `bun run main.js` or `deno run --allow-read main.js` + +### Check import + +Run `node import.js` or `bun run import.js` or `deno run --allow-read import.js` diff --git a/example/index.html b/example/browser/index.html similarity index 79% rename from example/index.html rename to example/browser/index.html index 8ad1bef..43fc312 100644 --- a/example/index.html +++ b/example/browser/index.html @@ -9,7 +9,7 @@
- +