@conloca/cli 0.2.1 → 0.2.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.
- package/README.md +5 -3
- package/dist/conloca.js +92 -27
- package/package.json +12 -6
package/README.md
CHANGED
|
@@ -74,7 +74,8 @@ This command will generate:
|
|
|
74
74
|
- `src/components/puck/Flex.tsx` - Flex layout component
|
|
75
75
|
- `src/components/puck/Grid.tsx` - Grid layout component
|
|
76
76
|
- `src/layouts/Layout.astro` - Bare page layout, meant to be replaced
|
|
77
|
-
- `src/schemas/data.ts` - Example
|
|
77
|
+
- `src/schemas/data.ts` - Example Typia data-collection schemas (types plus generated validators and form metadata)
|
|
78
|
+
- `typia-vite.mjs` / `tsconfig.typia.json` - The native Typia transform `astro.config.mjs` runs over `src/schemas/`
|
|
78
79
|
- `content/sites.json` - Site list, holding the site `default`
|
|
79
80
|
- `.claude/skills/conloca/SKILL.md` - One-page Conloca guide for coding agents
|
|
80
81
|
|
|
@@ -123,7 +124,7 @@ Astro checks, when an `astro.config.mjs`/`.ts`/`.js` is present (the config is r
|
|
|
123
124
|
- `conlocaCMS` is imported from `@conloca/astro-cms/node` and its options carry `contentRoot`, `puckConfigPath`, and a
|
|
124
125
|
`routing` block or `layout`
|
|
125
126
|
- `react()` is in `integrations` and comes before `conlocaCMS()`
|
|
126
|
-
- the
|
|
127
|
+
- the `@vitejs/plugin-react` peer is declared in `package.json`
|
|
127
128
|
- `tsconfig.json` sets `compilerOptions.jsx` to `react-jsx` (advisory — a warning only)
|
|
128
129
|
- with `output: 'server'`, every file under `src/pages` declares `prerender`
|
|
129
130
|
- no static `src/pages/index.astro` shadows the CMS home page
|
|
@@ -223,7 +224,8 @@ Adding Conloca to an existing Astro site instead? Install the packages, run `con
|
|
|
223
224
|
prints to `astro.config.mjs`, create `src/content.config.ts` as printed, then run `conloca doctor`:
|
|
224
225
|
|
|
225
226
|
```bash
|
|
226
|
-
npm install @conloca/astro-cms @conloca/content-api @conloca/mdx @puckeditor/core @astrojs/react @vitejs/plugin-react
|
|
227
|
+
npm install @conloca/astro-cms @conloca/content-api @conloca/mdx @puckeditor/core @astrojs/react @vitejs/plugin-react typia
|
|
228
|
+
npm install -D ttsc @ttsc/unplugin
|
|
227
229
|
conloca astro setup
|
|
228
230
|
conloca doctor
|
|
229
231
|
```
|
package/dist/conloca.js
CHANGED
|
@@ -2170,10 +2170,12 @@ var THIRD_PARTY_VERSIONS = {
|
|
|
2170
2170
|
"@vitejs/plugin-react": "^5.2.0",
|
|
2171
2171
|
react: "19.2.8",
|
|
2172
2172
|
"react-dom": "19.2.8",
|
|
2173
|
-
|
|
2174
|
-
"@astrojs/check": "^0.9.10"
|
|
2173
|
+
typia: "^14.0.4",
|
|
2174
|
+
"@astrojs/check": "^0.9.10",
|
|
2175
|
+
"@ttsc/unplugin": "^0.30.4",
|
|
2176
|
+
ttsc: "0.30.4"
|
|
2175
2177
|
};
|
|
2176
|
-
var DEV_ONLY = new Set(["@astrojs/check"]);
|
|
2178
|
+
var DEV_ONLY = new Set(["@astrojs/check", "@ttsc/unplugin", "ttsc"]);
|
|
2177
2179
|
var MANIFEST_CANDIDATES = ["../package.json", "../../package.json"];
|
|
2178
2180
|
async function readCliManifest() {
|
|
2179
2181
|
for (const candidate of MANIFEST_CANDIDATES) {
|
|
@@ -2277,6 +2279,7 @@ import node from '@astrojs/node';
|
|
|
2277
2279
|
import react from '@astrojs/react';
|
|
2278
2280
|
import { conlocaCMS } from '@conloca/astro-cms/node';
|
|
2279
2281
|
import { defineConfig } from 'astro/config';
|
|
2282
|
+
import { schemaTypia } from './typia-vite.mjs';
|
|
2280
2283
|
|
|
2281
2284
|
export default defineConfig({
|
|
2282
2285
|
output: 'server',
|
|
@@ -2302,9 +2305,46 @@ export default defineConfig({
|
|
|
2302
2305
|
},
|
|
2303
2306
|
}),
|
|
2304
2307
|
],
|
|
2308
|
+
// Generates the validators and form metadata src/schemas/data.ts declares.
|
|
2309
|
+
vite: { plugins: [...schemaTypia()] },
|
|
2305
2310
|
});
|
|
2306
2311
|
`;
|
|
2307
2312
|
}
|
|
2313
|
+
var TYPIA_VITE_TEMPLATE = `import { fileURLToPath } from 'node:url';
|
|
2314
|
+
import ttsc from '@ttsc/unplugin/vite';
|
|
2315
|
+
|
|
2316
|
+
const project = fileURLToPath(new URL('./tsconfig.typia.json', import.meta.url));
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* Compiles the Typia call sites in src/schemas/ into generated validators and
|
|
2320
|
+
* JSON Schema metadata. Astro's content config and the CMS editor both load
|
|
2321
|
+
* those modules through this Vite pipeline.
|
|
2322
|
+
*
|
|
2323
|
+
* @returns {import('vite').Plugin[]}
|
|
2324
|
+
*/
|
|
2325
|
+
export function schemaTypia() {
|
|
2326
|
+
const plugins = ttsc({ project });
|
|
2327
|
+
return (Array.isArray(plugins) ? plugins : [plugins]).map((plugin) => {
|
|
2328
|
+
const transform = plugin.transform;
|
|
2329
|
+
if (!transform) return plugin;
|
|
2330
|
+
const hook = typeof transform === 'function' ? { handler: transform } : transform;
|
|
2331
|
+
return { ...plugin, transform: { ...hook, filter: { ...hook.filter, id: /[\\\\/]src[\\\\/]schemas[\\\\/]/ } } };
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
`;
|
|
2335
|
+
var TYPIA_TSCONFIG_TEMPLATE = `{
|
|
2336
|
+
"compilerOptions": {
|
|
2337
|
+
"target": "ES2022",
|
|
2338
|
+
"module": "ESNext",
|
|
2339
|
+
"moduleResolution": "Bundler",
|
|
2340
|
+
"strict": true,
|
|
2341
|
+
"skipLibCheck": true,
|
|
2342
|
+
"noEmit": true,
|
|
2343
|
+
"types": []
|
|
2344
|
+
},
|
|
2345
|
+
"include": ["src/schemas/**/*.ts"]
|
|
2346
|
+
}
|
|
2347
|
+
`;
|
|
2308
2348
|
var TSCONFIG_TEMPLATE = `{
|
|
2309
2349
|
"extends": "astro/tsconfigs/strict",
|
|
2310
2350
|
"compilerOptions": {
|
|
@@ -2418,7 +2458,7 @@ async function readProjectDependencies(projectDir) {
|
|
|
2418
2458
|
|
|
2419
2459
|
// src/commands/doctor-astro.ts
|
|
2420
2460
|
var ASTRO_CONFIG_NAMES = ["astro.config.mjs", "astro.config.ts", "astro.config.js"];
|
|
2421
|
-
var CMS_PEERS = ["
|
|
2461
|
+
var CMS_PEERS = ["@vitejs/plugin-react"];
|
|
2422
2462
|
var PAGE_FILE_RE = /\.(?:astro|ts|md|mdx)$/;
|
|
2423
2463
|
var OPENERS = { "(": ")", "{": "}", "[": "]" };
|
|
2424
2464
|
var CLOSERS = new Set([")", "}", "]"]);
|
|
@@ -3393,7 +3433,7 @@ async function ensureSiteInSitesConfig(contentPath, siteName) {
|
|
|
3393
3433
|
}
|
|
3394
3434
|
|
|
3395
3435
|
// src/templates/conloca-skill.md
|
|
3396
|
-
var conloca_skill_default = "---\nname: conloca\ndescription: Load when working on an Astro site using Conloca CMS — @conloca/* packages, .vxjson content, sites.json.\n---\n\n# Conloca CMS\n\nConloca stores pages as `.vxjson` files (visual pages built from Puck components) and `.mdx` files under `content/`, and\nrenders them through the `@conloca/astro-cms` Astro integration. The visual editor lives at `/__cms` on the dev server\nonly.\n\n## First move: `conloca doctor`\n\nFor any Conloca problem — blank page, 404 on a content page, editor not loading, build failure — run this before reading\nsource:\n\n```bash\nconloca doctor # human-readable report\nconloca doctor --json # single {ok, problems} object on stdout\n```\n\nThe `conloca` command ships in `@conloca/cli` — run it as `npx @conloca/cli doctor` (or `bunx`) when it is not\ninstalled.\n\nIt checks the content directory (sites.json complete, site directories present, every content file indexes cleanly) and,\nwhen an astro.config is present, the Astro wiring: content config, conlocaCMS import and options, react() order, peer\ndependencies, tsconfig jsx, prerender under server output, and home-page shadowing. Each problem names the broken file\nand the fix. It is read-only and exits 1 on errors; warnings alone exit 0.\n\nNew project from an empty directory? `conloca create <dir>` writes and installs the whole wired site;\n`conloca astro setup` is for adding Conloca to an existing Astro site.\n\n## The files a working site needs\n\n- `astro.config.mjs` — registers `react()` and `conlocaCMS(...)`\n- `src/content.config.ts` — declares the content collections (without it every content page 404s)\n- `content/sites.json` — sites with their `locales` and `defaultLocale`, plus `globalLocales`\n- `src/puck.config.tsx` — registers the Puck components pages are built from\n- `src/layouts/Layout.astro` — the page layout content pages render into\n- `src/components/puck/*` and `src/schemas/data.ts` — starter components and data-collection schemas\n\nRun `conloca astro setup` inside an existing Astro project. It scaffolds the content config, components, schemas, page\nlayout, and content directories, preserving existing generated files. It adds the default site to `sites.json` when\nmissing. It prints the `astro.config` wiring rather than writing that file: merge the printed options into the existing\nconfig, then run `conloca doctor` to verify the result. `conloca init . <site-name>` adds another site to sites.json.\n\n## Install: the exact package set\n\n```bash\nnpm install @conloca/astro-cms @conloca/content-api @conloca/mdx @puckeditor/core @astrojs/react @vitejs/plugin-react
|
|
3436
|
+
var conloca_skill_default = "---\nname: conloca\ndescription: Load when working on an Astro site using Conloca CMS — @conloca/* packages, .vxjson content, sites.json.\n---\n\n# Conloca CMS\n\nConloca stores pages as `.vxjson` files (visual pages built from Puck components) and `.mdx` files under `content/`, and\nrenders them through the `@conloca/astro-cms` Astro integration. The visual editor lives at `/__cms` on the dev server\nonly.\n\n## First move: `conloca doctor`\n\nFor any Conloca problem — blank page, 404 on a content page, editor not loading, build failure — run this before reading\nsource:\n\n```bash\nconloca doctor # human-readable report\nconloca doctor --json # single {ok, problems} object on stdout\n```\n\nThe `conloca` command ships in `@conloca/cli` — run it as `npx @conloca/cli doctor` (or `bunx`) when it is not\ninstalled.\n\nIt checks the content directory (sites.json complete, site directories present, every content file indexes cleanly) and,\nwhen an astro.config is present, the Astro wiring: content config, conlocaCMS import and options, react() order, peer\ndependencies, tsconfig jsx, prerender under server output, and home-page shadowing. Each problem names the broken file\nand the fix. It is read-only and exits 1 on errors; warnings alone exit 0.\n\nNew project from an empty directory? `conloca create <dir>` writes and installs the whole wired site;\n`conloca astro setup` is for adding Conloca to an existing Astro site.\n\n## The files a working site needs\n\n- `astro.config.mjs` — registers `react()` and `conlocaCMS(...)`\n- `src/content.config.ts` — declares the content collections (without it every content page 404s)\n- `content/sites.json` — sites with their `locales` and `defaultLocale`, plus `globalLocales`\n- `src/puck.config.tsx` — registers the Puck components pages are built from\n- `src/layouts/Layout.astro` — the page layout content pages render into\n- `src/components/puck/*` and `src/schemas/data.ts` — starter components and data-collection schemas\n\nRun `conloca astro setup` inside an existing Astro project. It scaffolds the content config, components, schemas, page\nlayout, and content directories, preserving existing generated files. It adds the default site to `sites.json` when\nmissing. It prints the `astro.config` wiring rather than writing that file: merge the printed options into the existing\nconfig, then run `conloca doctor` to verify the result. `conloca init . <site-name>` adds another site to sites.json.\n\n## Install: the exact package set\n\n```bash\nnpm install @conloca/astro-cms @conloca/content-api @conloca/mdx @puckeditor/core @astrojs/react @vitejs/plugin-react typia\nnpm install -D ttsc @ttsc/unplugin\n```\n\n`@puckeditor/core` is what the generated components import — there is no other Puck package to install.\n\n## Canonical astro.config.mjs\n\nThe minimal working config, matching what `conloca astro setup` prints:\n\n```js\nimport react from '@astrojs/react';\nimport { conlocaCMS } from '@conloca/astro-cms/node';\nimport { defineConfig } from 'astro/config';\nimport { schemaTypia } from './typia-vite.mjs';\n\nexport default defineConfig({\n integrations: [\n react(),\n conlocaCMS({\n contentRoot: './content',\n puckConfigPath: './src/puck.config.tsx',\n schemasPath: './src/schemas/data.ts',\n layout: './src/layouts/Layout.astro',\n }),\n ],\n vite: { plugins: [...schemaTypia()] },\n});\n```\n\n`react()` must come before `conlocaCMS()` — doctor checks the order. `src/schemas/data.ts` declares each data collection\nas a TypeScript type plus its generated Typia validator (`typia.plain.createValidatePrune<T>()`) and form metadata\n(`typia.json.schema<T>()`); `typia-vite.mjs` is the native transform that generates them, so it must stay in\n`vite.plugins`. And `src/content.config.ts`:\n\n```ts\nimport { conlocaData, conlocaFragments, conlocaPages } from '@conloca/astro-cms/node/content';\nimport { dataSchemas } from './schemas/data';\n\nexport const collections = {\n pages: conlocaPages(),\n ...conlocaData({ dataSchemas }),\n ...conlocaFragments(),\n};\n```\n\nEvery collection is declared here by name — content the config does not name fails the build instead of silently not\nbuilding.\n\n## Where errors appear\n\n- `astro dev` runs in the foreground: config and integration errors print to the terminal running it, and page errors\n also show in the browser error overlay. There is no separate log command — read that terminal.\n- A page referencing a Puck component type missing from puck.config.tsx serves HTTP 200 with a blank region and a clean\n browser console. The only signal is `[Conloca] Page references N component type(s) missing from your Puck config: ...`\n in the dev-server or build terminal.\n- The editor at `/__cms` exists only on the dev server. A production build without it is not a bug.\n\n## Creating a page\n\n```bash\nconloca page create --site default --collection pages --pathname /about --title 'About us'\n```\n\nWrites the `.vxjson` file with the same empty Puck payload the CMS writes for a new page, in the site's default locale;\nthe page is immediately editable at `/__cms`. `--json` prints `{ok, id, path}`. Do not hand-craft `.vxjson` files and do\nnot reach for HTTP endpoints — this command is the supported path.\n\n## Routing\n\n- `layout: './src/layouts/Layout.astro'` alone injects a catch-all `/[...slug]` route over the `pages` collection, with\n `prerender: true` and `fallback: '404'`.\n- Passing `routing` replaces that default route entirely and the top-level `layout` is then ignored — name it per route\n instead: `routing: { routes: { pages: { pattern: '/[...slug]', layout: './src/layouts/Layout.astro' } } }`.\n- `routing: true` is the same default catch-all with no layout.\n- `fallback: '404'` returns a bare 404 when no content matches the pattern; `'passthrough'` hands the miss back to Astro\n so the site's own `/404` page renders, with a real 404 status.\n- Trap: a static `src/pages/index.astro` shadows the CMS home page — the file wins over the catch-all and Astro says\n nothing. Doctor flags it; delete the file or manage the home page in the CMS.\n\n## Adding Conloca to an existing Astro site\n\n- Switching to `output: 'server'`: first add `export const prerender = true` to every existing file under `src/pages/`,\n then flip the output — otherwise those pages silently stop being static. Doctor errors on files that miss it.\n- Existing `.mdx` content: set the site's `mdxPages` path in `content/sites.json` (relative to the project root, e.g.\n `./src/content/docs`). `.mdx` files under it surface in the CMS as pages of that site; the default locale lives at\n `<mdxPages>/<slug>.mdx`, other locales at `<mdxPages>/<locale>/<slug>.mdx`.\n- Plain `.md` files are never adopted — only `.mdx` and `.vxjson` are recognized as pages. Rename `.md` to `.mdx` to\n bring a file under management.\n\n## Custom Puck components\n\nFollow the generated examples in `src/components/puck/` — that is the one proven path:\n\n1. Write a render component plus a `ComponentConfig` wrapped in `withLayout` from `src/components/ComponentLayout.tsx`,\n mirroring the generated `HeadingComponent.tsx` / `Heading.tsx` pair.\n2. Register the component and its Props type in `src/puck.config.tsx`: add it to the `Components` type and the\n `components` map (and optionally a `categories` entry).\n3. Types come from `@puckeditor/core`. If `.tsx` components misrender or fail typecheck, set tsconfig\n `\"jsx\": \"react-jsx\"` — doctor's advisory warning covers this.\n\nA component referenced by stored content but not registered renders blank — see \"Where errors appear\".\n\n## Known limits — by design, do not fight them\n\n- MDX fragments render prose only.\n `Unknown component <X>: fragments render as plain content and cannot use React components.` is intentional: fragment\n content is treated as untrusted, so `{...}` expressions and `import`/`export` statements are rejected too. Do not try\n to sneak components in.\n- Unknown Puck component types render as nothing; the dev-server or build console names them. The fix is registering the\n type in `puck.config.tsx`, not editing the stored content.\n";
|
|
3397
3437
|
|
|
3398
3438
|
// src/commands/setup.ts
|
|
3399
3439
|
var DEFAULT_SITE_NAME = "default";
|
|
@@ -3997,37 +4037,55 @@ const puckConfig: Config<Components> = {
|
|
|
3997
4037
|
|
|
3998
4038
|
export default puckConfig;
|
|
3999
4039
|
`;
|
|
4000
|
-
var DATA_SCHEMAS_TEMPLATE = `import {
|
|
4040
|
+
var DATA_SCHEMAS_TEMPLATE = `import { defineHostSchema } from '@conloca/astro-cms/page-schemas';
|
|
4041
|
+
import typia, { type tags } from 'typia';
|
|
4001
4042
|
|
|
4002
4043
|
/**
|
|
4003
4044
|
* Data collection schemas for the CMS.
|
|
4004
4045
|
*
|
|
4005
|
-
* Each key is a collection name (matching folders in content/data/).
|
|
4006
|
-
*
|
|
4046
|
+
* Each key is a collection name (matching folders in content/data/). Each value
|
|
4047
|
+
* is a TypeScript type plus what Typia generates for it at build time (wired by
|
|
4048
|
+
* typia-vite.mjs in astro.config.mjs): \`validate\` checks every stored entry
|
|
4049
|
+
* when the collection loads, and \`metadata\` is the JSON Schema the CMS renders
|
|
4050
|
+
* the entry form from.
|
|
4007
4051
|
*
|
|
4008
4052
|
* Tips:
|
|
4009
|
-
* -
|
|
4010
|
-
* -
|
|
4011
|
-
* - Supported
|
|
4053
|
+
* - A JSDoc comment on a field becomes its help text in the form
|
|
4054
|
+
* - Optional properties (\`?\`) are optional fields
|
|
4055
|
+
* - Supported controls: string, number, boolean, date (\`string & tags.Format<'date-time'>\`),
|
|
4056
|
+
* email / url (\`tags.Format\`), string literal unions (select), arrays
|
|
4012
4057
|
*/
|
|
4058
|
+
|
|
4059
|
+
/** Authors collection - blog post authors, team members, etc. */
|
|
4060
|
+
export interface Author {
|
|
4061
|
+
/** Full name */
|
|
4062
|
+
name: string;
|
|
4063
|
+
/** Short biography */
|
|
4064
|
+
bio: string;
|
|
4065
|
+
/** Profile image URL */
|
|
4066
|
+
avatar?: string & tags.Format<'url'>;
|
|
4067
|
+
/** Twitter handle (e.g., @username) */
|
|
4068
|
+
twitter?: string;
|
|
4069
|
+
/** Contact email */
|
|
4070
|
+
email?: string & tags.Format<'email'>;
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
/** Settings collection - site configuration, feature flags, etc. */
|
|
4074
|
+
export interface Settings {
|
|
4075
|
+
/** Site name */
|
|
4076
|
+
siteName?: string;
|
|
4077
|
+
/** Contact email address */
|
|
4078
|
+
contactEmail?: string & tags.Format<'email'>;
|
|
4079
|
+
}
|
|
4080
|
+
|
|
4013
4081
|
export const dataSchemas = {
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
authors: z.object({
|
|
4018
|
-
name: z.string().describe('Full name'),
|
|
4019
|
-
bio: z.string().describe('Short biography'),
|
|
4020
|
-
avatar: z.string().url().optional().describe('Profile image URL'),
|
|
4021
|
-
twitter: z.string().optional().describe('Twitter handle (e.g., @username)'),
|
|
4022
|
-
email: z.string().email().optional().describe('Contact email'),
|
|
4082
|
+
authors: defineHostSchema<Author>({
|
|
4083
|
+
validate: typia.plain.createValidatePrune<Author>(),
|
|
4084
|
+
metadata: typia.json.schema<Author>(),
|
|
4023
4085
|
}),
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
*/
|
|
4028
|
-
settings: z.object({
|
|
4029
|
-
siteName: z.string().optional().describe('Site name'),
|
|
4030
|
-
contactEmail: z.string().email().optional().describe('Contact email address'),
|
|
4086
|
+
settings: defineHostSchema<Settings>({
|
|
4087
|
+
validate: typia.plain.createValidatePrune<Settings>(),
|
|
4088
|
+
metadata: typia.json.schema<Settings>(),
|
|
4031
4089
|
}),
|
|
4032
4090
|
};
|
|
4033
4091
|
`;
|
|
@@ -4071,6 +4129,8 @@ async function setup(projectPath = ".", siteName = DEFAULT_SITE_NAME) {
|
|
|
4071
4129
|
await writeIfNotExists(join8(srcDir, "components", "puck", "Grid.tsx"), GRID_TEMPLATE, "src/components/puck/Grid.tsx");
|
|
4072
4130
|
await writeIfNotExists(join8(srcDir, "puck.config.tsx"), PUCK_CONFIG_TEMPLATE, "src/puck.config.tsx");
|
|
4073
4131
|
await writeIfNotExists(join8(srcDir, "schemas", "data.ts"), DATA_SCHEMAS_TEMPLATE, "src/schemas/data.ts");
|
|
4132
|
+
await writeIfNotExists(join8(absolutePath, "typia-vite.mjs"), TYPIA_VITE_TEMPLATE, "typia-vite.mjs");
|
|
4133
|
+
await writeIfNotExists(join8(absolutePath, "tsconfig.typia.json"), TYPIA_TSCONFIG_TEMPLATE, "tsconfig.typia.json");
|
|
4074
4134
|
await writeIfNotExists(join8(srcDir, "layouts", "Layout.astro"), PAGE_LAYOUT_TEMPLATE, "src/layouts/Layout.astro");
|
|
4075
4135
|
await writeIfNotExists(join8(absolutePath, ".claude", "skills", "conloca", "SKILL.md"), conloca_skill_default, ".claude/skills/conloca/SKILL.md");
|
|
4076
4136
|
const sites = await ensureSiteInSitesConfig(contentDir, siteName);
|
|
@@ -4109,6 +4169,7 @@ Next steps:`);
|
|
|
4109
4169
|
`);
|
|
4110
4170
|
console.log(` import react from '@astrojs/react';
|
|
4111
4171
|
import { conlocaCMS } from '@conloca/astro-cms/node';
|
|
4172
|
+
import { schemaTypia } from './typia-vite.mjs';
|
|
4112
4173
|
|
|
4113
4174
|
export default defineConfig({
|
|
4114
4175
|
integrations: [
|
|
@@ -4120,7 +4181,11 @@ Next steps:`);
|
|
|
4120
4181
|
layout: './src/layouts/Layout.astro',
|
|
4121
4182
|
}),
|
|
4122
4183
|
],
|
|
4184
|
+
vite: { plugins: [...schemaTypia()] },
|
|
4123
4185
|
});`);
|
|
4186
|
+
console.log(`
|
|
4187
|
+
The schemas file is generated code: add typia, and ttsc + @ttsc/unplugin as dev`);
|
|
4188
|
+
console.log(" dependencies, so typia-vite.mjs can compile it.");
|
|
4124
4189
|
console.log("\n `layout` on its own turns on a catch-all /[...slug] route over the pages");
|
|
4125
4190
|
console.log(" collection. Adding `routing` replaces that route, and the top-level `layout`");
|
|
4126
4191
|
console.log(" is then ignored — name it under routing.routes.<name>.layout instead.");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conloca/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"directory": "packages/cli"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@conloca/astro-cms": "0.2.
|
|
14
|
-
"@conloca/content-api": "0.2.
|
|
13
|
+
"@conloca/astro-cms": "0.2.2",
|
|
14
|
+
"@conloca/content-api": "0.2.2"
|
|
15
15
|
},
|
|
16
16
|
"bin": {
|
|
17
17
|
"conloca": "./dist/conloca.js"
|
|
@@ -50,10 +50,15 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"build": {
|
|
53
|
+
"//": "The bundle inlines src/templates/conloca-skill.md. The default input excludes every Markdown file, and that exclusion wins over a file listed by name, so the project's own files are hashed in full.",
|
|
53
54
|
"executor": "nx:run-commands",
|
|
54
55
|
"dependsOn": [
|
|
55
56
|
"^build"
|
|
56
57
|
],
|
|
58
|
+
"inputs": [
|
|
59
|
+
"{projectRoot}/**/*",
|
|
60
|
+
"^default"
|
|
61
|
+
],
|
|
57
62
|
"options": {
|
|
58
63
|
"command": "bun run build.ts",
|
|
59
64
|
"cwd": "{projectRoot}"
|
|
@@ -68,6 +73,7 @@
|
|
|
68
73
|
]
|
|
69
74
|
},
|
|
70
75
|
"test": {
|
|
76
|
+
"//": "test/skill.test.ts reads src/templates/conloca-skill.md, which the default input would exclude even when listed by name, so the project's own files are hashed in full.",
|
|
71
77
|
"executor": "@smoothbricks/nx-plugin:bounded-exec",
|
|
72
78
|
"dependsOn": [
|
|
73
79
|
"build",
|
|
@@ -75,7 +81,7 @@
|
|
|
75
81
|
"test-packed"
|
|
76
82
|
],
|
|
77
83
|
"inputs": [
|
|
78
|
-
"
|
|
84
|
+
"{projectRoot}/**/*",
|
|
79
85
|
"^default",
|
|
80
86
|
"{workspaceRoot}/example/website-with-cms/package.json",
|
|
81
87
|
"{workspaceRoot}/tooling/test-setup.ts",
|
|
@@ -83,9 +89,9 @@
|
|
|
83
89
|
"{workspaceRoot}/tooling/git-env-isolation.ts"
|
|
84
90
|
],
|
|
85
91
|
"options": {
|
|
86
|
-
"command": "bun test --timeout=
|
|
92
|
+
"command": "bun test --timeout=0",
|
|
87
93
|
"cwd": "{projectRoot}",
|
|
88
|
-
"
|
|
94
|
+
"idleTimeoutMs": 180000,
|
|
89
95
|
"killAfterMs": 10000
|
|
90
96
|
}
|
|
91
97
|
},
|