Skip to content

Commit

Permalink
Merge pull request #331 from tsedio/fix-workspaces
Browse files Browse the repository at this point in the history
Fix workspaces
  • Loading branch information
Romakita committed Jun 4, 2023
2 parents 1cfb3b6 + a117ac2 commit f0471e3
Show file tree
Hide file tree
Showing 215 changed files with 5,458 additions and 3,506 deletions.
15 changes: 15 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
docs
docs-references
**/lib
**/dist
**/coverage
**/.nyc_output
**/node_modules
*-lock.json
*.lock
benchmarks.*
**/generated
**/test/**/data

*/**/*.js
33 changes: 0 additions & 33 deletions .eslintrc

This file was deleted.

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")
};
30 changes: 8 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -33,7 +33,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [16.x]
node-version: [18.x]
exclude:
# - os: macos-latest
# node-version: 12.x
Expand All @@ -42,7 +42,7 @@ jobs:
# - os: windows-latest
# node-version: 12.x
- os: windows-latest
node-version: 16.x
node-version: 18.x

steps:
- uses: actions/checkout@v2
Expand All @@ -52,31 +52,17 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000
- name: Run build
run: yarn tsc --build
- name: Run test
run: yarn test:coverage
# - name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# flag-name: run-${{ matrix.test_number }}
# parallel: true

# coveralls:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finished
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true
run: yarn test

build:
runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v2
Expand All @@ -96,7 +82,7 @@ jobs:

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

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 7 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
dist
docs
node_modules
**/lib
**/dist
**/coverage
**/.nyc_output
**/node_modules
*-lock.json
*.lock
benchmarks.*
**/generated
File renamed without changes.
65 changes: 0 additions & 65 deletions jest.config.js

This file was deleted.

