@codedrifters/configulator 0.0.458 → 0.0.460
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 +73 -6
- package/lib/index.d.ts +73 -6
- package/lib/index.js +33 -6
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +31 -6
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -6711,6 +6711,10 @@ var TurboRepoTask = class extends Component {
|
|
|
6711
6711
|
}
|
|
6712
6712
|
};
|
|
6713
6713
|
|
|
6714
|
+
// src/git/git-branch-env.ts
|
|
6715
|
+
var GIT_BRANCH_NAME_ENV = "GIT_BRANCH_NAME";
|
|
6716
|
+
var GIT_BRANCH_NAME_ENV_VALUE = '$([ -n "$GIT_BRANCH_NAME" ] && echo "$GIT_BRANCH_NAME" || git branch --show-current)';
|
|
6717
|
+
|
|
6714
6718
|
// src/turbo/turbo-repo.ts
|
|
6715
6719
|
var ROOT_TURBO_TASK_NAME = "turbo:build";
|
|
6716
6720
|
var ROOT_CI_TASK_NAME = "build:all";
|
|
@@ -6902,12 +6906,11 @@ var _TurboRepo = class _TurboRepo extends Component2 {
|
|
|
6902
6906
|
}
|
|
6903
6907
|
}
|
|
6904
6908
|
activateBranchNameEnvVar(options) {
|
|
6905
|
-
const value = '$([ -n "$GIT_BRANCH_NAME" ] && echo "$GIT_BRANCH_NAME" || git rev-parse --abbrev-ref HEAD)';
|
|
6906
6909
|
if (options === void 0) {
|
|
6907
6910
|
this.project.logger.warn(
|
|
6908
6911
|
"TurboRepo.activateBranchNameEnvVar() with no arguments is deprecated. It writes GIT_BRANCH_NAME to the root `globalEnv`, which forces every task in the monorepo to miss cache on every branch switch. Pass `{ tasks: [...] }` and name only the tasks that actually consume the branch (e.g. CDK synth/package) to preserve cross-branch cache hits for everything else."
|
|
6909
6912
|
);
|
|
6910
|
-
this.addGlobalEnvVar(
|
|
6913
|
+
this.addGlobalEnvVar(GIT_BRANCH_NAME_ENV, GIT_BRANCH_NAME_ENV_VALUE);
|
|
6911
6914
|
return;
|
|
6912
6915
|
}
|
|
6913
6916
|
const knownTaskNames = this.tasks.map((task) => task.name);
|
|
@@ -6923,10 +6926,30 @@ var _TurboRepo = class _TurboRepo extends Component2 {
|
|
|
6923
6926
|
}
|
|
6924
6927
|
for (const name of options.tasks) {
|
|
6925
6928
|
const task = this.tasks.find((t) => t.name === name);
|
|
6926
|
-
if (task && !task.env.includes(
|
|
6927
|
-
task.env.push(
|
|
6929
|
+
if (task && !task.env.includes(GIT_BRANCH_NAME_ENV)) {
|
|
6930
|
+
task.env.push(GIT_BRANCH_NAME_ENV);
|
|
6928
6931
|
}
|
|
6929
6932
|
}
|
|
6933
|
+
this.injectBranchNameOnBuildAll();
|
|
6934
|
+
}
|
|
6935
|
+
/**
|
|
6936
|
+
* Populate `GIT_BRANCH_NAME` on the root `build:all` task env — the process
|
|
6937
|
+
* env turbo runs in — so locally computed hashes match CI, where the
|
|
6938
|
+
* workflow job env supplies the same variable.
|
|
6939
|
+
*
|
|
6940
|
+
* Written straight to the task rather than through
|
|
6941
|
+
* {@link addGlobalEnvVar}, which would also push the name onto the root
|
|
6942
|
+
* `globalEnv` and bust the cache for every task in the monorepo.
|
|
6943
|
+
*
|
|
6944
|
+
* No-ops when the root project has no TurboRepo (`turbo: false`) and
|
|
6945
|
+
* therefore no `build:all` task to inject into.
|
|
6946
|
+
*/
|
|
6947
|
+
injectBranchNameOnBuildAll() {
|
|
6948
|
+
const rootTurbo = _TurboRepo.of(this.project.root);
|
|
6949
|
+
rootTurbo?.buildAllTask?.env(
|
|
6950
|
+
GIT_BRANCH_NAME_ENV,
|
|
6951
|
+
GIT_BRANCH_NAME_ENV_VALUE
|
|
6952
|
+
);
|
|
6930
6953
|
}
|
|
6931
6954
|
/**
|
|
6932
6955
|
* Paths of all generated files in the project, deduped, for use as task
|
|
@@ -34581,7 +34604,7 @@ var VERSION = {
|
|
|
34581
34604
|
*
|
|
34582
34605
|
* CLI and lib are versioned separately, so this is the CLI version.
|
|
34583
34606
|
*/
|
|
34584
|
-
AWS_CDK_CLI_VERSION: "2.
|
|
34607
|
+
AWS_CDK_CLI_VERSION: "2.1137.0",
|
|
34585
34608
|
/**
|
|
34586
34609
|
* CDK Version to use for construct projects.
|
|
34587
34610
|
*
|
|
@@ -38468,7 +38491,7 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends Component12 {
|
|
|
38468
38491
|
};
|
|
38469
38492
|
this.cdkCli = CdkCli.of(project) || new CdkCli(project);
|
|
38470
38493
|
this.env = {
|
|
38471
|
-
|
|
38494
|
+
[GIT_BRANCH_NAME_ENV]: GIT_BRANCH_NAME_ENV_VALUE
|
|
38472
38495
|
};
|
|
38473
38496
|
this.projectPath = relative3(project.root.outdir, project.outdir);
|
|
38474
38497
|
this.rootPath = relative3(project.outdir, project.root.outdir);
|
|
@@ -44880,6 +44903,8 @@ export {
|
|
|
44880
44903
|
DiffReportJob,
|
|
44881
44904
|
GITHUB_ISSUE_TYPES,
|
|
44882
44905
|
GITHUB_ISSUE_TYPE_BY_TITLE_PREFIX,
|
|
44906
|
+
GIT_BRANCH_NAME_ENV,
|
|
44907
|
+
GIT_BRANCH_NAME_ENV_VALUE,
|
|
44883
44908
|
ISSUE_TEMPLATES_GENERATED_SUFFIX,
|
|
44884
44909
|
JsiiFaker,
|
|
44885
44910
|
LAYOUT_ENFORCEMENT,
|