From 7d9ba69e1d653ac496dd4cacb000ace18b5d0f97 Mon Sep 17 00:00:00 2001 From: forehalo Date: Sun, 9 Oct 2022 14:30:23 +0800 Subject: [PATCH 1/2] fix dual module types exporting --- .github/workflows/index.yaml | 5 +++++ package.json | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/index.yaml b/.github/workflows/index.yaml index 24fe3c8..957d6cf 100644 --- a/.github/workflows/index.yaml +++ b/.github/workflows/index.yaml @@ -20,7 +20,12 @@ jobs: - run: npm run lint - run: npm run build - run: npm run test + - name: module test + run: | + node --input-type=module --eval "import * as m from '@abraham/reflection'; console.log(m)" + node --input-type=commonjs --eval "const m = require('@abraham/reflection'); console.log(m)" - run: npm run pkg-ok + - uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index e001771..e401015 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "type": "module", "exports": { "import": "./dist/index.js", - "require": "./dist/index.umd.js" + "require": "./dist/index.umd.cjs" }, - "main": "./dist/index.umd.js", + "main": "./dist/index.umd.cjs", "module": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { @@ -80,7 +80,7 @@ "rollup": { "input": "dist/index.js", "output": { - "file": "dist/index.umd.js", + "file": "dist/index.umd.cjs", "format": "umd", "name": "@abraham/reflection" } From 0ab5deccb6a346dc1fa412bf0e41923ba4cdb69c Mon Sep 17 00:00:00 2001 From: Abraham Williams <4braham@gmail.com> Date: Sun, 5 Feb 2023 18:05:35 -0600 Subject: [PATCH 2/2] npm run format --- .github/workflows/index.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/index.yaml b/.github/workflows/index.yaml index 957d6cf..d4fe677 100644 --- a/.github/workflows/index.yaml +++ b/.github/workflows/index.yaml @@ -25,7 +25,6 @@ jobs: node --input-type=module --eval "import * as m from '@abraham/reflection'; console.log(m)" node --input-type=commonjs --eval "const m = require('@abraham/reflection'); console.log(m)" - run: npm run pkg-ok - - uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }}