Browse Source

Merge pull request #10607 from abpframework/feat/upgrade-nx

Upgrade NX to v13
pull/10612/head
Mehmet Erim 5 years ago
committed by GitHub
parent
commit
c7f3c8a13a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 122
      npm/ng-packs/angular.json
  2. 2
      npm/ng-packs/apps/dev-app-e2e/src/plugins/index.js
  3. 2
      npm/ng-packs/apps/dev-app-e2e/tsconfig.json
  4. 4
      npm/ng-packs/apps/dev-app/tsconfig.json
  5. 60
      npm/ng-packs/migrations.json
  6. 78
      npm/ng-packs/nx.json
  7. 67
      npm/ng-packs/package.json
  8. 2
      npm/ng-packs/packages/account-core/tsconfig.json
  9. 2
      npm/ng-packs/packages/account/tsconfig.json
  10. 2
      npm/ng-packs/packages/components/tsconfig.json
  11. 2
      npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts
  12. 2
      npm/ng-packs/packages/core/src/lib/tests/environment.service.spec.ts
  13. 9
      npm/ng-packs/packages/core/src/lib/tests/replaceable-template.directive.spec.ts
  14. 4
      npm/ng-packs/packages/core/tsconfig.json
  15. 2
      npm/ng-packs/packages/feature-management/tsconfig.json
  16. 2
      npm/ng-packs/packages/identity/tsconfig.json
  17. 2
      npm/ng-packs/packages/permission-management/tsconfig.json
  18. 2
      npm/ng-packs/packages/schematics/.eslintrc.json
  19. 2
      npm/ng-packs/packages/setting-management/tsconfig.json
  20. 2
      npm/ng-packs/packages/tenant-management/tsconfig.json
  21. 24
      npm/ng-packs/packages/theme-basic/src/lib/tests/lazy-style.handler.spec.ts
  22. 4
      npm/ng-packs/packages/theme-basic/tsconfig.json
  23. 2
      npm/ng-packs/packages/theme-shared/extensions/src/tests/entity-props.spec.ts
  24. 10
      npm/ng-packs/packages/theme-shared/extensions/src/tests/form-props.spec.ts
  25. 6
      npm/ng-packs/packages/theme-shared/extensions/src/tests/toolbar-actions.spec.ts
  26. 4
      npm/ng-packs/packages/theme-shared/src/lib/tests/breadcrumb.component.spec.ts
  27. 4
      npm/ng-packs/packages/theme-shared/src/lib/tests/button.component.spec.ts
  28. 2
      npm/ng-packs/packages/theme-shared/src/lib/tests/error.handler.spec.ts
  29. 9
      npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts
  30. 4
      npm/ng-packs/packages/theme-shared/tsconfig.json
  31. 2
      npm/ng-packs/source-code-requirements/tsconfig.lib.json
  32. 16
      npm/ng-packs/source-code-requirements/tsconfig.spec.json
  33. 2
      npm/ng-packs/tools/tsconfig.tools.json
  34. 2
      npm/ng-packs/tsconfig.base.json
  35. 2095
      npm/ng-packs/yarn.lock

122
npm/ng-packs/angular.json

