contentrain 0.5.0 → 0.5.4

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.
@@ -14,7 +14,7 @@ async function createDemoProject() {
14
14
  const dir = await mkdtemp(join(tmpdir(), "contentrain-demo-"));
15
15
  const git = simpleGit(dir);
16
16
  await git.init();
17
- await git.addConfig("user.email", "demo@contentrain.io");
17
+ await git.addConfig("user.email", "ai@contentrain.io");
18
18
  await git.addConfig("user.name", "Contentrain Demo");
19
19
  const crDir = join(dir, ".contentrain");
20
20
  await Promise.all([
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { i as pc } from "./ui-B8l_LC36.mjs";
3
3
  import { defineCommand, runMain } from "citty";
4
4
  //#region package.json
5
- var version = "0.5.0";
5
+ var version = "0.5.4";
6
6
  //#endregion
7
7
  //#region src/utils/debug.ts
8
8
  /**
@@ -43,11 +43,11 @@ runMain(defineCommand({
43
43
  description: "Contentrain CLI — AI content governance infrastructure"
44
44
  },
45
45
  subCommands: {
46
- init: () => import("./init-540qiNQJ.mjs").then((m) => m.default),
46
+ init: () => import("./init-1fl35oaD.mjs").then((m) => m.default),
47
47
  status: () => import("./status-Bmjfrk-B.mjs").then((m) => m.default),
48
48
  doctor: () => import("./doctor-MOf_LQEL.mjs").then((m) => m.default),
49
49
  validate: () => import("./validate-BG0X5g09.mjs").then((m) => m.default),
50
- serve: () => import("./serve-CxA2pKbp.mjs").then((m) => m.default),
50
+ serve: () => import("./serve-iLl3Y5Bt.mjs").then((m) => m.default),
51
51
  generate: () => import("./generate-ByscV5SN.mjs").then((m) => m.default),
52
52
  diff: () => import("./diff-ov1j9bAb.mjs").then((m) => m.default),
53
53
  merge: () => import("./merge-DdPRttF-.mjs").then((m) => m.default),
@@ -279,12 +279,40 @@ var init_default = defineCommand({
279
279
  log.message(` ${pc.cyan("contentrain doctor")} — verify setup health`);
280
280
  if (templateChoice === "none") log.message(` ${pc.cyan("contentrain serve")} — open the local review and normalize UI`);
281
281
  log.message(` ${pc.cyan("contentrain generate")} — generate SDK client`);
282
+ printStackWiring(stackChoice);
282
283
  log.message("");
283
284
  log.message(pc.dim(` Tip: ${pc.cyan("contentrain studio connect")} — link this project to ${pc.bold("Contentrain Studio")} for`));
284
285
  log.message(pc.dim(` team review, CDN delivery, and collaboration → ${pc.underline("https://studio.contentrain.io")}`));
285
286
  outro("");
286
287
  }
287
288
  });
289
+ /**
290
+ * Print stack-aware guidance for wiring the generated `#contentrain` client
291
+ * into the host project. Init does not mutate the host's bundler config or
292
+ * package.json (agent = intelligence), but a fresh `contentrain init` user has
293
+ * no signal about the alias + prebuild step, so we surface it here.
294
+ */
295
+ function printStackWiring(stack) {
296
+ if (!new Set([
297
+ "nuxt",
298
+ "next",
299
+ "astro",
300
+ "sveltekit",
301
+ "svelte",
302
+ "react",
303
+ "react-vite",
304
+ "vue",
305
+ "vite"
306
+ ]).has(stack)) return;
307
+ log.message("");
308
+ log.message(pc.bold(` SDK wiring (${stack}):`));
309
+ log.message(` 1. Add the subpath import to ${pc.cyan("package.json")}:`);
310
+ log.message(pc.dim(" \"imports\": { \"#contentrain\": \"./.contentrain/client/index.mjs\" }"));
311
+ log.message(` 2. Add a ${pc.cyan("#contentrain")} bundler alias — see the ${pc.cyan("contentrain-sdk")} skill (bundler-config).`);
312
+ log.message(` 3. ${pc.cyan(".contentrain/client/")} is git-ignored, so wire generate into build for CI/fresh clones:`);
313
+ log.message(pc.dim(" \"scripts\": { \"prebuild\": \"contentrain generate\", \"predev\": \"contentrain generate\" }"));
314
+ if (stack === "nuxt") log.message(pc.dim(" Note (Nuxt): treat #contentrain as server-only — use it under server/ (e.g. server/api/*)."));
315
+ }
288
316
  async function executeInit(projectRoot, opts) {
289
317
  const s = spinner();
290
318
  s.start("Initializing...");
@@ -54,7 +54,7 @@ var serve_default = defineCommand({
54
54
  let projectRoot = await resolveProjectRoot(args.root);
55
55
  let demoDir;
56
56
  if (args.demo) {
57
- const { createDemoProject, cleanupDemoProject } = await import("./demo-BOUcAoFZ.mjs");
57
+ const { createDemoProject, cleanupDemoProject } = await import("./demo-DUknxn48.mjs");
58
58
  demoDir = await createDemoProject();
59
59
  projectRoot = demoDir;
60
60
  consola.info(`Demo project created at ${demoDir}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentrain",
3
- "version": "0.5.0",
3
+ "version": "0.5.4",
4
4
  "license": "MIT",
5
5
  "description": "CLI for Contentrain — AI content governance infrastructure",
6
6
  "type": "module",
@@ -47,11 +47,11 @@
47
47
  "simple-git": "^3.27.0",
48
48
  "ws": "^8.18.0",
49
49
  "zod": "^3.24.0",
50
- "@contentrain/rules": "0.4.0",
51
- "@contentrain/skills": "0.4.0",
52
- "@contentrain/mcp": "1.3.0",
53
- "@contentrain/query": "5.1.5",
54
- "@contentrain/types": "0.5.0"
50
+ "@contentrain/rules": "0.5.2",
51
+ "@contentrain/skills": "0.5.2",
52
+ "@contentrain/types": "0.5.1",
53
+ "@contentrain/mcp": "1.5.2",
54
+ "@contentrain/query": "6.0.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/ws": "^8.5.0",