Skip to content

Commit ef8b733

Browse files
committed
chore: unify tsc for packages and meteor
1 parent 233c327 commit ef8b733

39 files changed

+199
-134
lines changed

.github/workflows/node.yaml

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ jobs:
3737
3838
yarn config set cacheFolder /home/runner/lint-core-cache
3939
yarn
40+
41+
# setup zodern:types. No linters are setup, so this simply installs the packages
42+
yarn meteor lint
43+
4044
yarn build:packages
4145
env:
4246
CI: true
4347
- name: Run typecheck and linter
4448
run: |
4549
cd meteor
46-
47-
# setup zodern:types. No linters are setup, so this simply installs the packages
48-
meteor lint
49-
5050
yarn ci:lint
5151
env:
5252
CI: true
@@ -78,16 +78,16 @@ jobs:
7878
7979
yarn config set cacheFolder /home/runner/test-core-cache
8080
yarn
81+
82+
# setup zodern:types. No linters are setup, so this simply installs the packages
83+
yarn meteor lint
84+
8185
yarn build:packages
8286
env:
8387
CI: true
8488
- name: Run Tests
8589
run: |
8690
cd meteor
87-
88-
# setup zodern:types. No linters are setup, so this simply installs the packages
89-
meteor lint
90-
9191
NODE_OPTIONS="--max-old-space-size=6144" yarn unitci --force-exit
9292
env:
9393
CI: true
@@ -180,6 +180,9 @@ jobs:
180180
corepack enable
181181
182182
yarn install
183+
184+
# setup zodern:types. No linters are setup, so this simply installs the packages
185+
yarn meteor lint
183186
- name: Build libs
184187
if: steps.check-build-and-push.outputs.enable == 'true'
185188
run: |
@@ -357,7 +360,7 @@ jobs:
357360
358361
cd packages
359362
yarn install
360-
yarn lerna run --scope \*\*/${{ matrix.gateway-name }} --include-dependencies --stream build
363+
yarn build:single ${{ matrix.gateway-name }}/tsconfig.build.json
361364
yarn run pinst --disable
362365
yarn workspaces focus ${{ matrix.gateway-name }} --production
363366
- name: Set up Docker Buildx
@@ -425,7 +428,7 @@ jobs:
425428
echo $CODE_BLOCK >> $GITHUB_STEP_SUMMARY
426429
427430
lint-packages:
428-
name: Lint Package
431+
name: Lint Package ${{ matrix.package-name }}
429432
runs-on: ubuntu-latest
430433
timeout-minutes: 15
431434

@@ -443,8 +446,10 @@ jobs:
443446
- job-worker
444447
- openapi
445448
- live-status-gateway
446-
- webui
447449
- live-status-gateway-api
450+
include:
451+
- package-name: webui
452+
tsconfig-name: tsconfig.json
448453

449454
steps:
450455
- uses: actions/checkout@v6
@@ -467,7 +472,12 @@ jobs:
467472
cd packages
468473
yarn config set cacheFolder /home/runner/${{ matrix.package-name }}-cache
469474
yarn install
470-
yarn lerna run --scope \*\*/${{ matrix.package-name }} --include-dependencies --stream build
475+
476+
if [ "${{ matrix.package-name }}" = "openapi" ]; then
477+
yarn workspace @sofie-automation/openapi run build
478+
else
479+
yarn build:single ${{ matrix.package-name }}/${{ matrix.tsconfig-name || 'tsconfig.build.json' }}
480+
fi
471481
env:
472482
CI: true
473483
- name: Run typecheck and linter
@@ -478,7 +488,7 @@ jobs:
478488
CI: true
479489

480490
test-packages:
481-
name: Test Package (main)
491+
name: Test Package ${{ matrix.package-name }} (Node ${{ matrix.node-version }})
482492
runs-on: ubuntu-latest
483493
timeout-minutes: 15
484494

