-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📦 NEW: Support esm and cjs exports
closes #5
- Loading branch information
Showing
18 changed files
with
117 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "eslint-config-egg/typescript", | ||
"parserOptions": { | ||
// recommend to use another config file like tsconfig.eslint.json and extends tsconfig.json in it. | ||
// because you may be need to lint test/**/*.test.ts but no need to emit to js. | ||
// @see https://github.com/typescript-eslint/typescript-eslint/issues/890 | ||
"project": "./tsconfig.json" | ||
}, | ||
"ignorePatterns": [ | ||
"src/**/*.js", | ||
"src/esm", | ||
"src/cjs" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ coverage/ | |
dist/ | ||
node_modules/ | ||
.idea | ||
proto | ||
proto/ | ||
.fleet | ||
.DS_Store | ||
logs/ |
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,19 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Current Test File", | ||
"autoAttachChildProcesses": true, | ||
"skipFiles": ["<node_internals>/**", "**/node_modules/**"], | ||
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs", | ||
"args": ["run", "${relativeFile}"], | ||
"smartStep": true, | ||
"console": "integratedTerminal" | ||
} | ||
] | ||
} |
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
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
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,11 +1,36 @@ | ||
{ | ||
"extends": "@eggjs/tsconfig", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"module": "CommonJS", | ||
"moduleResolution": "Node" | ||
"useUnknownInCatchVariables": true, | ||
"allowSyntheticDefaultImports": true, | ||
"declaration": true, | ||
"downlevelIteration": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"importHelpers": true, | ||
"module": "NodeNext", | ||
"moduleResolution": "Node", | ||
"newLine": "LF", | ||
"checkJs": false, | ||
"allowJs": true, | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"suppressImplicitAnyIndexErrors": true, | ||
"suppressExcessPropertyErrors": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"target": "ES2018", | ||
"sourceMap": true, | ||
"esModuleInterop": true, | ||
"stripInternal": true, | ||
"lib": [ | ||
"ESNext" | ||
], | ||
"composite": true, | ||
"types": [ | ||
"node" | ||
], | ||
"rootDir": "src" | ||
}, | ||
"include": [ "src" ], | ||
"exclude": ["node_modules", "**/test/*"] | ||
"include": [ | ||
"src/**/*.ts" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
import { defineConfig } from 'vitest/config'; | ||
|
||
export default defineConfig({ | ||
test: { | ||
include: [ | ||
'test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}', | ||
], | ||
testTimeout: 5000, | ||
}, | ||
}); |