@ankhorage/devtools 1.6.1 → 1.7.0
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
CHANGED
|
@@ -101,7 +101,7 @@ The synchronized package scripts are:
|
|
|
101
101
|
"lint:fix": "ankhorage-eslint . --fix --max-warnings=0",
|
|
102
102
|
"format": "ankhorage-prettier --write .",
|
|
103
103
|
"format:check": "ankhorage-prettier --check .",
|
|
104
|
-
"knip": "ankhorage-knip"
|
|
104
|
+
"knip:check": "ankhorage-knip"
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
```
|
|
@@ -291,10 +291,13 @@ When this managed package contract changes, synchronization runs `bun install`.
|
|
|
291
291
|
|
|
292
292
|
```text
|
|
293
293
|
.github/workflows/ci.yml
|
|
294
|
+
.github/workflows/renovate.yml
|
|
294
295
|
.github/workflows/release.yml
|
|
295
296
|
```
|
|
296
297
|
|
|
297
|
-
|
|
298
|
+
CI and Release render their `bun-version` from the same managed Bun runtime policy used for `package.json`. 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.
|
|
299
|
+
|
|
300
|
+
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.
|
|
298
301
|
|
|
299
302
|
## Managed VS Code configuration
|
|
300
303
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* as a development dependency for normal consumers, while `@ankhorage/ankh` keeps devtools as a
|
|
6
6
|
* runtime dependency because the CLI loads it as a bundled core provider. Individually installed
|
|
7
7
|
* toolchain packages that devtools now owns are removed, and the canonical `lint`, `lint:fix`,
|
|
8
|
-
* `format`, `format:check`, and `knip` scripts are written.
|
|
8
|
+
* `format`, `format:check`, and `knip:check` scripts are written.
|
|
9
9
|
* Unrelated manifest fields, scripts, dependencies, and metadata are preserved.
|
|
10
10
|
*
|
|
11
11
|
* The Bun runtime policy is shared by every repository, including devtools itself. Devtools skips
|
|
@@ -30,7 +30,7 @@ const STANDARD_SCRIPTS = {
|
|
|
30
30
|
'lint:fix': 'ankhorage-eslint . --fix --max-warnings=0',
|
|
31
31
|
format: 'ankhorage-prettier --write .',
|
|
32
32
|
'format:check': 'ankhorage-prettier --check .',
|
|
33
|
-
knip: 'ankhorage-knip',
|
|
33
|
+
'knip:check': 'ankhorage-knip',
|
|
34
34
|
};
|
|
35
35
|
const DEVTOOLS_OWNED_DEV_DEPENDENCIES = [
|
|
36
36
|
'@eslint/js',
|
|
@@ -82,7 +82,9 @@ export function applyManagedPackageContract(manifest, devtoolsVersion) {
|
|
|
82
82
|
if (manifest.name === DEVTOOLS_PACKAGE_NAME) {
|
|
83
83
|
return applyBunRuntimePolicy(manifest);
|
|
84
84
|
}
|
|
85
|
-
const scripts = { ...toRecord(manifest.scripts)
|
|
85
|
+
const scripts = { ...toRecord(manifest.scripts) };
|
|
86
|
+
delete scripts.knip;
|
|
87
|
+
Object.assign(scripts, STANDARD_SCRIPTS);
|
|
86
88
|
const devDependencies = removeOwnedDependencies(toRecord(manifest.devDependencies));
|
|
87
89
|
const dependencies = toRecord(manifest.dependencies);
|
|
88
90
|
applyDevtoolsDependencyPlacement(manifest, dependencies, devDependencies, devtoolsVersion);
|
|
@@ -175,7 +177,8 @@ function normalizedDependencies(manifest, dependencies) {
|
|
|
175
177
|
: { dependencies };
|
|
176
178
|
}
|
|
177
179
|
function hasStandardScripts(scripts) {
|
|
178
|
-
return
|
|
180
|
+
return (scripts.knip === undefined &&
|
|
181
|
+
Object.entries(STANDARD_SCRIPTS).every(([name, command]) => scripts[name] === command));
|
|
179
182
|
}
|
|
180
183
|
function serializePackageManifest(manifest) {
|
|
181
184
|
return `${JSON.stringify(manifest, null, 2)}\n`;
|
|
@@ -5,6 +5,7 @@ on:
|
|
|
5
5
|
push:
|
|
6
6
|
branches:
|
|
7
7
|
- main
|
|
8
|
+
workflow_dispatch:
|
|
8
9
|
|
|
9
10
|
permissions:
|
|
10
11
|
contents: read
|
|
@@ -61,10 +62,10 @@ jobs:
|
|
|
61
62
|
|
|
62
63
|
- name: Run Knip
|
|
63
64
|
run: |
|
|
64
|
-
if node -e "const p=require('./package.json'); process.exit(p.scripts?.knip ? 0 : 1)"; then
|
|
65
|
-
bun run knip
|
|
65
|
+
if node -e "const p=require('./package.json'); process.exit(p.scripts?.['knip:check'] ? 0 : 1)"; then
|
|
66
|
+
bun run knip:check
|
|
66
67
|
else
|
|
67
|
-
echo "No knip script found; skipping."
|
|
68
|
+
echo "No knip:check script found; skipping."
|
|
68
69
|
fi
|
|
69
70
|
|
|
70
71
|
- name: Run tests
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Renovate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- reopened
|
|
8
|
+
- synchronize
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
actions: write
|
|
12
|
+
contents: write
|
|
13
|
+
pull-requests: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
changeset:
|
|
17
|
+
if: >-
|
|
18
|
+
github.actor == 'renovate[bot]' &&
|
|
19
|
+
github.event.pull_request.head.repo.full_name == github.repository &&
|
|
20
|
+
startsWith(github.event.pull_request.head.ref, 'renovate/')
|
|
21
|
+
uses: ankhorage/renovate/.github/workflows/changeset.yml@b7305e8f17f9b07238f6b827bbc9f866fd498a0f
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ManagedFileDefinition } from '../shared/managedFiles.js';
|
|
2
|
-
export declare const workflowManagedFiles: readonly [ManagedFileDefinition, ManagedFileDefinition];
|
|
2
|
+
export declare const workflowManagedFiles: readonly [ManagedFileDefinition, ManagedFileDefinition, ManagedFileDefinition];
|
|
@@ -5,6 +5,7 @@ const NODE_VERSION_TOKEN = '__ANKH_NODE_VERSION__';
|
|
|
5
5
|
export const workflowManagedFiles = [
|
|
6
6
|
createWorkflowDefinition('.github/workflows/ci.yml', './files/ci.yml'),
|
|
7
7
|
createWorkflowDefinition('.github/workflows/release.yml', './files/release.yml'),
|
|
8
|
+
createWorkflowDefinition('.github/workflows/renovate.yml', './files/renovate.yml'),
|
|
8
9
|
];
|
|
9
10
|
function createWorkflowDefinition(relativePath, sourcePath) {
|
|
10
11
|
const sourceUrl = new URL(sourcePath, import.meta.url);
|
package/package.json
CHANGED