Skip to content

Commit 67c5658

Browse files
authored
fix: invalid ESM import (#12)
* fix: invalid ESM import * also add unit tests for this * chore: build when in PRs * chore: coverage tests
1 parent a095e71 commit 67c5658

File tree

10 files changed

+1928
-16
lines changed

10 files changed

+1928
-16
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@ concurrency:
1212
jobs:
1313
release-please:
1414
runs-on: ubuntu-latest
15-
if: github.ref == 'refs/heads/main'
1615
outputs:
1716
release_created: ${{ steps.release.outputs.release_created }}
1817
tag_name: ${{ steps.release.outputs.tag_name }}
1918
steps:
2019
- uses: googleapis/release-please-action@v4
20+
if: github.ref == 'refs/heads/main'
2121
id: release
2222
with:
2323
release-type: node
2424
build:
2525
runs-on: ubuntu-latest
2626
needs: [release-please]
27-
# Run on all PRs, or when a release is created
28-
if: ${{ github.event_name == 'pull_request' || needs.release-please.outputs.release_created }}
2927

3028
steps:
3129
- uses: actions/checkout@v4
@@ -62,8 +60,8 @@ jobs:
6260
- name: Build
6361
run: pnpm run build
6462

65-
# - name: test
66-
# run: pnpm run test
63+
- name: test
64+
run: pnpm run test:coverage
6765

6866
- name: Setup NPM Authentication
6967
if: ${{ needs.release-please.outputs.release_created }}

dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import AES from "crypto-js/aes";
2-
import Utf8 from "crypto-js/enc-utf8";
1+
import AES from "crypto-js/aes.js";
2+
import Utf8 from "crypto-js/enc-utf8.js";
33
import { createSharedComposable } from "@vueuse/core";
44
const _useCallback = (config) => {
55
const send = (url, payload, redirectType, sendType, sender) => {

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
"build": "tsc",
1616
"dev": "tsc --watch",
1717
"clean": "rimraf dist",
18-
"prebuild": "pnpm clean"
18+
"prebuild": "pnpm clean",
19+
"test": "vitest --config vitest.config.ts",
20+
"test:coverage": "vitest run --coverage",
21+
"test:ui": "vitest --ui"
1922
},
2023
"dependencies": {
2124
"crypto-js": "^4.2.0"
@@ -27,7 +30,10 @@
2730
"@vueuse/core": "^13.0.0",
2831
"@types/crypto-js": "^4.2.1",
2932
"rimraf": "^6.0.0",
30-
"typescript": "^5.3.3"
33+
"@vitest/coverage-v8": "^3.1.1",
34+
"@vue/test-utils": "^2.4.6",
35+
"typescript": "^5.3.3",
36+
"vitest": "^3.1.1"
3137
},
3238
"packageManager": "pnpm@10.8.0+sha512.0e82714d1b5b43c74610193cb20734897c1d00de89d0e18420aebc5977fa13d780a9cb05734624e81ebd81cc876cd464794850641c48b9544326b5622ca29971",
3339
"pnpm": {

0 commit comments

Comments
 (0)