diff --git a/packages/create-rstack/README.md b/packages/create-rstack/README.md index e41dc6d7..56d4f8a4 100644 --- a/packages/create-rstack/README.md +++ b/packages/create-rstack/README.md @@ -50,6 +50,7 @@ npx create-rstack --dir my-project --template app-vanilla-ts --no-git - `lib-solid-ts` - TypeScript Solid library - `doc` - Basic documentation site - `doc-i18n` - Multilingual documentation site +- `pnpm` - pnpm workspace - `turborepo` - Turborepo - `nx` - Nx diff --git a/packages/create-rstack/src/index.ts b/packages/create-rstack/src/index.ts index a925e197..26a9a661 100644 --- a/packages/create-rstack/src/index.ts +++ b/packages/create-rstack/src/index.ts @@ -43,6 +43,7 @@ const templateNames = [ 'lib-solid-ts', 'doc', 'doc-i18n', + 'pnpm', 'turborepo', 'nx', ]; @@ -57,7 +58,7 @@ const resolveTemplateName = (template: string): string => { const getTemplateName = async ({ template }: Argv): Promise => { if (typeof template === 'string') { - if (/^(?:app|lib|doc|turborepo|nx)(?:-|$)/u.test(template)) { + if (/^(?:app|lib|doc|pnpm|turborepo|nx)(?:-|$)/u.test(template)) { return resolveTemplateName(template); } @@ -81,6 +82,7 @@ const getTemplateName = async ({ template }: Argv): Promise => { await select({ message: 'Select monorepo tool', options: [ + { value: 'pnpm', label: 'pnpm workspace' }, { value: 'turborepo', label: 'Turborepo', hint: 'pnpm' }, { value: 'nx', label: 'Nx', hint: 'pnpm' }, ], @@ -239,6 +241,6 @@ await create({ builtinTools: [], getTemplateName, getPackageManager: ({ templateName }) => - ['turborepo', 'nx'].includes(templateName) ? 'pnpm' : undefined, + ['pnpm', 'turborepo', 'nx'].includes(templateName) ? 'pnpm' : undefined, onGitResolved: injectStagedSetup, }); diff --git a/packages/create-rstack/template-pnpm/README.md b/packages/create-rstack/template-pnpm/README.md new file mode 100644 index 00000000..7ee61969 --- /dev/null +++ b/packages/create-rstack/template-pnpm/README.md @@ -0,0 +1,33 @@ +# pnpm workspace + Rstack + +## Setup + +```bash +pnpm install +``` + +## Structure + +- `apps/web`: React application. +- `packages/ui`: Shared UI components. +- `tsconfig.base.json`: Shared TypeScript configuration. + +## Scripts + +Run from the repository root: + +- `pnpm run build`: Build all packages in dependency order. +- `pnpm run dev`: Build shared packages, then start the web app and watch the shared UI package. +- `pnpm run test`: Build shared packages, then run tests. +- `pnpm run check`: Run lint, formatting, and TypeScript checks. +- `pnpm run lint`: Lint the workspace. +- `pnpm run format`: Format the workspace. + +Run `pnpm run build` before `pnpm run check`. + +Use `pnpm --filter