@codedrifters/configulator 0.0.386 → 0.0.388

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
@@ -12473,6 +12473,15 @@ declare class TurboRepo extends Component$1 {
12473
12473
  * not match a task on this TurboRepo, so typos surface immediately.
12474
12474
  */
12475
12475
  activateBranchNameEnvVar(options: ActivateBranchNameEnvVarOptions): void;
12476
+ /**
12477
+ * Paths of all generated files in the project, deduped, for use as task
12478
+ * inputs so the compile cache invalidates when they change. Includes
12479
+ * projen-managed `FileBase` files plus generated-once `SampleFile` /
12480
+ * `SampleDir` — whose paths projen keeps private, so they are read defensively
12481
+ * and skipped if that internal shape ever changes. Computed at synth time so
12482
+ * files added after this component (e.g. a subclass's SampleFiles) are seen.
12483
+ */
12484
+ private generatedFileInputs;
12476
12485
  preSynthesize(): void;
12477
12486
  }
12478
12487
 
package/lib/index.d.ts CHANGED
@@ -12522,6 +12522,15 @@ declare class TurboRepo extends Component$1 {
12522
12522
  * not match a task on this TurboRepo, so typos surface immediately.
12523
12523
  */
12524
12524
  activateBranchNameEnvVar(options: ActivateBranchNameEnvVarOptions): void;
12525
+ /**
12526
+ * Paths of all generated files in the project, deduped, for use as task
12527
+ * inputs so the compile cache invalidates when they change. Includes
12528
+ * projen-managed `FileBase` files plus generated-once `SampleFile` /
12529
+ * `SampleDir` — whose paths projen keeps private, so they are read defensively
12530
+ * and skipped if that internal shape ever changes. Computed at synth time so
12531
+ * files added after this component (e.g. a subclass's SampleFiles) are seen.
12532
+ */
12533
+ private generatedFileInputs;
12525
12534
  preSynthesize(): void;
12526
12535
  }
12527
12536
 
