Skip to content

Commit d5402ad

Browse files
committed
feat: migrate to esm
1 parent f314c1d commit d5402ad

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module.exports = {
1+
export default {
22
extends: ["@commitlint/config-conventional"],
33
}

jest.config.js renamed to jest.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
testMatch: ["**/*.test.ts"],
33
transform: {
44
"^.+\\.tsx?$": "ts-jest",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@capraconsulting/webapp-deploy-lambda",
33
"version": "0.0.0-development",
44
"description": "CDK construct for deploying a webapp release to S3 and CloudFront",
5+
"type": "module",
56
"repository": {
67
"type": "git",
78
"url": "https://github.com/capralifecycle/webapp-deploy-lambda"
@@ -58,7 +59,7 @@
5859
"prettier": "3.4.2",
5960
"semantic-release": "24.2.0",
6061
"ts-jest": "29.2.5",
61-
"ts-node": "10.9.2",
62+
"tsx": "4.19.2",
6263
"typescript": "5.7.2"
6364
},
6465
"peerDependencies": {

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
export { ISource, Source, SourceConfig } from "./source"
2-
export { WebappDeploy, WebappDeployProps } from "./webapp-deploy"
1+
export { Source } from "./source"
2+
export type { ISource, SourceConfig } from "./source"
3+
export { WebappDeploy } from "./webapp-deploy"
4+
export type { WebappDeployProps } from "./webapp-deploy"

tsconfig.base.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"compilerOptions": {
33
"outDir": "./lib",
44
"declaration": true,
5-
"target": "ES2018",
6-
"module": "commonjs",
5+
"target": "es2022",
76
"strict": true,
87
"inlineSourceMap": true,
98
"inlineSources": true,
10-
"strictPropertyInitialization": false
9+
10+
"module": "preserve"
1111
}
1212
}

tsconfig.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
{
22
"extends": "./tsconfig.base.json",
3-
"include": ["src"],
4-
"exclude": ["src/**/*.test.ts"]
3+
"compilerOptions": {
4+
"esModuleInterop": true,
5+
"skipLibCheck": true,
6+
"allowJs": true,
7+
"resolveJsonModule": true,
8+
"moduleDetection": "force",
9+
"isolatedModules": true,
10+
"noEmit": true,
11+
"verbatimModuleSyntax": false,
12+
13+
"lib": [
14+
"es2022"
15+
]
16+
},
17+
"include": [
18+
"src"
19+
],
20+
"exclude": [
21+
"src/**/*.test.ts"
22+
]
523
}

0 commit comments

Comments
 (0)