@divithselvam/jokebook 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,64 @@
1
+ # Changelog
2
+
3
+ All notable changes to Jokebook are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
+
5
+ ## [1.1.0] - 2026-12-01
6
+
7
+ ### Added
8
+
9
+ - `jokebook upgrade` with `--check` and `--apply`: three-way merge against the bundled old and new starters, structural merges for `package.json` and `tauri.conf.json`, automatic text merges with `git merge-file`, and conflict refusal.
10
+ - Atomic upgrade writes with per-file backups, rollback after a failed write, path validation, and a report under `.jokebook/`.
11
+ - Catalog-only updates when the catalog changes without a starter revision bump.
12
+ - Machine-readable `jokebook-catalog` metadata in catalog 1.1.0, declaring section ownership, table headers and automated recipes.
13
+ - A bundled starter index at `dist/starters/index.json` and per-revision archive paths at `dist/starters/<revision>/<surface>.tgz`.
14
+ - Catalog-driven recipe resolution: ids, aliases, package, version, capability, summary and workspace come from the catalog instead of constants in commands.
15
+ - Packed-package verification of the tarball layout, catalog hash, starter index, version output, `stack list`, `stack show`, `init --dry-run` and outside-product `upgrade` refusal.
16
+ - Tests for catalog metadata, legacy catalog fallback, archive layout, clean upgrades, conflict refusal and catalog-only updates.
17
+
18
+ ### Changed
19
+
20
+ - Package version and catalog/starter revisions are 1.1.0. Starter 1.1.0 reuses the verified 1.0.0 application sources; it updates agent guidance and generated READMEs and removes the placeholder catalog marker.
21
+ - The npm package ships only the current catalog at `dist/catalog/STACK.md`; every bundled starter revision remains available for upgrades.
22
+ - Generated `AGENTS.md` now explains the catalog contract, the upgrade check/apply workflow, conflict refusal and post-upgrade checks.
23
+ - Recipe and archive selection no longer hardcode versioned packument strings, archive filenames, catalog hashes, workspace paths or status text.
24
+ - `add` requires the current starter revision and tells older products to upgrade first.
25
+ - Documentation, `CONTRIBUTING.md` and release checks describe the new build layout and upgrade lifecycle.
26
+
27
+ ### Fixed
28
+
29
+ - Skill installation no longer fails when Jokebook itself runs through `npm exec --package=@divithselvam/jokebook`: the nested `npx` call no longer inherits npm's outer package selection.
30
+ - Upgrade plans no longer report success while unresolved conflicts remain, and a failed apply no longer leaves a half-updated marker.
31
+ - Starter extraction creates its destination before reading archives.
32
+ - Previously stale release metadata in `package.json`, `bin/run.js` and the verify script is derived from the package manifest and generated indexes.
33
+
34
+ ### Security
35
+
36
+ - Upgrade refuses absolute paths, paths that escape the product, and non-file replacement targets.
37
+ - Upgrade restores every touched file when an application step fails.
38
+
39
+ ## [1.0.0] - 2026-11-30
40
+
41
+ ### Added
42
+
43
+ - Versioned starter 1.0.0 with `web`, `desktop`, `mobile` and `full` presets.
44
+ - SvelteKit and Vite+ web foundation, Rust/Axum API, Cargo workspace, PostgreSQL Compose configuration and one root pnpm lockfile.
45
+ - Optional Tauri desktop client generated from the official Tauri template.
46
+ - Optional shared Swift 6.4.3 core with a SwiftUI iOS app and a Jetpack Compose Android app, linked through swift-java 0.7.0 JNI bindings and the Swift SDK for Android.
47
+ - `jokebook init` with interactive and unattended modes, dry runs, JSON output, exact destination handling, staging and cancellation.
48
+ - `jokebook stack list` and `jokebook stack show` with catalog hash verification and full capability lookup.
49
+ - `jokebook add runtime-validation` (alias `valibot`) with exact pinning, idempotency, verification and rollback.
50
+ - Project-local installation of `blame-the-intern` and `modern-web-guidance` through the pinned Skills CLI 1.9.1.
51
+ - Provenance checks for both skills and the exact two-line generated `AGENTS.md`.
52
+ - Byte-for-byte `STACK.md` copies whose SHA-256 is recorded in each product.
53
+ - Local release verification with ESLint, tests, a packed-package smoke test and `prepublishOnly`.
54
+ - Node 26.13.1, npm 11.20.0 and pnpm 12.25.1 pins.
55
+
56
+ ### Security
57
+
58
+ - Child processes run with closed stdin, a non-interactive environment and a cancellation signal.
59
+ - Error output redacts likely tokens, credentials and authorization headers.
60
+ - Existing non-empty destinations are refused.
61
+ - A staged product is moved into place only after dependency installation, recipe checks and both skill verifications succeed.
62
+
63
+ [1.1.0]: https://github.com/Divith123/jokebook/releases/tag/v1.1.0
64
+ [1.0.0]: https://github.com/Divith123/jokebook/releases/tag/v1.0.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License Copyright (c) 2026 Divithselvam
2
+
3
+ Permission is hereby granted, free
4
+ of charge, to any person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice
12
+ (including the next paragraph) shall be included in all copies or substantial
13
+ portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
18
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,193 @@
1
- # Temporary Holding Version
1
+ # Jokebook
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/@divithselvam/jokebook.svg)](https://www.npmjs.com/package/@divithselvam/jokebook)
4
+ [![license](https://img.shields.io/npm/l/@divithselvam/jokebook.svg)](LICENSE)
5
+
6
+ Jokebook is a versioned project generator for production-minded web products. One command creates a pnpm workspace with a SvelteKit web app, a Rust/Axum API, PostgreSQL development configuration, and optional Tauri desktop and shared-Swift native mobile clients.
7
+
8
+ Every generated product carries a byte-for-byte copy of the architecture and package catalog it was built from, plus two project-local agent skills whose source commits are recorded in `skills-lock.json`. Generation is staged, checked, and moved into place only after dependency installation and skill verification succeed. Existing products can merge a newer bundled starter with `jokebook upgrade` without discarding local edits.
9
+
10
+ ## Requirements
11
+
12
+ - **Node.js 26.13.1** with its **npm 11.20.0** and `npx`.
13
+ - **pnpm 12.25.1** on `PATH`.
14
+ - **Git**.
15
+ - For native targets: Rust 1.100.1, Docker, Xcode 27.2, Swift 6.4.3, the Swift SDK for Android, Android NDK r30 and a JDK as described in the generated mobile `README.md`.
16
+
17
+ Jokebook rejects a different Node or pnpm release before writing a product. The CLI itself is published for Node 26.13.1.
18
+
19
+ ## Install and run
20
+
21
+ Without a global install:
22
+
23
+ ```sh
24
+ npm exec --yes --package=@divithselvam/jokebook -- jokebook init
25
+ npm exec --yes --package=@divithselvam/jokebook -- jokebook init my-product --preset web --no-interactive --json
26
+ ```
27
+
28
+ Or install the executable globally:
29
+
30
+ ```sh
31
+ npm install --global @divithselvam/jokebook
32
+ jokebook init
33
+ ```
34
+
35
+ ## Presets
36
+
37
+ | Preset | Surfaces |
38
+ | --- | --- |
39
+ | `web` (default) | SvelteKit, Vite+, Rust/Axum API and PostgreSQL development configuration |
40
+ | `desktop` | Web foundation plus a Tauri desktop client |
41
+ | `mobile` | Web foundation plus a shared Swift core, a SwiftUI iOS app and a Jetpack Compose Android app |
42
+ | `full` | Web foundation, Tauri desktop client, SwiftUI iOS app and Jetpack Compose Android app |
43
+
44
+ No GPUI preset is shipped. The catalog documents GPUI for products that need a native Rust renderer, but Jokebook has no verified upstream generation route for it.
45
+
46
+ ## Commands
47
+
48
+ ```text
49
+ jokebook init [product] [--preset web|desktop|mobile|full] [--dir <path>] [--with <recipe>]...
50
+ [--interactive | --no-interactive] [--json] [--dry-run]
51
+ jokebook stack list [--json]
52
+ jokebook stack show <capability> [--json]
53
+ jokebook add <recipe> [--no-interactive] [--json] [--dry-run]
54
+ jokebook upgrade [--check | --apply] [--json]
55
+ jokebook --help
56
+ jokebook --version
57
+ ```
58
+
59
+ ### `init`
60
+
61
+ Flags take precedence. In an interactive terminal, Jokebook prompts only for missing values: product name, destination, preset and optional recipes. It shows the resolved plan before writing.
62
+
63
+ `--no-interactive`, `--json`, CI, a missing TTY or `TERM=dumb` select unattended mode. Unattended mode requires a product name and never reads stdin. Defaults are the `web` preset, no recipes and `./<product>`.
64
+
65
+ `--dir` sets the exact destination. Its parent must already exist; the destination itself must be absent or an empty real directory. `--dry-run` validates and prints the resolved plan without writing a project, changing manifests or installing skills.
66
+
67
+ The command exits `0` on success, `1` on failure and `130` on cancellation. `--json` prints exactly one parseable object to stdout in both cases, with the operation, stage, destination, starter revision, resolved settings, installed skills, actionable error details and a corrected usage line when relevant.
68
+
69
+ ### `stack`
70
+
71
+ `stack list` and `stack show` are read-only. Inside a generated product they read that product's pinned `STACK.md` and verify its SHA-256. Elsewhere they read the catalog bundled with the CLI.
72
+
73
+ Capability rows, sections, table headers, workspace ownership and automated recipes come from the catalog's machine-readable metadata. `stack show` accepts a capability slug from `stack list` or a unique backticked package name. It reports the recommendation, versions, owning workspace, source row and links, setup notes and recipe status.
74
+
75
+ ### `add`
76
+
77
+ `add runtime-validation` (alias `valibot`) resolves the package and exact version declared by the catalog recipe, installs it in the recipe's workspace with the product's pnpm workspace, and verifies a real import. It can also be selected with `init --with runtime-validation`. Repeating the recipe verifies the existing installation and makes no change.
78
+
79
+ Automated recipes require the current starter revision. If the product is older, run `jokebook upgrade --apply` first. Catalog capabilities without an automated recipe return their documented setup guidance and leave the product untouched. Run `add` from the product directory or any of its subdirectories.
80
+
81
+ ### `upgrade`
82
+
83
+ `upgrade --check` plans a three-way merge between the bundled old and new starters and reports added, updated, merged and removed files. It writes nothing. `upgrade --apply` writes the same plan only when there are no conflicts.
84
+
85
+ Jokebook keeps local edits. Text files use `git merge-file`; `package.json` and `tauri.conf.json` use a semantic three-way merge; new and removed files are compared against the bundled old starter. A conflict blocks the whole plan: `--apply` refuses to change any file and exits non-zero. Applied writes are atomic, and a failed write restores every touched file from its backup.
86
+
87
+ A completed upgrade writes a report under `.jokebook/`, updates the product marker and moves the pinned catalog when needed. A catalog-only release is handled without changing the starter revision. Review the report and `git diff`, run `pnpm install` if dependencies changed, then run the product checks.
88
+
89
+ ## What a product contains
90
+
91
+ ```text
92
+ my-product/
93
+ apps/web/ SvelteKit web application
94
+ apps/desktop/ Tauri desktop client (desktop and full)
95
+ apps/mobile/ Shared Swift core, SwiftUI iOS app and Jetpack Compose Android app
96
+ (mobile and full; see apps/mobile/README.md)
97
+ services/api/ Rust/Axum HTTP API
98
+ packages/ Shared workspace packages
99
+ STACK.md Pinned architecture and package catalog
100
+ AGENTS.md Agent guidance for the catalog and update workflow
101
+ skills-lock.json Skills CLI provenance for both project skills
102
+ pnpm-workspace.yaml One pnpm workspace and root lockfile
103
+ Cargo.toml Rust workspace
104
+ package.json Product marker, preset, catalog revision and catalog hash
105
+ ```
106
+
107
+ The generated `README.md` covers development commands, the API and readiness endpoints, production static hosting, native prerequisites, catalog lookup and the upgrade workflow.
108
+
109
+ ## How generation works
110
+
111
+ 1. Resolve flags and prompts into one validated configuration.
112
+ 2. Reject a non-empty destination before touching the filesystem.
113
+ 3. Extract the versioned starter into a staging directory alongside the destination.
114
+ 4. Write the product marker, copy the pinned catalog and configure desktop identifiers when needed.
115
+ 5. Run `pnpm install --frozen-lockfile` in the staged workspace.
116
+ 6. Apply selected recipes and install both project-local agent skills.
117
+ 7. Re-check the destination and rename the completed staging directory into place.
118
+
119
+ If any step fails, the staging directory is removed and an existing empty destination is left untouched. Child processes receive closed stdin, a non-interactive environment and a cancellation signal.
120
+
121
+ ## Catalog and recipes
122
+
123
+ The canonical catalog lives at `catalogs/<revision>/STACK.md`. Catalog `1.1.0` is the current revision, with SHA-256 `14f8bf06942076bf593e89e20f6413677fbf8f0cf4aee9151fbe87e604150e17`. Catalog `1.0.0` remains bundled as the frozen upgrade base at SHA-256 `850953320cc8e9093b9c3286e4279596dbdd274319e2b60ab648977ae4e90307`.
124
+
125
+ The `1.1.0` catalog adds a machine-readable `jokebook-catalog` block that declares section ownership, table headers and recipes. Its Markdown content is otherwise identical to `1.0.0`. The frozen `1.0.0` catalog predates that block, so the CLI keeps a clearly marked legacy section map for it only.
126
+
127
+ Every generated product gets a byte-for-byte copy of the catalog bundled with its starter. The CLI refuses to continue if a product's `STACK.md` no longer matches the hash recorded in its `package.json`. The published package contains only the current catalog at `dist/catalog/STACK.md`; bundled starter revisions live under `dist/starters/<revision>/<surface>.tgz`.
128
+
129
+ `runtime-validation` is the only automated recipe because it has a real, repeatable integration check. Other capabilities remain documented recommendations; they are not installed blindly. Recipe aliases, implementation, package, summary, workspace and capability target all come from the catalog metadata.
130
+
131
+ ## Agent skills
132
+
133
+ Every real `init` installs these two skills with the pinned Skills CLI 1.9.1, from the staged product root:
134
+
135
+ - `Divith123/skills` → `blame-the-intern`
136
+ - `googlechrome/modern-web-guidance` → `modern-web-guidance`
137
+
138
+ Both use the project-local `universal` target and copy mode. Jokebook verifies each `SKILL.md` identity and the source repository and commit recorded by the Skills CLI. The starter's `AGENTS.md` then tells agents to load both skills, read `STACK.md` before scaffolding or changing dependencies, and use `jokebook upgrade --check` before `--apply`.
139
+
140
+ No agent command or global skill installation is required after generation.
141
+
142
+ ## Runtime decisions
143
+
144
+ The default and only qualified runtime path is Node 26.13.1 with pnpm 12.25.1. Vite+'s environment management selects Node and supports a pinned pnpm version; the starter uses one root pnpm workspace and lockfile.
145
+
146
+ Deno is not a supported product profile. It has npm compatibility and its own dependency management, but Jokebook has no verified Deno starter that passes official scaffolding, workspace resolution, Vite+ builds, both Skills CLI installs, Tauri tooling and packed-CLI checks. Shipping a Deno label without those checks would be misleading.
147
+
148
+ ## Local verification
149
+
150
+ This repository intentionally does not depend on GitHub Actions. The release gate runs locally with the pinned toolchain:
151
+
152
+ ```sh
153
+ npm ci
154
+ npm run verify
155
+ ```
156
+
157
+ `npm run verify` runs ESLint, the test suite and a packed-package smoke test. The smoke test packs the npm tarball, inspects its contents, checks the bundled catalog and starter indexes, then runs `jokebook --version`, `stack list`, `stack show`, an `init --dry-run` and an `upgrade` refusal outside a product. It also covers catalog-only and starter upgrades, conflict refusal, catalog parsing and archive contents. `npm run verify:package` runs only the package check.
158
+
159
+ Before a release, inspect the package and run a publish dry run:
160
+
161
+ ```sh
162
+ npm pack
163
+ npm publish --access public --dry-run
164
+ ```
165
+
166
+ `prepublishOnly` runs `npm run verify`, so a publish cannot bypass the local gate. `npm run build` compiles the CLI, copies the current catalog to `dist/catalog/` and creates a `web`, `desktop` and `mobile` archive for every bundled starter revision under `dist/starters/`. The old `1.0.0` revision stays available as the upgrade base.
167
+
168
+ ## Starter provenance
169
+
170
+ Starter **1.1.0** reuses the verified `1.0.0` application sources. It updates `AGENTS.md` and the generated READMEs for the catalog and upgrade contract, and removes the placeholder catalog marker from `package.json` so generation writes the real marker. Starter **1.0.0** remains frozen with the 30 November 2026 catalog at SHA-256 `850953320cc8e9093b9c3286e4279596dbdd274319e2b60ab648977ae4e90307`.
171
+
172
+ | Source | Generation |
173
+ | --- | --- |
174
+ | CLI | oclif 6.0.15 `generate` and `generate command` |
175
+ | Workspace and `AGENTS.md` | Vite+ 1.8.0 `vp create vite:monorepo --agent codex --package-manager pnpm --no-interactive` |
176
+ | Web | `sv@1.7.1 create`, minimal and demo templates with the static adapter. The demo supplies the generated route-options file. |
177
+ | PostgreSQL compose | Svelte CLI 1.7.1 official Drizzle add-on with PostgreSQL and Docker. The Compose service was integrated with SQLx. |
178
+ | Rust | Cargo 1.100.1 `init --lib`, `new --bin`, `add` and `generate-lockfile` |
179
+ | Desktop | `create-tauri-app@4.7.5` Svelte TypeScript template, built by Tauri CLI 2.13.0 |
180
+ | Mobile | Hand-written SwiftPM `MobileCore` and `MobileCoreAndroid` targets, SwiftUI app, Jetpack Compose app, swift-java 0.7.0 JNI bindings, Swift 6.4.3, Kotlin 2.4.21, Compose BOM 2026.09.00, Gradle 9.5.0 and NDK r30 |
181
+ | Skills | Vercel Skills CLI 1.9.1, run locally with `--agent universal --copy --yes` |
182
+
183
+ Refresh starter sources with the upstream generators, verify the resulting workspace locks and target builds, then publish a new starter revision and catalog metadata before packing. The Jokebook source repository uses npm to build and distribute the CLI; each generated product uses pnpm.
184
+
185
+ Release verification for 1.1.0 runs on macOS on Apple silicon. The CLI and starter use cross-platform Node APIs, but Linux and Windows native builds are not part of the 1.1.0 verification matrix. The generated README lists the host-specific prerequisites.
186
+
187
+ ## Contributing
188
+
189
+ Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. Security reports belong in [SECURITY.md](SECURITY.md). Participation is covered by the [Code of Conduct](CODE_OF_CONDUCT.md).
190
+
191
+ ## License
192
+
193
+ MIT. See [LICENSE](LICENSE).
package/bin/run.js ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {readFile} from 'node:fs/promises'
4
+
5
+ if (Object.hasOwn(process.env, 'NO_COLOR')) delete process.env.FORCE_COLOR
6
+ const manifest = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'))
7
+ const {run, flush, Errors} = await import('@oclif/core')
8
+ try {
9
+ await run(process.argv.slice(2), import.meta.url)
10
+ await flush()
11
+ } catch (error) {
12
+ if (!process.argv.includes('--json')) {
13
+ await Errors.handle(error)
14
+ } else {
15
+ console.log(JSON.stringify({
16
+ ok: false,
17
+ stage: 'arguments',
18
+ settings: null,
19
+ destination: null,
20
+ starterRevision: manifest.jokebook?.starter ?? null,
21
+ installedSkills: [],
22
+ error: {message: error.message},
23
+ usage: 'Try: jokebook --help',
24
+ }))
25
+ process.exitCode = 1
26
+ }
27
+ }