@ -35,9 +35,12 @@
"builder": "@nrwl/linter:eslint", "builder": "@nrwl/linter:eslint",
"options": { "options": {
"lintFilePatterns": ["packages/account/src/**/*.ts", "packages/account/src/**/*.html"] "lintFilePatterns": ["packages/account/src/**/*.ts", "packages/account/src/**/*.html"]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared", "account-core"]
}, },
"account-core": { "account-core": {
"projectType": "library", "projectType": "library",
@ -76,9 +79,12 @@
"packages/account-core/src/**/*.ts", "packages/account-core/src/**/*.ts",
"packages/account-core/src/**/*.html" "packages/account-core/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared"]
}, },
"components": { "components": {
"projectType": "library", "projectType": "library",
@ -117,9 +123,12 @@
"packages/components/src/**/*.ts", "packages/components/src/**/*.ts",
"packages/components/src/**/*.html" "packages/components/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared"]
}, },
"core": { "core": {
"projectType": "library", "projectType": "library",
@ -155,9 +164,11 @@
"builder": "@nrwl/linter:eslint", "builder": "@nrwl/linter:eslint",
"options": { "options": {
"lintFilePatterns": ["packages/core/src/**/*.ts", "packages/core/src/**/*.html"] "lintFilePatterns": ["packages/core/src/**/*.ts", "packages/core/src/**/*.html"]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": []
}, },
"dev-app": { "dev-app": {
"projectType": "application", "projectType": "application",
@ -307,9 +318,12 @@
"builder": "@nrwl/linter:eslint", "builder": "@nrwl/linter:eslint",
"options": { "options": {
"lintFilePatterns": ["apps/dev-app-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/dev-app-e2e/**/*.{js,ts}"]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["dev-app"]
}, },
"feature-management": { "feature-management": {
"projectType": "library", "projectType": "library",
@ -348,9 +362,12 @@
"packages/feature-management/src/**/*.ts", "packages/feature-management/src/**/*.ts",
"packages/feature-management/src/**/*.html" "packages/feature-management/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared"]
}, },
"identity": { "identity": {
"projectType": "library", "projectType": "library",
@ -386,9 +403,12 @@
"builder": "@nrwl/linter:eslint", "builder": "@nrwl/linter:eslint",
"options": { "options": {
"lintFilePatterns": ["packages/identity/src/**/*.ts", "packages/identity/src/**/*.html"] "lintFilePatterns": ["packages/identity/src/**/*.ts", "packages/identity/src/**/*.html"]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared", "permission-management"]
}, },
"permission-management": { "permission-management": {
"projectType": "library", "projectType": "library",
@ -427,9 +447,12 @@
"packages/permission-management/src/**/*.ts", "packages/permission-management/src/**/*.ts",
"packages/permission-management/src/**/*.html" "packages/permission-management/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared"]
}, },
"schematics": { "schematics": {
"projectType": "library", "projectType": "library",
@ -452,9 +475,11 @@
"packages/schematics/src/**/*.ts", "packages/schematics/src/**/*.ts",
"packages/schematics/src/**/*.html" "packages/schematics/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": []
}, },
"setting-management": { "setting-management": {
"projectType": "library", "projectType": "library",
@ -493,9 +518,12 @@
"packages/setting-management/src/**/*.ts", "packages/setting-management/src/**/*.ts",
"packages/setting-management/src/**/*.html" "packages/setting-management/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared", "components"]
}, },
"tenant-management": { "tenant-management": {
"projectType": "library", "projectType": "library",
@ -534,9 +562,12 @@
"packages/tenant-management/src/**/*.ts", "packages/tenant-management/src/**/*.ts",
"packages/tenant-management/src/**/*.html" "packages/tenant-management/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared", "feature-management"]
}, },
"theme-basic": { "theme-basic": {
"projectType": "library", "projectType": "library",
@ -575,9 +606,12 @@
"packages/theme-basic/src/**/*.ts", "packages/theme-basic/src/**/*.ts",
"packages/theme-basic/src/**/*.html" "packages/theme-basic/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
} },
"tags": [],
"implicitDependencies": ["core", "theme-shared", "account-core"]
}, },
"theme-shared": { "theme-shared": {
"projectType": "library", "projectType": "library",
@ -616,42 +650,12 @@
"packages/theme-shared/src/**/*.ts", "packages/theme-shared/src/**/*.ts",
"packages/theme-shared/src/**/*.html" "packages/theme-shared/src/**/*.html"
] ]
} },
"outputs": ["{options.outputFile}"]
} }
}
}
},
"cli": {
"analytics": false,
"defaultCollection": "@nrwl/angular"
},
"schematics": {
"@nrwl/angular": {
"application": {
"linter": "eslint"
}, },
"library": { "tags": [],
"linter": "eslint" "implicitDependencies": ["core"]
},
"storybook-configuration": {
"linter": "eslint"
}
},
"@nrwl/angular:application": {
"style": "scss",
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
},
"@nrwl/angular:library": {
"style": "scss",
"linter": "eslint",
"unitTestRunner": "jest",
"strict": false
},
"@nrwl/angular:component": {
"style": "scss"
} }
}, }
"defaultProject": "dev-app"
} }

2
npm/ng-packs/apps/dev-app-e2e/src/plugins/index.js

@ -16,7 +16,5 @@ const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');
module.exports = (on, config) => { module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits // `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config // `config` is the resolved Cypress config
// Preprocess Typescript file using Nx helper // Preprocess Typescript file using Nx helper
on('file:preprocessor', preprocessTypescript(config));
}; };

2
npm/ng-packs/apps/dev-app-e2e/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

