Fixed build for all the packages

This commit is contained in:
VitoAlbano
2024-10-11 22:53:41 +01:00
committed by Vito Albano
parent 1def5dcc0a
commit 62baa655ed
18 changed files with 5930 additions and 567 deletions

View File

@@ -10,3 +10,4 @@ scripts
docs/**/*.md docs/**/*.md
lib/js-api/docs/**/*.md lib/js-api/docs/**/*.md
.storybook .storybook
webpack.config.js

View File

@@ -50,7 +50,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"options": { "options": {
"lintFilePatterns": ["lib/cli/**/*.ts", "lib/cli/**/*.html"] "lintFilePatterns": ["lib/cli/**/*.ts", "lib/cli/**/*.html"]
} }

View File

@@ -33,7 +33,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"options": { "options": {
"lintFilePatterns": ["lib/content-services/**/*.ts", "lib/content-services/**/*.html"] "lintFilePatterns": ["lib/content-services/**/*.ts", "lib/content-services/**/*.html"]
} }

View File

@@ -24,7 +24,7 @@
"defaultConfiguration": "production" "defaultConfiguration": "production"
}, },
"build-schematics": { "build-schematics": {
"executor": "@nrwl/js:tsc", "executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"], "outputs": ["{options.outputPath}"],
"options": { "options": {
"outputPath": "dist/libs/core/schematics/migrations", "outputPath": "dist/libs/core/schematics/migrations",
@@ -48,7 +48,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"options": { "options": {
"lintFilePatterns": [ "lintFilePatterns": [
"lib/core/**/*.ts", "lib/core/**/*.ts",

View File

@@ -11,8 +11,8 @@
"projectRoot": "lib/eslint-angular", "projectRoot": "lib/eslint-angular",
"outputPath": "dist/libs/eslint-plugin-eslint-angular", "outputPath": "dist/libs/eslint-plugin-eslint-angular",
"main": "lib/eslint-angular/index.ts", "main": "lib/eslint-angular/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/eslint-angular/tsconfig.lib.prod.json", "tsConfig": "lib/eslint-angular/tsconfig.lib.prod.json",
"webpackConfig": "lib/eslint-angular/webpack.config.js",
"stylePreprocessorOptions": { "stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"] "includePaths": ["lib", "lib/core/src/lib"]
}, },
@@ -24,14 +24,13 @@
"projectRoot": "lib/eslint-angular", "projectRoot": "lib/eslint-angular",
"outputPath": "dist/libs/eslint-plugin-eslint-angular", "outputPath": "dist/libs/eslint-plugin-eslint-angular",
"main": "lib/eslint-angular/index.ts", "main": "lib/eslint-angular/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/eslint-angular/tsconfig.lib.prod.json" "tsConfig": "lib/eslint-angular/tsconfig.lib.prod.json"
} }
}, },
"defaultConfiguration": "production" "defaultConfiguration": "production"
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint:eslint",
"options": { "options": {
"lintFilePatterns": ["lib/eslint-angular/**/*.ts"] "lintFilePatterns": ["lib/eslint-angular/**/*.ts"]
} }

View File

@@ -33,7 +33,7 @@ const messages = {
type MessageIds = keyof typeof messages; type MessageIds = keyof typeof messages;
const filetypeErrors: {regexp: RegExp; messageId: MessageIds}[] = [ const filetypeErrors: { regexp: RegExp; messageId: MessageIds }[] = [
{ {
regexp: /.*\.spec\.ts/, regexp: /.*\.spec\.ts/,
messageId: 'useAngularMaterialTestingHarness' messageId: 'useAngularMaterialTestingHarness'
@@ -52,8 +52,7 @@ export default createESLintRule<unknown[], MessageIds>({
meta: { meta: {
type: 'suggestion', type: 'suggestion',
docs: { docs: {
description: 'Disallows using Angular Material internal selectors', description: 'Disallows using Angular Material internal selectors'
recommended: 'error'
}, },
hasSuggestions: true, hasSuggestions: true,
schema: [], schema: [],
@@ -63,9 +62,9 @@ export default createESLintRule<unknown[], MessageIds>({
create(context) { create(context) {
return { return {
[ASTSelectors.join(',')](node: TSESTree.Literal | TSESTree.TemplateLiteral) { [ASTSelectors.join(',')](node: TSESTree.Literal | TSESTree.TemplateLiteral) {
const message = filetypeErrors.find((fileTypeError) => const message = filetypeErrors.find((fileTypeError) => context.getFilename().match(fileTypeError.regexp)) || {
context.getFilename().match(fileTypeError.regexp) messageId: 'noAngularMaterialSelectors'
) || { messageId: 'noAngularMaterialSelectors' }; };
context.report({ context.report({
node, node,

View File

@@ -21,7 +21,7 @@ import { createESLintRule } from '../../utils/create-eslint-rule/create-eslint-r
export const RULE_NAME = 'use-none-component-view-encapsulation'; export const RULE_NAME = 'use-none-component-view-encapsulation';
type MessageIds = 'useNoneComponentViewEncapsulation'| 'suggestAddViewEncapsulationNone'; type MessageIds = 'useNoneComponentViewEncapsulation' | 'suggestAddViewEncapsulationNone';
type DecoratorForClass = TSESTree.Decorator & { type DecoratorForClass = TSESTree.Decorator & {
parent: TSESTree.ClassDeclaration; parent: TSESTree.ClassDeclaration;
}; };
@@ -53,8 +53,7 @@ export default createESLintRule<unknown[], MessageIds>({
meta: { meta: {
type: 'suggestion', type: 'suggestion',
docs: { docs: {
description: `Disallows using other encapsulation than \`${viewEncapsulationNone}\``, description: `Disallows using other encapsulation than \`${viewEncapsulationNone}\``
recommended: false
}, },
hasSuggestions: true, hasSuggestions: true,
schema: [], schema: [],
@@ -65,18 +64,13 @@ export default createESLintRule<unknown[], MessageIds>({
}, },
defaultOptions: [], defaultOptions: [],
create(context) { create(context) {
const encapsulationProperty = Selectors.metadataProperty( const encapsulationProperty = Selectors.metadataProperty(metadataPropertyName);
metadataPropertyName
);
const withoutEncapsulationProperty = const withoutEncapsulationProperty =
`${Selectors.COMPONENT_CLASS_DECORATOR}:matches([expression.arguments.length=0], [expression.arguments.0.type='ObjectExpression']:not(:has(${encapsulationProperty})))` as const; `${Selectors.COMPONENT_CLASS_DECORATOR}:matches([expression.arguments.length=0], [expression.arguments.0.type='ObjectExpression']:not(:has(${encapsulationProperty})))` as const;
const nonNoneViewEncapsulationNoneProperty = const nonNoneViewEncapsulationNoneProperty =
`${Selectors.COMPONENT_CLASS_DECORATOR} > CallExpression > ObjectExpression > ` + `${Selectors.COMPONENT_CLASS_DECORATOR} > CallExpression > ObjectExpression > ` +
`${encapsulationProperty}:matches([value.type='Identifier'][value.name='undefined'], [value.object.name='ViewEncapsulation'][value.property.name!='None'])`; `${encapsulationProperty}:matches([value.type='Identifier'][value.name='undefined'], [value.object.name='ViewEncapsulation'][value.property.name!='None'])`;
const selectors = [ const selectors = [withoutEncapsulationProperty, nonNoneViewEncapsulationNoneProperty].join(',');
withoutEncapsulationProperty,
nonNoneViewEncapsulationNoneProperty
].join(',');
return { return {
[selectors](node: DecoratorForClass | PropertyInClassDecorator) { [selectors](node: DecoratorForClass | PropertyInClassDecorator) {
context.report({ context.report({
@@ -92,7 +86,7 @@ export default createESLintRule<unknown[], MessageIds>({
fixer, fixer,
importName: 'ViewEncapsulation', importName: 'ViewEncapsulation',
moduleName: '@angular/core', moduleName: '@angular/core',
node: node.parent.parent.parent.parent node: node.parent
}), }),
ASTUtils.isMemberExpression(node.value) ASTUtils.isMemberExpression(node.value)
? fixer.replaceText(node.value.property, 'None') ? fixer.replaceText(node.value.property, 'None')
@@ -107,11 +101,7 @@ export default createESLintRule<unknown[], MessageIds>({
moduleName: '@angular/core', moduleName: '@angular/core',
node: node.parent node: node.parent
}), }),
RuleFixes.getDecoratorPropertyAddFix( RuleFixes.getDecoratorPropertyAddFix(node, fixer, `${metadataPropertyName}: ${viewEncapsulationNone}`)
node,
fixer,
`${metadataPropertyName}: ${viewEncapsulationNone}`
)
].filter(isNotNullOrUndefined); ].filter(isNotNullOrUndefined);
} }
} }

View File

@@ -11,7 +11,7 @@
"skipLibCheck": true, "skipLibCheck": true,
"baseUrl": "src", "baseUrl": "src",
"types": [ "types": [
"node" "node", "@typescript-eslint/utils"
] ]
}, },
"include": [ "include": [

View File

@@ -0,0 +1,20 @@
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
const { join } = require('path');
module.exports = {
output: {
path: join(__dirname, '../../dist/libs/eslint-angular')
},
devServer: {
port: 4200
},
plugins: [
new NxAppWebpackPlugin({
main: './index.ts',
tsConfig: './tsconfig.lib.json',
index: './index.ts',
outputHashing: process.env['NODE_ENV'] === 'production' ? 'all' : 'none',
optimization: process.env['NODE_ENV'] === 'production'
})
]
};

View File

@@ -32,7 +32,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"options": { "options": {
"lintFilePatterns": ["lib/extensions/**/*.ts", "lib/extensions/**/*.html"] "lintFilePatterns": ["lib/extensions/**/*.ts", "lib/extensions/**/*.html"]
} }

View File

@@ -33,7 +33,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"options": { "options": {
"lintFilePatterns": ["lib/insights/**/*.ts", "lib/insights/**/*.html"] "lintFilePatterns": ["lib/insights/**/*.ts", "lib/insights/**/*.html"]
} }

View File

@@ -6,7 +6,7 @@
"prefix": "adf", "prefix": "adf",
"targets": { "targets": {
"build": { "build": {
"executor": "@nrwl/js:tsc", "executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"], "outputs": ["{options.outputPath}"],
"dependsOn": ["build-esm5"], "dependsOn": ["build-esm5"],
"options": { "options": {
@@ -24,7 +24,7 @@
} }
}, },
"build-esm5": { "build-esm5": {
"executor": "@nrwl/js:tsc", "executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"], "outputs": ["{options.outputPath}"],
"dependsOn": ["build-esm2015"], "dependsOn": ["build-esm2015"],
"options": { "options": {
@@ -34,7 +34,7 @@
} }
}, },
"build-esm2015": { "build-esm2015": {
"executor": "@nrwl/js:tsc", "executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"], "outputs": ["{options.outputPath}"],
"dependsOn": ["build-cjs"], "dependsOn": ["build-cjs"],
"options": { "options": {
@@ -44,7 +44,7 @@
} }
}, },
"build-cjs": { "build-cjs": {
"executor": "@nrwl/js:tsc", "executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"], "outputs": ["{options.outputPath}"],
"options": { "options": {
"outputPath": "dist/libs/js-api", "outputPath": "dist/libs/js-api",
@@ -54,7 +54,7 @@
} }
}, },
"build-types": { "build-types": {
"executor": "@nrwl/js:tsc", "executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"], "outputs": ["{options.outputPath}"],
"options": { "options": {
"outputPath": "dist/libs/js-api/typings", "outputPath": "dist/libs/js-api/typings",
@@ -76,7 +76,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["lib/js-api/**/*.ts"] "lintFilePatterns": ["lib/js-api/**/*.ts"]

View File

@@ -33,7 +33,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"options": { "options": {
"lintFilePatterns": ["lib/process-services-cloud/**/*.ts", "lib/process-services-cloud/**/*.html"] "lintFilePatterns": ["lib/process-services-cloud/**/*.ts", "lib/process-services-cloud/**/*.html"]
} }

View File

@@ -33,7 +33,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"options": { "options": {
"lintFilePatterns": ["lib/process-services/**/*.ts", "lib/process-services/**/*.html"] "lintFilePatterns": ["lib/process-services/**/*.ts", "lib/process-services/**/*.html"]
} }

View File

@@ -6,12 +6,11 @@
"prefix": "adf", "prefix": "adf",
"targets": { "targets": {
"build": { "build": {
"executor": "@nrwl/webpack:webpack", "executor": "@nx/webpack:webpack",
"options": { "options": {
"projectRoot": "lib/testing", "projectRoot": "lib/testing",
"outputPath": "dist/libs/testing", "outputPath": "dist/libs/testing",
"main": "lib/testing/index.ts", "main": "lib/testing/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/testing/tsconfig.lib.prod.json", "tsConfig": "lib/testing/tsconfig.lib.prod.json",
"webpackConfig": "lib/testing/webpack.config.js", "webpackConfig": "lib/testing/webpack.config.js",
"stylePreprocessorOptions": { "stylePreprocessorOptions": {
@@ -25,14 +24,13 @@
"projectRoot": "lib/testing", "projectRoot": "lib/testing",
"outputPath": "dist/libs/testing", "outputPath": "dist/libs/testing",
"main": "lib/testing/index.ts", "main": "lib/testing/index.ts",
"generatePackageJson": true, "tsConfig": "lib/testing/tsconfig.lib.prod.json"
"tsConfig": "lib/testing/tsconfig.lib.prod.json",
} }
}, },
"defaultConfiguration": "production" "defaultConfiguration": "production"
}, },
"lint": { "lint": {
"executor": "@nrwl/linter:eslint", "executor": "@nx/eslint:lint",
"options": { "options": {
"lintFilePatterns": ["lib/testing/**/*.ts", "lib/testing/**/*.html"] "lintFilePatterns": ["lib/testing/**/*.ts", "lib/testing/**/*.html"]
} }

29
nx.json
View File

@@ -6,22 +6,12 @@
"$schema": "./node_modules/nx/schemas/nx-schema.json", "$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": { "targetDefaults": {
"build": { "build": {
"dependsOn": [ "dependsOn": ["^build"],
"^build" "inputs": ["production", "^production"],
],
"inputs": [
"production",
"^production"
],
"cache": true "cache": true
}, },
"build-storybook": { "build-storybook": {
"inputs": [ "inputs": ["default", "^production", "{projectRoot}/.storybook/**/*", "{projectRoot}/tsconfig.storybook.json"]
"default",
"^production",
"{projectRoot}/.storybook/**/*",
"{projectRoot}/tsconfig.storybook.json"
]
}, },
"lint": { "lint": {
"cache": true "cache": true
@@ -36,18 +26,12 @@
"tasksRunnerOptions": { "tasksRunnerOptions": {
"default": { "default": {
"options": { "options": {
"cacheDirectory": "nxcache", "runtimeCacheInputs": ["node -v"]
"runtimeCacheInputs": [
"node -v"
]
} }
} }
}, },
"namedInputs": { "namedInputs": {
"default": [ "default": ["{projectRoot}/**/*", "sharedGlobals"],
"{projectRoot}/**/*",
"sharedGlobals"
],
"sharedGlobals": [ "sharedGlobals": [
"{workspaceRoot}/angular.json", "{workspaceRoot}/angular.json",
"{workspaceRoot}/demo-shell/src/index.html", "{workspaceRoot}/demo-shell/src/index.html",
@@ -63,5 +47,6 @@
"!{projectRoot}/karma.conf.js", "!{projectRoot}/karma.conf.js",
"!{projectRoot}/tsconfig.storybook.json" "!{projectRoot}/tsconfig.storybook.json"
] ]
} },
"cacheDirectory": "nxcache"
} }

6366
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -117,6 +117,7 @@
"@typescript-eslint/eslint-plugin": "6.21.0", "@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0", "@typescript-eslint/parser": "6.21.0",
"@typescript-eslint/typescript-estree": "7.1.1", "@typescript-eslint/typescript-estree": "7.1.1",
"@typescript-eslint/utils": "^8.8.1",
"ajv": "^8.12.0", "ajv": "^8.12.0",
"commander": "12.0.0", "commander": "12.0.0",
"css-loader": "^7.1.2", "css-loader": "^7.1.2",
@@ -130,7 +131,7 @@
"eslint-config-prettier": "9.1.0", "eslint-config-prettier": "9.1.0",
"eslint-plugin-ban": "^1.6.0", "eslint-plugin-ban": "^1.6.0",
"eslint-plugin-import": "2.29.1", "eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "50.6.1", "eslint-plugin-jsdoc": "50.3.1",
"eslint-plugin-license-header": "0.6.0", "eslint-plugin-license-header": "0.6.0",
"eslint-plugin-prefer-arrow": "1.2.3", "eslint-plugin-prefer-arrow": "1.2.3",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
@@ -161,7 +162,7 @@
"ng-packagr": "17.1.2", "ng-packagr": "17.1.2",
"nock": "13.5.5", "nock": "13.5.5",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"nx": "17.3.1", "nx": "^20.0.0",
"postcss": "8.4.41", "postcss": "8.4.41",
"postcss-sass": "^0.5.0", "postcss-sass": "^0.5.0",
"prettier": "2.8.8", "prettier": "2.8.8",