Skip to content

Applies to CLI v2.7.1Last updated

Automation

CI/CD

Every generated project can run its full quality gate with one command and already includes a GitHub Actions workflow for it. This page shows what you get, how to run the same checks elsewhere, and which CLI checks are worth adding.

One command for the quality gate

npm run ci runs the project's checks in order and stops at the first failure. fsd:check runs Steiger, which every template installs, so FSD layer and public-API rules are enforced from the first commit.

Frameworknpm run ci
React + Vitefsd:check → lint → build
Next.jscheck:template → fsd:check → lint → typecheck → build
Vue + Vitefsd:check → lint → build
Nuxtfsd:check → lint → typecheck → build
SvelteKitfsd:check → lint → typecheck → build

Included GitHub workflows

  • CI: on pushes to main and on pull requests, installs with npm ci, rejects whitespace errors, and runs npm run ci. Every template except Next.js also audits production dependencies.
  • Dependency security and Dependabot keep dependencies patched.
  • Vue, Nuxt, and SvelteKit include CodeQL. React and Vue add a commitlint check for pull requests, and React ships manually dispatched Auto-PR and labeler workflows.

Nothing publishes or deploys automatically. Review the workflows in .github/workflows and delete the ones you do not need.

Local Git hooks

Hooks stay light so commits stay fast: pre-commit checks whitespace, commit-msg enforces conventional commits, and heavier checks run in CI. Opt in to more locally, or bypass when needed:

bash
FSD_PRE_COMMIT_LINT=1 git commit -m "feat: add catalog"
FSD_PRE_PUSH_CHECKS=1 git push
HUSKY=0 git commit -m "docs: update guide"   # skip hooks once

Add CLI checks

Two CLI commands are useful in a pipeline. Both are read-only.

yaml
      - name: FSD architecture
        run: npx create-fsd-architecture@latest check --architecture

      - name: CLI upgrade status
        run: |
          set +e
          npx create-fsd-architecture@latest upgrade --check
          code=$?
          # 0 current, 2 upgrade available, 3 blocked by conflicts, 4 invalid
          if [ "$code" -eq 2 ]; then echo "::warning::A CLI upgrade is available"; exit 0; fi
          exit $code

The snippet treats an available upgrade as a warning and fails only on conflicts or an invalid project. See safe upgrades for what each state means.

Other CI providers

The gate is plain npm scripts, so any runner with Node.js 22 works. GitLab CI example:

yaml
# .gitlab-ci.yml
quality:
  image: node:22
  cache:
    paths: [.npm/]
  script:
    - npm ci --cache .npm --prefer-offline
    - npm run ci
    - npx create-fsd-architecture@latest check --architecture

With another package manager, install with its frozen-lockfile mode: pnpm install --frozen-lockfile, yarn install --immutable, or bun install --frozen-lockfile, then pnpm run ci, yarn ci, or bun run ci.

Deploying

Deployment depends on the framework's output (static files or a Node.js server). Connect the repository to your host and use npm run build as the build command.

Support FSD CLI

If FSD CLI helps you build, consider supporting its development and documentation. Donations are optional.

GitHub Sponsors (opens in a new tab)Buy Me a Coffee (opens in a new tab)

InstaPay · Egypt

ashrafmo-1

للدعم من مصر عبر إنستا باي. تأكد من بيانات المستلم قبل تأكيد التحويل.