4
npm/ng-packs/apps/dev-app/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [
@ -18,7 +18,7 @@
"strict": false, "strict": false,
"noImplicitReturns": false, "noImplicitReturns": false,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true
}, },
"angularCompilerOptions": { "angularCompilerOptions": {
"strictInjectionParameters": true, "strictInjectionParameters": true,

60
npm/ng-packs/migrations.json

@ -0,0 +1,60 @@
{
"migrations": [
{
"version": "13.0.0-beta.1",
"description": "Add default base to nx.json if its not currently set",
"factory": "./src/migrations/update-13-0-0/set-default-base-if-not-set",
"cli": "nx",
"package": "@nrwl/workspace",
"name": "set-default-base-if-not-set"
},
{
"version": "13.0.0-beta.4",
"description": "Move global settings into nx.json, and project specific settings into workspace.json",
"cli": "nx",
"implementation": "./src/migrations/update-13-0-0/config-locations/config-locations",
"package": "@nrwl/workspace",
"name": "13-0-0-config-locations"
},
{
"cli": "nx",
"version": "12.9.0",
"description": "Fixes invalid importPaths for buildable and publishable libs.",
"factory": "./src/migrations/update-12-9-0/update-invalid-import-paths",
"package": "@nrwl/angular",
"name": "update-invalid-import-paths"
},
{
"cli": "nx",
"version": "13.0.0-beta.10",
"description": "Adds postcss packages needed for Tailwind support if ng-packagr is already installed.",
"factory": "./src/migrations/update-13-0-0/add-postcss-packages",
"package": "@nrwl/angular",
"name": "add-postcss-packages"
},
{
"cli": "nx",
"version": "12.8.0-beta.0",
"description": "Remove Typescript Preprocessor Plugin",
"factory": "./src/migrations/update-12-8-0/remove-typescript-plugin",
"package": "@nrwl/cypress",
"name": "remove-typescript-plugin"
},
{
"cli": "nx",
"version": "12.9.0-beta.0",
"description": "Add outputs for caching",
"factory": "./src/migrations/update-12-9-0/add-outputs",
"package": "@nrwl/linter",
"name": "add-outputs"
},
{
"cli": "nx",
"version": "12.9.0-beta.0",
"description": "Remove ESLint parserOptions.project config if no rules requiring type-checking are in use",
"factory": "./src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules",
"package": "@nrwl/linter",
"name": "remove-eslint-project-config-if-no-type-checking-rules-again"
}
]
}

78
npm/ng-packs/nx.json

@ -30,59 +30,37 @@
"libsDir": "packages", "libsDir": "packages",
"appsDir": "" "appsDir": ""
}, },
"projects": { "cli": {
"account-core": { "analytics": false,
"tags": [], "defaultCollection": "@nrwl/angular"
"implicitDependencies": ["core", "theme-shared"] },
}, "defaultProject": "dev-app",
"account": { "generators": {
"tags": [], "@nrwl/angular": {
"implicitDependencies": ["core", "theme-shared", "account-core"] "application": {
}, "linter": "eslint"
"components": { },
"tags": [], "library": {
"implicitDependencies": ["core", "theme-shared"] "linter": "eslint"
}, },
"core": { "storybook-configuration": {
"tags": [] "linter": "eslint"
}, }
"dev-app": {
"tags": []
},
"dev-app-e2e": {
"tags": [],
"implicitDependencies": ["dev-app"]
},
"feature-management": {
"tags": [],
"implicitDependencies": ["core", "theme-shared"]
},
"identity": {
"tags": [],
"implicitDependencies": ["core", "theme-shared", "permission-management"]
},
"permission-management": {
"tags": [],
"implicitDependencies": ["core", "theme-shared"]
},
"schematics": {
"tags": []
},
"setting-management": {
"tags": [],
"implicitDependencies": ["core", "theme-shared", "components"]
}, },
"tenant-management": { "@nrwl/angular:application": {
"tags": [], "style": "scss",
"implicitDependencies": ["core", "theme-shared", "feature-management"] "linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
}, },
"theme-basic": { "@nrwl/angular:library": {
"tags": [], "style": "scss",
"implicitDependencies": ["core", "theme-shared", "account-core"] "linter": "eslint",
"unitTestRunner": "jest",
"strict": false
}, },
"theme-shared": { "@nrwl/angular:component": {
"tags": [], "style": "scss"
"implicitDependencies": ["core"]
} }
} }
} }

67
npm/ng-packs/package.json

