From 0c3eec879a8a85266ea2a005b8fe67b4b906e1ff Mon Sep 17 00:00:00 2001 From: Alan Smithee Date: Tue, 5 Mar 2024 14:29:43 +0100 Subject: [PATCH 1/3] add a script to clean up db output and run it before build script --- chess/db/package.json | 3 ++- hex-battle/backend/db/package.json | 3 ++- nft-lvlup/db/package.json | 3 ++- open-world/db/package.json | 3 ++- paima-dice/db/package.json | 3 ++- rock-paper-scissors/db/package.json | 5 +++-- trading-cards/db/package.json | 3 ++- web-2.5/db/package.json | 3 ++- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/chess/db/package.json b/chess/db/package.json index 8dce3586..cb477983 100644 --- a/chess/db/package.json +++ b/chess/db/package.json @@ -6,7 +6,8 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/hex-battle/backend/db/package.json b/hex-battle/backend/db/package.json index 1b81bfcf..5402409d 100644 --- a/hex-battle/backend/db/package.json +++ b/hex-battle/backend/db/package.json @@ -6,7 +6,8 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/nft-lvlup/db/package.json b/nft-lvlup/db/package.json index 4fe66042..b313a5f7 100644 --- a/nft-lvlup/db/package.json +++ b/nft-lvlup/db/package.json @@ -6,7 +6,8 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/open-world/db/package.json b/open-world/db/package.json index 70ddd183..6fbb7931 100644 --- a/open-world/db/package.json +++ b/open-world/db/package.json @@ -6,7 +6,8 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/paima-dice/db/package.json b/paima-dice/db/package.json index 312d1517..6872a453 100644 --- a/paima-dice/db/package.json +++ b/paima-dice/db/package.json @@ -6,7 +6,8 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/rock-paper-scissors/db/package.json b/rock-paper-scissors/db/package.json index be1e56fa..82d85568 100644 --- a/rock-paper-scissors/db/package.json +++ b/rock-paper-scissors/db/package.json @@ -6,7 +6,8 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, @@ -21,4 +22,4 @@ "@types/pg": "^8.10.9", "tsc-alias": "^1.8.8" } -} +} \ No newline at end of file diff --git a/trading-cards/db/package.json b/trading-cards/db/package.json index a260eb0f..47c70250 100644 --- a/trading-cards/db/package.json +++ b/trading-cards/db/package.json @@ -6,7 +6,8 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/web-2.5/db/package.json b/web-2.5/db/package.json index 713f5298..82d85568 100644 --- a/web-2.5/db/package.json +++ b/web-2.5/db/package.json @@ -6,7 +6,8 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, From 8e1740bbbecee4b2460f1872b09610a13858ecdc Mon Sep 17 00:00:00 2001 From: Alan Smithee Date: Wed, 6 Mar 2024 10:11:48 +0100 Subject: [PATCH 2/3] use wipe.sh --- chess/db/package.json | 2 +- hex-battle/backend/db/package.json | 2 +- nft-lvlup/db/package.json | 2 +- open-world/db/package.json | 2 +- paima-dice/db/package.json | 2 +- rock-paper-scissors/db/package.json | 2 +- trading-cards/db/package.json | 2 +- web-2.5/db/package.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/chess/db/package.json b/chess/db/package.json index cb477983..a10bc9c8 100644 --- a/chess/db/package.json +++ b/chess/db/package.json @@ -6,7 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "clean": "sh ../scripts/wipe.sh", "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" diff --git a/hex-battle/backend/db/package.json b/hex-battle/backend/db/package.json index 5402409d..88987309 100644 --- a/hex-battle/backend/db/package.json +++ b/hex-battle/backend/db/package.json @@ -6,7 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "clean": "sh ../scripts/wipe.sh", "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" diff --git a/nft-lvlup/db/package.json b/nft-lvlup/db/package.json index b313a5f7..f176980b 100644 --- a/nft-lvlup/db/package.json +++ b/nft-lvlup/db/package.json @@ -6,7 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "clean": "sh ../scripts/wipe.sh", "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" diff --git a/open-world/db/package.json b/open-world/db/package.json index 6fbb7931..7b1ec42c 100644 --- a/open-world/db/package.json +++ b/open-world/db/package.json @@ -6,7 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "clean": "sh ../scripts/wipe.sh", "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" diff --git a/paima-dice/db/package.json b/paima-dice/db/package.json index 6872a453..195b937f 100644 --- a/paima-dice/db/package.json +++ b/paima-dice/db/package.json @@ -6,7 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "clean": "sh ../scripts/wipe.sh", "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" diff --git a/rock-paper-scissors/db/package.json b/rock-paper-scissors/db/package.json index 82d85568..027181de 100644 --- a/rock-paper-scissors/db/package.json +++ b/rock-paper-scissors/db/package.json @@ -6,7 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "clean": "sh ../scripts/wipe.sh", "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" diff --git a/trading-cards/db/package.json b/trading-cards/db/package.json index 47c70250..c7925a7c 100644 --- a/trading-cards/db/package.json +++ b/trading-cards/db/package.json @@ -6,7 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "clean": "sh ../scripts/wipe.sh", "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" diff --git a/web-2.5/db/package.json b/web-2.5/db/package.json index 82d85568..027181de 100644 --- a/web-2.5/db/package.json +++ b/web-2.5/db/package.json @@ -6,7 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "rm -rf tsconfig.tsbuildinfo & rm -rf build", + "clean": "sh ../scripts/wipe.sh", "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" From e218927cc8dc4f80c17bf7d5869960f92192b1fc Mon Sep 17 00:00:00 2001 From: Alan Smithee Date: Sun, 10 Mar 2024 18:07:40 +0100 Subject: [PATCH 3/3] call wipe.sh from root package, and do not run it before build in db package --- chess/db/package.json | 3 +-- chess/package.json | 3 ++- generic/package.json | 1 + hex-battle/backend/db/package.json | 3 +-- hex-battle/backend/package.json | 1 + nft-lvlup/db/package.json | 3 +-- nft-lvlup/package.json | 3 ++- open-world/db/package.json | 3 +-- open-world/package.json | 1 + paima-dice/db/package.json | 3 +-- paima-dice/package.json | 1 + rock-paper-scissors/db/package.json | 3 +-- rock-paper-scissors/package.json | 3 ++- trading-cards/db/package.json | 3 +-- trading-cards/package.json | 3 ++- web-2.5/db/package.json | 3 +-- web-2.5/package.json | 1 + 17 files changed, 21 insertions(+), 20 deletions(-) diff --git a/chess/db/package.json b/chess/db/package.json index a10bc9c8..8dce3586 100644 --- a/chess/db/package.json +++ b/chess/db/package.json @@ -6,8 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "sh ../scripts/wipe.sh", - "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/chess/package.json b/chess/package.json index 244391cd..d8096f3f 100644 --- a/chess/package.json +++ b/chess/package.json @@ -9,6 +9,7 @@ "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "sh scripts/pack.sh", "pack:middleware": "npm run build -w middleware/", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .", @@ -72,4 +73,4 @@ "typescript": "^5.3.3" } } -} +} \ No newline at end of file diff --git a/generic/package.json b/generic/package.json index bfb446a3..1494e821 100644 --- a/generic/package.json +++ b/generic/package.json @@ -9,6 +9,7 @@ "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "sh scripts/pack.sh", "pack:middleware": "npm run build -w middleware/", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .", diff --git a/hex-battle/backend/db/package.json b/hex-battle/backend/db/package.json index 88987309..1b81bfcf 100644 --- a/hex-battle/backend/db/package.json +++ b/hex-battle/backend/db/package.json @@ -6,8 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "sh ../scripts/wipe.sh", - "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/hex-battle/backend/package.json b/hex-battle/backend/package.json index 4014c7fb..96cf8fca 100644 --- a/hex-battle/backend/package.json +++ b/hex-battle/backend/package.json @@ -9,6 +9,7 @@ "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "sh scripts/pack.sh", "pack:middleware": "npm run build -w middleware/", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .", diff --git a/nft-lvlup/db/package.json b/nft-lvlup/db/package.json index f176980b..4fe66042 100644 --- a/nft-lvlup/db/package.json +++ b/nft-lvlup/db/package.json @@ -6,8 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "sh ../scripts/wipe.sh", - "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/nft-lvlup/package.json b/nft-lvlup/package.json index 9a69c78a..bc7e30a7 100644 --- a/nft-lvlup/package.json +++ b/nft-lvlup/package.json @@ -6,6 +6,7 @@ "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "sh scripts/pack.sh", "pack:middleware": "npm run build -w middleware/", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .", @@ -62,4 +63,4 @@ "@paima/sdk": "2.2.0", "@paima/node-sdk": "2.2.0" } -} +} \ No newline at end of file diff --git a/open-world/db/package.json b/open-world/db/package.json index 7b1ec42c..70ddd183 100644 --- a/open-world/db/package.json +++ b/open-world/db/package.json @@ -6,8 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "sh ../scripts/wipe.sh", - "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/open-world/package.json b/open-world/package.json index 6913f7e4..3e0c0e9d 100644 --- a/open-world/package.json +++ b/open-world/package.json @@ -9,6 +9,7 @@ "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "sh scripts/pack.sh", "pack:middleware": "npm run build -w middleware/", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .", diff --git a/paima-dice/db/package.json b/paima-dice/db/package.json index 195b937f..312d1517 100644 --- a/paima-dice/db/package.json +++ b/paima-dice/db/package.json @@ -6,8 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "sh ../scripts/wipe.sh", - "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/paima-dice/package.json b/paima-dice/package.json index dfb4d466..41b96b60 100644 --- a/paima-dice/package.json +++ b/paima-dice/package.json @@ -9,6 +9,7 @@ "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "sh scripts/pack.sh", "pack:middleware": "npm run build -w middleware/", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .", diff --git a/rock-paper-scissors/db/package.json b/rock-paper-scissors/db/package.json index 027181de..713f5298 100644 --- a/rock-paper-scissors/db/package.json +++ b/rock-paper-scissors/db/package.json @@ -6,8 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "sh ../scripts/wipe.sh", - "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/rock-paper-scissors/package.json b/rock-paper-scissors/package.json index 9eeccc31..f42b8dd2 100644 --- a/rock-paper-scissors/package.json +++ b/rock-paper-scissors/package.json @@ -8,6 +8,7 @@ "scripts": { "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "npm run build && sh scripts/pack.sh", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .", @@ -73,4 +74,4 @@ "typescript": "^5.3.3" } } -} +} \ No newline at end of file diff --git a/trading-cards/db/package.json b/trading-cards/db/package.json index c7925a7c..a260eb0f 100644 --- a/trading-cards/db/package.json +++ b/trading-cards/db/package.json @@ -6,8 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "sh ../scripts/wipe.sh", - "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/trading-cards/package.json b/trading-cards/package.json index b96a9ced..51878253 100644 --- a/trading-cards/package.json +++ b/trading-cards/package.json @@ -9,6 +9,7 @@ "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "sh scripts/pack.sh", "pack:middleware": "npm run build -w middleware/", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .", @@ -75,4 +76,4 @@ "typescript": "^5.3.3" } } -} +} \ No newline at end of file diff --git a/web-2.5/db/package.json b/web-2.5/db/package.json index 027181de..713f5298 100644 --- a/web-2.5/db/package.json +++ b/web-2.5/db/package.json @@ -6,8 +6,7 @@ "types": "build/index.d.ts", "type": "module", "scripts": { - "clean": "sh ../scripts/wipe.sh", - "build": "npm run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json", + "build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1", "compile": "npx pgtyped -w -c pgtypedconfig.json" }, diff --git a/web-2.5/package.json b/web-2.5/package.json index b03b27c7..248b0acc 100644 --- a/web-2.5/package.json +++ b/web-2.5/package.json @@ -9,6 +9,7 @@ "initialize": "npm ci && cp .env.example ../.env.localhost && cp extensions.yml ../extensions.yml", "pack": "sh scripts/pack.sh", "pack:middleware": "npm run build -w middleware/", + "clean": "sh scripts/wipe.sh", "build": "npx tsc --build tsconfig.build.json", "lint": "eslint --ext ts,tsx --ignore-path .gitignore .", "lint:fix": "eslint --ext ts,tsx --ignore-path .gitignore --fix .",