@ogygie/generate 0.29.0 → 0.29.2
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.
|
@@ -729,7 +729,7 @@ function checkCrossReferences(block, issue) {
|
|
|
729
729
|
issue(["operations", index, "path"], `a ${operation.kind} path carries exactly one parameter, the key`);
|
|
730
730
|
}
|
|
731
731
|
} else if (pathParametersOf(operation.path).length > 0) {
|
|
732
|
-
issue(["operations", index, "path"], `a ${operation.kind} operation
|
|
732
|
+
issue(["operations", index, "path"], `a ${operation.kind} operation takes no path parameter (got ${JSON.stringify(operation.path)}): filter through the fields of its input`);
|
|
733
733
|
}
|
|
734
734
|
if (isWriteOperation(operation) && operation.respondsWith !== void 0) {
|
|
735
735
|
if (!readIds.has(operation.respondsWith)) {
|
|
@@ -804,7 +804,7 @@ function checkCrossReferences(block, issue) {
|
|
|
804
804
|
known.delete(hole.name);
|
|
805
805
|
for (const source of hole.from) {
|
|
806
806
|
if (!known.has(source)) {
|
|
807
|
-
issue(["holes", index, "from"], `view "${hole.name}" reads "${source}", which is neither the resource table, a slot table, a reference table, a shared table
|
|
807
|
+
issue(["holes", index, "from"], `view "${hole.name}" reads "${source}", which is neither the resource table, a slot table, a reference table, another view of this block nor a declared shared table: declare it in contracts.sharedTables: [${source}] when it is a table of the product outside this block`);
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
810
|
}
|
package/dist/cli/run.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -189,7 +189,7 @@ import {
|
|
|
189
189
|
viewCandidateTextOf,
|
|
190
190
|
viewExampleTestName,
|
|
191
191
|
vocabularyOf
|
|
192
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-KQ7RGIBV.js";
|
|
193
193
|
|
|
194
194
|
// src/prompt-card.ts
|
|
195
195
|
var phrase = (caseKey) => caseKey.replace(/^with:/u, "avec ").replace(/^without:/u, "sans ");
|
|
@@ -225,10 +225,10 @@ function generationGrammarCard(generation) {
|
|
|
225
225
|
"Une spec qui porte `# G\xE9n\xE9ration` est G\xC9N\xC9R\xC9E : routes, base, tests et \xE9crans se d\xE9rivent sans mod\xE8le ; ce qui se pense devient un TROU typ\xE9, rempli ensuite. Alors ses `# Comportements` s'\xE9crivent dans la GRAMMAIRE FERM\xC9E ci-dessous, jamais au format \xC9TANT DONN\xC9 / QUAND / ALORS. Sans `# G\xE9n\xE9ration`, garde le format en trois lignes.",
|
|
226
226
|
"",
|
|
227
227
|
`Bloc d'une FEATURE API \u2014 un seul bloc \`\`\`yaml, cl\xE9s ${GENERATION_BLOCK_KEYS.map((key) => `\`${key}\``).join(", ")} :`,
|
|
228
|
-
|
|
229
|
-
`- \`operations\` : ${operationKinds.join(", ")} ; chaque op\xE9ration : \`{ id: camelCase, kind, method, path: /api/\u2026, guard: <un guard ci-dessous>, input: <Nom>Schema, output: <Nom>Schema, holes?: [ids], respondsWith?: <lecture du bloc>, invalidates?: [racine-kebab] }\` ; une \xE9criture par cl\xE9 ajoute \`by: <cl\xE9>\` et \`notFound: CODE\`, son path finit par \`/:<cl\xE9
|
|
228
|
+
"- `contracts: { module: ./schemas.ts, resource: <Nom>Schema, table: snake_case, key?: champ (cl\xE9 m\xE9tier des \xE9critures par cl\xE9), columns?: { champ: \"type\" }, sharedTables?: [snake_case] }` \u2014 les sch\xE9mas sont des NOMS (suffixe Schema), jamais du code ; `columns` est FACULTATIF et ne force un type que quand le sch\xE9ma ne suffit pas, parmi la liste ferm\xE9e `text`, `integer`, `bigint`, `boolean`, `date`, `timestamptz`, `uuid` ; `sharedTables` nomme les tables du produit HORS du bloc qu'un trou `view` lit (`from`) \u2014 d\xE9clar\xE9es, jamais cr\xE9\xE9es ni \xE9crites ; sans cette d\xE9claration, la vue est refus\xE9e, `jsonb`, `numeric(p,s)`, `varchar(n)`, `char(n)` (jamais un type SQL Server, jamais `not null` : la cible traduit) ; `id` n'est jamais une cl\xE9 ni une colonne d\xE9clar\xE9e.",
|
|
229
|
+
`- \`operations\` : ${operationKinds.join(", ")} ; chaque op\xE9ration : \`{ id: camelCase, kind, method, path: /api/\u2026, guard: <un guard ci-dessous>, input: <Nom>Schema, output: <Nom>Schema, holes?: [ids], respondsWith?: <lecture du bloc>, invalidates?: [racine-kebab] }\` ; une \xE9criture par cl\xE9 ajoute \`by: <cl\xE9>\` et \`notFound: CODE\`, son path finit par \`/:<cl\xE9>\` ; une \`read\` ne prend AUCUN param\xE8tre de chemin : le filtre (une soci\xE9t\xE9, une p\xE9riode) passe par les champs de son \`input\`.`,
|
|
230
230
|
`- \`motifs\` : ${motifs.join(", ")} \u2014 une instance par motif, et SEULEMENT si une op\xE9ration l'emploie (\`uses: <motif>\` sur l'op\xE9ration, sauf \`signedWrite\` qui s'applique \xE0 toutes les \xE9critures) ; sinon \`motifs: {}\`.`,
|
|
231
|
-
`- \`holes\` : ${holeKinds.join(", ")} ; un trou \`validate\` = \`{ id, kind: validate, reads: [champs de l'entr\xE9e], error: CODE, effects: [] | [clock], suggestedFix: true, examples: { accept: {\u2026}, reject: {\u2026} } }\` ; un \`derive\` = \`{ id, kind: derive, reads, writes: <champ de la ressource>, error: CODE, effects: [], examples: { accept: [{ input, output }], reject: { input } } }\`. Les exemples sont OBLIGATOIRES ; une date d'exemple se rapporte au 2026-01-01 (horloge fig\xE9e des tests).`,
|
|
231
|
+
`- \`holes\` : ${holeKinds.join(", ")} ; un trou \`view\` = \`{ id, kind: view, name: snake_case, from: [tables ou vues lues], writes: <champ de la ressource>, examples: { rows: [{\u2026}], value } }\` \u2014 \`from\` ne lit que la table de la ressource, une table de slot ou de r\xE9f\xE9rence, une autre vue du bloc ou une table de \`contracts.sharedTables\` ; un trou \`validate\` = \`{ id, kind: validate, reads: [champs de l'entr\xE9e], error: CODE, effects: [] | [clock], suggestedFix: true, examples: { accept: {\u2026}, reject: {\u2026} } }\` ; un \`derive\` = \`{ id, kind: derive, reads, writes: <champ de la ressource>, error: CODE, effects: [], examples: { accept: [{ input, output }], reject: { input } } }\`. Les exemples sont OBLIGATOIRES ; une date d'exemple se rapporte au 2026-01-01 (horloge fig\xE9e des tests).`,
|
|
232
232
|
"",
|
|
233
233
|
`Bloc d'un \xC9CRAN \u2014 cl\xE9s ${SCREEN_BLOCK_KEYS.map((key) => `\`${key}\``).join(", ")} : \`consumes: [{ feature, operations: [ids] }]\` (features DE LA CARTE ; vide ou absent quand toutes les vues sont de contenu), \`views: [{ id, kind: list, operation: <lecture> } | { id, kind: form, operation: <\xE9criture>, fields: [champs] } | { id, kind: custom, operation, hole } | { id, kind: content, content: <id d'une liste> }]\`, \`holes: [{ id, receives: [champs de la sortie], actions: [\xE9critures], examples: { input, renders: ["texte"] } }]\`, \`content: [{ id: camelCase, entries: [{ id: kebab-case, title, body, href? }] }]\` (la MATI\xC8RE d'une rubrique \u2014 une aide, une FAQ : du texte brut \xE9crit ici m\xEAme, dans la langue source du produit, un lien au plus par entr\xE9e, jamais un libell\xE9 d'interface), et UNE des deux : \`route?: /chemin\` (une page) ou \`mounts?: { point, id }\` (un emplacement d'un \xE9cran existant, parmi les points d'extension de la cible ci-dessous).`,
|
|
234
234
|
"",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ogygie/generate",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.2",
|
|
4
4
|
"description": "Ogygie generator: reads the `# Génération` block of a spec and its schemas.ts, derives everything deterministic without a model (routes, pipeline, database, factories, tests, screens, previews), fills the typed holes of logic.ts by library, draw and escalation, and draws the first schemas.ts of a new feature — judged by the gates. Sixth package of the lockstep (D55).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ogygie/core": "0.29.
|
|
32
|
+
"@ogygie/core": "0.29.2",
|
|
33
33
|
"tsx": "^4.20.0",
|
|
34
34
|
"yaml": "^2.9.0",
|
|
35
35
|
"zod": "^4.0.0"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@lingui/babel-plugin-lingui-macro": "^5.9.5",
|
|
39
39
|
"@lingui/core": "^5.9.5",
|
|
40
40
|
"@lingui/react": "^5.9.5",
|
|
41
|
-
"@ogygie/ui": "0.29.
|
|
41
|
+
"@ogygie/ui": "0.29.2",
|
|
42
42
|
"@starter/api": "0.1.0",
|
|
43
43
|
"@tanstack/react-query": "^5.102.2",
|
|
44
44
|
"@tanstack/react-router": "^1.170.32",
|