diff --git a/package-lock.json b/package-lock.json index e3690f1..75c5ae2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8693,7 +8693,6 @@ "tiny-invariant": "^1.3.1" }, "devDependencies": { - "@types/node": "^20.11.4", "ts-node": "^10.9.2", "typescript": "^5.3.3" } diff --git a/packages/cdk/cdk.json b/packages/cdk/cdk.json index d174ae5..38a0ef6 100644 --- a/packages/cdk/cdk.json +++ b/packages/cdk/cdk.json @@ -1,3 +1,3 @@ { - "app": "npx ts-node --prefer-ts-exts src/index.ts" + "app": "node --no-warnings --loader ts-node/esm src/index.ts" } diff --git a/packages/cdk/package.json b/packages/cdk/package.json index a8ed630..fb00bff 100644 --- a/packages/cdk/package.json +++ b/packages/cdk/package.json @@ -1,11 +1,11 @@ { "name": "@hrs-website/cdk", "version": "0.1.0", + "type": "module", "scripts": { "deploy": "cdk deploy" }, "devDependencies": { - "@types/node": "^20.11.4", "ts-node": "^10.9.2", "typescript": "^5.3.3" }, diff --git a/packages/cdk/src/cdk-stack.ts b/packages/cdk/src/cdk-stack.ts index ad98376..bc5337a 100644 --- a/packages/cdk/src/cdk-stack.ts +++ b/packages/cdk/src/cdk-stack.ts @@ -19,7 +19,7 @@ import { Construct } from 'constructs' import { WEBPACK_MANIFEST_FILE_NAME, getDefaultRootObject, -} from './webpack-manifest' +} from './webpack-manifest.js' const DIST_PATH = '../app/dist' diff --git a/packages/cdk/src/index.ts b/packages/cdk/src/index.ts index a90bff9..4961c30 100644 --- a/packages/cdk/src/index.ts +++ b/packages/cdk/src/index.ts @@ -1,7 +1,5 @@ -#!/usr/bin/env node -import 'source-map-support/register' import * as cdk from 'aws-cdk-lib' -import { CdkStack } from './cdk-stack' +import { CdkStack } from './cdk-stack.js' const stage = process.env.STAGE?.toLowerCase() if (!stage) { @@ -17,14 +15,5 @@ function capitalize(str: string) { const app = new cdk.App() new CdkStack(app, `OrgHaitianRelief${capitalize(stage)}`, { - /* If you don't specify 'env', this stack will be environment-agnostic. - * Account/Region-dependent features and context lookups will not work, - * but a single synthesized template can be deployed anywhere. */ - /* Uncomment the next line to specialize this stack for the AWS Account - * and Region that are implied by the current CLI configuration. */ - // env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION }, - /* Uncomment the next line if you know exactly what Account and Region you - * want to deploy the stack to. */ env: { account: '063257577013', region: 'us-east-1' }, - /* For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html */ }) diff --git a/packages/cdk/tsconfig.json b/packages/cdk/tsconfig.json index 2fb5929..e5b2d87 100644 --- a/packages/cdk/tsconfig.json +++ b/packages/cdk/tsconfig.json @@ -1,23 +1,16 @@ { "compilerOptions": { - "target": "ES2018", - "module": "commonjs", - "lib": ["es2018"], - "declaration": true, + "target": "es2022", + "module": "nodenext", + "moduleResolution": "nodenext", + "sourceMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, "strict": true, - "noImplicitAny": true, - "strictNullChecks": true, - "noImplicitThis": true, - "alwaysStrict": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": false, - "inlineSourceMap": true, - "inlineSources": true, - "experimentalDecorators": true, - "strictPropertyInitialization": false, - "typeRoots": ["./node_modules/@types"] + "skipLibCheck": true, + "noUncheckedIndexedAccess": true }, - "exclude": ["node_modules", "cdk.out"] + "ts-node": { + "esm": true + } }