@studio-fes/create-fes-app
v0.4.8
Published
Interactive wizard to scaffold a new project from the studio fes Nuxt layers starters (Craft CMS, Strapi).
Readme
@studio-fes/create-fes-app
Interactive wizard to scaffold a new project from the studio fes Nuxt layers starters (Craft CMS, Strapi).
Usage (once published to npm)
npx @studio-fes/create-fes-app [project-name]The wizard asks for:
- Project name (skipped if passed as an argument)
- Starter template — currently
craftorstrapi, one per folder intemplates/ - Package manager — pnpm, npm, yarn or bun
- Whether to install dependencies right away
- Whether to run
git init
It then copies the chosen template into a new folder, renames package.json, copies .env.example to .env, and prints the next steps.
Developing the templates
templates/craft and templates/strapi are the templates themselves — there is no separate examples/ folder to keep in sync. They are regular pnpm workspace packages (see pnpm-workspace.yaml) that depend on @studio-fes/layer-craft / @studio-fes/layer-strapi via workspace:*, so editing a layer and running the template picks up the change immediately:
pnpm dev:craft # -> pnpm --filter './packages/create-app/templates/craft' dev
pnpm dev:strapi # -> pnpm --filter './packages/create-app/templates/strapi' devTo try the wizard itself against the current source:
node packages/create-app/bin/create-fes-app.mjsSince the templates still use workspace:* in this state, the CLI resolves that to a real version at scaffold time — either from the sibling package in this monorepo (when run from source) or, if that's not available (e.g. testing outside the repo), from the npm registry.
Publishing
The live templates/craft and templates/strapi folders are pnpm workspace packages — they have node_modules, .nuxt, workspace:* dependencies, none of which is valid or wanted in a published npm tarball. So the package is never published from templates/ directly:
prepack(scripts/build-templates-for-publish.mjs) builds a clean copy of each template intodist/templates/<name>, strippingnode_modules/.nuxt/.output/.env, pinningworkspace:*dependencies to the sibling package's current version, and stashing.gitignoreas_gitignore(npm has historically dropped nested.gitignorefiles from published tarballs).package.json'sfilesfield only listsbinanddist, so only that clean build ships.dist/is gitignored and safe to delete/rebuild at any time (node scripts/build-templates-for-publish.mjs).- The CLI (
bin/create-fes-app.mjs) looks fordist/templatesfirst and falls back totemplates/— the latter only matters when running the wizard straight from source before it's ever been packed, in which case it also resolvesworkspace:*at runtime as a safety net.
This version is kept in lockstep with the layer packages (@studio-fes/layer-base/layer-craft/layer-strapi) via the fixed group in .changeset/config.json, so they always bump and publish together.
To publish, run the usual changesets flow from the repo root:
# 1. Commit any pending changes first
git add -A
git commit -m "..."
# 2. Record what changed (select @studio-fes/create-fes-app, pick a bump, write a summary)
pnpm changeset
# 3. Bump version + changelog, then commit
pnpm version-packages
git add -A
git commit -m "chore: version packages"
# 4. Make sure the npm token has access to the @studio-fes org
pnpm exec npm whoami
# 5. Build (packages/* only — create-app has no build script, it's skipped) and publish
pnpm release
# 6. Push the commits and tags
git push --follow-tagsOnce published, anyone can run npx @studio-fes/create-fes-app without cloning this repo.
