@angular/core 12.0.1 → 12.0.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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "12.0.1",
3
+ "version": "12.0.2",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": "^12.14.1 || ^14.0.0"
8
+ "node": "^12.14.1 || >=14.0.0"
9
9
  },
10
10
  "dependencies": {
11
11
  "tslib": "^2.1.0"
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /// <amd-module name="@angular/core/schematics/migrations/deep-shadow-piercing-selector" />
9
+ import { Rule } from '@angular-devkit/schematics';
10
+ export default function (): Rule;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ (function (factory) {
9
+ if (typeof module === "object" && typeof module.exports === "object") {
10
+ var v = factory(require, exports);
11
+ if (v !== undefined) module.exports = v;
12
+ }
13
+ else if (typeof define === "function" && define.amd) {
14
+ define("@angular/core/schematics/migrations/deep-shadow-piercing-selector", ["require", "exports", "@angular-devkit/core"], factory);
15
+ }
16
+ })(function (require, exports) {
17
+ "use strict";
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ const core_1 = require("@angular-devkit/core");
20
+ const VALID_EXTENSIONS = ['.scss', '.sass', '.css', '.styl', '.less', '.ts'];
21
+ function* visitFiles(directory) {
22
+ for (const path of directory.subfiles) {
23
+ const extension = core_1.extname(path);
24
+ if (VALID_EXTENSIONS.includes(extension)) {
25
+ yield core_1.join(directory.path, path);
26
+ }
27
+ }
28
+ for (const path of directory.subdirs) {
29
+ if (path === 'node_modules' || path.startsWith('.') || path === 'dist') {
30
+ continue;
31
+ }
32
+ yield* visitFiles(directory.dir(path));
33
+ }
34
+ }
35
+ function default_1() {
36
+ return (tree) => {
37
+ var _a;
38
+ // Visit all files in an Angular workspace monorepo.
39
+ for (const file of visitFiles(tree.root)) {
40
+ const content = (_a = tree.read(file)) === null || _a === void 0 ? void 0 : _a.toString();
41
+ if (content === null || content === void 0 ? void 0 : content.includes('/deep/ ')) {
42
+ tree.overwrite(file, content.replace(/\/deep\/ /g, '::ng-deep '));
43
+ }
44
+ }
45
+ };
46
+ }
47
+ exports.default = default_1;
48
+ });
49
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NjaGVtYXRpY3MvbWlncmF0aW9ucy9kZWVwLXNoYWRvdy1waWVyY2luZy1zZWxlY3Rvci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7OztJQUVILCtDQUFtRDtJQUduRCxNQUFNLGdCQUFnQixHQUFHLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRSxLQUFLLENBQUMsQ0FBQztJQUU3RSxRQUFRLENBQUMsQ0FBQyxVQUFVLENBQUMsU0FBbUI7UUFDdEMsS0FBSyxNQUFNLElBQUksSUFBSSxTQUFTLENBQUMsUUFBUSxFQUFFO1lBQ3JDLE1BQU0sU0FBUyxHQUFHLGNBQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztZQUNoQyxJQUFJLGdCQUFnQixDQUFDLFFBQVEsQ0FBQyxTQUFTLENBQUMsRUFBRTtnQk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SB7XG4gIHJldHVybiAodHJlZSkgPT4ge1xuICAgIC8vIFZpc2l0IGFsbCBmaWxlcyBpbiBhbiBBbmd1bGFyIHdvcmtzcGFjZSBtb25vcmVwby5cbiAgICBmb3IgKGNvbnN0IGZpbGUgb2YgdmlzaXRGaWxlcyh0cmVlLnJvb3QpKSB7XG4gICAgICBjb25zdCBjb250ZW50ID0gdHJlZS5yZWFkKGZpbGUpPy50b1N0cmluZygpO1xuICAgICAgaWYgKGNvbnRlbnQ/LmluY2x1ZGVzKCcvZGVlcC8gJykpIHtcbiAgICAgICAgdHJlZS5vdmVyd3JpdGUoZmlsZSwgY29udGVudC5yZXBsYWNlKC9cXC9kZWVwXFwvIC9nLCAnOjpuZy1kZWVwICcpKTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG59XG4iXX0=
@@ -94,6 +94,11 @@
94
94
  "version": "12.0.0-next.6",
95
95
  "description": "`XhrFactory` has been moved from `@angular/common/http` to `@angular/common`.",
96
96
  "factory": "./migrations/xhr-factory/index"
97
+ },
98
+ "migration-v12-deep-shadow-piercing-selector": {
99
+ "version": "12.0.2",
100
+ "description": "Automatically migrates shadow-piercing selector from `/deep/` to the recommanded alternative `::ng-deep`.",
101
+ "factory": "./migrations/deep-shadow-piercing-selector/index"
97
102
  }
98
103
  }
99
104
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.1
2
+ * @license Angular v12.0.2
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.1
2
+ * @license Angular v12.0.2
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -136,33 +136,37 @@ export declare const ComponentFixtureNoNgZone: InjectionToken<boolean[]>;
136
136
  export declare function discardPeriodicTasks(): void;
137
137
 
