Skip to content

Commit

Permalink
chore: replace Lerna with Nx (2.2) (#1366)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7f47894)
  • Loading branch information
Lodin authored and platosha committed Oct 6, 2023
1 parent 6b0bfd3 commit a9d4db6
Show file tree
Hide file tree
Showing 57 changed files with 7,178 additions and 12,412 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git-tag-version=false
8 changes: 0 additions & 8 deletions lerna.json

This file was deleted.

22 changes: 22 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"workspaceLayout": {
"libsDir": "packages/ts"
},
"affected": {
"defaultBase": "main"
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
}
},
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "build:esbuild", "build:dts", "build:copy"],
"parallel": 3
}
}
}
}
18,973 changes: 6,845 additions & 12,128 deletions package-lock.json

Large diffs are not rendered by default.

66 changes: 32 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
"packages/ts/*"
],
"scripts": {
"check": "concurrently npm:lint npm:typecheck",
"build": "sh ./scripts/prepare.sh && lerna run build",
"lint": "lerna run lint --parallel",
"test": "lerna run test --parallel",
"test:coverage": "lerna run test:coverage --parallel",
"typecheck": "lerna run typecheck --parallel"
"clean:build": "nx run-many -t clean:build --all --output-style stream",
"check": "nx run-many -t lint,typecheck --all --output-style stream",
"build": "sh ./scripts/prepare.sh && nx run-many -t build --all --output-style stream",
"build:nocache": "sh ./scripts/prepare.sh && nx run-many -t build --all --output-style stream --skip-nx-cache",
"lint": "nx run-many -t lint --all --output-style stream",
"lint:fix": "nx run-many -t lint:fix --all --output-style stream",
"test": "nx run-many -t test --all --output-style stream",
"test:coverage": "nx run-many -t test:coverage --all --output-style stream",
"typecheck": "nx run-many -t typecheck --all --output-style stream"
},
"repository": {
"type": "git",
Expand All @@ -26,43 +29,38 @@
"author": "Vaadin Ltd",
"license": "Apache-2.0",
"overrides": {
"esbuild": "$esbuild"
"esbuild": "$esbuild",
"prettier": "$prettier",
"eslint-plugin-prettier": "$eslint-plugin-prettier"
},
"devDependencies": {
"@esm-bundle/chai": "^4.3.4-fix.0",
"@types/karma": "^6.3.3",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.3",
"@types/sinon": "^10.0.13",
"@types/validator": "^13.7.14",
"@types/karma": "^6.3.5",
"@types/node": "^20.7.1",
"chai-dom": "^1.11.0",
"concurrently": "^7.6.0",
"esbuild": "^0.18.20",
"eslint": "^8.41.0",
"eslint-config-vaadin": "^1.0.0-alpha.14",
"eslint-plugin-perfectionist": "^1.5.1",
"compare-versions": "^6.1.0",
"concurrently": "^8.2.1",
"esbuild": "^0.19.4",
"eslint": "^8.50.0",
"eslint-config-vaadin": "^1.0.0-alpha.12",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-tsdoc": "^0.2.17",
"glob": "^10.3.3",
"karma": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage": "^2.2.0",
"glob": "^10.3.10",
"karma": "^6.4.2",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-mocha": "^2.0.1",
"karma-spec-reporter": "^0.0.36",
"karma-vite": "^1.0.4",
"lerna": "^7.1.4",
"lint-staged": "^13.2.0",
"meow": "^11.0.0",
"lint-staged": "^14.0.1",
"meow": "^12.1.1",
"micromatch": "^4.0.5",
"mocha": "^10.2.0",
"nx": "^16.6.0",
"nx": "^16.9.1",
"prettier": "^2.8.4",
"simple-git-hooks": "^2.8.1",
"sinon": "^15.0.2",
"tsx": "^3.12.5",
"type-fest": "^4.1.0",
"typescript": "^5.1.6",
"vite": "^4.4.8",
"compare-versions": "^3.4.0",
"sync-request": "^6.0.0"
"simple-git-hooks": "^2.9.0",
"sync-request": "^6.1.0",
"tsx": "^3.13.0",
"typescript": "^5.2.2",
"vite": "^4.4.9"
}
}
25 changes: 13 additions & 12 deletions packages/ts/form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
"Form"
],
"scripts": {
"clean:build": "git clean -fx . -e .vite -e node_modules",
"build": "concurrently npm:build:*",
"build:esbuild": "tsx ../../../scripts/build.ts",
"build:dts": "tsc --isolatedModules -p tsconfig.build.json",
"build:copy": "cd src && copyfiles **/*.d.ts ..",
"lint": "eslint src/**/*.ts test/**/*.ts",
"lint:fix": "eslint src/**/*.ts test/**/*.ts --fix",
"test": "karma start ../../../karma.config.cjs --port 9877",
"test:coverage": "npm run test -- --coverage",
"test:watch": "npm run test -- --watch",
"typecheck": "tsc --noEmit",
"version": "node ../../../scripts/bump/package-update.js"
"typecheck": "tsc --noEmit"
},
"exports": {
".": {
Expand Down Expand Up @@ -67,24 +69,23 @@
"access": "public"
},
"dependencies": {
"@hilla/frontend": "*",
"rimraf": "^5.0.1",
"@hilla/frontend": "~2.2",
"validator": "^13.11.0"
},
"peerDependencies": {
"lit": "^2.3.0"
},
"devDependencies": {
"@esm-bundle/chai": "^4.3.4-fix.0",
"@types/chai": "^4.3.5",
"@types/chai-dom": "^1.11.0",
"@types/mocha": "^10.0.1",
"@types/sinon": "^10.0.16",
"@types/sinon-chai": "^3.2.9",
"@types/validator": "^13.11.1",
"@types/chai": "^4.3.6",
"@types/chai-dom": "^1.11.1",
"@types/mocha": "^10.0.2",
"@types/sinon": "^10.0.17",
"@types/sinon-chai": "^3.2.10",
"@types/validator": "^13.11.2",
"chai-dom": "^1.11.0",
"sinon": "^15.2.0",
"sinon": "^16.0.0",
"sinon-chai": "^3.7.0",
"typescript": "^5.1.6"
"typescript": "^5.2.2"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
"Hilla"
],
"scripts": {
"clean:build": "git clean -fx . -e .vite -e node_modules",
"build": "concurrently npm:build:*",
"build:esbuild": "tsx ../../../scripts/build.ts",
"build:dts": "tsc --isolatedModules -p tsconfig.build.json",
"lint": "eslint src test",
"build:copy": "cd src && copyfiles **/*.d.ts ..",
"lint": "eslint src/**/*.ts test/**/*.ts",
"lint:fix": "eslint src/**/*.ts test/**/*.ts --fix",
"test": "karma start ../../../karma.config.cjs --port 9878",
"test:coverage": "npm run test -- --coverage",
"test:watch": "npm run test -- --watch",
"typecheck": "tsc --noEmit",
"version": "node ../../../scripts/bump/package-update.js"
"typecheck": "tsc --noEmit"
},
"exports": {
".": {
Expand Down Expand Up @@ -62,27 +64,25 @@
"@vaadin/common-frontend": "^0.0.18",
"atmosphere.js": "^3.1.3",
"js-cookie": "^3.0.5",
"rimraf": "^5.0.1"
"rimraf": "^5.0.5"
},
"peerDependencies": {
"lit": "^2.3.0"
},
"devDependencies": {
"@esm-bundle/chai": "^4.3.4-fix.0",
"@open-wc/testing": "^3.2.0",
"@types/atmosphere.js": "^2.1.3",
"@types/chai": "^4.3.5",
"@types/chai-as-promised": "^7.1.5",
"@types/js-cookie": "^3.0.3",
"@types/mocha": "^10.0.1",
"@types/sinon": "^10.0.16",
"@types/sinon-chai": "^3.2.9",
"@types/validator": "^13.11.1",
"chai-as-promised": "^7.1.1",
"@types/atmosphere.js": "^2.1.4",
"@types/chai": "^4.3.6",
"@types/js-cookie": "^3.0.4",
"@types/mocha": "^10.0.2",
"@types/sinon": "^10.0.17",
"@types/sinon-chai": "^3.2.10",
"@types/validator": "^13.11.2",
"chai-dom": "^1.11.0",
"fetch-mock": "^9.11.0",
"sinon": "^15.2.0",
"sinon": "^16.0.0",
"sinon-chai": "^3.7.0",
"typescript": "^5.1.6"
"typescript": "^5.2.2"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 21 additions & 19 deletions packages/ts/generator-typescript-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
"node": ">= 16.13"
},
"scripts": {
"clean:build": "git clean -fx . -e .vite -e node_modules",
"build": "concurrently npm:build:*",
"build:transpile": "tsc --isolatedModules -p tsconfig.build.json",
"build:esbuild": "tsx ../../../scripts/build.ts",
"build:dts": "tsc --isolatedModules -p tsconfig.build.json",
"build:copy": "cd src && copyfiles **/*.d.ts ..",
"lint": "eslint src test",
"lint:fix": "eslint src test --fix",
"test": "mocha test/**/*.spec.ts --config ../../../.mocharc.json",
"test:coverage": "c8 -c ../../../.c8rc.json npm test",
"typecheck": "tsc --noEmit",
"version": "node ../../../scripts/bump/package-update.js"
"typecheck": "tsc --noEmit"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -43,31 +45,31 @@
"tsgen": "bin/index.js"
},
"peerDependencies": {
"@hilla/generator-typescript-core": "^2.2.0"
"@hilla/generator-typescript-core": "~2.2"
},
"dependencies": {
"@hilla/generator-typescript-utils": "^2.2.0",
"@hilla/generator-typescript-utils": "~2.2",
"get-stdin": "^9.0.0",
"meow": "^12.1.0"
"meow": "^12.1.1"
},
"devDependencies": {
"@hilla/generator-typescript-core": "^2.2.0",
"@types/chai": "^4.3.5",
"@types/chai-as-promised": "^7.1.5",
"@types/mocha": "^10.0.1",
"@types/node": "^20.5.0",
"@types/sinon": "^10.0.16",
"@types/sinon-chai": "^3.2.9",
"@hilla/generator-typescript-core": "~2.2",
"@types/chai": "^4.3.6",
"@types/chai-as-promised": "^7.1.6",
"@types/mocha": "^10.0.2",
"@types/node": "^20.7.1",
"@types/sinon": "^10.0.17",
"@types/sinon-chai": "^3.2.10",
"c8": "^8.0.1",
"chai": "^4.3.7",
"chai": "^4.3.10",
"chai-as-promised": "^7.1.1",
"concurrently": "^8.2.0",
"concurrently": "^8.2.1",
"copyfiles": "^2.4.1",
"mocha": "^10.2.0",
"pino": "^8.15.0",
"rimraf": "^5.0.1",
"sinon": "^15.2.0",
"pino": "^8.15.1",
"rimraf": "^5.0.5",
"sinon": "^16.0.0",
"sinon-chai": "^3.7.0",
"type-fest": "^4.2.0"
"type-fest": "^4.3.2"
}
}
2 changes: 2 additions & 0 deletions packages/ts/generator-typescript-cli/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDeclarationOnly": true,
"declarationMap": true,
"rootDir": "src",
"outDir": "."
},
Expand Down
35 changes: 18 additions & 17 deletions packages/ts/generator-typescript-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
"node": ">= 16.13"
},
"scripts": {
"clean:build": "rimraf *.{d.ts.map,d.ts,js.map,js}",
"clean:build": "git clean -fx . -e .vite -e node_modules",
"build": "concurrently npm:build:*",
"build:transpile": "tsc --isolatedModules -p ./tsconfig.build.json",
"build:esbuild": "tsx ../../../scripts/build.ts",
"build:dts": "tsc --isolatedModules -p tsconfig.build.json",
"build:copy": "cd src && copyfiles **/*.d.ts ..",
"lint": "eslint src test",
"lint:fix": "eslint src test --fix",
"test": "mocha test/**/*.spec.ts --config ../../../.mocharc.json",
"test:coverage": "c8 -c ../../../.c8rc.json npm test",
"typecheck": "tsc --noEmit",
"version": "node ../../../scripts/bump/package-update.js"
"typecheck": "tsc --noEmit"
},
"exports": {
".": {
Expand Down Expand Up @@ -71,25 +72,25 @@
},
"dependencies": {
"@apidevtools/swagger-parser": "^10.1.0",
"@hilla/generator-typescript-utils": "^2.2.0",
"meow": "^12.1.0",
"@hilla/generator-typescript-utils": "~2.2",
"meow": "^12.1.1",
"openapi-types": "^12.1.3",
"typescript": "^5.1.6"
"typescript": "^5.2.2"
},
"devDependencies": {
"@types/chai": "^4.3.5",
"@types/mocha": "^10.0.1",
"@types/node": "^20.5.0",
"@types/sinon": "^10.0.16",
"@types/sinon-chai": "^3.2.9",
"@types/chai": "^4.3.6",
"@types/mocha": "^10.0.2",
"@types/node": "^20.7.1",
"@types/sinon": "^10.0.17",
"@types/sinon-chai": "^3.2.10",
"c8": "^8.0.1",
"chai": "^4.3.7",
"concurrently": "^8.2.0",
"chai": "^4.3.10",
"concurrently": "^8.2.1",
"copyfiles": "^2.4.1",
"mocha": "^10.2.0",
"rimraf": "^5.0.1",
"sinon": "^15.2.0",
"rimraf": "^5.0.5",
"sinon": "^16.0.0",
"sinon-chai": "^3.7.0",
"type-fest": "^4.2.0"
"type-fest": "^4.3.2"
}
}
4 changes: 3 additions & 1 deletion packages/ts/generator-typescript-core/src/Plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type LoggerFactory from '@hilla/generator-typescript-utils/LoggerFactory.js';
// eslint-disable-next-line import/no-duplicates
import type { Logger } from '@hilla/generator-typescript-utils/LoggerFactory.js';
// eslint-disable-next-line import/no-duplicates
import type LoggerFactory from '@hilla/generator-typescript-utils/LoggerFactory.js';
import type { Constructor } from 'type-fest';
import type ReferenceResolver from './ReferenceResolver.js';
import type SharedStorage from './SharedStorage.js';
Expand Down
2 changes: 2 additions & 0 deletions packages/ts/generator-typescript-core/src/PluginManager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type LoggerFactory from '@hilla/generator-typescript-utils/LoggerFactory.js';
// eslint-disable-next-line import/no-duplicates
import type Plugin from './Plugin.js';
// eslint-disable-next-line import/no-duplicates
import type { PluginConstructor } from './Plugin.js';
import type ReferenceResolver from './ReferenceResolver.js';
import type SharedStorage from './SharedStorage.js';
Expand Down
2 changes: 2 additions & 0 deletions packages/ts/generator-typescript-core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDeclarationOnly": true,
"declarationMap": true,
"rootDir": "src",
"outDir": "."
},
Expand Down
Loading

0 comments on commit a9d4db6

Please sign in to comment.