Skip to content

Commit

Permalink
build: exclude tests from dist (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Jan 24, 2024
1 parent 2225215 commit c26dc1c
Show file tree
Hide file tree
Showing 103 changed files with 576 additions and 90 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on:
workflow_dispatch:
inputs:
version:
description: version
required: true
type: choice
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease

permissions:
contents: write
actions: read
pull-requests: read
id-token: write

jobs:
release:
runs-on: buildjet-2vcpu-ubuntu-2004
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 20.6.0

- name: Cache node_modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}

- name: npm install
run: npm ci

- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: lerna version
run: lerna version --no-private --verify-access ${{ inputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
LEFTHOOK: 0

- name: lerna publish
run: lerna publish from-git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
LEFTHOOK: 0

8 changes: 7 additions & 1 deletion packages/api-console-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@
"rxjs": "~7.5.0"
},
"jest": {
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
Expand Down
3 changes: 3 additions & 0 deletions packages/api-console-module/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"index.ts",
"node_modules/@deepkit/api-console-gui/src/api.ts"
],
"exclude": [
"tests"
],
"references": [
{
"path": "../api-console-api/tsconfig.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2020"
},
"include": [
"src",
"index.ts",
Expand Down
8 changes: 7 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@
"conditional-type-checks": "^1.0.5"
},
"jest": {
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
Expand Down
3 changes: 3 additions & 0 deletions packages/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"src",
"index.ts"
],
"exclude": [
"tests"
],
"references": [
{
"path": "../core/tsconfig.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2020"
},
"include": [
"src",
"index.ts",
Expand Down
8 changes: 7 additions & 1 deletion packages/broker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@
"@deepkit/type": "^1.0.1-alpha.113"
},
"jest": {
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
Expand Down
4 changes: 3 additions & 1 deletion packages/broker/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
"reflection": true,
"include": [
"src",
"tests",
"index.ts"
],
"exclude": [
"tests"
],
"references": [
{
"path": "../bson/tsconfig.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2020"
},
"include": [
"src",
"index.ts",
Expand Down
7 changes: 6 additions & 1 deletion packages/bson/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@
"jest": {
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
Expand Down
3 changes: 3 additions & 0 deletions packages/bson/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"src",
"index.ts"
],
"exclude": [
"tests"
],
"references": [
{
"path": "../core/tsconfig.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2020"
},
"include": [
"src",
"index.ts",
Expand Down
8 changes: 7 additions & 1 deletion packages/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@
"bun-types": "1.0.6"
},
"jest": {
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
Expand Down
4 changes: 3 additions & 1 deletion packages/bun/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
},
"include": [
"src",
"tests",
"index.ts"
],
"exclude": [
"tests"
],
"references": [
{
"path": "../core/tsconfig.json"
Expand Down
8 changes: 8 additions & 0 deletions packages/bun/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"src",
"index.ts",
"tests"
]
}
8 changes: 7 additions & 1 deletion packages/core-rxjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@
"rxjs": "~7.5.0"
},
"jest": {
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
Expand Down
4 changes: 3 additions & 1 deletion packages/core-rxjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
},
"include": [
"src",
"index.ts",
"index.ts"
],
"exclude": [
"tests"
],
"references": [
Expand Down
8 changes: 8 additions & 0 deletions packages/core-rxjs/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"src",
"index.ts",
"tests"
]
}
8 changes: 7 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@
"build": "echo '{\"type\": \"module\"}' > ./dist/esm/package.json"
},
"jest": {
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
Expand Down
7 changes: 5 additions & 2 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
"declaration": true,
"composite": true,
"types": [
"dot-prop"
"dot-prop",
"node"
]
},
"reflection": true,
"include": [
"src",
"index.ts",
"index.ts"
],
"exclude": [
"tests"
],
"references": []
Expand Down
8 changes: 8 additions & 0 deletions packages/core/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"src",
"index.ts",
"tests"
]
}
8 changes: 7 additions & 1 deletion packages/event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@
"@deepkit/type": "^1.0.1-alpha.113"
},
"jest": {
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
Expand Down
4 changes: 3 additions & 1 deletion packages/event/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
},
"include": [
"src",
"tests",
"index.ts"
],
"exclude": [
"tests"
],
"reflection": true,
"references": [
{
Expand Down
8 changes: 8 additions & 0 deletions packages/event/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"src",
"index.ts",
"tests"
]
}
2 changes: 1 addition & 1 deletion packages/filesystem-aws-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.json"
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
Expand Down
4 changes: 3 additions & 1 deletion packages/filesystem-aws-s3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
},
"include": [
"src",
"tests",
"index.ts"
],
"exclude": [
"tests"
],
"references": [
{
"path": "../core/tsconfig.json"
Expand Down
8 changes: 8 additions & 0 deletions packages/filesystem-aws-s3/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"src",
"index.ts",
"tests"
]
}
2 changes: 1 addition & 1 deletion packages/filesystem-ftp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.json"
"tsconfig": "<rootDir>/tsconfig.spec.json"
}
]
},
Expand Down
Loading

0 comments on commit c26dc1c

Please sign in to comment.