138
138
  /**
139
- * Wraps a function to be executed in the fakeAsync zone:
140
- * - microtasks are manually executed by calling `flushMicrotasks()`,
141
- * - timers are synchronous, `tick()` simulates the asynchronous passage of time.
139
+ * Wraps a function to be executed in the `fakeAsync` zone:
140
+ * - Microtasks are manually executed by calling `flushMicrotasks()`.
141
+ * - Timers are synchronous; `tick()` simulates the asynchronous passage of time.
142
142
  *
143
- * If there are any pending timers at the end of the function, an exception will be thrown.
143
+ * If there are any pending timers at the end of the function, an exception is thrown.
144
144
  *
145
- * Can be used to wrap inject() calls.
145
+ * Can be used to wrap `inject()` calls.
146
+ *
147
+ * @param fn The function that you want to wrap in the `fakeAysnc` zone.
146
148
  *
147
149
  * @usageNotes
148
150
  * ### Example
149
151
  *
150
152
  * {@example core/testing/ts/fake_async.ts region='basic'}
151
153
  *
152
- * @param fn
153
- * @returns The function wrapped to be executed in the fakeAsync zone
154
+ *
155
+ * @returns The function wrapped to be executed in the `fakeAsync` zone.
156
+ * Any arguments passed when calling this returned function will be passed through to the `fn`
157
+ * function in the parameters when it is called.
154
158
  *
155
159
  * @publicApi
156
160
  */
157
161
  export declare function fakeAsync(fn: Function): (...args: any[]) => any;
158
162
 
159
163
  /**
160
- * Simulates the asynchronous passage of time for the timers in the fakeAsync zone by
161
- * draining the macrotask queue until it is empty. The returned value is the milliseconds
162
- * of time that would have been elapsed.
164
+ * Simulates the asynchronous passage of time for the timers in the `fakeAsync` zone by
165
+ * draining the macrotask queue until it is empty.
163
166
  *
164
- * @param maxTurns
165
- * @returns The simulated time elapsed, in millis.
167
+ * @param maxTurns The maximum number of times the scheduler attempts to clear its queue before
168
+ * throwing an error.
169
+ * @returns The simulated time elapsed, in milliseconds.
166
170
  *
167
171
  * @publicApi
168
172
  */
@@ -404,23 +408,36 @@ export declare type TestModuleMetadata = {
404
408
  };
405
409
 
406
410
  /**
407
- * Simulates the asynchronous passage of time for the timers in the fakeAsync zone.
411
+ * Simulates the asynchronous passage of time for the timers in the `fakeAsync` zone.
408
412
  *
409
413
  * The microtasks queue is drained at the very start of this function and after any timer callback
410
414
  * has been executed.
411
415
  *
416
+ * @param millis The number of milliseconds to advance the virtual timer.
417
+ * @param tickOptions The options to pass to the `tick()` function.
418
+ *
412
419
  * @usageNotes
420
+ *
421
+ * The `tick()` option is a flag called `processNewMacroTasksSynchronously`,
422
+ * which determines whether or not to invoke new macroTasks.
423
+ *
424
+ * If you provide a `tickOptions` object, but do not specify a
425
+ * `processNewMacroTasksSynchronously` property (`tick(100, {})`),
426
+ * then `processNewMacroTasksSynchronously` defaults to true.
427
+ *
428
+ * If you omit the `tickOptions` parameter (`tick(100))`), then
429
+ * `tickOptions` defaults to `{processNewMacroTasksSynchronously: true}`.
430
+ *
413
431
  * ### Example
414
432
  *
415
433
  * {@example core/testing/ts/fake_async.ts region='basic'}
416
434
  *
417
- * @param millis, the number of millisecond to advance the virtual timer
418
- * @param tickOptions, the options of tick with a flag called
419
- * processNewMacroTasksSynchronously, whether to invoke the new macroTasks, by default is
420
- * false, means the new macroTasks will be invoked
421
- *
422
- * For example,
435
+ * The following example includes a nested timeout (new macroTask), and
436
+ * the `tickOptions` parameter is allowed to default. In this case,
437
+ * `processNewMacroTasksSynchronously` defaults to true, and the nested
438
+ * function is executed on each tick.
423
439
  *
440
+ * ```
424
441
  * it ('test with nested setTimeout', fakeAsync(() => {
425
442
  * let nestedTimeoutInvoked = false;
426
443
  * function funcWithNestedTimeout() {
@@ -432,10 +449,12 @@ export declare type TestModuleMetadata = {
432
449
  * tick();
433
450
  * expect(nestedTimeoutInvoked).toBe(true);
434
451
  * }));
452
+ * ```
435
453
  *
436
- * in this case, we have a nested timeout (new macroTask), when we tick, both the
437
- * funcWithNestedTimeout and the nested timeout both will be invoked.
454
+ * In the following case, `processNewMacroTasksSynchronously` is explicitly
455
+ * set to false, so the nested timeout function is not invoked.
438
456
  *
457
+ * ```
439
458
  * it ('test with nested setTimeout', fakeAsync(() => {
440
459
  * let nestedTimeoutInvoked = false;
441
460
  * function funcWithNestedTimeout() {
@@ -447,9 +466,7 @@ export declare type TestModuleMetadata = {
447
466
  * tick(0, {processNewMacroTasksSynchronously: false});
448
467
  * expect(nestedTimeoutInvoked).toBe(false);
449
468
  * }));
450
- *
451
- * if we pass the tickOptions with processNewMacroTasksSynchronously to be false, the nested timeout
452
- * will not be invoked.
469
+ * ```
453
470
  *
454
471
  *
455
472
  * @publicApi
package/testing.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.1
2
+ * @license Angular v12.0.2
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */