Skip to content

Commit db5efa9

Browse files
committed
chore(sync): pre-formatted template scripts (no behavior change)
The template's TypeBox source files now ship pre-formatted to fleet oxfmt style, so cascades are byte-identical. Pure formatting + doc-comment cleanup; no behavior change. Synced via: node scripts/sync-scaffolding.mts --target . --fix DISABLE_PRECOMMIT_TEST=1 — sync operation, not feature work.
1 parent 918465a commit db5efa9

4 files changed

Lines changed: 25 additions & 22 deletions

File tree

scripts/lockstep-schema.mts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const UpstreamRefSchema = Type.String({
4949

5050
const ConformanceTestSchema = Type.String({
5151
description:
52-
"Path (relative to repo root) of a test that enforces behavior parity (modulo documented deviations). Strongly recommended — static checks catch syntactic drift, not behavioral. A row without a conformance test relies entirely on code-pattern / fixture-snapshot checks.",
52+
'Path (relative to repo root) of a test that enforces behavior parity (modulo documented deviations). Strongly recommended — static checks catch syntactic drift, not behavioral. A row without a conformance test relies entirely on code-pattern / fixture-snapshot checks.',
5353
})
5454

5555
const NotesSchema = Type.String({
@@ -59,13 +59,10 @@ const NotesSchema = Type.String({
5959

6060
const PortStatusSchema = Type.Object(
6161
{
62-
status: Type.Union(
63-
[Type.Literal('implemented'), Type.Literal('opt-out')],
64-
{
65-
description:
66-
'`implemented` = port meets the row\'s assertions; `opt-out` = port consciously skips this row (requires `reason`).',
67-
},
68-
),
62+
status: Type.Union([Type.Literal('implemented'), Type.Literal('opt-out')], {
63+
description:
64+
"`implemented` = port meets the row's assertions; `opt-out` = port consciously skips this row (requires `reason`).",
65+
}),
6966
reason: Type.Optional(
7067
Type.String({
7168
description:
@@ -123,7 +120,7 @@ const SiteSchema = Type.Object(
123120
language: Type.Optional(
124121
Type.String({
125122
description:
126-
'Language label for human reports (e.g. `cpp`, `go`, `rust`, `typescript`). The harness does no language-specific processing — it\'s purely informational.',
123+
"Language label for human reports (e.g. `cpp`, `go`, `rust`, `typescript`). The harness does no language-specific processing — it's purely informational.",
127124
}),
128125
),
129126
},
@@ -194,7 +191,8 @@ const FileForkRowSchema = Type.Object(
194191
conformance_test: Type.Optional(ConformanceTestSchema),
195192
notes: Type.Optional(NotesSchema),
196193
local: Type.String({
197-
description: 'Path (relative to repo root) of our ported copy of the upstream file.',
194+
description:
195+
'Path (relative to repo root) of our ported copy of the upstream file.',
198196
}),
199197
upstream_path: Type.String({
200198
description:
@@ -208,7 +206,7 @@ const FileForkRowSchema = Type.Object(
208206
deviations: Type.Array(Type.String(), {
209207
minItems: 1,
210208
description:
211-
"Human-readable list of intentional differences from upstream. Zero deviations = the file should not be forked; consume upstream directly. Each entry is one short sentence (e.g. `swap require() for import` or `remove Node 14 fallback`).",
209+
'Human-readable list of intentional differences from upstream. Zero deviations = the file should not be forked; consume upstream directly. Each entry is one short sentence (e.g. `swap require() for import` or `remove Node 14 fallback`).',
212210
}),
213211
},
214212
{
@@ -445,7 +443,7 @@ export const LockstepManifestSchema = Type.Object(
445443
},
446444
{
447445
description:
448-
"Unified lock-step manifest shared across Socket repos. One schema, all cases — the `kind` discriminator on each row selects which flavor of lock-step applies. Single-file manifests work for repos with one cohesive concern; the `includes[]` field carves a manifest into per-area files (e.g. lockstep-acorn.json + lockstep-build.json) when one repo tracks multiple independent concerns.",
446+
'Unified lock-step manifest shared across Socket repos. One schema, all cases — the `kind` discriminator on each row selects which flavor of lock-step applies. Single-file manifests work for repos with one cohesive concern; the `includes[]` field carves a manifest into per-area files (e.g. lockstep-acorn.json + lockstep-build.json) when one repo tracks multiple independent concerns.',
449447
},
450448
)
451449

scripts/lockstep.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ function loadManifestTree(rootManifestPath: string): {
184184
for (const rel of includes) {
185185
const subPath = path.resolve(baseDir, rel)
186186
const sub = readManifest(subPath)
187-
const area = sub.area ?? path.basename(rel, '.json').replace(/^lockstep-/, '')
187+
const area =
188+
sub.area ?? path.basename(rel, '.json').replace(/^lockstep-/, '')
188189
areas.push({ area, manifest: sub })
189190
}
190191

scripts/socket-repo-template-emit-schema.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ const rootDir = path.resolve(__dirname, '..')
2323
// Schema lives in `.config/` next to the per-repo
2424
// `.config/socket-repo-template.json` it describes — the marker's
2525
// `$schema` ref is `./socket-repo-template-schema.json`.
26-
const outPath = path.join(rootDir, '.config', 'socket-repo-template-schema.json')
26+
const outPath = path.join(
27+
rootDir,
28+
'.config',
29+
'socket-repo-template-schema.json',
30+
)
2731

2832
const enriched = {
2933
$schema: 'https://json-schema.org/draft/2020-12/schema',

scripts/socket-repo-template-schema.mts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* @fileoverview TypeBox schema for the per-fleet-repo socket-repo-template
3-
* config consumed by `sync-scaffolding`. Canonical filename is
4-
* `.config/socket-repo-template.json`; the legacy
5-
* `.socket-repo-template.json` at the repo root is still accepted by
6-
* the loader for back-compat.
3+
* config consumed by `sync-scaffolding`. Two valid locations:
4+
* `.config/socket-repo-template.json` (primary) or
5+
* `.socket-repo-template.json` at the repo root (alternative). Both are
6+
* first-class — pick the location that fits your repo's convention.
77
*
88
* Each fleet repo (socket-lib, socket-cli, ultrathink, …) ships this
9-
* config declaring its kind + any per-repo opt-ins. The runner reads
10-
* it to decide which optional files the repo is expected to ship and
11-
* which it must not ship.
9+
* config declaring its `layout` + `native` axes plus any per-repo
10+
* opt-ins. The runner reads it to decide which optional files the
11+
* repo is expected to ship and which it must not ship.
1212
*
1313
* Source-of-truth flow:
1414
* - This TypeBox source → `Static<typeof SocketRepoTemplateConfigSchema>`
@@ -272,7 +272,7 @@ export const SocketRepoTemplateConfigSchema = Type.Object(
272272
},
273273
{
274274
description:
275-
'Per-repo socket-repo-template config. Two valid locations: `.config/socket-repo-template.json` (primary) or `.socket-repo-template.json` at the repo root (alternative). Both are first-class — pick the location that fits your repo\'s convention.',
275+
"Per-repo socket-repo-template config. Two valid locations: `.config/socket-repo-template.json` (primary) or `.socket-repo-template.json` at the repo root (alternative). Both are first-class — pick the location that fits your repo's convention.",
276276
},
277277
)
278278

0 commit comments

Comments
 (0)