Skip to content

Commit 9d5d2cc

Browse files
committed
conf: update to esm
1 parent 0b70a3a commit 9d5d2cc

File tree

4 files changed

+177
-25
lines changed

4 files changed

+177
-25
lines changed

jest.config.js jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
preset: "ts-jest",
33
testEnvironment: "node",
44
verbose: true,

package-lock.json

+151
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"engines": {
77
"node": ">=18"
88
},
9+
"type": "module",
910
"scripts": {
1011
"test:e2e": "jest --testMatch \"**/e2e/**/*.test.ts\" --runInBand",
1112
"test:integration": "jest --testMatch \"**/integration/**/*.test.ts\" --runInBand",
@@ -63,6 +64,7 @@
6364
"rimraf": "^5.0.5",
6465
"semantic-release": "^22.0.12",
6566
"ts-jest": "^29.1.2",
67+
"ts-node": "^10.9.2",
6668
"typescript": "^5.5.4"
6769
},
6870
"dependencies": {

tsconfig.json

+23-24
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
23
"compilerOptions": {
34
/* Visit https://aka.ms/tsconfig to read more about this file */
4-
55
/* Projects */
66
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
77
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
88
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
99
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
1010
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
1111
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12-
1312
/* Language and Environment */
14-
"target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15-
"lib": ["ES2023"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
13+
"target": "ES2023", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
14+
"lib": [
15+
"ES2023"
16+
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
1617
// "jsx": "preserve", /* Specify what JSX code is generated. */
1718
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
1819
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
@@ -23,33 +24,31 @@
2324
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
2425
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
2526
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26-
2727
/* Modules */
28-
"module": "commonjs", /* Specify what module code is generated. */
28+
"module": "commonjs", /* Specify what module code is generated. */
2929
// "rootDir": "./", /* Specify the root folder within your source files. */
3030
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
3131
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
3232
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
3333
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34-
"typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */
35-
"./src/types", "./node_modules/@types"
36-
],
34+
"typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */
35+
"./src/types",
36+
"./node_modules/@types"
37+
],
3738
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
3839
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
3940
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
4041
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
4142
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
4243
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
4344
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
44-
"resolveJsonModule": false, /* Enable importing .json files. */
45+
"resolveJsonModule": false, /* Enable importing .json files. */
4546
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
4647
// "noResolve": true, /* Disallow 'imports, 'requires or '<reference>s from expanding the number of files TypeScript should add to a project. */
47-
4848
/* JavaScript Support */
4949
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
5050
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
5151
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
52-
5352
/* Emit */
5453
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
5554
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
@@ -59,7 +58,7 @@
5958
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
6059
// "outDir": "./lib", /* Specify an output folder for all emitted files. */
6160
// "removeComments": true, /* Disable emitting comments. */
62-
"noEmit": true, /* Disable emitting files from a compilation. */
61+
"noEmit": true, /* Disable emitting files from a compilation. */
6362
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
6463
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
6564
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
@@ -74,17 +73,15 @@
7473
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
7574
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
7675
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
77-
7876
/* Interop Constraints */
7977
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
8078
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
8179
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
82-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
80+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
8381
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
84-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
85-
82+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
8683
/* Type Checking */
87-
"strict": true, /* Enable all strict type-checking options. */
84+
"strict": true, /* Enable all strict type-checking options. */
8885
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
8986
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
9087
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
@@ -95,21 +92,23 @@
9592
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
9693
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
9794
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
98-
"exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
95+
"exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
9996
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
10097
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
101-
"noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
98+
"noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
10299
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
103100
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
104101
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
105102
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
106-
107103
/* Completeness */
108104
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
109-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
105+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
110106
},
111107
"include": [
112108
"./src/**/*",
113109
"./test/**/*"
114-
]
115-
}
110+
],
111+
"ts-node": {
112+
"esm": true
113+
}
114+
}

0 commit comments

Comments
 (0)