package/lib/index.js CHANGED
@@ -15155,11 +15155,14 @@ function renderUnblockDependentsScript(ud) {
15155
15155
  ` echo "$line" | grep -oE '#[0-9]+' | tr -d '#' | tr '\\n' ' ' || echo ""`,
15156
15156
  "}",
15157
15157
  "",
15158
- "# Check if a single issue is closed. Returns 0 if closed, 1 if open.",
15158
+ "# Check whether a single dependency is resolved. Returns 0 (resolved)",
15159
+ "# for a CLOSED issue or a MERGED PR, 1 otherwise. A Depends on: target",
15160
+ "# may reference a PR (state MERGED/OPEN/CLOSED): an OPEN PR keeps",
15161
+ "# blocking, MERGED resolves it, UNKNOWN (API error) stays conservative.",
15159
15162
  "is_closed() {",
15160
15163
  " local state",
15161
15164
  ` state=$(gh issue view "$1" --json state --jq '.state' 2>/dev/null || echo "UNKNOWN")`,
15162
- ' [[ "$state" == "CLOSED" ]]',
15165
+ ' [[ "$state" == "CLOSED" || "$state" == "MERGED" ]]',
15163
15166
  "}",
15164
15167
  "",
15165
15168
  "# \u2500\u2500 main \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
@@ -15392,11 +15395,14 @@ function buildCheckBlockedScript(tiers, scopeGate, _runRatio) {
15392
15395
  ` echo "$line" | grep -oE '#[0-9]+' | tr -d '#' | tr '\\n' ' ' || echo ""`,
15393
15396
  "}",
15394
15397
  "",
15395
- "# Check if a single issue is closed. Returns 0 if closed, 1 if open.",
15398
+ "# Check whether a single dependency is resolved. Returns 0 (resolved)",
15399
+ "# for a CLOSED issue or a MERGED PR, 1 otherwise. A Depends on: target",
15400
+ "# may reference a PR (state MERGED/OPEN/CLOSED): an OPEN PR keeps",
15401
+ "# blocking, MERGED resolves it, UNKNOWN (API error) stays conservative.",
15396
15402
  "is_closed() {",
15397
15403
  " local state",
15398
15404
  ` state=$(gh issue view "$1" --json state --jq '.state' 2>/dev/null || echo "UNKNOWN")`,
15399
- ' [[ "$state" == "CLOSED" ]]',
15405
+ ' [[ "$state" == "CLOSED" || "$state" == "MERGED" ]]',
15400
15406
  "}",
15401
15407
  "",
15402
15408
  "# Map a bare type-label value (without the `type:` prefix) to its",
@@ -31107,11 +31113,9 @@ var _TurboRepo = class _TurboRepo extends import_lib2.Component {
31107
31113
  };
31108
31114
  this.remoteCacheOptions = options.remoteCacheOptions;
31109
31115
  this.buildAllTaskEnvVars = options.buildAllTaskEnvVars ?? {};
31110
- const rootGeneratedFiles = this.isRootProject ? this.project.components.filter((c) => c instanceof import_lib2.FileBase).map((c) => c.path) : [];
31111
31116
  this.buildTask = new TurboRepoTask(this.project, {
31112
31117
  name: ROOT_TURBO_TASK_NAME,
31113
- dependsOn: this.isRootProject ? [`^${ROOT_TURBO_TASK_NAME}`] : [],
31114
- ...rootGeneratedFiles.length > 0 && { inputs: rootGeneratedFiles }
31118
+ dependsOn: this.isRootProject ? [`^${ROOT_TURBO_TASK_NAME}`] : []
31115
31119
  });
31116
31120
  if (this.isRootProject) {
31117
31121
  this.buildAllTask = this.project.tasks.addTask(ROOT_CI_TASK_NAME, {
@@ -31151,18 +31155,17 @@ var _TurboRepo = class _TurboRepo extends import_lib2.Component {
31151
31155
  }
31152
31156
  }
31153
31157
  if (!this.isRootProject) {
31154
- const generatedFiles = this.project.components.filter((c) => c instanceof import_lib2.FileBase).map((c) => c.path);
31155
31158
  this.preCompileTask = new TurboRepoTask(project, {
31156
31159
  name: options.preCompileTask?.name ?? "pre-compile",
31157
- inputs: ["src/**", ...generatedFiles]
31160
+ inputs: ["src/**"]
31158
31161
  });
31159
31162
  this.compileTask = new TurboRepoTask(project, {
31160
31163
  name: options.compileTask?.name ?? "compile",
31161
- inputs: ["src/**", ...generatedFiles]
31164
+ inputs: ["src/**"]
31162
31165
  });
31163
31166
  this.postCompileTask = new TurboRepoTask(project, {
31164
31167
  name: options.postCompileTask?.name ?? "post-compile",
31165
- inputs: ["src/**", ...generatedFiles]
31168
+ inputs: ["src/**"]
31166
31169
  });
31167
31170
  this.testTask = new TurboRepoTask(project, {
31168
31171
  name: options.testTask?.name ?? "test"
@@ -31293,6 +31296,33 @@ var _TurboRepo = class _TurboRepo extends import_lib2.Component {
31293
31296
  }
31294
31297
  }
31295
31298
  }
31299
+ /**
31300
+ * Paths of all generated files in the project, deduped, for use as task
31301
+ * inputs so the compile cache invalidates when they change. Includes
31302
+ * projen-managed `FileBase` files plus generated-once `SampleFile` /
31303
+ * `SampleDir` — whose paths projen keeps private, so they are read defensively
31304
+ * and skipped if that internal shape ever changes. Computed at synth time so
31305
+ * files added after this component (e.g. a subclass's SampleFiles) are seen.
31306
+ */
31307
+ generatedFileInputs() {
31308
+ const inputs = /* @__PURE__ */ new Set();
31309
+ for (const component of this.project.components) {
31310
+ if (component instanceof import_lib2.FileBase) {
31311
+ inputs.add(component.path);
31312
+ } else if (component instanceof import_lib2.SampleFile) {
31313
+ const filePath = component.filePath;
31314
+ if (typeof filePath === "string") {
31315
+ inputs.add(filePath);
31316
+ }
31317
+ } else if (component instanceof import_lib2.SampleDir) {
31318
+ const dir = component.dir;
31319
+ if (typeof dir === "string") {
31320
+ inputs.add(`${dir}/**`);
31321
+ }
31322
+ }
31323
+ }
31324
+ return Array.from(inputs);
31325
+ }
31296
31326
  preSynthesize() {
31297
31327
  let nextDependsOn = this.project.deps.all.filter((d) => d.version === "workspace:*").map((d) => [d.name, ROOT_TURBO_TASK_NAME].join("#"));
31298
31328
  if (!this.isRootProject) {
@@ -31314,6 +31344,24 @@ var _TurboRepo = class _TurboRepo extends import_lib2.Component {
31314
31344
  });
31315
31345
  this.buildTask.dependsOn.push(...nextDependsOn);
31316
31346
  }
31347
+ const generatedInputs = this.generatedFileInputs();
31348
+ const appendGeneratedInputs = (task) => {
31349
+ if (!task) {
31350
+ return;
31351
+ }
31352
+ for (const input of generatedInputs) {
31353
+ if (!task.inputs.includes(input)) {
31354
+ task.inputs.push(input);
31355
+ }
31356
+ }
31357
+ };
31358
+ if (this.isRootProject) {
31359
+ appendGeneratedInputs(this.buildTask);
31360
+ } else {
31361
+ appendGeneratedInputs(this.preCompileTask);
31362
+ appendGeneratedInputs(this.compileTask);
31363
+ appendGeneratedInputs(this.postCompileTask);
31364
+ }
31317
31365
  const fileName = "turbo.json";
31318
31366
  this.project.addPackageIgnore(fileName);
31319
31367
  new import_lib2.JsonFile(this.project, fileName, {