@dbx-tools/projen 0.9.174 → 0.9.176

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.
Files changed (3) hide show
  1. package/index.ts +1 -1
  2. package/package.json +6 -6
  3. package/src/release.ts +39 -21
package/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // Hand edits are overwritten on the next watch; this file is read-only.
4
4
 
5
5
  export const PACKAGE_IDENTIFIER = "@dbx-tools/projen";
6
- export const PACKAGE_VERSION = "0.9.174";
6
+ export const PACKAGE_VERSION = "0.9.176";
7
7
  export * as appkitWorkspace from "./src/appkit-workspace.ts";
8
8
  export * as barrels from "./src/barrels.ts";
9
9
  export * as bunApp from "./src/bun-app.ts";
package/package.json CHANGED
@@ -30,11 +30,11 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@clack/prompts": "^1.7.0",
33
- "@dbx-tools/auth": "^0.9.174",
34
- "@dbx-tools/cli-args": "^0.9.174",
35
- "@dbx-tools/core": "^0.9.174",
36
- "@dbx-tools/path": "^0.9.174",
37
- "@dbx-tools/shared-core": "^0.9.174",
33
+ "@dbx-tools/auth": "^0.9.176",
34
+ "@dbx-tools/cli-args": "^0.9.176",
35
+ "@dbx-tools/core": "^0.9.176",
36
+ "@dbx-tools/path": "^0.9.176",
37
+ "@dbx-tools/shared-core": "^0.9.176",
38
38
  "commander": "^15.0.0",
39
39
  "concurrently": "^10.0.3",
40
40
  "constructs": "^10.6.0",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "main": "index.ts",
58
58
  "license": "Apache-2.0",
59
- "version": "0.9.174",
59
+ "version": "0.9.176",
60
60
  "types": "index.ts",
61
61
  "type": "module",
62
62
  "exports": {
package/src/release.ts CHANGED
@@ -118,36 +118,57 @@ export function uvSetupStep(): JobStep {
118
118
  };
119
119
  }
120
120
 
121
- function refreshDocsRegistryDependencies(workflow: GithubWorkflow): void {
122
- const docs = workflow.getJob("deploy-docs") as Job | undefined;
123
- if (!docs) return;
124
- if (workflow.getJob(PUBLICATION_VERIFIER_JOB)) {
125
- workflow.updateJob("deploy-docs", {
121
+ const DOCS_JOB = "deploy-docs";
122
+
123
+ function publicationRegistryJobs(workflow: GithubWorkflow): string[] {
124
+ return Object.keys(workflow.jobs).filter(
125
+ (name) => name === "publish-node" || name.startsWith("publish-pypi-"),
126
+ );
127
+ }
128
+
129
+ function publisherPrerequisites(registryJobs: readonly string[]): string[] {
130
+ return registryJobs.map((name) => {
131
+ const output = name === "publish-node" ? "npm" : "pypi";
132
+ return `needs['build-release'].outputs.${output} != 'true' || needs['${name}'].result == 'success'`;
133
+ });
134
+ }
135
+
136
+ /**
137
+ * Deploy docs after selected publishers succeed, then run the availability
138
+ * verifier. Docs never consume registry availability, so the slow public
139
+ * availability poll must not delay their deployment.
140
+ */
141
+ function refreshReleaseOrdering(workflow: GithubWorkflow): void {
142
+ const registryJobs = publicationRegistryJobs(workflow);
143
+ const docs = workflow.getJob(DOCS_JOB) as Job | undefined;
144
+ if (docs) {
145
+ workflow.updateJob(DOCS_JOB, {
126
146
  ...docs,
127
- needs: ["build-release", PUBLICATION_VERIFIER_JOB],
147
+ needs: ["build-release", ...registryJobs],
128
148
  if: releaseCondition([
129
149
  "needs['build-release'].result == 'success'",
130
150
  "needs['build-release'].outputs.docs == 'true'",
131
- `needs['${PUBLICATION_VERIFIER_JOB}'].result == 'success' || needs['${PUBLICATION_VERIFIER_JOB}'].result == 'skipped'`,
151
+ ...publisherPrerequisites(registryJobs),
132
152
  ]),
133
153
  });
134
154
  }
155
+ const verifier = workflow.getJob(PUBLICATION_VERIFIER_JOB) as Job | undefined;
156
+ if (verifier) {
157
+ workflow.updateJob(PUBLICATION_VERIFIER_JOB, {
158
+ ...verifier,
159
+ needs: ["build-release", ...registryJobs, ...(docs ? [DOCS_JOB] : [])],
160
+ });
161
+ }
135
162
  }
136
163
 
137
164
  /** Keep documentation publication behind every configured package registry. */
138
165
  export function refreshReleaseDocsDependencies(project: DBXToolsJavaScriptProject): void {
139
166
  const workflow = releaseWorkflows.get(project);
140
167
  if (workflow) {
141
- refreshDocsRegistryDependencies(workflow);
168
+ refreshReleaseOrdering(workflow);
142
169
  }
143
170
  }
144
171
 
145
- function publicationRegistryJobs(workflow: GithubWorkflow): string[] {
146
- return Object.keys(workflow.jobs).filter(
147
- (name) => name === "publish-node" || name.startsWith("publish-pypi-"),
148
- );
149
- }
150
-
151
172
  /** Keep one public availability barrier behind every configured registry publisher. */
152
173
  export function refreshPublicationVerification(project: DBXToolsJavaScriptProject): void {
153
174
  const workflow = releaseWorkflows.get(project);
@@ -160,10 +181,7 @@ export function refreshPublicationVerification(project: DBXToolsJavaScriptProjec
160
181
  ...(hasNpm ? ["needs['build-release'].outputs.npm == 'true'"] : []),
161
182
  ...(hasPypi ? ["needs['build-release'].outputs.pypi == 'true'"] : []),
162
183
  ].join(" || ");
163
- const prerequisites = registryJobs.map((name) => {
164
- const output = name === "publish-node" ? "npm" : "pypi";
165
- return `needs['build-release'].outputs.${output} != 'true' || needs['${name}'].result == 'success'`;
166
- });
184
+ const prerequisites = publisherPrerequisites(registryJobs);
167
185
  const job: Job = {
168
186
  if: releaseCondition([
169
187
  "needs['build-release'].result == 'success'",
@@ -240,7 +258,7 @@ export function refreshPublicationVerification(project: DBXToolsJavaScriptProjec
240
258
  } else {
241
259
  workflow.addJob(PUBLICATION_VERIFIER_JOB, job);
242
260
  }
243
- refreshDocsRegistryDependencies(workflow);
261
+ refreshReleaseOrdering(workflow);
244
262
  }
245
263
 
246
264
  function releaseBuildJob(
@@ -398,7 +416,7 @@ function nodePublishJob(): Job {
398
416
  }
399
417
 
400
418
  function addDocsJobs(workflow: GithubWorkflow): void {
401
- workflow.addJob("deploy-docs", {
419
+ workflow.addJob(DOCS_JOB, {
402
420
  if: releaseCondition([
403
421
  "needs['build-release'].result == 'success'",
404
422
  "needs['build-release'].outputs.docs == 'true'",
@@ -419,7 +437,7 @@ function addDocsJobs(workflow: GithubWorkflow): void {
419
437
  },
420
438
  ],
421
439
  });
422
- refreshDocsRegistryDependencies(workflow);
440
+ refreshReleaseOrdering(workflow);
423
441
  }
424
442
 
425
443
  /** Owns the single release workflow and local release preparation tasks. */