@ -49,70 +49,75 @@
"@abp/ng.theme.basic": "~5.0.0-beta.3", "@abp/ng.theme.basic": "~5.0.0-beta.3",
"@abp/ng.theme.shared": "~5.0.0-beta.3", "@abp/ng.theme.shared": "~5.0.0-beta.3",
"@abp/utils": "~5.0.0-beta.3", "@abp/utils": "~5.0.0-beta.3",
"@angular-devkit/build-angular": "~12.2.0", "@angular-devkit/build-angular": "12.2.13",
"@angular-devkit/build-ng-packagr": "^0.1002.0", "@angular-devkit/build-ng-packagr": "^0.1002.0",
"@angular-devkit/schematics-cli": "~12.2.0", "@angular-devkit/schematics-cli": "~12.2.0",
"@angular-eslint/eslint-plugin": "~12.3.0", "@angular-eslint/eslint-plugin": "~12.3.0",
"@angular-eslint/eslint-plugin-template": "~12.3.0", "@angular-eslint/eslint-plugin-template": "~12.3.0",
"@angular-eslint/template-parser": "~12.3.0", "@angular-eslint/template-parser": "~12.3.0",
"@angular/animations": "~12.2.0", "@angular/animations": "12.2.13",
"@angular/cli": "~12.2.0", "@angular/cli": "12.2.13",
"@angular/common": "~12.2.0", "@angular/common": "12.2.13",
"@angular/compiler": "~12.2.0", "@angular/compiler": "12.2.13",
"@angular/compiler-cli": "^12.2.0", "@angular/compiler-cli": "12.2.13",
"@angular/core": "~12.2.0", "@angular/core": "12.2.13",
"@angular/forms": "~12.2.0", "@angular/forms": "12.2.13",
"@angular/language-service": "^12.2.0", "@angular/language-service": "12.2.13",
"@angular/platform-browser": "~12.2.0", "@angular/platform-browser": "12.2.13",
"@angular/platform-browser-dynamic": "~12.2.0", "@angular/platform-browser-dynamic": "12.2.13",
"@angular/router": "~12.2.0", "@angular/router": "12.2.13",
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
"@ng-bootstrap/ng-bootstrap": "^11.0.0-beta.2", "@ng-bootstrap/ng-bootstrap": "^11.0.0-beta.2",
"@ngneat/spectator": "^8.0.3", "@ngneat/spectator": "^8.0.3",
"@ngx-validate/core": "^0.0.13", "@ngx-validate/core": "^0.0.13",
"@nrwl/angular": "12.6.5", "@nrwl/angular": "13.1.3",
"@nrwl/cli": "12.6.5", "@nrwl/cli": "13.1.3",
"@nrwl/cypress": "12.6.5", "@nrwl/cypress": "13.1.3",
"@nrwl/eslint-plugin-nx": "12.6.5", "@nrwl/eslint-plugin-nx": "13.1.3",
"@nrwl/jest": "12.6.5", "@nrwl/jest": "13.1.3",
"@nrwl/linter": "12.6.5", "@nrwl/linter": "13.1.3",
"@nrwl/tao": "12.6.5", "@nrwl/tao": "13.1.3",
"@nrwl/workspace": "12.6.5", "@nrwl/workspace": "13.1.3",
"@schematics/angular": "~12.2.0", "@schematics/angular": "~12.2.0",
"@swimlane/ngx-datatable": "^19.0.0", "@swimlane/ngx-datatable": "^19.0.0",
"@types/jest": "26.0.24", "@types/jest": "27.0.2",
"@types/node": "14.14.33", "@types/node": "14.14.33",
"@typescript-eslint/eslint-plugin": "~4.28.3", "@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "~4.28.3", "@typescript-eslint/parser": "4.33.0",
"angular-oauth2-oidc": "^12.1.0", "angular-oauth2-oidc": "^12.1.0",
"bootstrap": "^5.1.1", "bootstrap": "^5.1.1",
"chart.js": "^3.5.1", "chart.js": "^3.5.1",
"cypress": "^7.3.0", "cypress": "^7.3.0",
"dotenv": "~10.0.0", "dotenv": "10.0.0",
"eslint": "7.22.0", "eslint": "7.32.0",
"eslint-config-prettier": "8.1.0", "eslint-config-prettier": "8.1.0",
"eslint-plugin-cypress": "^2.10.3", "eslint-plugin-cypress": "^2.10.3",
"got": "^11.5.2", "got": "^11.5.2",
"jest": "27.0.3", "jest": "27.2.3",
"jest-canvas-mock": "^2.3.1", "jest-canvas-mock": "^2.3.1",
"jest-preset-angular": "9.0.4", "jest-preset-angular": "10.0.1",
"jsonc-parser": "^2.3.0", "jsonc-parser": "^2.3.0",
"just-clone": "^3.2.1", "just-clone": "^3.2.1",
"just-compare": "^1.4.0", "just-compare": "^1.4.0",
"lerna": "^4.0.0", "lerna": "^4.0.0",
"ng-packagr": "^12.2.0", "ng-packagr": "12.2.5",
"ng-zorro-antd": "^12.0.1", "ng-zorro-antd": "^12.0.1",
"postcss": "^8.3.9",
"postcss-import": "^14.0.2",
"postcss-preset-env": "^6.7.0",
"postcss-url": "^10.1.1",
"prettier": "^2.3.1", "prettier": "^2.3.1",
"protractor": "~7.0.0", "protractor": "~7.0.0",
"rxjs": "~6.6.0", "rxjs": "~6.6.0",
"should-quote": "^1.0.0", "should-quote": "^1.0.0",
"ts-jest": "27.0.3", "ts-jest": "27.0.5",
"ts-node": "~9.1.1", "ts-node": "~9.1.1",
"ts-toolbelt": "6.15.4", "ts-toolbelt": "6.15.4",
"tsickle": "^0.39.1", "tsickle": "^0.39.1",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"tslint": "~6.1.0", "tslint": "~6.1.0",
"typescript": "~4.3.5", "typescript": "4.3.5",
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
} },
"dependencies": {}
} }

