Skip to content

Commit

Permalink
feat: angular-webcomponents prepared
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Jun 25, 2024
1 parent 4bab9ce commit 1e9c237
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 24 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.

19 changes: 16 additions & 3 deletions libs/angular-webcomponents/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,37 @@
"error",
{
"type": "attribute",
"prefix": "onecx",
"prefix": "ocx",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "onecx",
"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/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"
}
}
24 changes: 24 additions & 0 deletions libs/angular-webcomponents/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
"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}"],
Expand All @@ -26,6 +44,12 @@
"options": {
"lintFilePatterns": ["libs/angular-webcomponents/**/*.ts", "libs/angular-webcomponents/**/*.html"]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "angular-webcomponents"
}
}
}
}
2 changes: 1 addition & 1 deletion libs/angular-webcomponents/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './lib/angular-webcomponents.module'
export * from './lib/model/remote-webcomponent'

This file was deleted.

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: 5 additions & 3 deletions libs/angular-webcomponents/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
{
"compilerOptions": {
"target": "es2022",
"useDefineForClassFields": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": 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": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
Expand Down
8 changes: 5 additions & 3 deletions libs/angular-webcomponents/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": []
"types": [],
"target": "es2022",
"useDefineForClassFields": false
},
"exclude": ["src/**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "src/**/*.test.ts"],
"include": ["src/**/*.ts"]
"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"]
}

2 changes: 1 addition & 1 deletion libs/angular-webcomponents/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
"include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
}

0 comments on commit 1e9c237

Please sign in to comment.