From c0aa1414ede4745468e58ae1c113a461e8773a68 Mon Sep 17 00:00:00 2001 From: Jan-Robin Aumann <136792097+bmo-at-a9s@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:12:14 +0200 Subject: [PATCH] Apply changes from https://github.com/cloudfoundry/stratos/pull/4583 (#33) --- angular.json | 40 +++++++++++++++++++ src/frontend/packages/extension/karma.conf.js | 8 ++++ .../packages/extension/ng-package.json | 8 ++++ src/frontend/packages/extension/package.json | 8 ++++ .../extension/src/extension.module.ts | 7 ++++ .../packages/extension/src/public-api.ts | 5 +++ .../packages/extension/tsconfig.lib.json | 7 ++++ .../packages/extension/tsconfig.lib.prod.json | 6 +++ .../packages/extension/tsconfig.spec.json | 9 +++++ src/frontend/packages/extension/tslint.json | 17 ++++++++ src/tsconfig.json | 2 + 11 files changed, 117 insertions(+) create mode 100644 src/frontend/packages/extension/karma.conf.js create mode 100644 src/frontend/packages/extension/ng-package.json create mode 100644 src/frontend/packages/extension/package.json create mode 100644 src/frontend/packages/extension/src/extension.module.ts create mode 100644 src/frontend/packages/extension/src/public-api.ts create mode 100644 src/frontend/packages/extension/tsconfig.lib.json create mode 100644 src/frontend/packages/extension/tsconfig.lib.prod.json create mode 100644 src/frontend/packages/extension/tsconfig.spec.json create mode 100644 src/frontend/packages/extension/tslint.json diff --git a/angular.json b/angular.json index 6e4c5a829a..74e771a525 100644 --- a/angular.json +++ b/angular.json @@ -269,6 +269,46 @@ } } }, + "extension": { + "root": "src/frontend/packages/extension", + "sourceRoot": "src/frontend/packages/extension/src", + "projectType": "library", + "prefix": "ext", + "architect": { + "build": { + "builder": "@angular-devkit/build-ng-packagr:build", + "options": { + "tsConfig": "src/frontend/packages/extension/tsconfig.lib.json", + "project": "src/frontend/packages/extension/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "src/frontend/packages/extension/tsconfig.lib.prod.json" + } + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/frontend/packages/extension/src/test.ts", + "tsConfig": "src/frontend/packages/extension/tsconfig.spec.json", + "karmaConfig": "src/frontend/packages/extension/karma.conf.js" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.json" + ], + "tslintConfig": "src/frontend/packages/extension/tslint.json", + "files": [ + "src/frontend/packages/extension/src/**/*.ts" + ] + } + } + } + }, "shared": { "root": "src/frontend/packages/shared", "sourceRoot": "src/frontend/packages/shared/src", diff --git a/src/frontend/packages/extension/karma.conf.js b/src/frontend/packages/extension/karma.conf.js new file mode 100644 index 0000000000..b5e6358868 --- /dev/null +++ b/src/frontend/packages/extension/karma.conf.js @@ -0,0 +1,8 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + ...require('../../../../build/karma.conf.creator.js')('extension')(config) + }) + } \ No newline at end of file diff --git a/src/frontend/packages/extension/ng-package.json b/src/frontend/packages/extension/ng-package.json new file mode 100644 index 0000000000..fa3f700997 --- /dev/null +++ b/src/frontend/packages/extension/ng-package.json @@ -0,0 +1,8 @@ +{ + "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../../../dist/extension", + "lib": { + "entryFile": "src/public-api.ts", + "umdModuleIds": {} + } +} \ No newline at end of file diff --git a/src/frontend/packages/extension/package.json b/src/frontend/packages/extension/package.json new file mode 100644 index 0000000000..a1c36d8225 --- /dev/null +++ b/src/frontend/packages/extension/package.json @@ -0,0 +1,8 @@ +{ + "name": "@stratosui/extension", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^9.1.6", + "@angular/core": "^9.1.6" + } +} \ No newline at end of file diff --git a/src/frontend/packages/extension/src/extension.module.ts b/src/frontend/packages/extension/src/extension.module.ts new file mode 100644 index 0000000000..4f7c4f110b --- /dev/null +++ b/src/frontend/packages/extension/src/extension.module.ts @@ -0,0 +1,7 @@ +import { NgModule } from '@angular/core'; + +@NgModule({ + imports: [ + ] +}) +export class ExtensionModule { } \ No newline at end of file diff --git a/src/frontend/packages/extension/src/public-api.ts b/src/frontend/packages/extension/src/public-api.ts new file mode 100644 index 0000000000..e985bd6536 --- /dev/null +++ b/src/frontend/packages/extension/src/public-api.ts @@ -0,0 +1,5 @@ +/* + * Public API Surface of the extension package + */ + +export { ExtensionModule } from './extension.module'; \ No newline at end of file diff --git a/src/frontend/packages/extension/tsconfig.lib.json b/src/frontend/packages/extension/tsconfig.lib.json new file mode 100644 index 0000000000..dc686fd9df --- /dev/null +++ b/src/frontend/packages/extension/tsconfig.lib.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../tsconfig.lib.json", + "compilerOptions": { + "outDir": "../../../../out-tsc" + }, + "exclude": ["./src/test.ts", "**/*.spec.ts"] +} \ No newline at end of file diff --git a/src/frontend/packages/extension/tsconfig.lib.prod.json b/src/frontend/packages/extension/tsconfig.lib.prod.json new file mode 100644 index 0000000000..12f45466e3 --- /dev/null +++ b/src/frontend/packages/extension/tsconfig.lib.prod.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.lib.json", + "angularCompilerOptions": { + "enableIvy": false + } +} \ No newline at end of file diff --git a/src/frontend/packages/extension/tsconfig.spec.json b/src/frontend/packages/extension/tsconfig.spec.json new file mode 100644 index 0000000000..56b3e33bc1 --- /dev/null +++ b/src/frontend/packages/extension/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../tsconfig.spec.json", + "compilerOptions": { + "outDir": "../../../../out-tsc", + "types": ["jasmine", "node"] + }, + "files": ["src/test.ts"], + "include": ["**/*.spec.ts", "**/*.d.ts"] +} \ No newline at end of file diff --git a/src/frontend/packages/extension/tslint.json b/src/frontend/packages/extension/tslint.json new file mode 100644 index 0000000000..f403b51490 --- /dev/null +++ b/src/frontend/packages/extension/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../tslint.json", + "rules": { + "directive-selector": [ + false, + "attribute", + "lib", + "camelCase" + ], + "component-selector": [ + false, + "element", + "lib", + "kebab-case" + ] + } +} \ No newline at end of file diff --git a/src/tsconfig.json b/src/tsconfig.json index a98e757ac3..f91f9f8608 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -33,7 +33,9 @@ "preserveSymlinks": true, "paths": { "@stratosui/core": ["frontend/packages/core/src/public-api.ts"], + "@stratosui/extension": ["frontend/packages/extension/src/public-api.ts"], "@stratosui/store": ["frontend/packages/store/src/public-api.ts"], + "@stratosui/shared": ["frontend/packages/shared/src/public-api.ts"], "@stratosui/store/testing": ["frontend/packages/store/testing/public-api.ts"], "@stratosui/cloud-foundry": ["frontend/packages/cloud-foundry/src/public_api.ts"], "@stratosui/cf-autoscaler": ["frontend/packages/cf-autoscaler/src/public_api.ts"],