create-three-blocks-starter
v0.0.14
Published
Create a new Three Blocks starter app
Maintainers
Readme
create-three-blocks-starter
Private CLI to scaffold a new project from the Three Blocks starter.
Usage
Authenticate to the private registry first (one time per project):
# Using pnpm (recommended - no warnings)
npx -y three-blocks-login@latest@latest --mode project --scope @three-blocks --channel stable
# Using npx (may show harmless npm config warnings)
npx -y three-blocks-login@latest --mode project --scope @three-blocks --channel stableNote: If you see npm warnings about unknown env configs, use
pnpm dlxinstead ofnpx, or see three-blocks-login NPM warnings fix.
Then scaffold a new app:
npm create @three-blocks/starter@latest my-app
# or
pnpm dlx create-three-blocks-starter my-appNext steps:
cd my-app
pnpm i
pnpm devCI/CD & Vercel Setup
The CLI now automatically generates the correct setup, but if you need to configure it manually:
Quick Setup (3 steps)
Commit
.npmrcto your repository (generated automatically by create-three-blocks-starter):@three-blocks:registry=https://three-blocks-196905988268.d.codeartifact.ap-northeast-1.amazonaws.com/npm/core/Preinstall script (added automatically by create-three-blocks-starter):
{ "scripts": { "preinstall": "npx -y three-blocks-login@latest" } }Set environment variable in your CI/CD platform:
- Vercel: Project Settings → Environment Variables → Add
THREE_BLOCKS_SECRET_KEY - GitHub Actions: Repository Settings → Secrets → Add
THREE_BLOCKS_SECRET_KEY - Other CI: Add
THREE_BLOCKS_SECRET_KEYsecret with your license key
- Vercel: Project Settings → Environment Variables → Add
How It Works
- Committed
.npmrctells pnpm WHERE to find packages (no auth needed yet) - Preinstall script fetches a short-lived token and adds it to
.npmrc - This solves pnpm's timing issue (it resolves packages before running preinstall)
Development (monorepo)
- The CLI pulls the template from
packages/three-blocks-starter/duringprepack. - To sync locally without publishing:
pnpm --filter create-three-blocks-starter run dev:syncPublish
npx -y three-blocks-login@latest --mode project --scope @three-blocks
pnpm --filter create-three-blocks-starter publish --access restricted