Skip to content

Commit

Permalink
ci: use references in tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Mar 21, 2023
1 parent 544d6c4 commit b45585b
Show file tree
Hide file tree
Showing 481 changed files with 7,189 additions and 1,715 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ docs-references
*.lock
benchmarks.*
**/generated

*/**/*.js
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require("@tsed/eslint/node.js")
};
52 changes: 21 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn build
env:
FORCE_COLOR: true
- name: Run test
run: yarn test:integration
env:
Expand All @@ -76,6 +80,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:core --since origin/production

Expand All @@ -96,6 +102,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:specs --since origin/production

Expand All @@ -116,6 +124,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:platform --since origin/production

Expand All @@ -136,6 +146,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:orm --since origin/production

Expand All @@ -156,6 +168,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:graphql --since origin/production

Expand All @@ -176,6 +190,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:security --since origin/production

Expand All @@ -196,6 +212,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:third-parties --since origin/production

Expand All @@ -216,43 +234,15 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000 --ignore-engines
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:formio --since origin/production

build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000
- name: Run build
run: yarn build

deploy-packages:
runs-on: ubuntu-latest
needs:
[
lint,
test-core,
test-specs,
test-platform,
test-integration,
test-orm,
test-security,
test-graphql,
test-third-parties,
test-formio,
build
]
[lint, test-core, test-specs, test-platform, test-integration, test-orm, test-security, test-graphql, test-third-parties, test-formio]
if: github.event_name != 'pull_request' && contains('
refs/heads/production
refs/heads/alpha
Expand Down
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const jestConfig = require("@tsed/jest-config");

// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html

module.exports = {
...require("@tsed/jest-config")(__dirname, "root"),
...jestConfig,
coverageThreshold: {
global: {
statements: 99.26,
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"postinstall": "node tools/yarn/postinstall.js && cd docs && yarn install && cd .. && node ./tools/github-sponsors/bin/github-sponsors.js",
"configure": "monorepo ci configure",
"clean": "monorepo clean workspace",
"test": "yarn clean && yarn test:lint && yarn test:core && yarn test:specs && yarn test:platform && yarn test:integration && yarn test:graphql && yarn test:orm && yarn test:security && yarn test:formio && yarn test:third-parties",
"test:lint": "eslint '**/*.{ts,js}'",
"test:lint:fix": "yarn test:lint --fix",
"test": "yarn test:lint && yarn test:core && yarn test:specs && yarn test:platform && yarn test:integration && yarn test:graphql && yarn test:orm && yarn test:security && yarn test:formio && yarn test:third-parties",
"test:lint": "lerna run lint",
"test:lint:fix": "lerna run lint:fix",
"test:core": "lerna run test --scope \"@tsed/{core,di,common,engines,normalize-path}\" --stream --concurrency 2",
"test:platform": "lerna run test --ignore \"@tsed/platform-{express,koa}\" --scope \"@tsed/platform-*\" --stream --concurrency 2",
"test:integration": "lerna run test --scope \"@tsed/platform-{express,koa}\" --stream --concurrency 2",
Expand All @@ -42,6 +42,8 @@
"coverage": "merge-istanbul --out coverage/coverage-final.json \"**/packages/**/coverage/coverage-final.json\" && nyc report --reporter text --reporter html --reporter lcov -t coverage --report-dir coverage",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"build": "monorepo build --verbose",
"build:references": "node ./tools/typescript",
"build:eslint": "node ./tools/eslint",
"sync:packages": "monorepo sync packages",
"api:build": "lerna run build && tsdoc",
"docs:install": "sh ./scripts/docs/install.sh",
Expand Down Expand Up @@ -161,9 +163,8 @@
"supertest": "6.2.2",
"ts-jest": "^29.0.3",
"ts-node": "10.8.1",
"tsconfig-paths": "4.1.2",
"tslib": "2.4.0",
"typescript": "^4.7.4",
"typescript": "4.9.5",
"ts-loader": "^9.4.2",
"html-webpack-plugin": "5.5.0",
"webpack": "^5.75.0",
Expand Down
13 changes: 13 additions & 0 deletions packages/core/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
docs
docs-references
lib
dist
coverage
.nyc_output
*-lock.json
*.lock
benchmarks.*
**/generated

**/*.js
1 change: 1 addition & 0 deletions packages/core/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@tsed/eslint/node.js");
2 changes: 1 addition & 1 deletion packages/core/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://jestjs.io/docs/en/configuration.html

module.exports = {
...require("@tsed/jest-config")(__dirname, "core"),
...require("@tsed/jest-config"),
coverageThreshold: {
global: require("./coverage.json")
}
Expand Down
17 changes: 11 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@
"default": "./lib/esm/index.js"
},
"scripts": {
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs && yarn run build:browser",
"build": "yarn barrels && yarn build:ts && yarn run build:browser",
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\"",
"build:cjs": "tsc --build tsconfig.compile.json",
"build:esm": "tsc --build tsconfig.compile.esm.json",
"build:browser": "webpack",
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2",
"build:ts": "tsc --build tsconfig.json",
"lint": "eslint '**/*.{ts,js}'",
"lint:fix": "eslint '**/*.{ts,js}' --fix"
},
"dependencies": {
"reflect-metadata": "^0.1.13",
"tslib": "2.4.0"
},
"devDependencies": {},
"devDependencies": {
"@tsed/typescript": "7.18.2",
"@tsed/eslint": "7.18.2",
"eslint": "^8.12.0"
},
"peerDependencies": {}
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"extends": "./tsconfig.compile.json",
"extends": "@tsed/typescript/tsconfig.node.json",
"compilerOptions": {
"baseUrl": ".",
"target": "esnext",
"module": "esnext",
"module": "commonjs",
"rootDir": "src",
"outDir": "./lib/esm",
"outDir": "./lib/cjs",
"declaration": true,
"declarationDir": "./lib/types"
"declarationDir": "./lib/types",
"composite": true,
"noEmit": false
},
"include": ["src"],
"include": ["src", "src/**/*.json"],
"exclude": [
"node_modules",
"test",
Expand All @@ -21,6 +22,8 @@
"**/*.spec.ts",
"keys",
"jest.config.js",
"**/__mock__/**",
"webpack.config.js"
]
],
"references": []
}
9 changes: 0 additions & 9 deletions packages/core/tsconfig.compile.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"extends": "./tsconfig.compile.json",
"extends": "@tsed/typescript/tsconfig.node.json",
"compilerOptions": {
"baseUrl": ".",
"module": "ES2020",
"rootDir": "src",
"outDir": "./lib/esm",
"declaration": true,
"declarationDir": "./lib/types"
"declarationDir": "./lib/types",
"composite": true,
"noEmit": false
},
"include": ["src", "src/**/*.json"],
"exclude": [
"node_modules",
"test",
Expand All @@ -19,6 +22,8 @@
"**/*.spec.ts",
"keys",
"jest.config.js",
"**/__mock__/**",
"webpack.config.js"
]
],
"references": []
}
18 changes: 18 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"files": [],
"compilerOptions": {
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"composite": true
},
"exclude": ["node_modules", "lib", "benchmark", "coverage", "spec", "keys", "jest.config.js", "webpack.config.js"],
"references": [
{
"path": "./tsconfig.esm.json"
},
{
"path": "./tsconfig.cjs.json"
}
]
}
13 changes: 13 additions & 0 deletions packages/di/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
docs
docs-references
lib
dist
coverage
.nyc_output
*-lock.json
*.lock
benchmarks.*
**/generated