@@ -513,6 +523,7 @@ jobs:
513523
- node-version: 22.x
514524
package-name: webui
515525
send-coverage: true
526+
tsconfig-name: tsconfig.json
516527
# manual meteor-lib as it only needs a couple of versions
517528
- node-version: 22.x
518529
package-name: meteor-lib
@@ -539,7 +550,12 @@ jobs:
539550
cd packages
540551
yarn config set cacheFolder /home/runner/test-packages-cache
541552
yarn install
542-
yarn lerna run --scope \*\*/${{ matrix.package-name }} --include-dependencies --stream build
553+
554+
if [ "${{ matrix.package-name }}" = "openapi" ]; then
555+
yarn workspace @sofie-automation/openapi run build
556+
else
557+
yarn build:single ${{ matrix.package-name }}/${{ matrix.tsconfig-name || 'tsconfig.build.json' }}
558+
fi
543559
env:
544560
CI: true
545561
- name: Run tests
@@ -631,6 +647,7 @@ jobs:
631647
uses: actions/setup-node@v6
632648
with:
633649
node-version-file: ".node-version"
650+
- uses: ./.github/actions/setup-meteor
634651
- name: restore node_modules
635652
uses: actions/cache@v4
636653
with:
@@ -641,9 +658,13 @@ jobs:
641658
run: |
642659
corepack enable
643660
644-
cd packages
645661
yarn config set cacheFolder /home/runner/publish-docs-cache
646662
yarn install
663+
664+
# setup zodern:types. No linters are setup, so this simply installs the packages
665+
yarn meteor lint
666+
667+
cd packages
647668
yarn build:all
648669
env:
649670
CI: true

.github/workflows/publish-libs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ jobs:
6868
- name: Use Node.js
6969
uses: actions/setup-node@v6
7070
with:
71-
node-version-file: '.node-version'
71+
node-version-file: ".node-version"
7272
- name: Prepare Environment
7373
run: |
7474
corepack enable
7575
7676
cd packages
7777
yarn install
78-
yarn lerna run --scope \*\*/${{ matrix.package-name }} --include-dependencies --stream build
78+
yarn build:single ${{ matrix.package-name }}/tsconfig.build.json
7979
env:
8080
CI: true
8181
- name: Run typecheck and linter
@@ -119,7 +119,7 @@ jobs:
119119
120120
cd packages
121121
yarn install
122-
yarn lerna run --scope \*\*/${{ matrix.package-name }} --include-dependencies --stream build
122+
yarn build:single ${{ matrix.package-name }}/tsconfig.build.json
123123
env:
124124
CI: true
125125
- name: Run tests
@@ -145,7 +145,7 @@ jobs:
145145
- name: Use Node.js
146146
uses: actions/setup-node@v6
147147
with:
148-
node-version-file: '.node-version'
148+
node-version-file: ".node-version"
149149
- name: Prepare Environment
150150
run: |
151151
corepack enable
@@ -222,7 +222,7 @@ jobs:
222222
- name: Use Node.js
223223
uses: actions/setup-node@v6
224224
with:
225-
node-version-file: '.node-version'
225+
node-version-file: ".node-version"
226226

227227
- name: Download release artifact
228228
uses: actions/download-artifact@v6

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ meteor-settings.json
1515
.github/workflows/forkSync.yml
1616
.github/workflows/forkSynk.yml
1717

