Skip to content

Commit 3c71728

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

39 files changed

+196
-134
lines changed

.github/workflows/node.yaml

Lines changed: 33 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
@@ -357,7 +357,7 @@ jobs:
357357
358358
cd packages
359359
yarn install
360-
yarn lerna run --scope \*\*/${{ matrix.gateway-name }} --include-dependencies --stream build
360+
yarn build:single ${{ matrix.gateway-name }}/tsconfig.build.json
361361
yarn run pinst --disable
362362
yarn workspaces focus ${{ matrix.gateway-name }} --production
363363
- name: Set up Docker Buildx
@@ -425,7 +425,7 @@ jobs:
425425
echo $CODE_BLOCK >> $GITHUB_STEP_SUMMARY
426426
427427
lint-packages:
428-
name: Lint Package
428+
name: Lint Package ${{ matrix.package-name }}
429429
runs-on: ubuntu-latest
430430
timeout-minutes: 15
431431

@@ -443,8 +443,10 @@ jobs:
443443
- job-worker
444444
- openapi
445445
- live-status-gateway
446-
- webui
447446
- live-status-gateway-api
447+
include:
448+
- package-name: webui
449+
tsconfig-name: tsconfig.json
448450

449451
steps:
450452
- uses: actions/checkout@v6
@@ -467,7 +469,12 @@ jobs:
467469
cd packages
468470
yarn config set cacheFolder /home/runner/${{ matrix.package-name }}-cache
469471
yarn install
470-
yarn lerna run --scope \*\*/${{ matrix.package-name }} --include-dependencies --stream build
472+
473+
if [ "${{ matrix.package-name }}" = "openapi" ]; then
474+
yarn workspace @sofie-automation/openapi run build
475+
else
476+
yarn build:single ${{ matrix.package-name }}/${{ matrix.tsconfig-name || 'tsconfig.build.json' }}
477+
fi
471478
env:
472479
CI: true
473480
- name: Run typecheck and linter
@@ -478,7 +485,7 @@ jobs:
478485
CI: true
479486

480487
test-packages:
481-
name: Test Package (main)
488+
name: Test Package ${{ matrix.package-name }} (Node ${{ matrix.node-version }})
482489
runs-on: ubuntu-latest
483490
timeout-minutes: 15
484491

@@ -513,6 +520,7 @@ jobs:
513520
- node-version: 22.x
514521
package-name: webui
515522
send-coverage: true
523+
tsconfig-name: tsconfig.json
516524
# manual meteor-lib as it only needs a couple of versions
517525
- node-version: 22.x
518526
package-name: meteor-lib
@@ -539,7 +547,12 @@ jobs:
539547
cd packages
540548
yarn config set cacheFolder /home/runner/test-packages-cache
541549
yarn install
542-
yarn lerna run --scope \*\*/${{ matrix.package-name }} --include-dependencies --stream build
550+
551+
if [ "${{ matrix.package-name }}" = "openapi" ]; then
552+
yarn workspace @sofie-automation/openapi run build
553+
else
554+
yarn build:single ${{ matrix.package-name }}/${{ matrix.tsconfig-name || 'tsconfig.build.json' }}
555+
fi
543556
env:
544557
CI: true
545558
- name: Run tests
@@ -631,6 +644,7 @@ jobs:
631644
uses: actions/setup-node@v6
632645
with:
633646
node-version-file: ".node-version"
647+
- uses: ./.github/actions/setup-meteor
634648
- name: restore node_modules
635649
uses: actions/cache@v4
636650
with:
@@ -641,9 +655,13 @@ jobs:
641655
run: |
642656
corepack enable
643657
644-
cd packages
645658
yarn config set cacheFolder /home/runner/publish-docs-cache
646659
yarn install
660+
661+
# setup zodern:types. No linters are setup, so this simply installs the packages
662+
yarn meteor lint
663+
664+
cd packages
647665
yarn build:all
648666
env:
649667
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)