**/*.js
1 change: 1 addition & 0 deletions packages/di/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@tsed/eslint/node.js");
2 changes: 1 addition & 1 deletion packages/di/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://jestjs.io/docs/en/configuration.html

module.exports = {
...require("@tsed/jest-config")(__dirname, "di"),
...require("@tsed/jest-config"),
coverageThreshold: {
global: require("./coverage.json")
}
Expand Down
16 changes: 10 additions & 6 deletions packages/di/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@
"default": "./lib/esm/index.js"
},
"scripts": {
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
"build:cjs": "tsc --build tsconfig.compile.json",
"build:esm": "tsc --build tsconfig.compile.esm.json",
"build": "yarn barrels && yarn build:ts",
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\"",
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2 -u"
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2 -u",
"build:ts": "tsc --build tsconfig.json",
"lint": "eslint '**/*.{ts,js}'",
"lint:fix": "eslint '**/*.{ts,js}' --fix"
},
"dependencies": {
"tslib": "2.4.0"
},
"devDependencies": {
"@tsed/core": "7.18.2",
"@tsed/logger": ">=6.2.2",
"@tsed/schema": "7.18.2"
"@tsed/schema": "7.18.2",
"@tsed/typescript": "7.18.2",
"@tsed/eslint": "7.18.2",
"eslint": "^8.12.0"
},
"peerDependencies": {
"@tsed/core": "^7.18.2",
Expand All @@ -44,4 +48,4 @@
"optional": false
}
}
}
}
Loading

0 comments on commit b45585b

Please sign in to comment.