Skip to content

Commit

Permalink
Clean generated files before build (#1576)
Browse files Browse the repository at this point in the history
Previously, generated GraphQL and block types were not removed before
the build. This caused when a GraphQL feature was removed in the API
(for instance, user permissions). To fix it, we now remove the generated
files in the clean script.
  • Loading branch information
johnnyomair authored Jan 16, 2024
1 parent bb2c76d commit 7036a8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/admin/cms-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "$npm_execpath run clean && run-p generate-graphql-types generate-block-types && run-p build:babel build:types",
"build:babel": "npx babel ./src -x \".ts,.tsx\" -d lib",
"build:types": "tsc --project ./tsconfig.build.json --emitDeclarationOnly",
"clean": "rimraf lib",
"clean": "rimraf lib 'src/**/*.generated.ts'",
"generate-block-types": "comet generate-block-types --inputs",
"generate-block-types:watch": "chokidar -s \"**/block-meta.json\" -c \"$npm_execpath generate-block-types\"",
"generate-graphql-types": "graphql-codegen",
Expand Down
2 changes: 1 addition & 1 deletion packages/site/cms-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"scripts": {
"build": "$npm_execpath run clean && npm run generate-block-types && tsc --project tsconfig.build.json",
"clean": "rimraf lib",
"clean": "rimraf lib 'src/**/*.generated.ts'",
"dev": "$npm_execpath generate-block-types && tsc --watch --preserveWatchOutput --project tsconfig.build.json",
"generate-block-types": "comet generate-block-types",
"generate-block-types:watch": "chokidar -s \"**/block-meta.json\" -c \"$npm_execpath generate-block-types\"",
Expand Down

0 comments on commit 7036a8d

Please sign in to comment.