Skip to content

Commit 77c7b07

Browse files
authored
refactor: Incl. generated code (protos, what not) in clean scripts; stop tracking sdk's generated config validator (#3292)
This pull request standardizes and improves the cleaning process across several packages by ensuring that generated code directories are consistently removed by the `clean` script. It also updates the `.gitignore` in the SDK package to match the new generated code structure. ### Changes **Build and clean script improvements:** * Updated the `clean` script in the following `package.json` files to remove the `generated` or `src/generated` directories, ensuring that all generated code is properly cleaned: - [`packages/autocertifier-client/package.json`](diffhunk://#diff-ce36aa2971623458d0b35543ec3caf4e8df12445e570d4c599e3142a79b87de5L24-R24): Now removes `generated` directory. - [`packages/dht/package.json`](diffhunk://#diff-48deceddbbe98a41ff1d0f560db132548031fbd96d790c09ffeed924a20e8a05L30-R30): Now removes `generated` directory. - [`packages/proto-rpc/package.json`](diffhunk://#diff-e81a3463e3e75e879c7fa17b1609d29d02bb633aaceb777564c9f88a48729ff9L25-R25): Now removes `generated` directory. - [`packages/trackerless-network/package.json`](diffhunk://#diff-e73f8b6abf767f5f6271d1dcbf5188b40d63732e6a8cd772b44f677c2fc36bc1L25-R25): Now removes `generated` directory. - [`packages/sdk/package.json`](diffhunk://#diff-77164cc5c071d1488e1cf72c0f91fdd99dd8976edb5004c83198bbd517039572L40-R40): Now removes `src/generated` directory. **`.gitignore` update:** * Updated `packages/sdk/.gitignore` to ignore the entire `src/generated` directory instead of individual subdirectories, aligning it with the new cleaning behavior.
1 parent 924ecf2 commit 77c7b07

File tree

8 files changed

+7
-8
lines changed

8 files changed

+7
-8
lines changed

packages/autocertifier-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"prebuild": "./proto.sh",
2020
"build": "tsc -b",
2121
"check": "tsc --noEmit",
22-
"clean": "rm -rf dist *.tsbuildinfo node_modules/.cache || true",
22+
"clean": "rm -rf dist generated *.tsbuildinfo node_modules/.cache || true",
2323
"eslint": "eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'"
2424
},
2525
"dependencies": {

packages/dht/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"build": "tsc -b",
2828
"build-browser": "webpack --mode=development --progress",
2929
"check": "tsc -p tsconfig.jest.json",
30-
"clean": "jest --clearCache || true; rm -rf dist *.tsbuildinfo node_modules/.cache || true",
30+
"clean": "jest --clearCache || true; rm -rf dist generated *.tsbuildinfo node_modules/.cache || true",
3131
"eslint": "eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'",
3232
"test": "npm run test-unit && npm run test-integration && npm run test-end-to-end",
3333
"test-browser": "karma start karma.config.ts",

packages/proto-rpc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"build": "tsc -b",
2323
"build-browser": "webpack --mode=development --progress",
2424
"check": "./test-proto.sh && tsc -p tsconfig.jest.json",
25-
"clean": "jest --clearCache || true; rm -rf dist *.tsbuildinfo node_modules/.cache || true",
25+
"clean": "jest --clearCache || true; rm -rf dist generated *.tsbuildinfo node_modules/.cache || true",
2626
"eslint": "./test-proto.sh && eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'",
2727
"test": "./test-proto.sh && npm run test-unit && npm run test-integration",
2828
"test-browser": "./test-proto.sh && karma start karma.config.ts",

packages/sdk/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,4 @@ test/exports/dist
4242
test/exports/package-lock.json
4343
docs
4444

45-
src/generated/packages
46-
src/generated/google
45+
src/generated

packages/sdk/bin/generate-config-validator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ ajv.addFormat('ethereum-address', /^0x[a-fA-F0-9]{40}$/)
2929

3030
const validate = ajv.compile(CONFIG_SCHEMA)
3131
const moduleCode = standaloneCode(ajv, validate)
32+
fs.mkdirSync(path.join(__dirname, '../src/generated'), { recursive: true })
3233
fs.writeFileSync(path.join(__dirname, '../src/generated/validateConfig.js'), moduleCode)

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"build-browser-development": "NODE_ENV=development webpack --mode=development --progress",
3838
"build-browser-production": "NODE_ENV=production webpack --mode=production --progress",
3939
"check": "tsc -p tsconfig.jest.json",
40-
"clean": "jest --clearCache || true; rm -rf dist *.tsbuildinfo node_modules/.cache || true",
40+
"clean": "jest --clearCache || true; rm -rf dist src/generated *.tsbuildinfo node_modules/.cache || true",
4141
"eslint": "eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts,mts}'",
4242
"generate-protoc-code": "./proto.sh",
4343
"test": "npm run test-unit && npm run test-integration && npm run test-end-to-end",

packages/sdk/src/generated/validateConfig.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/trackerless-network/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"build-browser": "webpack --mode=development --progress",
2222
"prebuild": "./proto.sh",
2323
"check": "tsc -p tsconfig.jest.json",
24-
"clean": "jest --clearCache || true; rm -rf dist *.tsbuildinfo node_modules/.cache || true",
24+
"clean": "jest --clearCache || true; rm -rf dist generated *.tsbuildinfo node_modules/.cache || true",
2525
"coverage": "jest --coverage",
2626
"eslint": "eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'",
2727
"test": "npm run test-unit && npm run test-integration && npm run test-end-to-end",

0 commit comments

Comments
 (0)