18+
**/*.tsbuildinfo
19+
1820
.pnp.*
1921
.yarn/*
2022
!.yarn/patches

meteor/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"unit": "jest",
1515
"unitci": "jest --maxWorkers 2 --coverage",
1616
"unitcov": "jest --coverage",
17-
"test": "yarn check-types && yarn unit",
17+
"test": "yarn unit",
1818
"watch": "jest --watch",
1919
"update-snapshots": "jest --updateSnapshot",
20-
"ci:lint": "yarn check-types && yarn lint",
20+
"ci:lint": "yarn lint",
2121
"cov-open": "open-cli coverage/lcov-report/index.html",
2222
"cov": "yarn unitcov && yarn cov-open",
2323
"license-validate": "node ../scripts/checkLicenses.js --allowed=\"MIT,BSD,ISC,Apache,Unlicense,CC0,LGPL,CC BY 3.0,CC BY 4.0,MPL 2.0,Python 2.0\" --excludePackages=timecode,rxjs/ajax,rxjs/fetch,rxjs/internal-compatibility,nw-pre-gyp-module-test,rxjs/operators,rxjs/testing,rxjs/webSocket,undefined,i18next-conv,@fortawesome/fontawesome-common-types,argv,indexof,custom-license,private,public-domain-module,@sofie-automation/corelib,@sofie-automation/shared-lib,@sofie-automation/job-worker",
@@ -32,9 +32,7 @@
3232
"prepareChangelog": "run release --prerelease --release-as patch",
3333
"validate:all-dependencies": "run validate:prod-dependencies && run validate:dev-dependencies && run license-validate",
3434
"validate:prod-dependencies": "yarn npm audit --environment production",
35-
"validate:dev-dependencies": "yarn npm audit --environment development --severity moderate",
36-
"check-types": "tsc --noEmit -p tsconfig.json",
37-
"watch-types": "run check-types --watch"
35+
"validate:dev-dependencies": "yarn npm audit --environment development --severity moderate"
3836
},
3937
"dependencies": {
4038
"@babel/runtime": "^7.26.7",

meteor/tsconfig-base.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,16 @@
1414
// "./node_modules/@types/meteor/*",
1515
"./.meteor/local/types/packages.d.ts"
1616
]
17-
}
17+
},
18+
"noEmit": true
1819
},
1920
"include": ["client/**/*", "server/**/*", "lib/**/*", "__mocks__/**/*", "tslint-rules/**/*"],
20-
"exclude": ["node_modules", "**/.coverage/**/*"]
21+
"exclude": ["node_modules", "**/.coverage/**/*"],
22+
"references": [
23+
{ "path": "../shared-lib/tsconfig.build.json" },
24+
{ "path": "../blueprints-integration/tsconfig.build.json" },
25+
{ "path": "../corelib/tsconfig.build.json" },
26+
{ "path": "../meteor-lib/tsconfig.build.json" },
27+
{ "path": "../job-worker/tsconfig.build.json" }
28+
]
2129
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"test:packages": "cd packages && run test",
2020
"lint:packages": "cd packages && run lint",
2121
"unit:packages": "cd packages && run unit",
22-
"check-types:meteor": "cd meteor && run check-types",
22+
"check-types": "cd packages && run build",
2323
"test:meteor": "cd meteor && run test",
2424
"lint:meteor": "cd meteor && yarn lint",
2525
"unit:meteor": "cd meteor && yarn unit",
@@ -33,7 +33,7 @@
3333
"meteor": "cd meteor && meteor",
3434
"docs:serve": "cd packages && run docs:serve",
3535
"reset": "node scripts/reset.mjs",
36-
"test-all": "yarn install && run install-and-build && run check-types:meteor && run lint:packages && run lint:meteor && run test:packages && run test:meteor"
36+
"test-all": "yarn install && run install-and-build && run check-types && run lint:packages && run lint:meteor && run test:packages && run test:meteor"
3737
},
3838
"devDependencies": {
3939
"concurrently": "^9.1.2",

packages/blueprints-integration/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
},
1616
"homepage": "https://github.com/Sofie-Automation/sofie-core/blob/main/packages/blueprints-integration#readme",
1717
"scripts": {
18-
"build": "run -T rimraf dist && run build:main",
19-
"build:main": "run -T tsc -p tsconfig.build.json",
2018
"lint:raw": "run -T eslint",
2119
"lint": "run lint:raw .",
2220
"unit": "run -T jest",
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
{
22
"extends": "@sofie-automation/code-standard-preset/ts/tsconfig.lib",
33
"include": ["src/**/*.ts"],
4-
"exclude": ["node_modules/**", "src/**/*spec.ts", "src/**/__tests__/*", "src/**/__mocks__/*"],
4+
"exclude": ["node_modules/**", "**/*spec.ts", "**/__tests__/*", "**/__mocks__/*"],
55
"compilerOptions": {
66
"outDir": "./dist",
7+
"rootDir": "./src",
78
"baseUrl": "./",
89
"paths": {
910
"*": ["./node_modules/*"],
1011
"@sofie-automation/blueprints-integration": ["./src/index.ts"]
1112
},
1213
"resolveJsonModule": true,
13-
"types": ["node"]
14-
}
14+
"types": ["node"],
15+
"composite": true
16+
},
17+
"references": [
18+
{
19+
"path": "../shared-lib"
20+
}
21+
]
1522
}

packages/corelib/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
},
1717
"homepage": "https://github.com/Sofie-Automation/sofie-core/blob/main/packages/corelib#readme",
1818
"scripts": {
19-
"build": "run -T rimraf dist && run build:main",
20-
"build:main": "run -T tsc -p tsconfig.build.json",
2119
"lint:raw": "run -T eslint",
2220
"lint": "run lint:raw .",
2321
"unit": "run -T jest",
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"extends": "@sofie-automation/code-standard-preset/ts/tsconfig.lib",
33
"include": ["src/**/*.ts"],
4-
"exclude": ["node_modules/**", "src/**/*spec.ts", "src/**/__tests__/*", "src/**/__mocks__/*"],
4+
"exclude": ["node_modules/**", "**/*spec.ts", "**/__tests__/*", "**/__mocks__/*"],
55
"compilerOptions": {
66
"target": "es2019",
7+
"rootDir": "./src",
78
"outDir": "./dist",
89
"baseUrl": "./",
910
"paths": {
@@ -12,6 +13,15 @@
1213
},
1314
"resolveJsonModule": true,
1415
"types": ["node"],
15-
"esModuleInterop": true
16-
}
16+
"esModuleInterop": true,
17+
"composite": true
18+
},
19+
"references": [
20+
{
21+
"path": "../shared-lib"
22+
},
23+
{
24+
"path": "../blueprints-integration"
25+
}
26+
]
1727
}

0 commit comments

Comments
 (0)