Skip to content

Commit

Permalink
build: Add nuke script
Browse files Browse the repository at this point in the history
We often face situations where a build will fail because some cache somewhere
is messing up with the build. This PR adds a `nuke` script that can be used to
delete all files that might be out of date (i.e. node_modules, dist files, .turbo
cache, tsbuildinfo files, etc). It is a more destructive version from `clean`, which
doesn't touch e.g. node_modules.
  • Loading branch information
tomi committed Aug 30, 2024
1 parent 81f4322 commit 8661a8f
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 16 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dev": "turbo run dev --parallel --env-mode=loose --filter=!n8n-design-system --filter=!@n8n/chat",
"dev:ai": "turbo run dev --parallel --env-mode=loose --filter=@n8n/nodes-langchain --filter=n8n --filter=n8n-core",
"clean": "turbo run clean --parallel",
"nuke": "turbo run nuke --parallel",
"format": "turbo run format && node scripts/format.mjs",
"lint": "turbo run lint",
"lintfix": "turbo run lintfix",
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"benchmark-in-cloud": "pnpm benchmark --env cloud",
"benchmark-locally": "pnpm benchmark --env local",
"destroy-cloud-env": "zx scripts/destroyCloudEnv.mjs",
"watch": "concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\""
"watch": "concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\"",
"nuke": "rimraf .turbo dist node_modules tsconfig.tsbuildinfo"
},
"engines": {
"node": ">=20.10"
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"lintfix": "eslint . --ext .js,.ts,.vue --fix",
"format": "prettier --write src/",
"storybook": "storybook dev -p 6006 --no-open",
"build:storybook": "storybook build"
"build:storybook": "storybook build",
"nuke": "rimraf .turbo dist node_modules tmp"
},
"main": "./dist/chat.umd.js",
"module": "./dist/chat.es.js",
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/client-oauth2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lintfix": "eslint . --fix",
"watch": "tsc -p tsconfig.build.json --watch",
"test": "jest",
"test:dev": "jest --watch"
"test:dev": "jest --watch",
"nuke": "rimraf .turbo dist node_modules"
},
"main": "dist/index.js",
"module": "src/index.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/codemirror-lang/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"test": "jest",
"lint": "eslint . --ext .ts --quiet",
"lintfix": "eslint . --ext .ts --fix",
"format": "prettier --write --ignore-path ../../.prettierignore src test"
"format": "prettier --write --ignore-path ../../.prettierignore src test",
"nuke": "rimraf .turbo dist node_modules"
},
"peerDependencies": {
"@codemirror/language": "*",
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lintfix": "eslint . --fix",
"watch": "tsc -p tsconfig.build.json --watch",
"test": "jest",
"test:dev": "jest --watch"
"test:dev": "jest --watch",
"nuke": "rimraf .turbo dist node_modules"
},
"main": "dist/index.js",
"module": "src/index.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/imap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"lint": "eslint . --quiet",
"lintfix": "eslint . --fix",
"watch": "tsc -p tsconfig.build.json --watch",
"test": "jest"
"test": "jest",
"nuke": "rimraf .turbo dist node_modules"
},
"main": "dist/index.js",
"module": "src/index.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/nodes-langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"lintfix": "eslint nodes credentials --fix",
"watch": "tsc-watch -p tsconfig.build.json --onCompilationComplete \"tsc-alias -p tsconfig.build.json\" --onSuccess \"pnpm n8n-generate-ui-types\"",
"test": "jest",
"test:dev": "jest --watch"
"test:dev": "jest --watch",
"nuke": "rimraf .turbo dist node_modules"
},
"files": [
"dist"
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/permissions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lintfix": "eslint . --fix",
"watch": "tsc -p tsconfig.build.json --watch",
"test": "jest",
"test:dev": "jest --watch"
"test:dev": "jest --watch",
"nuke": "rimraf .turbo dist node_modules"
},
"main": "dist/index.js",
"module": "src/index.ts",
Expand Down
3 changes: 3 additions & 0 deletions packages/@n8n/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"@storybook/vue3-vite": "^8.1.4",
"chromatic": "^11.4.1",
"storybook": "^8.1.4"
},
"scripts": {
"nuke": "rimraf node_modules"
}
}
3 changes: 2 additions & 1 deletion packages/@n8n_io/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"scripts": {
"clean": "rimraf .turbo",
"test": "jest"
"test": "jest",
"nuke": "rimraf .turbo node_modules"
}
}
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"test:sqlite": "N8N_LOG_LEVEL=silent DB_TYPE=sqlite jest",
"test:postgres": "N8N_LOG_LEVEL=silent DB_TYPE=postgresdb DB_POSTGRESDB_SCHEMA=alt_schema DB_TABLE_PREFIX=test_ jest --no-coverage",
"test:mysql": "N8N_LOG_LEVEL=silent DB_TYPE=mysqldb DB_TABLE_PREFIX=test_ jest --no-coverage",
"watch": "concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\""
"watch": "concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\"",
"nuke": "rimraf .turbo dist node_modules"
},
"bin": {
"n8n": "./bin/n8n"
Expand Down
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lint": "eslint . --quiet",
"lintfix": "eslint . --fix",
"watch": "tsc -p tsconfig.build.json --watch",
"test": "jest"
"test": "jest",
"nuke": "rimraf .turbo dist node_modules"
},
"files": [
"dist",
Expand Down
3 changes: 2 additions & 1 deletion packages/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"chromatic": "chromatic",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"lint": "eslint src --ext .js,.ts,.vue --quiet",
"lintfix": "eslint src --ext .js,.ts,.vue --fix"
"lintfix": "eslint src --ext .js,.ts,.vue --fix",
"nuke": "rimraf .turbo dist node_modules"
},
"devDependencies": {
"@n8n/storybook": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/editor-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"format": "prettier --write . --ignore-path ../../.prettierignore",
"serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vite --host 0.0.0.0 --port 8080 dev",
"test": "vitest run",
"test:dev": "vitest"
"test:dev": "vitest",
"nuke": "rimraf .turbo dist node_modules"
},
"dependencies": {
"@codemirror/autocomplete": "^6.16.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/node-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"lint": "eslint . --quiet",
"lintfix": "eslint . --fix",
"prepack": "echo \"Building project...\" && rm -rf dist && tsc -b",
"watch": "tsc --watch"
"watch": "tsc --watch",
"nuke": "rimraf .turbo dist node_modules"
},
"bin": {
"n8n-node-dev": "./bin/n8n-node-dev"
Expand Down
3 changes: 2 additions & 1 deletion packages/nodes-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"lint": "eslint . --quiet && node ./scripts/validate-load-options-methods.js",
"lintfix": "eslint . --fix",
"watch": "tsc-watch -p tsconfig.build.json --onCompilationComplete \"tsc-alias -p tsconfig.build.json\" --onSuccess \"pnpm n8n-generate-ui-types\"",
"test": "jest"
"test": "jest",
"nuke": "rimraf .turbo dist node_modules"
},
"files": [
"dist"
Expand Down
3 changes: 2 additions & 1 deletion packages/workflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"lintfix": "eslint . --fix",
"watch": "tsc -p tsconfig.build.json --watch",
"test": "jest",
"test:dev": "jest --watch"
"test:dev": "jest --watch",
"nuke": "rimraf .turbo dist node_modules"
},
"files": [
"dist/**/*"
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"clean": {
"cache": false
},
"nuke": {
"cache": false
},
"build:backend": {
"dependsOn": ["n8n#build"]
},
Expand Down

0 comments on commit 8661a8f

Please sign in to comment.