diff --git a/.projenrc.ts b/.projenrc.ts index ceafc7472..51ee210ec 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -125,11 +125,12 @@ const ADDITIONAL_CLI_IGNORE_PATTERNS = [ ]; const defaultTsOptions: NonNullable['compilerOptions'] = { - target: 'ES2020', - module: 'commonjs', - lib: ['es2020'], + module: 'node18', + target: 'es2022', + lib: ['es2022'], incremental: true, - esModuleInterop: false, + esModuleInterop: true, + noEmitOnError: true, skipLibCheck: true, isolatedModules: true, }; @@ -544,14 +545,6 @@ const cloudFormationDiff = configureProject( 'string-width@^4', 'table@^6', ], - // FIXME: this should be a jsii project - // (EDIT: or should it? We're going to bundle it into aws-cdk-lib) - tsconfig: { - compilerOptions: { - ...defaultTsOptions, - }, - }, - jestOptions: jestOptionsForProject({ jestConfig: { coverageThreshold: { @@ -630,11 +623,6 @@ const yarnCling = configureProject( deps: ['@yarnpkg/parsers', 'semver'], devDeps: ['@types/semver', 'fast-check'], minNodeVersion: '20', - tsconfig: { - compilerOptions: { - ...defaultTsOptions, - }, - }, jestOptions: jestOptionsForProject({ jestConfig: { coverageThreshold: { @@ -663,11 +651,6 @@ const yargsGen = configureProject( deps: ['@cdklabs/typewriter', 'prettier@^2.8', 'lodash.clonedeep'], devDeps: ['@types/semver', '@types/yarnpkg__lockfile', '@types/lodash.clonedeep', '@types/prettier@^2'], minNodeVersion: '20', // Necessary for 'structuredClone' - tsconfig: { - compilerOptions: { - ...defaultTsOptions, - }, - }, }), ); @@ -688,11 +671,6 @@ const cliPluginContract = configureProject( ], devDeps: [ ], - tsconfig: { - compilerOptions: { - ...defaultTsOptions, - }, - }, }), ); @@ -760,20 +738,6 @@ const cdkAssetsLib = configureProject( 'aws-sdk-client-mock', 'aws-sdk-client-mock-jest', ], - tsconfigDev: { - compilerOptions: { - ...defaultTsOptions, - }, - include: ['bin/**/*.ts'], - }, - tsconfig: { - compilerOptions: { - ...defaultTsOptions, - rootDir: undefined, - outDir: undefined, - }, - include: ['bin/**/*.ts'], - }, jestOptions: jestOptionsForProject({ jestConfig: { // We have many tests here that commonly time out @@ -897,9 +861,7 @@ const TOOLKIT_LIB_EXCLUDE_PATTERNS = [ const toolkitLibTsCompilerOptions = { ...defaultTsOptions, - target: 'es2022', lib: ['es2022', 'esnext.disposable'], - module: 'NodeNext', declarationMap: true, }; @@ -1011,12 +973,6 @@ const toolkitLib = configureProject( ...toolkitLibTsCompilerOptions, }, }, - tsconfigDev: { - compilerOptions: { - ...toolkitLibTsCompilerOptions, - rootDir: '.', // shouldn't be required but something broke... check again once we have gotten rid of the tmpToolkitHelpers package - }, - }, nextVersionCommand: 'tsx ../../../projenrc/next-version.ts maybeRc', }), ); @@ -1303,25 +1259,10 @@ const cli = configureProject( 'yargs@^15', ], excludeDepsFromUpgrade: ['aws-cdk-lib'], // this is handled separately further down - tsconfig: { - compilerOptions: { - ...defaultTsOptions, - lib: ['es2019', 'es2022.error'], - - // Changes the meaning of 'import' for libraries whose top-level export is a function - // 'aws-cdk' has been written against `false` for interop - esModuleInterop: false, - - // Necessary to properly compile proxy-agent and lru-cache without esModuleInterop set. - skipLibCheck: true, - }, - }, tsconfigDev: { compilerOptions: { ...defaultTsOptions, - lib: ['es2019', 'esnext.disposable', 'es2022.error'], - esModuleInterop: false, - skipLibCheck: true, + lib: ['es2022', 'esnext.disposable'], }, }, eslintOptions: { @@ -1471,11 +1412,6 @@ const cdkAliasPackage = configureProject( nextVersionCommand: `tsx ../../projenrc/next-version.ts copyVersion:../../${cliPackageJson}`, releasableCommits: transitiveToolkitPackages('cdk'), majorVersion: 2, - tsconfig: { - compilerOptions: { - ...defaultTsOptions, - }, - }, }), ); void cdkAliasPackage; @@ -1657,10 +1593,8 @@ const cliInteg = configureProject( tsconfig: { compilerOptions: { ...defaultTsOptions, - esModuleInterop: false, target: 'es2022', lib: ['es2022', 'esnext.disposable', 'dom'], - module: 'NodeNext', }, include: ['**/*.ts'], exclude: ['resources/**/*'], diff --git a/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts b/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts index ba244486e..95508c699 100644 --- a/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import * as assert from 'assert'; +import assert from 'assert'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; diff --git a/packages/@aws-cdk-testing/cli-integ/tsconfig.dev.json b/packages/@aws-cdk-testing/cli-integ/tsconfig.dev.json index 00148df11..83057c577 100644 --- a/packages/@aws-cdk-testing/cli-integ/tsconfig.dev.json +++ b/packages/@aws-cdk-testing/cli-integ/tsconfig.dev.json @@ -3,7 +3,7 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, @@ -12,8 +12,8 @@ "esnext.disposable", "dom" ], - "module": "NodeNext", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, diff --git a/packages/@aws-cdk-testing/cli-integ/tsconfig.json b/packages/@aws-cdk-testing/cli-integ/tsconfig.json index ade9e9865..816d63e35 100644 --- a/packages/@aws-cdk-testing/cli-integ/tsconfig.json +++ b/packages/@aws-cdk-testing/cli-integ/tsconfig.json @@ -5,7 +5,7 @@ "outDir": ".", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, @@ -14,8 +14,8 @@ "esnext.disposable", "dom" ], - "module": "NodeNext", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, diff --git a/packages/@aws-cdk/cdk-assets-lib/test/docker-images.test.ts b/packages/@aws-cdk/cdk-assets-lib/test/docker-images.test.ts index 8c5c26a8e..c6043a4a7 100644 --- a/packages/@aws-cdk/cdk-assets-lib/test/docker-images.test.ts +++ b/packages/@aws-cdk/cdk-assets-lib/test/docker-images.test.ts @@ -2,7 +2,7 @@ jest.mock('child_process'); import 'aws-sdk-client-mock-jest'; -import * as fs from 'fs'; +import fs from 'fs'; import { Manifest } from '@aws-cdk/cloud-assembly-schema'; import type { GetAuthorizationTokenResponse } from '@aws-sdk/client-ecr'; import { diff --git a/packages/@aws-cdk/cdk-assets-lib/tsconfig.dev.json b/packages/@aws-cdk/cdk-assets-lib/tsconfig.dev.json index aaa27a698..a3aa0e627 100644 --- a/packages/@aws-cdk/cdk-assets-lib/tsconfig.dev.json +++ b/packages/@aws-cdk/cdk-assets-lib/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "mime", @@ -39,8 +39,7 @@ }, "include": [ "lib/**/*.ts", - "test/**/*.ts", - "bin/**/*.ts" + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/packages/@aws-cdk/cdk-assets-lib/tsconfig.json b/packages/@aws-cdk/cdk-assets-lib/tsconfig.json index 64a60c435..9768013de 100644 --- a/packages/@aws-cdk/cdk-assets-lib/tsconfig.json +++ b/packages/@aws-cdk/cdk-assets-lib/tsconfig.json @@ -1,17 +1,19 @@ // ~~ Generated by projen. To modify, edit .projenrc.js and run "yarn projen". { "compilerOptions": { + "rootDir": "lib", + "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "mime", @@ -37,8 +39,7 @@ "composite": true }, "include": [ - "lib/**/*.ts", - "bin/**/*.ts" + "lib/**/*.ts" ], "exclude": [], "references": [ diff --git a/packages/@aws-cdk/cdk-build-tools/lib/os.ts b/packages/@aws-cdk/cdk-build-tools/lib/os.ts index 3218e3c04..f91799d3a 100644 --- a/packages/@aws-cdk/cdk-build-tools/lib/os.ts +++ b/packages/@aws-cdk/cdk-build-tools/lib/os.ts @@ -1,7 +1,7 @@ import * as child_process from 'child_process'; import * as fs from 'fs'; import * as util from 'util'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { Timers } from './timer'; interface ShellOptions { diff --git a/packages/@aws-cdk/cli-plugin-contract/tsconfig.dev.json b/packages/@aws-cdk/cli-plugin-contract/tsconfig.dev.json index 1f6ea3b46..808fab74d 100644 --- a/packages/@aws-cdk/cli-plugin-contract/tsconfig.dev.json +++ b/packages/@aws-cdk/cli-plugin-contract/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node" diff --git a/packages/@aws-cdk/cli-plugin-contract/tsconfig.json b/packages/@aws-cdk/cli-plugin-contract/tsconfig.json index 771ed2df4..a59ff46d3 100644 --- a/packages/@aws-cdk/cli-plugin-contract/tsconfig.json +++ b/packages/@aws-cdk/cli-plugin-contract/tsconfig.json @@ -5,15 +5,15 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -25,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node" diff --git a/packages/@aws-cdk/cloud-assembly-api/tsconfig.dev.json b/packages/@aws-cdk/cloud-assembly-api/tsconfig.dev.json index 1b8394ff5..1777cae2a 100644 --- a/packages/@aws-cdk/cloud-assembly-api/tsconfig.dev.json +++ b/packages/@aws-cdk/cloud-assembly-api/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node" diff --git a/packages/@aws-cdk/cloud-assembly-api/tsconfig.json b/packages/@aws-cdk/cloud-assembly-api/tsconfig.json index 4aed4a213..eece7e831 100644 --- a/packages/@aws-cdk/cloud-assembly-api/tsconfig.json +++ b/packages/@aws-cdk/cloud-assembly-api/tsconfig.json @@ -5,15 +5,15 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -25,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node" diff --git a/packages/@aws-cdk/cloud-assembly-schema/tsconfig.dev.json b/packages/@aws-cdk/cloud-assembly-schema/tsconfig.dev.json index 604127520..dcc2245c7 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/tsconfig.dev.json +++ b/packages/@aws-cdk/cloud-assembly-schema/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node", diff --git a/packages/@aws-cdk/cloudformation-diff/lib/format-foreach.ts b/packages/@aws-cdk/cloudformation-diff/lib/format-foreach.ts index 687f0b36e..1a5bd4e07 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/format-foreach.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/format-foreach.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { deepEqual } from './diff/util'; const ADDITION = chalk.green('[+]'); diff --git a/packages/@aws-cdk/cloudformation-diff/lib/format-table.ts b/packages/@aws-cdk/cloudformation-diff/lib/format-table.ts index f73612921..2c83710ac 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/format-table.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/format-table.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import stringWidth from 'string-width'; import * as table from 'table'; diff --git a/packages/@aws-cdk/cloudformation-diff/lib/format.ts b/packages/@aws-cdk/cloudformation-diff/lib/format.ts index 9a2cd88ab..6ecaf25ed 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/format.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/format.ts @@ -1,5 +1,5 @@ import { format } from 'util'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { DifferenceCollection, Move, TemplateDiff } from './diff/types'; import { deepEqual } from './diff/util'; import type { Difference, ResourceDifference } from './diff-template'; diff --git a/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts b/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts index a5294764b..82e354869 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts @@ -1,5 +1,5 @@ import { PropertyScrutinyType, ResourceScrutinyType } from '@aws-cdk/service-spec-types'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { ISsoInstanceACAConfig, ISsoPermissionSet } from './iam-identity-center'; import { SsoAssignment, SsoInstanceACAConfig, SsoPermissionSet } from './iam-identity-center'; import type { ManagedPolicyJson } from './managed-policy'; diff --git a/packages/@aws-cdk/cloudformation-diff/lib/mappings.ts b/packages/@aws-cdk/cloudformation-diff/lib/mappings.ts index 296906a07..4b4349c7d 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/mappings.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/mappings.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { Formatter } from './format'; import { formatTable } from './format-table'; diff --git a/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.ts b/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.ts index ecde87a27..71a43f27c 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { RuleJson } from './security-group-rule'; import { SecurityGroupRule } from './security-group-rule'; import type { PropertyChange, ResourceChange } from '../diff/types'; diff --git a/packages/@aws-cdk/cloudformation-diff/test/format.test.ts b/packages/@aws-cdk/cloudformation-diff/test/format.test.ts index 6c6a8c30a..d63884b2f 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/format.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/format.test.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { Formatter } from '../lib'; const formatter = new Formatter(process.stdout, {}); diff --git a/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts b/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts index 9765e9781..dc42a9ba5 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { fullDiff } from '../../lib'; import type { MaybeParsed } from '../../lib/diff/maybe-parsed'; import type { IamChangesJson } from '../../lib/iam/iam-changes'; diff --git a/packages/@aws-cdk/cloudformation-diff/tsconfig.dev.json b/packages/@aws-cdk/cloudformation-diff/tsconfig.dev.json index 1f6ea3b46..808fab74d 100644 --- a/packages/@aws-cdk/cloudformation-diff/tsconfig.dev.json +++ b/packages/@aws-cdk/cloudformation-diff/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node" diff --git a/packages/@aws-cdk/cloudformation-diff/tsconfig.json b/packages/@aws-cdk/cloudformation-diff/tsconfig.json index 771ed2df4..a59ff46d3 100644 --- a/packages/@aws-cdk/cloudformation-diff/tsconfig.json +++ b/packages/@aws-cdk/cloudformation-diff/tsconfig.json @@ -5,15 +5,15 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -25,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node" diff --git a/packages/@aws-cdk/integ-runner/lib/cli.ts b/packages/@aws-cdk/integ-runner/lib/cli.ts index 696edb1dc..5c794d7ad 100644 --- a/packages/@aws-cdk/integ-runner/lib/cli.ts +++ b/packages/@aws-cdk/integ-runner/lib/cli.ts @@ -1,7 +1,7 @@ // Exercise all integ stacks and if they deploy, update the expected synth files import * as fs from 'fs'; import * as path from 'path'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as workerpool from 'workerpool'; import * as logger from './logger'; import type { IntegTest, IntegTestInfo } from './runner/integration-tests'; diff --git a/packages/@aws-cdk/integ-runner/lib/engines/toolkit-lib.ts b/packages/@aws-cdk/integ-runner/lib/engines/toolkit-lib.ts index 4262d220f..a880fe2f0 100644 --- a/packages/@aws-cdk/integ-runner/lib/engines/toolkit-lib.ts +++ b/packages/@aws-cdk/integ-runner/lib/engines/toolkit-lib.ts @@ -3,7 +3,7 @@ import { UNKNOWN_REGION } from '@aws-cdk/cloud-assembly-api'; import type { DefaultCdkOptions } from '@aws-cdk/cloud-assembly-schema/lib/integ-tests'; import type { ICloudAssemblySource, IIoHost, IoMessage, IoRequest, IReadableCloudAssembly, NonInteractiveIoHostProps, StackSelector } from '@aws-cdk/toolkit-lib'; import { BaseCredentials, ExpandStackSelection, MemoryContext, NonInteractiveIoHost, StackSelectionStrategy, Toolkit } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import type { CdkDeployResult, CxOptions, DeployOptions, DestroyOptions, ICdk, ListOptions, SynthOptions, WatchEvents, WatchOptions } from './cdk-interface'; import { ProxyAgentProvider } from './proxy-agent'; diff --git a/packages/@aws-cdk/integ-runner/lib/logger.ts b/packages/@aws-cdk/integ-runner/lib/logger.ts index 75e7a7b29..1ebeddd35 100644 --- a/packages/@aws-cdk/integ-runner/lib/logger.ts +++ b/packages/@aws-cdk/integ-runner/lib/logger.ts @@ -1,6 +1,6 @@ import type { Writable } from 'stream'; import * as util from 'util'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; type StyleFn = (str: string) => string; const { stderr } = process; diff --git a/packages/@aws-cdk/integ-runner/lib/workers/common.ts b/packages/@aws-cdk/integ-runner/lib/workers/common.ts index c3b307555..5cb2f1933 100644 --- a/packages/@aws-cdk/integ-runner/lib/workers/common.ts +++ b/packages/@aws-cdk/integ-runner/lib/workers/common.ts @@ -1,6 +1,6 @@ import { format } from 'util'; import type { ResourceImpact } from '@aws-cdk/cloudformation-diff'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as logger from '../logger'; import type { IntegTestInfo } from '../runner/integration-tests'; diff --git a/packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts b/packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts index cf6b64f7d..848b3ee9d 100644 --- a/packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts +++ b/packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts @@ -1,8 +1,8 @@ -import * as child_process from 'child_process'; -import * as builtinFs from 'fs'; +import child_process from 'child_process'; +import builtinFs from 'fs'; import { AVAILABILITY_ZONE_FALLBACK_CONTEXT_KEY } from '@aws-cdk/cloud-assembly-api'; import { Manifest } from '@aws-cdk/cloud-assembly-schema'; -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import { IntegTestRunner, IntegTest } from '../../lib/runner'; import { MockCdkProvider } from '../helpers'; diff --git a/packages/@aws-cdk/integ-runner/test/runner/integ-test-suite.test.ts b/packages/@aws-cdk/integ-runner/test/runner/integ-test-suite.test.ts index 144661d92..963104503 100644 --- a/packages/@aws-cdk/integ-runner/test/runner/integ-test-suite.test.ts +++ b/packages/@aws-cdk/integ-runner/test/runner/integ-test-suite.test.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import * as mockfs from 'mock-fs'; +import mockfs from 'mock-fs'; import { IntegTestSuite, LegacyIntegTestSuite } from '../../lib/runner/integ-test-suite'; import type { MockCdkMocks } from '../helpers'; import { MockCdkProvider } from '../helpers'; diff --git a/packages/@aws-cdk/integ-runner/test/runner/integration-tests.test.ts b/packages/@aws-cdk/integ-runner/test/runner/integration-tests.test.ts index 48518e51d..5d412c091 100644 --- a/packages/@aws-cdk/integ-runner/test/runner/integration-tests.test.ts +++ b/packages/@aws-cdk/integ-runner/test/runner/integration-tests.test.ts @@ -1,4 +1,4 @@ -import * as mockfs from 'mock-fs'; +import mockfs from 'mock-fs'; import { IntegrationTests } from '../../lib/runner/integration-tests'; describe('IntegrationTests Discovery', () => { diff --git a/packages/@aws-cdk/integ-runner/test/runner/private/cloud-assembly.test.ts b/packages/@aws-cdk/integ-runner/test/runner/private/cloud-assembly.test.ts index cb2cee84b..9941e0d36 100644 --- a/packages/@aws-cdk/integ-runner/test/runner/private/cloud-assembly.test.ts +++ b/packages/@aws-cdk/integ-runner/test/runner/private/cloud-assembly.test.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import { Manifest } from '@aws-cdk/cloud-assembly-schema'; -import * as mockfs from 'mock-fs'; +import mockfs from 'mock-fs'; import { AssemblyManifestReader } from '../../../lib/runner/private/cloud-assembly'; describe('cloud assembly manifest reader', () => { diff --git a/packages/@aws-cdk/integ-runner/test/runner/private/integ-manifest.test.ts b/packages/@aws-cdk/integ-runner/test/runner/private/integ-manifest.test.ts index 8dffa0bb6..50a000cc7 100644 --- a/packages/@aws-cdk/integ-runner/test/runner/private/integ-manifest.test.ts +++ b/packages/@aws-cdk/integ-runner/test/runner/private/integ-manifest.test.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import * as mockfs from 'mock-fs'; +import mockfs from 'mock-fs'; import { IntegManifestReader } from '../../../lib/runner/private/integ-manifest'; describe('Integ manifest reader', () => { diff --git a/packages/@aws-cdk/integ-runner/test/runner/snapshot-test-runner.test.ts b/packages/@aws-cdk/integ-runner/test/runner/snapshot-test-runner.test.ts index d00b19ebb..11e76d9e5 100644 --- a/packages/@aws-cdk/integ-runner/test/runner/snapshot-test-runner.test.ts +++ b/packages/@aws-cdk/integ-runner/test/runner/snapshot-test-runner.test.ts @@ -1,7 +1,7 @@ -import * as child_process from 'child_process'; -import * as builtinFs from 'fs'; +import child_process from 'child_process'; +import builtinFs from 'fs'; import * as path from 'path'; -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import { IntegSnapshotRunner, IntegTest } from '../../lib/runner'; import { DiagnosticReason } from '../../lib/workers/common'; import { MockCdkProvider } from '../helpers'; diff --git a/packages/@aws-cdk/integ-runner/test/utils.test.ts b/packages/@aws-cdk/integ-runner/test/utils.test.ts index 54715aa6d..509e67ce3 100644 --- a/packages/@aws-cdk/integ-runner/test/utils.test.ts +++ b/packages/@aws-cdk/integ-runner/test/utils.test.ts @@ -1,4 +1,4 @@ -import * as child_process from 'child_process'; +import child_process from 'child_process'; import { execWithSubShell, renderCommand } from '../lib/utils'; jest.mock('child_process'); diff --git a/packages/@aws-cdk/integ-runner/test/workers/integ-worker.test.ts b/packages/@aws-cdk/integ-runner/test/workers/integ-worker.test.ts index f9d795187..a0ec1b16f 100644 --- a/packages/@aws-cdk/integ-runner/test/workers/integ-worker.test.ts +++ b/packages/@aws-cdk/integ-runner/test/workers/integ-worker.test.ts @@ -1,6 +1,6 @@ -import * as builtinFs from 'fs'; +import builtinFs from 'fs'; import * as path from 'path'; -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import * as workerpool from 'workerpool'; import { IntegTestRunner } from '../../lib/runner'; import { integTestWorker } from '../../lib/workers/extract'; diff --git a/packages/@aws-cdk/integ-runner/test/workers/snapshot-worker.test.ts b/packages/@aws-cdk/integ-runner/test/workers/snapshot-worker.test.ts index 13878ffe8..7cc2d8c59 100644 --- a/packages/@aws-cdk/integ-runner/test/workers/snapshot-worker.test.ts +++ b/packages/@aws-cdk/integ-runner/test/workers/snapshot-worker.test.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import { snapshotTestWorker } from '../../lib/workers/extract'; jest.setTimeout(20_000); diff --git a/packages/@aws-cdk/integ-runner/tsconfig.dev.json b/packages/@aws-cdk/integ-runner/tsconfig.dev.json index 00905615e..626d93bd4 100644 --- a/packages/@aws-cdk/integ-runner/tsconfig.dev.json +++ b/packages/@aws-cdk/integ-runner/tsconfig.dev.json @@ -3,7 +3,7 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, @@ -11,8 +11,8 @@ "es2022", "esnext.disposable" ], - "module": "NodeNext", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, diff --git a/packages/@aws-cdk/integ-runner/tsconfig.json b/packages/@aws-cdk/integ-runner/tsconfig.json index 2e75ddae0..e40137288 100644 --- a/packages/@aws-cdk/integ-runner/tsconfig.json +++ b/packages/@aws-cdk/integ-runner/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, @@ -13,8 +13,8 @@ "es2022", "esnext.disposable" ], - "module": "NodeNext", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, diff --git a/packages/@aws-cdk/private-tools/tsconfig.dev.json b/packages/@aws-cdk/private-tools/tsconfig.dev.json index 63ef1e175..05d292f62 100644 --- a/packages/@aws-cdk/private-tools/tsconfig.dev.json +++ b/packages/@aws-cdk/private-tools/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node", diff --git a/packages/@aws-cdk/private-tools/tsconfig.json b/packages/@aws-cdk/private-tools/tsconfig.json index b801c14c6..5cfd95d42 100644 --- a/packages/@aws-cdk/private-tools/tsconfig.json +++ b/packages/@aws-cdk/private-tools/tsconfig.json @@ -5,15 +5,15 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -25,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node", diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/stack-assembly.ts b/packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/stack-assembly.ts index 13b47858f..e92fac7ac 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/stack-assembly.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/stack-assembly.ts @@ -1,5 +1,5 @@ import type * as cxapi from '@aws-cdk/cloud-assembly-api'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { isMatch as picomatch } from 'picomatch'; import { StackCollection } from './stack-collection'; import { flatten } from '../../util'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/cloudformation/template-body-parameter.ts b/packages/@aws-cdk/toolkit-lib/lib/api/cloudformation/template-body-parameter.ts index 5e09f016b..a9e108677 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/cloudformation/template-body-parameter.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/cloudformation/template-body-parameter.ts @@ -4,7 +4,7 @@ import * as util from 'node:util'; import { type CloudFormationStackArtifact, type Environment, EnvironmentPlaceholders } from '@aws-cdk/cloud-assembly-api'; import { HeadObjectCommand, S3Client } from '@aws-sdk/client-s3'; import { getEndpointFromInstructions } from '@smithy/middleware-endpoint'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { ToolkitError } from '../../toolkit/toolkit-error'; import { contentHash, toYAML } from '../../util'; import type { AssetManifestBuilder } from '../deployments'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/deployments/assets.ts b/packages/@aws-cdk/toolkit-lib/lib/api/deployments/assets.ts index d300dd341..989fbd5ac 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/deployments/assets.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/deployments/assets.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import * as cxapi from '@aws-cdk/cloud-assembly-api'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { AssetManifestBuilder } from './asset-manifest-builder'; import { ToolkitError } from '../../toolkit/toolkit-error'; import type { EnvironmentResources } from '../environment'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack.ts b/packages/@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack.ts index e52587d27..3f7e4f67d 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack.ts @@ -9,7 +9,7 @@ import type { UpdateStackCommandInput, Tag, } from '@aws-sdk/client-cloudformation'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { AssetManifestBuilder } from './asset-manifest-builder'; import { publishAssets } from './asset-publishing'; import { addMetadataAssetsToManifest } from './assets'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/deployments/deployments.ts b/packages/@aws-cdk/toolkit-lib/lib/api/deployments/deployments.ts index a3042ea83..ddd78e705 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/deployments/deployments.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/deployments/deployments.ts @@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto'; import * as cdk_assets from '@aws-cdk/cdk-assets-lib'; import type * as cxapi from '@aws-cdk/cloud-assembly-api'; import type { DescribeChangeSetCommandOutput } from '@aws-sdk/client-cloudformation'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { AssetManifestBuilder } from './asset-manifest-builder'; import { BasePublishProgressListener, diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/diff/diff-formatter.ts b/packages/@aws-cdk/toolkit-lib/lib/api/diff/diff-formatter.ts index 24912a9df..b60ebd5b6 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/diff/diff-formatter.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/diff/diff-formatter.ts @@ -9,7 +9,7 @@ import { type ResourceDifference, type TemplateDiff, } from '@aws-cdk/cloudformation-diff'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { PermissionChangeType } from '../../payloads'; import type { NestedStackTemplates, Template } from '../cloudformation'; import { buildLogicalToPathMap } from '../cloudformation/logical-id-map'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/drift/drift-formatter.ts b/packages/@aws-cdk/toolkit-lib/lib/api/drift/drift-formatter.ts index ffd7f2892..c6d222e93 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/drift/drift-formatter.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/drift/drift-formatter.ts @@ -3,7 +3,7 @@ import type * as cxapi from '@aws-cdk/cloud-assembly-api'; import { Difference } from '@aws-cdk/cloudformation-diff'; import type { StackResourceDrift } from '@aws-sdk/client-cloudformation'; import { StackResourceDriftStatus } from '@aws-sdk/client-cloudformation'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { FormattedDrift } from '../../actions/drift'; import { buildLogicalToPathMap } from '../cloudformation/logical-id-map'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/garbage-collection/garbage-collector.ts b/packages/@aws-cdk/toolkit-lib/lib/api/garbage-collection/garbage-collector.ts index fa3b7e129..1e64e56ff 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/garbage-collection/garbage-collector.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/garbage-collection/garbage-collector.ts @@ -1,7 +1,7 @@ import type * as cxapi from '@aws-cdk/cloud-assembly-api'; import type { ImageIdentifier } from '@aws-sdk/client-ecr'; import type { Tag } from '@aws-sdk/client-s3'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { IECRClient, IS3Client, SDK, SdkProvider } from '../aws-auth/private'; import { DEFAULT_TOOLKIT_STACK_NAME, ToolkitInfo } from '../toolkit-info'; import { ProgressPrinter } from './progress-printer'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/garbage-collection/progress-printer.ts b/packages/@aws-cdk/toolkit-lib/lib/api/garbage-collection/progress-printer.ts index 94da6e8c5..f66448e1f 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/garbage-collection/progress-printer.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/garbage-collection/progress-printer.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { GcAsset as GCAsset } from './garbage-collector'; import { ToolkitError } from '../../toolkit/toolkit-error'; import type { IoHelper } from '../io/private'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/hotswap/hotswap-deployments.ts b/packages/@aws-cdk/toolkit-lib/lib/api/hotswap/hotswap-deployments.ts index f9650bcbd..42fe421e7 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/hotswap/hotswap-deployments.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/hotswap/hotswap-deployments.ts @@ -2,7 +2,7 @@ import { format } from 'util'; import type * as cxapi from '@aws-cdk/cloud-assembly-api'; import * as cfn_diff from '@aws-cdk/cloudformation-diff'; import type { WaiterResult } from '@smithy/util-waiter'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { NonHotswappableReason } from '../../payloads'; import { formatErrorMessage } from '../../util'; import type { SDK, SdkProvider } from '../aws-auth/private'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/logs-monitor/logs-monitor.ts b/packages/@aws-cdk/toolkit-lib/lib/api/logs-monitor/logs-monitor.ts index d01efe37c..7d5f06666 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/logs-monitor/logs-monitor.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/logs-monitor/logs-monitor.ts @@ -1,7 +1,7 @@ import { randomUUID } from 'node:crypto'; import * as util from 'node:util'; import type * as cxapi from '@aws-cdk/cloud-assembly-api'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { CloudWatchLogEvent } from '../../payloads/logs-monitor'; import { flatten } from '../../util'; import type { SDK } from '../aws-auth/private'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/refactoring/stack-definitions.ts b/packages/@aws-cdk/toolkit-lib/lib/api/refactoring/stack-definitions.ts index 715674a48..7d837e2ae 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/refactoring/stack-definitions.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/refactoring/stack-definitions.ts @@ -1,7 +1,7 @@ import * as util from 'node:util'; import type { Environment } from '@aws-cdk/cx-api'; import type { StackDefinition } from '@aws-sdk/client-cloudformation'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { CloudFormationStack, ResourceMapping } from './cloudformation'; import { ToolkitError } from '../../toolkit/toolkit-error'; import { contentHash } from '../../util'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/resource-import/importer.ts b/packages/@aws-cdk/toolkit-lib/lib/api/resource-import/importer.ts index 95e528744..86810d34e 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/resource-import/importer.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/resource-import/importer.ts @@ -3,7 +3,7 @@ import type * as cxapi from '@aws-cdk/cloud-assembly-api'; import * as cfnDiff from '@aws-cdk/cloudformation-diff'; import type { ResourceDifference } from '@aws-cdk/cloudformation-diff'; import type { ResourceIdentifierSummary, ResourceToImport } from '@aws-sdk/client-cloudformation'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import type { DeploymentMethod } from '../../actions/deploy'; import { ToolkitError } from '../../toolkit/toolkit-error'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/resource-import/migrator.ts b/packages/@aws-cdk/toolkit-lib/lib/api/resource-import/migrator.ts index 2f67dc3fd..347419637 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/resource-import/migrator.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/resource-import/migrator.ts @@ -1,5 +1,5 @@ import type * as cxapi from '@aws-cdk/cloud-assembly-api'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import type { ImportDeploymentOptions, ResourcesToImport } from './importer'; import { ResourceImporter } from './importer'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/toolkit-info.ts b/packages/@aws-cdk/toolkit-lib/lib/api/toolkit-info.ts index 47e634ed3..0ca87bb83 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/toolkit-info.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/toolkit-info.ts @@ -1,6 +1,6 @@ import { format } from 'util'; import type * as cxapi from '@aws-cdk/cloud-assembly-api'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { SDK } from './aws-auth/private'; import { BOOTSTRAP_VARIANT_PARAMETER, diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/validate/validate-formatting.ts b/packages/@aws-cdk/toolkit-lib/lib/api/validate/validate-formatting.ts index a84adc666..ce1a75a94 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/validate/validate-formatting.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/validate/validate-formatting.ts @@ -1,6 +1,6 @@ import * as path from 'node:path'; import type { PluginReportJson, PolicyViolationJson, PolicyViolationSeverity, ViolatingConstructJson } from '@aws-cdk/cloud-assembly-schema'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { ValidateResult } from '../../actions/validate'; import type { ActionLessMessage } from '../io/private'; import { IO } from '../io/private'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/private/activity-printer/current.ts b/packages/@aws-cdk/toolkit-lib/lib/private/activity-printer/current.ts index 8e6138863..0b1a43ff2 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/private/activity-printer/current.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/private/activity-printer/current.ts @@ -1,5 +1,5 @@ import * as util from 'util'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { ActivityPrinterProps } from './base'; import { ActivityPrinterBase } from './base'; import { RewritableBlock } from './display'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/private/activity-printer/history.ts b/packages/@aws-cdk/toolkit-lib/lib/private/activity-printer/history.ts index e2dab571b..fe684accc 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/private/activity-printer/history.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/private/activity-printer/history.ts @@ -1,5 +1,5 @@ import * as util from 'util'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { ActivityPrinterProps } from './base'; import { ActivityPrinterBase } from './base'; import type { StackActivity } from '../../payloads'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/toolkit/non-interactive-io-host.ts b/packages/@aws-cdk/toolkit-lib/lib/toolkit/non-interactive-io-host.ts index 36e928b0d..d8c132f65 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/toolkit/non-interactive-io-host.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/toolkit/non-interactive-io-host.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { IIoHost, IoMessage, IoMessageLevel, IoRequest } from '../api/io'; import { isMessageRelevantForLevel } from '../api/io/private'; import { HistoryActivityPrinter, type IActivityPrinter } from '../private/activity-printer'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts b/packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts index cc209b577..330d69988 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts @@ -5,7 +5,7 @@ import * as cxapi from '@aws-cdk/cloud-assembly-api'; import type { FeatureFlagReportProperties, PluginReportJson } from '@aws-cdk/cloud-assembly-schema'; import { ArtifactType } from '@aws-cdk/cloud-assembly-schema'; import type { TemplateDiff } from '@aws-cdk/cloudformation-diff'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as chokidar from 'chokidar'; import { type EventName, EVENTS } from 'chokidar/handler.js'; diff --git a/packages/@aws-cdk/toolkit-lib/test/actions/destroy.test.ts b/packages/@aws-cdk/toolkit-lib/test/actions/destroy.test.ts index d638b1f95..26c786c9e 100644 --- a/packages/@aws-cdk/toolkit-lib/test/actions/destroy.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/actions/destroy.test.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { StackSelectionStrategy } from '../../lib/api/cloud-assembly'; import * as deployments from '../../lib/api/deployments'; import type { DestroyStackOptions } from '../../lib/api/deployments'; diff --git a/packages/@aws-cdk/toolkit-lib/test/actions/diff.test.ts b/packages/@aws-cdk/toolkit-lib/test/actions/diff.test.ts index 6552e64f1..d0d17fce9 100644 --- a/packages/@aws-cdk/toolkit-lib/test/actions/diff.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/actions/diff.test.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import { CreateChangeSetCommand, DeleteStackCommand, DescribeChangeSetCommand, DescribeStacksCommand, GetTemplateCommand, ListStacksCommand } from '@aws-sdk/client-cloudformation'; import { GetParameterCommand } from '@aws-sdk/client-ssm'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { DiffMethod } from '../../lib/actions/diff'; import { StackSelectionStrategy } from '../../lib/api/cloud-assembly'; import * as deployments from '../../lib/api/deployments'; diff --git a/packages/@aws-cdk/toolkit-lib/test/activity-monitor/history.test.ts b/packages/@aws-cdk/toolkit-lib/test/activity-monitor/history.test.ts index 2a6e85a9e..b236117df 100644 --- a/packages/@aws-cdk/toolkit-lib/test/activity-monitor/history.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/activity-monitor/history.test.ts @@ -1,5 +1,5 @@ import { ResourceStatus } from '@aws-sdk/client-cloudformation'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { HistoryActivityPrinter } from '../../lib/private/activity-printer'; import { testStack } from '../_helpers/assembly'; import { stderr } from '../_helpers/console-listener'; diff --git a/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/account-cache.test.ts b/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/account-cache.test.ts index 2804fc320..2379a37e6 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/account-cache.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/account-cache.test.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import { AccountAccessKeyCache } from '../../../lib/api/aws-auth/private'; import { withMocked } from '../../_helpers/as-mock'; import bockfs from '../../_helpers/bockfs'; diff --git a/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/fake-sts.ts b/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/fake-sts.ts index f2e949f91..d1a3e9f5a 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/fake-sts.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/fake-sts.ts @@ -1,6 +1,6 @@ import { randomUUID } from 'node:crypto'; import type { Tag } from '@aws-sdk/client-sts'; -import * as nock from 'nock'; +import nock from 'nock'; import { formatErrorMessage } from '../../../lib/util'; interface RegisteredIdentity { diff --git a/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/sdk-provider.test.ts b/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/sdk-provider.test.ts index 04e671980..2ad636ce2 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/sdk-provider.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/aws-auth/sdk-provider.test.ts @@ -13,7 +13,7 @@ * calls and locally fake an STS Endpoint using the `FakeSts` class. */ import { randomUUID } from 'node:crypto'; -import * as os from 'node:os'; +import os from 'node:os'; import * as cxapi from '@aws-cdk/cloud-assembly-api'; import * as fromEnv from '@aws-sdk/credential-provider-env'; import type { RegisterRoleOptions, RegisterUserOptions } from './fake-sts'; diff --git a/packages/@aws-cdk/toolkit-lib/test/api/cloud-assembly/environment.test.ts b/packages/@aws-cdk/toolkit-lib/test/api/cloud-assembly/environment.test.ts index 3e27e50c9..d51a1afd7 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/cloud-assembly/environment.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/cloud-assembly/environment.test.ts @@ -1,4 +1,4 @@ -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import { guessExecutable, synthParametersFromSettings } from '../../../lib/api/cloud-assembly/environment'; import { Settings } from '../../../lib/api/settings'; diff --git a/packages/@aws-cdk/toolkit-lib/test/api/diff/diff.test.ts b/packages/@aws-cdk/toolkit-lib/test/api/diff/diff.test.ts index 130f70e9c..7fa1a49c0 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/diff/diff.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/diff/diff.test.ts @@ -1,5 +1,5 @@ import type * as cxapi from '@aws-cdk/cloud-assembly-api'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { DiffFormatter } from '../../../lib/api/diff/diff-formatter'; function stripAnsi(s: string): string { diff --git a/packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts b/packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts index 504402ff2..d38f78441 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts @@ -1,8 +1,8 @@ -import * as https from 'https'; +import https from 'https'; import * as os from 'os'; import * as path from 'path'; import * as fs from 'fs-extra'; -import * as nock from 'nock'; +import nock from 'nock'; import { Context } from '../../lib/api/context'; import { asIoHelper } from '../../lib/api/io/private'; import { NetworkDetector } from '../../lib/api/network-detector/network-detector'; diff --git a/packages/@aws-cdk/toolkit-lib/test/api/notices/cached-data-source.test.ts b/packages/@aws-cdk/toolkit-lib/test/api/notices/cached-data-source.test.ts index 0daeb8fa9..1f6c989b4 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/notices/cached-data-source.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/notices/cached-data-source.test.ts @@ -1,6 +1,6 @@ import * as os from 'os'; import * as path from 'path'; -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import { asIoHelper } from '../../../lib/api/io/private'; import { CachedDataSource } from '../../../lib/api/notices/cached-data-source'; import { TestIoHost } from '../../_helpers'; diff --git a/packages/@aws-cdk/toolkit-lib/test/api/validate/validate-formatting.test.ts b/packages/@aws-cdk/toolkit-lib/test/api/validate/validate-formatting.test.ts index 41f047cf7..241ee14e8 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/validate/validate-formatting.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/validate/validate-formatting.test.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { ValidateResult } from '../../../lib/actions/validate'; import { formatValidateResult as formatValidateResult_ } from '../../../lib/api/validate/validate-formatting'; diff --git a/packages/@aws-cdk/toolkit-lib/test/toolkit/toolkit.test.ts b/packages/@aws-cdk/toolkit-lib/test/toolkit/toolkit.test.ts index e932b33eb..4e33e5b80 100644 --- a/packages/@aws-cdk/toolkit-lib/test/toolkit/toolkit.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/toolkit/toolkit.test.ts @@ -6,7 +6,7 @@ */ import * as cdk from 'aws-cdk-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { Toolkit } from '../../lib/toolkit/toolkit'; import { TestIoHost } from '../_helpers'; diff --git a/packages/@aws-cdk/toolkit-lib/tsconfig.dev.json b/packages/@aws-cdk/toolkit-lib/tsconfig.dev.json index 10015c749..3e9d2ed17 100644 --- a/packages/@aws-cdk/toolkit-lib/tsconfig.dev.json +++ b/packages/@aws-cdk/toolkit-lib/tsconfig.dev.json @@ -3,7 +3,7 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, @@ -11,8 +11,8 @@ "es2022", "esnext.disposable" ], - "module": "NodeNext", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -37,7 +37,6 @@ "skipLibCheck": true, "isolatedModules": true, "declarationMap": true, - "rootDir": ".", "composite": true, "outDir": "lib" }, diff --git a/packages/@aws-cdk/toolkit-lib/tsconfig.json b/packages/@aws-cdk/toolkit-lib/tsconfig.json index 8ba1d08f9..47e9a6957 100644 --- a/packages/@aws-cdk/toolkit-lib/tsconfig.json +++ b/packages/@aws-cdk/toolkit-lib/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, @@ -13,8 +13,8 @@ "es2022", "esnext.disposable" ], - "module": "NodeNext", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, diff --git a/packages/@aws-cdk/user-input-gen/tsconfig.dev.json b/packages/@aws-cdk/user-input-gen/tsconfig.dev.json index cb6fa1a5b..c00a9b2db 100644 --- a/packages/@aws-cdk/user-input-gen/tsconfig.dev.json +++ b/packages/@aws-cdk/user-input-gen/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "lodash.clonedeep", diff --git a/packages/@aws-cdk/user-input-gen/tsconfig.json b/packages/@aws-cdk/user-input-gen/tsconfig.json index adb4d2f9b..7dc25ad44 100644 --- a/packages/@aws-cdk/user-input-gen/tsconfig.json +++ b/packages/@aws-cdk/user-input-gen/tsconfig.json @@ -5,15 +5,15 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -25,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "lodash.clonedeep", diff --git a/packages/@aws-cdk/yarn-cling/tsconfig.dev.json b/packages/@aws-cdk/yarn-cling/tsconfig.dev.json index 604127520..dcc2245c7 100644 --- a/packages/@aws-cdk/yarn-cling/tsconfig.dev.json +++ b/packages/@aws-cdk/yarn-cling/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node", diff --git a/packages/@aws-cdk/yarn-cling/tsconfig.json b/packages/@aws-cdk/yarn-cling/tsconfig.json index 464b8ed1c..9735f23a1 100644 --- a/packages/@aws-cdk/yarn-cling/tsconfig.json +++ b/packages/@aws-cdk/yarn-cling/tsconfig.json @@ -5,15 +5,15 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -25,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node", diff --git a/packages/aws-cdk/lib/cli/cdk-toolkit.ts b/packages/aws-cdk/lib/cli/cdk-toolkit.ts index 4a18336d1..32c8977fd 100644 --- a/packages/aws-cdk/lib/cli/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cli/cdk-toolkit.ts @@ -6,7 +6,7 @@ import * as cxapi from '@aws-cdk/cloud-assembly-api'; import { RequireApproval } from '@aws-cdk/cloud-assembly-schema'; import type { ConfirmationRequest, DeploymentMethod, DiagnoseOptions, PublishAssetsOptions, ToolkitAction, ToolkitOptions, UnstableFeature, ValidateOptions } from '@aws-cdk/toolkit-lib'; import { PermissionChangeType, Toolkit, ToolkitError, AbortError } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as chokidar from 'chokidar'; import { type EventName, EVENTS } from 'chokidar/handler.js'; import * as fs from 'fs-extra'; diff --git a/packages/aws-cdk/lib/cli/cli.ts b/packages/aws-cdk/lib/cli/cli.ts index 20de99422..54c7f9063 100644 --- a/packages/aws-cdk/lib/cli/cli.ts +++ b/packages/aws-cdk/lib/cli/cli.ts @@ -2,7 +2,7 @@ import * as cxapi from '@aws-cdk/cx-api'; import type { ChangeSetDeployment, DeploymentMethod, DirectDeployment, StackSelector as LibStackSelector } from '@aws-cdk/toolkit-lib'; import { ExpandStackSelection, StackSelectionStrategy, ToolkitError, Toolkit, AbortError } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { guessLanguage } from '../util'; import { CdkToolkit, AssetBuildTime } from './cdk-toolkit'; import { ciSystemIsStdErrSafe } from './ci-systems'; diff --git a/packages/aws-cdk/lib/cli/display-version.ts b/packages/aws-cdk/lib/cli/display-version.ts index 15998b6dc..f573234ff 100644 --- a/packages/aws-cdk/lib/cli/display-version.ts +++ b/packages/aws-cdk/lib/cli/display-version.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import { ToolkitError } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import * as semver from 'semver'; import type { IoHelper } from '../api-private'; diff --git a/packages/aws-cdk/lib/cli/io-host/cli-io-host.ts b/packages/aws-cdk/lib/cli/io-host/cli-io-host.ts index cfd4121bd..ae89e08df 100644 --- a/packages/aws-cdk/lib/cli/io-host/cli-io-host.ts +++ b/packages/aws-cdk/lib/cli/io-host/cli-io-host.ts @@ -3,7 +3,7 @@ import * as util from 'node:util'; import { RequireApproval } from '@aws-cdk/cloud-assembly-schema'; import { ToolkitError } from '@aws-cdk/toolkit-lib'; import type { HotswapResult, IIoHost, IoMessage, IoMessageCode, IoMessageLevel, IoRequest, ToolkitAction } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as promptly from 'promptly'; import type { IoHelper, ActivityPrinterProps, IActivityPrinter, IoMessageMaker, IoRequestMaker, IoDefaultMessages } from '../../../lib/api-private'; import { asIoHelper, IO, isMessageRelevantForLevel, CurrentActivityPrinter, HistoryActivityPrinter } from '../../../lib/api-private'; diff --git a/packages/aws-cdk/lib/cli/pretty-print-error.ts b/packages/aws-cdk/lib/cli/pretty-print-error.ts index cb085515d..eee62a4c0 100644 --- a/packages/aws-cdk/lib/cli/pretty-print-error.ts +++ b/packages/aws-cdk/lib/cli/pretty-print-error.ts @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import * as chalk from 'chalk'; +import chalk from 'chalk'; /* c8 ignore start */ export function prettyPrintError(error: unknown, options: { soft?: boolean; debug?: boolean } = {}) { diff --git a/packages/aws-cdk/lib/commands/context.ts b/packages/aws-cdk/lib/commands/context.ts index 734b2f5f8..9b3922466 100644 --- a/packages/aws-cdk/lib/commands/context.ts +++ b/packages/aws-cdk/lib/commands/context.ts @@ -1,5 +1,5 @@ import { ToolkitError } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; // eslint-disable-next-line @typescript-eslint/no-require-imports import picomatch = require('picomatch'); import type { Context } from '../api/context'; diff --git a/packages/aws-cdk/lib/commands/docs.ts b/packages/aws-cdk/lib/commands/docs.ts index 7aa64d4c2..fb1ec9479 100644 --- a/packages/aws-cdk/lib/commands/docs.ts +++ b/packages/aws-cdk/lib/commands/docs.ts @@ -1,6 +1,6 @@ import * as childProcess from 'child_process'; import { promisify } from 'node:util'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { IoHelper } from '../api-private'; export const command = 'docs'; diff --git a/packages/aws-cdk/lib/commands/doctor.ts b/packages/aws-cdk/lib/commands/doctor.ts index c9215acee..8b52ff4e8 100644 --- a/packages/aws-cdk/lib/commands/doctor.ts +++ b/packages/aws-cdk/lib/commands/doctor.ts @@ -1,6 +1,6 @@ import * as process from 'process'; import * as cxapi from '@aws-cdk/cx-api'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { Settings } from '../api/settings'; import type { IoHelper } from '../api-private'; import { displayVersionMessage } from '../cli/display-version'; diff --git a/packages/aws-cdk/lib/commands/flags/operations.ts b/packages/aws-cdk/lib/commands/flags/operations.ts index d0cdc0652..28a574cbe 100644 --- a/packages/aws-cdk/lib/commands/flags/operations.ts +++ b/packages/aws-cdk/lib/commands/flags/operations.ts @@ -4,7 +4,7 @@ import type { CloudFormationStackArtifact } from '@aws-cdk/cloud-assembly-api'; import { formatTable } from '@aws-cdk/cloudformation-diff'; import type { FeatureFlag, Toolkit } from '@aws-cdk/toolkit-lib'; import { CdkAppMultiContext, MemoryContext, DiffMethod, AbortError } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import PQueue from 'p-queue'; import { OBSOLETE_FLAGS } from './obsolete-flags'; diff --git a/packages/aws-cdk/lib/commands/init/init.ts b/packages/aws-cdk/lib/commands/init/init.ts index e570a9692..a1e0acf6e 100644 --- a/packages/aws-cdk/lib/commands/init/init.ts +++ b/packages/aws-cdk/lib/commands/init/init.ts @@ -1,7 +1,7 @@ import * as childProcess from 'child_process'; import * as path from 'path'; import { ToolkitError } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import { invokeBuiltinHooks } from './init-hooks'; import type { IoHelper } from '../../api-private'; diff --git a/packages/aws-cdk/lib/commands/init/os.ts b/packages/aws-cdk/lib/commands/init/os.ts index 45d8140d7..99157468c 100644 --- a/packages/aws-cdk/lib/commands/init/os.ts +++ b/packages/aws-cdk/lib/commands/init/os.ts @@ -1,6 +1,6 @@ import * as child_process from 'child_process'; import { ToolkitError } from '@aws-cdk/toolkit-lib'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import type { IoHelper } from '../../api-private'; /** diff --git a/packages/aws-cdk/lib/commands/migrate.ts b/packages/aws-cdk/lib/commands/migrate.ts index 01744512a..8d6394432 100644 --- a/packages/aws-cdk/lib/commands/migrate.ts +++ b/packages/aws-cdk/lib/commands/migrate.ts @@ -19,7 +19,7 @@ import type { ScannedResourceIdentifier, } from '@aws-sdk/client-cloudformation'; import * as cdk_from_cfn from 'cdk-from-cfn'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { cliInit } from './init'; import type { ICloudFormationClient, SdkProvider } from '../api/aws-auth'; import { CloudFormationStack } from '../api/cloudformation'; diff --git a/packages/aws-cdk/test/cli/console-formatters.test.ts b/packages/aws-cdk/test/cli/console-formatters.test.ts index 0c823a4ff..f63e7680e 100644 --- a/packages/aws-cdk/test/cli/console-formatters.test.ts +++ b/packages/aws-cdk/test/cli/console-formatters.test.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { formatAsBanner } from '../../lib/cli/util/console-formatters'; test('no banner on empty msg list', () => diff --git a/packages/aws-cdk/test/cli/io-host/cli-io-host.test.ts b/packages/aws-cdk/test/cli/io-host/cli-io-host.test.ts index 57fa77df9..7709d6a4a 100644 --- a/packages/aws-cdk/test/cli/io-host/cli-io-host.test.ts +++ b/packages/aws-cdk/test/cli/io-host/cli-io-host.test.ts @@ -2,7 +2,7 @@ import * as os from 'os'; import * as path from 'path'; import { PassThrough } from 'stream'; import { RequireApproval } from '@aws-cdk/cloud-assembly-schema'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import { Context } from '../../../lib/api/context'; import { IO } from '../../../lib/api-private'; diff --git a/packages/aws-cdk/test/cli/telemetry/installation-id.test.ts b/packages/aws-cdk/test/cli/telemetry/installation-id.test.ts index b43d76c78..e7872696e 100644 --- a/packages/aws-cdk/test/cli/telemetry/installation-id.test.ts +++ b/packages/aws-cdk/test/cli/telemetry/installation-id.test.ts @@ -1,4 +1,4 @@ -import * as fs from 'fs'; +import fs from 'fs'; import * as os from 'os'; import * as path from 'path'; diff --git a/packages/aws-cdk/test/cli/telemetry/sink/file-sink.test.ts b/packages/aws-cdk/test/cli/telemetry/sink/file-sink.test.ts index 8e225dc06..5968cfed9 100644 --- a/packages/aws-cdk/test/cli/telemetry/sink/file-sink.test.ts +++ b/packages/aws-cdk/test/cli/telemetry/sink/file-sink.test.ts @@ -1,6 +1,6 @@ import * as os from 'os'; import * as path from 'path'; -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import { createTestEvent } from './util'; import { IoHelper } from '../../../../lib/api-private'; import { CliIoHost } from '../../../../lib/cli/io-host'; diff --git a/packages/aws-cdk/test/cli/version.test.ts b/packages/aws-cdk/test/cli/version.test.ts index c7ae1f6d5..7c1080d87 100644 --- a/packages/aws-cdk/test/cli/version.test.ts +++ b/packages/aws-cdk/test/cli/version.test.ts @@ -1,5 +1,5 @@ /* eslint-disable import/order */ -import * as fs from 'fs-extra'; +import fs from 'fs-extra'; import * as os from 'os'; import * as path from 'path'; import * as sinon from 'sinon'; diff --git a/packages/aws-cdk/test/commands/init.test.ts b/packages/aws-cdk/test/commands/init.test.ts index 982dc18fa..2ae61d58a 100644 --- a/packages/aws-cdk/test/commands/init.test.ts +++ b/packages/aws-cdk/test/commands/init.test.ts @@ -1,8 +1,11 @@ -import * as child_process from 'child_process'; +import child_process from 'child_process'; +import type { ChildProcess } from 'child_process'; import * as os from 'os'; import * as path from 'path'; +import { promisify } from 'util'; import * as cxapi from '@aws-cdk/cx-api'; import * as fs from 'fs-extra'; +import { makeConfig } from '../../lib/cli/cli-config'; import { availableInitLanguages, availableInitTemplates, cliInit, currentlyRecommendedAwsCdkLibFlags, expandPlaceholders, printAvailableTemplates } from '../../lib/commands/init'; import { type JsPackageManager } from '../../lib/commands/init/package-manager'; import { createSingleLanguageTemplate, createMultiLanguageTemplate, createMultiTemplateRepository } from '../_fixtures/init-templates/template-helpers'; @@ -79,9 +82,7 @@ describe('constructs version', () => { }); cliTest('can specify project name with project-name option via CLI', async (workDir) => { - const { exec } = await import('child_process'); - const { promisify } = await import('util'); - const execAsync = promisify(exec); + const execAsync = promisify(child_process.exec); const cdkBin = path.join(__dirname, '..', '..', 'bin', 'cdk'); const commonEnv = { ...process.env, CDK_DISABLE_VERSION_CHECK: '1', CI: 'true', TERM: 'dumb', NO_COLOR: '1' }; @@ -721,9 +722,7 @@ describe('constructs version', () => { 30_000); cliTest('unstable flag functionality works correctly', async (workDir) => { - const { exec } = await import('child_process'); - const { promisify } = await import('util'); - const execAsync = promisify(exec); + const execAsync = promisify(child_process.exec); const cdkBin = path.join(__dirname, '..', '..', 'bin', 'cdk'); const repoDir = await createMultiTemplateRepository(workDir, [ @@ -765,9 +764,7 @@ describe('constructs version', () => { }, 100_000); cliTest('conflict between lib-version and from-path is enforced', async (workDir) => { - const { exec } = await import('child_process'); - const { promisify } = await import('util'); - const execAsync = promisify(exec); + const execAsync = promisify(child_process.exec); const templateDir = await createSingleLanguageTemplate(workDir, 'conflict-test', 'typescript'); @@ -782,7 +779,6 @@ describe('constructs version', () => { cliTest('template-path implies from-path validation works', async (workDir) => { // Test that the implication is properly configured - const { makeConfig } = await import('../../lib/cli/cli-config'); const config = await makeConfig(); expect(config.commands.init.implies).toEqual({ 'template-path': 'from-path' }); @@ -1189,7 +1185,7 @@ describe('constructs version', () => { once: jest.fn((event, cb) => { if (event === 'exit') cb(0); }), - }) as unknown as child_process.ChildProcess); + }) as unknown as ChildProcess); try { const templateDir = path.join(workDir, 'csharp-template'); @@ -1437,7 +1433,7 @@ describe('constructs version', () => { // Mock child_process.spawn to track which package manager is called spawnSpy = jest.spyOn(child_process, 'spawn').mockImplementation(() => ({ stdout: { on: jest.fn() }, - }) as unknown as child_process.ChildProcess); + }) as unknown as ChildProcess); }); afterEach(() => { diff --git a/packages/aws-cdk/test/commands/notices.test.ts b/packages/aws-cdk/test/commands/notices.test.ts index ade9eb593..66b25e648 100644 --- a/packages/aws-cdk/test/commands/notices.test.ts +++ b/packages/aws-cdk/test/commands/notices.test.ts @@ -6,7 +6,7 @@ jest.mock('../../../@aws-cdk/toolkit-lib/lib/api/network-detector/network-detect }, })); -import * as nock from 'nock'; +import nock from 'nock'; import { exec } from '../../lib/cli/cli'; process.env.CDK_NOTICES_TIMEOUT = '3000'; diff --git a/packages/aws-cdk/tsconfig.dev.json b/packages/aws-cdk/tsconfig.dev.json index e4491c8d9..cc4c2cbef 100644 --- a/packages/aws-cdk/tsconfig.dev.json +++ b/packages/aws-cdk/tsconfig.dev.json @@ -3,17 +3,16 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2019", - "esnext.disposable", - "es2022.error" + "es2022", + "esnext.disposable" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -25,7 +24,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "fs-extra", "jest", diff --git a/packages/aws-cdk/tsconfig.json b/packages/aws-cdk/tsconfig.json index 428ce0b0b..115b50221 100644 --- a/packages/aws-cdk/tsconfig.json +++ b/packages/aws-cdk/tsconfig.json @@ -5,16 +5,15 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2019", - "es2022.error" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -26,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "fs-extra", "jest", diff --git a/packages/cdk-assets/tsconfig.dev.json b/packages/cdk-assets/tsconfig.dev.json index efb047eee..f6088ae80 100644 --- a/packages/cdk-assets/tsconfig.dev.json +++ b/packages/cdk-assets/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node", diff --git a/packages/cdk-assets/tsconfig.json b/packages/cdk-assets/tsconfig.json index 1e40ca48c..2f213837c 100644 --- a/packages/cdk-assets/tsconfig.json +++ b/packages/cdk-assets/tsconfig.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node", diff --git a/packages/cdk/tsconfig.dev.json b/packages/cdk/tsconfig.dev.json index 8a5318d0f..5525763bd 100644 --- a/packages/cdk/tsconfig.dev.json +++ b/packages/cdk/tsconfig.dev.json @@ -3,15 +3,15 @@ "compilerOptions": { "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -23,7 +23,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node" diff --git a/packages/cdk/tsconfig.json b/packages/cdk/tsconfig.json index 0d4f70af9..d01a114e9 100644 --- a/packages/cdk/tsconfig.json +++ b/packages/cdk/tsconfig.json @@ -5,15 +5,15 @@ "outDir": "lib", "alwaysStrict": true, "declaration": true, - "esModuleInterop": false, + "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ - "es2020" + "es2022" ], - "module": "commonjs", - "noEmitOnError": false, + "module": "node18", + "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, @@ -25,7 +25,7 @@ "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, - "target": "ES2020", + "target": "es2022", "types": [ "jest", "node"