@elia97/officina 0.16.0 → 0.17.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 +13 -2
- package/dist/checks/doctor.js +5 -4
- package/dist/checks/placeholders.js +6 -4
- package/dist/gen/images.d.mts +5 -0
- package/dist/gen/images.mjs +8 -0
- package/dist/gen/run.d.ts +2 -0
- package/dist/gen/run.js +9 -3
- package/dist/gen/section.mjs +9 -3
- package/dist/gen/sectioned-collection.d.mts +2 -0
- package/dist/gen/sectioned-collection.mjs +2 -1
- package/dist/gen/templates/section/component.astro.hbs +14 -2
- package/dist/gen/templates/section/content.yml.hbs +9 -5
- package/dist/gen/templates/section/schema.ts.hbs +7 -4
- package/dist/gen/templates/sections/index.ts.hbs +3 -3
- package/dist/lib/check-placeholders.d.ts +2 -0
- package/dist/lib/check-placeholders.js +33 -18
- package/dist/lib/config.d.ts +3 -0
- package/dist/lib/config.js +3 -0
- package/dist/lib/contract.d.ts +5 -2
- package/dist/lib/contract.js +18 -2
- package/dist/lib/tooling.js +1 -1
- package/package.json +3 -3
- package/presets/biome.base.json +11 -6
package/README.md
CHANGED
|
@@ -119,9 +119,13 @@ La radice del pacchetto esporta `defineConfig` e i tipi; i pezzi del motore stan
|
|
|
119
119
|
|
|
120
120
|
`features.generators` ha un valore in più delle altre, perché non tutti i siti in produzione nascono dallo scaffold: `'required'` è il comportamento di sempre; `false` spegne i generatori del pacchetto, e `doctor` smette di chiedere i punti di aggancio e gli ancoraggi invece di pretendere file che nessun codice di quel sito userebbe; `'project'` fa lo stesso ma lascia vivi i generatori che il progetto scrive in `officina.generators.mjs`, che a quel punto `doctor` pretende. Con `false` o `'project'`, `officina gen section|page|component|collection` si ferma dicendolo, mentre gli script `gen` e `gen:*` restano attesi in `package.json`: meglio un comando che spiega di uno script che manca. `gen icons` non c'entra con i generatori di codice e non cambia.
|
|
121
121
|
|
|
122
|
+
`images` dice dove stanno le foto dei contenuti: `'local'`, il default, oppure `'cloudinary'`. Non è un controllo da accendere o spegnere ma una descrizione del progetto, e il silenzio vale `'local'` senza che `doctor` lo segnali. Da lei dipendono il codice che scrivono `gen section` e `gen collection` per una sezione con la foto e i punti di aggancio che `doctor` chiede, come in § Generatori.
|
|
123
|
+
|
|
122
124
|
`features.database` e `features.auth` sono le due voci che il silenzio non accende, perché la maggior parte dei progetti un database non lo ha: seguono le dipendenze. `database` è accesa quando `package.json` dipende da `drizzle-orm`, `auth` quando dipende da `better-auth`, fra le `dependencies` o le `devDependencies`; senza la libreria la voce non si chiede e vale spenta. Dichiarata, vale la dichiarazione: `false` spegne la feature anche con la libreria, e `doctor` lo scrive nell'uscita; `'required'` la accende anche senza. `database.migrationUrlKey` è la variabile con cui girano le migrazioni, `DATABASE_URL_UNPOOLED` se non è dichiarata, e deve essere il nome di una variabile d'ambiente.
|
|
123
125
|
|
|
124
|
-
`placeholders` dice a `check placeholders` cosa guardare: `sources` sono i file da scandire, `contactEnvKeys` le variabili che `--env` pretende. Una lista dichiarata **sostituisce** quella del pacchetto, dizionari compresi: senza dichiarazione i sorgenti sono `src/lib/site.ts`, `src/lib/company.ts` e i dizionari di `src/i18n/strings`, quando la cartella esiste. Serve ai progetti che non nascono dallo scaffold: se partita IVA, recapiti e destinatario dei form stanno nel contenuto invece che in un modulo, i sorgenti del template non sono i suoi, e crearli per far passare il gate terrebbe gli stessi dati in due sedi. Un sorgente elencato che non esiste è un ritrovamento con il suo percorso, non un errore che ferma il comando.
|
|
126
|
+
`placeholders` dice a `check placeholders` cosa guardare: `sources` sono i file da scandire, `contactEnvKeys` le variabili che `--env` pretende. Una lista dichiarata **sostituisce** quella del pacchetto, dizionari compresi: senza dichiarazione i sorgenti sono `src/lib/site.ts`, `src/lib/company.ts` e i dizionari di `src/i18n/strings`, quando la cartella esiste. Serve ai progetti che non nascono dallo scaffold: se partita IVA, recapiti e destinatario dei form stanno nel contenuto invece che in un modulo, i sorgenti del template non sono i suoi, e crearli per far passare il gate terrebbe gli stessi dati in due sedi. Un sorgente elencato che non esiste è un ritrovamento con il suo percorso, non un errore che ferma il comando.
|
|
127
|
+
|
|
128
|
+
Oltre ai sorgenti, il check guarda sempre il contenuto: ogni file `.yml`, `.yaml`, `.json`, `.md`, `.mdx` e `.mdoc` sotto `src/content/`, anche quando `sources` è dichiarato, perché è lì che `gen section` e `gen collection` scrivono una sezione nuova. La sezione nasce con `'<SECTION_TITLE>'`, `'<SECTION_BODY>'` e, se ha la foto, `'<IMAGE_ALT>'` con `'<PUBLIC_ID>'` su Cloudinary o `src: ../../assets/placeholder.jpg` in locale: finché uno di questi resta, il deploy si ferma nominando file e riga, invece di mandare online una foto rotta o quella grigia di prova. YAML e Markdown scrivono i valori senza apici, quindi in `src/content/` il check legge la riga intera e non solo le stringhe fra apici, e il riferimento ad `assets/placeholder.jpg` è un ritrovamento suo. Un progetto senza `src/content/` non vede niente di nuovo. Con il database acceso `--env` pretende anche `DATABASE_URL`, e con l'autenticazione `BETTER_AUTH_SECRET`, qualunque sia `contactEnvKeys`: la variabile delle migrazioni no, perché al deploy arriva da un segreto di GitHub.
|
|
125
129
|
|
|
126
130
|
Nel deploy `check placeholders` gira due volte sui file di Vercel. Con `--env .vercel/.env.production.local`, dopo `vercel pull`, distingue una chiave che su Vercel non esiste, una vuota e una che porta un segnaposto del template, tutte e tre errori, da una variabile **Secret**: `vercel pull` non ne scarica il valore e scrive al suo posto `[SENSITIVE]`, quindi il check lo dice con un avviso, che non ferma il deploy, invece di darla per verificata. Il segnaposto però diventa un problema se la build legge la variabile, per esempio una variabile di `astro:env` con `access: 'public'`, che Astro incorpora nel codice: con `--output .vercel/output`, dopo `vercel build`, il check cerca `[SENSITIVE]` nei file della build e ferma il deploy nominandoli. Una variabile che la build legge va tenuta Config su Vercel, o letta a runtime, e una Secret non diventa Config: si toglie e si riaggiunge.
|
|
127
131
|
|
|
@@ -265,7 +269,7 @@ Perché le action non restino ferme per sempre, Dependabot di questo repository
|
|
|
265
269
|
|
|
266
270
|
Di `.github/dependabot.yml` guarda la **forma**, non la presenza delle chiavi: lo legge come YAML e pretende che le chiavi del gruppo stiano sul gruppo — Dependabot rifiuta l'intero file se `commit-message` o `open-pull-requests-limit` stanno su una voce che dichiara `multi-ecosystem-group` — e che ogni ecosistema del gruppo abbia una seconda voce per il resto. Senza quella, `patterns` restringe l'intera voce e tutto il resto smette di aggiornarsi senza che niente diventi rosso. Le action le cerca con il nome che dà loro Dependabot, quello del repository senza la sottocartella: `Elia97/officina`. `Elia97/officina/*` non corrisponde a nessuna dipendenza, in `patterns` come in `ignore` o in `exclude-patterns`, e `doctor` lo segnala ovunque compaia.
|
|
267
271
|
|
|
268
|
-
Le prime due sezioni rispondono a due domande diverse. I punti di aggancio sono l'elenco di `src/lib/contract.ts`, e chiedono che una cosa esista: i moduli che il codice generato importa, le cartelle in cui i generatori scrivono, `class-variance-authority` fra le dipendenze, lo script `check` che il post-gen lancia. Gli ancoraggi guardano dentro quei file, e chiedono che abbiano ancora la forma su cui l'iniezione conta:
|
|
272
|
+
Le prime due sezioni rispondono a due domande diverse. I punti di aggancio sono l'elenco di `src/lib/contract.ts`, e chiedono che una cosa esista: i moduli che il codice generato importa, le cartelle in cui i generatori scrivono, `class-variance-authority` fra le dipendenze, lo script `check` che il post-gen lancia. Quelli delle foto seguono `images`: con le foto locali `imageSchema` in `src/lib/schemas/common.ts` e `src/assets/placeholder.jpg`, con Cloudinary `photoSchema` nello stesso file e `src/components/ui/photo.astro`. Ogni progetto si vede chiedere solo i due della sua fonte. Gli ancoraggi guardano dentro quei file, e chiedono che abbiano ancora la forma su cui l'iniezione conta:
|
|
269
273
|
|
|
270
274
|
- per ogni collection a sezioni registrata in `src/content.config.ts` — riconosciuta dall'import di `<nome>CollectionSchema` da `@/lib/schemas/<nome>`, non dai marcatori, che sono proprio ciò che può sparire — la funzione `<nome>CollectionSchema`, la sua `z.discriminatedUnion` sopra un array letterale, il parametro non destrutturato che una sezione con immagine riceve, il `return { … }` di primo livello di `get<Nome>Sections`, e una sola pagina sotto `src/pages/` che porti `{/* @gen:<nome>-sections */}` e, su quella, `// @gen:<nome>-imports`;
|
|
271
275
|
- per ogni dizionario di `src/i18n/strings/`, il suo `export const <lingua> = { … } as const`.
|
|
@@ -329,6 +333,13 @@ Una volta sola, a mano: su npmjs.com il trusted publisher per `Elia97/officina`
|
|
|
329
333
|
|
|
330
334
|
I generatori scrivono codice che deve incastrarsi nello scaffold, quindi il progetto deve avere i punti di aggancio che si aspettano: i moduli che il codice generato importa, l'elenco è `src/lib/contract.ts`, e i file in cui iniettano, con la forma su cui l'iniezione conta. Sono le prime due sezioni di `officina doctor`. Finché manca qualcosa il pre-volo del generatore si ferma prima di scrivere un solo file.
|
|
331
335
|
|
|
336
|
+
**Le foto su Cloudinary.** Con `images: 'cloudinary'` in `officina.config.ts`, una sezione con la foto nasce già per Cloudinary, in `gen section` come nella prima sezione di `gen collection`. Lo schema usa `photoSchema` da `../common` e non riceve il contesto di Astro, il contenuto parte da `public_id: '<PUBLIC_ID>'` con il testo alternativo, e il componente passa la foto a `Photo`. La fonte vale per tutto il progetto: la domanda resta «la sezione ha una foto?». I due punti di aggancio li fissa officina, e il progetto li adegua al modulo di Cloudinary che ha già, anche con un involucro sottile:
|
|
337
|
+
|
|
338
|
+
- `export const photoSchema` in `src/lib/schemas/common.ts`, un oggetto con `public_id` e `alt`;
|
|
339
|
+
- `src/components/ui/photo.astro`, con le props `publicId`, `alt`, `widths`, `sizes` e un `class` facoltativo; la sezione generata gli passa le stesse misure che con le foto locali passa a `<Image>`.
|
|
340
|
+
|
|
341
|
+
Che le props coincidano non lo controlla `doctor`, che guarda solo che il file esista: lo dice `pnpm run check` nel post-gen. Il segnaposto `'<PUBLIC_ID>'` lo trova `check placeholders`, che guarda `src/content/` e ferma il deploy finché la sezione non ha la sua foto.
|
|
342
|
+
|
|
332
343
|
Un progetto aggiunge i propri generatori con un file `officina.generators.mjs` nella radice, con la firma di un plopfile: `export default function (plop)`. È un'estensione avanzata e non è parte dell'API del pacchetto: è legata alla firma di plop, quindi una major di plop può romperla.
|
|
333
344
|
|
|
334
345
|
I test dei generatori girano sui punti di aggancio del progetto di prova, copiati da `vetrina`. Che un progetto vero li abbia ancora lo verifica `doctor`, non i test.
|
package/dist/checks/doctor.js
CHANGED
|
@@ -6,7 +6,7 @@ import { PROJECT_GENERATORS } from '../gen/plopfile.mjs';
|
|
|
6
6
|
import { dependencyGaps, leftoverGaps, presetGaps, readManifest, scriptGaps, } from '../lib/alignment.js';
|
|
7
7
|
import { anchorGaps } from '../lib/anchors.js';
|
|
8
8
|
import { cliOptions, exitCode, printFindings } from '../lib/cli.js';
|
|
9
|
-
import { featuresOffByChoice, featuresOn, findConfigFile, generatorsSetting, loadConfig, } from '../lib/config.js';
|
|
9
|
+
import { featuresOffByChoice, featuresOn, findConfigFile, generatorsSetting, imagesSetting, loadConfig, } from '../lib/config.js';
|
|
10
10
|
import { configGaps } from '../lib/config-gaps.js';
|
|
11
11
|
import { contractGaps } from '../lib/contract.js';
|
|
12
12
|
import { databaseAuthGaps } from '../lib/database-auth.js';
|
|
@@ -36,10 +36,11 @@ async function loadedConfig(root) {
|
|
|
36
36
|
const HOOK_POINTS = 'punti di aggancio dei generatori';
|
|
37
37
|
const ANCHORS = 'ancoraggi delle pagine a sezioni e dei dizionari';
|
|
38
38
|
const usable = (config) => config === undefined || config instanceof Error ? {} : config;
|
|
39
|
-
function generatorSections(root,
|
|
39
|
+
function generatorSections(root, config) {
|
|
40
|
+
const setting = generatorsSetting(config);
|
|
40
41
|
if (setting === 'required') {
|
|
41
42
|
return [
|
|
42
|
-
{ title: HOOK_POINTS, gaps: contractGaps(root) },
|
|
43
|
+
{ title: HOOK_POINTS, gaps: contractGaps(root, imagesSetting(config)) },
|
|
43
44
|
{ title: ANCHORS, gaps: anchorGaps(root) },
|
|
44
45
|
];
|
|
45
46
|
}
|
|
@@ -90,7 +91,7 @@ export async function main() {
|
|
|
90
91
|
const version = packageVersion();
|
|
91
92
|
const config = await loadedConfig(root);
|
|
92
93
|
const sections = [
|
|
93
|
-
...generatorSections(root,
|
|
94
|
+
...generatorSections(root, usable(config)),
|
|
94
95
|
{
|
|
95
96
|
title: 'script, dipendenze e strumenti di package.json',
|
|
96
97
|
gaps: [...scriptGaps(manifest), ...dependencyGaps(manifest), ...toolingGaps(manifest)],
|
|
@@ -3,7 +3,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
3
3
|
import process from 'node:process';
|
|
4
4
|
import { parseArgs } from 'node:util';
|
|
5
5
|
import { readManifest } from '../lib/alignment.js';
|
|
6
|
-
import { envFindings, outputFindings, placeholderSources, requiredEnvKeys, sourceFindings, } from '../lib/check-placeholders.js';
|
|
6
|
+
import { contentFindings, envFindings, isContent, outputFindings, placeholderSources, requiredEnvKeys, sourceFindings, } from '../lib/check-placeholders.js';
|
|
7
7
|
import { cliOptions, exitCode, printFindings } from '../lib/cli.js';
|
|
8
8
|
import { featuresOn, loadConfig } from '../lib/config.js';
|
|
9
9
|
const MISSING_SOURCE = 'sorgente assente: `placeholders.sources` in officina.config.ts dice quali file guardare';
|
|
@@ -11,7 +11,8 @@ function sourceScan(paths) {
|
|
|
11
11
|
return paths.flatMap((path) => {
|
|
12
12
|
if (!existsSync(path))
|
|
13
13
|
return [{ path, message: MISSING_SOURCE, severity: 'error' }];
|
|
14
|
-
|
|
14
|
+
const findings = isContent(path) ? contentFindings : sourceFindings;
|
|
15
|
+
return findings(readFileSync(path, 'utf8')).map((hit) => ({ path, ...hit, severity: 'error' }));
|
|
15
16
|
});
|
|
16
17
|
}
|
|
17
18
|
function envScan(path, keys) {
|
|
@@ -50,11 +51,12 @@ function scan(env, output, config) {
|
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
const paths = placeholderSources(config);
|
|
54
|
+
const content = paths.filter(isContent).length;
|
|
53
55
|
return {
|
|
54
|
-
scope: `${paths.length} sorgenti`,
|
|
56
|
+
scope: `${paths.length - content} sorgenti${content > 0 ? ` e ${content} file di src/content` : ''}`,
|
|
55
57
|
findings: sourceScan(paths),
|
|
56
58
|
clean: 'Nessun segnaposto del template.',
|
|
57
|
-
advice: 'Da sostituire con i dati del progetto prima del deploy: i file da guardare li dice `placeholders.sources` in officina.config.ts',
|
|
59
|
+
advice: 'Da sostituire con i dati del progetto prima del deploy: i file da guardare li dice `placeholders.sources` in officina.config.ts, e il contenuto di src/content, dove i generatori scrivono i segnaposto di una sezione nuova, si guarda sempre',
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
export async function main(args = process.argv.slice(2)) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
// `officina gen` legge `images` da officina.config.ts e la passa qui, come `OFFICINA_GENERATORS`.
|
|
3
|
+
export const imageSource = () => (process.env.OFFICINA_IMAGES === 'cloudinary' ? 'cloudinary' : 'local');
|
|
4
|
+
export function imageData(answers) {
|
|
5
|
+
const image = answers.image === true;
|
|
6
|
+
const cloudinary = imageSource() === 'cloudinary';
|
|
7
|
+
return { localImage: image && !cloudinary, cloudinaryImage: image && cloudinary };
|
|
8
|
+
}
|
package/dist/gen/run.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { type GeneratorsSetting, type ImageSource } from '../lib/config.ts';
|
|
1
2
|
export declare function plopCommand(args: string[], cwd: string): string[];
|
|
3
|
+
export declare const plopEnv: (generators: GeneratorsSetting, images: ImageSource, base?: NodeJS.ProcessEnv) => NodeJS.ProcessEnv;
|
|
2
4
|
export declare function main(args?: string[]): Promise<number>;
|
package/dist/gen/run.js
CHANGED
|
@@ -4,7 +4,7 @@ import { dirname, join } from 'node:path';
|
|
|
4
4
|
import process from 'node:process';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { missingInput } from '../lib/cli.js';
|
|
7
|
-
import { generatorsSetting, loadConfig } from '../lib/config.js';
|
|
7
|
+
import { generatorsSetting, imagesSetting, loadConfig, } from '../lib/config.js';
|
|
8
8
|
import { PROJECT_GENERATORS } from './plopfile.mjs';
|
|
9
9
|
// plop risolve i template dalla cartella del plopfile e scrive in `--dest`: il plopfile sta nel
|
|
10
10
|
// pacchetto, la destinazione è il progetto da cui si lancia il comando.
|
|
@@ -14,8 +14,14 @@ export function plopCommand(args, cwd) {
|
|
|
14
14
|
const plopfile = fileURLToPath(new URL('./plopfile.mjs', import.meta.url));
|
|
15
15
|
return [plopBin, '--plopfile', plopfile, '--dest', cwd, ...args];
|
|
16
16
|
}
|
|
17
|
+
export const plopEnv = (generators, images, base = process.env) => ({
|
|
18
|
+
...base,
|
|
19
|
+
OFFICINA_IMAGES: images,
|
|
20
|
+
...(generators === 'project' ? { OFFICINA_GENERATORS: 'project' } : {}),
|
|
21
|
+
});
|
|
17
22
|
export async function main(args = []) {
|
|
18
|
-
const
|
|
23
|
+
const config = await loadConfig(process.cwd());
|
|
24
|
+
const setting = generatorsSetting(config);
|
|
19
25
|
if (setting === false) {
|
|
20
26
|
console.error('\n✗ Il progetto ha spento i generatori con `features.generators: false`: quelli del pacchetto\n' +
|
|
21
27
|
' scriverebbero codice che qui non si incastra.\n');
|
|
@@ -23,7 +29,7 @@ export async function main(args = []) {
|
|
|
23
29
|
}
|
|
24
30
|
if (setting === 'project' && missingInput(PROJECT_GENERATORS, "con `generators: 'project'` i generatori sono i suoi"))
|
|
25
31
|
return 1;
|
|
26
|
-
const env = setting
|
|
32
|
+
const env = plopEnv(setting, imagesSetting(config));
|
|
27
33
|
const result = spawnSync(process.execPath, plopCommand(args, process.cwd()), { stdio: 'inherit', env });
|
|
28
34
|
return result.status ?? 1;
|
|
29
35
|
}
|
package/dist/gen/section.mjs
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { isValidIdentifier } from './identifier.mjs';
|
|
2
|
+
import { imageData, imageSource } from './images.mjs';
|
|
2
3
|
import { assertSectionInjectable, injectSection } from './inject-section.mjs';
|
|
3
4
|
import { postGenAction } from './post-gen.mjs';
|
|
4
5
|
import { casings, sectionFiles, sectionTargets, validateSectionName } from './section-targets.mjs';
|
|
6
|
+
const IMAGE_START = {
|
|
7
|
+
local: 'src/assets/placeholder.jpg',
|
|
8
|
+
cloudinary: "public_id '<PUBLIC_ID>'",
|
|
9
|
+
};
|
|
5
10
|
function rollbackHint(targets) {
|
|
6
11
|
return (`gen:section also MODIFIED three existing files: ${targets.barrel}, ${targets.dataLayer} and the page ` +
|
|
7
12
|
`that carries ${targets.sectionsMarker}. Review them with \`git diff\`, then discard ONLY the injected hunks ` +
|
|
@@ -38,7 +43,7 @@ export default function sectionGenerator(plop) {
|
|
|
38
43
|
{
|
|
39
44
|
type: 'confirm',
|
|
40
45
|
name: 'image',
|
|
41
|
-
message:
|
|
46
|
+
message: `Does the section carry an image? (its content starts on ${IMAGE_START[imageSource()]})`,
|
|
42
47
|
default: false,
|
|
43
48
|
},
|
|
44
49
|
],
|
|
@@ -46,9 +51,10 @@ export default function sectionGenerator(plop) {
|
|
|
46
51
|
const collection = casings(plop, answers.collection);
|
|
47
52
|
const section = casings(plop, answers.name);
|
|
48
53
|
const targets = sectionTargets(collection);
|
|
49
|
-
const
|
|
54
|
+
const images = imageData(answers);
|
|
55
|
+
const request = { root, collection, ...section, image: images.localImage };
|
|
50
56
|
const [schema, content, component] = sectionFiles(targets, section.kebab);
|
|
51
|
-
const data = { section: answers.name };
|
|
57
|
+
const data = { section: answers.name, ...images };
|
|
52
58
|
return [
|
|
53
59
|
() => {
|
|
54
60
|
assertSectionInjectable(request);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import { imageData } from './images.mjs';
|
|
3
4
|
import { assertInjectable, injectCollection } from './inject-config.mjs';
|
|
4
5
|
import { assertStringsInjectable, injectStrings } from './inject-strings.mjs';
|
|
5
6
|
import { pageStrings, pathSegments } from './page.mjs';
|
|
@@ -57,7 +58,7 @@ export function sectionedCollectionActions(plop, answers, root) {
|
|
|
57
58
|
const pageKey = plop.getHelper('camelCase')(segments.join('/'));
|
|
58
59
|
const page = `src/pages/${segments.join('/')}.astro`;
|
|
59
60
|
const strings = pageStrings({ pageKey, pageTitle: plop.getHelper('sentenceCase')(segments.at(-1)), dynamic: false });
|
|
60
|
-
const data = { collection: answers.name, pageKey };
|
|
61
|
+
const data = { collection: answers.name, pageKey, ...imageData(answers) };
|
|
61
62
|
const [schema, content, component] = sectionFiles(targets, section.kebab);
|
|
62
63
|
return [
|
|
63
64
|
() => {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
{{#if
|
|
2
|
+
{{#if localImage}}
|
|
3
3
|
import { Image } from 'astro:assets'
|
|
4
4
|
|
|
5
5
|
{{/if}}
|
|
6
6
|
import Button from '@/components/ui/button.astro'
|
|
7
7
|
import Container from '@/components/ui/container.astro'
|
|
8
8
|
import Heading from '@/components/ui/heading.astro'
|
|
9
|
+
{{#if cloudinaryImage}}
|
|
10
|
+
import Photo from '@/components/ui/photo.astro'
|
|
11
|
+
{{/if}}
|
|
9
12
|
import Section from '@/components/ui/section.astro'
|
|
10
13
|
import type { {{pascalCase collection}}Sections } from '@/lib/{{dashCase collection}}'
|
|
11
14
|
|
|
@@ -21,7 +24,7 @@ const href = (url: string) => ctaHref(Astro.currentLocale, url)
|
|
|
21
24
|
<Container>
|
|
22
25
|
<Heading as="h2">{title}</Heading>
|
|
23
26
|
{body && <p class="mt-4 max-w-2xl text-pretty text-muted-foreground">{body}</p>}
|
|
24
|
-
{{#if
|
|
27
|
+
{{#if localImage}}
|
|
25
28
|
<Image
|
|
26
29
|
src={image.src}
|
|
27
30
|
alt={image.alt}
|
|
@@ -30,6 +33,15 @@ const href = (url: string) => ctaHref(Astro.currentLocale, url)
|
|
|
30
33
|
class="mt-8 h-auto w-full rounded-lg"
|
|
31
34
|
/>
|
|
32
35
|
{{/if}}
|
|
36
|
+
{{#if cloudinaryImage}}
|
|
37
|
+
<Photo
|
|
38
|
+
publicId={image.public_id}
|
|
39
|
+
alt={image.alt}
|
|
40
|
+
widths={[640, 960, 1280, 1920]}
|
|
41
|
+
sizes="(min-width: 96rem) 96rem, 100vw"
|
|
42
|
+
class="mt-8 h-auto w-full rounded-lg"
|
|
43
|
+
/>
|
|
44
|
+
{{/if}}
|
|
33
45
|
{
|
|
34
46
|
buttons.length > 0 && (
|
|
35
47
|
<div class="mt-8 flex flex-wrap gap-4">
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
section: {{camelCase section}}
|
|
2
|
-
title:
|
|
3
|
-
body:
|
|
4
|
-
|
|
5
|
-
{{#if image}}
|
|
2
|
+
title: '<SECTION_TITLE>'
|
|
3
|
+
body: '<SECTION_BODY>'
|
|
4
|
+
{{#if localImage}}
|
|
6
5
|
image:
|
|
7
6
|
src: ../../assets/placeholder.jpg
|
|
8
|
-
alt:
|
|
7
|
+
alt: '<IMAGE_ALT>'
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if cloudinaryImage}}
|
|
10
|
+
image:
|
|
11
|
+
public_id: '<PUBLIC_ID>'
|
|
12
|
+
alt: '<IMAGE_ALT>'
|
|
9
13
|
{{/if}}
|
|
10
14
|
buttons: []
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
{{#if
|
|
1
|
+
{{#if localImage}}
|
|
2
2
|
import type { SchemaContext } from 'astro:content'
|
|
3
3
|
{{/if}}
|
|
4
4
|
import { z } from 'astro/zod'
|
|
5
5
|
|
|
6
|
-
import { ctaSchema{{#if
|
|
6
|
+
import { ctaSchema{{#if localImage}}, imageSchema{{/if}}{{#if cloudinaryImage}}, photoSchema{{/if}} } from '../common'
|
|
7
7
|
|
|
8
|
-
export function {{camelCase section}}SectionSchema({{#if
|
|
8
|
+
export function {{camelCase section}}SectionSchema({{#if localImage}}{ image }: SchemaContext{{/if}}) {
|
|
9
9
|
return z.strictObject({
|
|
10
10
|
section: z.literal('{{camelCase section}}'),
|
|
11
11
|
title: z.string().min(1),
|
|
12
12
|
body: z.string().optional(),
|
|
13
|
-
{{#if
|
|
13
|
+
{{#if localImage}}
|
|
14
14
|
image: imageSchema(image),
|
|
15
15
|
{{/if}}
|
|
16
|
+
{{#if cloudinaryImage}}
|
|
17
|
+
image: photoSchema,
|
|
18
|
+
{{/if}}
|
|
16
19
|
buttons: z.array(ctaSchema).default([]),
|
|
17
20
|
})
|
|
18
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#if
|
|
1
|
+
{{#if localImage}}
|
|
2
2
|
import type { SchemaContext } from 'astro:content'
|
|
3
3
|
{{/if}}
|
|
4
4
|
import { z } from 'astro/zod'
|
|
@@ -7,6 +7,6 @@ import { {{camelCase section}}SectionSchema } from './{{dashCase section}}'
|
|
|
7
7
|
|
|
8
8
|
// INJECTION POINT per `pnpm gen:section` (ts-morph): il generatore verifica questa funzione
|
|
9
9
|
// e la sua chiamata a z.discriminatedUnion.
|
|
10
|
-
export function {{camelCase collection}}CollectionSchema({{#if
|
|
11
|
-
return z.discriminatedUnion('section', [{{camelCase section}}SectionSchema({{#if
|
|
10
|
+
export function {{camelCase collection}}CollectionSchema({{#if localImage}}context: SchemaContext{{/if}}) {
|
|
11
|
+
return z.discriminatedUnion('section', [{{camelCase section}}SectionSchema({{#if localImage}}context{{/if}})])
|
|
12
12
|
}
|
|
@@ -3,9 +3,11 @@ import { type Finding, type Hit } from './cli.ts';
|
|
|
3
3
|
import { type OfficinaConfig } from './config.ts';
|
|
4
4
|
type EnvHit = Omit<Finding, 'path'>;
|
|
5
5
|
export declare function placeholderSources(config?: OfficinaConfig): string[];
|
|
6
|
+
export declare const isContent: (path: string) => boolean;
|
|
6
7
|
export declare const contactEnvKeys: (config?: OfficinaConfig) => readonly string[];
|
|
7
8
|
export declare function requiredEnvKeys(config: OfficinaConfig, manifest: Manifest): string[];
|
|
8
9
|
export declare function sourceFindings(source: string): Hit[];
|
|
10
|
+
export declare function contentFindings(source: string): Hit[];
|
|
9
11
|
export declare function envFindings(content: string, keys: readonly string[]): EnvHit[];
|
|
10
12
|
export declare const outputFindings: (dir: string) => Finding[];
|
|
11
13
|
export {};
|
|
@@ -4,6 +4,8 @@ import { parseEnv } from 'node:util';
|
|
|
4
4
|
import { readLines } from './cli.js';
|
|
5
5
|
import { DEPENDENCY_FEATURES, featuresOn } from './config.js';
|
|
6
6
|
const DICTIONARIES = 'src/i18n/strings';
|
|
7
|
+
const CONTENT = 'src/content/';
|
|
8
|
+
const CONTENT_EXTENSIONS = ['.yml', '.yaml', '.json', '.md', '.mdx', '.mdoc'];
|
|
7
9
|
const DEFAULT_SOURCES = ['src/lib/site.ts', 'src/lib/company.ts'];
|
|
8
10
|
const CONTACT_ENV_KEYS = ['CONTACT_FROM_EMAIL', 'CONTACT_FROM_NAME', 'CONTACT_TO_EMAIL'];
|
|
9
11
|
const TOKEN = /<[A-Z][A-Z_]{2,}>/;
|
|
@@ -12,6 +14,7 @@ const STRING_LITERAL = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g;
|
|
|
12
14
|
const COMMENT_ONLY = /^\s*(?:\/\/|\/\*|\*)/;
|
|
13
15
|
const ZERO_POSTAL_CODE = /\bpostalCode:\s*(['"])00000\1/;
|
|
14
16
|
const EMPTY_HREF = /\bhref:\s*(['"])#\1/;
|
|
17
|
+
const PLACEHOLDER_IMAGE = /\bassets\/placeholder\.jpg\b/;
|
|
15
18
|
// `SENSITIVE_ENV_VALUE_PLACEHOLDER` di vercel@62.2.0: `vercel pull` lo scrive al posto del valore di una Secret.
|
|
16
19
|
const SENSITIVE = '[SENSITIVE]';
|
|
17
20
|
const WITHOUT_VALUE = 'il deploy andrebbe online senza il suo valore';
|
|
@@ -21,12 +24,22 @@ const dictionaries = () => existsSync(DICTIONARIES)
|
|
|
21
24
|
.sort()
|
|
22
25
|
.map((name) => join(DICTIONARIES, name))
|
|
23
26
|
: [];
|
|
27
|
+
const filesUnder = (dir) => readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
28
|
+
const path = join(dir, entry.name);
|
|
29
|
+
if (entry.isDirectory())
|
|
30
|
+
return filesUnder(path);
|
|
31
|
+
return entry.isFile() ? [path] : [];
|
|
32
|
+
});
|
|
33
|
+
const contentFiles = () => existsSync(CONTENT)
|
|
34
|
+
? filesUnder(CONTENT)
|
|
35
|
+
.filter((path) => CONTENT_EXTENSIONS.some((extension) => path.endsWith(extension)))
|
|
36
|
+
.sort()
|
|
37
|
+
: [];
|
|
24
38
|
export function placeholderSources(config = {}) {
|
|
25
|
-
const declared = config.placeholders?.sources;
|
|
26
|
-
|
|
27
|
-
return [...declared];
|
|
28
|
-
return [...DEFAULT_SOURCES, ...dictionaries()];
|
|
39
|
+
const declared = config.placeholders?.sources ?? [...DEFAULT_SOURCES, ...dictionaries()];
|
|
40
|
+
return [...new Set([...declared, ...contentFiles()])];
|
|
29
41
|
}
|
|
42
|
+
export const isContent = (path) => path.startsWith(CONTENT);
|
|
30
43
|
export const contactEnvKeys = (config = {}) => config.placeholders?.contactEnvKeys ?? CONTACT_ENV_KEYS;
|
|
31
44
|
export function requiredEnvKeys(config, manifest) {
|
|
32
45
|
const on = featuresOn(config, manifest);
|
|
@@ -44,16 +57,24 @@ function literalFindings(value) {
|
|
|
44
57
|
messages.push(`telefono segnaposto ${value}`);
|
|
45
58
|
return messages;
|
|
46
59
|
}
|
|
60
|
+
function lineMessages(text) {
|
|
61
|
+
const messages = [...text.matchAll(STRING_LITERAL)].flatMap((match) => literalFindings(match[0].slice(1, -1)));
|
|
62
|
+
if (ZERO_POSTAL_CODE.test(text))
|
|
63
|
+
messages.push('CAP segnaposto 00000');
|
|
64
|
+
if (EMPTY_HREF.test(text))
|
|
65
|
+
messages.push("profilo senza indirizzo: href: '#'");
|
|
66
|
+
return messages;
|
|
67
|
+
}
|
|
47
68
|
export function sourceFindings(source) {
|
|
69
|
+
return readLines(source).flatMap(({ n, text }) => COMMENT_ONLY.test(text) ? [] : lineMessages(text).map((message) => ({ line: n, message })));
|
|
70
|
+
}
|
|
71
|
+
// YAML e Markdown scrivono i valori senza apici, e in Markdown una riga che comincia con `*` è una voce d'elenco.
|
|
72
|
+
export function contentFindings(source) {
|
|
48
73
|
return readLines(source).flatMap(({ n, text }) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
messages.push('CAP segnaposto 00000');
|
|
54
|
-
if (EMPTY_HREF.test(text))
|
|
55
|
-
messages.push("profilo senza indirizzo: href: '#'");
|
|
56
|
-
return messages.map((message) => ({ line: n, message }));
|
|
74
|
+
const messages = new Set([...lineMessages(text), ...literalFindings(text)]);
|
|
75
|
+
if (PLACEHOLDER_IMAGE.test(text))
|
|
76
|
+
messages.add('foto di prova assets/placeholder.jpg');
|
|
77
|
+
return [...messages].map((message) => ({ line: n, message }));
|
|
57
78
|
});
|
|
58
79
|
}
|
|
59
80
|
export function envFindings(content, keys) {
|
|
@@ -78,12 +99,6 @@ export function envFindings(content, keys) {
|
|
|
78
99
|
return [];
|
|
79
100
|
});
|
|
80
101
|
}
|
|
81
|
-
const filesUnder = (dir) => readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
82
|
-
const path = join(dir, entry.name);
|
|
83
|
-
if (entry.isDirectory())
|
|
84
|
-
return filesUnder(path);
|
|
85
|
-
return entry.isFile() ? [path] : [];
|
|
86
|
-
});
|
|
87
102
|
export const outputFindings = (dir) => filesUnder(dir)
|
|
88
103
|
.filter((path) => readFileSync(path).includes(SENSITIVE))
|
|
89
104
|
.sort()
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { SmokeCheck } from './smoke-production.ts';
|
|
|
5
5
|
/** `'required'` fa fallire il gate quando ciò che deve controllare non c'è; `false` lo spegne. */
|
|
6
6
|
export type FeatureSetting = 'required' | false;
|
|
7
7
|
export type GeneratorsSetting = FeatureSetting | 'project';
|
|
8
|
+
export type ImageSource = 'local' | 'cloudinary';
|
|
8
9
|
export interface OfficinaConfig {
|
|
9
10
|
/** L'apice di produzione, senza barra finale: lo usa `check smoke` quando non riceve un URL e `smoke.url` manca. */
|
|
10
11
|
siteUrl?: string;
|
|
@@ -25,6 +26,7 @@ export interface OfficinaConfig {
|
|
|
25
26
|
analytics?: {
|
|
26
27
|
linkTracking?: string;
|
|
27
28
|
};
|
|
29
|
+
images?: ImageSource;
|
|
28
30
|
/**
|
|
29
31
|
* Quali controlli il progetto pretende. Una voce non dichiarata vale `'required'`, tranne `database`
|
|
30
32
|
* e `auth`, che senza dichiarazione seguono le dipendenze di `package.json`.
|
|
@@ -58,6 +60,7 @@ export type FeatureName = (typeof FEATURES)[number];
|
|
|
58
60
|
/** Un controllo si spegne solo scrivendolo: il silenzio vale `'required'`. */
|
|
59
61
|
export declare const isRequired: (config: OfficinaConfig, name: FeatureName) => boolean;
|
|
60
62
|
export declare const generatorsSetting: (config: OfficinaConfig) => GeneratorsSetting;
|
|
63
|
+
export declare const imagesSetting: (config: OfficinaConfig) => ImageSource;
|
|
61
64
|
export declare const DEPENDENCY_FEATURES: {
|
|
62
65
|
readonly database: {
|
|
63
66
|
readonly dependency: 'drizzle-orm';
|
package/dist/lib/config.js
CHANGED
|
@@ -14,6 +14,7 @@ export const FEATURES = ['analytics', 'roadmap', 'generators', 'botId', 'links']
|
|
|
14
14
|
/** Un controllo si spegne solo scrivendolo: il silenzio vale `'required'`. */
|
|
15
15
|
export const isRequired = (config, name) => (config.features?.[name] ?? 'required') === 'required';
|
|
16
16
|
export const generatorsSetting = (config) => config.features?.generators ?? 'required';
|
|
17
|
+
export const imagesSetting = (config) => config.images ?? 'local';
|
|
17
18
|
export const DEPENDENCY_FEATURES = {
|
|
18
19
|
database: { dependency: 'drizzle-orm', secret: 'DATABASE_URL' },
|
|
19
20
|
auth: { dependency: 'better-auth', secret: 'BETTER_AUTH_SECRET' },
|
|
@@ -35,6 +36,7 @@ const budget = aShape({ label: aString, matches: aFunction, maxGzip: aNumber });
|
|
|
35
36
|
const verifiedRoute = aShape({ path: aString, type: aString });
|
|
36
37
|
const feature = oneOf("'required' oppure false", ['required', false]);
|
|
37
38
|
const generators = oneOf("'required', 'project' oppure false", ['required', 'project', false]);
|
|
39
|
+
const images = oneOf("'local' oppure 'cloudinary'", ['local', 'cloudinary']);
|
|
38
40
|
const SHAPE = aShape({
|
|
39
41
|
siteUrl: aString,
|
|
40
42
|
icons: aShape({ background: aString }),
|
|
@@ -46,6 +48,7 @@ const SHAPE = aShape({
|
|
|
46
48
|
checks: anArrayOf(aFunction),
|
|
47
49
|
}),
|
|
48
50
|
analytics: aShape({ linkTracking: aString }),
|
|
51
|
+
images,
|
|
49
52
|
features: aShape({
|
|
50
53
|
analytics: feature,
|
|
51
54
|
roadmap: feature,
|
package/dist/lib/contract.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { ImageSource } from './config.ts';
|
|
1
2
|
type Requirement = {
|
|
3
|
+
images?: ImageSource;
|
|
4
|
+
} & ({
|
|
2
5
|
kind: 'file';
|
|
3
6
|
path: string;
|
|
4
7
|
reason: string;
|
|
@@ -20,12 +23,12 @@ type Requirement = {
|
|
|
20
23
|
kind: 'script';
|
|
21
24
|
name: string;
|
|
22
25
|
reason: string;
|
|
23
|
-
};
|
|
26
|
+
});
|
|
24
27
|
export declare const CONTRACT: Requirement[];
|
|
25
28
|
export interface ContractGap {
|
|
26
29
|
path: string;
|
|
27
30
|
message: string;
|
|
28
31
|
severity?: 'warning';
|
|
29
32
|
}
|
|
30
|
-
export declare function contractGaps(root: string): ContractGap[];
|
|
33
|
+
export declare function contractGaps(root: string, images?: ImageSource): ContractGap[];
|
|
31
34
|
export {};
|
package/dist/lib/contract.js
CHANGED
|
@@ -39,11 +39,26 @@ export const CONTRACT = [
|
|
|
39
39
|
path: 'src/lib/schemas/common.ts',
|
|
40
40
|
text: 'export function imageSchema',
|
|
41
41
|
reason: "lo schema di una sezione con immagine lo importa da ../common, e lo chiama con l'helper di Astro",
|
|
42
|
+
images: 'local',
|
|
42
43
|
},
|
|
43
44
|
{
|
|
44
45
|
kind: 'file',
|
|
45
46
|
path: 'src/assets/placeholder.jpg',
|
|
46
47
|
reason: 'il contenuto di una sezione con immagine ci punta appena generato',
|
|
48
|
+
images: 'local',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
kind: 'anchor',
|
|
52
|
+
path: 'src/lib/schemas/common.ts',
|
|
53
|
+
text: 'export const photoSchema',
|
|
54
|
+
reason: 'lo schema di una sezione con la foto su Cloudinary lo importa da ../common',
|
|
55
|
+
images: 'cloudinary',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
kind: 'file',
|
|
59
|
+
path: 'src/components/ui/photo.astro',
|
|
60
|
+
reason: 'una sezione con la foto su Cloudinary la mostra con questo componente',
|
|
61
|
+
images: 'cloudinary',
|
|
47
62
|
},
|
|
48
63
|
{
|
|
49
64
|
kind: 'anchor',
|
|
@@ -95,9 +110,10 @@ function readManifest(root) {
|
|
|
95
110
|
const target = join(root, MANIFEST);
|
|
96
111
|
return existsSync(target) ? JSON.parse(readFileSync(target, 'utf8')) : {};
|
|
97
112
|
}
|
|
98
|
-
export function contractGaps(root) {
|
|
113
|
+
export function contractGaps(root, images = 'local') {
|
|
99
114
|
const manifest = readManifest(root);
|
|
100
|
-
|
|
115
|
+
const required = CONTRACT.filter((requirement) => requirement.images === undefined || requirement.images === images);
|
|
116
|
+
return required.flatMap((requirement) => {
|
|
101
117
|
const gap = pathGap(root, requirement) ?? manifestGap(manifest, requirement);
|
|
102
118
|
return gap === undefined ? [] : [gap];
|
|
103
119
|
});
|
package/dist/lib/tooling.js
CHANGED
|
@@ -10,7 +10,7 @@ const REQUIRED = [
|
|
|
10
10
|
];
|
|
11
11
|
const BIOME = '@biomejs/biome';
|
|
12
12
|
const MANIFEST = 'package.json';
|
|
13
|
-
// Il preset usa una regola `nursery`, che fra
|
|
13
|
+
// Il preset usa una regola `nursery`, che anche fra due minor di Biome cambia nome o sparisce:
|
|
14
14
|
// l'intervallo che regge lo dichiara il pacchetto, in un posto solo.
|
|
15
15
|
function biomeRangeGap(declared) {
|
|
16
16
|
const range = peerRange(BIOME);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elia97/officina",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Gli strumenti dei progetti nati dai template di Elia: gate di qualità, generatori e verifiche di build e di produzione.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"test:pack": "bash scripts/pack-test.sh"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@biomejs/biome": "2.
|
|
58
|
+
"@biomejs/biome": "2.6.3",
|
|
59
59
|
"@types/node": "^26.5.1",
|
|
60
60
|
"@vitest/coverage-v8": "^4.1.11",
|
|
61
61
|
"fallow": "^3.26.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"yaml": "^2.9.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@biomejs/biome": ">=2.
|
|
71
|
+
"@biomejs/biome": ">=2.6.0 <3.0.0",
|
|
72
72
|
"sharp": ">=0.34.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependenciesMeta": {
|
package/presets/biome.base.json
CHANGED
|
@@ -36,12 +36,7 @@
|
|
|
36
36
|
"noExcessiveLinesPerFunction": "error"
|
|
37
37
|
},
|
|
38
38
|
"nursery": {
|
|
39
|
-
"
|
|
40
|
-
"level": "error",
|
|
41
|
-
"options": {
|
|
42
|
-
"functions": ["cn", "cva"]
|
|
43
|
-
}
|
|
44
|
-
}
|
|
39
|
+
"useTailwindSortedClasses": "error"
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
42
|
},
|
|
@@ -56,6 +51,16 @@
|
|
|
56
51
|
"tailwindDirectives": true
|
|
57
52
|
}
|
|
58
53
|
},
|
|
54
|
+
"yaml": {
|
|
55
|
+
"formatter": {
|
|
56
|
+
"enabled": false
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"markdown": {
|
|
60
|
+
"formatter": {
|
|
61
|
+
"enabled": false
|
|
62
|
+
}
|
|
63
|
+
},
|
|
59
64
|
"assist": {
|
|
60
65
|
"enabled": true,
|
|
61
66
|
"actions": {
|