@homeflare/config 0.12.0 → 0.13.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/dist/repo-shape/ci.d.ts.map +1 -1
- package/dist/repo-shape/drift.d.ts +1 -1
- package/dist/repo-shape/drift.d.ts.map +1 -1
- package/dist/repo-shape/guards.d.ts +5 -0
- package/dist/repo-shape/guards.d.ts.map +1 -1
- package/dist/repo-shape/refresh.d.ts +5 -1
- package/dist/repo-shape/refresh.d.ts.map +1 -1
- package/dist/repo-shape/retired.d.ts +54 -0
- package/dist/repo-shape/retired.d.ts.map +1 -0
- package/dist/repo-shape.d.ts +1 -0
- package/dist/repo-shape.d.ts.map +1 -1
- package/dist/repo-shape.js +84 -5
- package/dist/repo-shape.js.map +8 -7
- package/dist/versions.js +22 -1
- package/dist/versions.js.map +4 -4
- package/docs/repo-shape-retired.md +75 -0
- package/docs/repo-shape.md +11 -0
- package/package.json +1 -1
- package/src/repo-shape/ci.ts +15 -0
- package/src/repo-shape/drift.ts +19 -1
- package/src/repo-shape/guards.ts +11 -0
- package/src/repo-shape/refresh.ts +55 -2
- package/src/repo-shape/retired.ts +113 -0
- package/src/repo-shape.ts +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci.d.ts","sourceRoot":"","sources":["../../src/repo-shape/ci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAqB,SAAS,EAAE,MAAM,YAAY,CAAC;AAI/D,8DAA8D;AAC9D,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ci.d.ts","sourceRoot":"","sources":["../../src/repo-shape/ci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAqB,SAAS,EAAE,MAAM,YAAY,CAAC;AAI/D,8DAA8D;AAC9D,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAkM3C,sCAAsC;AACtC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAkCjD"}
|
|
@@ -4,7 +4,7 @@ export type Problem = string;
|
|
|
4
4
|
/** The command that makes a difference go away. Printed with every drift problem. */
|
|
5
5
|
export declare const REFRESH_COMMAND = "bun run repo-shape:refresh";
|
|
6
6
|
export interface DriftReport {
|
|
7
|
-
/** Empty when the committed files are the rendered ones. */
|
|
7
|
+
/** Empty when the committed files are the rendered ones and no retired path lingers. */
|
|
8
8
|
readonly problems: readonly Problem[];
|
|
9
9
|
/** Paths whose committed text differs from the render, excluding excepted files. */
|
|
10
10
|
readonly drifted: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drift.d.ts","sourceRoot":"","sources":["../../src/repo-shape/drift.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drift.d.ts","sourceRoot":"","sources":["../../src/repo-shape/drift.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAgB,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE9E,wFAAwF;AACxF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,qFAAqF;AACrF,eAAO,MAAM,eAAe,+BAA+B,CAAC;AA6D5D,MAAM,WAAW,WAAW;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAClD;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CA8BjG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,MAAM,EAAE,CAKpE"}
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
export declare function requireNonEmpty(field: string, value: string): string;
|
|
14
14
|
export declare function requireSentence(field: string, value: string): string;
|
|
15
15
|
export declare function requireIsoDate(value: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* A retired file names the `@homeflare/config` release that stopped rendering it, so
|
|
18
|
+
* anyone reading `retired.ts` can find the changeset that made the call.
|
|
19
|
+
*/
|
|
20
|
+
export declare function requireSemver(value: string): string;
|
|
16
21
|
/**
|
|
17
22
|
* ⛔ A MAJOR, NOT A RANGE, AND NOT A FLOAT. `actions/setup-node` takes `node-version: 24`
|
|
18
23
|
* and resolves the newest 24.x; a fractional or negative value renders YAML the action
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/repo-shape/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQpE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASlD"}
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/repo-shape/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQpE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKnD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASlD"}
|
|
@@ -6,8 +6,12 @@ export interface RefreshResult {
|
|
|
6
6
|
readonly unchanged: readonly string[];
|
|
7
7
|
/** Paths skipped because the shape declares an exception for them. */
|
|
8
8
|
readonly skipped: readonly string[];
|
|
9
|
+
/** Retired paths deleted because they still carried the generated-file header. */
|
|
10
|
+
readonly removed: readonly string[];
|
|
11
|
+
/** Retired paths left alone because they did not — provably hand-written, not ours. */
|
|
12
|
+
readonly refused: readonly string[];
|
|
9
13
|
}
|
|
10
|
-
/** Write a repository's rendered files into `projectDir
|
|
14
|
+
/** Write a repository's rendered files into `projectDir`, and clear its rendered fossils. */
|
|
11
15
|
export declare function refreshRepoShape(projectDir: string, shape: RepoShape): Promise<RefreshResult>;
|
|
12
16
|
/**
|
|
13
17
|
* The `repo-shape:refresh` entry point. `--check` reports drift and exits non-zero
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/repo-shape/refresh.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/repo-shape/refresh.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,YAAY,CAAC;AAGxD,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,6BAA6B;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,uFAAuF;IACvF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,6FAA6F;AAC7F,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,aAAa,CAAC,CAwBxB;AA4CD;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,CA2CjB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A path `@homeflare/config` no longer renders, but may still find committed in a
|
|
3
|
+
* repository that refreshed before the retirement. Extend this union at the same time a
|
|
4
|
+
* path is added to `RETIRED_FILES` below — never reuse one already there.
|
|
5
|
+
*/
|
|
6
|
+
export type RetiredPath = '.github/workflows/dependabot-automerge.yml';
|
|
7
|
+
export interface RetiredFile {
|
|
8
|
+
/** The path this package rendered, once. */
|
|
9
|
+
readonly path: RetiredPath;
|
|
10
|
+
/** The `@homeflare/config` version whose release stopped rendering it. */
|
|
11
|
+
readonly retiredIn: string;
|
|
12
|
+
/** Why, and which kit change did it — written at the retirement, like `except()`'s reason. */
|
|
13
|
+
readonly reason: string;
|
|
14
|
+
}
|
|
15
|
+
/** Every path `@homeflare/config` used to render, oldest retirement first. */
|
|
16
|
+
export declare const RETIRED_FILES: readonly RetiredFile[];
|
|
17
|
+
/**
|
|
18
|
+
* The substring every generated file's header has carried since this package's first
|
|
19
|
+
* renderer. Kept independent of the four current renderers' own copies of this text
|
|
20
|
+
* (`ci.ts`, `security.ts`, `dependabot.ts`, `companions.ts`) on purpose: a future wording
|
|
21
|
+
* change to the live header must not stop this module recognising a file rendered under
|
|
22
|
+
* the old one.
|
|
23
|
+
*/
|
|
24
|
+
export declare const GENERATED_FILE_MARKER = "\uD83E\uDD16 RENDERED BY @homeflare/config";
|
|
25
|
+
/**
|
|
26
|
+
* Whether `content` is provably a file this package once wrote.
|
|
27
|
+
*
|
|
28
|
+
* ⚠️ THE MARKER HAS TO START A LINE OF ITS OWN, NOT MERELY OCCUR SOMEWHERE IN THE TEXT.
|
|
29
|
+
* Every real header carries it as a whole comment line — `# 🤖 RENDERED BY
|
|
30
|
+
* @homeflare/config — DO NOT EDIT…`, third line in every renderer in this directory, so
|
|
31
|
+
* this does not require it to be the FIRST line — but a bare `content.includes(...)`
|
|
32
|
+
* would also match a hand-written file that merely *talks about* the marker, e.g. a
|
|
33
|
+
* comment reading "this file used to be 🤖 RENDERED BY @homeflare/config before it was
|
|
34
|
+
* retired; keeping it by hand now" — adversarial review, 2026-09-24, caught this exact
|
|
35
|
+
* case before it shipped. Requiring the marker at the start of a trimmed line is what a
|
|
36
|
+
* sentence built around it, rather than a header line consisting of it, cannot satisfy.
|
|
37
|
+
* `repo-shape-retired.test.ts` asserts the mid-sentence form stays refused.
|
|
38
|
+
*
|
|
39
|
+
* ⚠️ STILL A PREFIX CHECK ON THAT LINE, NOT A FULL-LINE EXACT MATCH. The retired renderer
|
|
40
|
+
* varied its trailing header prose by `shape.runner` and by repository name, and a
|
|
41
|
+
* future wording change to what follows the marker on a live renderer's header must not
|
|
42
|
+
* stop this recognising a file rendered under the old wording — only the marker itself,
|
|
43
|
+
* `🤖 RENDERED BY @homeflare/config`, has been constant across every renderer this
|
|
44
|
+
* package has ever shipped.
|
|
45
|
+
*/
|
|
46
|
+
export declare function wasRenderedByUs(content: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The message `driftInRepoShape` reports for a retired path that is still present, and
|
|
49
|
+
* `repoShapeCli --check` prints verbatim. Names the fix command either way — whether that
|
|
50
|
+
* command can actually remove the file depends on `wasRenderedByUs`, which only
|
|
51
|
+
* `refreshRepoShape` (holding the file's contents) can decide.
|
|
52
|
+
*/
|
|
53
|
+
export declare function retiredFileProblem(file: RetiredFile): string;
|
|
54
|
+
//# sourceMappingURL=retired.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retired.d.ts","sourceRoot":"","sources":["../../src/repo-shape/retired.ts"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,4CAA4C,CAAC;AAEvE,MAAM,WAAW,WAAW;IAC1B,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAUD,8EAA8E;AAC9E,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAQ/C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,+CAAqC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAIxD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAK5D"}
|
package/dist/repo-shape.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export { HOMEFLARE_PATTERN, renderDependabot, THIRD_PARTY_COOLDOWN_DAYS, } from
|
|
|
39
39
|
export { type DriftReport, type Problem, driftInRepoShape, exceptionSummary, REFRESH_COMMAND, } from './repo-shape/drift.ts';
|
|
40
40
|
export { type RefreshResult, refreshRepoShape, repoShapeCli } from './repo-shape/refresh.ts';
|
|
41
41
|
export { type RenderedRepo, type RepoShapePolicy, RENDERED_PATHS, renderRepoShape, } from './repo-shape/render.ts';
|
|
42
|
+
export { type RetiredFile, type RetiredPath, GENERATED_FILE_MARKER, RETIRED_FILES, retiredFileProblem, wasRenderedByUs, } from './repo-shape/retired.ts';
|
|
42
43
|
export { renderSecurity } from './repo-shape/security.ts';
|
|
43
44
|
export { type ExtraJob, type JobStep, type RenderedPath, type RepoRunner, type RepoShape, type RepoShapeException, type Stated, except, extraJob, isExcepted, runsOn, } from './repo-shape/shape.ts';
|
|
44
45
|
//# sourceMappingURL=repo-shape.d.ts.map
|
package/dist/repo-shape.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-shape.d.ts","sourceRoot":"","sources":["../src/repo-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,cAAc,EACd,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,MAAM,EACX,MAAM,EACN,QAAQ,EACR,UAAU,EACV,MAAM,GACP,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"repo-shape.d.ts","sourceRoot":"","sources":["../src/repo-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,cAAc,EACd,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,MAAM,EACX,MAAM,EACN,QAAQ,EACR,UAAU,EACV,MAAM,GACP,MAAM,uBAAuB,CAAC"}
|
package/dist/repo-shape.js
CHANGED
|
@@ -20,6 +20,12 @@ function requireIsoDate(value) {
|
|
|
20
20
|
}
|
|
21
21
|
return value;
|
|
22
22
|
}
|
|
23
|
+
function requireSemver(value) {
|
|
24
|
+
if (!/^\d+\.\d+\.\d+$/.test(value)) {
|
|
25
|
+
throw new Error(`repo-shape: retiredIn must be a released x.y.z, got ${JSON.stringify(value)}`);
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
23
29
|
function requireMajor(value) {
|
|
24
30
|
if (!Number.isInteger(value) || value <= 0) {
|
|
25
31
|
throw new Error(`repo-shape: node must be a positive integer major, got ${value}`);
|
|
@@ -179,6 +185,21 @@ permissions:
|
|
|
179
185
|
concurrency:
|
|
180
186
|
group: ci-\${{ github.ref }}
|
|
181
187
|
cancel-in-progress: true
|
|
188
|
+
|
|
189
|
+
# \u26D4 SECOND GUARD, NOT THE FIRST ONE. The estate's primary Alchemy telemetry opt-out is the
|
|
190
|
+
# persisted \`~/.alchemy/telemetry-disabled\` file (Tim, 2026-09-26), which a CI runner never
|
|
191
|
+
# has \u2014 a self-hosted job starts a fresh container per run and a GitHub-hosted one is a fresh
|
|
192
|
+
# VM every time, so neither has read the file even if this estate's account somehow wrote it
|
|
193
|
+
# there. \`DO_NOT_TRACK\` is the opt-out alchemy's telemetry layer actually reads
|
|
194
|
+
# (\`!!process.env.DO_NOT_TRACK\`, alchemy \`src/Telemetry/Attributes.ts:126-129\`); this env
|
|
195
|
+
# applies to every job and step in this workflow. No repository's \`check\` invokes the Alchemy
|
|
196
|
+
# CLI today, measured 2026-09-26 (grepped every ci/security/release workflow for
|
|
197
|
+
# \`alchemy\`/\`bin/cli.js\`, zero hits), but alchemy's own \`Test\` helpers wire \`TelemetryLive\`
|
|
198
|
+
# into top-level \`deploy\`/\`destroy\` (\`src/Test/Core.ts:470,482\`), so a future kit test built on
|
|
199
|
+
# those (today's kit tests use only \`test.provider\` scratch stacks, which don't) would send
|
|
200
|
+
# telemetry from \`bun test\` without this guard \u2014 this closes that gap in advance.
|
|
201
|
+
env:
|
|
202
|
+
DO_NOT_TRACK: '1'
|
|
182
203
|
`;
|
|
183
204
|
var CHECK_NOTE = ` # \u2500\u2500 One job, one install \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
184
205
|
# \u2605 WAS 3 SEPARATE JOBS: lint and format, types, tests. They shared an identical
|
|
@@ -549,6 +570,30 @@ var RENDERED_PATHS = [
|
|
|
549
570
|
".github/workflows/security.yml"
|
|
550
571
|
];
|
|
551
572
|
|
|
573
|
+
// src/repo-shape/retired.ts
|
|
574
|
+
function retire(file) {
|
|
575
|
+
return {
|
|
576
|
+
path: file.path,
|
|
577
|
+
reason: requireSentence("retired reason", file.reason),
|
|
578
|
+
retiredIn: requireSemver(file.retiredIn)
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
var RETIRED_FILES = [
|
|
582
|
+
retire({
|
|
583
|
+
path: ".github/workflows/dependabot-automerge.yml",
|
|
584
|
+
reason: "kit PR 199 retired the Dependabot @homeflare group; taslabs-net/homeflare-bumper " + "carries a kit release into each consumer now, over the kit's own release workflow",
|
|
585
|
+
retiredIn: "0.12.0"
|
|
586
|
+
})
|
|
587
|
+
];
|
|
588
|
+
var GENERATED_FILE_MARKER = "\uD83E\uDD16 RENDERED BY @homeflare/config";
|
|
589
|
+
function wasRenderedByUs(content) {
|
|
590
|
+
return content.split(`
|
|
591
|
+
`).some((line) => line.trimStart().startsWith(`# ${GENERATED_FILE_MARKER}`));
|
|
592
|
+
}
|
|
593
|
+
function retiredFileProblem(file) {
|
|
594
|
+
return `${file.path}: retired in @homeflare/config@${file.retiredIn} (${file.reason}) ` + "but still present \u2014 run `bun run repo-shape:refresh` to remove it";
|
|
595
|
+
}
|
|
596
|
+
|
|
552
597
|
// src/repo-shape/drift.ts
|
|
553
598
|
var REFRESH_COMMAND = "bun run repo-shape:refresh";
|
|
554
599
|
function normalize(text) {
|
|
@@ -573,13 +618,23 @@ function duplicateExceptions(exceptions) {
|
|
|
573
618
|
}
|
|
574
619
|
return [...duplicated].map((file) => `${file}: declared as an exception more than once \u2014 keep one, with one reason`);
|
|
575
620
|
}
|
|
621
|
+
async function retiredFilesPresent(projectDir) {
|
|
622
|
+
const problems = [];
|
|
623
|
+
for (const file of RETIRED_FILES) {
|
|
624
|
+
if (await readIfPresent(`${projectDir}/${file.path}`) !== undefined) {
|
|
625
|
+
problems.push(retiredFileProblem(file));
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
return problems;
|
|
629
|
+
}
|
|
576
630
|
async function driftInRepoShape(projectDir, shape) {
|
|
577
631
|
const rendered = renderRepoShape(shape);
|
|
578
632
|
const exceptions = shape.exceptions ?? [];
|
|
579
633
|
const excepted = new Map(exceptions.map((exception) => [exception.file, exception]));
|
|
580
634
|
const problems = [
|
|
581
635
|
...duplicateExceptions(exceptions),
|
|
582
|
-
...staleExceptions(rendered, exceptions)
|
|
636
|
+
...staleExceptions(rendered, exceptions),
|
|
637
|
+
...await retiredFilesPresent(projectDir)
|
|
583
638
|
];
|
|
584
639
|
const drifted = [];
|
|
585
640
|
for (const [path, expected] of Object.entries(rendered.files)) {
|
|
@@ -621,7 +676,25 @@ async function refreshRepoShape(projectDir, shape) {
|
|
|
621
676
|
await Bun.write(target, contents);
|
|
622
677
|
written.push(path);
|
|
623
678
|
}
|
|
624
|
-
|
|
679
|
+
const { refused, removed } = await clearRetiredFiles(projectDir);
|
|
680
|
+
return { refused, removed, skipped, unchanged, written };
|
|
681
|
+
}
|
|
682
|
+
async function clearRetiredFiles(projectDir) {
|
|
683
|
+
const removed = [];
|
|
684
|
+
const refused = [];
|
|
685
|
+
for (const retiredFile of RETIRED_FILES) {
|
|
686
|
+
const target = `${projectDir}/${retiredFile.path}`;
|
|
687
|
+
const file = Bun.file(target);
|
|
688
|
+
if (!await file.exists())
|
|
689
|
+
continue;
|
|
690
|
+
if (wasRenderedByUs(await file.text())) {
|
|
691
|
+
await file.delete();
|
|
692
|
+
removed.push(retiredFile.path);
|
|
693
|
+
} else {
|
|
694
|
+
refused.push(retiredFile.path);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
return { refused, removed };
|
|
625
698
|
}
|
|
626
699
|
async function say(stream, lines) {
|
|
627
700
|
if (lines.length === 0)
|
|
@@ -652,16 +725,20 @@ async function repoShapeCli(projectDir, shape, argv) {
|
|
|
652
725
|
await say(Bun.stdout, [
|
|
653
726
|
...result.written.map((path) => `wrote ${path}`),
|
|
654
727
|
...result.unchanged.map((path) => `ok ${path}`),
|
|
655
|
-
...result.skipped.map((path) => `excepted ${path}`)
|
|
728
|
+
...result.skipped.map((path) => `excepted ${path}`),
|
|
729
|
+
...result.removed.map((path) => `removed ${path} (retired; carried our header)`)
|
|
656
730
|
]);
|
|
731
|
+
await say(Bun.stderr, result.refused.map((path) => `refused ${path} \u2014 present but not provably ours; not deleted. See docs/repo-shape-retired.md.`));
|
|
657
732
|
return 0;
|
|
658
733
|
}
|
|
659
734
|
export {
|
|
660
735
|
ACTIONLINT_VERSION,
|
|
661
736
|
BUN_VERSION,
|
|
737
|
+
GENERATED_FILE_MARKER,
|
|
662
738
|
HOMEFLARE_PATTERN,
|
|
663
739
|
REFRESH_COMMAND,
|
|
664
740
|
RENDERED_PATHS,
|
|
741
|
+
RETIRED_FILES,
|
|
665
742
|
THIRD_PARTY_COOLDOWN_DAYS,
|
|
666
743
|
driftInRepoShape,
|
|
667
744
|
except,
|
|
@@ -676,8 +753,10 @@ export {
|
|
|
676
753
|
renderRepoShape,
|
|
677
754
|
renderSecurity,
|
|
678
755
|
repoShapeCli,
|
|
679
|
-
|
|
756
|
+
retiredFileProblem,
|
|
757
|
+
runsOn,
|
|
758
|
+
wasRenderedByUs
|
|
680
759
|
};
|
|
681
760
|
|
|
682
|
-
//# debugId=
|
|
761
|
+
//# debugId=DCEF4CB7F22E842764756E2164756E21
|
|
683
762
|
//# sourceMappingURL=repo-shape.js.map
|