diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index f83b6925ce..bff18f57aa 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -32,7 +32,7 @@ "dep-graph": "nx dep-graph", "help": "nx help", "build:schematics": "cd scripts && yarn && yarn build:schematics && cd ..", - "dev:schematics": "tsc -p packages/schematics/tsconfig.json -w", + "dev:schematics": "tsc -p packages/schematics/tsconfig.lib.json -w", "mock:schematics": "cd scripts/mock-schematic && yarn && yarn start", "debug:schematics": "./node_modules/.bin/nx g ./packages/schematics/src/collection.json:proxy-add --module identity --apiName __default --source __default --target __default --url https://localhost:44305 --serviceType application --entryPoint __default ", "debug:schematics-dist": "./node_modules/.bin/ng g ./dist/packages/schematics/collection.json:proxy-add --module __default --apiName __default --source __default --target __default --url http://localhost:4300 --service-type application --entryPoint __default", diff --git a/npm/ng-packs/packages/generators/package.json b/npm/ng-packs/packages/generators/package.json index 075a64a575..5825fd23e8 100644 --- a/npm/ng-packs/packages/generators/package.json +++ b/npm/ng-packs/packages/generators/package.json @@ -8,6 +8,9 @@ "type": "git", "url": "https://github.com/abpframework/abp.git" }, + "dependencies": { + "tslib": "^2.3.0" + }, "publishConfig": { "access": "public" } diff --git a/npm/ng-packs/packages/generators/project.json b/npm/ng-packs/packages/generators/project.json index e0215aa306..b773237fa2 100644 --- a/npm/ng-packs/packages/generators/project.json +++ b/npm/ng-packs/packages/generators/project.json @@ -49,7 +49,7 @@ "executor": "@nx/vitest:test", "outputs": ["{options.reportsDirectory}"], "options": { - "reportsDirectory": "../../coverage/packages/generators" + "reportsDirectory": "{projectRoot}/../../coverage/packages/generators" } } } diff --git a/npm/ng-packs/packages/generators/tsconfig.json b/npm/ng-packs/packages/generators/tsconfig.json index 8d1999ff05..3ce2b36939 100644 --- a/npm/ng-packs/packages/generators/tsconfig.json +++ b/npm/ng-packs/packages/generators/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "module": "commonjs", "skipLibCheck": true, - "moduleResolution": "node" + "moduleResolution": "bundler" }, "files": [], "include": [], diff --git a/npm/ng-packs/packages/schematics/package.json b/npm/ng-packs/packages/schematics/package.json index 3bd6ee7c44..e8d1a3dbcb 100644 --- a/npm/ng-packs/packages/schematics/package.json +++ b/npm/ng-packs/packages/schematics/package.json @@ -4,16 +4,16 @@ "author": "", "schematics": "./collection.json", "dependencies": { - "@angular-devkit/core": "~21.2.0", - "@angular-devkit/schematics": "~21.2.0", - "@angular/cli": "~21.2.0", + "@angular-devkit/core": "~22.0.0", + "@angular-devkit/schematics": "~22.0.0", + "@angular/cli": "~22.0.0", "got": "^11.5.2", "jsonc-parser": "^2.3.0", "should-quote": "^1.0.0", - "typescript": "~5.9.0" + "typescript": "~6.0.3" }, "devDependencies": { - "@schematics/angular": "~21.2.0", + "@schematics/angular": "~22.0.0", "@types/jest": "29.4.4", "@types/node": "20.2.5", "jest": "29.4.3", diff --git a/npm/ng-packs/packages/schematics/project.json b/npm/ng-packs/packages/schematics/project.json index d12fff2738..77ccc4bf3a 100644 --- a/npm/ng-packs/packages/schematics/project.json +++ b/npm/ng-packs/packages/schematics/project.json @@ -14,7 +14,7 @@ "executor": "@nx/vitest:test", "outputs": ["{options.reportsDirectory}"], "options": { - "reportsDirectory": "../../coverage/packages/schematics" + "reportsDirectory": "{projectRoot}/../../coverage/packages/schematics" } } } diff --git a/npm/ng-packs/packages/schematics/src/commands/change-theme/index.ts b/npm/ng-packs/packages/schematics/src/commands/change-theme/index.ts index bb455103f7..c8384cec24 100644 --- a/npm/ng-packs/packages/schematics/src/commands/change-theme/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/change-theme/index.ts @@ -1,6 +1,5 @@ import { JsonArray, JsonValue } from '@angular-devkit/core'; import { Rule, SchematicsException, Tree, chain } from '@angular-devkit/schematics'; -import { ProjectDefinition } from '@angular-devkit/core/src/workspace'; import * as ts from 'typescript'; import { allStyles, importMap, styleMap } from './style-map'; import { ChangeThemeOptions } from './model'; @@ -11,6 +10,7 @@ import { isLibrary, isStandaloneApp, updateWorkspace, + ProjectDefinition, WorkspaceDefinition, getAppConfigPath, cleanEmptyExprFromModule, diff --git a/npm/ng-packs/packages/schematics/src/commands/ssr-add/server/index.ts b/npm/ng-packs/packages/schematics/src/commands/ssr-add/server/index.ts index 3cd2d0371c..967d1120ea 100644 --- a/npm/ng-packs/packages/schematics/src/commands/ssr-add/server/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/ssr-add/server/index.ts @@ -259,9 +259,13 @@ export default function (options: ServerOptions): Rule { 'withEventReplay', '@angular/platform-browser', )}(), ${external( - 'withIncrementalHydration', + 'withNoIncrementalHydration', '@angular/platform-browser', - )}(), ${external('withHttpTransferCacheOptions', '@angular/platform-browser')}({}))`, + )}(), ${external('withHttpTransferCacheOptions', '@angular/platform-browser')}({ + filter: req => + !req.url.includes('application-configuration') && + !req.url.includes('application-localization'), + }))`, ), ]); }; diff --git a/npm/ng-packs/packages/schematics/tsconfig.json b/npm/ng-packs/packages/schematics/tsconfig.json index dcccc6bde1..3a8c07cc89 100644 --- a/npm/ng-packs/packages/schematics/tsconfig.json +++ b/npm/ng-packs/packages/schematics/tsconfig.json @@ -1,24 +1,18 @@ { + "extends": "../../tsconfig.base.json", "compilerOptions": { - "baseUrl": "tsconfig", - "lib": ["es2020", "dom"], - "declaration": true, - "module": "commonjs", - "moduleResolution": "node", - "noEmitOnError": true, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitThis": true, - "noUnusedParameters": true, - "noUnusedLocals": true, - "rootDir": "src/", - "skipDefaultLibCheck": true, + "module": "node16", "skipLibCheck": true, - "sourceMap": true, - "strictNullChecks": true, - "target": "es2020", - "types": ["jest", "node"] + "moduleResolution": "node16" }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "src/*/files/**/*", "**/*.spec.ts", "jest.config.ts"] + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] } diff --git a/npm/ng-packs/packages/schematics/tsconfig.lib.json b/npm/ng-packs/packages/schematics/tsconfig.lib.json new file mode 100644 index 0000000000..91d173810d --- /dev/null +++ b/npm/ng-packs/packages/schematics/tsconfig.lib.json @@ -0,0 +1,21 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "lib": ["es2020", "dom"], + "declaration": true, + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedParameters": true, + "noUnusedLocals": true, + "rootDir": "src/", + "skipDefaultLibCheck": true, + "sourceMap": true, + "strictNullChecks": true, + "target": "es2020", + "types": ["jest", "node"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "src/*/files/**/*", "**/*.spec.ts", "jest.config.ts"] +} diff --git a/npm/ng-packs/scripts/build-schematics.ts b/npm/ng-packs/scripts/build-schematics.ts index bdf2e66392..f5aa97db4b 100644 --- a/npm/ng-packs/scripts/build-schematics.ts +++ b/npm/ng-packs/scripts/build-schematics.ts @@ -1,5 +1,9 @@ import execa from 'execa'; import fse from 'fs-extra'; +import { join } from 'path'; + +const NG_PACKS_ROOT = join(__dirname, '..'); +const TSC_PATH = join(NG_PACKS_ROOT, 'node_modules/typescript/bin/tsc'); class FileCopy { src: string; @@ -76,16 +80,16 @@ async function* copyPackageFiles(packageName: string) { await execa('yarn', ['install'], { stdout: 'inherit', cwd: `../packages/${PACKAGE_TO_BUILD}` }); await execa( - 'tsc', + TSC_PATH, [ '-p', - `packages/${PACKAGE_TO_BUILD}/tsconfig.json`, + `packages/${PACKAGE_TO_BUILD}/tsconfig.lib.json`, '--outDir', `dist/packages/${PACKAGE_TO_BUILD}`, ], { stdout: 'inherit', - cwd: '../', + cwd: NG_PACKS_ROOT, }, );