@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.d.mts CHANGED
@@ -14108,11 +14108,15 @@ interface AwsCdkProjectOptions extends Omit<awscdk.AwsCdkTypeScriptAppOptions, "
14108
14108
  /**
14109
14109
  * Minimum version of `aws-cdk-lib` to depend on.
14110
14110
  *
14111
- * Optional, and normally omitted: the rendered specifier is always
14112
- * `catalog:`, so the parent `MonorepoProject`'s pnpm catalog decides the
14113
- * resolved version. Supplying a value that disagrees with that catalog
14114
- * entry throws rather than being silently discarded — bump the catalog
14115
- * instead.
14111
+ * Optional, and normally omitted: the rendered specifier is `catalog:`
14112
+ * whenever the parent `MonorepoProject`'s pnpm catalog carries an entry, so
14113
+ * that catalog decides the resolved version. Supplying a value that
14114
+ * disagrees with the entry throws rather than being silently discarded —
14115
+ * bump the catalog instead. Only where the catalog has no entry at all does
14116
+ * this value render, and then it must be an exact version.
14117
+ *
14118
+ * Listing `aws-cdk-lib` in `deps`, `devDeps`, or `peerDeps` is never the way
14119
+ * to move it — the first is overridden by the pin and the other two throw.
14116
14120
  *
14117
14121
  * @default - the parent monorepo's catalog pin for `aws-cdk-lib`
14118
14122
  */
package/lib/index.d.ts CHANGED
@@ -14157,11 +14157,15 @@ interface AwsCdkProjectOptions extends Omit<awscdk.AwsCdkTypeScriptAppOptions, "
14157
14157
  /**
14158
14158
  * Minimum version of `aws-cdk-lib` to depend on.
14159
14159
  *
14160
- * Optional, and normally omitted: the rendered specifier is always
14161
- * `catalog:`, so the parent `MonorepoProject`'s pnpm catalog decides the
14162
- * resolved version. Supplying a value that disagrees with that catalog
14163
- * entry throws rather than being silently discarded — bump the catalog
14164
- * instead.
14160
+ * Optional, and normally omitted: the rendered specifier is `catalog:`
14161
+ * whenever the parent `MonorepoProject`'s pnpm catalog carries an entry, so
14162
+ * that catalog decides the resolved version. Supplying a value that
14163
+ * disagrees with the entry throws rather than being silently discarded —
14164
+ * bump the catalog instead. Only where the catalog has no entry at all does
14165
+ * this value render, and then it must be an exact version.
14166
+ *
14167
+ * Listing `aws-cdk-lib` in `deps`, `devDeps`, or `peerDeps` is never the way
14168
+ * to move it — the first is overridden by the pin and the other two throw.
14165
14169
  *
14166
14170
  * @default - the parent monorepo's catalog pin for `aws-cdk-lib`
14167
14171
  */
package/lib/index.js CHANGED
@@ -43916,20 +43916,24 @@ var AwsCdkProject = class extends import_projen31.awscdk.AwsCdkTypeScriptApp {
43916
43916
  const pnpmVersion = parent.pnpmVersion;
43917
43917
  const pnpmWorkspace = PnpmWorkspace.of(parent);
43918
43918
  const defaultCatalog = pnpmWorkspace?.defaultCatalog ?? {};
43919
- const cdkVersion = resolveCatalogVersion(
43919
+ rejectCatalogManagedDeps("devDeps", userOptions.devDeps);
43920
+ rejectCatalogManagedDeps("peerDeps", userOptions.peerDeps);
43921
+ const cdkPin = resolveCatalogPin(
43920
43922
  "cdkVersion",
43921
43923
  "aws-cdk-lib",
43922
43924
  userOptions.cdkVersion,
43923
43925
  VERSION.AWS_CDK_LIB_VERSION,
43924
43926
  defaultCatalog
43925
43927
  );
43926
- const constructsVersion = resolveCatalogVersion(
43928
+ const constructsPin = resolveCatalogPin(
43927
43929
  "constructsVersion",
43928
43930
  "constructs",
43929
43931
  userOptions.constructsVersion,
43930
43932
  VERSION.AWS_CONSTRUCTS_VERSION,
43931
43933
  defaultCatalog
43932
43934
  );
43935
+ const cdkVersion = cdkPin.version;
43936
+ const constructsVersion = constructsPin.version;
43933
43937
  const resolvedOutdir = userOptions.outdir ?? resolveAwsCdkProjectOutdir(userOptions.packageName ?? userOptions.name);
43934
43938
  const testRunner = userOptions.testRunner ?? TestRunner.JEST;
43935
43939
  const useJest = testRunner === TestRunner.JEST;
@@ -44040,7 +44044,10 @@ var AwsCdkProject = class extends import_projen31.awscdk.AwsCdkTypeScriptApp {
44040
44044
  };
44041
44045
  super(options);
44042
44046
  this.addDevDeps("@types/node@catalog:");
44043
- this.addDeps("aws-cdk-lib@catalog:", "constructs@catalog:");
44047
+ this.addDeps(
44048
+ `aws-cdk-lib@${cdkPin.specifier}`,
44049
+ `constructs@${constructsPin.specifier}`
44050
+ );
44044
44051
  this.tsconfig?.file.addOverride("compilerOptions.skipLibCheck", true);
44045
44052
  if (testRunner === TestRunner.VITEST) {
44046
44053
  new Vitest(this, {
@@ -44151,10 +44158,28 @@ var AwsCdkProject = class extends import_projen31.awscdk.AwsCdkTypeScriptApp {
44151
44158
  }
44152
44159
  };
44153
44160
  var EXACT_VERSION = /^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/;
44154
- function resolveCatalogVersion(optionName, packageName, suppliedVersion, fallbackVersion, catalog) {
44161
+ var CATALOG_MANAGED_PACKAGES = ["aws-cdk-lib", "constructs"];
44162
+ function rejectCatalogManagedDeps(optionName, specs) {
44163
+ for (const spec2 of specs ?? []) {
44164
+ const { name } = import_projen31.Dependencies.parseDependency(spec2);
44165
+ if (!CATALOG_MANAGED_PACKAGES.includes(name)) {
44166
+ continue;
44167
+ }
44168
+ throw new Error(
44169
+ `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.`
44170
+ );
44171
+ }
44172
+ }
44173
+ function resolveCatalogPin(optionName, packageName, suppliedVersion, fallbackVersion, catalog) {
44155
44174
  const catalogVersion = catalog[packageName];
44156
44175
  if (catalogVersion === void 0) {
44157
- return suppliedVersion ?? fallbackVersion;
44176
+ const version = suppliedVersion ?? fallbackVersion;
44177
+ if (!EXACT_VERSION.test(version)) {
44178
+ throw new Error(
44179
+ `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.`
44180
+ );
44181
+ }
44182
+ return { version, specifier: version };
44158
44183
  }
44159
44184
  if (!EXACT_VERSION.test(catalogVersion)) {
44160
44185
  throw new Error(
@@ -44166,7 +44191,7 @@ function resolveCatalogVersion(optionName, packageName, suppliedVersion, fallbac
44166
44191
  `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}.`
44167
44192
  );
44168
44193
  }
44169
- return catalogVersion;
44194
+ return { version: catalogVersion, specifier: "catalog:" };
44170
44195
  }
44171
44196
 
44172
44197
  // src/projects/react-vite-site-project.ts