Skip to content

Commit

Permalink
Merge branch 'feat/webcomponents-props' into feat/breadcrumbs-for-web…
Browse files Browse the repository at this point in the history
…components
  • Loading branch information
markuczy committed Jun 25, 2024
2 parents 73a7f72 + 1e9c237 commit 2247344
Show file tree
Hide file tree
Showing 17 changed files with 237 additions and 6 deletions.
1 change: 0 additions & 1 deletion libs/angular-remote-components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './lib/model/remote-component'
export * from './lib/model/remote-webcomponent'
export * from './lib/model/remote-component-config.model'
export * from './lib/model/injection-tokens'
export * from './lib/components/slot/slot.component'
Expand Down

This file was deleted.

46 changes: 46 additions & 0 deletions libs/angular-webcomponents/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "ocx",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "ocx",
"style": "kebab-case"
}
],
"no-restricted-syntax": [
"off",
{
"selector": "CallExpression[callee.object.name=\"console\"][callee.property.name=/^(debug|info|time|timeEnd|trace)$/]"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
7 changes: 7 additions & 0 deletions libs/angular-webcomponents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# angular-webcomponents

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test angular-webcomponents` to execute the unit tests.
22 changes: 22 additions & 0 deletions libs/angular-webcomponents/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'angular-webcomponents',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../coverage/libs/angular-webcomponents',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
}
7 changes: 7 additions & 0 deletions libs/angular-webcomponents/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/angular-webcomponents",
"lib": {
"entryFile": "src/index.ts"
}
}
10 changes: 10 additions & 0 deletions libs/angular-webcomponents/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@onecx/angular-webcomponents",
"version": "4.33.0",
"peerDependencies": {
},
"dependencies": {},
"publishConfig": {
"access": "public"
}
}
55 changes: 55 additions & 0 deletions libs/angular-webcomponents/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "angular-webcomponents",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/angular-webcomponents/src",
"prefix": "onecx",
"tags": [],
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/angular:package",
"outputs": [
"{workspaceRoot}/dist/{projectRoot}"
],
"options": {
"project": "libs/angular-webcomponents/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/angular-webcomponents/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/angular-webcomponents/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/angular-webcomponents/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/angular-webcomponents/**/*.ts", "libs/angular-webcomponents/**/*.html"]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "angular-webcomponents"
}
}
}
}
1 change: 1 addition & 0 deletions libs/angular-webcomponents/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/model/remote-webcomponent'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type RemoteWebcomponentConfig = {
appId: string
productName: string
permissions: string[]
baseUrl: string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { RemoteWebcomponentConfig } from './remote-webcomponent-config.model'

export interface ocxRemoteWebcomponent {
ocxRemoteComponentConfig: RemoteWebcomponentConfig
}
8 changes: 8 additions & 0 deletions libs/angular-webcomponents/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
},
}
import 'jest-preset-angular/setup-jest'
31 changes: 31 additions & 0 deletions libs/angular-webcomponents/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"compilerOptions": {
"target": "es2022",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.lib.prod.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"extends": "../../tsconfig.base.json",
"angularCompilerOptions": {
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
14 changes: 14 additions & 0 deletions libs/angular-webcomponents/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": [],
"target": "es2022",
"useDefineForClassFields": false
},
"exclude": ["**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "**/*.test.ts", "**/*.stories.ts", "jest.config.ts"],
"include": ["**/*.ts"]
}
13 changes: 13 additions & 0 deletions libs/angular-webcomponents/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false,
"target": "es2022",
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
},
"exclude": ["jest.config.ts"]
}

11 changes: 11 additions & 0 deletions libs/angular-webcomponents/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"target": "es2016",
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
}
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@onecx/angular-remote-components": ["libs/angular-remote-components/src/index.ts"],
"@onecx/angular-standalone-shell": ["libs/angular-standalone-shell/src/index.ts"],
"@onecx/angular-testing": ["libs/angular-testing/src/index.ts"],
"@onecx/angular-webcomponents": ["libs/angular-webcomponents/src/index.ts"],
"@onecx/integration-interface": ["libs/integration-interface/src/index.ts"],
"@onecx/keycloak-auth": ["libs/keycloak-auth/src/index.ts"],
"@onecx/portal-integration-angular": ["libs/portal-integration-angular/src/index.ts"],
Expand Down

0 comments on commit 2247344

Please sign in to comment.