Skip to content

Commit

Permalink
Fixed build for all the packages
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed Oct 11, 2024
1 parent d6a4af2 commit ce673e9
Show file tree
Hide file tree
Showing 18 changed files with 6,842 additions and 1,479 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ scripts
docs/**/*.md
lib/js-api/docs/**/*.md
.storybook
webpack.config.js
2 changes: 1 addition & 1 deletion lib/cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/cli/**/*.ts", "lib/cli/**/*.html"]
}
Expand Down
2 changes: 1 addition & 1 deletion lib/content-services/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/content-services/**/*.ts", "lib/content-services/**/*.html"]
}
Expand Down
4 changes: 2 additions & 2 deletions lib/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"defaultConfiguration": "production"
},
"build-schematics": {
"executor": "@nrwl/js:tsc",
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/core/schematics/migrations",
Expand All @@ -48,7 +48,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"lib/core/**/*.ts",
Expand Down
5 changes: 2 additions & 3 deletions lib/eslint-angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"projectRoot": "lib/eslint-angular",
"outputPath": "dist/libs/eslint-plugin-eslint-angular",
"main": "lib/eslint-angular/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/eslint-angular/tsconfig.lib.prod.json",
"webpackConfig": "lib/eslint-angular/webpack.config.js",
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
},
Expand All @@ -24,14 +24,13 @@
"projectRoot": "lib/eslint-angular",
"outputPath": "dist/libs/eslint-plugin-eslint-angular",
"main": "lib/eslint-angular/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/eslint-angular/tsconfig.lib.prod.json"
}
},
"defaultConfiguration": "production"
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint:eslint",
"options": {
"lintFilePatterns": ["lib/eslint-angular/**/*.ts"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const messages = {

type MessageIds = keyof typeof messages;

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

context.report({
node,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { createESLintRule } from '../../utils/create-eslint-rule/create-eslint-r

export const RULE_NAME = 'use-none-component-view-encapsulation';

type MessageIds = 'useNoneComponentViewEncapsulation'| 'suggestAddViewEncapsulationNone';
type MessageIds = 'useNoneComponentViewEncapsulation' | 'suggestAddViewEncapsulationNone';
type DecoratorForClass = TSESTree.Decorator & {
parent: TSESTree.ClassDeclaration;
};
Expand Down Expand Up @@ -53,8 +53,7 @@ export default createESLintRule<unknown[], MessageIds>({
meta: {
type: 'suggestion',
docs: {
description: `Disallows using other encapsulation than \`${viewEncapsulationNone}\``,
recommended: false
description: `Disallows using other encapsulation than \`${viewEncapsulationNone}\``
},
hasSuggestions: true,
schema: [],
Expand All @@ -65,18 +64,13 @@ export default createESLintRule<unknown[], MessageIds>({
},
defaultOptions: [],
create(context) {
const encapsulationProperty = Selectors.metadataProperty(
metadataPropertyName
);
const encapsulationProperty = Selectors.metadataProperty(metadataPropertyName);
const withoutEncapsulationProperty =
`${Selectors.COMPONENT_CLASS_DECORATOR}:matches([expression.arguments.length=0], [expression.arguments.0.type='ObjectExpression']:not(:has(${encapsulationProperty})))` as const;
const nonNoneViewEncapsulationNoneProperty =
`${Selectors.COMPONENT_CLASS_DECORATOR} > CallExpression > ObjectExpression > ` +
`${encapsulationProperty}:matches([value.type='Identifier'][value.name='undefined'], [value.object.name='ViewEncapsulation'][value.property.name!='None'])`;
const selectors = [
withoutEncapsulationProperty,
nonNoneViewEncapsulationNoneProperty
].join(',');
const selectors = [withoutEncapsulationProperty, nonNoneViewEncapsulationNoneProperty].join(',');
return {
[selectors](node: DecoratorForClass | PropertyInClassDecorator) {
context.report({
Expand All @@ -92,7 +86,7 @@ export default createESLintRule<unknown[], MessageIds>({
fixer,
importName: 'ViewEncapsulation',
moduleName: '@angular/core',
node: node.parent.parent.parent.parent
node: node.parent
}),
ASTUtils.isMemberExpression(node.value)
? fixer.replaceText(node.value.property, 'None')
Expand All @@ -107,11 +101,7 @@ export default createESLintRule<unknown[], MessageIds>({
moduleName: '@angular/core',
node: node.parent
}),
RuleFixes.getDecoratorPropertyAddFix(
node,
fixer,
`${metadataPropertyName}: ${viewEncapsulationNone}`
)
RuleFixes.getDecoratorPropertyAddFix(node, fixer, `${metadataPropertyName}: ${viewEncapsulationNone}`)
].filter(isNotNullOrUndefined);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/eslint-angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"skipLibCheck": true,
"baseUrl": "src",
"types": [
"node"
"node", "@typescript-eslint/utils"
]
},
"include": [
Expand Down
20 changes: 20 additions & 0 deletions lib/eslint-angular/webpack.config.js
Original file line number Diff line number Diff line change
@@ -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'
})
]
};
2 changes: 1 addition & 1 deletion lib/extensions/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/extensions/**/*.ts", "lib/extensions/**/*.html"]
}
Expand Down
2 changes: 1 addition & 1 deletion lib/insights/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/insights/**/*.ts", "lib/insights/**/*.html"]
}
Expand Down
12 changes: 6 additions & 6 deletions lib/js-api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"prefix": "adf",
"targets": {
"build": {
"executor": "@nrwl/js:tsc",
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"dependsOn": ["build-esm5"],
"options": {
Expand All @@ -24,7 +24,7 @@
}
},
"build-esm5": {
"executor": "@nrwl/js:tsc",
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"dependsOn": ["build-esm2015"],
"options": {
Expand All @@ -34,7 +34,7 @@
}
},
"build-esm2015": {
"executor": "@nrwl/js:tsc",
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"dependsOn": ["build-cjs"],
"options": {
Expand All @@ -44,7 +44,7 @@
}
},
"build-cjs": {
"executor": "@nrwl/js:tsc",
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/js-api",
Expand All @@ -54,7 +54,7 @@
}
},
"build-types": {
"executor": "@nrwl/js:tsc",
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/js-api/typings",
Expand All @@ -76,7 +76,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["lib/js-api/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion lib/process-services-cloud/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/process-services-cloud/**/*.ts", "lib/process-services-cloud/**/*.html"]
}
Expand Down
2 changes: 1 addition & 1 deletion lib/process-services/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/process-services/**/*.ts", "lib/process-services/**/*.html"]
}
Expand Down
8 changes: 3 additions & 5 deletions lib/testing/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
"prefix": "adf",
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"executor": "@nx/webpack:webpack",
"options": {
"projectRoot": "lib/testing",
"outputPath": "dist/libs/testing",
"main": "lib/testing/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/testing/tsconfig.lib.prod.json",
"webpackConfig": "lib/testing/webpack.config.js",
"stylePreprocessorOptions": {
Expand All @@ -25,14 +24,13 @@
"projectRoot": "lib/testing",
"outputPath": "dist/libs/testing",
"main": "lib/testing/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/testing/tsconfig.lib.prod.json",
"tsConfig": "lib/testing/tsconfig.lib.prod.json"
}
},
"defaultConfiguration": "production"
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/testing/**/*.ts", "lib/testing/**/*.html"]
}
Expand Down
29 changes: 7 additions & 22 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,12 @@
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"build": {
"dependsOn": [
"^build"
],
"inputs": [
"production",
"^production"
],
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"cache": true
},
"build-storybook": {
"inputs": [
"default",
"^production",
"{projectRoot}/.storybook/**/*",
"{projectRoot}/tsconfig.storybook.json"
]
"inputs": ["default", "^production", "{projectRoot}/.storybook/**/*", "{projectRoot}/tsconfig.storybook.json"]
},
"lint": {
"cache": true
Expand All @@ -36,18 +26,12 @@
"tasksRunnerOptions": {
"default": {
"options": {
"cacheDirectory": "nxcache",
"runtimeCacheInputs": [
"node -v"
]
"runtimeCacheInputs": ["node -v"]
}
}
},
"namedInputs": {
"default": [
"{projectRoot}/**/*",
"sharedGlobals"
],
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [
"{workspaceRoot}/angular.json",
"{workspaceRoot}/demo-shell/src/index.html",
Expand All @@ -63,5 +47,6 @@
"!{projectRoot}/karma.conf.js",
"!{projectRoot}/tsconfig.storybook.json"
]
}
},
"cacheDirectory": "nxcache"
}
Loading

0 comments on commit ce673e9

Please sign in to comment.