diff --git a/.github/workflows/factory.yml b/.github/workflows/factory.yml index 8e1bace..a9c2d5c 100644 --- a/.github/workflows/factory.yml +++ b/.github/workflows/factory.yml @@ -48,6 +48,9 @@ jobs: - fresh-vite-app-vue - fresh-vite-app - fresh-vitepress-site + - fresh-viteplus-app + - fresh-viteplus-lib + - fresh-viteplus-monorepo - fresh-vscode-extension - fresh-vscode-web-extension diff --git a/CLAUDE.md b/CLAUDE.md index a60c671..c34892a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,4 +1,11 @@ -# TypeScript Project Guidelines +# Fresh App Factory Project Guidelines + +## Creating and Updating Generators + +1. Look at existing generators in `src/generators/` to see the pattern. Notice how Corepack is used to pin pnpm version, etc. Especially consult similar generator +2. Create/update the generator file +3. Test the generator with `bin/run ` and inspect the generated files at `workspace/fresh-app/` +4. In case of adding new generator, update `.github/workflows/factory.yml` to add the new generator to the list ## Build & Run Commands diff --git a/src/generators/fresh-viteplus-app.ts b/src/generators/fresh-viteplus-app.ts new file mode 100644 index 0000000..c0f8af2 --- /dev/null +++ b/src/generators/fresh-viteplus-app.ts @@ -0,0 +1,20 @@ +import { defineGenerator } from '../defineGenerator' + +export default defineGenerator({ + command: [ + 'curl -fsSL https://vite.plus | CI=true bash', + 'export PATH="$HOME/.vite-plus/bin:$PATH"', + 'vp create vite:application --directory fresh-app --no-interactive', + 'cd fresh-app', + 'vp install', + 'vp build', + ].join('\n'), + displayedCommand: 'vp create vite:application', + description: 'Fresh Vite+ app', + framework: { + name: 'Vite+', + url: 'https://viteplus.dev/', + documentationUrl: 'https://viteplus.dev/guide/', + }, + staticOutputDirectory: 'dist', +}) diff --git a/src/generators/fresh-viteplus-lib.ts b/src/generators/fresh-viteplus-lib.ts new file mode 100644 index 0000000..1069e43 --- /dev/null +++ b/src/generators/fresh-viteplus-lib.ts @@ -0,0 +1,20 @@ +import { defineGenerator } from '../defineGenerator' + +export default defineGenerator({ + command: [ + 'curl -fsSL https://vite.plus | CI=true bash', + 'export PATH="$HOME/.vite-plus/bin:$PATH"', + 'vp create vite:library --directory fresh-app --no-interactive', + 'cd fresh-app', + 'vp install', + 'vp pack', + ].join('\n'), + displayedCommand: 'vp create vite:library', + description: 'Fresh Vite+ library', + framework: { + name: 'Vite+', + url: 'https://viteplus.dev/', + documentationUrl: 'https://viteplus.dev/guide/', + }, + staticOutputDirectory: 'dist', +}) diff --git a/src/generators/fresh-viteplus-monorepo.ts b/src/generators/fresh-viteplus-monorepo.ts new file mode 100644 index 0000000..29e3c2c --- /dev/null +++ b/src/generators/fresh-viteplus-monorepo.ts @@ -0,0 +1,20 @@ +import { defineGenerator } from '../defineGenerator' + +export default defineGenerator({ + command: [ + 'curl -fsSL https://vite.plus | CI=true bash', + 'export PATH="$HOME/.vite-plus/bin:$PATH"', + 'vp create vite:monorepo --directory fresh-app --no-interactive', + 'cd fresh-app', + 'vp install', + 'vp build apps/website', + ].join('\n'), + displayedCommand: 'vp create vite:monorepo', + description: 'Fresh Vite+ monorepo', + framework: { + name: 'Vite+', + url: 'https://viteplus.dev/', + documentationUrl: 'https://viteplus.dev/guide/', + }, + staticOutputDirectory: 'apps/website/dist', +})