diff --git a/packages/nx-webpack-plugin/.eslintrc.json b/packages/nx-webpack-plugin/.eslintrc.json deleted file mode 100644 index f0f8c2dc4..000000000 --- a/packages/nx-webpack-plugin/.eslintrc.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "parserOptions": { - "project": ["packages/nx-webpack-plugin/tsconfig.*?.json"] - }, - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.json"], - "parser": "jsonc-eslint-parser", - "rules": { - "@nx/dependency-checks": "error" - } - } - ] -} diff --git a/packages/nx-webpack-plugin/README.md b/packages/nx-webpack-plugin/README.md deleted file mode 100644 index d2303f4d3..000000000 --- a/packages/nx-webpack-plugin/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# nx-webpack-plugin - -This library was generated with [Nx](https://nx.dev). - -## Building - -Run `nx build nx-webpack-plugin` to build the library. - -## Running unit tests - -Run `nx test nx-webpack-plugin` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/packages/nx-webpack-plugin/jest.config.ts b/packages/nx-webpack-plugin/jest.config.ts deleted file mode 100644 index 7b263a484..000000000 --- a/packages/nx-webpack-plugin/jest.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Config } from 'jest'; - -export default { - displayName: 'nx-webpack-plugin', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/packages/nx-webpack-plugin', -} as Config; diff --git a/packages/nx-webpack-plugin/package.json b/packages/nx-webpack-plugin/package.json deleted file mode 100644 index 949ec6169..000000000 --- a/packages/nx-webpack-plugin/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@deepkit/nx-webpack-plugin", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "https://github.com/marcus-sa/deepkit-community.git" - }, - "dependencies": { - "tslib": "2.6.2", - "webpack": "5.88.2", - "ts-loader": "9.4.4" - }, - "peerDependencies": { - "@deepkit/type-compiler": "*", - "@nx/webpack": "^16.7.4" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/nx-webpack-plugin/project.json b/packages/nx-webpack-plugin/project.json deleted file mode 100644 index e6c21ea03..000000000 --- a/packages/nx-webpack-plugin/project.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "nx-webpack-plugin", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "packages/nx-webpack-plugin/src", - "projectType": "library", - "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/{projectRoot}", - "tsConfig": "{projectRoot}/tsconfig.lib.json", - "packageJson": "{projectRoot}/package.json", - "main": "{projectRoot}/src/index.ts", - "assets": ["{projectRoot}/*.md"] - } - }, - "release": { - "command": "release-it --config={projectRoot}/.release-it.json" - }, - "lint": { - "executor": "@nx/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": [ - "{projectRoot}/**/*.ts", - "{projectRoot}/package.json" - ] - } - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "{projectRoot}/jest.config.ts", - "passWithNoTests": true - }, - "configurations": { - "ci": { - "ci": true, - "codeCoverage": true - } - } - } - }, - "tags": ["nx-webpack-plugin"] -} diff --git a/packages/nx-webpack-plugin/src/index.ts b/packages/nx-webpack-plugin/src/index.ts deleted file mode 100644 index aabfed313..000000000 --- a/packages/nx-webpack-plugin/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './lib/with-deepkit'; diff --git a/packages/nx-webpack-plugin/src/lib/with-deepkit.ts b/packages/nx-webpack-plugin/src/lib/with-deepkit.ts deleted file mode 100644 index a3d28a282..000000000 --- a/packages/nx-webpack-plugin/src/lib/with-deepkit.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { NxWebpackPlugin } from '@nx/webpack'; -import type { RuleSetRule } from 'webpack'; -import type { LoaderOptions } from 'ts-loader/dist/interfaces'; -import * as typeCompiler from '@deepkit/type-compiler'; - -interface TsLoaderRule extends RuleSetRule { - readonly options: LoaderOptions; -} - -type GetCustomTransformers = Exclude< -LoaderOptions['getCustomTransformers'], -string ->; - -function addDeepkitTransformer( - prevGetCustomTransformers: GetCustomTransformers, -): GetCustomTransformers { - return (program, getProgram) => { - const customTransformers = { - ...prevGetCustomTransformers?.(program, getProgram), - }; - customTransformers.before = [ - typeCompiler.transformer, - ...(customTransformers.before || []), - ]; - customTransformers.afterDeclarations = [ - typeCompiler.declarationTransformer, - ...(customTransformers.afterDeclarations || []), - ]; - return customTransformers; - }; -} - -export function withDeepkit(): NxWebpackPlugin { - return config => { - const rules = config.module!.rules! as readonly RuleSetRule[]; - - rules - .filter( - (rule): rule is TsLoaderRule => !!rule.loader?.includes('ts-loader'), - ) - .forEach(tsRule => { - tsRule.options!.getCustomTransformers = addDeepkitTransformer( - tsRule.options.getCustomTransformers as GetCustomTransformers, - ); - }); - - return config; - }; -} diff --git a/packages/nx-webpack-plugin/tsconfig.json b/packages/nx-webpack-plugin/tsconfig.json deleted file mode 100644 index 4a955f678..000000000 --- a/packages/nx-webpack-plugin/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "module": "commonjs" - }, - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - } - ], - "reflection": true -} diff --git a/packages/nx-webpack-plugin/tsconfig.lib.json b/packages/nx-webpack-plugin/tsconfig.lib.json deleted file mode 100644 index ae507b2d8..000000000 --- a/packages/nx-webpack-plugin/tsconfig.lib.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "../../dist/out-tsc", - "declaration": true, - "types": ["node"] - }, - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], - "include": ["src/**/*.ts"], - "reflection": true -} diff --git a/packages/nx-webpack-plugin/tsconfig.spec.json b/packages/nx-webpack-plugin/tsconfig.spec.json deleted file mode 100644 index 0a3e02d10..000000000 --- a/packages/nx-webpack-plugin/tsconfig.spec.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ], - "reflection": true -} diff --git a/tsconfig.base.json b/tsconfig.base.json index 55b670f56..0ba92aa7c 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,73 +1,90 @@ { - "compileOnSave": false, - "compilerOptions": { - "rootDir": ".", - "sourceMap": true, - "declaration": false, - "moduleResolution": "node", - "strict": true, - "emitDecoratorMetadata": true, - "resolveJsonModule": true, - "experimentalDecorators": true, - "strictPropertyInitialization": false, - "useDefineForClassFields": false, - "importHelpers": true, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "target": "esnext", - "noImplicitAny": false, - "module": "esnext", - "lib": ["esnext", "dom"], - "skipLibCheck": true, - "skipDefaultLibCheck": true, - "baseUrl": ".", - "paths": { - "@deepkit/angular-universal": ["packages/angular-universal/src/index.ts"], - "@deepkit/api-console-api": ["packages/api-console-api/src/index.ts"], - "@deepkit/api-console-gui": ["packages/api-console-gui/src/index.ts"], - "@deepkit/api-console-module": ["packages/api-console-module/src/index.ts"], - "@deepkit/app": ["packages/app/src/index.ts"], - "@deepkit/broker": ["packages/broker/src/index.ts"], - "@deepkit/bson": ["packages/bson/src/index.ts"], - "@deepkit/core": ["packages/core/src/index.ts"], - "@deepkit/core-rxjs": ["packages/core-rxjs/src/index.ts"], - "@deepkit/crypto": ["packages/crypto/src/index.ts"], - "@deepkit/desktop-ui": ["packages/desktop-ui/src/index.ts"], - "@deepkit/event": ["packages/event/src/index.ts"], - "@deepkit/framework": ["packages/framework/src/index.ts"], - "@deepkit/framework-debug-api": ["packages/framework-debug-api/src/index.ts"], - "@deepkit/fs": ["packages/fs/src/index.ts"], - "@deepkit/http": ["packages/http/src/index.ts"], - "@deepkit/injector": ["packages/injector/src/index.ts"], - "@deepkit/logger": ["packages/logger/src/index.ts"], - "@deepkit/mongo": ["packages/mongo/src/index.ts"], - "@deepkit/mysql": ["packages/mysql/src/index.ts"], - "@deepkit/nx-webpack-plugin": ["packages/nx-webpack-plugin/src/index.ts"], - "@deepkit/orm": ["packages/orm/src/index.ts"], - "@deepkit/orm-browser": ["packages/orm-browser/src/index.ts"], - "@deepkit/orm-browser-api": ["packages/orm-browser-api/src/index.ts"], - "@deepkit/orm-browser-gui": ["packages/orm-browser-gui/src/index.ts"], - "@deepkit/orm-browser-module": ["packages/orm-browser-module/src/index.ts"], - "@deepkit/orm-integration": ["packages/orm-integration/src/index.ts"], - "@deepkit/postgres": ["packages/postgres/src/index.ts"], - "@deepkit/rpc": ["packages/rpc/src/index.ts"], - "@deepkit/rpc-tcp": ["packages/rpc-tcp/src/index.ts"], - "@deepkit/sql": ["packages/sql/src/index.ts"], - "@deepkit/sql/commands": ["packages/sql/src/commands.ts"], - "@deepkit/sqlite": ["packages/sqlite/src/index.ts"], - "@deepkit/stopwatch": ["packages/stopwatch/src/index.ts"], - "@deepkit/template": ["packages/template/src/index.ts"], - "@deepkit/topsort": ["packages/topsort/src/index.ts"], - "@deepkit/type": ["packages/type/src/index.ts"], - "@deepkit/type-angular": ["packages/type-angular/src/index.ts"], - "@deepkit/type-compiler": ["packages/type-compiler/src/index.ts"], - "@deepkit/type-spec": ["packages/type-spec/src/index.ts"], - "@deepkit/ui-library": ["packages/ui-library/src/index.ts"], - "@deepkit/vite": ["packages/vite/src/index.ts"], - "@deepkit/workflow": ["packages/workflow/src/index.ts"] - } - }, - "exclude": ["node_modules", "tmp"] + "compileOnSave": false, + "compilerOptions": { + "rootDir": ".", + "sourceMap": true, + "declaration": false, + "moduleResolution": "node", + "strict": true, + "emitDecoratorMetadata": true, + "resolveJsonModule": true, + "experimentalDecorators": true, + "strictPropertyInitialization": false, + "useDefineForClassFields": false, + "importHelpers": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "target": "esnext", + "noImplicitAny": false, + "module": "esnext", + "lib": ["esnext", "dom"], + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "baseUrl": ".", + "paths": { + "@deepkit/angular-universal": [ + "packages/angular-universal/src/index.ts" + ], + "@deepkit/api-console-api": [ + "packages/api-console-api/src/index.ts" + ], + "@deepkit/api-console-gui": [ + "packages/api-console-gui/src/index.ts" + ], + "@deepkit/api-console-module": [ + "packages/api-console-module/src/index.ts" + ], + "@deepkit/app": ["packages/app/src/index.ts"], + "@deepkit/broker": ["packages/broker/src/index.ts"], + "@deepkit/bson": ["packages/bson/src/index.ts"], + "@deepkit/core": ["packages/core/src/index.ts"], + "@deepkit/core-rxjs": ["packages/core-rxjs/src/index.ts"], + "@deepkit/crypto": ["packages/crypto/src/index.ts"], + "@deepkit/desktop-ui": ["packages/desktop-ui/src/index.ts"], + "@deepkit/event": ["packages/event/src/index.ts"], + "@deepkit/framework": ["packages/framework/src/index.ts"], + "@deepkit/framework-debug-api": [ + "packages/framework-debug-api/src/index.ts" + ], + "@deepkit/fs": ["packages/fs/src/index.ts"], + "@deepkit/http": ["packages/http/src/index.ts"], + "@deepkit/injector": ["packages/injector/src/index.ts"], + "@deepkit/logger": ["packages/logger/src/index.ts"], + "@deepkit/mongo": ["packages/mongo/src/index.ts"], + "@deepkit/mysql": ["packages/mysql/src/index.ts"], + "@deepkit/orm": ["packages/orm/src/index.ts"], + "@deepkit/orm-browser": ["packages/orm-browser/src/index.ts"], + "@deepkit/orm-browser-api": [ + "packages/orm-browser-api/src/index.ts" + ], + "@deepkit/orm-browser-gui": [ + "packages/orm-browser-gui/src/index.ts" + ], + "@deepkit/orm-browser-module": [ + "packages/orm-browser-module/src/index.ts" + ], + "@deepkit/orm-integration": [ + "packages/orm-integration/src/index.ts" + ], + "@deepkit/postgres": ["packages/postgres/src/index.ts"], + "@deepkit/rpc": ["packages/rpc/src/index.ts"], + "@deepkit/rpc-tcp": ["packages/rpc-tcp/src/index.ts"], + "@deepkit/sql": ["packages/sql/src/index.ts"], + "@deepkit/sql/commands": ["packages/sql/src/commands.ts"], + "@deepkit/sqlite": ["packages/sqlite/src/index.ts"], + "@deepkit/stopwatch": ["packages/stopwatch/src/index.ts"], + "@deepkit/template": ["packages/template/src/index.ts"], + "@deepkit/topsort": ["packages/topsort/src/index.ts"], + "@deepkit/type": ["packages/type/src/index.ts"], + "@deepkit/type-angular": ["packages/type-angular/src/index.ts"], + "@deepkit/type-compiler": ["packages/type-compiler/src/index.ts"], + "@deepkit/type-spec": ["packages/type-spec/src/index.ts"], + "@deepkit/ui-library": ["packages/ui-library/src/index.ts"], + "@deepkit/vite": ["packages/vite/src/index.ts"], + "@deepkit/workflow": ["packages/workflow/src/index.ts"] + } + }, + "exclude": ["node_modules", "tmp"] }