Skip to content

Commit c572ec2

Browse files
authored
refactor: move to a monorepo config (#131)
* basic monorepo setup * fix lint workflow * fix integration test workflow * ignore header checker for lock file * add lock file * fix adk files * fix package file * fix file * add empty index file * update lock file * fix adk lint * remove package lock files
1 parent 4e97c37 commit c572ec2

25 files changed

+5501
-9210
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
**/node_modules
2-
build/
2+
**/build

.github/header-checker-lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ sourceFileExtensions:
3030
- "text"
3131
- "js"
3232
- "ts"
33+
ignoreFiles:
34+
- "pnpm-lock.yaml"

.github/workflows/lint-toolbox-adk.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ jobs:
3232
concurrency:
3333
group: ${{ github.workflow }}-${{ github.ref }}
3434
cancel-in-progress: true
35-
defaults:
36-
run:
37-
working-directory: ./packages/toolbox-adk
3835
permissions:
3936
contents: 'read'
4037
issues: 'write'
@@ -66,7 +63,11 @@ jobs:
6663
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
6764
with:
6865
node-version: 22.16.0
69-
- name: Install package
70-
run: npm ci
66+
- name: Install pnpm
67+
uses: pnpm/action-setup@v3
68+
with:
69+
version: 9
70+
- name: Install dependencies
71+
run: pnpm install --frozen-lockfile
7172
- name: Run linter
72-
run: npm run lint
73+
run: pnpm --filter @toolbox-sdk/adk run lint

.github/workflows/lint-toolbox-core.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
name: core
1516
on:
1617
pull_request:
@@ -31,9 +32,6 @@ jobs:
3132
concurrency:
3233
group: ${{ github.workflow }}-${{ github.ref }}
3334
cancel-in-progress: true
34-
defaults:
35-
run:
36-
working-directory: ./packages/toolbox-core
3735
permissions:
3836
contents: 'read'
3937
issues: 'write'
@@ -65,7 +63,11 @@ jobs:
6563
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
6664
with:
6765
node-version: 22.16.0
68-
- name: Install package
69-
run: npm ci
66+
- name: Install pnpm
67+
uses: pnpm/action-setup@v3
68+
with:
69+
version: 9
70+
- name: Install dependencies
71+
run: pnpm install --frozen-lockfile
7072
- name: Run linter
71-
run: npm run lint
73+
run: pnpm --filter @toolbox-sdk/core run lint

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
*node_modules*
2-
*build*
3-
*coverage*
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
build/
6+
7+
# Coverage
8+
coverage/
File renamed without changes.

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "toolbox-js-sdks",
3+
"private": true,
4+
"scripts": {
5+
"lint": "pnpm -r lint",
6+
"fix": "pnpm -r fix",
7+
"compile": "pnpm -r --stream run compile",
8+
"compile:esm": "pnpm -r --stream run compile:esm",
9+
"compile:cjs": "pnpm -r --stream run compile:cjs",
10+
"test:unit": "pnpm -r --stream run test:unit",
11+
"test:e2e": "pnpm -r --stream run test:e2e",
12+
"coverage": "pnpm -r --stream run coverage"
13+
},
14+
"devDependencies": {
15+
"@google-cloud/secret-manager": "^6.1.1",
16+
"@google-cloud/storage": "^7.17.2",
17+
"@jest/globals": "^30.2.0",
18+
"@types/fs-extra": "^11.0.4",
19+
"@types/jest": "^30.0.0",
20+
"@types/node": "^24.9.1",
21+
"@types/tmp": "^0.2.6",
22+
"cross-env": "^10.1.0",
23+
"eslint": "^8.57.1",
24+
"fs-extra": "^11.3.2",
25+
"google-auth-library": "^10.4.2",
26+
"gts": "^6.0.2",
27+
"jest": "^30.2.0",
28+
"tmp": "^0.2.5",
29+
"ts-jest": "^29.4.5",
30+
"typescript": "^5.8.3"
31+
}
32+
}
Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
{
2-
"extends": "./node_modules/gts",
3-
"parserOptions": {
4-
"project": "./tsconfig.json"
5-
},
6-
"env": {
7-
"node": true,
8-
"jest": true
9-
},
10-
"overrides": [
11-
{
12-
"files": [
13-
"**/test/**/*.ts",
14-
"**/*.test.ts",
15-
"**/jest.globalSetup.ts",
16-
"**/jest.globalTeardown.ts",
17-
"**/jest.setup.ts"
18-
],
19-
"rules": {
20-
"n/no-unpublished-import": "off"
21-
}
22-
}
23-
]
2+
"extends": "../../node_modules/gts",
3+
"parserOptions": {
4+
"project": "./tsconfig.json"
5+
},
6+
"env": {
7+
"node": true,
8+
"jest": true
9+
},
10+
"ignorePatterns": [
11+
"build/"
12+
],
13+
"overrides": [
14+
{
15+
"files": [
16+
"**/test/**/*.ts",
17+
"**/*.test.ts",
18+
"**/jest.globalSetup.ts",
19+
"**/jest.globalTeardown.ts",
20+
"**/jest.setup.ts"
21+
],
22+
"rules": {
23+
"n/no-unpublished-import": "off",
24+
"n/no-extraneous-import": "off"
25+
}
26+
}
27+
]
2428
}

packages/toolbox-adk/jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"testMatch": [
33
"<rootDir>/test/*.ts"
44
],
5-
"preset": "ts-jest",
5+
"preset": "ts-jest/presets/default-esm",
66
"transform": {
77
"^.+\\.ts$": [
88
"ts-jest",

0 commit comments

Comments
 (0)