@nrwl/angular 12.1.0 → 12.2.0
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 +5 -5
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/compile-ngc.d.ts +3 -1
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/compile-ngc.js +7 -6
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/compile-ngc.js.map +1 -1
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/entry-point.d.ts +30 -0
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/entry-point.di.js +5 -12
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/entry-point.di.js.map +1 -1
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/entry-point.js +54 -0
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/entry-point.js.map +1 -0
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-package.d.ts +8 -0
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-package.di.d.ts +5 -0
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-package.di.js +12 -0
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-package.di.js.map +1 -0
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-package.js +200 -0
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-package.js.map +1 -0
- package/src/utils/versions.js +1 -1
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-bundles.d.ts +0 -12
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-bundles.js +0 -70
- package/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-bundles.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/angular",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.2.0",
|
|
4
4
|
"description": "Angular Plugin for Nx",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@angular-devkit/schematics": "~11.2.0",
|
|
34
|
-
"@nrwl/cypress": "12.
|
|
35
|
-
"@nrwl/devkit": "12.
|
|
36
|
-
"@nrwl/jest": "12.
|
|
37
|
-
"@nrwl/linter": "12.
|
|
34
|
+
"@nrwl/cypress": "12.2.0",
|
|
35
|
+
"@nrwl/devkit": "12.2.0",
|
|
36
|
+
"@nrwl/jest": "12.2.0",
|
|
37
|
+
"@nrwl/linter": "12.2.0",
|
|
38
38
|
"@schematics/angular": "~11.2.0",
|
|
39
39
|
"jasmine-marbles": "~0.6.0",
|
|
40
40
|
"tslib": "^2.0.0"
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* Excludes the ngcc compilation which is not needed
|
|
5
5
|
* since these libraries will be compiled by the ngtsc.
|
|
6
6
|
*/
|
|
7
|
+
import { InjectionToken } from 'injection-js';
|
|
7
8
|
import { Transform } from 'ng-packagr/lib/graph/transform';
|
|
8
9
|
import { TransformProvider } from 'ng-packagr/lib/graph/transform.di';
|
|
9
10
|
import { StylesheetProcessor as StylesheetProcessorClass } from 'ng-packagr/lib/styles/stylesheet-processor';
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const nxCompileNgcTransformFactory: (StylesheetProcessor: typeof StylesheetProcessorClass) => Transform;
|
|
12
|
+
export declare const NX_COMPILE_NGC_TOKEN: InjectionToken<Transform>;
|
|
11
13
|
export declare const NX_COMPILE_NGC_TRANSFORM: TransformProvider;
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
* since these libraries will be compiled by the ngtsc.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.NX_COMPILE_NGC_TRANSFORM = exports.
|
|
9
|
+
exports.NX_COMPILE_NGC_TRANSFORM = exports.NX_COMPILE_NGC_TOKEN = exports.nxCompileNgcTransformFactory = void 0;
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
|
+
const injection_js_1 = require("injection-js");
|
|
11
12
|
const transform_1 = require("ng-packagr/lib/graph/transform");
|
|
12
13
|
const transform_di_1 = require("ng-packagr/lib/graph/transform.di");
|
|
13
|
-
const compile_ngc_di_1 = require("ng-packagr/lib/ng-package/entry-point/compile-ngc.di");
|
|
14
14
|
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
|
15
15
|
const compile_source_files_1 = require("ng-packagr/lib/ngc/compile-source-files");
|
|
16
16
|
const stylesheet_processor_di_1 = require("ng-packagr/lib/styles/stylesheet-processor.di");
|
|
17
17
|
const tsconfig_1 = require("ng-packagr/lib/ts/tsconfig");
|
|
18
18
|
const path = require("path");
|
|
19
19
|
const ts = require("typescript");
|
|
20
|
-
const
|
|
20
|
+
const nxCompileNgcTransformFactory = (StylesheetProcessor) => {
|
|
21
21
|
return transform_1.transformFromPromise((graph) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
22
22
|
try {
|
|
23
23
|
const entryPoint = graph.find(nodes_1.isEntryPointInProgress());
|
|
@@ -42,10 +42,11 @@ const compileNgcTransformFactory = (StylesheetProcessor) => {
|
|
|
42
42
|
return graph;
|
|
43
43
|
}));
|
|
44
44
|
};
|
|
45
|
-
exports.
|
|
45
|
+
exports.nxCompileNgcTransformFactory = nxCompileNgcTransformFactory;
|
|
46
|
+
exports.NX_COMPILE_NGC_TOKEN = new injection_js_1.InjectionToken(`nx.v1.compileNgc`);
|
|
46
47
|
exports.NX_COMPILE_NGC_TRANSFORM = transform_di_1.provideTransform({
|
|
47
|
-
provide:
|
|
48
|
-
useFactory: exports.
|
|
48
|
+
provide: exports.NX_COMPILE_NGC_TOKEN,
|
|
49
|
+
useFactory: exports.nxCompileNgcTransformFactory,
|
|
49
50
|
deps: [stylesheet_processor_di_1.STYLESHEET_PROCESSOR_TOKEN],
|
|
50
51
|
});
|
|
51
52
|
//# sourceMappingURL=compile-ngc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-ngc.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/ng-packagr-lite/ng-packagr-adjustments/compile-ngc.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,8DAGwC;AACxC,oEAG2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"compile-ngc.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/ng-packagr-lite/ng-packagr-adjustments/compile-ngc.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,+CAA8C;AAC9C,8DAGwC;AACxC,oEAG2C;AAC3C,2DAIyC;AACzC,kFAA6E;AAE7E,2FAA2F;AAC3F,yDAA0E;AAC1E,6BAA6B;AAC7B,iCAAiC;AAE1B,MAAM,4BAA4B,GAAG,CAC1C,mBAAoD,EACzC,EAAE;IACb,OAAO,gCAAoB,CAAC,CAAO,KAAK,EAAE,EAAE;QAC1C,IAAI;YACF,MAAM,UAAU,GAAmB,KAAK,CAAC,IAAI,CAAC,8BAAsB,EAAE,CAAC,CAAC;YACxE,MAAM,WAAW,GAAqB,KAAK,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;YACjE,sCAAsC;YACtC,MAAM,QAAQ,GAAG,uCAA4B,CAC3C,UAAU,CAAC,IAAI,CAAC,QAAQ,EACxB,WAAW,CACZ,CAAC;YAEF,6BAA6B;YAC7B,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACnE,MAAM,EAAE,qBAAqB,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC;YACnD,MAAM,EACJ,QAAQ,EACR,MAAM,EACN,iBAAiB,GAClB,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC;YAC/B,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,CACjD,QAAQ,EACR,MAAM,EACN,iBAAiB,CAClB,CAAC;YAEF,MAAM,yCAAkB,CACtB,KAAK,EACL,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB;gBACE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC7B,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;gBAC1C,WAAW,EAAE,IAAI;gBACjB,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;aAC/B,CACF,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAC;SACb;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC;AA7CW,QAAA,4BAA4B,gCA6CvC;AAEW,QAAA,oBAAoB,GAAG,IAAI,6BAAc,CACpD,kBAAkB,CACnB,CAAC;AACW,QAAA,wBAAwB,GAAsB,+BAAgB,CAAC;IAC1E,OAAO,EAAE,4BAAoB;IAC7B,UAAU,EAAE,oCAA4B;IACxC,IAAI,EAAE,CAAC,oDAA0B,CAAC;CACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from original ng-packagr source
|
|
3
|
+
*
|
|
4
|
+
* Remove writing bundles as they are not needed
|
|
5
|
+
* for incremental builds.
|
|
6
|
+
*/
|
|
7
|
+
import { Transform } from 'ng-packagr/lib/graph/transform';
|
|
8
|
+
/**
|
|
9
|
+
* A re-write of the `transformSources()` script that transforms an entry point from sources to distributable format.
|
|
10
|
+
*
|
|
11
|
+
* Sources are TypeScript source files accompanied by HTML templates and xCSS stylesheets.
|
|
12
|
+
* See the Angular Package Format for a detailed description of what the distributables include.
|
|
13
|
+
*
|
|
14
|
+
* The current transformation pipeline can be thought of as:
|
|
15
|
+
*
|
|
16
|
+
* - clean
|
|
17
|
+
* - compileTs
|
|
18
|
+
* - downlevelTs
|
|
19
|
+
* - relocateSourceMaps
|
|
20
|
+
* - writePackage
|
|
21
|
+
* - copyStagedFiles (esm, dts, metadata, sourcemaps)
|
|
22
|
+
* - writePackageJson
|
|
23
|
+
*
|
|
24
|
+
* The transformation pipeline is pluggable through the dependency injection system.
|
|
25
|
+
* Sub-transformations are passed to this factory function as arguments.
|
|
26
|
+
*
|
|
27
|
+
* @param compileTs Transformation compiling typescript sources to ES2015 modules.
|
|
28
|
+
* @param writePackage Transformation writing a distribution-ready `package.json` (for publishing to npm registry).
|
|
29
|
+
*/
|
|
30
|
+
export declare const nxEntryPointTransformFactory: (compileTs: Transform, writePackage: Transform) => Transform;
|
|
@@ -6,27 +6,20 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.NX_ENTRY_POINT_PROVIDERS = exports.NX_ENTRY_POINT_TRANSFORM = exports.NX_ENTRY_POINT_TRANSFORM_TOKEN = void 0;
|
|
9
|
-
const compile_ngc_di_1 = require("ng-packagr/lib/ng-package/entry-point/compile-ngc.di");
|
|
10
|
-
const write_bundles_1 = require("./write-bundles");
|
|
11
|
-
const write_package_di_1 = require("ng-packagr/lib/ng-package/entry-point/write-package.di");
|
|
12
9
|
const injection_js_1 = require("injection-js");
|
|
13
10
|
const transform_di_1 = require("ng-packagr/lib/graph/transform.di");
|
|
14
|
-
const entry_point_transform_1 = require("ng-packagr/lib/ng-package/entry-point/entry-point.transform");
|
|
15
11
|
const compile_ngc_1 = require("./compile-ngc");
|
|
12
|
+
const entry_point_1 = require("./entry-point");
|
|
13
|
+
const write_package_di_1 = require("./write-package.di");
|
|
16
14
|
exports.NX_ENTRY_POINT_TRANSFORM_TOKEN = new injection_js_1.InjectionToken(`nx.v1.entryPointTransform`);
|
|
17
15
|
exports.NX_ENTRY_POINT_TRANSFORM = transform_di_1.provideTransform({
|
|
18
16
|
provide: exports.NX_ENTRY_POINT_TRANSFORM_TOKEN,
|
|
19
|
-
useFactory:
|
|
20
|
-
deps: [
|
|
21
|
-
compile_ngc_di_1.COMPILE_NGC_TOKEN,
|
|
22
|
-
write_bundles_1.NX_WRITE_BUNDLES_TRANSFORM_TOKEN,
|
|
23
|
-
write_package_di_1.WRITE_PACKAGE_TRANSFORM_TOKEN,
|
|
24
|
-
],
|
|
17
|
+
useFactory: entry_point_1.nxEntryPointTransformFactory,
|
|
18
|
+
deps: [compile_ngc_1.NX_COMPILE_NGC_TOKEN, write_package_di_1.NX_WRITE_PACKAGE_TRANSFORM_TOKEN],
|
|
25
19
|
});
|
|
26
20
|
exports.NX_ENTRY_POINT_PROVIDERS = [
|
|
27
21
|
exports.NX_ENTRY_POINT_TRANSFORM,
|
|
28
22
|
compile_ngc_1.NX_COMPILE_NGC_TRANSFORM,
|
|
29
|
-
|
|
30
|
-
write_package_di_1.WRITE_PACKAGE_TRANSFORM,
|
|
23
|
+
write_package_di_1.NX_WRITE_PACKAGE_TRANSFORM,
|
|
31
24
|
];
|
|
32
25
|
//# sourceMappingURL=entry-point.di.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-point.di.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/ng-packagr-lite/ng-packagr-adjustments/entry-point.di.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH
|
|
1
|
+
{"version":3,"file":"entry-point.di.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/ng-packagr-lite/ng-packagr-adjustments/entry-point.di.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+CAAwD;AAExD,oEAG2C;AAC3C,+CAA+E;AAC/E,+CAA6D;AAC7D,yDAG4B;AAEf,QAAA,8BAA8B,GAAG,IAAI,6BAAc,CAC9D,2BAA2B,CAC5B,CAAC;AAEW,QAAA,wBAAwB,GAAsB,+BAAgB,CAAC;IAC1E,OAAO,EAAE,sCAA8B;IACvC,UAAU,EAAE,0CAA4B;IACxC,IAAI,EAAE,CAAC,kCAAoB,EAAE,mDAAgC,CAAC;CAC/D,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAe;IAClD,gCAAwB;IACxB,sCAAwB;IACxB,6CAA0B;CAC3B,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Adapted from original ng-packagr source
|
|
4
|
+
*
|
|
5
|
+
* Remove writing bundles as they are not needed
|
|
6
|
+
* for incremental builds.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.nxEntryPointTransformFactory = void 0;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
12
|
+
const node_1 = require("ng-packagr/lib/graph/node");
|
|
13
|
+
const select_1 = require("ng-packagr/lib/graph/select");
|
|
14
|
+
const transform_1 = require("ng-packagr/lib/graph/transform");
|
|
15
|
+
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
|
16
|
+
const rxjs_1 = require("rxjs");
|
|
17
|
+
/**
|
|
18
|
+
* A re-write of the `transformSources()` script that transforms an entry point from sources to distributable format.
|
|
19
|
+
*
|
|
20
|
+
* Sources are TypeScript source files accompanied by HTML templates and xCSS stylesheets.
|
|
21
|
+
* See the Angular Package Format for a detailed description of what the distributables include.
|
|
22
|
+
*
|
|
23
|
+
* The current transformation pipeline can be thought of as:
|
|
24
|
+
*
|
|
25
|
+
* - clean
|
|
26
|
+
* - compileTs
|
|
27
|
+
* - downlevelTs
|
|
28
|
+
* - relocateSourceMaps
|
|
29
|
+
* - writePackage
|
|
30
|
+
* - copyStagedFiles (esm, dts, metadata, sourcemaps)
|
|
31
|
+
* - writePackageJson
|
|
32
|
+
*
|
|
33
|
+
* The transformation pipeline is pluggable through the dependency injection system.
|
|
34
|
+
* Sub-transformations are passed to this factory function as arguments.
|
|
35
|
+
*
|
|
36
|
+
* @param compileTs Transformation compiling typescript sources to ES2015 modules.
|
|
37
|
+
* @param writePackage Transformation writing a distribution-ready `package.json` (for publishing to npm registry).
|
|
38
|
+
*/
|
|
39
|
+
const nxEntryPointTransformFactory = (compileTs, writePackage) => rxjs_1.pipe(transform_1.transformFromPromise((graph) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
// Peek the first entry point from the graph
|
|
41
|
+
const entryPoint = graph.find(nodes_1.byEntryPoint().and(select_1.isInProgress));
|
|
42
|
+
devkit_1.logger.info('\n------------------------------------------------------------------------------');
|
|
43
|
+
devkit_1.logger.info(`Building entry point '${entryPoint.data.entryPoint.moduleId}'`);
|
|
44
|
+
devkit_1.logger.info('------------------------------------------------------------------------------');
|
|
45
|
+
})),
|
|
46
|
+
// TypeScript sources compilation
|
|
47
|
+
compileTs,
|
|
48
|
+
// After TypeScript: write package
|
|
49
|
+
writePackage, transform_1.transformFromPromise((graph) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
+
const entryPoint = graph.find(nodes_1.byEntryPoint().and(select_1.isInProgress));
|
|
51
|
+
entryPoint.state = node_1.STATE_DONE;
|
|
52
|
+
})));
|
|
53
|
+
exports.nxEntryPointTransformFactory = nxEntryPointTransformFactory;
|
|
54
|
+
//# sourceMappingURL=entry-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-point.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/ng-packagr-lite/ng-packagr-adjustments/entry-point.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,yCAAsC;AACtC,oDAAuD;AACvD,wDAA2D;AAC3D,8DAGwC;AACxC,2DAA+D;AAC/D,+BAA4B;AAE5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACI,MAAM,4BAA4B,GAAG,CAC1C,SAAoB,EACpB,YAAuB,EACZ,EAAE,CACb,WAAI,CACF,gCAAoB,CAAC,CAAO,KAAK,EAAE,EAAE;IACnC,4CAA4C;IAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,oBAAY,EAAE,CAAC,GAAG,CAAC,qBAAY,CAAC,CAAC,CAAC;IAChE,eAAM,CAAC,IAAI,CACT,kFAAkF,CACnF,CAAC;IACF,eAAM,CAAC,IAAI,CACT,yBAAyB,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,CAChE,CAAC;IACF,eAAM,CAAC,IAAI,CACT,gFAAgF,CACjF,CAAC;AACJ,CAAC,CAAA,CAAC;AACF,iCAAiC;AACjC,SAAS;AACT,kCAAkC;AAClC,YAAY,EACZ,gCAAoB,CAAC,CAAO,KAAK,EAAE,EAAE;IACnC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,oBAAY,EAAE,CAAC,GAAG,CAAC,qBAAY,CAAC,CAAC,CAAC;IAChE,UAAU,CAAC,KAAK,GAAG,iBAAU,CAAC;AAChC,CAAC,CAAA,CAAC,CACH,CAAC;AA1BS,QAAA,4BAA4B,gCA0BrC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from original ng-packagr
|
|
3
|
+
*
|
|
4
|
+
* Change the package.json metadata to only use
|
|
5
|
+
* the ESM2015 output as it's the only one generated.
|
|
6
|
+
*/
|
|
7
|
+
import { Transform } from 'ng-packagr/lib/graph/transform';
|
|
8
|
+
export declare const nxWritePackageTransform: Transform;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InjectionToken } from 'injection-js';
|
|
2
|
+
import { Transform } from 'ng-packagr/lib/graph/transform';
|
|
3
|
+
import { TransformProvider } from 'ng-packagr/lib/graph/transform.di';
|
|
4
|
+
export declare const NX_WRITE_PACKAGE_TRANSFORM_TOKEN: InjectionToken<Transform>;
|
|
5
|
+
export declare const NX_WRITE_PACKAGE_TRANSFORM: TransformProvider;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NX_WRITE_PACKAGE_TRANSFORM = exports.NX_WRITE_PACKAGE_TRANSFORM_TOKEN = void 0;
|
|
4
|
+
const injection_js_1 = require("injection-js");
|
|
5
|
+
const transform_di_1 = require("ng-packagr/lib/graph/transform.di");
|
|
6
|
+
const write_package_1 = require("./write-package");
|
|
7
|
+
exports.NX_WRITE_PACKAGE_TRANSFORM_TOKEN = new injection_js_1.InjectionToken(`nx.v1.writePackageTransform`);
|
|
8
|
+
exports.NX_WRITE_PACKAGE_TRANSFORM = transform_di_1.provideTransform({
|
|
9
|
+
provide: exports.NX_WRITE_PACKAGE_TRANSFORM_TOKEN,
|
|
10
|
+
useFactory: () => write_package_1.nxWritePackageTransform,
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=write-package.di.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-package.di.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-package.di.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAE9C,oEAG2C;AAC3C,mDAA0D;AAE7C,QAAA,gCAAgC,GAAG,IAAI,6BAAc,CAChE,6BAA6B,CAC9B,CAAC;AACW,QAAA,0BAA0B,GAAsB,+BAAgB,CAAC;IAC5E,OAAO,EAAE,wCAAgC;IACzC,UAAU,EAAE,GAAG,EAAE,CAAC,uCAAuB;CAC1C,CAAC,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Adapted from original ng-packagr
|
|
4
|
+
*
|
|
5
|
+
* Change the package.json metadata to only use
|
|
6
|
+
* the ESM2015 output as it's the only one generated.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.nxWritePackageTransform = void 0;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
12
|
+
const node_1 = require("ng-packagr/lib/graph/node");
|
|
13
|
+
const transform_1 = require("ng-packagr/lib/graph/transform");
|
|
14
|
+
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
|
15
|
+
const fs_1 = require("ng-packagr/lib/utils/fs");
|
|
16
|
+
const glob_1 = require("ng-packagr/lib/utils/glob");
|
|
17
|
+
const path_1 = require("ng-packagr/lib/utils/path");
|
|
18
|
+
const path = require("path");
|
|
19
|
+
exports.nxWritePackageTransform = transform_1.transformFromPromise((graph) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
const entryPoint = graph.find(nodes_1.isEntryPointInProgress());
|
|
21
|
+
const ngEntryPoint = entryPoint.data.entryPoint;
|
|
22
|
+
const ngPackageNode = graph.find(nodes_1.isPackage);
|
|
23
|
+
const ngPackage = ngPackageNode.data;
|
|
24
|
+
const { destinationFiles } = entryPoint.data;
|
|
25
|
+
const ignorePaths = [
|
|
26
|
+
'.gitkeep',
|
|
27
|
+
'**/.DS_Store',
|
|
28
|
+
'**/Thumbs.db',
|
|
29
|
+
'**/node_modules/**',
|
|
30
|
+
`${ngPackage.dest}/**`,
|
|
31
|
+
];
|
|
32
|
+
if (ngPackage.assets.length && !ngEntryPoint.isSecondaryEntryPoint) {
|
|
33
|
+
const assetFiles = [];
|
|
34
|
+
// COPY ASSET FILES TO DESTINATION
|
|
35
|
+
devkit_1.logger.log('Copying assets');
|
|
36
|
+
try {
|
|
37
|
+
for (let asset of ngPackage.assets) {
|
|
38
|
+
asset = path.join(ngPackage.src, asset);
|
|
39
|
+
if (yield fs_1.exists(asset)) {
|
|
40
|
+
const stats = yield fs_1.stat(asset);
|
|
41
|
+
if (stats.isFile()) {
|
|
42
|
+
assetFiles.push(asset);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (stats.isDirectory()) {
|
|
46
|
+
asset = path.join(asset, '**/*');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const files = yield glob_1.globFiles(asset, {
|
|
50
|
+
ignore: ignorePaths,
|
|
51
|
+
cache: ngPackageNode.cache.globCache,
|
|
52
|
+
dot: true,
|
|
53
|
+
nodir: true,
|
|
54
|
+
});
|
|
55
|
+
if (files.length) {
|
|
56
|
+
assetFiles.push(...files);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
for (const file of assetFiles) {
|
|
60
|
+
const relativePath = path.relative(ngPackage.src, file);
|
|
61
|
+
const destination = path.resolve(ngPackage.dest, relativePath);
|
|
62
|
+
const nodeUri = nodes_1.fileUrl(path_1.ensureUnixPath(file));
|
|
63
|
+
let node = graph.get(nodeUri);
|
|
64
|
+
if (!node) {
|
|
65
|
+
node = new node_1.Node(nodeUri);
|
|
66
|
+
graph.put(node);
|
|
67
|
+
}
|
|
68
|
+
entryPoint.dependsOn(node);
|
|
69
|
+
yield fs_1.copyFile(file, destination);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// 6. WRITE PACKAGE.JSON
|
|
77
|
+
try {
|
|
78
|
+
devkit_1.logger.info('Writing package metadata');
|
|
79
|
+
const relativeUnixFromDestPath = (filePath) => path_1.ensureUnixPath(path.relative(ngEntryPoint.destinationPath, filePath));
|
|
80
|
+
const isIvy = !!entryPoint.data.tsConfig.options.enableIvy;
|
|
81
|
+
yield writePackageJson(ngEntryPoint, ngPackage, {
|
|
82
|
+
module: relativeUnixFromDestPath(destinationFiles.esm2015),
|
|
83
|
+
esm2015: relativeUnixFromDestPath(destinationFiles.esm2015),
|
|
84
|
+
typings: relativeUnixFromDestPath(destinationFiles.declarations),
|
|
85
|
+
// Ivy doesn't generate metadata files
|
|
86
|
+
metadata: isIvy
|
|
87
|
+
? undefined
|
|
88
|
+
: relativeUnixFromDestPath(destinationFiles.metadata),
|
|
89
|
+
// webpack v4+ specific flag to enable advanced optimizations and code splitting
|
|
90
|
+
sideEffects: ngEntryPoint.sideEffects,
|
|
91
|
+
}, isIvy);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
devkit_1.logger.info(`Built ${ngEntryPoint.moduleId}`);
|
|
97
|
+
return graph;
|
|
98
|
+
}));
|
|
99
|
+
/**
|
|
100
|
+
* Creates and writes a `package.json` file of the entry point used by the `node_module`
|
|
101
|
+
* resolution strategies.
|
|
102
|
+
*
|
|
103
|
+
* #### Example
|
|
104
|
+
*
|
|
105
|
+
* A consumer of the entry point depends on it by `import {..} from '@my/module/id';`.
|
|
106
|
+
* The module id `@my/module/id` will be resolved to the `package.json` file that is written by
|
|
107
|
+
* this build step.
|
|
108
|
+
* The properties `main`, `module`, `typings` (and so on) in the `package.json` point to the
|
|
109
|
+
* flattened JavaScript bundles, type definitions, (...).
|
|
110
|
+
*
|
|
111
|
+
* @param entryPoint An entry point of an Angular package / library
|
|
112
|
+
* @param additionalProperties Additional properties, e.g. binary artefacts (bundle files), to merge into `package.json`
|
|
113
|
+
*/
|
|
114
|
+
function writePackageJson(entryPoint, pkg, additionalProperties, isIvy) {
|
|
115
|
+
var _a, _b, _c;
|
|
116
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
// set additional properties
|
|
118
|
+
const packageJson = Object.assign(Object.assign({}, entryPoint.packageJson), additionalProperties);
|
|
119
|
+
// read tslib version from `@angular/compiler` so that our tslib
|
|
120
|
+
// version at least matches that of angular if we use require('tslib').version
|
|
121
|
+
// it will get what installed and not the minimum version nor if it is a `~` or `^`
|
|
122
|
+
// this is only required for primary
|
|
123
|
+
if (!entryPoint.isSecondaryEntryPoint) {
|
|
124
|
+
if (!((_a = packageJson.peerDependencies) === null || _a === void 0 ? void 0 : _a.tslib) &&
|
|
125
|
+
!((_b = packageJson.dependencies) === null || _b === void 0 ? void 0 : _b.tslib)) {
|
|
126
|
+
const { peerDependencies: angularPeerDependencies = {}, dependencies: angularDependencies = {}, } = require('@angular/compiler/package.json');
|
|
127
|
+
const tsLibVersion = angularPeerDependencies.tslib || angularDependencies.tslib;
|
|
128
|
+
if (tsLibVersion) {
|
|
129
|
+
packageJson.dependencies = Object.assign(Object.assign({}, packageJson.dependencies), { tslib: tsLibVersion });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if ((_c = packageJson.peerDependencies) === null || _c === void 0 ? void 0 : _c.tslib) {
|
|
133
|
+
devkit_1.logger.warn(`'tslib' is no longer recommended to be used as a 'peerDependencies'. Moving it to 'dependencies'.`);
|
|
134
|
+
packageJson.dependencies = Object.assign(Object.assign({}, (packageJson.dependencies || {})), { tslib: packageJson.peerDependencies.tslib });
|
|
135
|
+
delete packageJson.peerDependencies.tslib;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// Verify non-peerDependencies as they can easily lead to duplicate installs or version conflicts
|
|
139
|
+
// in the node_modules folder of an application
|
|
140
|
+
const allowedList = pkg.allowedNonPeerDependencies.map((value) => new RegExp(value));
|
|
141
|
+
try {
|
|
142
|
+
checkNonPeerDependencies(packageJson, 'dependencies', allowedList);
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
yield fs_1.rimraf(entryPoint.destinationPath);
|
|
146
|
+
throw e;
|
|
147
|
+
}
|
|
148
|
+
// Removes scripts from package.json after build
|
|
149
|
+
if (packageJson.scripts) {
|
|
150
|
+
if (pkg.keepLifecycleScripts !== true) {
|
|
151
|
+
devkit_1.logger.info(`Removing scripts section in package.json as it's considered a potential security vulnerability.`);
|
|
152
|
+
delete packageJson.scripts;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
devkit_1.logger.warn(`You enabled keepLifecycleScripts explicitly. The scripts section in package.json will be published to npm.`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (isIvy && !entryPoint.isSecondaryEntryPoint) {
|
|
159
|
+
const scripts = packageJson.scripts || (packageJson.scripts = {});
|
|
160
|
+
scripts.prepublishOnly =
|
|
161
|
+
'node --eval "console.error(\'' +
|
|
162
|
+
'ERROR: Trying to publish a package that has been compiled by Ivy. This is not allowed.\\n' +
|
|
163
|
+
'Please delete and rebuild the package, without compiling with Ivy, before attempting to publish.\\n' +
|
|
164
|
+
'\')" ' +
|
|
165
|
+
'&& exit 1';
|
|
166
|
+
}
|
|
167
|
+
// keep the dist package.json clean
|
|
168
|
+
// this will not throw if ngPackage field does not exist
|
|
169
|
+
delete packageJson.ngPackage;
|
|
170
|
+
const packageJsonPropertiesToDelete = [
|
|
171
|
+
'stylelint',
|
|
172
|
+
'prettier',
|
|
173
|
+
'browserslist',
|
|
174
|
+
'devDependencies',
|
|
175
|
+
'jest',
|
|
176
|
+
'workspaces',
|
|
177
|
+
'husky',
|
|
178
|
+
];
|
|
179
|
+
for (const prop of packageJsonPropertiesToDelete) {
|
|
180
|
+
if (prop in packageJson) {
|
|
181
|
+
delete packageJson[prop];
|
|
182
|
+
devkit_1.logger.info(`Removing ${prop} section in package.json.`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
packageJson.name = entryPoint.moduleId;
|
|
186
|
+
yield fs_1.writeFile(path.join(entryPoint.destinationPath, 'package.json'), JSON.stringify(packageJson, undefined, 2));
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function checkNonPeerDependencies(packageJson, property, allowed) {
|
|
190
|
+
if (!packageJson[property]) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
for (const dep of Object.keys(packageJson[property])) {
|
|
194
|
+
if (!allowed.some((regex) => regex.test(dep))) {
|
|
195
|
+
devkit_1.logger.warn(`Distributing npm packages with '${property}' is not recommended. Please consider adding ${dep} to 'peerDependencies' or remove it from '${property}'.`);
|
|
196
|
+
throw new Error(`Dependency ${dep} must be explicitly allowed using the "allowedNonPeerDependencies" option.`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=write-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-package.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-package.ts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,CACT,mCAAmC,QAAQ,gDAAgD,GAAG,6CAA6C,QAAQ,IAAI,CACxJ,CAAC;YACF,MAAM,IAAI,KAAK,CACb,cAAc,GAAG,4EAA4E,CAC9F,CAAC;SACH;KACF;AACH,CAAC"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.angularEslintVersion = exports.jestPresetAngularVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularJsVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
|
-
exports.nxVersion = '12.
|
|
4
|
+
exports.nxVersion = '12.2.0';
|
|
5
5
|
exports.angularVersion = '^11.2.0';
|
|
6
6
|
exports.angularDevkitVersion = '~0.1102.0';
|
|
7
7
|
exports.angularJsVersion = '1.7.9';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from original ng-packagr
|
|
3
|
-
*
|
|
4
|
-
* Exclude the UMD bundling and minification
|
|
5
|
-
* which is not needed for incremental compilation
|
|
6
|
-
*/
|
|
7
|
-
import { InjectionToken } from 'injection-js';
|
|
8
|
-
import { Transform } from 'ng-packagr/lib/graph/transform';
|
|
9
|
-
import { TransformProvider } from 'ng-packagr/lib/graph/transform.di';
|
|
10
|
-
export declare const nxWriteBundlesTransform: Transform;
|
|
11
|
-
export declare const NX_WRITE_BUNDLES_TRANSFORM_TOKEN: InjectionToken<Transform>;
|
|
12
|
-
export declare const NX_WRITE_BUNDLES_TRANSFORM: TransformProvider;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Adapted from original ng-packagr
|
|
4
|
-
*
|
|
5
|
-
* Exclude the UMD bundling and minification
|
|
6
|
-
* which is not needed for incremental compilation
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.NX_WRITE_BUNDLES_TRANSFORM = exports.NX_WRITE_BUNDLES_TRANSFORM_TOKEN = exports.nxWriteBundlesTransform = void 0;
|
|
10
|
-
const tslib_1 = require("tslib");
|
|
11
|
-
const injection_js_1 = require("injection-js");
|
|
12
|
-
const transform_1 = require("ng-packagr/lib/graph/transform");
|
|
13
|
-
const transform_di_1 = require("ng-packagr/lib/graph/transform.di");
|
|
14
|
-
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
|
15
|
-
const rollup_1 = require("ng-packagr/lib/flatten/rollup");
|
|
16
|
-
const log = require("ng-packagr/lib/utils/log");
|
|
17
|
-
const array_1 = require("ng-packagr/lib/utils/array");
|
|
18
|
-
exports.nxWriteBundlesTransform = transform_1.transformFromPromise((graph) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const entryPoint = graph.find(nodes_1.isEntryPointInProgress());
|
|
20
|
-
const { destinationFiles, entryPoint: ngEntryPoint, tsConfig, } = entryPoint.data;
|
|
21
|
-
const cache = entryPoint.cache;
|
|
22
|
-
// Add UMD module IDs for dependencies
|
|
23
|
-
const dependencyUmdIds = entryPoint
|
|
24
|
-
.filter(nodes_1.isEntryPoint)
|
|
25
|
-
.map((ep) => ep.data.entryPoint)
|
|
26
|
-
.reduce((prev, ep) => {
|
|
27
|
-
prev[ep.moduleId] = ep.umdId;
|
|
28
|
-
return prev;
|
|
29
|
-
}, {});
|
|
30
|
-
const { fesm2015, esm2015 } = destinationFiles;
|
|
31
|
-
const opts = {
|
|
32
|
-
sourceRoot: tsConfig.options.sourceRoot,
|
|
33
|
-
amd: { id: ngEntryPoint.amdId },
|
|
34
|
-
umdModuleIds: Object.assign(Object.assign({}, ngEntryPoint.umdModuleIds), dependencyUmdIds),
|
|
35
|
-
entry: esm2015,
|
|
36
|
-
dependencyList: getDependencyListForGraph(graph),
|
|
37
|
-
};
|
|
38
|
-
log.info('Bundling to FESM2015');
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
cache.rollupFESMCache = yield rollup_1.rollupBundleFile(Object.assign(Object.assign({}, opts), { moduleName: ngEntryPoint.moduleId, format: 'es', dest: fesm2015,
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
cache: cache.rollupFESMCache }));
|
|
43
|
-
}));
|
|
44
|
-
/** Get all list of dependencies for the entire 'BuildGraph' */
|
|
45
|
-
function getDependencyListForGraph(graph) {
|
|
46
|
-
// We need to do this because if A dependency on bundled B
|
|
47
|
-
// And A has a secondary entry point A/1 we want only to bundle B if it's used.
|
|
48
|
-
// Also if A/1 depends on A we don't want to bundle A thus we mark this a dependency.
|
|
49
|
-
const dependencyList = {
|
|
50
|
-
dependencies: [],
|
|
51
|
-
bundledDependencies: [],
|
|
52
|
-
};
|
|
53
|
-
for (const entry of graph.filter(nodes_1.isEntryPoint)) {
|
|
54
|
-
const { bundledDependencies = [], dependencies = {}, peerDependencies = {}, } = entry.data.entryPoint.packageJson;
|
|
55
|
-
dependencyList.bundledDependencies = array_1.unique(dependencyList.bundledDependencies.concat(bundledDependencies));
|
|
56
|
-
dependencyList.dependencies = array_1.unique(dependencyList.dependencies.concat(Object.keys(dependencies), Object.keys(peerDependencies), entry.data.entryPoint.moduleId));
|
|
57
|
-
}
|
|
58
|
-
if (dependencyList.bundledDependencies.length) {
|
|
59
|
-
log.warn(`Inlining of 'bundledDependencies' has been deprecated in version 5 and will be removed in future versions.` +
|
|
60
|
-
'\n' +
|
|
61
|
-
`List the dependency in the 'peerDependencies' section instead.`);
|
|
62
|
-
}
|
|
63
|
-
return dependencyList;
|
|
64
|
-
}
|
|
65
|
-
exports.NX_WRITE_BUNDLES_TRANSFORM_TOKEN = new injection_js_1.InjectionToken(`nx.v1.writeBundlesTransform`);
|
|
66
|
-
exports.NX_WRITE_BUNDLES_TRANSFORM = transform_di_1.provideTransform({
|
|
67
|
-
provide: exports.NX_WRITE_BUNDLES_TRANSFORM_TOKEN,
|
|
68
|
-
useFactory: () => exports.nxWriteBundlesTransform,
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=write-bundles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-bundles.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/ng-packagr-lite/ng-packagr-adjustments/write-bundles.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,+CAA8C;AAC9C,8DAGwC;AACxC,oEAG2C;AAC3C,2DAIyC;AAEzC,0DAAiE;AACjE,gDAAgD;AAGhD,sDAAoD;AAEvC,QAAA,uBAAuB,GAAc,gCAAoB,CACpE,CAAO,KAAK,EAAE,EAAE;IACd,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,8BAAsB,EAAE,CAAmB,CAAC;IAC1E,MAAM,EACJ,gBAAgB,EAChB,UAAU,EAAE,YAAY,EACxB,QAAQ,GACT,GAAG,UAAU,CAAC,IAAI,CAAC;IACpB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAE/B,sCAAsC;IACtC,MAAM,gBAAgB,GAAG,UAAU;SAChC,MAAM,CAAC,oBAAY,CAAC;SACpB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC;SAC/B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAgB,EAAE,EAAE;QACjC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;QAE7B,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,EAAE,CAAC,CAAC;IAET,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC;IAE/C,MAAM,IAAI,GAAG;QACX,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU;QACvC,GAAG,EAAE,EAAE,EAAE,EAAE,YAAY,CAAC,KAAK,EAAE;QAC/B,YAAY,kCACP,YAAY,CAAC,YAAY,GACzB,gBAAgB,CACpB;QACD,KAAK,EA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