Fix codegen (#434)

This commit is contained in:
Zai Shi 2025-02-12 02:07:30 +01:00 committed by GitHub
parent 987119ded8
commit 4c4f557ff2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 27 additions and 15 deletions

View File

@ -14,7 +14,7 @@
"build:demo": "pnpm pre && turbo run build --filter=demo-app...",
"build:packages": "pnpm pre && turbo run build --filter=./packages/*",
"clean": "pnpm pre && turbo run clean && rimraf --glob **/.next && rimraf --glob **/.turbo && rimraf .turbo && rimraf --glob **/node_modules",
"codegen": "pnpm pre && turbo run codegen",
"codegen": "pnpm pre && turbo run codegen && pnpm run generate-from-template",
"deps-compose": "docker compose -p stack-dependencies -f dependencies.compose.yaml",
"stop-deps": "POSTGRES_DELAY_MS=0 pnpm run deps-compose kill && POSTGRES_DELAY_MS=0 pnpm run deps-compose down -v",
"init-db": "pnpm pre && pnpm run prisma db push && pnpm run prisma db seed",
@ -41,7 +41,8 @@
"verify-data-integrity": "pnpm pre && pnpm -C apps/backend run verify-data-integrity",
"generate-docs": "pnpm pre && turbo run generate-docs",
"generate-keys": "pnpm pre && turbo run generate-keys",
"generate-from-template:watch": "chokidar --silent -c 'npx --package=ts-node ts-node ./scripts/generate-from-template.ts' './packages/template' --ignore './packages/template/package.json' --ignore '**/node_modules/**' --ignore '**/dist/**' --ignore '**/.turbo/**' --throttle 2000"
"generate-from-template": "npx --package=ts-node ts-node ./scripts/generate-from-template.ts",
"generate-from-template:watch": "chokidar --silent -c 'pnpm run generate-from-template' './packages/template' --ignore './packages/template/package.json' --ignore '**/node_modules/**' --ignore '**/dist/**' --ignore '**/.turbo/**' --throttle 2000"
},
"devDependencies": {
"@changesets/cli": "^2.27.9",

View File

@ -21,8 +21,15 @@
"typecheck": "tsc --noEmit",
"clean": "rimraf dist && rimraf node_modules",
"lint": "eslint --ext .tsx,.ts .",
"build": "rimraf dist && tsup-node",
"dev": "rimraf dist && tsup-node --watch"
"build": "rimraf dist && pnpm run css && tsup-node",
"dev": "rimraf dist && concurrently -n \"build,codegen\" -k \"tsup-node --watch\" \"pnpm run codegen:watch\"",
"codegen": "pnpm run css",
"css": "pnpm run css-tw && pnpm run css-sc",
"css:watch": "concurrently -n \"tw,sc\" -k \"pnpm run css-tw:watch\" \"pnpm run css-sc:watch\"",
"css-tw:watch": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css --watch",
"css-tw": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css",
"css-sc": "tsx ./scripts/process-css.ts ./src/generated/tailwind.css ./src/generated/global-css.ts",
"css-sc:watch": "chokidar --silent './src/generated/tailwind.css' -c 'pnpm run css-sc' --throttle 2000"
},
"files": [
"README.md",

View File

@ -30,23 +30,27 @@
"clean": "rimraf dist && rimraf node_modules",
"lint": "eslint --ext .tsx,.ts .",
"//": "IF_PLATFORM template",
"//": "IF_PLATFORM template react-like",
"build": "rimraf dist && pnpm run css && tsup-node",
"dev": "rimraf dist && concurrently -n \"build,codegen\" -k \"tsup-node --watch\" \"pnpm run codegen:watch\""
,"//": "ELSE_PLATFORM"
"dev": "rimraf dist && concurrently -n \"build,codegen\" -k \"tsup-node --watch\" \"pnpm run codegen:watch\"",
"codegen": "pnpm run css"
,"//": "ELSE_PLATFORM",
"build": "rimraf dist && tsup-node",
"dev": "rimraf dist && tsup-node --watch"
,"//": "END_PLATFORM"
"//": "IF_PLATFORM template react-like",
,"css": "pnpm run css-tw && pnpm run css-sc",
"css:watch": "concurrently -n \"tw,sc\" -k \"pnpm run css-tw:watch\" \"pnpm run css-sc:watch\"",
"css-tw:watch": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css --watch",
"css-tw": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css",
"css-sc": "tsx ./scripts/process-css.ts ./src/generated/tailwind.css ./src/generated/global-css.ts",
"css-sc:watch": "chokidar --silent './src/generated/tailwind.css' -c 'pnpm run css-sc' --throttle 2000"
,"//": "END_PLATFORM"
"//": "IF_PLATFORM template",
,"codegen": "pnpm run css && pnpm run quetzal",
"codegen:watch": "concurrently -n \"css,quetzal\" -k \"pnpm run css:watch\" \"pnpm run quetzal:watch\"",
"css": "pnpm run css-tw && pnpm run css-sc",
"css:watch": "concurrently -n \"tw,sc\" -k \"pnpm run css-tw:watch\" \"pnpm run css-sc:watch\"",
"css-tw:watch": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css --watch",
"css-tw": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css",
"css-sc": "tsx ./scripts/process-css.ts ./src/generated/tailwind.css ./src/generated/global-css.ts",
"css-sc:watch": "chokidar --silent './src/generated/tailwind.css' -c 'pnpm run css-sc' --throttle 2000",
"override-env-local-for-quetzal": "echo \"\\n$STACK_ENV_LOCAL_PACKAGE_BUILD_OVERRIDE_FOR_QUETZAL\\n\" >> .env.local",
"quetzal": "rimraf quetzal-translations && pnpm run override-env-local-for-quetzal && quetzal-process-translations && tsx ./scripts/merge-quetzal-translations.ts",
"quetzal:ignore-errors": "pnpm run quetzal || echo Quetzal failed, probably because the API key is missing. We will just ignore it",

View File

@ -25,13 +25,13 @@
"build": "rimraf dist && pnpm run css && tsup-node",
"dev": "rimraf dist && concurrently -n \"build,codegen\" -k \"tsup-node --watch\" \"pnpm run codegen:watch\"",
"codegen": "pnpm run css && pnpm run quetzal",
"codegen:watch": "concurrently -n \"css,quetzal\" -k \"pnpm run css:watch\" \"pnpm run quetzal:watch\"",
"css": "pnpm run css-tw && pnpm run css-sc",
"css:watch": "concurrently -n \"tw,sc\" -k \"pnpm run css-tw:watch\" \"pnpm run css-sc:watch\"",
"css-tw:watch": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css --watch",
"css-tw": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css",
"css-sc": "tsx ./scripts/process-css.ts ./src/generated/tailwind.css ./src/generated/global-css.ts",
"css-sc:watch": "chokidar --silent './src/generated/tailwind.css' -c 'pnpm run css-sc' --throttle 2000",
"codegen:watch": "concurrently -n \"css,quetzal\" -k \"pnpm run css:watch\" \"pnpm run quetzal:watch\"",
"override-env-local-for-quetzal": "echo \"\\n$STACK_ENV_LOCAL_PACKAGE_BUILD_OVERRIDE_FOR_QUETZAL\\n\" >> .env.local",
"quetzal": "rimraf quetzal-translations && pnpm run override-env-local-for-quetzal && quetzal-process-translations && tsx ./scripts/merge-quetzal-translations.ts",
"quetzal:ignore-errors": "pnpm run quetzal || echo Quetzal failed, probably because the API key is missing. We will just ignore it",

View File

@ -488,7 +488,7 @@ generateFromTemplate({
editFn: (path, content) => {
// ignore the generated folder as the files are big and not needed
if (path.startsWith('src/generated')) {
return content;
return null;
}
content = processMacros(content, ["next", "react-like"]);