Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Add this URL in Arcane’s Templates settings:
- `.env.example`
- `template.json` (metadata; see example below)
- Optional: `README.md` for extra setup notes or caveats.
- Auto-generation: [scripts/build-registry.ts](scripts/build-registry.ts) scans `templates/` and generates [registry.json](registry.json) that follows [schema.json](schema.json).
- Auto-generation: [`arcane-templates generate`](#development) scans `templates/` and generates [registry.json](registry.json) that follows [schema.json](schema.json).
- Do not edit or commit `registry.json` in PRs — CI builds and publishes it on merge to `main`.
- Every generated template now includes a `content_hash` fingerprint derived from `template.json`, the compose file, `.env.example`, and `README.md` when present.
- Versioning policy:
Expand Down Expand Up @@ -49,14 +49,16 @@ The generated registry entry shape looks like this:

1. Fork this repo

2. Create a directory in `templates/` using a lowercase, hyphenated ID:
2. Scaffold a template with the CLI:

```bash
cd templates
mkdir my-awesome-template
pnpm run create:template -- my-awesome-template
```

3. Add required files:
You can also run the published CLI with `npx arcane-templates create my-awesome-template`.
If you want the short local command name, build and link the package, then run `arcanetmpl create my-awesome-template`.

3. Required files:

```
templates/my-awesome-template/
Expand Down Expand Up @@ -102,11 +104,29 @@ Tips:

## Development

- CLI entrypoint:

```bash
pnpm run cli -- --help
```

- Build and use the local binary:

```bash
pnpm install
pnpm run build
npm link
arcanetmpl help
arcanetmpl create my-awesome-template
```

- Validate data against the registry schema: [schema.json](schema.json)

```bash
pnpm install
pnpm run build
pnpm run format
pnpm run create:template -- my-awesome-template
pnpm run lint
pnpm run test
pnpm run validate
Expand Down
25 changes: 20 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
{
"name": "arcane-templates",
"private": true,
"private": false,
"bin": {
"arcane-templates": "./dist/scripts/cli.js",
"arcanetmpl": "./dist/scripts/cli.js"
},
"files": [
"dist",
"README.md"
],
"packageManager": "pnpm@11.0.0+sha512.5bd187500e49cc6c3d891d973b432c02b844a5eb7209172c90a517a3ef4f579ed5c23d409b699e6a9dc418ff7b2b1890e63f6d74f1d3fc49848f37779c89c84c",
"engines": {
"node": ">=25"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "tsc --project tsconfig.json",
"prepare": "pnpm run build",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 prepare script hard-codes pnpm run build

Now that preinstall: only-allow pnpm was removed (intentionally for public publishing), contributors who npm install or yarn install will hit a cryptic error because prepare invokes pnpm run build. Consider using tsc --project tsconfig.json directly in prepare so it works regardless of the package manager:

Suggested change
"prepare": "pnpm run build",
"prepare": "tsc --project tsconfig.json",
Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 18

Comment:
**`prepare` script hard-codes `pnpm run build`**

Now that `preinstall: only-allow pnpm` was removed (intentionally for public publishing), contributors who `npm install` or `yarn install` will hit a cryptic error because `prepare` invokes `pnpm run build`. Consider using `tsc --project tsconfig.json` directly in `prepare` so it works regardless of the package manager:

```suggestion
    "prepare": "tsc --project tsconfig.json",
```

How can I resolve this? If you propose a fix, please make it concise.

Fix in Codex

"format": "prettier . --write",
"format:check": "prettier . --check",
"lint": "pnpm run type-check && pnpm run generate && pnpm run format:check && pnpm run validate",
"type-check": "tsc --noEmit",
"test": "tsx scripts/test-build-registry.ts",
"validate": "tsx scripts/validate.ts",
"generate": "tsx scripts/build-registry.ts",
"validate": "tsx scripts/cli.ts validate",
"generate": "tsx scripts/cli.ts generate",
"ci": "pnpm run lint && pnpm run test && pnpm run generate",
"stage": "rm -rf build && mkdir -p build/templates && cp -v registry.json build/ && cp -v schema.json build/ && if [ -d public ]; then rsync -a public/ build/; fi && rsync -a --delete templates/ build/templates/",
"stage": "tsx scripts/cli.ts stage",
"create:template": "tsx scripts/cli.ts create",
"cli": "tsx scripts/cli.ts",
"deploy": "pnpm run stage && wrangler version deploy",
"dev": "pnpm run generate && pnpm run stage && wrangler dev"
},
"dependencies": {
"ajv": "^8.18.0",
"ajv-formats": "^3.0.1"
},
Comment on lines +33 to +36
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Published CLI will crash because prettier is missing from dependencies

prettier is imported at the top level in both scripts/lib/registry.ts:4 and scripts/lib/template-scaffold.ts:3, but it is only listed in devDependencies, not in dependencies. Since the package is now public ("private": false) with bin entries pointing to dist/scripts/cli.js, anyone installing via npx arcane-templates or npm install -g arcane-templates will not get prettier installed (npm only installs dependencies, not devDependencies for published packages). Because cli.ts eagerly imports all modules at the top level, the import prettier from "prettier" statement will fail on module load, crashing every CLI command — not just generate and create which actually use prettier, but also help, validate, and stage.

Suggested change
"dependencies": {
"ajv": "^8.18.0",
"ajv-formats": "^3.0.1"
},
"dependencies": {
"ajv": "^8.18.0",
"ajv-formats": "^3.0.1",
"prettier": "^3.8.3"
},
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

"devDependencies": {
"@types/node": "^25.6.0",
"ajv": "^8.20.0",
Expand Down
Loading