aws-cdk 2.1100.0 → 2.1100.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -3500,7 +3500,7 @@ var require_semver2 = __commonJS({
3500
3500
  // ../@aws-cdk/cloud-assembly-schema/cli-version.json
3501
3501
  var require_cli_version = __commonJS({
3502
3502
  "../@aws-cdk/cloud-assembly-schema/cli-version.json"(exports2, module2) {
3503
- module2.exports = { version: "2.1100.0" };
3503
+ module2.exports = { version: "2.1100.1" };
3504
3504
  }
3505
3505
  });
3506
3506
 
@@ -139214,7 +139214,8 @@ var init_early_validation = __esm({
139214
139214
  }
139215
139215
  return `The template cannot be deployed because of early validation errors, but retrieving more details about those
139216
139216
  errors failed (${error5}). Make sure you have permissions to call the DescribeEvents API, or re-bootstrap
139217
- your environment with the latest version of the CLI (need at least version 30, current version ${currentVersion ?? "unknown"}).`;
139217
+ your environment by running 'cdk bootstrap' to update the Bootstrap CDK Toolkit stack.
139218
+ Bootstrap toolkit stack version 30 or later is needed; current version: ${currentVersion ?? "unknown"}.`;
139218
139219
  }
139219
139220
  let message2 = `ChangeSet '${changeSetName}' on stack '${stackName}' failed early validation`;
139220
139221
  if (operationEvents.length > 0) {
@@ -276799,7 +276800,7 @@ var init_session = __esm({
276799
276800
  identifiers: {
276800
276801
  installationId: await getOrCreateInstallationId(this.ioHost.asIoHelper()),
276801
276802
  sessionId: (0, import_crypto7.randomUUID)(),
276802
- telemetryVersion: "1.0",
276803
+ telemetryVersion: "2.0",
276803
276804
  cdkCliVersion: versionNumber2(),
276804
276805
  cdkLibraryVersion: await getLibraryVersion(this.ioHost.asIoHelper())
276805
276806
  },
@@ -277171,6 +277172,13 @@ var init_cli_io_host = __esm({
277171
277172
  return _CliIoHost._instance;
277172
277173
  }
277173
277174
  async startTelemetry(args, context, proxyAgent) {
277175
+ const config = require_cli_type_registry();
277176
+ const validCommands = Object.keys(config.commands);
277177
+ const cmd = args._[0];
277178
+ if (!validCommands.includes(cmd)) {
277179
+ await this.asIoHelper().defaults.trace(`Session instantiated with an invalid command (${cmd}). Not starting telemetry.`);
277180
+ return;
277181
+ }
277174
277182
  let sinks = [];
277175
277183
  const telemetryFilePath = args["telemetry-file"];
277176
277184
  if (telemetryFilePath) {
@@ -279868,7 +279876,7 @@ async function invokeBuiltinHooks(ioHelper, target, context) {
279868
279876
  break;
279869
279877
  case "javascript":
279870
279878
  case "typescript":
279871
- await context.substitutePlaceholdersIn("package.json");
279879
+ await context.substitutePlaceholdersIn("package.json", "README.md");
279872
279880
  }
279873
279881
  }
279874
279882
  async function dotnetAddProject(ioHelper, targetDirectory, context, ext4 = "csproj") {
@@ -279926,6 +279934,23 @@ var init_language = __esm({
279926
279934
  }
279927
279935
  });
279928
279936
 
279937
+ // lib/commands/init/package-manager.ts
279938
+ var JS_PACKAGE_MANAGERS, getPmCmdPrefix;
279939
+ var init_package_manager = __esm({
279940
+ "lib/commands/init/package-manager.ts"() {
279941
+ "use strict";
279942
+ JS_PACKAGE_MANAGERS = [
279943
+ { name: "npm", commandPrefix: "npm run" },
279944
+ { name: "yarn", commandPrefix: "yarn" },
279945
+ { name: "pnpm", commandPrefix: "pnpm" },
279946
+ { name: "bun", commandPrefix: "bun run" }
279947
+ ];
279948
+ getPmCmdPrefix = /* @__PURE__ */ __name((packageManager) => {
279949
+ return JS_PACKAGE_MANAGERS.find((pm) => pm.name === packageManager).commandPrefix;
279950
+ }, "getPmCmdPrefix");
279951
+ }
279952
+ });
279953
+
279929
279954
  // ../../node_modules/camelcase/index.js
279930
279955
  var require_camelcase = __commonJS({
279931
279956
  "../../node_modules/camelcase/index.js"(exports2, module2) {
@@ -280213,7 +280238,7 @@ function pythonExecutable() {
280213
280238
  }
280214
280239
  return python;
280215
280240
  }
280216
- function expandPlaceholders(template, language, project) {
280241
+ function expandPlaceholders(template, language, project, packageManager) {
280217
280242
  const cdkVersion = project.versions["aws-cdk-lib"];
280218
280243
  const cdkCliVersion = project.versions["aws-cdk"];
280219
280244
  let constructsVersion = project.versions.constructs;
@@ -280233,7 +280258,7 @@ function expandPlaceholders(template, language, project) {
280233
280258
  ).replace(
280234
280259
  /%PascalStackProps%/,
280235
280260
  project.stackName ? camelCase(project.stackName, { pascalCase: true }) + "StackProps" : "StackProps"
280236
- ).replace(/%name\.camelCased%/g, camelCase(project.name)).replace(/%name\.PascalCased%/g, camelCase(project.name, { pascalCase: true })).replace(/%cdk-version%/g, cdkVersion).replace(/%cdk-cli-version%/g, cdkCliVersion).replace(/%constructs-version%/g, constructsVersion).replace(/%cdk-home%/g, cdkHomeDir()).replace(/%name\.PythonModule%/g, project.name.replace(/-/g, "_")).replace(/%python-executable%/g, pythonExecutable()).replace(/%name\.StackName%/g, project.name.replace(/[^A-Za-z0-9-]/g, "-"));
280261
+ ).replace(/%name\.camelCased%/g, camelCase(project.name)).replace(/%name\.PascalCased%/g, camelCase(project.name, { pascalCase: true })).replace(/%cdk-version%/g, cdkVersion).replace(/%cdk-cli-version%/g, cdkCliVersion).replace(/%constructs-version%/g, constructsVersion).replace(/%cdk-home%/g, cdkHomeDir()).replace(/%name\.PythonModule%/g, project.name.replace(/-/g, "_")).replace(/%python-executable%/g, pythonExecutable()).replace(/%name\.StackName%/g, project.name.replace(/[^A-Za-z0-9-]/g, "-")).replace(/%pm-cmd%/g, getPmCmdPrefix(packageManager ?? "npm"));
280237
280262
  }
280238
280263
  async function availableInitTemplates() {
280239
280264
  try {
@@ -280267,7 +280292,7 @@ async function printAvailableTemplates(ioHelper, language) {
280267
280292
  async function initializeProject(ioHelper, template, language, canUseNetwork, generateOnly, workDir, stackName, migrate, cdkVersion, packageManager) {
280268
280293
  await assertIsEmptyDirectory(workDir);
280269
280294
  await ioHelper.defaults.info(`Applying project template ${chalk26.green(template.name)} for ${chalk26.blue(language)}`);
280270
- await template.install(ioHelper, language, workDir, stackName, cdkVersion);
280295
+ await template.install(ioHelper, language, workDir, stackName, cdkVersion, packageManager);
280271
280296
  if (migrate) {
280272
280297
  await template.addMigrateContext(workDir);
280273
280298
  }
@@ -280504,6 +280529,7 @@ var init_init = __esm({
280504
280529
  init_version();
280505
280530
  init_util7();
280506
280531
  init_language();
280532
+ init_package_manager();
280507
280533
  camelCase = require_camelcase();
280508
280534
  decamelize = require_decamelize();
280509
280535
  SUPPORTED_LANGUAGE_NAMES = SUPPORTED_LANGUAGES.map((l4) => l4.name);
@@ -280580,7 +280606,7 @@ var init_init = __esm({
280580
280606
  * @param libVersion - the version of the CDK library to use
280581
280607
  * @default undefined
280582
280608
  */
280583
- async install(ioHelper, language, targetDirectory, stackName, libVersion) {
280609
+ async install(ioHelper, language, targetDirectory, stackName, libVersion, packageManager) {
280584
280610
  if (this.languages.indexOf(language) === -1) {
280585
280611
  await ioHelper.defaults.error(
280586
280612
  `The ${chalk26.blue(language)} language is not supported for ${chalk26.green(this.name)} (it supports: ${this.languages.map((l4) => chalk26.blue(l4)).join(", ")})`
@@ -280602,7 +280628,7 @@ var init_init = __esm({
280602
280628
  if (this.templateType === "custom" /* CUSTOM */) {
280603
280629
  await this.installFilesWithoutProcessing(sourceDirectory, targetDirectory);
280604
280630
  } else {
280605
- await this.installFiles(sourceDirectory, targetDirectory, language, projectInfo);
280631
+ await this.installFiles(sourceDirectory, targetDirectory, language, projectInfo, packageManager);
280606
280632
  await this.applyFutureFlags(targetDirectory);
280607
280633
  await invokeBuiltinHooks(
280608
280634
  ioHelper,
@@ -280612,25 +280638,25 @@ var init_init = __esm({
280612
280638
  const fileProcessingPromises = fileNames.map(async (fileName) => {
280613
280639
  const fullPath = path34.join(targetDirectory, fileName);
280614
280640
  const template = await fs36.readFile(fullPath, { encoding: "utf-8" });
280615
- await fs36.writeFile(fullPath, expandPlaceholders(template, language, projectInfo));
280641
+ await fs36.writeFile(fullPath, expandPlaceholders(template, language, projectInfo, packageManager));
280616
280642
  });
280617
280643
  await Promise.all(fileProcessingPromises);
280618
280644
  }, "substitutePlaceholdersIn"),
280619
- placeholder: /* @__PURE__ */ __name((ph) => expandPlaceholders(`%${ph}%`, language, projectInfo), "placeholder")
280645
+ placeholder: /* @__PURE__ */ __name((ph) => expandPlaceholders(`%${ph}%`, language, projectInfo, packageManager), "placeholder")
280620
280646
  }
280621
280647
  );
280622
280648
  }
280623
280649
  }
280624
- async installFiles(sourceDirectory, targetDirectory, language, project) {
280650
+ async installFiles(sourceDirectory, targetDirectory, language, project, packageManager) {
280625
280651
  for (const file of await fs36.readdir(sourceDirectory)) {
280626
280652
  const fromFile = path34.join(sourceDirectory, file);
280627
- const toFile = path34.join(targetDirectory, expandPlaceholders(file, language, project));
280653
+ const toFile = path34.join(targetDirectory, expandPlaceholders(file, language, project, packageManager));
280628
280654
  if ((await fs36.stat(fromFile)).isDirectory()) {
280629
280655
  await fs36.mkdir(toFile);
280630
- await this.installFiles(fromFile, toFile, language, project);
280656
+ await this.installFiles(fromFile, toFile, language, project, packageManager);
280631
280657
  continue;
280632
280658
  } else if (file.match(/^.*\.template\.[^.]+$/)) {
280633
- await this.installProcessed(fromFile, toFile.replace(/\.template(\.[^.]+)$/, "$1"), language, project);
280659
+ await this.installProcessed(fromFile, toFile.replace(/\.template(\.[^.]+)$/, "$1"), language, project, packageManager);
280634
280660
  continue;
280635
280661
  } else if (file.match(/^.*\.hook\.(d.)?[^.]+$/)) {
280636
280662
  continue;
@@ -280639,9 +280665,9 @@ var init_init = __esm({
280639
280665
  }
280640
280666
  }
280641
280667
  }
280642
- async installProcessed(templatePath, toFile, language, project) {
280668
+ async installProcessed(templatePath, toFile, language, project, packageManager) {
280643
280669
  const template = await fs36.readFile(templatePath, { encoding: "utf-8" });
280644
- await fs36.writeFile(toFile, expandPlaceholders(template, language, project));
280670
+ await fs36.writeFile(toFile, expandPlaceholders(template, language, project, packageManager));
280645
280671
  }
280646
280672
  /**
280647
280673
  * Copy template files without processing placeholders (for custom templates)
@@ -6,7 +6,7 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app. The build ste
6
6
 
7
7
  ## Useful commands
8
8
 
9
- * `npm run test` perform the jest unit tests
9
+ * `%pm-cmd% test` perform the jest unit tests
10
10
  * `npx cdk deploy` deploy this stack to your default AWS account/region
11
11
  * `npx cdk diff` compare deployed stack with current state
12
12
  * `npx cdk synth` emits the synthesized CloudFormation template
@@ -6,9 +6,9 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app.
6
6
 
7
7
  ## Useful commands
8
8
 
9
- * `npm run build` compile typescript to js
10
- * `npm run watch` watch for changes and compile
11
- * `npm run test` perform the jest unit tests
9
+ * `%pm-cmd% build` compile typescript to js
10
+ * `%pm-cmd% watch` watch for changes and compile
11
+ * `%pm-cmd% test` perform the jest unit tests
12
12
  * `npx cdk deploy` deploy this stack to your default AWS account/region
13
13
  * `npx cdk diff` compare deployed stack with current state
14
14
  * `npx cdk synth` emits the synthesized CloudFormation template
@@ -7,6 +7,6 @@ The construct defines an interface (`%name.PascalCased%Props`) to configure the
7
7
 
8
8
  ## Useful commands
9
9
 
10
- * `npm run build` compile typescript to js
11
- * `npm run watch` watch for changes and compile
12
- * `npm run test` perform the jest unit tests
10
+ * `%pm-cmd% build` compile typescript to js
11
+ * `%pm-cmd% watch` watch for changes and compile
12
+ * `%pm-cmd% test` perform the jest unit tests
@@ -7,7 +7,7 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app. The build ste
7
7
 
8
8
  ## Useful commands
9
9
 
10
- * `npm run test` perform the jest unit tests
10
+ * `%pm-cmd% test` perform the jest unit tests
11
11
  * `cdk deploy` deploy this stack to your default AWS account/region
12
12
  * `cdk diff` compare deployed stack with current state
13
13
  * `cdk synth` emits the synthesized CloudFormation template
@@ -7,9 +7,9 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app.
7
7
 
8
8
  ## Useful commands
9
9
 
10
- * `npm run build` compile typescript to js
11
- * `npm run watch` watch for changes and compile
12
- * `npm run test` perform the jest unit tests
10
+ * `%pm-cmd% build` compile typescript to js
11
+ * `%pm-cmd% watch` watch for changes and compile
12
+ * `%pm-cmd% test` perform the jest unit tests
13
13
  * `cdk deploy` deploy this stack to your default AWS account/region
14
14
  * `cdk diff` compare deployed stack with current state
15
15
  * `cdk synth` emits the synthesized CloudFormation template
package/package.json CHANGED
@@ -78,10 +78,10 @@
78
78
  "typescript": "5.9",
79
79
  "xml-js": "^1.6.11",
80
80
  "@aws-cdk/cdk-assets-lib": "^1.1.0",
81
- "@aws-cdk/cloud-assembly-schema": ">=49.1.0",
81
+ "@aws-cdk/cloud-assembly-schema": ">=49.2.0",
82
82
  "@aws-cdk/cloudformation-diff": "2.185.0",
83
83
  "@aws-cdk/cx-api": "^2.232.1",
84
- "@aws-cdk/toolkit-lib": "^1.12.1",
84
+ "@aws-cdk/toolkit-lib": "^1.12.2",
85
85
  "@aws-sdk/client-appsync": "^3",
86
86
  "@aws-sdk/client-cloudcontrol": "^3",
87
87
  "@aws-sdk/client-cloudformation": "^3",
@@ -144,7 +144,7 @@
144
144
  "publishConfig": {
145
145
  "access": "public"
146
146
  },
147
- "version": "2.1100.0",
147
+ "version": "2.1100.1",
148
148
  "types": "lib/index.d.ts",
149
149
  "exports": {
150
150
  "./package.json": "./package.json",