Skip to content

Commit

Permalink
Merge branch 'main' into feat/angular-accelerator-init
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Mar 14, 2024
2 parents aa04b0d + eb0908c commit 5d5d50c
Show file tree
Hide file tree
Showing 15 changed files with 254 additions and 0 deletions.
46 changes: 46 additions & 0 deletions libs/angular-remote-components/.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-remote-components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# angular-remote-components

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

## Running unit tests

Run `nx test angular-remote-components` to execute the unit tests.
22 changes: 22 additions & 0 deletions libs/angular-remote-components/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'angular-remote-components',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../coverage/libs/angular-remote-components',
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',
],
}
9 changes: 9 additions & 0 deletions libs/angular-remote-components/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/angular-remote-components",
"lib": {
"entryFile": "src/index.ts"
},
"assets": ["./assets/**"]
}

10 changes: 10 additions & 0 deletions libs/angular-remote-components/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@onecx/angular-remote-components",
"version": "4.10.2",
"peerDependencies": {},
"dependencies": {},
"publishConfig": {
"access": "public"
}
}

55 changes: 55 additions & 0 deletions libs/angular-remote-components/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "angular-remote-components",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/angular-remote-components/src",
"prefix": "onecx",
"tags": [],
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/angular:package",
"outputs": [
"{workspaceRoot}/dist/{projectRoot}"
],
"options": {
"project": "libs/angular-remote-components/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/angular-remote-components/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/angular-remote-components/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/angular-remote-components/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/angular-remote-components/**/*.ts", "libs/angular-remote-components/**/*.html", "libs/angular-remote-components/package.json"]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "angular-remote-components"
}
}
}
}
2 changes: 2 additions & 0 deletions libs/angular-remote-components/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './lib/model/remote-component'
export * from './lib/model/remote-component-config.model'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type RemoteComponentConfig = {
appId: string
productName: string
permissions: string[]
bffUrl: string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { RemoteComponentConfig } from './remote-component-config.model'

export interface ocxInitRemoteComponent {
ocxRemoteComponent(config: RemoteComponentConfig): void
}
15 changes: 15 additions & 0 deletions libs/angular-remote-components/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'jest-preset-angular/setup-jest'

Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // deprecated
removeListener: jest.fn(), // deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
})
31 changes: 31 additions & 0 deletions libs/angular-remote-components/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
}
}
21 changes: 21 additions & 0 deletions libs/angular-remote-components/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": [],
"target": "es2022",
"useDefineForClassFields": false
},
"exclude": [
"src/test-setup.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.stories.ts",
"**/*.stories.js",
"jest.config.ts"
],
"include": ["**/*.ts"]
}
13 changes: 13 additions & 0 deletions libs/angular-remote-components/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-remote-components/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 @@ -21,6 +21,7 @@
"@onecx/angular-integration-interface": ["libs/angular-integration-interface/src/index.ts"],
"@onecx/angular-integration-interface/mocks": ["libs/angular-integration-interface/mocks/index.ts"],
"@onecx/angular-testing": ["libs/angular-testing/src/index.ts"],
"@onecx/angular-remote-components": ["libs/angular-remote-components/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 5d5d50c

Please sign in to comment.