From ce51260cd1f0c5f7844853181c9eae745b018ba7 Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:26:37 -0400 Subject: [PATCH] chore: publish to jsr --- .github/workflows/publish-beta.yml | 12 ++++++++++++ deno.json | 5 +++++ package.json | 14 +++++++------- src/{index.ts => mod.ts} | 0 tsconfig.json | 2 +- tsup.config.ts | 2 +- vitest.config.ts | 2 +- 7 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 deno.json rename src/{index.ts => mod.ts} (100%) diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index a205aff7..9acf3b10 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -90,6 +90,9 @@ jobs: name: Publish Beta to NPM needs: [test, prepare-version] runs-on: ubuntu-latest + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 @@ -142,3 +145,12 @@ jobs: body: body }) } + + - name: Set up Deno + uses: denoland/setup-deno@v1 + + - name: Publish to JSR + run: | + deno run -A jsr:@david/publish-on-tag@0.1.4 + env: + GITHUB_REF: refs/tags/v${{ needs.prepare-version.outputs.version }} diff --git a/deno.json b/deno.json new file mode 100644 index 00000000..ef64b9c3 --- /dev/null +++ b/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@radashi-org/radashi", + "version": "0.0.0", + "exports": "./src/mod.ts" +} diff --git a/package.json b/package.json index 75c8bf8e..236d2f23 100644 --- a/package.json +++ b/package.json @@ -38,15 +38,15 @@ "repository": { "url": "https://github.com/radashi-org/radashi" }, - "main": "dist/index.cjs", - "module": "dist/index.js", - "types": "dist/index.d.cts", + "main": "dist/radashi.cjs", + "module": "dist/radashi.js", + "types": "dist/radashi.d.cts", "exports": { "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" + "types": "./dist/radashi.d.cts", + "default": "./dist/radashi.cjs" }, - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/radashi.d.ts", + "default": "./dist/radashi.js" } } diff --git a/src/index.ts b/src/mod.ts similarity index 100% rename from src/index.ts rename to src/mod.ts diff --git a/tsconfig.json b/tsconfig.json index 070a58f1..786f3ac3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "types": [], "paths": { "radashi": [ - "./src/index", + "./src/mod", "./src/array/*", "./src/async/*", "./src/curry/*", diff --git a/tsup.config.ts b/tsup.config.ts index 8959a813..1b41238b 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'tsup' export default defineConfig({ - entry: ['src/index.ts'], + entry: { radashi: 'src/mod.ts' }, format: ['cjs', 'esm'], dts: true, target: 'node16' diff --git a/vitest.config.ts b/vitest.config.ts index 2cf110bd..4942b151 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -13,7 +13,7 @@ export default defineConfig({ }, resolve: { alias: { - radashi: resolve('./src/index.js') + radashi: resolve('./src/mod.js') } } })