@dbx-tools/projen 0.6.200 → 0.6.201
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/README.md +3 -2
- package/index.ts +1 -1
- package/package.json +4 -4
- package/tasks/release-pr.ts +36 -9
package/README.md
CHANGED
|
@@ -406,8 +406,9 @@ release branch when needed, and pushes it. It prepares the dedicated
|
|
|
406
406
|
checkout on its current branch throughout validation, local publication, and
|
|
407
407
|
PR creation. Failed preparation can resume from that worktree; success removes
|
|
408
408
|
it. `--message` sets the source commit message. The task never merges
|
|
409
|
-
the PR unless `--approve` is passed; that option
|
|
410
|
-
|
|
409
|
+
the PR unless `--approve` is passed; that option merges the release branch
|
|
410
|
+
directly through GitHub's merge API so no PR checks are created. A repository
|
|
411
|
+
that blocks direct merges falls back to an immediate admin-merged PR. npm uses
|
|
411
412
|
`npm config get registry` and publishes to a local Verdaccio automatically.
|
|
412
413
|
Publishable JavaScript members compile once
|
|
413
414
|
from the root in parallel, then upload through a bounded pool without rerunning
|
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.6.
|
|
6
|
+
export const PACKAGE_VERSION = "0.6.201";
|
|
7
7
|
export * as barrels from "./src/barrels.ts";
|
|
8
8
|
export * as bunApp from "./src/bun-app.ts";
|
|
9
9
|
export * as bunWorkflow from "./src/bun-workflow.ts";
|
package/package.json
CHANGED
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@clack/prompts": "^1.7.0",
|
|
28
|
-
"@dbx-tools/core": "0.6.
|
|
29
|
-
"@dbx-tools/path": "0.6.
|
|
30
|
-
"@dbx-tools/shared-core": "0.6.
|
|
28
|
+
"@dbx-tools/core": "0.6.201",
|
|
29
|
+
"@dbx-tools/path": "0.6.201",
|
|
30
|
+
"@dbx-tools/shared-core": "0.6.201",
|
|
31
31
|
"commander": "^15.0.0",
|
|
32
32
|
"concurrently": "^10.0.3",
|
|
33
33
|
"constructs": "^10.6.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"main": "index.ts",
|
|
49
49
|
"license": "Apache-2.0",
|
|
50
|
-
"version": "0.6.
|
|
50
|
+
"version": "0.6.201",
|
|
51
51
|
"types": "index.ts",
|
|
52
52
|
"type": "module",
|
|
53
53
|
"exports": {
|
package/tasks/release-pr.ts
CHANGED
|
@@ -105,11 +105,11 @@ function runIgnoringStdout(root: string, command: string, args: string[]): void
|
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
function githubAccount(root: string): { owner: string; token: string } {
|
|
108
|
+
function githubAccount(root: string): { owner: string; repository: string; token: string } {
|
|
109
109
|
const repository = project.repositoryUrl(root);
|
|
110
110
|
if (!repository) throw new Error("Release preparation requires a GitHub repository");
|
|
111
|
-
const owner = new URL(repository).pathname.split("/").filter(Boolean)
|
|
112
|
-
if (!owner) throw new Error(`Cannot determine GitHub
|
|
111
|
+
const [owner, name] = new URL(repository).pathname.split("/").filter(Boolean);
|
|
112
|
+
if (!owner || !name) throw new Error(`Cannot determine GitHub identity from ${repository}`);
|
|
113
113
|
const token = exec
|
|
114
114
|
.spawnSync("gh", ["auth", "token", "--user", owner], {
|
|
115
115
|
cwd: root,
|
|
@@ -120,7 +120,7 @@ function githubAccount(root: string): { owner: string; token: string } {
|
|
|
120
120
|
})
|
|
121
121
|
.stdout?.trim();
|
|
122
122
|
if (!token) throw new Error(`No GitHub CLI authentication found for ${owner}`);
|
|
123
|
-
return { owner, token };
|
|
123
|
+
return { owner, repository: name.replace(/\.git$/, ""), token };
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
const program = new Command();
|
|
@@ -148,7 +148,7 @@ program
|
|
|
148
148
|
.option("--local-pypi <value>", "local PyPI index: auto, false, or an explicit URL", "auto")
|
|
149
149
|
.option("--python-root <path>", "Python workspace package root", "packages/py")
|
|
150
150
|
.option("--no-local-cargo", "skip local Cargo publication")
|
|
151
|
-
.option("--approve", "merge the release
|
|
151
|
+
.option("--approve", "merge the release branch directly into the release base")
|
|
152
152
|
.action(
|
|
153
153
|
async (opts: {
|
|
154
154
|
level: VersionLevel;
|
|
@@ -272,7 +272,10 @@ program
|
|
|
272
272
|
} else if (!worktreeExists) {
|
|
273
273
|
throw new Error("Release preparation produced no changes");
|
|
274
274
|
}
|
|
275
|
-
|
|
275
|
+
// The source push and release commit hooks have already scanned every new
|
|
276
|
+
// byte. A new remote branch has no upstream comparison point, so the
|
|
277
|
+
// managed pre-push hook would rescan the repository's complete history.
|
|
278
|
+
git(releaseRoot, ["push", "--no-verify", "--set-upstream", "origin", releaseBranch]);
|
|
276
279
|
|
|
277
280
|
const title = `chore(release): ${next.version}`;
|
|
278
281
|
const body = [
|
|
@@ -283,7 +286,8 @@ program
|
|
|
283
286
|
"Merging this PR updates VERSION on main and starts the public release workflow.",
|
|
284
287
|
].join("\n");
|
|
285
288
|
const githubEnvironment = { ...process.env, GH_TOKEN: account.token };
|
|
286
|
-
|
|
289
|
+
const ensurePullRequest = (): void => {
|
|
290
|
+
if (commandSucceeds(root, "gh", ["pr", "view", releaseBranch], githubEnvironment)) return;
|
|
287
291
|
run(
|
|
288
292
|
root,
|
|
289
293
|
"gh",
|
|
@@ -301,9 +305,32 @@ program
|
|
|
301
305
|
],
|
|
302
306
|
githubEnvironment,
|
|
303
307
|
);
|
|
304
|
-
}
|
|
308
|
+
};
|
|
305
309
|
if (opts.approve) {
|
|
306
|
-
|
|
310
|
+
const merged = commandSucceeds(
|
|
311
|
+
root,
|
|
312
|
+
"gh",
|
|
313
|
+
[
|
|
314
|
+
"api",
|
|
315
|
+
"--method",
|
|
316
|
+
"POST",
|
|
317
|
+
`repos/${account.owner}/${account.repository}/merges`,
|
|
318
|
+
"-f",
|
|
319
|
+
`base=${opts.base}`,
|
|
320
|
+
"-f",
|
|
321
|
+
`head=${releaseBranch}`,
|
|
322
|
+
"-f",
|
|
323
|
+
`commit_message=Merge ${releaseTag}`,
|
|
324
|
+
],
|
|
325
|
+
githubEnvironment,
|
|
326
|
+
);
|
|
327
|
+
if (!merged) {
|
|
328
|
+
ensurePullRequest();
|
|
329
|
+
run(root, "gh", ["pr", "merge", releaseBranch, "--admin", "--merge"], githubEnvironment);
|
|
330
|
+
}
|
|
331
|
+
git(releaseRoot, ["push", "--no-verify", "origin", "--delete", releaseBranch]);
|
|
332
|
+
} else {
|
|
333
|
+
ensurePullRequest();
|
|
307
334
|
}
|
|
308
335
|
git(root, ["worktree", "remove", "--force", releaseRoot]);
|
|
309
336
|
git(root, ["branch", "--delete", "--force", releaseBranch]);
|