-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from shelfio/feature/INT-11-migrate-to-esm
INT-11 [BREAKING CHANGES] Migrate to ESM, update supported Node.js to v18
- Loading branch information
Showing
10 changed files
with
67 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const ES_PACKAGES_TO_TRANSFORM = []; | ||
|
||
/** @type {import('jest').Config} */ | ||
const config = { | ||
collectCoverageFrom: ['src/**/*.ts', '!src/**/schema.ts', '!src/**/types.ts'], | ||
reporters: ['default', 'jest-junit'], | ||
transform: { | ||
'^.+\\.(t|j)sx?$': [ | ||
'@swc/jest', | ||
{ | ||
jsc: { | ||
parser: { | ||
syntax: 'typescript', | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
resolver: 'ts-jest-resolver', | ||
transformIgnorePatterns: [ | ||
`node_modules/(?!(${ES_PACKAGES_TO_TRANSFORM.join('|')}))/node_modules/.+\\.js`, | ||
], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,17 @@ | |
"email": "[email protected]", | ||
"url": "https://shelf.io" | ||
}, | ||
"main": "lib", | ||
"sideEffects": false, | ||
"type": "module", | ||
"exports": "./lib/index.js", | ||
"module": "./lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"scripts": { | ||
"benchmark": "babel benchmark.ts | node", | ||
"build": "rm -rf lib/ && yarn build:types && yarn build:code", | ||
"build:code": "babel src --out-dir lib --ignore '**/*.test.ts' --extensions '.ts' && find ./lib -name '*.test.d.ts' -delete", | ||
"build:types": "tsc --emitDeclarationOnly --declaration --isolatedModules false --declarationDir lib", | ||
"benchmark": "tsx benchmark.ts", | ||
"build": "rm -rf lib/ && tsc", | ||
"coverage": "yarn test --coverage", | ||
"lint": "yarn lint:ci --fix", | ||
"lint:ci": "eslint . --ext .js,.ts,.json", | ||
|
@@ -34,18 +35,14 @@ | |
"eslint --fix" | ||
] | ||
}, | ||
"babel": { | ||
"extends": "@shelf/babel-config/backend" | ||
}, | ||
"prettier": "@shelf/prettier-config", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/cli": "7.24.1", | ||
"@babel/core": "7.24.3", | ||
"@shelf/babel-config": "3.0.0", | ||
"@shelf/eslint-config": "3.15.1", | ||
"@shelf/prettier-config": "1.0.0", | ||
"@shelf/tsconfig": "0.1.0", | ||
"@swc/core": "1.4.11", | ||
"@swc/jest": "0.2.36", | ||
"@types/jest": "29.5.12", | ||
"@types/node": "16", | ||
"@types/uslug": "1.0.4", | ||
|
@@ -54,13 +51,16 @@ | |
"fast-lorem-ipsum": "1.2.0", | ||
"husky": "9.0.11", | ||
"jest": "29.7.0", | ||
"jest-junit": "16.0.0", | ||
"lint-staged": "15.2.2", | ||
"prettier": "3.2.5", | ||
"ts-jest-resolver": "2.0.1", | ||
"tsx": "4.7.1", | ||
"typescript": "5.4.3", | ||
"uslug": "1.0.4" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
"node": ">=18" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './LMN'; | ||
export * from './Z'; | ||
export * from './LMN.js'; | ||
export * from './Z.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
{ | ||
"extends": "@shelf/tsconfig/backend", | ||
"compilerOptions": { | ||
"strict": true | ||
"strict": true, | ||
"module": "NodeNext", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"outDir": "lib" | ||
}, | ||
"exclude": ["node_modules"], | ||
"exclude": ["node_modules", "**/*.test.*", "**/mocks.ts"], | ||
"include": ["src"] | ||
} |