2
npm/ng-packs/packages/account-core/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

2
npm/ng-packs/packages/account/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

2
npm/ng-packs/packages/components/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

2
npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts

@ -132,7 +132,7 @@ export class ReplaceableTemplateDirective implements OnInit, OnChanges {
} }
setProvidedData() { setProvidedData() {
this.providedData = { ...this.data, inputs: {}, outputs: {} }; this.providedData = { outputs: {}, ...this.data, inputs: {} };
if (!this.data.inputs) return; if (!this.data.inputs) return;
Object.defineProperties(this.providedData.inputs, { Object.defineProperties(this.providedData.inputs, {

2
npm/ng-packs/packages/core/src/lib/tests/environment.service.spec.ts

@ -54,7 +54,7 @@ describe('Environment', () => {
it( it(
'should return api url', 'should return api url',
waitForAsync(() => { waitForAsync(() => {
expect(environment.getApiUrl()).toEqual(ENVIRONMENT_DATA.apis.default.url); expect(environment.getApiUrl('default')).toEqual(ENVIRONMENT_DATA.apis.default.url);
environment environment
.getApiUrl$('other') .getApiUrl$('other')
.subscribe(data => expect(data).toEqual(ENVIRONMENT_DATA.apis.other.url)); .subscribe(data => expect(data).toEqual(ENVIRONMENT_DATA.apis.other.url));

9
npm/ng-packs/packages/core/src/lib/tests/replaceable-template.directive.spec.ts

@ -65,7 +65,14 @@ describe('ReplaceableTemplateDirective', () => {
<abp-default-component #defaultComponent="abpDefaultComponent"></abp-default-component> <abp-default-component #defaultComponent="abpDefaultComponent"></abp-default-component>
</div> </div>
`, `,
{ hostProps: { oneWay: { label: 'Test' }, twoWay: false, twoWayChange, someOutput } }, {
hostProps: {
oneWay: { label: 'Test' },
twoWay: false,
twoWayChange,
someOutput,
},
},
); );
const component = spectator.query(DefaultComponent); const component = spectator.query(DefaultComponent);

4
npm/ng-packs/packages/core/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [
@ -11,6 +11,6 @@
} }
], ],
"compilerOptions": { "compilerOptions": {
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true
} }
} }

2
npm/ng-packs/packages/feature-management/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

2
npm/ng-packs/packages/identity/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

2
npm/ng-packs/packages/permission-management/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

2
npm/ng-packs/packages/schematics/.eslintrc.json

@ -46,4 +46,4 @@
"rules": {} "rules": {}
} }
] ]
} }

2
npm/ng-packs/packages/setting-management/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

2
npm/ng-packs/packages/tenant-management/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [

24
npm/ng-packs/packages/theme-shared/src/lib/tests/lazy-style.handler.spec.ts → npm/ng-packs/packages/theme-basic/src/lib/tests/lazy-style.handler.spec.ts

@ -1,8 +1,8 @@
import { LazyLoadService, LOADING_STRATEGY, LocalizationService } from '@abp/ng.core'; import { LazyLoadService, LOADING_STRATEGY, LocalizationService } from '@abp/ng.core';
import { DocumentDirHandlerService } from '@abp/ng.theme.shared';
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest';
import { EMPTY, of } from 'rxjs'; import { of } from 'rxjs';
import { BOOTSTRAP } from '../constants/styles'; import { BOOTSTRAP, createLazyStyleHref, LazyStyleHandler } from '../handlers';
import { createLazyStyleHref, initLazyStyleHandler, LazyStyleHandler } from '../handlers';
const languageChange$ = of({ payload: 'en' }); const languageChange$ = of({ payload: 'en' });
@ -14,6 +14,7 @@ describe('LazyStyleHandler', () => {
const createService = createServiceFactory({ const createService = createServiceFactory({
service: LazyStyleHandler, service: LazyStyleHandler,
providers: [ providers: [
DocumentDirHandlerService,
{ {
provide: LocalizationService, provide: LocalizationService,
useValue: { currentLang: 'en', languageChange$ }, useValue: { currentLang: 'en', languageChange$ },
@ -47,20 +48,3 @@ describe('LazyStyleHandler', () => {
}); });
}); });
}); });
describe('initLazyStyleHandler', () => {
it('should return a LazyStyleHandler factory', () => {
const generator = (function* () {
yield undefined; // LAZY_STYLES
yield { loaded: new Map() }; // LazyLoadService
yield { currentLang: 'en', languageChange$: EMPTY }; // LocalizationService
})();
const injector = {
get: () => generator.next().value as any,
};
const factory = initLazyStyleHandler(injector);
expect(factory()).toBeInstanceOf(LazyStyleHandler);
});
});

4
npm/ng-packs/packages/theme-basic/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [
@ -11,6 +11,6 @@
} }
], ],
"compilerOptions": { "compilerOptions": {
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true
} }
} }

