create-nisc 0.5.0 → 0.6.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/CHANGELOG.md +8 -0
- package/bin/create-nisc.js +2 -3
- package/dist/{chunk-3ZXAPJE7.js → chunk-4VAHF5TY.js} +3 -3
- package/dist/chunk-4VAHF5TY.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/moss-dom/nisc.config.ts +0 -8
- package/templates/moss-dom/src/app/action-catalog.ts +0 -2
- package/templates/moss-dom/src/app/actions/surfaces/welcome.action.ts +0 -3
- package/templates/moss-dom/src/app/actions/surfaces/welcome.layout.ts +0 -2
- package/templates/moss-dom/src/app/app.ts +0 -3
- package/templates/moss-dom/src/app/charter/assignments.ts +1 -2
- package/templates/moss-dom/src/app/charter/charter.ts +0 -3
- package/templates/moss-dom/src/app/shell/frame.layout.ts +0 -2
- package/templates/moss-dom/src/app/shell/shell.ts +0 -3
- package/templates/moss-dom/src/dev/all-checks.ts +0 -3
- package/templates/moss-dom/src/dev/artifacts-check.ts +0 -7
- package/templates/moss-dom/src/dev/strata.ts +0 -8
- package/templates/moss-dom/src/dev/welcome-check.ts +0 -5
- package/templates/moss-dom/src/main.ts +0 -10
- package/templates/moss-dom/src/server/boot.ts +0 -3
- package/templates/moss-dom/src/server/document.ts +0 -4
- package/templates/moss-dom/src/server/runtime.ts +2 -10
- package/templates/moss-dom/src/ui/kit.ts +2 -8
- package/templates/moss-dom/src/ui/registry.ts +2 -3
- package/templates/moss-dom/vite.config.ts +0 -3
- package/templates/moss-react/nisc.config.ts +0 -8
- package/templates/moss-react/src/app/action-catalog.ts +0 -2
- package/templates/moss-react/src/app/actions/surfaces/welcome.action.ts +0 -3
- package/templates/moss-react/src/app/actions/surfaces/welcome.layout.ts +0 -2
- package/templates/moss-react/src/app/app.ts +0 -3
- package/templates/moss-react/src/app/charter/assignments.ts +1 -2
- package/templates/moss-react/src/app/charter/charter.ts +0 -3
- package/templates/moss-react/src/app/shell/frame.layout.ts +0 -2
- package/templates/moss-react/src/app/shell/shell.ts +0 -3
- package/templates/moss-react/src/dev/all-checks.ts +0 -3
- package/templates/moss-react/src/dev/artifacts-check.ts +0 -7
- package/templates/moss-react/src/dev/strata.ts +0 -8
- package/templates/moss-react/src/dev/welcome-check.ts +0 -5
- package/templates/moss-react/src/main.tsx +0 -9
- package/templates/moss-react/src/server/boot.ts +0 -3
- package/templates/moss-react/src/server/document.ts +0 -3
- package/templates/moss-react/src/server/runtime.ts +2 -10
- package/templates/moss-react/src/ui/kit.tsx +0 -10
- package/templates/moss-react/src/ui/registry.ts +0 -2
- package/templates/moss-react/vite.config.ts +0 -3
- package/templates/shell-dom/nisc.config.ts +0 -9
- package/templates/shell-dom/src/app/action-catalog.ts +0 -2
- package/templates/shell-dom/src/app/actions/surfaces/welcome.action.ts +0 -2
- package/templates/shell-dom/src/app/actions/surfaces/welcome.layout.ts +0 -5
- package/templates/shell-dom/src/app/shell/frame.layout.ts +0 -2
- package/templates/shell-dom/src/app/shell/shell.ts +0 -3
- package/templates/shell-dom/src/boot.ts +3 -8
- package/templates/shell-dom/src/dev/all-checks.ts +0 -3
- package/templates/shell-dom/src/dev/artifacts-check.ts +0 -7
- package/templates/shell-dom/src/dev/strata.ts +0 -8
- package/templates/shell-dom/src/dev/welcome-check.ts +0 -5
- package/templates/shell-dom/src/main.ts +0 -3
- package/templates/shell-dom/src/ui/kit.ts +2 -8
- package/templates/shell-dom/src/ui/registry.ts +2 -3
- package/templates/shell-dom/src/ui/screen.ts +0 -4
- package/templates/shell-dom/vite.config.ts +0 -1
- package/templates/shell-react/nisc.config.ts +0 -8
- package/templates/shell-react/src/app/action-catalog.ts +0 -2
- package/templates/shell-react/src/app/actions/surfaces/welcome.action.ts +0 -2
- package/templates/shell-react/src/app/actions/surfaces/welcome.layout.ts +0 -5
- package/templates/shell-react/src/app/shell/frame.layout.ts +0 -2
- package/templates/shell-react/src/app/shell/shell.ts +0 -3
- package/templates/shell-react/src/boot.ts +3 -8
- package/templates/shell-react/src/dev/all-checks.ts +0 -3
- package/templates/shell-react/src/dev/artifacts-check.ts +0 -7
- package/templates/shell-react/src/dev/strata.ts +0 -8
- package/templates/shell-react/src/dev/welcome-check.ts +0 -5
- package/templates/shell-react/src/main.tsx +0 -9
- package/templates/shell-react/src/ui/kit.tsx +0 -10
- package/templates/shell-react/src/ui/registry.ts +0 -2
- package/templates/shell-react/src/ui/screen.tsx +0 -6
- package/templates/shell-react/vite.config.ts +0 -1
- package/dist/chunk-3ZXAPJE7.js.map +0 -1
package/CHANGELOG.md
CHANGED
package/bin/create-nisc.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// what it imports.
|
|
2
|
+
// A committed file, not one in dist/: a package manager links a bin when it
|
|
3
|
+
// installs, which in this workspace is before anything is built.
|
|
5
4
|
import '../dist/cli.js';
|
|
@@ -3,7 +3,7 @@ import { join, extname, dirname } from 'path';
|
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
|
|
5
5
|
// <define:__NISC_SET__>
|
|
6
|
-
var define_NISC_SET_default = { "@niscorp/charter": "0.1.3", "@niscorp/cli": "0.
|
|
6
|
+
var define_NISC_SET_default = { "@niscorp/charter": "0.1.3", "@niscorp/cli": "0.6.0", "@niscorp/cortex": "0.1.4", "@niscorp/loom": "0.3.1", "@niscorp/moss": "0.6.0", "@niscorp/nisc": "0.6.1", "@niscorp/nova": "0.3.1", "@niscorp/prism": "0.3.1", "@niscorp/signal": "0.1.4", "@niscorp/solid": "0.1.2", "@niscorp/strata": "0.1.7", "@niscorp/tide": "0.1.7", "@niscorp/vex": "0.3.1" };
|
|
7
7
|
|
|
8
8
|
// src/docs.ts
|
|
9
9
|
var uiName = (ui) => ui === "react" ? "React" : "plain DOM (nova\u2019s DOM adapter \u2014 no framework in the page)";
|
|
@@ -170,5 +170,5 @@ var testedSet = () => {
|
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
export { TEMPLATES, generate, templateOf, testedSet, validName };
|
|
173
|
-
//# sourceMappingURL=chunk-
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
173
|
+
//# sourceMappingURL=chunk-4VAHF5TY.js.map
|
|
174
|
+
//# sourceMappingURL=chunk-4VAHF5TY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["%3Cdefine:__NISC_SET__%3E","../src/docs.ts","../src/generate.ts","../src/set.ts"],"names":[],"mappings":";;;;;AAAA,IAAA,uBAAA,GAAA,EAAC,kBAAA,EAAmB,OAAA,EAAQ,cAAA,EAAe,OAAA,EAAQ,iBAAA,EAAkB,SAAQ,eAAA,EAAgB,OAAA,EAAQ,eAAA,EAAgB,OAAA,EAAQ,eAAA,EAAgB,OAAA,EAAQ,iBAAgB,OAAA,EAAQ,gBAAA,EAAiB,OAAA,EAAQ,iBAAA,EAAkB,OAAA,EAAQ,gBAAA,EAAiB,OAAA,EAAQ,iBAAA,EAAkB,OAAA,EAAQ,eAAA,EAAgB,OAAA,EAAQ,cAAA,EAAe,OAAA,EAAO;;;ACIjU,IAAM,MAAA,GAAS,CAAC,EAAA,KAAoB,EAAA,KAAO,UAAU,OAAA,GAAU,qEAAA;AAE/D,IAAM,QAAA,GAAW,CAAC,KAAA,KAChB,KAAA,CAAM,YAAY,MAAA,GACd,CAAA;AAAA;AAAA,4DAAA,EAEmD,KAAA,CAAM,EAAA,KAAO,OAAA,GAAU,cAAA,GAAiB,aAAa,CAAA;AAAA;AAAA;AAAA;AAAA,2DAAA,CAAA,GAKxG,CAAA;AAAA;AAAA,2EAAA,EAEkE,KAAA,CAAM,EAAA,KAAO,OAAA,GAAU,cAAA,GAAiB,aAAa,CAAA;AAAA;AAAA;AAAA;AAAA,2DAAA,CAAA;AAMtH,IAAM,SAAA,GAAY,CAAC,K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I,CAAC,CAAA,EAAG,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC;AAAA,CAAI,CAAA;AAE/G,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,OAAO,CAAA,IAAK,OAAA,EAAS;AACpC,IAAA,MAAM,EAAA,GAAK,IAAA,CAAK,OAAA,CAAQ,GAAA,EAAK,GAAG,CAAA;AAChC,IAAA,SAAA,CAAU,QAAQ,EAAE,CAAA,EAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAC1C,IAAA,aAAA,CAAc,IAAI,OAAO,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,EAAE,OAAO,CAAC,GAAG,QAAQ,IAAA,EAAM,EAAE,MAAA,CAAO,CAAC,QAAQ,CAAC,QAAA,CAAS,SAAS,GAAG,CAAC,EAAE,IAAA,EAAK,EAAG,MAAM,QAAA,EAAS;AACtG;;;AC9GO,IAAM,YAAY,MAAwC;AAC/D,EAAA,IAAI,OAAO,uBAAA,KAAiB,WAAA,EAAa,MAAM,IAAI,MAAM,4FAAuF,CAAA;AAChJ,EAAA,OAAO,uBAAA;AACT","file":"chunk-4VAHF5TY.js","sourcesContent":["{\"@niscorp/charter\":\"0.1.3\",\"@niscorp/cli\":\"0.6.0\",\"@niscorp/cortex\":\"0.1.4\",\"@niscorp/loom\":\"0.3.1\",\"@niscorp/moss\":\"0.6.0\",\"@niscorp/nisc\":\"0.6.1\",\"@niscorp/nova\":\"0.3.1\",\"@niscorp/prism\":\"0.3.1\",\"@niscorp/signal\":\"0.1.4\",\"@niscorp/solid\":\"0.1.2\",\"@niscorp/strata\":\"0.1.7\",\"@niscorp/tide\":\"0.1.7\",\"@niscorp/vex\":\"0.3.1\"}","import type { Posture, Ui } from './generate';\n\ntype Facts = { name: string; posture: Posture; ui: Ui; today: string; nisc: string };\n\nconst uiName = (ui: Ui): string => (ui === 'react' ? 'React' : 'plain DOM (nova’s DOM adapter — no framework in the page)');\n\nconst layoutOf = (facts: Facts): string =>\n facts.posture === 'moss'\n ? `src/app/ ARTIFACTS ONLY — the manifest (app.ts), the charter, the actions, the shell\nsrc/server/ the environment (runtime.ts), the boot, how a screen is drawn (document.ts)\nsrc/ui/ the kit — the only renderer code, with ${facts.ui === 'react' ? 'src/main.tsx' : 'src/main.ts'}, the terminal entry\nsrc/dev/ the checks (\\`npm run check\\`) — a new feature adds its own\nnisc.config.ts how the app boots and how a screen is drawn, for the \\`nisc\\` command\nstrata.lock.json the grammar versions the source is written at (rule 20) — moved only\n by \\`npm run strata verify\\`, never by hand`\n : `src/app/ ARTIFACTS ONLY — the actions and the shell's canvases\nsrc/boot.ts the shell factory: the artifacts plus everything environmental\nsrc/ui/ the kit and the screen — the only renderer code, with ${facts.ui === 'react' ? 'src/main.tsx' : 'src/main.ts'}, the entry\nsrc/dev/ the checks (\\`npm run check\\`) — a new feature adds its own\nnisc.config.ts how the app boots and how its screen is drawn and picked up, for the \\`nisc\\` command\nstrata.lock.json the grammar versions the source is written at (rule 20) — moved only\n by \\`npm run strata verify\\`, never by hand`;\n\nexport const agentsDoc = (facts: Facts): string => `# ${facts.name}\n\nA nisc application. **The rules it is built by are \\`node_modules/@niscorp/nisc/AGENTS.md\\`** — read all of it before changing anything here (it is there once the app's dependencies are installed). It is the rulebook for the nisc version this app has installed, and \\`STYLE_GUIDE.md\\` sits beside it. The grammars it names — a layout node, an \\`ActionDefinition\\`, a Prism config, a charter, a Vex DSL — are in each package's own \\`README.md\\` and \\`DESIGN.md\\`, under \\`node_modules/@niscorp/<name>/\\`.\n\nWhat is particular to this app:\n\n- **Its decisions are in PLAN.md.** What was answered when it was made, what was derived, and what is still open. An open decision point is asked before anything is built on it, never resolved silently.\n- **It is ${facts.posture === 'moss' ? 'behind moss' : 'its own shell'}**, drawn with ${uiName(facts.ui)}.\n- **Where things go:**\n\n\\`\\`\\`\n${layoutOf(facts)}\n\\`\\`\\`\n\n- **How it runs:** \\`npm run dev\\`, \\`npm run build\\`, \\`npm run check\\`${facts.posture === 'page' ? ', `npm run export`' : ', `npm start`'} — all of them the \\`nisc\\` command — and \\`npm run strata status\\` for the grammars.\n`;\n\nconst d1 = (posture: Posture): string =>\n posture === 'moss'\n ? `| D1 Posture | answered | **A moss server app.** The shell runs on the server, one per person; the browser is a canvas terminal over a socket. The charter is enforced there: a principal reaches only the actions and the data it is granted. |`\n : `| D1 Posture | answered | **Its own shell, in the page — no server.** The shell, its actions and its endpoints run in the browser. Consequence, said plainly: **the charter is not enforcement here.** Whatever data and policy the page has, its user has; nothing in this posture is a security boundary. An app that needs one needs a server — moss. |`;\n\nconst d2 = (posture: Posture): string =>\n posture === 'moss'\n ? `| D2 Environment | derived · **open for deployment** | Development and the checks run on PGlite, an in-memory Postgres that starts empty every boot (\\`src/server/runtime.ts\\`). Open: the Postgres a deployment hands it, and where it runs. |`\n : `| D2 Environment | **open** | The app has no data yet. Open: what serves its endpoints — in-memory fixtures, PGlite in the page (your data lives in one browser profile: no sync, no other devices, gone if site data is cleared), a real backend, or a mix. |`;\n\nconst d5 = (posture: Posture): string =>\n posture === 'moss'\n ? `| D5 Routing | derived · **partly open** | The first screen is drawn on the server and adopted by the terminal — it costs nothing while nobody can sign in. Open: once sign-in exists, the browser keeps the session in a cookie no script can read, and the page is drawn for whoever it says (AGENTS.md rule 12) — a page drawn for somebody is theirs alone (\\`private, no-store\\`). Open: which paths are **pages** rather than the app, and whether the app's shell state syncs to the address bar. |`\n : `| D5 Routing | derived · **partly open** | The first screen is drawn at build (\\`nisc export\\`) — one file per path, the screen as nobody in particular sees it — and the page's own shell picks it up. Open: which paths exist beyond \\`/\\`, and whether shell state syncs to the address bar. |`;\n\nexport const planDoc = (facts: Facts): string => `# PLAN — ${facts.name}\n\nMade ${facts.today} by \\`npm create nisc\\`, on nisc ${facts.nisc}. This is the record AGENTS.md's interview asks for (\"Before any code\"). The walkthrough asked what shapes the files; everything else is **open**, and an open decision blocks the build that depends on it until it is answered by the user or delegated by name. A blanket \"go\" delegates nothing.\n\n## Decision points\n\n| | Tier | |\n|---|---|---|\n${d1(facts.posture)}\n${d2(facts.posture)}\n| D3 Reads | **open** | Vex entries (\\`{ fingerprint, context }\\`, the shape an AI feature can reach later) or plain endpoints with hand-written handlers. |\n| D4 Writes | **open** | Vex mutation entries or plain endpoint handlers. Either way a write is an endpoint, never inline. |\n${d5(facts.posture)}\n\n## Answered when it was made\n\n- **What draws the screen:** ${uiName(facts.ui)}. The kit in \\`src/ui/\\` is where the look lives; a layout names components, never styles.\n\n## The dial-in — open\n\n- The entities, and how they relate.\n- Expected scale.\n- Who uses it: one person, or roles. More than one principal sketches its roles and charter now, not later.\n- AI features: now, later, never. (Later still shapes D3.)\n- Look and feel.\n- Where it is deployed.\n- What happens to the data long-term.\n\n## Order of work\n\n1. **The interview** — every open item above, answered or delegated by name. ← here\n2. **Scaffold** — done: ${facts.posture === 'moss' ? 'manifest, runtime and terminal' : 'the shell factory and the entry'}, one action rendering, and its checks (the artifacts, the grammar lock, the welcome screen).\n3. **Kit** — the primitives, against a kitchen-sink action; lock the look before any feature.\n4. **Data layer** — per D2/D3: schema, seed, entries; one read end to end.\n5. **Actions** — domain by domain: list → detail → form.\n6. **Writes** — per D4; one round trip: create → announce → re-read.\n7. **Checks and polish** — a check per feature in \\`src/dev/\\`; empty states and transitions last.\n`;\n\nexport const gitignoreLines = ['node_modules/', 'dist/', 'out/', '.strata/', '*.tsbuildinfo', '.env', '.env.*', '!.env.example'];\n","import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';\nimport { dirname, extname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { agentsDoc, gitignoreLines, planDoc } from './docs';\n\nexport type Posture = 'moss' | 'page';\nexport type Ui = 'react' | 'dom';\n\nexport type CreateOptions = {\n dir: string;\n name: string;\n posture: Posture;\n ui: Ui;\n versions: Readonly<Record<string, string>>;\n // YYYY-MM-DD\n today: string;\n};\n\nexport type Created = {\n files: string[];\n kept: string[];\n extended: string[];\n};\n\nexport const TEMPLATES = fileURLToPath(new URL('../templates', import.meta.url));\n\nexport const templateOf = (posture: Posture, ui: Ui): string => `${posture === 'moss' ? 'moss' : 'shell'}-${ui}`;\n\nconst tokenOf = (template: string): string => `nisc-template-${template}`;\n\nconst SKIP = new Set(['node_modules', 'dist', 'out', '.turbo']);\nconst TEXT = new Set(['.ts', '.tsx', '.json', '.html', '.css', '.md']);\nconst KEEP_THEIRS = new Set(['README.md']);\n\n// npm's rule for a package name.\nexport const validName = (name: string): boolean => /^[a-z0-9][a-z0-9._-]*$/.test(name) && name.length <= 214;\n\nconst filesIn = (dir: string, base = ''): string[] =>\n readdirSync(join(dir, base), { withFileTypes: true }).flatMap((entry) => {\n if (SKIP.has(entry.name)) return [];\n const rel = base === '' ? entry.name : `${base}/${entry.name}`;\n return entry.isDirectory() ? filesIn(dir, rel) : [rel];\n });\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => value !== null && typeof value === 'object' && !Array.isArray(value);\n\nconst pinned = (deps: unknown, versions: Readonly<Record<string, string>>): Record<string, string> => {\n if (!isRecord(deps)) return {};\n return Object.fromEntries(\n Object.entries(deps).map(([name, spec]): [string, string] => {\n if (typeof spec !== 'string') throw new Error(`create-nisc: ${name} has no version in the template`);\n if (!spec.startsWith('workspace:')) return [name, spec];\n const version = versions[name];\n if (version === undefined) throw new Error(`create-nisc: the nisc release has no ${name} — the set it was given is incomplete`);\n return [name, `^${version}`];\n }),\n );\n};\n\nexport const generate = (options: CreateOptions): Created => {\n const template = templateOf(options.posture, options.ui);\n const source = join(TEMPLATES, template);\n if (!existsSync(source)) throw new Error(`create-nisc: no template \"${template}\"`);\n if (!validName(options.name)) throw new Error(`create-nisc: \"${options.name}\" is not a package name (lowercase letters, digits, - . _)`);\n if (existsSync(options.dir) && !statSync(options.dir).isDirectory()) throw new Error(`create-nisc: ${options.dir} is a file`);\n\n const token = tokenOf(template);\n const planned = new Map<string, string | Buffer>();\n for (const rel of filesIn(source)) {\n const from = join(source, rel);\n if (rel === 'package.json') {\n const manifest: unknown = JSON.parse(readFileSync(from, 'utf8'));\n if (!isRecord(manifest)) throw new Error(`create-nisc: ${template}/package.json is not an object`);\n const app = {\n ...manifest,\n name: options.name,\n dependencies: pinned(manifest['dependencies'], options.versions),\n devDependencies: pinned(manifest['devDependencies'], options.versions),\n };\n planned.set(rel, `${JSON.stringify(app, null, 2)}\\n`);\n } else if (TEXT.has(extname(rel))) {\n planned.set(rel, readFileSync(from, 'utf8').split(token).join(options.name));\n } else {\n planned.set(rel, readFileSync(from));\n }\n }\n const facts = { name: options.name, posture: options.posture, ui: options.ui, today: options.today, nisc: options.versions['@niscorp/nisc'] ?? 'unknown' };\n planned.set('AGENTS.md', agentsDoc(facts));\n planned.set('PLAN.md', planDoc(facts));\n\n const there = (rel: string): boolean => existsSync(join(options.dir, rel));\n const kept = [...planned.keys()].filter((rel) => KEEP_THEIRS.has(rel) && there(rel));\n const collisions = [...planned.keys()].filter((rel) => !KEEP_THEIRS.has(rel) && there(rel)).sort();\n if (collisions.length > 0) {\n throw new Error(\n `create-nisc: ${options.dir} already has ${collisions.length === 1 ? 'a file' : 'files'} a new app would write — nothing was written:\\n ${collisions.join('\\n ')}\\nMake the app in an empty folder, or in a subfolder of this one.`,\n );\n }\n for (const rel of kept) planned.delete(rel);\n\n const ignorePath = join(options.dir, '.gitignore');\n const theirs = existsSync(ignorePath) ? readFileSync(ignorePath, 'utf8') : undefined;\n const have = new Set((theirs ?? '').split('\\n').map((line) => line.trim()));\n const missing = gitignoreLines.filter((line) => !have.has(line));\n const extended = theirs !== undefined && missing.length > 0 ? ['.gitignore'] : [];\n if (theirs === undefined) planned.set('.gitignore', `${gitignoreLines.join('\\n')}\\n`);\n else if (missing.length > 0) planned.set('.gitignore', `${theirs.replace(/\\n*$/, '\\n')}${missing.join('\\n')}\\n`);\n\n for (const [rel, content] of planned) {\n const to = join(options.dir, rel);\n mkdirSync(dirname(to), { recursive: true });\n writeFileSync(to, content);\n }\n return { files: [...planned.keys()].filter((rel) => !extended.includes(rel)).sort(), kept, extended };\n};\n","// Written in when this package is built (tsup.config.ts), never looked up:\n// \"whatever is newest on npm\" would be a set nobody tested the templates with.\ndeclare const __NISC_SET__: Readonly<Record<string, string>> | undefined;\n\nexport const testedSet = (): Readonly<Record<string, string>> => {\n if (typeof __NISC_SET__ === 'undefined') throw new Error('create-nisc: this copy was not built — it carries no nisc release to pin a new app to');\n return __NISC_SET__;\n};\n"]}
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validName, generate, testedSet } from './chunk-
|
|
1
|
+
import { validName, generate, testedSet } from './chunk-4VAHF5TY.js';
|
|
2
2
|
import { existsSync, readdirSync } from 'fs';
|
|
3
3
|
import { basename, resolve, relative } from 'path';
|
|
4
4
|
import { intro, text, confirm, cancel, select, note, outro, isCancel } from '@clack/prompts';
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts"],"names":[],"mappings":";;;;;AAmBA,IAAM,KAAA,GAAQ,CAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sEAAA,CAAA;AASd,IAAM,KAAA,mBAAQ,IAAI,GAAA,CAAI,CAAC,QAAA,EAAU,QAAA,EAAU,SAAA,EAAW,OAAA,EAAS,OAAA,EAAS,QAAA,EAAU,IAAI,CAAC,CAAA;AACvF,IAAM,WAAA,GAAc,aAAA;AAEpB,IAAM,MAAA,GAAS,CAAC,OAAA,KAA2B;AACzC,EAAA,OAAA,CAAQ,KAAA,CAAM,gBAAgB,OAAO;;AAAA,EAAO,KAAK,CAAA,CAAE,CAAA;AACnD,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAA;AAGA,IAAM,QAAA,GAAW,CAA6B,KAAA,KAAyB;AACrE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,QAAA,CAAS,KAAK,CAAA,EAAG;AAChD,IAAA,MAAA,CAAO,mBAAmB,CAAA;AAC1B,IAAA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EAAE,CAAA,CAAA;AAC1M,EAAA,MAAM,KAAA,GAAQ,mFAAA;AACd,EAAA,IAAI,GAAA,EAAK;AACP,IAAA,IAAA,CAAK,MAAM,MAAM,CAAA;AACjB,IAAA,KAAA,CAAM,CAAA,EAAG,OAAO,CAAA,EAAA,EAAK,KAAK,CAAA,CAAE,CAAA;AAAA,EAC9B,CAAA,MAAO;AACL,IAAA,OAAA,CAAQ,GAAA,CAAI,gBAAgB,OAAO;;AAAA,EAAO,IAAI;;AAAA,EAAO,KAAK,CAAA,CAAE,CAAA;AAAA,EAC9D;AACF,CAAA;AAEA,IAAA,EAAK,CAAE,KAAA,CAAM,CAAC,KAAA,KAAmB;AAC/B,EAAA,OAAA,CAAQ,MAAM,KAAA,YAAiB,KAAA,GAAQ,MAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CAAC,CAAA;AACpE,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA","file":"cli.js","sourcesContent":["import { existsSync, readdirSync } from 'node:fs';\nimport { basename, relative, resolve } from 'node:path';\nimport { cancel, confirm, intro, isCancel, note, outro, select, text } from '@clack/prompts';\nimport { generate, validName } from './generate';\nimport type { Posture, Ui } from './generate';\nimport { testedSet } from './set';\n\n// ═══════════════════════════════════════════════════════════════\n// npm create nisc [dir] [--moss | --page] [--react | --dom] [--yes]\n//\n// Three questions — where the app goes, where its shell runs (D1), what draws\n// the screen — because those are what shape the files. Everything else the\n// rulebook's interview asks is written into the app's PLAN.md as open, for the\n// conversation that comes next. A flag answers its question; `--yes` takes the\n// defaults for the rest (moss, React); with no terminal to ask in, the flags\n// are all there is. A flag it does not know is an error, never ignored: a typo\n// must not quietly make a different app.\n// ═══════════════════════════════════════════════════════════════\n\nconst USAGE = `npm create nisc [dir] [--moss | --page] [--react | --dom] [--yes]\n\n dir where the app goes (default: my-nisc-app); its name is the folder's\n --moss the shell runs on a server (moss) — the default\n --page the shell runs in the page, no server (offline, static hosting)\n --react React draws the screen — the default\n --dom plain DOM draws the screen, no framework in the page\n --yes take the defaults for anything not given, and ask nothing`;\n\nconst FLAGS = new Set(['--moss', '--page', '--react', '--dom', '--yes', '--help', '-h']);\nconst DEFAULT_DIR = 'my-nisc-app';\n\nconst refuse = (message: string): never => {\n console.error(`create-nisc: ${message}\\n\\n${USAGE}`);\n process.exit(1);\n};\n\n// An answer, or the walkthrough was cancelled (Ctrl-C) and nothing is made.\nconst answered = <T extends string | boolean>(value: T | symbol): T => {\n if (typeof value === 'symbol' || isCancel(value)) {\n cancel('Nothing was made.');\n process.exit(1);\n }\n return value;\n};\n\n// The package manager this was run with, to say the next commands in its words.\nconst manager = (): string => {\n const agent = process.env['npm_config_user_agent'] ?? '';\n return ['pnpm', 'yarn', 'bun'].find((name) => agent.startsWith(name)) ?? 'npm';\n};\n\nconst main = async (): Promise<void> => {\n const args = process.argv.slice(2);\n if (args.includes('--help') || args.includes('-h')) {\n console.log(USAGE);\n return;\n }\n const flags = args.filter((arg) => arg.startsWith('-'));\n const positional = args.filter((arg) => !arg.startsWith('-'));\n const unknown = flags.filter((flag) => !FLAGS.has(flag));\n if (unknown.length > 0) refuse(`unknown option ${unknown.join(', ')}`);\n if (positional.length > 1) refuse(`one folder at a time — got ${positional.join(', ')}`);\n if (flags.includes('--moss') && flags.includes('--page')) refuse('--moss and --page are two different apps; pick one');\n if (flags.includes('--react') && flags.includes('--dom')) refuse('--react and --dom are two different kits; pick one');\n\n const ask = process.stdout.isTTY === true && process.stdin.isTTY === true && !flags.includes('--yes');\n if (ask) intro('a new nisc app');\n\n const given = positional[0];\n const dirInput =\n given ??\n (ask\n ? answered<string>(\n await text({\n message: 'Where should it go?',\n placeholder: DEFAULT_DIR,\n defaultValue: DEFAULT_DIR,\n validate: (value) =>\n validName(basename(resolve(value === undefined || value === '' ? DEFAULT_DIR : value))) ? undefined : 'the folder’s name becomes the package name: lowercase letters, digits, - . _',\n }),\n )\n : DEFAULT_DIR);\n const dir = resolve(dirInput === '' ? DEFAULT_DIR : dirInput);\n const name = basename(dir);\n if (!validName(name)) refuse(`\"${name}\" cannot be a package name — the folder’s name becomes it: lowercase letters, digits, - . _`);\n\n // A folder that already holds something: nothing in it is overwritten (the\n // generator refuses if anything would be), but making an app in the wrong\n // place is worth one question.\n const holds = existsSync(dir) ? readdirSync(dir).length : 0;\n if (holds > 0 && ask) {\n const proceed = answered<boolean>(\n await confirm({ message: `${relative(process.cwd(), dir) || '.'} already holds ${holds} ${holds === 1 ? 'thing' : 'things'}. Nothing there will be overwritten — make the app in it?`, initialValue: true }),\n );\n if (!proceed) {\n cancel('Nothing was made.');\n process.exit(1);\n }\n }\n\n const posture: Posture = flags.includes('--page')\n ? 'page'\n : flags.includes('--moss') || !ask\n ? 'moss'\n : answered<Posture>(\n await select<Posture>({\n message: 'Where does the shell run?',\n options: [\n { value: 'moss', label: 'On a server — moss', hint: 'one shell per person on the server; the charter is enforced there' },\n { value: 'page', label: 'In the page — no server', hint: 'offline, static hosting; the charter is not a security boundary' },\n ],\n initialValue: 'moss',\n }),\n );\n\n const ui: Ui = flags.includes('--dom')\n ? 'dom'\n : flags.includes('--react') || !ask\n ? 'react'\n : answered<Ui>(\n await select<Ui>({\n message: 'What draws the screen?',\n options: [\n { value: 'react', label: 'React' },\n { value: 'dom', label: 'Plain DOM', hint: 'no framework in the page' },\n ],\n initialValue: 'react',\n }),\n );\n\n const made = generate({ dir, name, posture, ui, versions: testedSet(), today: new Date().toISOString().slice(0, 10) });\n\n const run = manager();\n const where = relative(process.cwd(), dir) || '.';\n const next = [...(where === '.' ? [] : [`cd ${where}`]), `${run} install`, `${run} run dev`].join('\\n');\n const left = [...made.kept.map((file) => `kept your ${file}`), ...made.extended.map((file) => `added to your ${file}`)];\n const summary = `${name} — ${posture === 'moss' ? 'behind moss' : 'its own shell'}, ${ui === 'react' ? 'React' : 'plain DOM'} — ${made.files.length} files${left.length > 0 ? ` (${left.join('; ')})` : ''}`;\n const after = 'Before building anything: PLAN.md — what is still open — and AGENTS.md.';\n if (ask) {\n note(next, 'Next');\n outro(`${summary}. ${after}`);\n } else {\n console.log(`create-nisc: ${summary}\\n\\n${next}\\n\\n${after}`);\n }\n};\n\nmain().catch((error: unknown) => {\n console.error(error instanceof Error ? error.message : String(error));\n process.exit(1);\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"names":[],"mappings":";;;;;AAOA,IAAM,KAAA,GAAQ,CAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sEAAA,CAAA;AASd,IAAM,KAAA,mBAAQ,IAAI,GAAA,CAAI,CAAC,QAAA,EAAU,QAAA,EAAU,SAAA,EAAW,OAAA,EAAS,OAAA,EAAS,QAAA,EAAU,IAAI,CAAC,CAAA;AACvF,IAAM,WAAA,GAAc,aAAA;AAEpB,IAAM,MAAA,GAAS,CAAC,OAAA,KAA2B;AACzC,EAAA,OAAA,CAAQ,KAAA,CAAM,gBAAgB,OAAO;;AAAA,EAAO,KAAK,CAAA,CAAE,CAAA;AACnD,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAA;AAEA,IAAM,QAAA,GAAW,CAA6B,KAAA,KAAyB;AACrE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,QAAA,CAAS,KAAK,CAAA,EAAG;AAChD,IAAA,MAAA,CAAO,mBAAmB,CAAA;AAC1B,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACA,EAAA,OAAO,KAAA;AACT,CAAA;AAEA,IAAM,UAAU,MAAc;AAC5B,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,IAAK,EAAA;AACtD,EAAA,OAAO,CAAC,MAAA,EAAQ,MAAA,EAAQ,KAAK,CAAA,CAAE,IAAA,CAAK,CAAC,IAAA,KAAS,KAAA,CAAM,UAAA,CAAW,IAAI,CAAC,CAAA,IAAK,KAAA;AAC3E,CAAA;AAEA,IAAM,OAAO,YAA2B;AACtC,EAAA,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,KAAA,CAAM,CAAC,KAAA,KAAmB;AAC/B,EAAA,OAAA,CAAQ,MAAM,KAAA,YAAiB,KAAA,GAAQ,MAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CAAC,CAAA;AACpE,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA","file":"cli.js","sourcesContent":["import { existsSync, readdirSync } from 'node:fs';\nimport { basename, relative, resolve } from 'node:path';\nimport { cancel, confirm, intro, isCancel, note, outro, select, text } from '@clack/prompts';\nimport { generate, validName } from './generate';\nimport type { Posture, Ui } from './generate';\nimport { testedSet } from './set';\n\nconst USAGE = `npm create nisc [dir] [--moss | --page] [--react | --dom] [--yes]\n\n dir where the app goes (default: my-nisc-app); its name is the folder's\n --moss the shell runs on a server (moss) — the default\n --page the shell runs in the page, no server (offline, static hosting)\n --react React draws the screen — the default\n --dom plain DOM draws the screen, no framework in the page\n --yes take the defaults for anything not given, and ask nothing`;\n\nconst FLAGS = new Set(['--moss', '--page', '--react', '--dom', '--yes', '--help', '-h']);\nconst DEFAULT_DIR = 'my-nisc-app';\n\nconst refuse = (message: string): never => {\n console.error(`create-nisc: ${message}\\n\\n${USAGE}`);\n process.exit(1);\n};\n\nconst answered = <T extends string | boolean>(value: T | symbol): T => {\n if (typeof value === 'symbol' || isCancel(value)) {\n cancel('Nothing was made.');\n process.exit(1);\n }\n return value;\n};\n\nconst manager = (): string => {\n const agent = process.env['npm_config_user_agent'] ?? '';\n return ['pnpm', 'yarn', 'bun'].find((name) => agent.startsWith(name)) ?? 'npm';\n};\n\nconst main = async (): Promise<void> => {\n const args = process.argv.slice(2);\n if (args.includes('--help') || args.includes('-h')) {\n console.log(USAGE);\n return;\n }\n const flags = args.filter((arg) => arg.startsWith('-'));\n const positional = args.filter((arg) => !arg.startsWith('-'));\n const unknown = flags.filter((flag) => !FLAGS.has(flag));\n if (unknown.length > 0) refuse(`unknown option ${unknown.join(', ')}`);\n if (positional.length > 1) refuse(`one folder at a time — got ${positional.join(', ')}`);\n if (flags.includes('--moss') && flags.includes('--page')) refuse('--moss and --page are two different apps; pick one');\n if (flags.includes('--react') && flags.includes('--dom')) refuse('--react and --dom are two different kits; pick one');\n\n const ask = process.stdout.isTTY === true && process.stdin.isTTY === true && !flags.includes('--yes');\n if (ask) intro('a new nisc app');\n\n const given = positional[0];\n const dirInput =\n given ??\n (ask\n ? answered<string>(\n await text({\n message: 'Where should it go?',\n placeholder: DEFAULT_DIR,\n defaultValue: DEFAULT_DIR,\n validate: (value) =>\n validName(basename(resolve(value === undefined || value === '' ? DEFAULT_DIR : value))) ? undefined : 'the folder’s name becomes the package name: lowercase letters, digits, - . _',\n }),\n )\n : DEFAULT_DIR);\n const dir = resolve(dirInput === '' ? DEFAULT_DIR : dirInput);\n const name = basename(dir);\n if (!validName(name)) refuse(`\"${name}\" cannot be a package name — the folder’s name becomes it: lowercase letters, digits, - . _`);\n\n const holds = existsSync(dir) ? readdirSync(dir).length : 0;\n if (holds > 0 && ask) {\n const proceed = answered<boolean>(\n await confirm({ message: `${relative(process.cwd(), dir) || '.'} already holds ${holds} ${holds === 1 ? 'thing' : 'things'}. Nothing there will be overwritten — make the app in it?`, initialValue: true }),\n );\n if (!proceed) {\n cancel('Nothing was made.');\n process.exit(1);\n }\n }\n\n const posture: Posture = flags.includes('--page')\n ? 'page'\n : flags.includes('--moss') || !ask\n ? 'moss'\n : answered<Posture>(\n await select<Posture>({\n message: 'Where does the shell run?',\n options: [\n { value: 'moss', label: 'On a server — moss', hint: 'one shell per person on the server; the charter is enforced there' },\n { value: 'page', label: 'In the page — no server', hint: 'offline, static hosting; the charter is not a security boundary' },\n ],\n initialValue: 'moss',\n }),\n );\n\n const ui: Ui = flags.includes('--dom')\n ? 'dom'\n : flags.includes('--react') || !ask\n ? 'react'\n : answered<Ui>(\n await select<Ui>({\n message: 'What draws the screen?',\n options: [\n { value: 'react', label: 'React' },\n { value: 'dom', label: 'Plain DOM', hint: 'no framework in the page' },\n ],\n initialValue: 'react',\n }),\n );\n\n const made = generate({ dir, name, posture, ui, versions: testedSet(), today: new Date().toISOString().slice(0, 10) });\n\n const run = manager();\n const where = relative(process.cwd(), dir) || '.';\n const next = [...(where === '.' ? [] : [`cd ${where}`]), `${run} install`, `${run} run dev`].join('\\n');\n const left = [...made.kept.map((file) => `kept your ${file}`), ...made.extended.map((file) => `added to your ${file}`)];\n const summary = `${name} — ${posture === 'moss' ? 'behind moss' : 'its own shell'}, ${ui === 'react' ? 'React' : 'plain DOM'} — ${made.files.length} files${left.length > 0 ? ` (${left.join('; ')})` : ''}`;\n const after = 'Before building anything: PLAN.md — what is still open — and AGENTS.md.';\n if (ask) {\n note(next, 'Next');\n outro(`${summary}. ${after}`);\n } else {\n console.log(`create-nisc: ${summary}\\n\\n${next}\\n\\n${after}`);\n }\n};\n\nmain().catch((error: unknown) => {\n console.error(error instanceof Error ? error.message : String(error));\n process.exit(1);\n});\n"]}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nisc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "npm create nisc — a new nisc application: a few questions, then an app with the right structure, its rulebook, and a first screen that works.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -2,14 +2,6 @@ import type { NiscMossProject } from '@niscorp/cli';
|
|
|
2
2
|
import { boot } from './src/server/boot';
|
|
3
3
|
import { drawing } from './src/server/document';
|
|
4
4
|
|
|
5
|
-
// What this app tells the `nisc` command: how it stands up (the same boot the
|
|
6
|
-
// checks run) and how one of its screens is drawn (the same drawing the dev
|
|
7
|
-
// server and `nisc start` use). Everything else is read off the app.
|
|
8
|
-
//
|
|
9
|
-
// npm run dev the app, with its server inside vite
|
|
10
|
-
// npm run build bundle, then say how each path is served
|
|
11
|
-
// npm start serve the built app, each first screen drawn
|
|
12
|
-
// npm run check the checks in src/dev
|
|
13
5
|
export const project: NiscMossProject = {
|
|
14
6
|
boot: async () => {
|
|
15
7
|
const { server } = await boot();
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ActionDefinition } from '@niscorp/nova';
|
|
2
2
|
import { welcomeAction } from './actions/surfaces/welcome.action';
|
|
3
3
|
|
|
4
|
-
// Ring 1: every action the app ships, by id. Which of them exist for a given
|
|
5
|
-
// principal is the charter's answer, not this file's.
|
|
6
4
|
export const actions: Record<string, ActionDefinition> = {
|
|
7
5
|
[welcomeAction.id]: welcomeAction,
|
|
8
6
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { ActionDefinition } from '@niscorp/nova';
|
|
2
2
|
import { welcomeLayout } from './welcome.layout';
|
|
3
3
|
|
|
4
|
-
// The first action: data with defaults, a JSON layout, and one trigger. The
|
|
5
|
-
// press is counted in the shell on the server — the browser only draws what
|
|
6
|
-
// the socket sends and sends back what was pressed.
|
|
7
4
|
export const welcomeAction: ActionDefinition = {
|
|
8
5
|
id: 'welcome',
|
|
9
6
|
title: 'Welcome',
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { LayoutNode } from '@niscorp/nova';
|
|
2
2
|
|
|
3
|
-
// JSON, bound to the action's data. Every component name is one the kit in
|
|
4
|
-
// src/ui registers; `ref` is what the action's trigger catches.
|
|
5
3
|
export const welcomeLayout: LayoutNode = {
|
|
6
4
|
component: 'Page',
|
|
7
5
|
children: [
|
|
@@ -4,7 +4,4 @@ import { assignments } from './charter/assignments';
|
|
|
4
4
|
import { charter } from './charter/charter';
|
|
5
5
|
import { shell } from './shell/shell';
|
|
6
6
|
|
|
7
|
-
// The manifest moss serves. One import per field; every field is data
|
|
8
|
-
// (AGENTS.md, "Layout of an app"). What it grows next — entries for the data
|
|
9
|
-
// layer, behaviors, pages — is in PLAN.md.
|
|
10
7
|
export const app = defineApp({ charter, assignments, actions, shell });
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
//
|
|
2
|
-
// sign in; the anonymous principal is always `public`.
|
|
1
|
+
// Principal id → role names. The anonymous principal is always `public`.
|
|
3
2
|
export const assignments: Record<string, readonly string[]> = {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Charter } from '@niscorp/charter';
|
|
2
2
|
|
|
3
|
-
// The policy document: role names → the action ids that exist for them (and,
|
|
4
|
-
// once there is data, `data: ['table.verb', …]`). `public` is whoever has not
|
|
5
|
-
// signed in — today, everybody.
|
|
6
3
|
export const charter: Charter = {
|
|
7
4
|
public: ['welcome'],
|
|
8
5
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { LayoutNode } from '@niscorp/nova';
|
|
2
2
|
|
|
3
|
-
// The frame around the canvases — chrome lives here, as layout, never as a
|
|
4
|
-
// wrapper component. One canvas for now: `main`, drawn where its slot is.
|
|
5
3
|
export const frameLayout: LayoutNode = { component: 'CanvasSlot', props: { canvasId: 'main' } };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { ShellManifest } from '@niscorp/moss';
|
|
2
2
|
import { frameLayout } from './frame.layout';
|
|
3
3
|
|
|
4
|
-
// The shell: one canvas, the action it opens with, and the frame around it.
|
|
5
|
-
// Shells host canvases, canvases host action instances, actions render JSON
|
|
6
|
-
// layouts.
|
|
7
4
|
export const shell: ShellManifest = {
|
|
8
5
|
canvases: [{ id: 'main', initial: 'welcome' }],
|
|
9
6
|
layout: frameLayout,
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
|
|
3
|
-
// Every check, each in its own process over its own fresh database: a check ships the app a
|
|
4
|
-
// history, and a shared one would make the order of the suite part of its
|
|
5
|
-
// meaning. `nisc check` runs this. A new feature adds its check here.
|
|
6
3
|
const CHECKS: readonly (readonly [name: string, what: string, args?: readonly string[]])[] = [
|
|
7
4
|
['artifacts-check', 'src/app is data: pure JSON, and every artifact parses its schema'],
|
|
8
5
|
['strata', 'the source is written at the installed grammars (strata.lock.json)', ['status', '--check']],
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
// The artifacts check — what makes `src/app/` a tree of DATA: everything in it
|
|
2
|
-
// is pure JSON (no function, no Date, no undefined, no class instance) and
|
|
3
|
-
// parses through its own schema, so a code file cannot pass for an artifact
|
|
4
|
-
// (AGENTS.md, review item 6a). It also holds rule 14: an action's `input`
|
|
5
|
-
// declares only keys its `data` has.
|
|
6
1
|
import { ActionDefinitionSchema, LayoutNodeSchema } from '@niscorp/nova';
|
|
7
2
|
import { actions } from '../app/action-catalog';
|
|
8
3
|
import { assignments } from '../app/charter/assignments';
|
|
@@ -15,7 +10,6 @@ const check = (name: string, passed: boolean, detail = ''): void => {
|
|
|
15
10
|
if (!passed) failures += 1;
|
|
16
11
|
};
|
|
17
12
|
|
|
18
|
-
// The first thing in a value that is not JSON, as a path — or '' when all of it is.
|
|
19
13
|
const impurity = (value: unknown, path: string): string => {
|
|
20
14
|
if (value === null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') return '';
|
|
21
15
|
if (Array.isArray(value)) return value.map((item, at) => impurity(item, `${path}[${at}]`)).find((found) => found !== '') ?? '';
|
|
@@ -46,7 +40,6 @@ if (shell.layout !== undefined) parses('the shell’s frame', () => LayoutNodeSc
|
|
|
46
40
|
for (const [id, definition] of Object.entries(actions)) {
|
|
47
41
|
check(`action "${id}" is catalogued under its own id`, definition.id === id, `its id is "${definition.id}"`);
|
|
48
42
|
parses(`action "${id}"`, () => ActionDefinitionSchema.parse(definition));
|
|
49
|
-
// rule 14: what an opener may seed is a subset of the action's data
|
|
50
43
|
const properties = isRecord(definition.input) && isRecord(definition.input['properties']) ? Object.keys(definition.input['properties']) : [];
|
|
51
44
|
const unknown = properties.filter((key) => !(key in (definition.data ?? {})));
|
|
52
45
|
check(`action "${id}" declares only inputs its data has`, unknown.length === 0, unknown.join(', '));
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
// strata for this app's SOURCE artifacts — which version of each grammar
|
|
2
|
-
// (nova's, Prism's) the actions in src/app are written in, recorded in
|
|
3
|
-
// strata.lock.json, and how they are brought forward when a grammar moves
|
|
4
|
-
// (AGENTS.md rule 20).
|
|
5
|
-
//
|
|
6
|
-
// npm run strata status where the source stands (`-- --check` to fail when behind)
|
|
7
|
-
// npm run strata upgrade the exact expected JSON + a report of what to edit
|
|
8
|
-
// npm run strata verify holds the edit to that JSON, then moves the lock
|
|
9
1
|
import { fileURLToPath } from 'node:url';
|
|
10
2
|
import { NOVA_SCHEMAS, NOVA_SEQUENCE } from '@niscorp/nova/migrations';
|
|
11
3
|
import { evaluate } from '@niscorp/prism';
|
|
@@ -2,11 +2,6 @@ import { renderDocument } from '@niscorp/moss';
|
|
|
2
2
|
import { boot } from '../server/boot';
|
|
3
3
|
import { drawing } from '../server/document';
|
|
4
4
|
|
|
5
|
-
// The welcome screen, end to end with no browser: the real server boots, the
|
|
6
|
-
// screen is served to nobody in particular, the page is drawn on the server,
|
|
7
|
-
// and a press reaches the shell. One `[pass]`/`[fail]` line per assertion; any
|
|
8
|
-
// failure exits non-zero (AGENTS.md, "Verification").
|
|
9
|
-
|
|
10
5
|
let failures = 0;
|
|
11
6
|
const check = (name: string, passed: boolean, detail = ''): void => {
|
|
12
7
|
console.log(`${passed ? '[pass]' : '[fail]'} ${name}${!passed && detail !== '' ? ` — ${detail}` : ''}`);
|
|
@@ -4,16 +4,6 @@ import { domTarget } from '@niscorp/moss/terminal/dom';
|
|
|
4
4
|
import { buildRegistry } from './ui/registry';
|
|
5
5
|
import './ui/kit.css';
|
|
6
6
|
|
|
7
|
-
// The browser: the kit, handed to moss's terminal — plain DOM, no framework. It
|
|
8
|
-
// knows nothing about the app: it draws the trees the socket sends and sends
|
|
9
|
-
// back what was pressed.
|
|
10
|
-
//
|
|
11
|
-
// The page arrives with the first screen already in it (src/server/document.ts)
|
|
12
|
-
// and the snapshot it was drawn from beside it; the wire starts from that
|
|
13
|
-
// snapshot, and the DOM adapter's first render puts the same elements back.
|
|
14
|
-
// Once people can sign in, the browser keeps the session in a cookie this
|
|
15
|
-
// page cannot read; it rides the page request and the socket by itself, which
|
|
16
|
-
// is how the server knows whose screen to draw.
|
|
17
7
|
const root = document.getElementById('root');
|
|
18
8
|
if (root === null) throw new Error('index.html has no #root');
|
|
19
9
|
|
|
@@ -3,7 +3,4 @@ import type { MossServer } from '@niscorp/moss';
|
|
|
3
3
|
import { app } from '../app/app';
|
|
4
4
|
import { runtime } from './runtime';
|
|
5
5
|
|
|
6
|
-
// The one composition: the app's artifacts plus an environment → the server.
|
|
7
|
-
// The dev server, `nisc build`, `nisc start` and every check boot through here.
|
|
8
|
-
// moss refuses to boot an incoherent charter — a refusal is a finding.
|
|
9
6
|
export const boot = async (): Promise<{ server: MossServer }> => ({ server: await createServer(app, await runtime()) });
|
|
@@ -3,10 +3,6 @@ import type { ShellSnapshot } from '@niscorp/moss';
|
|
|
3
3
|
import { renderSnapshot } from '@niscorp/moss/terminal/dom/server';
|
|
4
4
|
import { buildRegistry } from '../ui/registry';
|
|
5
5
|
|
|
6
|
-
// HOW A SCREEN IS DRAWN on the server: the kit the browser draws with, handed
|
|
7
|
-
// to moss. A DOM kit builds real elements, so it is handed a DOM to build them
|
|
8
|
-
// in (jsdom). A page request is answered with the screen the socket would have
|
|
9
|
-
// streamed a moment later.
|
|
10
6
|
const registry = buildRegistry();
|
|
11
7
|
const { window } = new JSDOM('');
|
|
12
8
|
|
|
@@ -3,18 +3,10 @@ import { createPostgresCache } from '@niscorp/vex';
|
|
|
3
3
|
import { createPglitePool, RAW_DATE_PARSERS } from '@niscorp/vex/pglite';
|
|
4
4
|
import type { NiscRuntime } from '@niscorp/moss';
|
|
5
5
|
|
|
6
|
-
// The environment (D2): what the app is handed to run on. An in-memory Postgres
|
|
7
|
-
// (PGlite) — every boot starts empty, which is what development and the checks
|
|
8
|
-
// want. A deployment hands moss a real Postgres pool here instead; nothing else
|
|
9
|
-
// in the app changes (see PLAN.md).
|
|
10
|
-
//
|
|
11
|
-
// `sessions`: moss verifies session tokens against its own table. Nobody can
|
|
12
|
-
// sign in yet — signing in is an application of its own, the anonymous
|
|
13
|
-
// principal's (AGENTS.md rule 12) — so every request is `public` for now.
|
|
14
6
|
export const runtime = async (): Promise<NiscRuntime> => {
|
|
15
7
|
const db = new PGlite();
|
|
16
|
-
//
|
|
17
|
-
//
|
|
8
|
+
// Two pools over one database: app queries get raw date strings (Prism
|
|
9
|
+
// formats them), the cache keeps Dates.
|
|
18
10
|
const cache = createPostgresCache({ pool: createPglitePool(db) });
|
|
19
11
|
await cache.init();
|
|
20
12
|
return { db, pool: createPglitePool(db, RAW_DATE_PARSERS), cache, session: 'sessions' };
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { DomComponent } from '@niscorp/nova/adapters/dom';
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// Props in, an element out; nova's DOM adapter wires a `ref`'d element's clicks
|
|
7
|
-
// by convention, so a button is just a button. Each one is CONFIGURED, never
|
|
8
|
-
// styled: it reads what a thing is (a tone) from a closed set of names, and
|
|
9
|
-
// anything it does not know falls back to the default. The look lives in
|
|
10
|
-
// kit.css alone.
|
|
11
|
-
// ═══════════════════════════════════════════════════════════
|
|
4
|
+
// nova's DOM adapter wires the clicks of an element with a `ref` itself, so
|
|
5
|
+
// `Button` adds no listener.
|
|
12
6
|
|
|
13
7
|
const parsed = <T>(schema: z.ZodType<T>, props: unknown, fallback: T): T => {
|
|
14
8
|
const result = schema.safeParse(props);
|
|
@@ -4,9 +4,8 @@ import type { DomComponent } from '@niscorp/nova/adapters/dom';
|
|
|
4
4
|
import { fallback } from '@niscorp/nova/adapters/dom/components';
|
|
5
5
|
import { Button, Heading, Page, Row, Text } from './kit';
|
|
6
6
|
|
|
7
|
-
// The
|
|
8
|
-
//
|
|
9
|
-
// wrapper). Every component a layout may name is here, and nothing else is.
|
|
7
|
+
// The adapter resolves a canvas slot itself, and an action slot is a plain
|
|
8
|
+
// wrapper: `fallback` does for both.
|
|
10
9
|
export const buildRegistry = (): ComponentRegistry<DomComponent> => {
|
|
11
10
|
const registry = createComponentRegistry<DomComponent>();
|
|
12
11
|
registry.register(CANVAS_SLOT_NAME, fallback);
|
|
@@ -2,7 +2,4 @@
|
|
|
2
2
|
// from one, so this file has to match vite's shape (AGENTS.md rule 16, a shim).
|
|
3
3
|
import { defineConfig } from 'vite';
|
|
4
4
|
|
|
5
|
-
// The browser's bundle: plain DOM, no framework. The app server runs inside
|
|
6
|
-
// vite's dev process too, but that is `nisc dev`'s doing (moss's dev plugin,
|
|
7
|
-
// fed from nisc.config.ts) — nothing about it belongs here.
|
|
8
5
|
export default defineConfig({});
|
|
@@ -2,14 +2,6 @@ import type { NiscMossProject } from '@niscorp/cli';
|
|
|
2
2
|
import { boot } from './src/server/boot';
|
|
3
3
|
import { drawing } from './src/server/document';
|
|
4
4
|
|
|
5
|
-
// What this app tells the `nisc` command: how it stands up (the same boot the
|
|
6
|
-
// checks run) and how one of its screens is drawn (the same drawing the dev
|
|
7
|
-
// server and `nisc start` use). Everything else is read off the app.
|
|
8
|
-
//
|
|
9
|
-
// npm run dev the app, with its server inside vite
|
|
10
|
-
// npm run build bundle, then say how each path is served
|
|
11
|
-
// npm start serve the built app, each first screen drawn
|
|
12
|
-
// npm run check the checks in src/dev
|
|
13
5
|
export const project: NiscMossProject = {
|
|
14
6
|
boot: async () => {
|
|
15
7
|
const { server } = await boot();
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ActionDefinition } from '@niscorp/nova';
|
|
2
2
|
import { welcomeAction } from './actions/surfaces/welcome.action';
|
|
3
3
|
|
|
4
|
-
// Ring 1: every action the app ships, by id. Which of them exist for a given
|
|
5
|
-
// principal is the charter's answer, not this file's.
|
|
6
4
|
export const actions: Record<string, ActionDefinition> = {
|
|
7
5
|
[welcomeAction.id]: welcomeAction,
|
|
8
6
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { ActionDefinition } from '@niscorp/nova';
|
|
2
2
|
import { welcomeLayout } from './welcome.layout';
|
|
3
3
|
|
|
4
|
-
// The first action: data with defaults, a JSON layout, and one trigger. The
|
|
5
|
-
// press is counted in the shell on the server — the browser only draws what
|
|
6
|
-
// the socket sends and sends back what was pressed.
|
|
7
4
|
export const welcomeAction: ActionDefinition = {
|
|
8
5
|
id: 'welcome',
|
|
9
6
|
title: 'Welcome',
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { LayoutNode } from '@niscorp/nova';
|
|
2
2
|
|
|
3
|
-
// JSON, bound to the action's data. Every component name is one the kit in
|
|
4
|
-
// src/ui registers; `ref` is what the action's trigger catches.
|
|
5
3
|
export const welcomeLayout: LayoutNode = {
|
|
6
4
|
component: 'Page',
|
|
7
5
|
children: [
|
|
@@ -4,7 +4,4 @@ import { assignments } from './charter/assignments';
|
|
|
4
4
|
import { charter } from './charter/charter';
|
|
5
5
|
import { shell } from './shell/shell';
|
|
6
6
|
|
|
7
|
-
// The manifest moss serves. One import per field; every field is data
|
|
8
|
-
// (AGENTS.md, "Layout of an app"). What it grows next — entries for the data
|
|
9
|
-
// layer, behaviors, pages — is in PLAN.md.
|
|
10
7
|
export const app = defineApp({ charter, assignments, actions, shell });
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
//
|
|
2
|
-
// sign in; the anonymous principal is always `public`.
|
|
1
|
+
// Principal id → role names. The anonymous principal is always `public`.
|
|
3
2
|
export const assignments: Record<string, readonly string[]> = {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Charter } from '@niscorp/charter';
|
|
2
2
|
|
|
3
|
-
// The policy document: role names → the action ids that exist for them (and,
|
|
4
|
-
// once there is data, `data: ['table.verb', …]`). `public` is whoever has not
|
|
5
|
-
// signed in — today, everybody.
|
|
6
3
|
export const charter: Charter = {
|
|
7
4
|
public: ['welcome'],
|
|
8
5
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { LayoutNode } from '@niscorp/nova';
|
|
2
2
|
|
|
3
|
-
// The frame around the canvases — chrome lives here, as layout, never as a
|
|
4
|
-
// wrapper component. One canvas for now: `main`, drawn where its slot is.
|
|
5
3
|
export const frameLayout: LayoutNode = { component: 'CanvasSlot', props: { canvasId: 'main' } };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { ShellManifest } from '@niscorp/moss';
|
|
2
2
|
import { frameLayout } from './frame.layout';
|
|
3
3
|
|
|
4
|
-
// The shell: one canvas, the action it opens with, and the frame around it.
|
|
5
|
-
// Shells host canvases, canvases host action instances, actions render JSON
|
|
6
|
-
// layouts.
|
|
7
4
|
export const shell: ShellManifest = {
|
|
8
5
|
canvases: [{ id: 'main', initial: 'welcome' }],
|
|
9
6
|
layout: frameLayout,
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
|
|
3
|
-
// Every check, each in its own process over its own fresh database: a check ships the app a
|
|
4
|
-
// history, and a shared one would make the order of the suite part of its
|
|
5
|
-
// meaning. `nisc check` runs this. A new feature adds its check here.
|
|
6
3
|
const CHECKS: readonly (readonly [name: string, what: string, args?: readonly string[]])[] = [
|
|
7
4
|
['artifacts-check', 'src/app is data: pure JSON, and every artifact parses its schema'],
|
|
8
5
|
['strata', 'the source is written at the installed grammars (strata.lock.json)', ['status', '--check']],
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
// The artifacts check — what makes `src/app/` a tree of DATA: everything in it
|
|
2
|
-
// is pure JSON (no function, no Date, no undefined, no class instance) and
|
|
3
|
-
// parses through its own schema, so a code file cannot pass for an artifact
|
|
4
|
-
// (AGENTS.md, review item 6a). It also holds rule 14: an action's `input`
|
|
5
|
-
// declares only keys its `data` has.
|
|
6
1
|
import { ActionDefinitionSchema, LayoutNodeSchema } from '@niscorp/nova';
|
|
7
2
|
import { actions } from '../app/action-catalog';
|
|
8
3
|
import { assignments } from '../app/charter/assignments';
|
|
@@ -15,7 +10,6 @@ const check = (name: string, passed: boolean, detail = ''): void => {
|
|
|
15
10
|
if (!passed) failures += 1;
|
|
16
11
|
};
|
|
17
12
|
|
|
18
|
-
// The first thing in a value that is not JSON, as a path — or '' when all of it is.
|
|
19
13
|
const impurity = (value: unknown, path: string): string => {
|
|
20
14
|
if (value === null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') return '';
|
|
21
15
|
if (Array.isArray(value)) return value.map((item, at) => impurity(item, `${path}[${at}]`)).find((found) => found !== '') ?? '';
|
|
@@ -46,7 +40,6 @@ if (shell.layout !== undefined) parses('the shell’s frame', () => LayoutNodeSc
|
|
|
46
40
|
for (const [id, definition] of Object.entries(actions)) {
|
|
47
41
|
check(`action "${id}" is catalogued under its own id`, definition.id === id, `its id is "${definition.id}"`);
|
|
48
42
|
parses(`action "${id}"`, () => ActionDefinitionSchema.parse(definition));
|
|
49
|
-
// rule 14: what an opener may seed is a subset of the action's data
|
|
50
43
|
const properties = isRecord(definition.input) && isRecord(definition.input['properties']) ? Object.keys(definition.input['properties']) : [];
|
|
51
44
|
const unknown = properties.filter((key) => !(key in (definition.data ?? {})));
|
|
52
45
|
check(`action "${id}" declares only inputs its data has`, unknown.length === 0, unknown.join(', '));
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
// strata for this app's SOURCE artifacts — which version of each grammar
|
|
2
|
-
// (nova's, Prism's) the actions in src/app are written in, recorded in
|
|
3
|
-
// strata.lock.json, and how they are brought forward when a grammar moves
|
|
4
|
-
// (AGENTS.md rule 20).
|
|
5
|
-
//
|
|
6
|
-
// npm run strata status where the source stands (`-- --check` to fail when behind)
|
|
7
|
-
// npm run strata upgrade the exact expected JSON + a report of what to edit
|
|
8
|
-
// npm run strata verify holds the edit to that JSON, then moves the lock
|
|
9
1
|
import { fileURLToPath } from 'node:url';
|
|
10
2
|
import { NOVA_SCHEMAS, NOVA_SEQUENCE } from '@niscorp/nova/migrations';
|
|
11
3
|
import { evaluate } from '@niscorp/prism';
|
|
@@ -2,11 +2,6 @@ import { renderDocument } from '@niscorp/moss';
|
|
|
2
2
|
import { boot } from '../server/boot';
|
|
3
3
|
import { drawing } from '../server/document';
|
|
4
4
|
|
|
5
|
-
// The welcome screen, end to end with no browser: the real server boots, the
|
|
6
|
-
// screen is served to nobody in particular, the page is drawn on the server,
|
|
7
|
-
// and a press reaches the shell. One `[pass]`/`[fail]` line per assertion; any
|
|
8
|
-
// failure exits non-zero (AGENTS.md, "Verification").
|
|
9
|
-
|
|
10
5
|
let failures = 0;
|
|
11
6
|
const check = (name: string, passed: boolean, detail = ''): void => {
|
|
12
7
|
console.log(`${passed ? '[pass]' : '[fail]'} ${name}${!passed && detail !== '' ? ` — ${detail}` : ''}`);
|
|
@@ -4,15 +4,6 @@ import { reactTarget } from '@niscorp/moss/terminal/react';
|
|
|
4
4
|
import { buildRegistry } from './ui/registry';
|
|
5
5
|
import './ui/kit.css';
|
|
6
6
|
|
|
7
|
-
// The browser: the kit, handed to moss's terminal. It knows nothing about the
|
|
8
|
-
// app — it draws the trees the socket sends and sends back what was pressed.
|
|
9
|
-
//
|
|
10
|
-
// The page arrives with the first screen already in it (src/server/document.ts)
|
|
11
|
-
// and the snapshot it was drawn from beside it; the wire starts from that
|
|
12
|
-
// snapshot, so the first render adopts the elements already there. Once people
|
|
13
|
-
// can sign in, the browser keeps the session in a cookie this page cannot
|
|
14
|
-
// read; it rides the page request and the socket by itself, which is how the
|
|
15
|
-
// server knows whose screen to draw.
|
|
16
7
|
const root = document.getElementById('root');
|
|
17
8
|
if (root === null) throw new Error('index.html has no #root');
|
|
18
9
|
|