Skip to content

Commit

Permalink
Check commonjs require in CI (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
kigawas authored Oct 23, 2024
1 parent 13bb270 commit d50cc4c
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 69 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ jobs:
- run: bun run example/runtime/main.js
- run: deno run --allow-read example/runtime/main.js
- run: node example/runtime/main.js
- run: node example/runtime/import.js
- run: node example/runtime/require.cjs
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# Changelog

## 0.4.10

- Fix commonjs build

## 0.4.9

- Add examples
Expand Down
10 changes: 10 additions & 0 deletions example/runtime/require.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { ECIES_CONFIG, utils: _utils } = require("eciesjs");
const config = require("eciesjs/config");
const consts = require("eciesjs/consts");
const utils = require("eciesjs/utils");

console.log("ECIES_CONFIG:", ECIES_CONFIG);
console.log("config:", config);
console.log("consts:", consts);
console.log("utils:", utils);
console.log("index utils:", _utils);
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "git+https://github.com/ecies/js.git"
},
"version": "0.4.9",
"version": "0.4.10",
"engines": {
"node": ">=16.0.0"
},
Expand All @@ -31,27 +31,27 @@
"dist"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.js"
},
"./config": {
"types": "./dist/config.d.ts",
"import": "./dist/config.js",
"require": "./dist/config.js"
},
"./consts": {
"types": "./dist/consts.d.ts",
"import": "./dist/consts.js",
"require": "./dist/consts.js"
},
"./utils": {
"types": "./dist/utils/index.d.ts",
"import": "./dist/utils/index.js",
"require": "./dist/utils/index.js"
}
},
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.js"
},
"./config": {
"types": "./dist/config.d.ts",
"import": "./dist/config.js",
"require": "./dist/config.js"
},
"./consts": {
"types": "./dist/consts.d.ts",
"import": "./dist/consts.js",
"require": "./dist/consts.js"
},
"./utils": {
"types": "./dist/utils/index.d.ts",
"import": "./dist/utils/index.js",
"require": "./dist/utils/index.js"
}
},
"scripts": {
"build": "npx tsc",
"test": "vitest"
Expand All @@ -63,7 +63,7 @@
"@noble/hashes": "^1.5.0"
},
"devDependencies": {
"@types/node": "^22.7.8",
"@types/node": "^22.7.9",
"@vitest/coverage-v8": "^2.1.3",
"typescript": "^5.6.3",
"undici": "^6.20.1",
Expand Down
85 changes: 39 additions & 46 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d50cc4c

Please sign in to comment.