2
npm/ng-packs/packages/theme-shared/extensions/src/tests/entity-props.spec.ts

@ -101,7 +101,7 @@ describe('EntityProp', () => {
expect(prop.displayName).toBe(options.displayName); expect(prop.displayName).toBe(options.displayName);
expect(prop.permission).toBe(options.permission); expect(prop.permission).toBe(options.permission);
expect(prop.visible()).toBe(options.visible()); expect(prop.visible()).toBe(options.visible());
expect(prop.valueResolver()).toBe(options.valueResolver()); expect(prop.valueResolver(null)).toBe(options.valueResolver());
expect(prop.sortable).toBe(options.sortable); expect(prop.sortable).toBe(options.sortable);
expect(prop.columnWidth).toBe(options.columnWidth); expect(prop.columnWidth).toBe(options.columnWidth);
}); });

10
npm/ng-packs/packages/theme-shared/extensions/src/tests/form-props.spec.ts

@ -106,13 +106,13 @@ describe('FormProp', () => {
expect(prop.displayName).toBe(options.displayName); expect(prop.displayName).toBe(options.displayName);
expect(prop.permission).toBe(options.permission); expect(prop.permission).toBe(options.permission);
expect(prop.visible()).toBe(options.visible()); expect(prop.visible()).toBe(options.visible());
expect(prop.asyncValidators()).toEqual(options.asyncValidators()); expect(prop.asyncValidators(null)).toEqual(options.asyncValidators());
expect(prop.validators()).toEqual(options.validators()); expect(prop.validators(null)).toEqual(options.validators());
expect(prop.disabled()).toBe(options.disabled()); expect(prop.disabled()).toBe(options.disabled());
expect(prop.readonly()).toBe(options.readonly()); expect(prop.readonly()).toBe(options.readonly());
expect(prop.autocomplete).toBe(options.autocomplete); expect(prop.autocomplete).toBe(options.autocomplete);
expect(prop.defaultValue).toBe(options.defaultValue); expect(prop.defaultValue).toBe(options.defaultValue);
expect(prop.options()).toBe(options.options()); expect(prop.options(null)).toBe(options.options());
expect(prop.id).toBe(options.id); expect(prop.id).toBe(options.id);
}); });
@ -129,8 +129,8 @@ describe('FormProp', () => {
expect(prop.displayName).toBe(options.name); expect(prop.displayName).toBe(options.name);
expect(prop.permission).toBeUndefined(); expect(prop.permission).toBeUndefined();
expect(prop.visible()).toBe(true); expect(prop.visible()).toBe(true);
expect(prop.asyncValidators()).toEqual([]); expect(prop.asyncValidators(null)).toEqual([]);
expect(prop.validators()).toEqual([]); expect(prop.validators(null)).toEqual([]);
expect(prop.disabled()).toBe(false); expect(prop.disabled()).toBe(false);
expect(prop.readonly()).toBe(false); expect(prop.readonly()).toBe(false);
expect(prop.autocomplete).toBe('off'); expect(prop.autocomplete).toBe('off');

6
npm/ng-packs/packages/theme-shared/extensions/src/tests/toolbar-actions.spec.ts

@ -108,7 +108,7 @@ describe('ToolbarAction', () => {
expect(action.text).toBe(options.text); expect(action.text).toBe(options.text);
expect(action.action).toBe(options.action); expect(action.action).toBe(options.action);
expect(action.permission).toBeUndefined(); expect(action.permission).toBe('');
expect(action.visible(null)).toBe(true); expect(action.visible(null)).toBe(true);
expect(action.icon).toBe(''); expect(action.icon).toBe('');
}); });
@ -178,8 +178,8 @@ describe('ToolbarComponent', () => {
const action = new ToolbarComponent(options); const action = new ToolbarComponent(options);
expect(action.component).toBe(options.component); expect(action.component).toBe(options.component);
expect(action.action()).toBeUndefined(); expect(action.action(null)).toBeUndefined();
expect(action.permission).toBeUndefined(); expect(action.permission).toBe('');
expect(action.visible()).toBe(true); expect(action.visible()).toBe(true);
}); });

