create-modoock-app 2.2.0 → 2.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-modoock-app",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Official Modoock project starter and boilerplate generator.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -3,12 +3,10 @@ import fs from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
 
6
- const CATALOG = "knowledge-base/metadata/catalog.yaml";
7
- const CANONICAL_INDEXES = [
8
- "components/components/ui/index.ts",
9
- "create-modoock-app/template/components/layout/index.ts",
10
- "create-modoock-app/template/components/shared/index.ts",
11
- ];
6
+ const KB_ROOT = "node_modules/@modoock/knowledge-base/knowledge-base";
7
+ const CATALOG = `${KB_ROOT}/metadata/catalog.yaml`;
8
+ const PACKAGE_UI_INDEX =
9
+ "node_modules/@modoock/components/components/ui/index.ts";
12
10
  const allow = { permission: "allow" };
13
11
  const emit = (o) => process.stdout.write(JSON.stringify(o));
14
12
 
@@ -26,23 +24,6 @@ try {
26
24
  )
27
25
  : "";
28
26
 
29
- const monorepoRoot = (() => {
30
- if (
31
- fs.existsSync(path.join(root, "components", "components", "ui")) &&
32
- fs.existsSync(path.join(root, "create-modoock-app", "template", "components"))
33
- ) {
34
- return root;
35
- }
36
- const parent = path.join(root, "..");
37
- if (
38
- fs.existsSync(path.join(parent, "components", "components", "ui")) &&
39
- fs.existsSync(path.join(parent, "create-modoock-app", "template", "components"))
40
- ) {
41
- return parent;
42
- }
43
- return root;
44
- })();
45
-
46
27
  const rel = (file) => {
47
28
  if (!file) return "";
48
29
  const abs = path.resolve(root, String(file));
@@ -50,18 +31,6 @@ try {
50
31
  if (r && !r.startsWith("..") && !path.isAbsolute(r)) {
51
32
  return r.split(path.sep).join("/");
52
33
  }
53
- // Allow stamping canonical sibling sources when workspace is builder/
54
- const fromMono = path.relative(monorepoRoot, abs);
55
- if (
56
- fromMono &&
57
- !fromMono.startsWith("..") &&
58
- !path.isAbsolute(fromMono) &&
59
- CANONICAL_INDEXES.some(
60
- (ip) => fromMono.split(path.sep).join("/") === ip,
61
- )
62
- ) {
63
- return fromMono.split(path.sep).join("/");
64
- }
65
34
  return "";
66
35
  };
67
36
 
@@ -85,18 +54,20 @@ try {
85
54
  };
86
55
 
87
56
  const componentIndexes = () => {
57
+ const indexes = [];
58
+ if (fs.existsSync(path.join(root, PACKAGE_UI_INDEX))) {
59
+ indexes.push(PACKAGE_UI_INDEX);
60
+ }
88
61
  const localDir = path.join(root, "components");
89
62
  if (fs.existsSync(localDir)) {
90
- const local = [];
91
63
  for (const d of fs.readdirSync(localDir, { withFileTypes: true })) {
92
64
  const ip = `components/${d.name}/index.ts`;
93
- if (d.isDirectory() && fs.existsSync(path.join(root, ip))) local.push(ip);
65
+ if (d.isDirectory() && fs.existsSync(path.join(root, ip))) {
66
+ indexes.push(ip);
67
+ }
94
68
  }
95
- if (local.length) return local;
96
69
  }
97
- return CANONICAL_INDEXES.filter((ip) =>
98
- fs.existsSync(path.join(monorepoRoot, ip)),
99
- );
70
+ return indexes;
100
71
  };
101
72
 
102
73
  if (event === "precompact") {
@@ -135,8 +106,12 @@ try {
135
106
  if (!t || t.startsWith("#")) continue;
136
107
  const m = t.match(/^(?:-\s+)?path:\s+(.+)$/);
137
108
  if (m) cur = m[1].trim().replace(/^['"]|['"]$/g, "");
138
- else if (/^load:\s*ui\s*$/.test(t) && cur && fs.existsSync(path.join(root, cur)))
139
- need.push(cur);
109
+ else if (/^load:\s*ui\s*$/.test(t) && cur) {
110
+ const resolved = cur.startsWith("knowledge-base/")
111
+ ? `${KB_ROOT}/${cur.slice("knowledge-base/".length)}`
112
+ : cur;
113
+ if (fs.existsSync(path.join(root, resolved))) need.push(resolved);
114
+ }
140
115
  }
141
116
  }
142
117
  need.push(...componentIndexes());
@@ -6,4 +6,5 @@ alwaysApply: true
6
6
  Follow `AGENTS.md`. If it is already in this conversation, do not re-open it.
7
7
  `.cursor/rules/honey.mdc` is required; if it is already in this conversation, do not re-open it.
8
8
  Do not treat `CLAUDE.md` as a second rulebook.
9
- Then `knowledge-base/metadata/catalog.yaml`.
9
+ Then `node_modules/@modoock/knowledge-base/knowledge-base/metadata/catalog.yaml`.
10
+ UI primitives: `node_modules/@modoock/components/components/ui` (read-only). New components: project `components/` only.
@@ -1,17 +1,26 @@
1
1
  # Development instructions
2
2
 
3
- This file is the canonical router. Product constraints live in `knowledge-base/`. Do not copy them here. Only open the files that match the task.
3
+ This file is the canonical router. Product constraints live in the `@modoock/knowledge-base` package. Do not copy them here. Only open the files that match the task.
4
4
 
5
5
  `CLAUDE.md` imports this file (`@AGENTS.md`) and `.cursor/rules/honey.mdc`. `.cursor/rules/agents.mdc` is a Cursor pointer — do not copy this procedure there. A Next.js footer may be appended here by `next dev`; do not copy it.
6
6
 
7
+ ## Package sources (read-only)
8
+
9
+ | Source | Path on disk | Rule |
10
+ | --- | --- | --- |
11
+ | Knowledge base | `node_modules/@modoock/knowledge-base/knowledge-base/` | Read only. Never edit files under `node_modules/`. |
12
+ | Design System UI | `node_modules/@modoock/components/components/ui/` | Read only. Reuse via `@/components/ui`. Never add or edit UI primitives here. |
13
+
14
+ Alias in this app: `@/components/ui` → package UI. Project-local code lives under `./components/` (layout, shared, and any **new** component the developer approves).
15
+
7
16
  ## Context load
8
17
 
9
18
  | Layer | When | What |
10
19
  | --- | --- | --- |
11
20
  | Always | every turn | this file, `.cursor/rules/honey.mdc` |
12
- | UI files | `app/**` or component sources | every catalog `path` with `load: ui`, then the three component `index.ts` files below |
21
+ | UI files | `app/**` or project `components/**` | every catalog `path` with `load: ui`, then the component `index.ts` files below |
13
22
  | On demand | `description` matches the need | that `path`, then its `open:` |
14
- | After coding | verification | `knowledge-base/validation/` for the change type |
23
+ | After coding | verification | `…/knowledge-base/validation/` for the change type |
15
24
 
16
25
  Do not load the whole knowledge-base. Cursor hook denies writes under `app/` and `components/` until the UI pack (table above) is `Read` this conversation.
17
26
 
@@ -19,6 +28,8 @@ Do not load the whole knowledge-base. Cursor hook denies writes under `app/` and
19
28
 
20
29
  ## Knowledge Base layout
21
30
 
31
+ Resolved under `node_modules/@modoock/knowledge-base/knowledge-base/`:
32
+
22
33
  ```
23
34
  knowledge-base/
24
35
  ├── rules/ # constraints (global, architecture, ui, accessibility, …)
@@ -28,12 +39,21 @@ knowledge-base/
28
39
  └── metadata/ # catalog.yaml — the need → path index
29
40
  ```
30
41
 
42
+ When opening a catalog `path` such as `knowledge-base/rules/…`, read the file at
43
+ `node_modules/@modoock/knowledge-base/<path>`.
44
+
31
45
  ## Which file to open
32
46
 
33
- Open `knowledge-base/metadata/catalog.yaml`. UI edit: every `load: ui` `path`. Then any `description` that matches — exact `path` (no `.mdc` guess). After each catalog `path`, also open that entry's `open:`. What exists (canonical indexes, no `.mdc` required):
34
- - `../components/components/ui/index.ts`
35
- - `../create-modoock-app/template/components/layout/index.ts`
36
- - `../create-modoock-app/template/components/shared/index.ts`
47
+ Open `node_modules/@modoock/knowledge-base/knowledge-base/metadata/catalog.yaml`.
48
+ UI edit: every `load: ui` `path` (prefix with `node_modules/@modoock/knowledge-base/`).
49
+ Then any `description` that matches — exact `path` (no `.mdc` guess). After each catalog `path`, also open that entry's `open:`.
50
+
51
+ What exists (canonical indexes):
52
+
53
+ - **Package UI (read-only):** `node_modules/@modoock/components/components/ui/index.ts`
54
+ - **Project layout:** `components/layout/index.ts`
55
+ - **Project shared:** `components/shared/index.ts`
56
+ - **Project UI (local only):** `components/ui/index.ts` — only for new app-level UI after human validation; do **not** duplicate package primitives here
37
57
 
38
58
  If no file covers the need, follow **New rules**. Missing `.mdc` for an existing export is not a gap.
39
59
 
@@ -49,7 +69,7 @@ Break the request down first. All six are required. Do not write this breakdown
49
69
  6. **Comment** — only if a part is uncovered: ask per **Mandatory human validation**, then wait.
50
70
 
51
71
  - Inspect the existing code. Reproduce a failure before fixing it. Change one thing at a time, then verify.
52
- - Reuse: `knowledge-base/design-system/components.mdc`. Composition: `knowledge-base/rules/architecture/composition.mdc`. APIs: the three `index.ts` above.
72
+ - Reuse: package `components.mdc` + package UI `index.ts`. Composition: `knowledge-base/rules/architecture/composition.mdc`. Project APIs: `components/layout/index.ts`, `components/shared/index.ts`.
53
73
  - Apply **Mandatory human validation**.
54
74
 
55
75
  ## Mandatory human validation
@@ -57,35 +77,35 @@ Break the request down first. All six are required. Do not write this breakdown
57
77
  Compose with existing primitives (group, order, space, hierarchy, empty/loading/error). Do not ask for that.
58
78
 
59
79
  Ask and wait only for:
60
- - a new public component in `../components/components/ui` | `../create-modoock-app/template/components/layout` | `../create-modoock-app/template/components/shared`
80
+ - a new public component in the **project** `components/ui` | `components/layout` | `components/shared` (never in `node_modules/@modoock/components`)
61
81
  - a new token or global variable
62
82
  - an interaction not named in the catalog / `patterns/`
63
83
  - an ambiguous product requirement (purpose, data, action)
64
84
 
65
- Yes → implement. No → leave out. Do not hide a Design System piece as page-local to skip the ask.
85
+ Yes → implement under `./components/…`. No → leave out. Do not hide a Design System piece as page-local to skip the ask. Do not patch `@modoock/components` or `@modoock/knowledge-base`.
66
86
 
67
87
  New component block:
68
88
  - **What:** Name
69
- - **Where:** path above
70
- - **Why:** which `index.ts` exports do not fit
89
+ - **Where:** `components/ui` | `components/layout` | `components/shared` (project root only)
90
+ - **Why:** which package / project `index.ts` exports do not fit
71
91
  - **Reuse:** one sentence
72
92
 
73
93
  ## New rules
74
94
 
75
95
  When a recurring case is not covered:
76
96
 
77
- - Propose a new rule, why it is recurring, and where it belongs (`knowledge-base/` or `components/`).
78
- - Do not add or modify a rule until the developer says yes. Then add it.
97
+ - Propose a new rule, why it is recurring, and where it would belong in the knowledge-base package (do not edit `node_modules`).
98
+ - Do not add or modify a rule until the developer says yes. Then add it only if the developer provides a writable knowledge-base location; otherwise stop.
79
99
 
80
100
  ## Verification
81
101
 
82
- Layers (do not mix): `npm run lint` = ESLint. `npm run typecheck` = TypeScript, including JSX props on the public type. `npm run sg:scan` = structural facts the scanner can prove — keep it strict and dumb. `knowledge-base/validation/` = Design System / UX / architecture. The agent = context and judgment.
102
+ Layers (do not mix): `npm run lint` = ESLint. `npm run typecheck` = TypeScript, including JSX props on the public type. `npm run sg:scan` = structural facts the scanner can prove — keep it strict and dumb. Package `knowledge-base/validation/` = Design System / UX / architecture. The agent = context and judgment.
83
103
 
84
104
  After a modification:
85
105
 
86
- - Check the change against `knowledge-base/validation/` for the files that match. For a read-only pass on the diff, use `.cursor/agents/code-reviewer.md`.
106
+ - Check the change against package `knowledge-base/validation/` for the files that match. For a read-only pass on the diff, use `.cursor/agents/code-reviewer.md`.
87
107
  - Check that existing features are not unnecessarily affected.
88
- - If a new component has been created, export it from the folder `index.ts` at the canonical path (`../components/components/ui/`, `../create-modoock-app/template/components/layout/`, or `../create-modoock-app/template/components/shared/`).
108
+ - If a new component has been created in the **project**, export it from that folder's `index.ts` (`components/ui/`, `components/layout/`, or `components/shared/`). Never export into the package under `node_modules`.
89
109
  - Run `npm run lint`, `npm run typecheck` and `npm run sg:scan` and fix any **error** before finishing. `typecheck` proves JSX props exist on the component type. Do not apply catalog auto-fixes (`ast-grep scan -U`) and do not rewrite existing app JSX to silence catalog warnings.
90
110
  - Report any problems or hypotheses that require a decision from the developer.
91
111
 
@@ -1,4 +1,5 @@
1
1
  @import "tailwindcss";
2
+ @source "../node_modules/@modoock/components/dist";
2
3
 
3
4
  /* ================================
4
5
  DESIGN TOKENS
@@ -25,10 +25,10 @@
25
25
  "baseUrl": ".",
26
26
  "paths": {
27
27
  "@/components/ui": [
28
- "../../components/components/ui"
28
+ "./node_modules/@modoock/components/components/ui"
29
29
  ],
30
30
  "@/components/ui/*": [
31
- "../../components/components/ui/*"
31
+ "./node_modules/@modoock/components/components/ui/*"
32
32
  ],
33
33
  "react": [
34
34
  "./node_modules/@types/react"