create-geonosis 2.13.0 → 3.0.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/CHANGELOG.md +23 -0
- package/bin/create-geonosis.mjs +1 -1
- package/dist/adopt.js +144 -0
- package/dist/answers.d.ts +42 -0
- package/dist/answers.js +111 -0
- package/dist/check.d.ts +24 -0
- package/dist/check.js +62 -0
- package/dist/composition.d.ts +46 -0
- package/dist/composition.js +137 -0
- package/dist/corpus.d.ts +16 -0
- package/dist/corpus.js +46 -0
- package/dist/create-geonosis-cli.js +41 -229
- package/dist/files.d.ts +18 -0
- package/dist/files.js +497 -0
- package/dist/floor-versions.d.ts +29 -0
- package/dist/floor-versions.js +35 -0
- package/dist/index.d.ts +7 -170
- package/dist/index.js +16 -19
- package/dist/layout.d.ts +18 -0
- package/dist/layout.js +164 -0
- package/dist/scaffold.d.ts +36 -0
- package/dist/scaffold.js +173 -0
- package/package.json +5 -4
- package/dist/chunk-LUUI74BB.js +0 -1224
package/dist/files.js
ADDED
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
// src/files.ts
|
|
2
|
+
import {
|
|
3
|
+
countersFor,
|
|
4
|
+
LAW_SOURCE,
|
|
5
|
+
LOADED_VERSION,
|
|
6
|
+
oxlintConfigFor,
|
|
7
|
+
rulesFor,
|
|
8
|
+
tiersFor
|
|
9
|
+
} from "@geonosis/cli";
|
|
10
|
+
import { CORPUS_DIR, corpusFor } from "./corpus.js";
|
|
11
|
+
import { TOOL_VERSIONS, TOOLS_RUNTIME } from "./floor-versions.js";
|
|
12
|
+
import { workspacesOf } from "./layout.js";
|
|
13
|
+
var VERSION = LOADED_VERSION;
|
|
14
|
+
var CATALOG = TOOL_VERSIONS;
|
|
15
|
+
var REACT = { "@types/react": "^19.0.0", react: "^19.0.0" };
|
|
16
|
+
var json = (value) => `${JSON.stringify(value, undefined, 2)}
|
|
17
|
+
`;
|
|
18
|
+
var exec = (runtime) => runtime === "bun" ? "bunx" : "npx";
|
|
19
|
+
var run = (runtime) => runtime === "bun" ? "bun run" : "pnpm";
|
|
20
|
+
var everyWorkspace = (runtime, script) => runtime === "bun" ? `bun run --filter '*' ${script}` : `pnpm -r ${script}`;
|
|
21
|
+
var presetsFor = (answers) => [
|
|
22
|
+
"tooling",
|
|
23
|
+
...answers.ui === "none" ? [] : ["frontend"],
|
|
24
|
+
...answers.backend === "none" ? [] : ["tenant-scoping"],
|
|
25
|
+
...answers.backend === "medusa" ? ["backend-medusa"] : [],
|
|
26
|
+
...answers.backend === "sagaflow-cf" ? ["backend-workflows-cf"] : [],
|
|
27
|
+
...answers.themekit === undefined ? [] : ["themekit"]
|
|
28
|
+
];
|
|
29
|
+
var tokenPrefix = (name) => `--${name.toLowerCase().replaceAll(/[^a-z]/g, "").slice(0, 3)}-`;
|
|
30
|
+
var answersForRules = (answers) => ({
|
|
31
|
+
"layer-walls": ["error", { layers: [] }],
|
|
32
|
+
...answers.brand === undefined ? {} : {
|
|
33
|
+
"no-brand-names": [
|
|
34
|
+
"error",
|
|
35
|
+
{ allowedSubstrings: [`${answers.scope}/`], brands: [answers.brand] }
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
...answers.ui === "none" ? {} : {
|
|
39
|
+
"no-raw-html-atoms": [
|
|
40
|
+
"error",
|
|
41
|
+
[{ atom: "Button", element: "button", importPath: `${answers.scope}/ui/atoms/button` }]
|
|
42
|
+
],
|
|
43
|
+
"no-runtime-dead-affordance": [
|
|
44
|
+
"error",
|
|
45
|
+
[{ atom: "Button", element: "button", importPath: `${answers.scope}/ui/atoms/button` }]
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
...answers.backend === "medusa" ? {
|
|
49
|
+
"plugin-route-namespaced": [
|
|
50
|
+
"error",
|
|
51
|
+
{
|
|
52
|
+
packages: [
|
|
53
|
+
{
|
|
54
|
+
name: `${answers.scope}/{dir}`,
|
|
55
|
+
namespaced: true,
|
|
56
|
+
under: "packages/medusa-plugins"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
} : {},
|
|
62
|
+
...answers.backend === "sagaflow-cf" ? {
|
|
63
|
+
"step-opens-its-own-cell": [
|
|
64
|
+
"error",
|
|
65
|
+
{
|
|
66
|
+
engine: "sagaflow-js",
|
|
67
|
+
within: "packages/backend/src/workflows/",
|
|
68
|
+
wrapper: "packages/backend/src/workflows/step\\.ts$"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
} : {},
|
|
72
|
+
...answers.themekit === undefined ? {} : {
|
|
73
|
+
"font-roles-only": ["error", { roles: ["body", "display"] }],
|
|
74
|
+
"tokens-only-colors": ["error", { tokenPrefix: [tokenPrefix(answers.name)] }]
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
var exportsOf = (workspace) => Object.fromEntries(Object.keys(workspace.sources).filter((file) => !file.includes(".test.")).toSorted().map((file) => [`./${file.replace(/^src\//, "").replace(/\.tsx?$/, "")}`, `./${file}`]));
|
|
78
|
+
var workspaceManifest = (workspace, answers, workspaces) => {
|
|
79
|
+
const react = workspace.dir === "packages/ui";
|
|
80
|
+
return json({
|
|
81
|
+
name: workspace.name,
|
|
82
|
+
version: "0.0.0",
|
|
83
|
+
private: true,
|
|
84
|
+
type: "module",
|
|
85
|
+
exports: exportsOf(workspace),
|
|
86
|
+
scripts: {
|
|
87
|
+
lint: "oxlint --config ../../.oxlintrc.json .",
|
|
88
|
+
test: "vitest run --reporter=default --reporter=json --outputFile=.geonosis/vitest.json",
|
|
89
|
+
typecheck: "tsc --noEmit"
|
|
90
|
+
},
|
|
91
|
+
devDependencies: {
|
|
92
|
+
"@types/node": "catalog:",
|
|
93
|
+
...react ? { "@types/react": "catalog:", react: "catalog:" } : {},
|
|
94
|
+
oxlint: "catalog:",
|
|
95
|
+
typescript: "catalog:",
|
|
96
|
+
vitest: "catalog:"
|
|
97
|
+
},
|
|
98
|
+
dependencies: {
|
|
99
|
+
...Object.fromEntries(workspace.mayDependOn.flatMap((tag) => {
|
|
100
|
+
const found = workspaces.find((one) => one.tag === tag);
|
|
101
|
+
return found === undefined || found.name === workspace.name ? [] : [[found.name, "workspace:*"]];
|
|
102
|
+
})),
|
|
103
|
+
...Object.fromEntries(Object.entries(workspace.packages ?? {}).filter(([name]) => answers.kit === undefined || !name.startsWith("@geonosis/")))
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
var kitDependencies = (answers) => ({
|
|
108
|
+
"@geonosis/cli": `^${VERSION}`,
|
|
109
|
+
"@geonosis/doctor": `^${VERSION}`,
|
|
110
|
+
"@geonosis/ledger": `^${VERSION}`,
|
|
111
|
+
"@geonosis/oxlint-plugin-biological-architecture": `^${VERSION}`,
|
|
112
|
+
"@geonosis/ratchet": `^${VERSION}`,
|
|
113
|
+
"@geonosis/verify": `^${VERSION}`,
|
|
114
|
+
...answers.themekit === undefined ? {} : { "@geonosis/themekit": `^${VERSION}` }
|
|
115
|
+
});
|
|
116
|
+
var GRAPH_SYNCS = [
|
|
117
|
+
{ target: "turbo", write: "turbo.json" },
|
|
118
|
+
{ target: "layer-walls", write: ".oxlintrc.json" }
|
|
119
|
+
];
|
|
120
|
+
var graphScript = GRAPH_SYNCS.map(({ target, write }) => `geonosis-ledger sync --target ${target} --write ${write}`).join(" && ");
|
|
121
|
+
var HOOK_INSTALLER = "scripts/install-hooks.mjs";
|
|
122
|
+
var hookInstaller = () => [
|
|
123
|
+
"import { spawnSync } from 'node:child_process'",
|
|
124
|
+
"import { existsSync, lstatSync } from 'node:fs'",
|
|
125
|
+
"import { join, resolve } from 'node:path'",
|
|
126
|
+
"",
|
|
127
|
+
"const git = (...args) => {",
|
|
128
|
+
" const done = spawnSync('git', args, { encoding: 'utf8' })",
|
|
129
|
+
"",
|
|
130
|
+
" return done.status === 0 ? done.stdout.trim() : undefined",
|
|
131
|
+
"}",
|
|
132
|
+
"",
|
|
133
|
+
"const say = (line) => process.stdout.write(`install-hooks: ${line}\n`)",
|
|
134
|
+
"",
|
|
135
|
+
"const common = git('rev-parse', '--path-format=absolute', '--git-common-dir')",
|
|
136
|
+
"if (common === undefined) {",
|
|
137
|
+
" say('git says nothing about this directory, so there is no hooks path to install into.')",
|
|
138
|
+
" process.exit(0)",
|
|
139
|
+
"}",
|
|
140
|
+
"",
|
|
141
|
+
"// A worktree's own .git is a FILE; the hooks it would install into belong to the checkout the",
|
|
142
|
+
"// common dir names, and writing them from here changes the tree somebody else is in.",
|
|
143
|
+
"const here = resolve(process.cwd(), '.git')",
|
|
144
|
+
"if (existsSync(here) && lstatSync(here).isFile() && resolve(common) !== here) {",
|
|
145
|
+
" say(`this is a git worktree and its hooks path is shared with ${common} — install them there instead.`)",
|
|
146
|
+
" process.exit(0)",
|
|
147
|
+
"}",
|
|
148
|
+
"",
|
|
149
|
+
"const lefthook = join(process.cwd(), 'node_modules/.bin/lefthook')",
|
|
150
|
+
"if (!existsSync(lefthook)) {",
|
|
151
|
+
" say('lefthook is not installed here yet, so no hook was written.')",
|
|
152
|
+
" process.exit(0)",
|
|
153
|
+
"}",
|
|
154
|
+
"",
|
|
155
|
+
"const done = spawnSync(lefthook, ['install'], { stdio: 'inherit' })",
|
|
156
|
+
"process.exit(done.status ?? 0)",
|
|
157
|
+
""
|
|
158
|
+
].join(`
|
|
159
|
+
`);
|
|
160
|
+
var rootScripts = ({ runtime }) => ({
|
|
161
|
+
doctor: "geonosis-doctor",
|
|
162
|
+
prepare: `node ${HOOK_INSTALLER}`,
|
|
163
|
+
"format:check": "oxfmt --config .oxfmtrc.json --check .",
|
|
164
|
+
format: "oxfmt --config .oxfmtrc.json .",
|
|
165
|
+
lint: "oxlint --config .oxlintrc.json .",
|
|
166
|
+
prove: "geonosis-ratchet --prove",
|
|
167
|
+
ratchet: "geonosis-ratchet",
|
|
168
|
+
"sync:graph": graphScript,
|
|
169
|
+
sync: "geonosis sync",
|
|
170
|
+
test: everyWorkspace(runtime, "test"),
|
|
171
|
+
typecheck: everyWorkspace(runtime, "typecheck"),
|
|
172
|
+
verify: "geonosis-verify"
|
|
173
|
+
});
|
|
174
|
+
var rootManifest = (answers) => {
|
|
175
|
+
const { runtime } = answers;
|
|
176
|
+
const globs = ["apps/*", "packages/*"];
|
|
177
|
+
return json({
|
|
178
|
+
name: answers.name,
|
|
179
|
+
version: "0.0.0",
|
|
180
|
+
private: true,
|
|
181
|
+
type: "module",
|
|
182
|
+
...runtime === "pnpm" ? TOOLS_RUNTIME : {},
|
|
183
|
+
...runtime === "bun" ? {
|
|
184
|
+
workspaces: {
|
|
185
|
+
catalog: { ...CATALOG, ...answers.ui === "none" ? {} : REACT },
|
|
186
|
+
packages: globs
|
|
187
|
+
}
|
|
188
|
+
} : {},
|
|
189
|
+
scripts: rootScripts(answers),
|
|
190
|
+
devDependencies: {
|
|
191
|
+
...answers.kit === undefined ? kitDependencies(answers) : {},
|
|
192
|
+
"@types/node": "catalog:",
|
|
193
|
+
...answers.ui === "none" ? {} : { "@types/react": "catalog:", react: "catalog:" },
|
|
194
|
+
lefthook: "^2.1.0",
|
|
195
|
+
oxfmt: "catalog:",
|
|
196
|
+
oxlint: "catalog:",
|
|
197
|
+
turbo: "^2.10.0",
|
|
198
|
+
typescript: "catalog:",
|
|
199
|
+
vitest: "catalog:"
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
var workspaceYaml = (answers) => [
|
|
204
|
+
"packages:",
|
|
205
|
+
" - apps/*",
|
|
206
|
+
" - packages/*",
|
|
207
|
+
"",
|
|
208
|
+
"# One version of a shared dependency, named once. A repo whose workspaces each pin their own",
|
|
209
|
+
"# typescript is a repo where one of them typechecks against a compiler the others do not run.",
|
|
210
|
+
"catalog:",
|
|
211
|
+
...Object.entries({ ...CATALOG, ...answers.ui === "none" ? {} : REACT }).toSorted(([a], [b]) => a.localeCompare(b, "en-US")).map(([name, spec]) => ` '${name}': '${spec}'`),
|
|
212
|
+
"",
|
|
213
|
+
"# pnpm 11 runs no dependency's install script unless it is named here. esbuild fetches its",
|
|
214
|
+
"# platform binary in one, and without it vitest cannot start — a test suite that cannot run",
|
|
215
|
+
"# reports nothing, which is the shape of green this kit exists to refuse.",
|
|
216
|
+
"allowBuilds:",
|
|
217
|
+
" esbuild: true",
|
|
218
|
+
" lefthook: true",
|
|
219
|
+
""
|
|
220
|
+
].join(`
|
|
221
|
+
`);
|
|
222
|
+
var architecture = (answers, workspaces) => [
|
|
223
|
+
`# ${answers.name} — target architecture`,
|
|
224
|
+
"",
|
|
225
|
+
"The edges table is the ONE place this graph is written down. `geonosis sync --target turbo`",
|
|
226
|
+
"generates turbo's `boundaries.tags` from it, and `--target layer-walls` generates the linter's",
|
|
227
|
+
"layers from it, so a tag added here reaches both gates and neither can drift from the other.",
|
|
228
|
+
"",
|
|
229
|
+
"| tag | packages | may depend on |",
|
|
230
|
+
"| --- | --- | --- |",
|
|
231
|
+
...workspaces.map((one) => `| ${one.tag} | ${one.name} | ${one.mayDependOn.join(", ") || "—"} |`),
|
|
232
|
+
"",
|
|
233
|
+
...answers.backend === "medusa" ? [
|
|
234
|
+
"Medusa plugins go under `packages/medusa-plugins/<name>`; the `plugin-route-namespaced`",
|
|
235
|
+
"rule is configured for that root, so a store route without a namespace is refused.",
|
|
236
|
+
""
|
|
237
|
+
] : []
|
|
238
|
+
].join(`
|
|
239
|
+
`);
|
|
240
|
+
var pipeline = (answers) => [
|
|
241
|
+
"# Pipeline: order placed",
|
|
242
|
+
"",
|
|
243
|
+
"One page per pipeline, and this is the template. Say what enters, what each hop does to it, and",
|
|
244
|
+
"what leaves — then keep the diagram beside the code that implements it.",
|
|
245
|
+
"",
|
|
246
|
+
"```mermaid",
|
|
247
|
+
"graph LR",
|
|
248
|
+
` IN[request] --> APP[${answers.scope}/web]`,
|
|
249
|
+
` APP --> CORE[${answers.scope}/core]`,
|
|
250
|
+
...answers.backend === "none" ? [] : [` APP --> BACK[${answers.scope}/backend]`],
|
|
251
|
+
" CORE --> OUT[response]",
|
|
252
|
+
"```",
|
|
253
|
+
"",
|
|
254
|
+
"| Hop | Owns | Fails how |",
|
|
255
|
+
"| --- | --- | --- |",
|
|
256
|
+
"| entry | shape of the request | refuses, never guesses |",
|
|
257
|
+
"| core | the calculation | pure, so it is tested without a server |",
|
|
258
|
+
"| exit | the response | one shape, named |",
|
|
259
|
+
""
|
|
260
|
+
].join(`
|
|
261
|
+
`);
|
|
262
|
+
var law = (answers) => [
|
|
263
|
+
`# ${answers.name} — repo doctrine`,
|
|
264
|
+
"",
|
|
265
|
+
`A ${answers.runtime} monorepo on the geonosis kit. \`docs/architecture.md\` is the graph;`,
|
|
266
|
+
"`docs/pipelines/` is one page per flow. Depth belongs in skills and in the rules, never here.",
|
|
267
|
+
"",
|
|
268
|
+
"## The laws",
|
|
269
|
+
"",
|
|
270
|
+
"**1. RED → GREEN.** Every new rule, constraint or invariant begins with a failing test. Write",
|
|
271
|
+
"it, watch it fail, then write the code that makes it pass. A test written afterwards validates",
|
|
272
|
+
"what was built, not what was intended.",
|
|
273
|
+
"",
|
|
274
|
+
"**2. Never downgrade a rule.** Setting one to `warn` or `off`, narrowing its globs, adding a",
|
|
275
|
+
"file to `ignorePatterns` or silencing it with a disable comment — all forbidden without asking.",
|
|
276
|
+
"A gate breaking because real code violates a real invariant is enforcement working.",
|
|
277
|
+
"",
|
|
278
|
+
"**3. No suppression.** No `@ts-ignore`, no `@ts-expect-error`. Fix the type, or ask.",
|
|
279
|
+
"",
|
|
280
|
+
`**4. oxfmt only.** \`${run(answers.runtime)} format\` writes, \`${run(answers.runtime)} format:check\` verifies. Never`,
|
|
281
|
+
"prettier: it is not a dependency here, so it downloads itself and reformats with its own defaults.",
|
|
282
|
+
"",
|
|
283
|
+
"**5. Nothing is hardcoded to a repo.** Every list a rule needs is an option.",
|
|
284
|
+
"",
|
|
285
|
+
"**6. Test what the code does, not how.** Never assert on class names or DOM structure.",
|
|
286
|
+
"",
|
|
287
|
+
"## The gates",
|
|
288
|
+
"",
|
|
289
|
+
"```bash",
|
|
290
|
+
"geonosis verify full # typecheck → lint → test → format → ratchet",
|
|
291
|
+
"geonosis doctor # loaded, exercised, baseline, runner, drift",
|
|
292
|
+
"```",
|
|
293
|
+
"",
|
|
294
|
+
"`gate-baseline.json` holds one number per counter, and a number may only shrink. A counter that",
|
|
295
|
+
"grew fails; one that shrank rewrites the baseline down in the commit that earned it.",
|
|
296
|
+
"",
|
|
297
|
+
"## The method",
|
|
298
|
+
"",
|
|
299
|
+
"The `geonosis` Claude Code plugin carries the hooks, agents and skills:",
|
|
300
|
+
"",
|
|
301
|
+
"```bash",
|
|
302
|
+
`claude plugin marketplace add ${answers.marketplace ?? "microcompanies/geonosis"}`,
|
|
303
|
+
"claude plugin install geonosis@geonosis",
|
|
304
|
+
"```",
|
|
305
|
+
"",
|
|
306
|
+
"`AGENTS.md` and `.cursor/rules/` are GENERATED from this file by `geonosis sync` — edit this",
|
|
307
|
+
"one. `lint-corpus/` is fixture code that must stay broken: it is how the doctor proves the rules",
|
|
308
|
+
"configured for this repo can fire at all.",
|
|
309
|
+
""
|
|
310
|
+
].join(`
|
|
311
|
+
`);
|
|
312
|
+
var ci = (answers) => [
|
|
313
|
+
"name: verify",
|
|
314
|
+
"",
|
|
315
|
+
"on:",
|
|
316
|
+
" push:",
|
|
317
|
+
" branches: [main]",
|
|
318
|
+
" pull_request:",
|
|
319
|
+
"",
|
|
320
|
+
"jobs:",
|
|
321
|
+
" verify:",
|
|
322
|
+
" runs-on: ubuntu-latest",
|
|
323
|
+
" timeout-minutes: 30",
|
|
324
|
+
" steps:",
|
|
325
|
+
" - uses: actions/checkout@v4",
|
|
326
|
+
...answers.runtime === "bun" ? [" - uses: oven-sh/setup-bun@v2", " - run: bun install --frozen-lockfile"] : [
|
|
327
|
+
" - uses: pnpm/action-setup@v4",
|
|
328
|
+
" - uses: actions/setup-node@v4",
|
|
329
|
+
" with:",
|
|
330
|
+
" node-version: '24'",
|
|
331
|
+
" cache: 'pnpm'",
|
|
332
|
+
" - run: pnpm install --frozen-lockfile"
|
|
333
|
+
],
|
|
334
|
+
` - run: ${exec(answers.runtime)} geonosis-verify full`,
|
|
335
|
+
` - run: ${exec(answers.runtime)} geonosis-doctor`,
|
|
336
|
+
"",
|
|
337
|
+
"# When @geonosis/testbed is installed, add its matrix here: one job per adapter the repo",
|
|
338
|
+
"# declares in geonosis.json → testbed.adapters. A job switched off in a condition is a job",
|
|
339
|
+
"# that lies, so the disabledCiJobs counter counts them and the ratchet holds the number at 0.",
|
|
340
|
+
""
|
|
341
|
+
].join(`
|
|
342
|
+
`);
|
|
343
|
+
var settings = (answers) => json({
|
|
344
|
+
extraKnownMarketplaces: {
|
|
345
|
+
geonosis: answers.marketplace === undefined ? { source: { repo: "microcompanies/geonosis", source: "github" } } : { source: { path: answers.marketplace, source: "directory" } }
|
|
346
|
+
},
|
|
347
|
+
enabledPlugins: { "geonosis@geonosis": true }
|
|
348
|
+
});
|
|
349
|
+
var tsconfigBase = (answers) => json({
|
|
350
|
+
compilerOptions: {
|
|
351
|
+
target: "ES2023",
|
|
352
|
+
lib: ["ES2023", ...answers.ui === "none" ? [] : ["DOM"]],
|
|
353
|
+
module: "ESNext",
|
|
354
|
+
moduleResolution: "bundler",
|
|
355
|
+
moduleDetection: "force",
|
|
356
|
+
...answers.ui === "none" ? {} : { jsx: "react-jsx" },
|
|
357
|
+
types: ["node"],
|
|
358
|
+
strict: true,
|
|
359
|
+
noUncheckedIndexedAccess: true,
|
|
360
|
+
noImplicitOverride: true,
|
|
361
|
+
noFallthroughCasesInSwitch: true,
|
|
362
|
+
verbatimModuleSyntax: true,
|
|
363
|
+
isolatedModules: true,
|
|
364
|
+
skipLibCheck: true,
|
|
365
|
+
esModuleInterop: true,
|
|
366
|
+
resolveJsonModule: true,
|
|
367
|
+
noEmit: true
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
var filesFor = (answers) => {
|
|
371
|
+
const workspaces = workspacesOf(answers);
|
|
372
|
+
const counters = countersFor(answers.runtime, LAW_SOURCE, workspaces.map((one) => ({ dir: one.dir, name: one.name })));
|
|
373
|
+
const { rules } = rulesFor(presetsFor(answers), answersForRules(answers));
|
|
374
|
+
const files = {
|
|
375
|
+
"package.json": rootManifest(answers),
|
|
376
|
+
...answers.runtime === "pnpm" ? { "pnpm-workspace.yaml": workspaceYaml(answers) } : {},
|
|
377
|
+
[LAW_SOURCE]: law(answers),
|
|
378
|
+
"CLAUDE.md": `@${LAW_SOURCE}
|
|
379
|
+
`,
|
|
380
|
+
"docs/architecture.md": architecture(answers, workspaces),
|
|
381
|
+
"docs/pipelines/order-placed.md": pipeline(answers),
|
|
382
|
+
".github/workflows/ci.yml": ci(answers),
|
|
383
|
+
".claude/settings.json": settings(answers),
|
|
384
|
+
".gitignore": ["node_modules/", "dist/", ".turbo/", ".geonosis/", "coverage/", ""].join(`
|
|
385
|
+
`),
|
|
386
|
+
".oxfmtrc.json": json({
|
|
387
|
+
printWidth: 100,
|
|
388
|
+
singleQuote: true,
|
|
389
|
+
semi: false,
|
|
390
|
+
trailingComma: "none",
|
|
391
|
+
arrowParens: "always",
|
|
392
|
+
endOfLine: "lf",
|
|
393
|
+
tabWidth: 2,
|
|
394
|
+
quoteProps: "as-needed",
|
|
395
|
+
sortImports: true,
|
|
396
|
+
sortPackageJson: true,
|
|
397
|
+
ignorePatterns: [
|
|
398
|
+
"node_modules",
|
|
399
|
+
"dist",
|
|
400
|
+
".turbo",
|
|
401
|
+
"coverage",
|
|
402
|
+
"**/*.md",
|
|
403
|
+
"**/*.json",
|
|
404
|
+
CORPUS_DIR
|
|
405
|
+
]
|
|
406
|
+
}),
|
|
407
|
+
".oxlintrc.json": json(oxlintConfigFor(rules, [CORPUS_DIR])),
|
|
408
|
+
"geonosis.json": json({
|
|
409
|
+
verify: tiersFor({
|
|
410
|
+
rules,
|
|
411
|
+
runtime: answers.runtime,
|
|
412
|
+
scripts: Object.keys(rootScripts(answers))
|
|
413
|
+
}),
|
|
414
|
+
doctor: { corpus: CORPUS_DIR },
|
|
415
|
+
law: { file: LAW_SOURCE },
|
|
416
|
+
ledger: {
|
|
417
|
+
architecture: "docs/architecture.md",
|
|
418
|
+
law: LAW_SOURCE,
|
|
419
|
+
plans: "plans",
|
|
420
|
+
progress: "plans/PROGRESS.md",
|
|
421
|
+
proofs: "proofs"
|
|
422
|
+
},
|
|
423
|
+
walk: { probes: [], urls: [] },
|
|
424
|
+
testbed: {
|
|
425
|
+
adapters: answers.backend === "medusa" ? ["medusa-built"] : answers.backend === "sagaflow-cf" ? ["workerd"] : []
|
|
426
|
+
}
|
|
427
|
+
}),
|
|
428
|
+
"geonosis.ratchet.json": json({ baseline: "gate-baseline.json", counters }),
|
|
429
|
+
"gate-baseline.json": json(Object.fromEntries(counters.map((one) => [
|
|
430
|
+
typeof one.key === "string" ? one.key : String(one.counter),
|
|
431
|
+
one.counter === "lawLineCount" ? law(answers).split(`
|
|
432
|
+
`).length - 1 : 0
|
|
433
|
+
]))),
|
|
434
|
+
"skills-lock.json": json({ skills: {}, version: 1 }),
|
|
435
|
+
[HOOK_INSTALLER]: hookInstaller(),
|
|
436
|
+
"lefthook.yml": [
|
|
437
|
+
"# Staged scope only, so a commit never waits on a file it did not touch. When one fires, fix",
|
|
438
|
+
"# or delete the code — never downgrade the rule to get past it.",
|
|
439
|
+
"#",
|
|
440
|
+
"# Each binary is called through node_modules/.bin, never through npx, bunx or pnpm: a git",
|
|
441
|
+
"# hook's PATH is not the shell's and carries no version-manager shim, so the runner fails to",
|
|
442
|
+
"# START and what you read is its message rather than the gate refusing anything.",
|
|
443
|
+
"pre-commit:",
|
|
444
|
+
" parallel: true",
|
|
445
|
+
" commands:",
|
|
446
|
+
" fmt:",
|
|
447
|
+
" glob: '*.{ts,tsx,js,json}'",
|
|
448
|
+
" run: node_modules/.bin/oxfmt --config .oxfmtrc.json --check {staged_files}",
|
|
449
|
+
" lint:",
|
|
450
|
+
" glob: '*.{ts,tsx}'",
|
|
451
|
+
" run: node_modules/.bin/oxlint --config .oxlintrc.json {staged_files}",
|
|
452
|
+
""
|
|
453
|
+
].join(`
|
|
454
|
+
`),
|
|
455
|
+
"turbo.json": json({
|
|
456
|
+
$schema: "https://turborepo.dev/schema.json",
|
|
457
|
+
boundaries: { tags: {} },
|
|
458
|
+
tasks: {
|
|
459
|
+
build: { dependsOn: ["^build"] },
|
|
460
|
+
lint: {},
|
|
461
|
+
test: { dependsOn: ["^build"] },
|
|
462
|
+
typecheck: { dependsOn: ["^typecheck"] }
|
|
463
|
+
}
|
|
464
|
+
}),
|
|
465
|
+
"tsconfig.base.json": tsconfigBase(answers),
|
|
466
|
+
"tsconfig.json": json({
|
|
467
|
+
extends: "./tsconfig.base.json",
|
|
468
|
+
include: [
|
|
469
|
+
"apps/*/src/**/*.ts",
|
|
470
|
+
"apps/*/src/**/*.tsx",
|
|
471
|
+
"packages/*/src/**/*.ts",
|
|
472
|
+
"packages/*/src/**/*.tsx"
|
|
473
|
+
],
|
|
474
|
+
exclude: ["**/dist/**", "**/node_modules/**", `${CORPUS_DIR}/**`]
|
|
475
|
+
}),
|
|
476
|
+
...corpusFor(answers, workspaces)
|
|
477
|
+
};
|
|
478
|
+
for (const workspace of workspaces) {
|
|
479
|
+
files[`${workspace.dir}/package.json`] = workspaceManifest(workspace, answers, workspaces);
|
|
480
|
+
files[`${workspace.dir}/tsconfig.json`] = json({
|
|
481
|
+
extends: "../../tsconfig.base.json",
|
|
482
|
+
include: ["src"]
|
|
483
|
+
});
|
|
484
|
+
for (const [file, body] of Object.entries(workspace.sources)) {
|
|
485
|
+
files[`${workspace.dir}/${file}`] = body;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return files;
|
|
489
|
+
};
|
|
490
|
+
var presetsChosenBy = presetsFor;
|
|
491
|
+
export {
|
|
492
|
+
GRAPH_SYNCS,
|
|
493
|
+
HOOK_INSTALLER,
|
|
494
|
+
filesFor,
|
|
495
|
+
kitDependencies,
|
|
496
|
+
presetsChosenBy
|
|
497
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const FLOOR_VERSIONS: {
|
|
2
|
+
readonly '@geonosis/assistant': '0.1.0';
|
|
3
|
+
readonly '@geonosis/conformance': '0.4.0';
|
|
4
|
+
readonly '@geonosis/db': '0.14.2';
|
|
5
|
+
readonly '@geonosis/document': '0.9.2';
|
|
6
|
+
readonly '@geonosis/events': '2.2.0';
|
|
7
|
+
readonly '@geonosis/extraction': '0.1.0';
|
|
8
|
+
readonly '@geonosis/files': '0.1.0';
|
|
9
|
+
readonly '@geonosis/inbox': '0.1.1';
|
|
10
|
+
readonly '@geonosis/interchange': '0.1.0';
|
|
11
|
+
readonly '@geonosis/money': '0.1.0';
|
|
12
|
+
readonly '@geonosis/placement': '0.1.0';
|
|
13
|
+
readonly '@geonosis/plans': '0.1.0';
|
|
14
|
+
readonly '@geonosis/recurring': '0.1.0';
|
|
15
|
+
readonly '@geonosis/search': '0.4.1';
|
|
16
|
+
readonly '@geonosis/ui': '0.2.1';
|
|
17
|
+
readonly '@geonosis/workflows': '0.6.0';
|
|
18
|
+
};
|
|
19
|
+
export declare const TOOL_VERSIONS: Record<string, string>;
|
|
20
|
+
export declare const TOOLS_RUNTIME: {
|
|
21
|
+
devEngines: {
|
|
22
|
+
runtime: {
|
|
23
|
+
name: string;
|
|
24
|
+
version: string;
|
|
25
|
+
onFail: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
packageManager: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/floor-versions.ts
|
|
2
|
+
var FLOOR_VERSIONS = {
|
|
3
|
+
"@geonosis/assistant": "0.1.0",
|
|
4
|
+
"@geonosis/conformance": "0.4.0",
|
|
5
|
+
"@geonosis/db": "0.14.2",
|
|
6
|
+
"@geonosis/document": "0.9.2",
|
|
7
|
+
"@geonosis/events": "2.2.0",
|
|
8
|
+
"@geonosis/extraction": "0.1.0",
|
|
9
|
+
"@geonosis/files": "0.1.0",
|
|
10
|
+
"@geonosis/inbox": "0.1.1",
|
|
11
|
+
"@geonosis/interchange": "0.1.0",
|
|
12
|
+
"@geonosis/money": "0.1.0",
|
|
13
|
+
"@geonosis/placement": "0.1.0",
|
|
14
|
+
"@geonosis/plans": "0.1.0",
|
|
15
|
+
"@geonosis/recurring": "0.1.0",
|
|
16
|
+
"@geonosis/search": "0.4.1",
|
|
17
|
+
"@geonosis/ui": "0.2.1",
|
|
18
|
+
"@geonosis/workflows": "0.6.0"
|
|
19
|
+
};
|
|
20
|
+
var TOOL_VERSIONS = {
|
|
21
|
+
"@types/node": "^26.6.3",
|
|
22
|
+
oxfmt: "^0.70.0",
|
|
23
|
+
oxlint: "^1.85.0",
|
|
24
|
+
typescript: "^7.0.2",
|
|
25
|
+
vitest: "^5.0.2"
|
|
26
|
+
};
|
|
27
|
+
var TOOLS_RUNTIME = {
|
|
28
|
+
devEngines: { runtime: { name: "bun", version: "^1.4.2", onFail: "download" } },
|
|
29
|
+
packageManager: "pnpm@12.6.0"
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
FLOOR_VERSIONS,
|
|
33
|
+
TOOLS_RUNTIME,
|
|
34
|
+
TOOL_VERSIONS
|
|
35
|
+
};
|