@codedrifters/configulator 0.0.332 → 0.0.333
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 +21 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.js +57 -33
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +27 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -34736,6 +34736,7 @@ import { ReleaseTrigger } from "projen/lib/release";
|
|
|
34736
34736
|
import { merge as merge2 } from "ts-deepmerge";
|
|
34737
34737
|
|
|
34738
34738
|
// src/projects/monorepo-project.ts
|
|
34739
|
+
import { TaskRuntime } from "projen";
|
|
34739
34740
|
import { WorkflowSteps } from "projen/lib/github";
|
|
34740
34741
|
import {
|
|
34741
34742
|
NodePackageManager,
|
|
@@ -35765,19 +35766,42 @@ var MonorepoProject = class extends TypeScriptAppProject {
|
|
|
35765
35766
|
requestInstallDependencies(resolver) {
|
|
35766
35767
|
postInstallDependenciesMap.get(this).push(resolver.resolveDepsAndWritePackageJson);
|
|
35767
35768
|
}
|
|
35769
|
+
/**
|
|
35770
|
+
* Runs a non-frozen dependency install during synth.
|
|
35771
|
+
*
|
|
35772
|
+
* Projen's `NodePackage.installDependencies` runs the frozen `install:ci`
|
|
35773
|
+
* task (`pnpm i --frozen-lockfile`) whenever `process.env.CI` is truthy.
|
|
35774
|
+
* That is wrong for a synth-time install: synth itself can rewrite
|
|
35775
|
+
* `pnpm-workspace.yaml` (e.g. when a configulator catalog value in
|
|
35776
|
+
* `versions.ts` bumps), leaving the lockfile out of sync with the freshly
|
|
35777
|
+
* written workspace catalog. A frozen install then fails with
|
|
35778
|
+
* `ERR_PNPM_LOCKFILE_CONFIG_MISMATCH`, which previously broke the scheduled
|
|
35779
|
+
* upgrade workflow on every consumer repo across any catalog bump.
|
|
35780
|
+
*
|
|
35781
|
+
* Frozen-install enforcement belongs to CI's explicit `install:ci`
|
|
35782
|
+
* invocation, not to the synth-time install. We therefore always run the
|
|
35783
|
+
* non-frozen `install` task here, which refreshes the lockfile to match the
|
|
35784
|
+
* rewritten workspace — matching the canonical regen sequence consumers
|
|
35785
|
+
* already document (`pnpm i && pnpm exec projen && pnpm i`, neither frozen).
|
|
35786
|
+
*
|
|
35787
|
+
* @see https://github.com/codedrifters/packages/issues/570
|
|
35788
|
+
*/
|
|
35789
|
+
installDependenciesNonFrozen() {
|
|
35790
|
+
const runtime = new TaskRuntime(this.outdir);
|
|
35791
|
+
runtime.runTask(this.package.installTask.name);
|
|
35792
|
+
}
|
|
35768
35793
|
/**
|
|
35769
35794
|
* Hooks into the install dependencies cycle
|
|
35770
35795
|
*/
|
|
35771
35796
|
postSynthesize() {
|
|
35772
35797
|
const postInstallDependencies = postInstallDependenciesMap.get(this);
|
|
35773
35798
|
if (postInstallDependencies?.length) {
|
|
35774
|
-
|
|
35775
|
-
nodePkg.installDependencies();
|
|
35799
|
+
this.installDependenciesNonFrozen();
|
|
35776
35800
|
const completedRequests = postInstallDependencies.map(
|
|
35777
35801
|
(request) => request()
|
|
35778
35802
|
);
|
|
35779
35803
|
if (completedRequests.some(Boolean)) {
|
|
35780
|
-
|
|
35804
|
+
this.installDependenciesNonFrozen();
|
|
35781
35805
|
}
|
|
35782
35806
|
postInstallDependenciesMap.set(this, []);
|
|
35783
35807
|
}
|