@angular/compiler-cli 14.0.3 → 14.1.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-N5CM3LUE.js → chunk-32MQTE7C.js} +16 -4
- package/bundles/{chunk-N5CM3LUE.js.map → chunk-32MQTE7C.js.map} +1 -1
- package/bundles/{chunk-EBIPNBQL.js → chunk-5OLIDMUF.js} +2 -2
- package/bundles/{chunk-EBIPNBQL.js.map → chunk-5OLIDMUF.js.map} +0 -0
- package/bundles/{chunk-XDCGNQL5.js → chunk-DSIJ6FBS.js} +50 -9
- package/bundles/{chunk-XDCGNQL5.js.map → chunk-DSIJ6FBS.js.map} +2 -2
- package/bundles/{chunk-JDKMNZ6O.js → chunk-KGCKQ2PH.js} +3 -1
- package/bundles/chunk-KGCKQ2PH.js.map +6 -0
- package/bundles/{chunk-DIXBUYVP.js → chunk-QGR2YCRK.js} +5 -5
- package/bundles/{chunk-DIXBUYVP.js.map → chunk-QGR2YCRK.js.map} +1 -1
- package/bundles/{chunk-7XY4OMWJ.js → chunk-SO3HP2WO.js} +6 -4
- package/bundles/{chunk-7XY4OMWJ.js.map → chunk-SO3HP2WO.js.map} +1 -1
- package/bundles/{chunk-Z7J7RXFF.js → chunk-U2GR6UX6.js} +3 -3
- package/bundles/{chunk-Z7J7RXFF.js.map → chunk-U2GR6UX6.js.map} +0 -0
- package/bundles/index.js +4 -4
- package/bundles/linker/babel/index.js +2 -2
- package/bundles/linker/index.js +2 -2
- package/bundles/ngcc/index.js +5 -5
- package/bundles/ngcc/main-ngcc.js +5 -5
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +4 -4
- package/bundles/private/migrations.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- package/bundles_metadata.json +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +2 -1
- package/src/ngtsc/core/api/src/public_options.d.ts +10 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +5 -0
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +2 -1
- package/src/ngtsc/typecheck/api/api.d.ts +1 -0
- package/src/ngtsc/typecheck/extended/checks/missing_control_flow_directive/index.d.ts +11 -0
- package/bundles/chunk-JDKMNZ6O.js.map +0 -6
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
formatDiagnostics,
|
|
15
15
|
performCompilation,
|
|
16
16
|
readConfiguration
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DSIJ6FBS.js";
|
|
18
18
|
import {
|
|
19
19
|
__spreadProps,
|
|
20
20
|
__spreadValues
|
|
@@ -379,4 +379,4 @@ export {
|
|
|
379
379
|
* Use of this source code is governed by an MIT-style license that can be
|
|
380
380
|
* found in the LICENSE file at https://angular.io/license
|
|
381
381
|
*/
|
|
382
|
-
//# sourceMappingURL=chunk-
|
|
382
|
+
//# sourceMappingURL=chunk-5OLIDMUF.js.map
|
|
File without changes
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
aliasTransformFactory,
|
|
31
31
|
declarationTransformFactory,
|
|
32
32
|
ivyTransformFactory
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-32MQTE7C.js";
|
|
34
34
|
import {
|
|
35
35
|
TypeScriptReflectionHost,
|
|
36
36
|
isNamedClassDeclaration
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
toUnredirectedSourceFile,
|
|
74
74
|
translateExpression,
|
|
75
75
|
translateType
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-KGCKQ2PH.js";
|
|
77
77
|
import {
|
|
78
78
|
LogicalFileSystem,
|
|
79
79
|
absoluteFrom,
|
|
@@ -5883,6 +5883,45 @@ var factory = {
|
|
|
5883
5883
|
create: () => new InvalidBananaInBoxCheck()
|
|
5884
5884
|
};
|
|
5885
5885
|
|
|
5886
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_control_flow_directive/index.mjs
|
|
5887
|
+
import { TmplAstTemplate as TmplAstTemplate4 } from "@angular/compiler";
|
|
5888
|
+
var KNOWN_CONTROL_FLOW_DIRECTIVES = /* @__PURE__ */ new Set(["ngIf", "ngFor", "ngSwitchCase", "ngSwitchDefault"]);
|
|
5889
|
+
var MissingControlFlowDirectiveCheck = class extends TemplateCheckWithVisitor {
|
|
5890
|
+
constructor() {
|
|
5891
|
+
super(...arguments);
|
|
5892
|
+
this.code = ErrorCode.MISSING_CONTROL_FLOW_DIRECTIVE;
|
|
5893
|
+
}
|
|
5894
|
+
run(ctx, component, template) {
|
|
5895
|
+
const componentMetadata = ctx.templateTypeChecker.getDirectiveMetadata(component);
|
|
5896
|
+
if (!componentMetadata || !componentMetadata.isStandalone) {
|
|
5897
|
+
return [];
|
|
5898
|
+
}
|
|
5899
|
+
return super.run(ctx, component, template);
|
|
5900
|
+
}
|
|
5901
|
+
visitNode(ctx, component, node) {
|
|
5902
|
+
if (!(node instanceof TmplAstTemplate4))
|
|
5903
|
+
return [];
|
|
5904
|
+
const controlFlowAttr = node.templateAttrs.find((attr) => KNOWN_CONTROL_FLOW_DIRECTIVES.has(attr.name));
|
|
5905
|
+
if (!controlFlowAttr)
|
|
5906
|
+
return [];
|
|
5907
|
+
const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
|
|
5908
|
+
if (symbol === null || symbol.directives.length > 0) {
|
|
5909
|
+
return [];
|
|
5910
|
+
}
|
|
5911
|
+
const sourceSpan = controlFlowAttr.keySpan || controlFlowAttr.sourceSpan;
|
|
5912
|
+
const errorMessage = `The \`*${controlFlowAttr.name}\` directive was used in the template, but the \`CommonModule\` was not imported. Please make sure that the \`CommonModule\` is included into the \`@Component.imports\` array of this component.`;
|
|
5913
|
+
const diagnostic = ctx.makeTemplateDiagnostic(sourceSpan, errorMessage);
|
|
5914
|
+
return [diagnostic];
|
|
5915
|
+
}
|
|
5916
|
+
};
|
|
5917
|
+
var factory2 = {
|
|
5918
|
+
code: ErrorCode.MISSING_CONTROL_FLOW_DIRECTIVE,
|
|
5919
|
+
name: ExtendedTemplateDiagnosticName.MISSING_CONTROL_FLOW_DIRECTIVE,
|
|
5920
|
+
create: (options) => {
|
|
5921
|
+
return new MissingControlFlowDirectiveCheck();
|
|
5922
|
+
}
|
|
5923
|
+
};
|
|
5924
|
+
|
|
5886
5925
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
5887
5926
|
import { Binary } from "@angular/compiler";
|
|
5888
5927
|
import ts29 from "typescript";
|
|
@@ -5916,7 +5955,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
5916
5955
|
return [diagnostic];
|
|
5917
5956
|
}
|
|
5918
5957
|
};
|
|
5919
|
-
var
|
|
5958
|
+
var factory3 = {
|
|
5920
5959
|
code: ErrorCode.NULLISH_COALESCING_NOT_NULLABLE,
|
|
5921
5960
|
name: ExtendedTemplateDiagnosticName.NULLISH_COALESCING_NOT_NULLABLE,
|
|
5922
5961
|
create: (options) => {
|
|
@@ -5945,12 +5984,12 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
5945
5984
|
var _a, _b, _c, _d, _e;
|
|
5946
5985
|
this.partialCtx = { templateTypeChecker, typeChecker };
|
|
5947
5986
|
this.templateChecks = /* @__PURE__ */ new Map();
|
|
5948
|
-
for (const
|
|
5949
|
-
const category = diagnosticLabelToCategory((_e = (_d = (_b = (_a = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a.checks) == null ? void 0 : _b[
|
|
5987
|
+
for (const factory4 of templateCheckFactories) {
|
|
5988
|
+
const category = diagnosticLabelToCategory((_e = (_d = (_b = (_a = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a.checks) == null ? void 0 : _b[factory4.name]) != null ? _d : (_c = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _c.defaultCategory) != null ? _e : DiagnosticCategoryLabel.Warning);
|
|
5950
5989
|
if (category === null) {
|
|
5951
5990
|
continue;
|
|
5952
5991
|
}
|
|
5953
|
-
const check =
|
|
5992
|
+
const check = factory4.create(options);
|
|
5954
5993
|
if (check === null) {
|
|
5955
5994
|
continue;
|
|
5956
5995
|
}
|
|
@@ -5994,6 +6033,7 @@ ${value}`);
|
|
|
5994
6033
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/index.mjs
|
|
5995
6034
|
var ALL_DIAGNOSTIC_FACTORIES = [
|
|
5996
6035
|
factory,
|
|
6036
|
+
factory3,
|
|
5997
6037
|
factory2
|
|
5998
6038
|
];
|
|
5999
6039
|
|
|
@@ -6449,6 +6489,7 @@ var NgCompiler = class {
|
|
|
6449
6489
|
return diagnostics;
|
|
6450
6490
|
}
|
|
6451
6491
|
makeCompilation() {
|
|
6492
|
+
var _a;
|
|
6452
6493
|
const checker = this.inputProgram.getTypeChecker();
|
|
6453
6494
|
const reflector = new TypeScriptReflectionHost(checker);
|
|
6454
6495
|
let refEmitter;
|
|
@@ -6507,7 +6548,7 @@ var NgCompiler = class {
|
|
|
6507
6548
|
new DirectiveDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, metaReader, injectableRegistry, isCore, semanticDepGraphUpdater, this.closureCompilerEnabled, false, this.delegatingPerfRecorder),
|
|
6508
6549
|
new PipeDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, injectableRegistry, isCore, this.delegatingPerfRecorder),
|
|
6509
6550
|
new InjectableDecoratorHandler(reflector, isCore, this.options.strictInjectionParameters || false, injectableRegistry, this.delegatingPerfRecorder),
|
|
6510
|
-
new NgModuleDecoratorHandler(reflector, evaluator, metaReader, metaRegistry, ngModuleScopeRegistry, referencesRegistry, isCore, refEmitter, this.adapter.factoryTracker, this.closureCompilerEnabled, injectableRegistry, this.delegatingPerfRecorder)
|
|
6551
|
+
new NgModuleDecoratorHandler(reflector, evaluator, metaReader, metaRegistry, ngModuleScopeRegistry, referencesRegistry, isCore, refEmitter, this.adapter.factoryTracker, this.closureCompilerEnabled, (_a = this.options.onlyPublishPublicTypingsForNgModules) != null ? _a : false, injectableRegistry, this.delegatingPerfRecorder)
|
|
6511
6552
|
];
|
|
6512
6553
|
const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater, this.adapter);
|
|
6513
6554
|
const notifyingDriver = new NotifyingProgramDriverWrapper(this.programDriver, (program) => {
|
|
@@ -6609,7 +6650,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
6609
6650
|
`.trim()
|
|
6610
6651
|
});
|
|
6611
6652
|
}
|
|
6612
|
-
const allExtendedDiagnosticNames = ALL_DIAGNOSTIC_FACTORIES.map((
|
|
6653
|
+
const allExtendedDiagnosticNames = ALL_DIAGNOSTIC_FACTORIES.map((factory4) => factory4.name);
|
|
6613
6654
|
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
6614
6655
|
if (!allExtendedDiagnosticNames.includes(checkName)) {
|
|
6615
6656
|
yield makeConfigDiagnostic({
|
|
@@ -7282,4 +7323,4 @@ export {
|
|
|
7282
7323
|
* found in the LICENSE file at https://angular.io/license
|
|
7283
7324
|
*/
|
|
7284
7325
|
// Closure Compiler ignores @suppress and similar if the comment contains @license.
|
|
7285
|
-
//# sourceMappingURL=chunk-
|
|
7326
|
+
//# sourceMappingURL=chunk-DSIJ6FBS.js.map
|