@ankhorage/devtools 1.8.1 → 1.8.3
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 +1 -1
- package/dist/internal/readmeDocs.js +2 -0
- package/dist/policy/changesetsPolicy.d.ts +4 -0
- package/dist/policy/changesetsPolicy.js +5 -0
- package/dist/tools/workflows/files/ci.yml +10 -1
- package/dist/tools/workflows/files/renovate.yml +1 -1
- package/dist/tools/workflows/renderWorkflowAsync.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -311,7 +311,7 @@ A repository participates in Changesets synchronization when `.changeset/config.
|
|
|
311
311
|
.github/workflows/release.yml
|
|
312
312
|
```
|
|
313
313
|
|
|
314
|
-
CI and Release render their `bun-version` from the same managed Bun runtime policy used for `package.json`. They also render Changesets status, version, and publish commands from the same policy that owns the synchronized package scripts. The CI workflow installs that Bun version with the frozen lockfile, builds before repository-provider validation, runs `bunx @ankhorage/ankh doctor validate .`, and conditionally runs lint, formatting, Knip, tests, typecheck, and Changesets checks. Release publishing calls the Devtools-owned runner through the synchronized package script; it never resolves an ambient or mutable Changesets executable.
|
|
314
|
+
CI and Release render their `bun-version` from the same managed Bun runtime policy used for `package.json`. They also render Changesets status, version, and publish commands from the same policy that owns the synchronized package scripts. The CI workflow installs that Bun version with the frozen lockfile, builds before repository-provider validation, runs `bunx @ankhorage/ankh doctor validate .`, and conditionally runs lint, formatting, Knip, tests, typecheck, and Changesets checks. Ordinary pull requests run the strict `changeset:status --since=origin/main` guard. A same-repository `changeset-release/main` pull request instead runs `bun run changeset -- status --since=HEAD`, validating the Version Packages metadata from the detached release checkout without requiring a local `main` ref or another unreleased Changeset after the release Changeset was consumed. A fork using that branch name remains subject to the ordinary strict guard. Release publishing calls the Devtools-owned runner through the synchronized package script; it never resolves an ambient or mutable Changesets executable.
|
|
315
315
|
|
|
316
316
|
The Renovate workflow accepts only same-repository branches created by `renovate[bot]`. It calls the SHA-pinned `ankhorage/renovate` workflow to add a release Changeset for runtime Ankhorage dependency updates or an empty Changeset for dev-only updates, then dispatches CI for that bot-authored commit. It never checks out or executes pull-request code in the privileged `pull_request_target` context.
|
|
317
317
|
|
|
@@ -22,6 +22,8 @@ const REQUIRED_README_SNIPPETS = [
|
|
|
22
22
|
"profile: 'auto'",
|
|
23
23
|
'@ankhorage/utility/project',
|
|
24
24
|
'ankhorage-changeset',
|
|
25
|
+
'changeset-release/main',
|
|
26
|
+
'bun run changeset -- status --since=HEAD',
|
|
25
27
|
'.changeset/config.json',
|
|
26
28
|
'<!-- devtools-bun-policy:start -->',
|
|
27
29
|
'<!-- devtools-bun-policy:end -->',
|
|
@@ -11,8 +11,12 @@ export declare const changesetsPolicy: {
|
|
|
11
11
|
readonly 'changeset:status': "bun src/cli/bin/changeset.ts status --since=origin/main";
|
|
12
12
|
readonly 'version-packages': "bun src/cli/bin/changeset.ts version";
|
|
13
13
|
};
|
|
14
|
+
readonly workflowArguments: {
|
|
15
|
+
readonly versionPackagesStatus: readonly ["status", "--since=HEAD"];
|
|
16
|
+
};
|
|
14
17
|
readonly workflowCommands: {
|
|
15
18
|
readonly status: "bun run changeset:status";
|
|
19
|
+
readonly versionPackagesStatus: `bun run changeset -- ${string}`;
|
|
16
20
|
readonly version: "bun run version-packages";
|
|
17
21
|
readonly publish: "bun run changeset -- publish";
|
|
18
22
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const versionPackagesStatusArguments = ['status', '--since=HEAD'];
|
|
1
2
|
export const changesetsPolicy = {
|
|
2
3
|
packageName: '@changesets/cli',
|
|
3
4
|
binaryName: 'ankhorage-changeset',
|
|
@@ -11,8 +12,12 @@ export const changesetsPolicy = {
|
|
|
11
12
|
'changeset:status': 'bun src/cli/bin/changeset.ts status --since=origin/main',
|
|
12
13
|
'version-packages': 'bun src/cli/bin/changeset.ts version',
|
|
13
14
|
},
|
|
15
|
+
workflowArguments: {
|
|
16
|
+
versionPackagesStatus: versionPackagesStatusArguments,
|
|
17
|
+
},
|
|
14
18
|
workflowCommands: {
|
|
15
19
|
status: 'bun run changeset:status',
|
|
20
|
+
versionPackagesStatus: `bun run changeset -- ${versionPackagesStatusArguments.join(' ')}`,
|
|
16
21
|
version: 'bun run version-packages',
|
|
17
22
|
publish: 'bun run changeset -- publish',
|
|
18
23
|
},
|
|
@@ -84,8 +84,17 @@ jobs:
|
|
|
84
84
|
echo "No typecheck script found; skipping."
|
|
85
85
|
fi
|
|
86
86
|
|
|
87
|
+
- name: Validate Version Packages metadata
|
|
88
|
+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.head_ref == 'changeset-release/main'
|
|
89
|
+
run: |
|
|
90
|
+
if node -e "const p=require('./package.json'); process.exit(p.scripts?.changeset ? 0 : 1)"; then
|
|
91
|
+
__ANKH_CHANGESETS_VERSION_PACKAGES_STATUS_COMMAND__
|
|
92
|
+
else
|
|
93
|
+
echo "No changeset script found; skipping."
|
|
94
|
+
fi
|
|
95
|
+
|
|
87
96
|
- name: Check changesets
|
|
88
|
-
if: github.event_name == 'pull_request'
|
|
97
|
+
if: github.event_name == 'pull_request' && (github.event.pull_request.head.repo.full_name != github.repository || github.head_ref != 'changeset-release/main')
|
|
89
98
|
run: |
|
|
90
99
|
if node -e "const p=require('./package.json'); process.exit(p.scripts?.['changeset:status'] ? 0 : 1)"; then
|
|
91
100
|
__ANKH_CHANGESETS_STATUS_COMMAND__
|
|
@@ -18,4 +18,4 @@ jobs:
|
|
|
18
18
|
github.actor == 'renovate[bot]' &&
|
|
19
19
|
github.event.pull_request.head.repo.full_name == github.repository &&
|
|
20
20
|
startsWith(github.event.pull_request.head.ref, 'renovate/')
|
|
21
|
-
uses: ankhorage/renovate/.github/workflows/changeset.yml@
|
|
21
|
+
uses: ankhorage/renovate/.github/workflows/changeset.yml@ae2cde4673bb58c6659bc5a7bd16739fb6f0db5e
|
|
@@ -6,11 +6,13 @@ export async function renderWorkflowAsync(sourceUrl, policy) {
|
|
|
6
6
|
.replaceAll(BUN_VERSION_TOKEN, policy.bunVersion)
|
|
7
7
|
.replaceAll(CHANGESETS_PUBLISH_COMMAND_TOKEN, changesetsPolicy.workflowCommands.publish)
|
|
8
8
|
.replaceAll(CHANGESETS_STATUS_COMMAND_TOKEN, changesetsPolicy.workflowCommands.status)
|
|
9
|
+
.replaceAll(CHANGESETS_VERSION_PACKAGES_STATUS_COMMAND_TOKEN, changesetsPolicy.workflowCommands.versionPackagesStatus)
|
|
9
10
|
.replaceAll(CHANGESETS_VERSION_COMMAND_TOKEN, changesetsPolicy.workflowCommands.version)
|
|
10
11
|
.replaceAll(NODE_VERSION_TOKEN, policy.nodeVersion);
|
|
11
12
|
}
|
|
12
13
|
const BUN_VERSION_TOKEN = '__ANKH_BUN_VERSION__';
|
|
13
14
|
const CHANGESETS_PUBLISH_COMMAND_TOKEN = '__ANKH_CHANGESETS_PUBLISH_COMMAND__';
|
|
14
15
|
const CHANGESETS_STATUS_COMMAND_TOKEN = '__ANKH_CHANGESETS_STATUS_COMMAND__';
|
|
16
|
+
const CHANGESETS_VERSION_PACKAGES_STATUS_COMMAND_TOKEN = '__ANKH_CHANGESETS_VERSION_PACKAGES_STATUS_COMMAND__';
|
|
15
17
|
const CHANGESETS_VERSION_COMMAND_TOKEN = '__ANKH_CHANGESETS_VERSION_COMMAND__';
|
|
16
18
|
const NODE_VERSION_TOKEN = '__ANKH_NODE_VERSION__';
|
package/package.json
CHANGED