Skip to content

Commit 950e3ec

Browse files
committed
🔧 chore: update npm entries
1 parent 8007cc3 commit 950e3ec

40 files changed

+452
-319
lines changed

Diff for: jest.config.js

-16
This file was deleted.

Diff for: jest.config.mjs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { tsMonorepoConfig } from '@guanghechen/jest-config'
2+
import path from 'node:path'
3+
import url from 'node:url'
4+
5+
export default async function () {
6+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
7+
const baseConfig = await tsMonorepoConfig(__dirname, { useESM: true })
8+
9+
const config = {
10+
...baseConfig,
11+
preset: 'ts-jest/presets/default-esm',
12+
coverageProvider: 'babel',
13+
coverageThreshold: {
14+
global: {
15+
branches: 90,
16+
functions: 95,
17+
lines: 95,
18+
statements: 95,
19+
},
20+
},
21+
extensionsToTreatAsEsm: ['.ts', '.mts'],
22+
}
23+
return config
24+
}

Diff for: package.json

+6-8
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,19 @@
3737
"packages/*"
3838
],
3939
"devDependencies": {
40-
"@babel/core": "7.20.7",
40+
"@babel/core": "7.20.12",
4141
"@babel/eslint-parser": "7.19.1",
42-
"@guanghechen/eslint-config": "^3.0.0-alpha.3",
43-
"@guanghechen/eslint-config-ts": "^3.0.0-alpha.3",
44-
"@guanghechen/jest-config": "^3.0.0-alpha.3",
45-
"@guanghechen/rollup-config": "^3.0.0-alpha.3",
46-
"@types/fs-extra": "^9.0.13",
42+
"@guanghechen/eslint-config": "^3.0.0-alpha.5",
43+
"@guanghechen/eslint-config-ts": "^3.0.0-alpha.5",
44+
"@guanghechen/jest-config": "^3.0.0-alpha.5",
45+
"@guanghechen/rollup-config": "^3.0.0-alpha.5",
4746
"@types/jest": "29.2.5",
4847
"@types/node": "18.11.18",
4948
"cross-env": "^7.0.3",
5049
"eslint": "8.31.0",
5150
"eslint-config-prettier": "8.6.0",
52-
"eslint-plugin-jest": "27.2.0",
51+
"eslint-plugin-jest": "27.2.1",
5352
"eslint-plugin-prettier": "4.2.1",
54-
"fs-extra": "^11.1.0",
5553
"gitmoji-changelog": "2.3.0",
5654
"husky": "8.0.3",
5755
"is-ci": "3.0.1",

Diff for: packages/base64/__test__/base64.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TextEncoder } from 'util'
1+
import { TextEncoder } from 'node:util'
22
import { Base64, decode, encode, validate } from '../src'
33