4
npm/ng-packs/packages/theme-shared/src/lib/tests/breadcrumb.component.spec.ts

@ -10,7 +10,7 @@ import { RouterModule } from '@angular/router';
import { createRoutingFactory, SpectatorRouting } from '@ngneat/spectator/jest'; import { createRoutingFactory, SpectatorRouting } from '@ngneat/spectator/jest';
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries // eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
import { mockRoutesService } from '../../../../core/src/lib/tests/routes.service.spec'; import { mockRoutesService } from '../../../../core/src/lib/tests/routes.service.spec';
import { BreadcrumbComponent } from '../components/breadcrumb/breadcrumb.component'; import { BreadcrumbComponent, BreadcrumbItemsComponent } from '../components';
const mockRoutes: ABP.Route[] = [ const mockRoutes: ABP.Route[] = [
{ name: 'Identity', path: '/identity' }, { name: 'Identity', path: '/identity' },
@ -33,7 +33,7 @@ describe('BreadcrumbComponent', () => {
useFactory: () => mockRoutesService(), useFactory: () => mockRoutesService(),
}, },
], ],
declarations: [LocalizationPipe, BreadcrumbComponent], declarations: [LocalizationPipe, BreadcrumbComponent, BreadcrumbItemsComponent],
imports: [RouterModule], imports: [RouterModule],
routes: [ routes: [
{ {

4
npm/ng-packs/packages/theme-shared/src/lib/tests/button.component.spec.ts

@ -52,8 +52,4 @@ describe('ButtonComponent', () => {
spectator.detectComponentChanges(); spectator.detectComponentChanges();
expect(spectator.query('[disabled]')).toBeTruthy(); expect(spectator.query('[disabled]')).toBeTruthy();
}); });
it('should disabled when the loading input is true', () => {
expect(spectator.query('[autofocus][name="abp-button"]')).toBeTruthy();
});
}); });

2
npm/ng-packs/packages/theme-shared/src/lib/tests/error.handler.spec.ts

@ -192,7 +192,7 @@ describe('ErrorHandler', () => {
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError.title, key: DEFAULT_ERROR_LOCALIZATIONS.defaultError.title,
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError.title, defaultValue: DEFAULT_ERROR_MESSAGES.defaultError.title,
}, },
null, '',
CONFIRMATION_BUTTONS, CONFIRMATION_BUTTONS,
); );
}); });

9
npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts

