@codedrifters/configulator 0.0.438 → 0.0.440

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.mjs CHANGED
@@ -41919,7 +41919,7 @@ var DEFAULT_FAVICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0
41919
41919
  `;
41920
41920
 
41921
41921
  // src/projects/aws-cdk-project.ts
41922
- import { awscdk } from "projen";
41922
+ import { awscdk, Dependencies } from "projen";
41923
41923
  import {
41924
41924
  NodePackageManager as NodePackageManager3,
41925
41925
  Transform as Transform2,
@@ -43535,20 +43535,24 @@ var AwsCdkProject = class extends awscdk.AwsCdkTypeScriptApp {
43535
43535
  const pnpmVersion = parent.pnpmVersion;
43536
43536
  const pnpmWorkspace = PnpmWorkspace.of(parent);
43537
43537
  const defaultCatalog = pnpmWorkspace?.defaultCatalog ?? {};
43538
- const cdkVersion = resolveCatalogVersion(
43538
+ rejectCatalogManagedDeps("devDeps", userOptions.devDeps);
43539
+ rejectCatalogManagedDeps("peerDeps", userOptions.peerDeps);
43540
+ const cdkPin = resolveCatalogPin(
43539
43541
  "cdkVersion",
43540
43542
  "aws-cdk-lib",
43541
43543
  userOptions.cdkVersion,
43542
43544
  VERSION.AWS_CDK_LIB_VERSION,
43543
43545
  defaultCatalog
43544
43546
  );
43545
- const constructsVersion = resolveCatalogVersion(
43547
+ const constructsPin = resolveCatalogPin(
43546
43548
  "constructsVersion",
43547
43549
  "constructs",
43548
43550
  userOptions.constructsVersion,
43549
43551
  VERSION.AWS_CONSTRUCTS_VERSION,
43550
43552
  defaultCatalog
43551
43553
  );
43554
+ const cdkVersion = cdkPin.version;
43555
+ const constructsVersion = constructsPin.version;
43552
43556
  const resolvedOutdir = userOptions.outdir ?? resolveAwsCdkProjectOutdir(userOptions.packageName ?? userOptions.name);
43553
43557
  const testRunner = userOptions.testRunner ?? TestRunner.JEST;
43554
43558
  const useJest = testRunner === TestRunner.JEST;
@@ -43659,7 +43663,10 @@ var AwsCdkProject = class extends awscdk.AwsCdkTypeScriptApp {
43659
43663
  };
43660
43664
  super(options);
43661
43665
  this.addDevDeps("@types/node@catalog:");
43662
- this.addDeps("aws-cdk-lib@catalog:", "constructs@catalog:");
43666
+ this.addDeps(
43667
+ `aws-cdk-lib@${cdkPin.specifier}`,
43668
+ `constructs@${constructsPin.specifier}`
43669
+ );
43663
43670
  this.tsconfig?.file.addOverride("compilerOptions.skipLibCheck", true);
43664
43671
  if (testRunner === TestRunner.VITEST) {
43665
43672
  new Vitest(this, {
@@ -43770,10 +43777,28 @@ var AwsCdkProject = class extends awscdk.AwsCdkTypeScriptApp {
43770
43777
  }
43771
43778
  };
43772
43779
  var EXACT_VERSION = /^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/;
43773
- function resolveCatalogVersion(optionName, packageName, suppliedVersion, fallbackVersion, catalog) {
43780
+ var CATALOG_MANAGED_PACKAGES = ["aws-cdk-lib", "constructs"];
43781
+ function rejectCatalogManagedDeps(optionName, specs) {
43782
+ for (const spec2 of specs ?? []) {
43783
+ const { name } = Dependencies.parseDependency(spec2);
43784
+ if (!CATALOG_MANAGED_PACKAGES.includes(name)) {
43785
+ continue;
43786
+ }
43787
+ throw new Error(
43788
+ `AwsCdkProject pins "${name}" itself, as a runtime dependency on the parent MonorepoProject's catalog, so \`${optionName}: ["${spec2}"]\` never reaches that pin \u2014 it renders a second, unpinned specifier beside it or is dropped outright. Remove "${spec2}" from \`${optionName}\`, and change the version through the catalog entry for "${name}" instead.`
43789
+ );
43790
+ }
43791
+ }
43792
+ function resolveCatalogPin(optionName, packageName, suppliedVersion, fallbackVersion, catalog) {
43774
43793
  const catalogVersion = catalog[packageName];
43775
43794
  if (catalogVersion === void 0) {
43776
- return suppliedVersion ?? fallbackVersion;
43795
+ const version = suppliedVersion ?? fallbackVersion;
43796
+ if (!EXACT_VERSION.test(version)) {
43797
+ throw new Error(
43798
+ `AwsCdkProject pins "${packageName}" exactly, but the parent MonorepoProject's catalog carries no entry for it, so the rendered specifier falls back to \`${optionName}: "${version}"\` \u2014 a range, which would leave every CDK app floating within it. Add an exact "${packageName}" entry to the catalog, or set \`${optionName}\` to an exact version.`
43799
+ );
43800
+ }
43801
+ return { version, specifier: version };
43777
43802
  }
43778
43803
  if (!EXACT_VERSION.test(catalogVersion)) {
43779
43804
  throw new Error(
@@ -43785,7 +43810,7 @@ function resolveCatalogVersion(optionName, packageName, suppliedVersion, fallbac
43785
43810
  `AwsCdkProject renders "${packageName}" as "catalog:", so the parent MonorepoProject's catalog pin (${catalogVersion}) decides the resolved version. \`${optionName}: "${suppliedVersion}"\` would be silently ignored. Drop the option, or bump the catalog entry for "${packageName}" to ${suppliedVersion}.`
43786
43811
  );
43787
43812
  }
43788
- return catalogVersion;
43813
+ return { version: catalogVersion, specifier: "catalog:" };
43789
43814
  }
43790
43815
 
43791
43816
  // src/projects/react-vite-site-project.ts