44
describe('basic', () => {

Diff for: packages/base64/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
],
1919
"type": "module",
2020
"exports": {
21-
"import": "./lib/esm/index.mjs",
22-
"require": "./lib/cjs/index.cjs"
21+
"types": "./lib/types/index.d.ts",
22+
"require": "./lib/cjs/index.cjs",
23+
"import": "./lib/esm/index.mjs"
2324
},
24-
"types": "lib/types/index.d.ts",
25-
"source": "src/index.ts",
25+
"types": "./lib/types/index.d.ts",
26+
"main": "./lib/cjs/index.cjs",
27+
"module": "./lib/esm/index.mjs",
28+
"source": "./src/index.ts",
2629
"license": "MIT",
2730
"engines": {
2831
"node": ">= 14.15.0"
@@ -37,8 +40,8 @@
3740
],
3841
"scripts": {
3942
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
40-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
41-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
43+
"prepublishOnly": "yarn build",
44+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4245
},
4346
"devDependencies": {
4447
"cross-env": "^7.0.3",

Diff for: packages/bellman-ford/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
],
2121
"type": "module",
2222
"exports": {
23-
"import": "./lib/esm/index.mjs",
24-
"require": "./lib/cjs/index.cjs"
23+
"types": "./lib/types/index.d.ts",
24+
"require": "./lib/cjs/index.cjs",
25+
"import": "./lib/esm/index.mjs"
2526
},
26-
"types": "lib/types/index.d.ts",
27-
"source": "src/index.ts",
27+
"types": "./lib/types/index.d.ts",
28+
"main": "./lib/cjs/index.cjs",
29+
"module": "./lib/esm/index.mjs",
30+
"source": "./src/index.ts",
2831
"license": "MIT",
2932
"engines": {
3033
"node": ">= 14.15.0"
@@ -39,8 +42,8 @@
3942
],
4043
"scripts": {
4144
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
42-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
43-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
45+
"prepublishOnly": "yarn build",
46+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4447
},
4548
"dependencies": {
4649
"@algorithm.ts/constant": "^3.0.0-alpha.3",

Diff for: packages/binary-index-tree/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
],
2020
"type": "module",
2121
"exports": {
22-
"import": "./lib/esm/index.mjs",
23-
"require": "./lib/cjs/index.cjs"
22+
"types": "./lib/types/index.d.ts",
23+
"require": "./lib/cjs/index.cjs",
24+
"import": "./lib/esm/index.mjs"
2425
},
25-
"types": "lib/types/index.d.ts",
26-
"source": "src/index.ts",
26+
"types": "./lib/types/index.d.ts",
27+
"main": "./lib/cjs/index.cjs",
28+
"module": "./lib/esm/index.mjs",
29+
"source": "./src/index.ts",
2730
"license": "MIT",
2831
"engines": {
2932
"node": ">= 14.15.0"
@@ -39,8 +42,8 @@
3942
],
4043
"scripts": {
4144
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
42-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
43-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
45+
"prepublishOnly": "yarn build",
46+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4447
},
4548
"dependencies": {
4649
"@algorithm.ts/types": "^3.0.0-alpha.3"

Diff for: packages/binary-search/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
],
1919
"type": "module",
2020
"exports": {
21-
"import": "./lib/esm/index.mjs",
22-
"require": "./lib/cjs/index.cjs"
21+
"types": "./lib/types/index.d.ts",
22+
"require": "./lib/cjs/index.cjs",
23+
"import": "./lib/esm/index.mjs"
2324
},
24-
"types": "lib/types/index.d.ts",
25-
"source": "src/index.ts",
25+
"types": "./lib/types/index.d.ts",
26+
"main": "./lib/cjs/index.cjs",
27+
"module": "./lib/esm/index.mjs",
28+
"source": "./src/index.ts",
2629
"license": "MIT",
2730
"engines": {
2831
"node": ">= 14.15.0"
@@ -37,8 +40,8 @@
3740
],
3841
"scripts": {
3942
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
40-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
41-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
43+
"prepublishOnly": "yarn build",
44+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4245
},
4346
"dependencies": {
4447
"@algorithm.ts/constant": "^3.0.0-alpha.3"

Diff for: packages/bipartite-matching/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
],
1919
"type": "module",
2020
"exports": {
21-
"import": "./lib/esm/index.mjs",
22-
"require": "./lib/cjs/index.cjs"
21+
"types": "./lib/types/index.d.ts",
22+
"require": "./lib/cjs/index.cjs",
23+
"import": "./lib/esm/index.mjs"
2324
},
24-
"types": "lib/types/index.d.ts",
25-
"source": "src/index.ts",
25+
"types": "./lib/types/index.d.ts",
26+
"main": "./lib/cjs/index.cjs",
27+
"module": "./lib/esm/index.mjs",
28+
"source": "./src/index.ts",
2629
"license": "MIT",
2730
"engines": {
2831
"node": ">= 14.15.0"
@@ -37,8 +40,8 @@
3740
],
3841
"scripts": {
3942
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
40-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
41-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
43+
"prepublishOnly": "yarn build",
44+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4245
},
4346
"dependencies": {
4447
"@algorithm.ts/queue": "^3.0.0-alpha.3"

Diff for: packages/calculator/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
],
2222
"type": "module",
2323
"exports": {
24-
"import": "./lib/esm/index.mjs",
25-
"require": "./lib/cjs/index.cjs"
24+
"types": "./lib/types/index.d.ts",
25+
"require": "./lib/cjs/index.cjs",
26+
"import": "./lib/esm/index.mjs"
2627
},
27-
"types": "lib/types/index.d.ts",
28-
"source": "src/index.ts",
28+
"types": "./lib/types/index.d.ts",
29+
"main": "./lib/cjs/index.cjs",
30+
"module": "./lib/esm/index.mjs",
31+
"source": "./src/index.ts",
2932
"license": "MIT",
3033
"engines": {
3134
"node": ">= 14.15.0"
@@ -40,8 +43,8 @@
4043
],
4144
"scripts": {
4245
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
43-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
44-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
46+
"prepublishOnly": "yarn build",
47+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4548
},
4649
"dependencies": {
4750
"@algorithm.ts/constant": "^3.0.0-alpha.3",

Diff for: packages/constant/package.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
"homepage": "https://github.com/guanghechen/algorithm.ts/tree/release-3.x.x/packages/constant#readme",
1515
"type": "module",
1616
"exports": {
17-
"import": "./lib/esm/index.mjs",
18-
"require": "./lib/cjs/index.cjs"
17+
"types": "./lib/types/index.d.ts",
18+
"require": "./lib/cjs/index.cjs",
19+
"import": "./lib/esm/index.mjs"
1920
},
20-
"types": "lib/types/index.d.ts",
21-
"source": "src/index.ts",
21+
"types": "./lib/types/index.d.ts",
22+
"main": "./lib/cjs/index.cjs",
23+
"module": "./lib/esm/index.mjs",
24+
"source": "./src/index.ts",
2225
"license": "MIT",
2326
"engines": {
2427
"node": ">= 14.15.0"
@@ -33,7 +36,7 @@
3336
],
3437
"scripts": {
3538
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
36-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build"
39+
"prepublishOnly": "yarn build"
3740
},
3841
"devDependencies": {
3942
"cross-env": "^7.0.3",

Diff for: packages/dijkstra/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
],
2222
"type": "module",
2323
"exports": {
24-
"import": "./lib/esm/index.mjs",
25-
"require": "./lib/cjs/index.cjs"
24+
"types": "./lib/types/index.d.ts",
25+
"require": "./lib/cjs/index.cjs",
26+
"import": "./lib/esm/index.mjs"
2627
},
27-
"types": "lib/types/index.d.ts",
28-
"source": "src/index.ts",
28+
"types": "./lib/types/index.d.ts",
29+
"main": "./lib/cjs/index.cjs",
30+
"module": "./lib/esm/index.mjs",
31+
"source": "./src/index.ts",
2932
"license": "MIT",
3033
"engines": {
3134
"node": ">= 14.15.0"
@@ -40,8 +43,8 @@
4043
],
4144
"scripts": {
4245
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
43-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
44-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
46+
"prepublishOnly": "yarn build",
47+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4548
},
4649
"dependencies": {
4750
"@algorithm.ts/constant": "^3.0.0-alpha.3",

Diff for: packages/dinic/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
],
2222
"type": "module",
2323
"exports": {
24-
"import": "./lib/esm/index.mjs",
25-
"require": "./lib/cjs/index.cjs"
24+
"types": "./lib/types/index.d.ts",
25+
"require": "./lib/cjs/index.cjs",
26+
"import": "./lib/esm/index.mjs"
2627
},
27-
"types": "lib/types/index.d.ts",
28-
"source": "src/index.ts",
28+
"types": "./lib/types/index.d.ts",
29+
"main": "./lib/cjs/index.cjs",
30+
"module": "./lib/esm/index.mjs",
31+
"source": "./src/index.ts",
2932
"license": "MIT",
3033
"engines": {
3134
"node": ">= 14.15.0"
@@ -40,8 +43,8 @@
4043
],
4144
"scripts": {
4245
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
43-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
44-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
46+
"prepublishOnly": "yarn build",
47+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4548
},
4649
"dependencies": {
4750
"@algorithm.ts/queue": "^3.0.0-alpha.3",

Diff for: packages/dlx/package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
],
2121
"type": "module",
2222
"exports": {
23-
"import": "./lib/esm/index.mjs",
24-
"require": "./lib/cjs/index.cjs"
23+
"types": "./lib/types/index.d.ts",
24+
"require": "./lib/cjs/index.cjs",
25+
"import": "./lib/esm/index.mjs"
2526
},
26-
"types": "lib/types/index.d.ts",
27-
"source": "src/index.ts",
27+
"types": "./lib/types/index.d.ts",
28+
"main": "./lib/cjs/index.cjs",
29+
"module": "./lib/esm/index.mjs",
30+
"source": "./src/index.ts",
2831
"license": "MIT",
2932
"engines": {
3033
"node": ">= 14.15.0"
@@ -39,8 +42,8 @@
3942
],
4043
"scripts": {
4144
"build": "rimraf lib/ && cross-env NODE_ENV=production rollup -c ../../rollup.config.mjs",
42-
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
43-
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
45+
"prepublishOnly": "yarn build",
46+
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
4447
},
4548
"devDependencies": {
4649
"cross-env": "^7.0.3",

0 commit comments

Comments
 (0)