@ -1,9 +1,9 @@
import { HttpWaitService, LOADER_DELAY, SubscriptionService } from '@abp/ng.core';
import { HttpRequest } from '@angular/common/http';
import { NavigationEnd, NavigationError, NavigationStart, Router } from '@angular/router'; import { NavigationEnd, NavigationError, NavigationStart, Router } from '@angular/router';
import { createComponentFactory, Spectator, SpyObject } from '@ngneat/spectator/jest'; import { createComponentFactory, Spectator, SpyObject } from '@ngneat/spectator/jest';
import { Subject, timer } from 'rxjs'; import { Subject, timer } from 'rxjs';
import { LoaderBarComponent } from '../components/loader-bar/loader-bar.component'; import { LoaderBarComponent } from '../components/loader-bar/loader-bar.component';
import { HttpWaitService, LOADER_DELAY, SubscriptionService } from '@abp/ng.core';
import { HttpRequest } from '@angular/common/http';
describe('LoaderBarComponent', () => { describe('LoaderBarComponent', () => {
let spectator: Spectator<LoaderBarComponent>; let spectator: Spectator<LoaderBarComponent>;
@ -44,10 +44,13 @@ describe('LoaderBarComponent', () => {
}); });
it('should be interval unsubscribed', done => { it('should be interval unsubscribed', done => {
const request = new HttpRequest('GET', 'test');
spectator.detectChanges(); spectator.detectChanges();
const httpWaitService = spectator.inject(HttpWaitService); const httpWaitService = spectator.inject(HttpWaitService);
httpWaitService.addRequest(new HttpRequest('GET', 'test')); httpWaitService.addRequest(request);
expect(spectator.component.interval.closed).toBe(false); expect(spectator.component.interval.closed).toBe(false);
httpWaitService.deleteRequest(request);
timer(400).subscribe(() => { timer(400).subscribe(() => {
expect(spectator.component.interval.closed).toBe(true); expect(spectator.component.interval.closed).toBe(true);
done(); done();

4
npm/ng-packs/packages/theme-shared/tsconfig.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [
@ -11,6 +11,6 @@
} }
], ],
"compilerOptions": { "compilerOptions": {
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true
} }
} }

2
npm/ng-packs/source-code-requirements/tsconfig.lib.json

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../../out-tsc/lib", "outDir": "../../out-tsc/lib",
"target": "es2015", "target": "es2015",

16
npm/ng-packs/source-code-requirements/tsconfig.spec.json

@ -1,17 +1,9 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../../out-tsc/spec", "outDir": "../../out-tsc/spec",
"types": [ "types": ["jasmine", "node"]
"jasmine",
"node"
]
}, },
"files": [ "files": ["src/test.ts"],
"src/test.ts" "include": ["**/*.spec.ts", "**/*.d.ts"]
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
} }

2
npm/ng-packs/tools/tsconfig.tools.json

@ -1,5 +1,5 @@
{ {
"extends": "../tsconfig.json", "extends": "../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../dist/out-tsc/tools", "outDir": "../dist/out-tsc/tools",
"rootDir": ".", "rootDir": ".",

2
npm/ng-packs/tsconfig.json → npm/ng-packs/tsconfig.base.json

@ -37,8 +37,8 @@
"@abp/ng.setting-management": ["packages/setting-management/src/public-api.ts"], "@abp/ng.setting-management": ["packages/setting-management/src/public-api.ts"],
"@abp/ng.setting-management/config": ["packages/setting-management/config/src/public-api.ts"], "@abp/ng.setting-management/config": ["packages/setting-management/config/src/public-api.ts"],
"@abp/ng.tenant-management": ["packages/tenant-management/src/public-api.ts"], "@abp/ng.tenant-management": ["packages/tenant-management/src/public-api.ts"],
"@abp/ng.tenant-management/proxy": ["packages/tenant-management/proxy/src/public-api.ts"],
"@abp/ng.tenant-management/config": ["packages/tenant-management/config/src/public-api.ts"], "@abp/ng.tenant-management/config": ["packages/tenant-management/config/src/public-api.ts"],
"@abp/ng.tenant-management/proxy": ["packages/tenant-management/proxy/src/public-api.ts"],
"@abp/ng.theme.basic": ["packages/theme-basic/src/public-api.ts"], "@abp/ng.theme.basic": ["packages/theme-basic/src/public-api.ts"],
"@abp/ng.theme.basic/testing": ["packages/theme-basic/testing/src/public-api.ts"], "@abp/ng.theme.basic/testing": ["packages/theme-basic/testing/src/public-api.ts"],
"@abp/ng.theme.shared": ["packages/theme-shared/src/public-api.ts"], "@abp/ng.theme.shared": ["packages/theme-shared/src/public-api.ts"],

2095
npm/ng-packs/yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save