31 changes: 19 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
"version": "4.5.2",
"description": "CLI to bootstrap your Ts.ED project",
"private": true,
"type": "module",
"scripts": {
"configure": "monorepo ci configure",
"clean": "monorepo clean workspace",
"test": "yarn test:lint && yarn test:coverage",
"test:unit": "cross-env NODE_ENV=test jest",
"test:coverage": "yarn test:unit",
"test:lint": "eslint packages --ext .ts",
"test:lint:fix": "eslint packages --ext .ts --fix",
"test": "lerna run test --stream",
"lint": "eslint '**/*.{ts,js}'",
"test:lint": "lerna run lint --stream",
"test:lint:fix": "lerna run lint:fix --stream",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"build": "monorepo build",
"build": "monorepo build --verbose",
"build:references": "node ./tools/typescript",
"build:eslint": "node ./tools/eslint",
"build:jest": "node ./tools/jest/install.js",
"sync:packages": "monorepo sync packages",
"docs:serve": "yarn api:build && yarn vuepress:serve",
"docs:build": "yarn api:build && yarn vuepress:build",
"docs:publish": "yarn docs:build && monorepo publish ghpages",
"api:build": "lerna run build && tsdoc",
"vuepress:build": "cross-env NODE_ENV=production vuepress build docs",
"vuepress:serve": "vuepress dev docs",
"prettier": "prettier '{packages,test}/**/*.ts' --write",
"prettier": "prettier '**/*.{ts,js,json,md,yml,yaml}' --write",
"release": "semantic-release",
"release:dryRun": "semantic-release --dry-run",
"prepare": "is-ci || husky install"
Expand Down Expand Up @@ -78,12 +79,15 @@
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@tsed/markdown-it-symbols": "3.20.4",
"@tsed/monorepo-utils": "^1.22.4",
"@tsed/monorepo-utils": "1.23.0",
"@tsed/ts-doc": "^4.1.0",
"@types/jest": "28.1.7",
"@types/node": "18.7.8",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"@swc/core": "^1.3.61",
"@swc/helpers": "^0.5.1",
"@swc/jest": "^0.2.26",
"concurrently": "7.6.0",
"coveralls": "3.1.1",
"cross-env": "7.0.3",
Expand All @@ -92,10 +96,12 @@
"eslint-plugin-jest": "27.1.6",
"eslint-plugin-mocha": "10.1.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-workspaces": "0.8.0",
"gflow": "^5.1.2",
"husky": "8.0.1",
"is-ci": "3.0.1",
"jest": "28.1.3",
"jest": "29.5.0",
"jest-coverage-thresholds-bumper": "1.1.0",
"lint-staged": "13.0.3",
"markdown-it": "13.0.1",
"prettier": "2.7.1",
Expand All @@ -106,7 +112,7 @@
"ts-jest": "28.0.8",
"ts-node": "10.9.1",
"tsconfig-paths": "4.1.2",
"typescript": "4.8.4",
"typescript": "4.9.5",
"vue-analytics": "5.22.1",
"vuepress": "1.9.7",
"entities": "1.1.2",
Expand All @@ -118,7 +124,8 @@
},
"workspaces": {
"packages": [
"packages/*"
"packages/*",
"tools/*"
],
"nohoist": [
"read-pkg-up"
Expand Down
13 changes: 13 additions & 0 deletions packages/cli-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/cli-core/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@tsed/eslint/node.js");
18 changes: 18 additions & 0 deletions packages/cli-core/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html

module.exports = {
...require("@tsed/jest-config"),
roots: ["<rootDir>/src", "<rootDir>/test"],
moduleNameMapper: {
"@tsed/cli-core": "<rootDir>/src/index.ts"
},
coverageThreshold: {
global: {
statements: 71.03,
branches: 72.88,
functions: 48.71,
lines: 71.03
}
},
};
17 changes: 13 additions & 4 deletions packages/cli-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
"default": "./lib/esm/index.js"
},
"scripts": {
"build": "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 build:ts",
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json",
"lint": "eslint '**/*.{ts,js}'",
"lint:fix": "eslint '**/*.{ts,js}' --fix",
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2 --passWithNoTests && jest-coverage-thresholds-bumper"
},
"keywords": [
"cli",
Expand Down Expand Up @@ -66,6 +68,9 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@tsed/eslint": "4.5.2",
"@tsed/jest-config": "4.5.2",
"@tsed/typescript": "4.5.2",
"@types/axios": "0.14.0",
"@types/commander": "2.12.2",
"@types/consolidate": "0.14.1",
Expand All @@ -79,7 +84,11 @@
"@types/tunnel": "0.0.3",
"@types/update-notifier": "5.1.0",
"@types/url-parse": "^1.4.3",
"@types/uuid": "8.3.4"
"@types/uuid": "8.3.4",
"cross-env": "7.0.3",
"deps": "^1.0.0",
"eslint": "8.22.0",
"jest": "29.5.0"
},
"peerDependencies": {
"@tsed/core": ">=7.14.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-core/src/services/CliDockerComposeYaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ export class CliDockerComposeYaml {
@Inject()
protected projectPackageJson: ProjectPackageJson;

async read() {
read() {
const path = "docker-compose.yml";
const file = !this.fs.exists(path) ? this.fs.findUpFile(this.projectPackageJson.dir, path) : path;

if (file) {
return this.cliYaml.read("docker-compose.yml");
}

return {};
return Promise.resolve({});
}

async write(obj: any) {
write(obj: any) {
const path = "docker-compose.yml";
const file = this.fs.findUpFile(this.projectPackageJson.dir, path) || join(this.projectPackageJson.dir, path);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli-core/src/services/CliFs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class CliFs {
return normalizePath(join(...args));
}

async readFile(file: string | Buffer | number, encoding?: any): Promise<string> {
readFile(file: string | Buffer | number, encoding?: any): Promise<string> {
return this.raw.readFile(file, encoding) as any;
}

Expand Down
Loading

0 comments on commit f0471e3

Please sign in to comment.