Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: create own bundle for @angular/compiler #720

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,4 @@ If you see a rule below that has **no status** against it, then please feel free

<!-- PR Links -->

[`pr559`]: https://api.github.com/repos/angular-eslint/angular-eslint/pulls/559

<!-- end rule list -->
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"implicitDependencies": [
"integration-tests",
"builder",
"bundled-angular-compiler",
"eslint-plugin",
"eslint-plugin-template",
"schematics",
Expand All @@ -85,6 +86,7 @@
"implicitDependencies": [
"integration-tests",
"builder",
"bundled-angular-compiler",
"eslint-plugin",
"eslint-plugin-template",
"schematics",
Expand All @@ -96,6 +98,7 @@
"implicitDependencies": [
"integration-tests",
"builder",
"bundled-angular-compiler",
"eslint-plugin",
"eslint-plugin-template",
"schematics",
Expand Down
1 change: 0 additions & 1 deletion packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@nrwl/devkit": "12.6.0"
},
"peerDependencies": {
"@angular/cli": ">= 12.0.0 < 13.0.0",
"eslint": "*",
"typescript": "*"
},
Expand Down
1 change: 1 addition & 0 deletions packages/bundled-angular-compiler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @angular-eslint/bundled-angular-compiler
21 changes: 21 additions & 0 deletions packages/bundled-angular-compiler/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@angular-eslint/bundled-angular-compiler",
"version": "12.5.0",
"description": "A CJS bundled version of @angular/compiler",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular-eslint/angular-eslint.git",
"directory": "packages/bundled-angular-compiler"
},
"devDependencies": {
"@angular/compiler": "12.2.11"
},
"files": [
"dist",
"package.json",
"README.md"
]
}
35 changes: 35 additions & 0 deletions packages/bundled-angular-compiler/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"root": "packages/bundled-angular-compiler",
"type": "library",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": ["packages/bundled-angular-compiler/dist"],
"options": {
"cwd": "packages/bundled-angular-compiler",
"parallel": false,
"commands": [
"npx rimraf ./dist",
"npx microbundle --tsconfig tsconfig.build.json --no-sourcemap --target=node --format=cjs --alias @angular/compiler=node_modules/@angular/compiler/fesm2015/compiler.js"
]
}
},
"clean": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"cwd": "packages/bundled-angular-compiler",
"parallel": false,
"commands": ["npx rimraf ./dist"]
}
},
"typecheck": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"cwd": "packages/bundled-angular-compiler",
"parallel": false,
"commands": ["npx tsc -p tsconfig.json --noEmit"]
}
}
},
"implicitDependencies": []
}
6 changes: 6 additions & 0 deletions packages/bundled-angular-compiler/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * from '@angular/compiler';
export type {
Comment,
Node as R3_Node,
} from '@angular/compiler/src/render3/r3_ast';
export type { Message } from '@angular/compiler/src/i18n/i18n_ast';
7 changes: 7 additions & 0 deletions packages/bundled-angular-compiler/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": ["src"]
}
4 changes: 4 additions & 0 deletions packages/bundled-angular-compiler/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.build.json",
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/eslint-plugin-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"LICENSE"
],
"dependencies": {
"@angular-eslint/bundled-angular-compiler": "12.5.0",
"@typescript-eslint/experimental-utils": "4.28.2",
"aria-query": "^4.2.2",
"axobject-query": "^2.2.0"
Expand All @@ -26,7 +27,6 @@
"@types/aria-query": "^4.2.0"
},
"peerDependencies": {
"@angular/compiler": ">= 12.0.0 < 13.0.0",
"eslint": "*",
"typescript": "*"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { Node, TmplAstElement } from '@angular/compiler';
import type {
Node,
TmplAstElement,
} from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
TmplAstBoundAttribute,
TmplAstTextAttribute,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { AST } from '@angular/compiler';
import type { AST } from '@angular-eslint/bundled-angular-compiler';
import {
ASTWithSource,
LiteralArray,
LiteralMap,
LiteralPrimitive,
TmplAstBoundAttribute,
TmplAstTextAttribute,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import type { ARIAProperty, ARIAPropertyDefinition } from 'aria-query';
import { aria } from 'aria-query';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-template/src/rules/banana-in-box.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BoundEventAst } from '@angular/compiler';
import type { BoundEventAst } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import type {
ASTWithSource,
Interpolation,
TmplAstBoundAttribute,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import {
Binary,
BindingPipe,
Conditional,
Lexer,
Parser,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
ensureTemplateParser,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
TmplAstBoundAttribute,
TmplAstTextAttribute,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
7 changes: 5 additions & 2 deletions packages/eslint-plugin-template/src/rules/eqeqeq.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { AST, Binary } from '@angular/compiler';
import { ASTWithSource, LiteralPrimitive } from '@angular/compiler';
import type { AST, Binary } from '@angular-eslint/bundled-angular-compiler';
import {
ASTWithSource,
LiteralPrimitive,
} from '@angular-eslint/bundled-angular-compiler';
import type { TSESLint } from '@typescript-eslint/experimental-utils';
import {
createESLintRule,
Expand Down
9 changes: 6 additions & 3 deletions packages/eslint-plugin-template/src/rules/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import type {
TmplAstIcu,
TmplAstText,
TmplAstTextAttribute,
} from '@angular/compiler';
import { TmplAstBoundText, TmplAstElement } from '@angular/compiler';
import type { Message } from '@angular/compiler/src/i18n/i18n_ast';
} from '@angular-eslint/bundled-angular-compiler';
import {
TmplAstBoundText,
TmplAstElement,
} from '@angular-eslint/bundled-angular-compiler';
import type { Message } from '@angular-eslint/bundled-angular-compiler';
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
import {
createESLintRule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import type { TSESLint } from '@typescript-eslint/experimental-utils';
import {
createESLintRule,
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-template/src/rules/no-any.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MethodCall } from '@angular/compiler';
import type { MethodCall } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
ensureTemplateParser,
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-template/src/rules/no-autofocus.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
TmplAstBoundAttribute,
TmplAstTextAttribute,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type {
FunctionCall,
MethodCall,
SafeMethodCall,
} from '@angular/compiler';
import { TmplAstBoundEvent } from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import { TmplAstBoundEvent } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
ensureTemplateParser,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
TmplAstBoundEvent,
TmplAstElement,
TmplAstTextAttribute,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { BindingPipe, PrefixNot } from '@angular/compiler';
import type {
BindingPipe,
PrefixNot,
} from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
ensureTemplateParser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
ParseSourceSpan,
TmplAstBoundAttribute,
TmplAstTextAttribute,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { TmplAstTemplate, TmplAstTextAttribute } from '@angular/compiler';
import { TmplAstBoundAttribute } from '@angular/compiler';
import type {
TmplAstTemplate,
TmplAstTextAttribute,
} from '@angular-eslint/bundled-angular-compiler';
import { TmplAstBoundAttribute } from '@angular-eslint/bundled-angular-compiler';
import {
createESLintRule,
getTemplateParserServices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import type { ARIARoleRelationConceptAttribute } from 'aria-query';
import { getAttributeValue } from './get-attribute-value';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { ParseSourceSpan, TmplAstElement } from '@angular/compiler';
import type {
ParseSourceSpan,
TmplAstElement,
} from '@angular-eslint/bundled-angular-compiler';
import type {
ESLintUtils,
TSESLint,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import {
ASTWithSource,
LiteralArray,
LiteralMap,
LiteralPrimitive,
} from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import { PROPERTY_READ } from './constants';
import { getOriginalAttributeName } from './get-original-attribute-name';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { AST } from '@angular/compiler';
import type { Node } from '@angular/compiler/src/render3/r3_ast';
import type {
AST,
R3_Node as Node,
} from '@angular-eslint/bundled-angular-compiler';
import type { TSESTree } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {
TmplAstBoundAttribute,
TmplAstTextAttribute,
} from '@angular/compiler';
import { TmplAstBoundEvent } from '@angular/compiler';
} from '@angular-eslint/bundled-angular-compiler';
import { TmplAstBoundEvent } from '@angular-eslint/bundled-angular-compiler';

/**
* Returns the original attribute name.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TmplAstElement } from '@angular/compiler';
import { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';

export function isChildNodeOf(
ast: TmplAstElement,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TmplAstElement } from '@angular/compiler';
import { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import { getAttributeValue } from './get-attribute-value';
import { getNearestNodeFrom } from './get-nearest-node-from';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import type { ARIARoleRelationConcept } from 'aria-query';
import { attributesComparator } from '../attributes-comparator';
import { getDomElements } from '../get-dom-elements';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TmplAstElement } from '@angular/compiler';
import type { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
import { getAttributeValue } from './get-attribute-value';

const presentationRoles: ReadonlySet<string> = new Set([
Expand Down