create-larastack-app
v0.11.0
Published
Scaffold a Larastack-based monorepo with selectable frontend, backend, and mobile apps.
Downloads
360
Maintainers
Readme
create-larastack-app
Scaffold a Larastack-based monorepo from Liinkiing/larastack with selectable applications:
frontend(Next.js)backend(Laravel)mobile(Expo)
The CLI asks for:
- project folder
- application name
- included app folders (checkbox multiselect)
- mobile app identifier (required, when
mobileis selected) - GitHub username (auto-detected when possible)
- author (
John Doe <[email protected]>, auto-filled from git config when possible) - Expo EAS project ID (optional, when
mobileis selected)
It then customizes placeholders like Larastack, larastack, and liinkiing, updates mobile identifiers, removes unselected app folders, and can initialize a fresh git repository.
Template conditional file rules
The scaffold supports conditional file operations from a template manifest at:
.create-larastack/rules.json
Manifest format:
{
"$schema": "https://raw.githubusercontent.com/Liinkiing/create-larastack-app/master/schemas/rules.schema.json",
"version": 1,
"rules": [
{
"id": "remove-backend-personal-access-token-migration",
"when": {
"allOf": [{ "appNotSelected": "mobile" }]
},
"operations": [
{
"type": "remove",
"paths": ["backend/database/migrations/*personal_access_tokens*"]
}
]
}
]
}Schema file in this repo:
schemas/rules.schema.json
Supported operations:
remove: remove files or directories by relative path or globcopy: copy file/directory from one relative path to anothertransform: apply strict named codemods to a file path
Example transform operation:
{
"type": "transform",
"path": "backend/app/Models/User.php",
"transform": "php.user.applyProfile",
"options": {
"profile": "no-mobile"
}
}Transform ids are predefined by the CLI implementation and validated by schema. Current ids:
php.user.applyProfilephp.routes.api.applyProfilephp.routes.web.applyProfilephp.migration.users.applyProfilephp.config.services.applyProfileenv.backend.applyProfileyaml.graphql.syncProjectsjson.opencode.syncMcpjson.oxfmt.syncOverridestoml.codex.syncMcp
Canonical source for transform ids in code:
src/transformers/ids.ts
Transform option validation is also schema-enforced:
php.user.applyProfile,php.routes.api.applyProfile,php.migration.users.applyProfile,php.config.services.applyProfile,env.backend.applyProfilerequireoptions.profileinno-mobile | backend-onlyphp.routes.web.applyProfilerequiresoptions.profile = no-frontendyaml.graphql.syncProjects,json.opencode.syncMcp,json.oxfmt.syncOverrides, andtoml.codex.syncMcpdo not acceptoptions
Supported conditions:
appSelected: run when an app is selectedappNotSelected: run when an app is not selected
The .create-larastack folder is removed from generated projects after rules are applied.
Requirements
- Node.js
>=22 - Corepack enabled
- pnpm
>=10
corepack enable
corepack use [email protected]Usage
npx create-larastack-app@latestpnpm create larastack-appbun create larastack-appYou can also pass flags for non-interactive runs:
npx create-larastack-app@latest my-app \
--name "My App" \
--apps frontend,backend \
--author "John Doe <[email protected]>" \
--github-user mygithubCLI options
--name <name>: Application display name--apps <apps>: Comma-separated list offrontend,backend,mobile--app-identifier <id>: Mobile app identifier (required whenmobileis selected)--github-user <username>: GitHub username for owner/repository placeholders--author <author>: Author for package.json (John Doe <[email protected]>)--eas-project-id <id>: Expo EAS project ID (optional)--template-source <source>: Override template source (github:Liinkiing/larastackby default)--template-ref <ref>: Git reference for the template (masterby default)--no-git: Skipgit init
Local development
pnpm install
pnpm run lint
pnpm run typecheck
pnpm run format:check
pnpm run test
pnpm run buildRun locally:
node dist/cli.jsRelease
Releases are manual and run from GitHub Actions with release-it + Conventional Commits.
- Open Actions and run the
releaseworkflow. - Choose inputs:
bump:auto(recommended), or forcepatch,minor,majorprerelease:none,alpha,beta,rcdry-run:trueto preview,falseto publish
- Run it on
master.
The workflow lints, typechecks, format-checks, tests, builds, updates CHANGELOG.md, creates the release commit/tag, publishes to npm, and creates a GitHub release.
Important:
- Do not use local CLI release commands for real releases.
- Always trigger
.github/workflows/release.ymlso npm publish uses GitHub OIDC trusted publishing. - Local
pnpm run release:dryis only for debugging.
Conventional Commit bump rules:
fix:-> patchfeat:-> minorBREAKING CHANGE:(or!) -> major
If commits are only non-releasable types (chore:, docs:, test:...), use the workflow bump input to force a release.
For npm auth, this project uses npm Trusted Publishing (OIDC) in .github/workflows/release.yml.
Because the package name is create-larastack-app, users can run the short create commands:
pnpm create larastack-appbun create larastack-app
