ng-packagr 11.0.0 → 11.1.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/CHANGELOG.md +44 -0
- package/lib/commands/build.command.js +2 -1
- package/lib/commands/build.command.js.map +1 -1
- package/lib/commands/version.command.js +2 -1
- package/lib/commands/version.command.js.map +1 -1
- package/lib/flatten/uglify.js +4 -4
- package/lib/flatten/uglify.js.map +1 -1
- package/lib/flatten/umd-module-id-strategy.js +2 -1
- package/lib/flatten/umd-module-id-strategy.js.map +1 -1
- package/lib/graph/transform.js +2 -1
- package/lib/graph/transform.js.map +1 -1
- package/lib/ng-package/discover-packages.js +4 -3
- package/lib/ng-package/discover-packages.js.map +1 -1
- package/lib/ng-package/entry-point/compile-ngc.di.d.ts +2 -1
- package/lib/ng-package/entry-point/compile-ngc.di.js +5 -2
- package/lib/ng-package/entry-point/compile-ngc.di.js.map +1 -1
- package/lib/ng-package/entry-point/compile-ngc.transform.d.ts +2 -1
- package/lib/ng-package/entry-point/compile-ngc.transform.js +40 -31
- package/lib/ng-package/entry-point/compile-ngc.transform.js.map +1 -1
- package/lib/ng-package/entry-point/entry-point.di.js +1 -1
- package/lib/ng-package/entry-point/entry-point.di.js.map +1 -1
- package/lib/ng-package/entry-point/entry-point.transform.js +2 -1
- package/lib/ng-package/entry-point/entry-point.transform.js.map +1 -1
- package/lib/ng-package/entry-point/init-tsconfig.di.js +2 -1
- package/lib/ng-package/entry-point/init-tsconfig.di.js.map +1 -1
- package/lib/ng-package/entry-point/init-tsconfig.transform.js +2 -1
- package/lib/ng-package/entry-point/init-tsconfig.transform.js.map +1 -1
- package/lib/ng-package/entry-point/write-bundles.transform.js +4 -1
- package/lib/ng-package/entry-point/write-bundles.transform.js.map +1 -1
- package/lib/ng-package/entry-point/write-package.transform.js +38 -16
- package/lib/ng-package/entry-point/write-package.transform.js.map +1 -1
- package/lib/ng-package/options.di.js +2 -1
- package/lib/ng-package/options.di.js.map +1 -1
- package/lib/ng-package/package.transform.js +28 -14
- package/lib/ng-package/package.transform.js.map +1 -1
- package/lib/ng-package/schema.js +8 -9
- package/lib/ng-package/schema.js.map +1 -1
- package/lib/ngc/compile-source-files.js +5 -2
- package/lib/ngc/compile-source-files.js.map +1 -1
- package/lib/ngc/ngcc-processor.d.ts +5 -0
- package/lib/ngc/ngcc-processor.js +121 -5
- package/lib/ngc/ngcc-processor.js.map +1 -1
- package/lib/packagr.js +2 -1
- package/lib/packagr.js.map +1 -1
- package/lib/project.di.js +2 -1
- package/lib/project.di.js.map +1 -1
- package/lib/styles/stylesheet-processor.di.d.ts +4 -0
- package/lib/styles/stylesheet-processor.di.js +12 -0
- package/lib/styles/stylesheet-processor.di.js.map +1 -0
- package/lib/ts/tsconfig.js +3 -1
- package/lib/ts/tsconfig.js.map +1 -1
- package/lib/utils/fs.d.ts +10 -0
- package/lib/utils/fs.js +46 -0
- package/lib/utils/fs.js.map +1 -0
- package/lib/utils/glob.js +3 -3
- package/lib/utils/glob.js.map +1 -1
- package/lib/utils/log.js +12 -6
- package/lib/utils/log.js.map +1 -1
- package/lib/utils/path.js +16 -13
- package/lib/utils/path.js.map +1 -1
- package/ng-package.schema.json +1 -1
- package/package.json +26 -21
- package/lib/utils/promisify.d.ts +0 -2
- package/lib/utils/promisify.js +0 -17
- package/lib/utils/promisify.js.map +0 -1
- package/lib/utils/rimraf.d.ts +0 -1
- package/lib/utils/rimraf.js +0 -18
- package/lib/utils/rimraf.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [11.1.0](https://github.com/ng-packagr/ng-packagr/compare/v11.0.3...v11.1.0) (2021-01-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add NGCC async integration ([232fb21](https://github.com/ng-packagr/ng-packagr/commit/232fb213d572294c5ea94280bd43e432e6d0995c))
|
|
11
|
+
* add stylesheet processor DI ([dedb3b3](https://github.com/ng-packagr/ng-packagr/commit/dedb3b3de41c16e85fde6e39626a858bb6d473c1))
|
|
12
|
+
* add support for using TypeScript 4.1 ([ffe3ab9](https://github.com/ng-packagr/ng-packagr/commit/ffe3ab935f83155cb7f5d0822902573ce96cdbe5))
|
|
13
|
+
* clarify argument type of compileNgcTransformFactory ([643d3d5](https://github.com/ng-packagr/ng-packagr/commit/643d3d51d60e096d67e77a2141269a05df993eef))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* add tsickle as optional peer dependency ([52f3988](https://github.com/ng-packagr/ng-packagr/commit/52f398887abb91db3901088a9f76e3911e88e5c6)), closes [#1801](https://github.com/ng-packagr/ng-packagr/issues/1801)
|
|
19
|
+
* changed assets not being copied during watch mode ([8d6664e](https://github.com/ng-packagr/ng-packagr/commit/8d6664e782bab40bfadd555dcdd9ef011b0104d6)), closes [#1826](https://github.com/ng-packagr/ng-packagr/issues/1826)
|
|
20
|
+
* set sourceRoot to empty string to correctly resolve dts sources ([94dd2d8](https://github.com/ng-packagr/ng-packagr/commit/94dd2d8881bc06696fbe8e6b67f9f8a8e761fa96))
|
|
21
|
+
* termination of process when using CTRL+C ([8f6c46e](https://github.com/ng-packagr/ng-packagr/commit/8f6c46ef4a8d418c37778b687f8f6bbb2d73f876))
|
|
22
|
+
* update @rollup/plugin-commonjs to version ^17.0.0 ([b79622a](https://github.com/ng-packagr/ng-packagr/commit/b79622ab105bbbd41494369fed38159ad4783885))
|
|
23
|
+
* update @rollup/plugin-node-resolve to version ^11.0.0 ([f45658a](https://github.com/ng-packagr/ng-packagr/commit/f45658a4aeb03316094803b923f6d2cf6965aee7))
|
|
24
|
+
* update commander to version ^7.0.0 ([289b019](https://github.com/ng-packagr/ng-packagr/commit/289b019992cb9f3fb1c0c70aedd82e3b04e70ea5))
|
|
25
|
+
* update less to version ^4.0.0 ([db8a459](https://github.com/ng-packagr/ng-packagr/commit/db8a45956555ff96a0a7fc087b8c806d0a2ab93d))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Performance
|
|
29
|
+
|
|
30
|
+
* only use ensureUnixPath when OS is Windows ([d4ed2b4](https://github.com/ng-packagr/ng-packagr/commit/d4ed2b44d3a7e3264e50c9e6786bb6b0c8197b39))
|
|
31
|
+
|
|
32
|
+
### [11.0.3](https://github.com/ng-packagr/ng-packagr/compare/v11.0.2...v11.0.3) (2020-11-21)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* correctly resolve sourceRoot ([6673dbc](https://github.com/ng-packagr/ng-packagr/commit/6673dbcc7903ba766f44c44d6fb39967ef0f002e))
|
|
38
|
+
|
|
39
|
+
### [11.0.2](https://github.com/ng-packagr/ng-packagr/compare/v11.0.1...v11.0.2) (2020-11-12)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* sourcemap should not differ based on build path ([1504c8e](https://github.com/ng-packagr/ng-packagr/commit/1504c8e06a64aee5b3ecc09327af25de5bd58385))
|
|
45
|
+
* Revert "fix: update @rollup/plugin-commonjs to version ^16.0.0"
|
|
46
|
+
|
|
47
|
+
### [11.0.1](https://github.com/ng-packagr/ng-packagr/compare/v11.0.0...v11.0.1) (2020-11-11)
|
|
48
|
+
|
|
5
49
|
## [11.0.0](https://github.com/ng-packagr/ng-packagr/compare/v11.0.0-rc.0...v11.0.0) (2020-11-11)
|
|
6
50
|
|
|
7
51
|
|
|
@@ -7,9 +7,10 @@ const packagr_1 = require("../packagr");
|
|
|
7
7
|
*
|
|
8
8
|
* @stable
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const build = opts => packagr_1.ngPackagr()
|
|
11
11
|
.forProject(opts.project)
|
|
12
12
|
.withOptions({ watch: opts.watch })
|
|
13
13
|
.withTsConfig(opts.config)
|
|
14
14
|
.build();
|
|
15
|
+
exports.build = build;
|
|
15
16
|
//# sourceMappingURL=build.command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.command.js","sourceRoot":"","sources":["../../../src/lib/commands/build.command.ts"],"names":[],"mappings":";;;AACA,wCAAuC;AAgBvC;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"build.command.js","sourceRoot":"","sources":["../../../src/lib/commands/build.command.ts"],"names":[],"mappings":";;;AACA,wCAAuC;AAgBvC;;;;GAIG;AACI,MAAM,KAAK,GAAgC,IAAI,CAAC,EAAE,CACvD,mBAAS,EAAE;KACR,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;KACxB,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;KAClC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;KACzB,KAAK,EAAE,CAAC;AALA,QAAA,KAAK,SAKL","sourcesContent":["import { Command } from './command';\nimport { ngPackagr } from '../packagr';\n\n/**\n * CLI arguments passed to `ng-packagr` executable and `build()` command.\n *\n * @stable\n */\nexport interface CliArguments {\n /** Path to the project file 'package.json', 'ng-package.json', or 'ng-package.js'. */\n project: string;\n /** Whether or not ng-packagr will watch for file changes and perform an incremental build. */\n watch?: boolean;\n /** Path to a tsconfig file. */\n config?: string;\n}\n\n/**\n * Command running an \"one-off\" build.\n *\n * @stable\n */\nexport const build: Command<CliArguments, void> = opts =>\n ngPackagr()\n .forProject(opts.project)\n .withOptions({ watch: opts.watch })\n .withTsConfig(opts.config)\n .build();\n"]}
|
|
@@ -9,7 +9,7 @@ const typescript_1 = require("typescript");
|
|
|
9
9
|
*
|
|
10
10
|
* @stable
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
const version = (pkg) => {
|
|
13
13
|
let TSICKLE_VERSION = '';
|
|
14
14
|
try {
|
|
15
15
|
TSICKLE_VERSION = require('tsickle/package.json').version;
|
|
@@ -22,4 +22,5 @@ exports.version = (pkg) => {
|
|
|
22
22
|
console.log(`tsickle: ` + TSICKLE_VERSION);
|
|
23
23
|
console.log(`typescript: ` + typescript_1.version);
|
|
24
24
|
};
|
|
25
|
+
exports.version = version;
|
|
25
26
|
//# sourceMappingURL=version.command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.command.js","sourceRoot":"","sources":["../../../src/lib/commands/version.command.ts"],"names":[],"mappings":";;;AAAA,mCAAmD;AACnD,gDAAgE;AAChE,2CAAmD;AAGnD;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"version.command.js","sourceRoot":"","sources":["../../../src/lib/commands/version.command.ts"],"names":[],"mappings":";;;AAAA,mCAAmD;AACnD,gDAAgE;AAChE,2CAAmD;AAGnD;;;;GAIG;AACI,MAAM,OAAO,GAAuB,CAAC,GAAQ,EAAE,EAAE;IACtD,IAAI,eAAe,GAAG,EAAE,CAAC;IACzB,IAAI;QACF,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC;KAC3D;IAAC,WAAM,GAAE;IAEV,MAAM,kBAAkB,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAEzD,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,kBAAkB,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,gBAAc,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,eAAe,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,oBAAU,CAAC,CAAC;AACtD,CAAC,CAAC;AAbW,QAAA,OAAO,WAalB","sourcesContent":["import { VERSION as ROLLUP_VERSION } from 'rollup';\nimport { VERSION as COMPILER_VERSION } from '@angular/compiler';\nimport { version as TS_VERSION } from 'typescript';\nimport { Command } from './command';\n\n/**\n * Prints version information.\n *\n * @stable\n */\nexport const version: Command<any, void> = (pkg: any) => {\n let TSICKLE_VERSION = '';\n try {\n TSICKLE_VERSION = require('tsickle/package.json').version;\n } catch {}\n\n const NG_PACKAGR_VERSION = pkg ? pkg.version : 'unknown';\n\n console.log(`ng-packagr: ` + NG_PACKAGR_VERSION);\n console.log(`@angular/compiler: ` + COMPILER_VERSION.full);\n console.log(`rollup: ` + ROLLUP_VERSION);\n console.log(`tsickle: ` + TSICKLE_VERSION);\n console.log(`typescript: ` + TS_VERSION);\n};\n"]}
|
package/lib/flatten/uglify.js
CHANGED
|
@@ -11,16 +11,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.minifyJsFile = void 0;
|
|
13
13
|
const terser_1 = require("terser");
|
|
14
|
-
const fs_extra_1 = require("fs-extra");
|
|
15
14
|
const path_1 = require("path");
|
|
16
15
|
const log_1 = require("../utils/log");
|
|
16
|
+
const fs_1 = require("../utils/fs");
|
|
17
17
|
function minifyJsFile(inputPath, outputPath) {
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
log_1.debug(`minifyJsFile: ${inputPath}`);
|
|
20
20
|
const sourcemapOut = `${outputPath}.map`;
|
|
21
21
|
const [inputFileBuffer, inputSourceMapBuffer] = yield Promise.all([
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
fs_1.readFile(inputPath),
|
|
23
|
+
fs_1.readFile(`${inputPath}.map`),
|
|
24
24
|
]);
|
|
25
25
|
const result = yield terser_1.minify(inputFileBuffer.toString(), {
|
|
26
26
|
sourceMap: {
|
|
@@ -36,7 +36,7 @@ function minifyJsFile(inputPath, outputPath) {
|
|
|
36
36
|
comments: 'some',
|
|
37
37
|
},
|
|
38
38
|
});
|
|
39
|
-
yield Promise.all([
|
|
39
|
+
yield Promise.all([fs_1.writeFile(outputPath, result.code), fs_1.writeFile(sourcemapOut, result.map)]);
|
|
40
40
|
return;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uglify.js","sourceRoot":"","sources":["../../../src/lib/flatten/uglify.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAgC;AAChC
|
|
1
|
+
{"version":3,"file":"uglify.js","sourceRoot":"","sources":["../../../src/lib/flatten/uglify.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAgC;AAChC,+BAAgC;AAChC,sCAAqC;AACrC,oCAAkD;AAElD,SAAsB,YAAY,CAAC,SAAiB,EAAE,UAAmB;;QACvE,WAAK,CAAC,iBAAiB,SAAS,EAAE,CAAC,CAAC;QAEpC,MAAM,YAAY,GAAG,GAAG,UAAU,MAAM,CAAC;QACzC,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC,GAAa,MAAM,OAAO,CAAC,GAAG,CAAC;YAC1E,aAAQ,CAAC,SAAS,CAAC;YACnB,aAAQ,CAAC,GAAG,SAAS,MAAM,CAAC;SAC7B,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,eAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE;YACtD,SAAS,EAAE;gBACT,cAAc,EAAE,IAAI;gBACpB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC;gBACpD,GAAG,EAAE,eAAQ,CAAC,YAAY,CAAC;aAC5B;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC;gBACP,YAAY,EAAE,IAAI;aACnB;YACD,MAAM,EAAE;gBACN,QAAQ,EAAE,MAAM;aACjB;SACF,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,cAAS,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,cAAS,CAAC,YAAY,EAAE,MAAM,CAAC,GAAa,CAAC,CAAC,CAAC,CAAC;QAEvG,OAAO;IACT,CAAC;CAAA;AA3BD,oCA2BC","sourcesContent":["import { minify } from 'terser';\nimport { basename } from 'path';\nimport { debug } from '../utils/log';\nimport { readFile, writeFile } from '../utils/fs';\n\nexport async function minifyJsFile(inputPath: string, outputPath?: string): Promise<void> {\n debug(`minifyJsFile: ${inputPath}`);\n\n const sourcemapOut = `${outputPath}.map`;\n const [inputFileBuffer, inputSourceMapBuffer]: Buffer[] = await Promise.all([\n readFile(inputPath),\n readFile(`${inputPath}.map`),\n ]);\n\n const result = await minify(inputFileBuffer.toString(), {\n sourceMap: {\n includeSources: true,\n content: JSON.parse(inputSourceMapBuffer.toString()),\n url: basename(sourcemapOut),\n },\n parse: {\n ecma: 5,\n bare_returns: true,\n },\n format: {\n comments: 'some',\n },\n });\n\n await Promise.all([writeFile(outputPath, result.code), writeFile(sourcemapOut, result.map as string)]);\n\n return;\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.umdModuleIdStrategy = void 0;
|
|
4
4
|
const strings_1 = require("../utils/strings");
|
|
5
|
-
|
|
5
|
+
const umdModuleIdStrategy = (moduleId, umdModuleIds = {}) => {
|
|
6
6
|
let nameProvided;
|
|
7
7
|
if ((nameProvided = umdModuleIds[moduleId])) {
|
|
8
8
|
return nameProvided;
|
|
@@ -25,4 +25,5 @@ exports.umdModuleIdStrategy = (moduleId, umdModuleIds = {}) => {
|
|
|
25
25
|
}
|
|
26
26
|
return ''; // leave it up to rollup to guess the global name
|
|
27
27
|
};
|
|
28
|
+
exports.umdModuleIdStrategy = umdModuleIdStrategy;
|
|
28
29
|
//# sourceMappingURL=umd-module-id-strategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"umd-module-id-strategy.js","sourceRoot":"","sources":["../../../src/lib/flatten/umd-module-id-strategy.ts"],"names":[],"mappings":";;;AAAA,8CAA4C;
|
|
1
|
+
{"version":3,"file":"umd-module-id-strategy.js","sourceRoot":"","sources":["../../../src/lib/flatten/umd-module-id-strategy.ts"],"names":[],"mappings":";;;AAAA,8CAA4C;AAErC,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAE,eAA0C,EAAE,EAAU,EAAE;IAC5G,IAAI,YAAgC,CAAC;IACrC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE;QAC3C,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,QAAQ,CAAC;IACb,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;QAClD,OAAO,MAAM,QAAQ,CAAC,CAAC,CAAC;aACrB,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,kBAAQ,CAAC;aACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;KAChB;IAED,IAAI,QAAQ,KAAK,MAAM,EAAE;QACvB,OAAO,MAAM,CAAC;KACf;IAED,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;QAChD,OAAO,QAAQ,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9B;IAED,IAAI,QAAQ,KAAK,OAAO,EAAE;QACxB,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,EAAE,CAAC,CAAC,iDAAiD;AAC9D,CAAC,CAAC;AA3BW,QAAA,mBAAmB,uBA2B9B","sourcesContent":["import { camelize } from '../utils/strings';\n\nexport const umdModuleIdStrategy = (moduleId: string, umdModuleIds: { [key: string]: string } = {}): string => {\n let nameProvided: string | undefined;\n if ((nameProvided = umdModuleIds[moduleId])) {\n return nameProvided;\n }\n\n let regMatch;\n if ((regMatch = /^\\@angular\\/(.+)/.exec(moduleId))) {\n return `ng.${regMatch[1]\n .split('/')\n .map(camelize)\n .join('.')}`;\n }\n\n if (moduleId === 'rxjs') {\n return 'rxjs';\n }\n\n if ((regMatch = /^rxjs\\/(\\/?.*)/.exec(moduleId))) {\n return `rxjs.${regMatch[1]}`;\n }\n\n if (moduleId === 'tslib') {\n return 'tslib';\n }\n\n return ''; // leave it up to rollup to guess the global name\n};\n"]}
|
package/lib/graph/transform.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.transformFromPromise = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
|
|
6
|
+
const transformFromPromise = (transformFn) => rxjs_1.pipe(operators_1.switchMap(graph => {
|
|
7
7
|
const transformResult = transformFn(graph);
|
|
8
8
|
if (transformResult instanceof Promise) {
|
|
9
9
|
return rxjs_1.from(transformResult).pipe(operators_1.map(result => (result ? result : graph)));
|
|
@@ -12,4 +12,5 @@ exports.transformFromPromise = (transformFn) => rxjs_1.pipe(operators_1.switchMa
|
|
|
12
12
|
return rxjs_1.of(transformResult ? transformResult : graph);
|
|
13
13
|
}
|
|
14
14
|
}));
|
|
15
|
+
exports.transformFromPromise = transformFromPromise;
|
|
15
16
|
//# sourceMappingURL=transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/lib/graph/transform.ts"],"names":[],"mappings":";;;AAAA,+BAA2G;AAC3G,8CAAgD;
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/lib/graph/transform.ts"],"names":[],"mappings":";;;AAAA,+BAA2G;AAC3G,8CAAgD;AAqBzC,MAAM,oBAAoB,GAAG,CAAC,WAAkC,EAAa,EAAE,CACpF,WAAI,CACF,qBAAS,CAAC,KAAK,CAAC,EAAE;IAChB,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAE3C,IAAI,eAAe,YAAY,OAAO,EAAE;QACtC,OAAO,WAAW,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,eAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpF;SAAM;QACL,OAAO,SAAY,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;KAChE;AACH,CAAC,CAAC,CACH,CAAC;AAXS,QAAA,oBAAoB,wBAW7B","sourcesContent":["import { MonoTypeOperatorFunction, Observable, from as fromPromise, of as observableOf, pipe } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { BuildGraph } from './build-graph';\n\n/**\n * A transformation applied over the build graph.\n *\n * By design, a pipeable operator over `BuildGraph`.\n * - A transformation takes a `BuildGraph` as input (from previous transformations).\n * - A transformation performs some operations based on the graph's data, potentially modifying nodes in the graph.\n * - It returns a `BuildGraph` that will be passed to subsequent transformations.\n *\n * @link https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md#pipeable-operators\n */\nexport interface Transform extends MonoTypeOperatorFunction<BuildGraph> {\n (source$: Observable<BuildGraph>): Observable<BuildGraph>;\n}\n\nexport interface PromiseBasedTransform {\n (graph: BuildGraph): Promise<BuildGraph | void> | BuildGraph | void;\n}\n\nexport const transformFromPromise = (transformFn: PromiseBasedTransform): Transform =>\n pipe(\n switchMap(graph => {\n const transformResult = transformFn(graph);\n\n if (transformResult instanceof Promise) {\n return fromPromise(transformResult).pipe(map(result => (result ? result : graph)));\n } else {\n return observableOf(transformResult ? transformResult : graph);\n }\n }),\n );\n"]}
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.discoverPackages = void 0;
|
|
13
|
-
const fs_extra_1 = require("fs-extra");
|
|
14
13
|
const path = require("path");
|
|
15
14
|
const log = require("../utils/log");
|
|
16
15
|
const path_1 = require("../utils/path");
|
|
@@ -18,6 +17,7 @@ const entry_point_1 = require("./entry-point/entry-point");
|
|
|
18
17
|
const package_1 = require("./package");
|
|
19
18
|
const glob_1 = require("../utils/glob");
|
|
20
19
|
const schema_1 = require("./schema");
|
|
20
|
+
const fs_1 = require("../utils/fs");
|
|
21
21
|
/**
|
|
22
22
|
* Resolves a user's package by testing for 'package.json', 'ng-package.json', or 'ng-package.js'.
|
|
23
23
|
*
|
|
@@ -27,9 +27,9 @@ const schema_1 = require("./schema");
|
|
|
27
27
|
*/
|
|
28
28
|
function resolveUserPackage(folderPathOrFilePath, isSecondary = false) {
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const readConfigFile = (filePath) => __awaiter(this, void 0, void 0, function* () { return (
|
|
30
|
+
const readConfigFile = (filePath) => __awaiter(this, void 0, void 0, function* () { return ((yield fs_1.exists(filePath)) ? Promise.resolve().then(() => require(filePath)) : undefined); });
|
|
31
31
|
const fullPath = path.resolve(folderPathOrFilePath);
|
|
32
|
-
const pathStats = yield
|
|
32
|
+
const pathStats = yield fs_1.stat(fullPath);
|
|
33
33
|
const basePath = pathStats.isDirectory() ? fullPath : path.dirname(fullPath);
|
|
34
34
|
const packageJson = yield readConfigFile(path.join(basePath, 'package.json'));
|
|
35
35
|
if (!packageJson && !isSecondary) {
|
|
@@ -92,6 +92,7 @@ function findSecondaryPackagesPaths(directoryPath, excludeFolder) {
|
|
|
92
92
|
];
|
|
93
93
|
const filePaths = yield glob_1.globFiles(`${directoryPath}/**/{package,ng-package}.json`, {
|
|
94
94
|
ignore,
|
|
95
|
+
nodir: true,
|
|
95
96
|
cwd: directoryPath,
|
|
96
97
|
});
|
|
97
98
|
return filePaths.map(path.dirname);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover-packages.js","sourceRoot":"","sources":["../../../src/lib/ng-package/discover-packages.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"discover-packages.js","sourceRoot":"","sources":["../../../src/lib/ng-package/discover-packages.ts"],"names":[],"mappings":"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","sourcesContent":["import * as path from 'path';\nimport * as log from '../utils/log';\nimport { ensureUnixPath } from '../utils/path';\nimport { NgEntryPoint } from './entry-point/entry-point';\nimport { NgPackage } from './package';\nimport { globFiles } from '../utils/glob';\nimport { validateNgPackageSchema } from './schema';\nimport { exists, stat } from '../utils/fs';\n\ninterface UserPackage {\n /** Values from the `package.json` file of this user package. */\n packageJson: Record<string, any>;\n /** NgPackageConfig for this user package. */\n ngPackageJson: Record<string, any>;\n /** Absolute directory path of this user package. */\n basePath: string;\n}\n\n/**\n * Resolves a user's package by testing for 'package.json', 'ng-package.json', or 'ng-package.js'.\n *\n * @param folderPathOrFilePath A path pointing either to a file or a directory\n * @param isSecondary A boolean determining if this is a secondary package\n * @return The user's package\n */\nasync function resolveUserPackage(folderPathOrFilePath: string, isSecondary = false): Promise<UserPackage | undefined> {\n const readConfigFile = async (filePath: string) => ((await exists(filePath)) ? import(filePath) : undefined);\n const fullPath = path.resolve(folderPathOrFilePath);\n const pathStats = await stat(fullPath);\n const basePath = pathStats.isDirectory() ? fullPath : path.dirname(fullPath);\n const packageJson: unknown = await readConfigFile(path.join(basePath, 'package.json'));\n\n if (!packageJson && !isSecondary) {\n throw new Error(`Cannot discover package sources at ${folderPathOrFilePath} as 'package.json' was not found.`);\n }\n\n if (packageJson && typeof packageJson !== 'object') {\n throw new Error(`Invalid 'package.json' at ${folderPathOrFilePath}.`);\n }\n\n let ngPackageJson: unknown;\n if (packageJson && packageJson['ngPackage']) {\n // Read `ngPackage` from `package.json`\n ngPackageJson = { ...packageJson['ngPackage'] };\n } else if (pathStats.isDirectory()) {\n ngPackageJson = await readConfigFile(path.join(basePath, 'ng-package.json'));\n if (!ngPackageJson) {\n ngPackageJson = await readConfigFile(path.join(basePath, 'ng-package.js'));\n }\n } else {\n ngPackageJson = await readConfigFile(fullPath);\n }\n\n if (ngPackageJson) {\n validateNgPackageSchema(ngPackageJson);\n\n return {\n basePath,\n packageJson: packageJson || {},\n ngPackageJson,\n };\n }\n\n if (pathStats.isDirectory()) {\n // return even if it's undefined and use defaults when it's not a file\n return undefined;\n }\n\n if (pathStats.isFile()) {\n // a project file was specified but was in valid\n if (path.basename(folderPathOrFilePath) === 'package.json') {\n throw new Error(`Cannot read a package from 'package.json' without 'ngPackage' property.`);\n }\n\n throw new Error(`Trying to read a package from unsupported file extension. Path: ${folderPathOrFilePath}`);\n }\n\n throw new Error(`Cannot discover package sources at ${folderPathOrFilePath}`);\n}\n\n/**\n * Scans `directoryPath` and sub-folders, looking for `package.json` files.\n * Similar to `find ${directoryPath} --name package.json --exec dirname {}`.\n *\n * @param directoryPath Path pointing to a directory\n * @param excludeFolder A sub-folder of `directoryPath` that is excluded from search results.\n */\nasync function findSecondaryPackagesPaths(directoryPath: string, excludeFolder: string): Promise<string[]> {\n const ignore = [\n '**/node_modules/**',\n '**/.git/**',\n `${path.resolve(directoryPath, excludeFolder)}/**`,\n `${directoryPath}/package.json`,\n `${directoryPath}/ng-package.json`,\n ];\n\n const filePaths = await globFiles(`${directoryPath}/**/{package,ng-package}.json`, {\n ignore,\n nodir: true,\n cwd: directoryPath,\n });\n\n return filePaths.map(path.dirname);\n}\n\n/**\n * Reads a secondary entry point from it's package file.\n *\n * @param primary The primary entry point.\n * @param userPackage The user package for the secondary entry point.\n */\nfunction secondaryEntryPoint(primary: NgEntryPoint, userPackage: UserPackage): NgEntryPoint {\n const { packageJson, ngPackageJson, basePath } = userPackage;\n if (path.resolve(basePath) === path.resolve(primary.basePath)) {\n log.error(`Cannot read secondary entry point. It's already a primary entry point. Path: ${basePath}`);\n throw new Error(`Secondary entry point is already a primary.`);\n }\n\n const relativeSourcePath = path.relative(primary.basePath, basePath);\n const secondaryModuleId = ensureUnixPath(`${primary.moduleId}/${relativeSourcePath}`);\n\n return new NgEntryPoint(packageJson, ngPackageJson, basePath, {\n moduleId: secondaryModuleId,\n primaryDestinationPath: primary.destinationPath,\n destinationPath: path.join(primary.destinationPath, relativeSourcePath),\n });\n}\n\nexport async function discoverPackages({ project }: { project: string }): Promise<NgPackage> {\n project = path.isAbsolute(project) ? project : path.resolve(project);\n\n const { packageJson, ngPackageJson, basePath } = await resolveUserPackage(project);\n const primary = new NgEntryPoint(packageJson, ngPackageJson, basePath);\n log.debug(`Found primary entry point: ${primary.moduleId}`);\n\n const folderPaths = await findSecondaryPackagesPaths(basePath, primary.$get('dest'));\n const secondaries: NgEntryPoint[] = [];\n\n for (const folderPath of folderPaths) {\n const secondaryPackage = await resolveUserPackage(folderPath, true);\n if (secondaryPackage) {\n secondaries.push(secondaryEntryPoint(primary, secondaryPackage));\n }\n }\n\n if (secondaries.length > 0) {\n log.debug(`Found secondary entry points: ${secondaries.map(e => e.moduleId).join(', ')}`);\n }\n\n return new NgPackage(basePath, primary, secondaries);\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { InjectionToken } from 'injection-js';
|
|
1
|
+
import { InjectionToken, Provider } from 'injection-js';
|
|
2
2
|
import { Transform } from '../../graph/transform';
|
|
3
3
|
import { TransformProvider } from '../../graph/transform.di';
|
|
4
4
|
export declare const COMPILE_NGC_TOKEN: InjectionToken<Transform>;
|
|
5
5
|
export declare const COMPILE_NGC_TRANSFORM: TransformProvider;
|
|
6
|
+
export declare const COMPILE_NGC_PROVIDERS: Provider[];
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COMPILE_NGC_TRANSFORM = exports.COMPILE_NGC_TOKEN = void 0;
|
|
3
|
+
exports.COMPILE_NGC_PROVIDERS = exports.COMPILE_NGC_TRANSFORM = exports.COMPILE_NGC_TOKEN = void 0;
|
|
4
4
|
const injection_js_1 = require("injection-js");
|
|
5
5
|
const transform_di_1 = require("../../graph/transform.di");
|
|
6
6
|
const compile_ngc_transform_1 = require("./compile-ngc.transform");
|
|
7
|
+
const stylesheet_processor_di_1 = require("../../styles/stylesheet-processor.di");
|
|
7
8
|
exports.COMPILE_NGC_TOKEN = new injection_js_1.InjectionToken(`ng.v5.compileNgcTransform`);
|
|
8
9
|
exports.COMPILE_NGC_TRANSFORM = transform_di_1.provideTransform({
|
|
9
10
|
provide: exports.COMPILE_NGC_TOKEN,
|
|
10
|
-
useFactory:
|
|
11
|
+
useFactory: compile_ngc_transform_1.compileNgcTransformFactory,
|
|
12
|
+
deps: [stylesheet_processor_di_1.STYLESHEET_PROCESSOR_TOKEN],
|
|
11
13
|
});
|
|
14
|
+
exports.COMPILE_NGC_PROVIDERS = [stylesheet_processor_di_1.STYLESHEET_PROCESSOR, exports.COMPILE_NGC_TRANSFORM];
|
|
12
15
|
//# sourceMappingURL=compile-ngc.di.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-ngc.di.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/compile-ngc.di.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"compile-ngc.di.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/compile-ngc.di.ts"],"names":[],"mappings":";;;AAAA,+CAAwD;AAExD,2DAA+E;AAC/E,mEAAqE;AACrE,kFAAwG;AAE3F,QAAA,iBAAiB,GAAG,IAAI,6BAAc,CAAY,2BAA2B,CAAC,CAAC;AAE/E,QAAA,qBAAqB,GAAsB,+BAAgB,CAAC;IACvE,OAAO,EAAE,yBAAiB;IAC1B,UAAU,EAAE,kDAA0B;IACtC,IAAI,EAAE,CAAC,oDAA0B,CAAC;CACnC,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAe,CAAC,8CAAoB,EAAE,6BAAqB,CAAC,CAAC","sourcesContent":["import { InjectionToken, Provider } from 'injection-js';\nimport { Transform } from '../../graph/transform';\nimport { TransformProvider, provideTransform } from '../../graph/transform.di';\nimport { compileNgcTransformFactory } from './compile-ngc.transform';\nimport { STYLESHEET_PROCESSOR_TOKEN, STYLESHEET_PROCESSOR } from '../../styles/stylesheet-processor.di';\n\nexport const COMPILE_NGC_TOKEN = new InjectionToken<Transform>(`ng.v5.compileNgcTransform`);\n\nexport const COMPILE_NGC_TRANSFORM: TransformProvider = provideTransform({\n provide: COMPILE_NGC_TOKEN,\n useFactory: compileNgcTransformFactory,\n deps: [STYLESHEET_PROCESSOR_TOKEN],\n});\n\nexport const COMPILE_NGC_PROVIDERS: Provider[] = [STYLESHEET_PROCESSOR, COMPILE_NGC_TRANSFORM];\n"]}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Transform } from '../../graph/transform';
|
|
2
|
-
|
|
2
|
+
import { StylesheetProcessor as StylesheetProcessorClass } from '../../styles/stylesheet-processor';
|
|
3
|
+
export declare const compileNgcTransformFactory: (StylesheetProcessor: typeof StylesheetProcessorClass) => Transform;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.compileNgcTransformFactory = void 0;
|
|
13
13
|
const path = require("path");
|
|
14
14
|
const ts = require("typescript");
|
|
15
15
|
const ora = require("ora");
|
|
@@ -18,34 +18,43 @@ const compile_source_files_1 = require("../../ngc/compile-source-files");
|
|
|
18
18
|
const ngcc_processor_1 = require("../../ngc/ngcc-processor");
|
|
19
19
|
const tsconfig_1 = require("../../ts/tsconfig");
|
|
20
20
|
const nodes_1 = require("../nodes");
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
21
|
+
const compileNgcTransformFactory = (StylesheetProcessor) => {
|
|
22
|
+
return transform_1.transformFromPromise((graph) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
const spinner = ora({
|
|
24
|
+
hideCursor: false,
|
|
25
|
+
discardStdin: false,
|
|
26
|
+
}).start(`Compiling TypeScript sources through NGC`);
|
|
27
|
+
try {
|
|
28
|
+
const entryPoint = graph.find(nodes_1.isEntryPointInProgress());
|
|
29
|
+
const entryPoints = graph.filter(nodes_1.isEntryPoint);
|
|
30
|
+
// Add paths mappings for dependencies
|
|
31
|
+
const tsConfig = tsconfig_1.setDependenciesTsConfigPaths(entryPoint.data.tsConfig, entryPoints);
|
|
32
|
+
// Compile TypeScript sources
|
|
33
|
+
const { esm2015, declarations } = entryPoint.data.destinationFiles;
|
|
34
|
+
const { moduleResolutionCache, ngccProcessingCache } = entryPoint.cache;
|
|
35
|
+
const { basePath, cssUrl, styleIncludePaths } = entryPoint.data.entryPoint;
|
|
36
|
+
const stylesheetProcessor = new StylesheetProcessor(basePath, cssUrl, styleIncludePaths);
|
|
37
|
+
const ngccProcessor = tsConfig.options.enableIvy
|
|
38
|
+
? new ngcc_processor_1.NgccProcessor(ngccProcessingCache, tsConfig.project, tsConfig.options, entryPoints)
|
|
39
|
+
: undefined;
|
|
40
|
+
if (ngccProcessor && !entryPoint.data.entryPoint.isSecondaryEntryPoint) {
|
|
41
|
+
// Only run the async version of NGCC during the primary entrypoint processing.
|
|
42
|
+
ngccProcessor.process();
|
|
43
|
+
}
|
|
44
|
+
yield compile_source_files_1.compileSourceFiles(graph, tsConfig, moduleResolutionCache, stylesheetProcessor, {
|
|
45
|
+
outDir: path.dirname(esm2015),
|
|
46
|
+
declarationDir: path.dirname(declarations),
|
|
47
|
+
declaration: true,
|
|
48
|
+
target: ts.ScriptTarget.ES2015,
|
|
49
|
+
}, ngccProcessor);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
spinner.fail();
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
spinner.succeed();
|
|
56
|
+
return graph;
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
exports.compileNgcTransformFactory = compileNgcTransformFactory;
|
|
51
60
|
//# sourceMappingURL=compile-ngc.transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-ngc.transform.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/compile-ngc.transform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA6B;AAC7B,iCAAiC;AACjC,2BAA2B;AAC3B,qDAAwE;AACxE,yEAAoE;AACpE,6DAAyD;AACzD,gDAAiE;AACjE,oCAAgF;
|
|
1
|
+
{"version":3,"file":"compile-ngc.transform.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/compile-ngc.transform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA6B;AAC7B,iCAAiC;AACjC,2BAA2B;AAC3B,qDAAwE;AACxE,yEAAoE;AACpE,6DAAyD;AACzD,gDAAiE;AACjE,oCAAgF;AAGzE,MAAM,0BAA0B,GAAG,CAAC,mBAAoD,EAAa,EAAE;IAC5G,OAAO,gCAAoB,CAAC,CAAM,KAAK,EAAC,EAAE;QACxC,MAAM,OAAO,GAAG,GAAG,CAAC;YAClB,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAErD,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,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAErF,6BAA6B;YAC7B,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACnE,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC;YACxE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC;YAC3E,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC;YAEzF,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS;gBAC9C,CAAC,CAAC,IAAI,8BAAa,CAAC,mBAAmB,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;gBACzF,CAAC,CAAC,SAAS,CAAC;YAEd,IAAI,aAAa,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE;gBACtE,+EAA+E;gBAC/E,aAAa,CAAC,OAAO,EAAE,CAAC;aACzB;YAED,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,EACD,aAAa,CACd,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,KAAK,CAAC;SACb;QAED,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC;AAjDW,QAAA,0BAA0B,8BAiDrC","sourcesContent":["import * as path from 'path';\nimport * as ts from 'typescript';\nimport * as ora from 'ora';\nimport { Transform, transformFromPromise } from '../../graph/transform';\nimport { compileSourceFiles } from '../../ngc/compile-source-files';\nimport { NgccProcessor } from '../../ngc/ngcc-processor';\nimport { setDependenciesTsConfigPaths } from '../../ts/tsconfig';\nimport { isEntryPointInProgress, EntryPointNode, isEntryPoint } from '../nodes';\nimport { StylesheetProcessor as StylesheetProcessorClass } from '../../styles/stylesheet-processor';\n\nexport const compileNgcTransformFactory = (StylesheetProcessor: typeof StylesheetProcessorClass): Transform => {\n return transformFromPromise(async graph => {\n const spinner = ora({\n hideCursor: false,\n discardStdin: false,\n }).start(`Compiling TypeScript sources through NGC`);\n\n try {\n const entryPoint: EntryPointNode = graph.find(isEntryPointInProgress());\n const entryPoints: EntryPointNode[] = graph.filter(isEntryPoint);\n // Add paths mappings for dependencies\n const tsConfig = setDependenciesTsConfigPaths(entryPoint.data.tsConfig, entryPoints);\n\n // Compile TypeScript sources\n const { esm2015, declarations } = entryPoint.data.destinationFiles;\n const { moduleResolutionCache, ngccProcessingCache } = entryPoint.cache;\n const { basePath, cssUrl, styleIncludePaths } = entryPoint.data.entryPoint;\n const stylesheetProcessor = new StylesheetProcessor(basePath, cssUrl, styleIncludePaths);\n\n const ngccProcessor = tsConfig.options.enableIvy\n ? new NgccProcessor(ngccProcessingCache, tsConfig.project, tsConfig.options, entryPoints)\n : undefined;\n\n if (ngccProcessor && !entryPoint.data.entryPoint.isSecondaryEntryPoint) {\n // Only run the async version of NGCC during the primary entrypoint processing.\n ngccProcessor.process();\n }\n\n await compileSourceFiles(\n graph,\n tsConfig,\n moduleResolutionCache,\n stylesheetProcessor,\n {\n outDir: path.dirname(esm2015),\n declarationDir: path.dirname(declarations),\n declaration: true,\n target: ts.ScriptTarget.ES2015,\n },\n ngccProcessor,\n );\n } catch (error) {\n spinner.fail();\n throw error;\n }\n\n spinner.succeed();\n return graph;\n });\n};\n"]}
|
|
@@ -15,7 +15,7 @@ exports.ENTRY_POINT_TRANSFORM = transform_di_1.provideTransform({
|
|
|
15
15
|
});
|
|
16
16
|
exports.ENTRY_POINT_PROVIDERS = [
|
|
17
17
|
exports.ENTRY_POINT_TRANSFORM,
|
|
18
|
-
compile_ngc_di_1.
|
|
18
|
+
...compile_ngc_di_1.COMPILE_NGC_PROVIDERS,
|
|
19
19
|
write_bundles_di_1.WRITE_BUNDLES_TRANSFORM,
|
|
20
20
|
write_package_di_1.WRITE_PACKAGE_TRANSFORM,
|
|
21
21
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-point.di.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/entry-point.di.ts"],"names":[],"mappings":";;;AAAA,+CAAwD;AAExD,2DAA+E;AAC/E,qDAA4E;AAC5E,yDAA4F;AAC5F,yDAA4F;AAC5F,mEAAqE;AAExD,QAAA,2BAA2B,GAAG,IAAI,6BAAc,CAAY,2BAA2B,CAAC,CAAC;AAEzF,QAAA,qBAAqB,GAAsB,+BAAgB,CAAC;IACvE,OAAO,EAAE,mCAA2B;IACpC,UAAU,EAAE,kDAA0B;IACtC,IAAI,EAAE,CAAC,kCAAiB,EAAE,gDAA6B,EAAE,gDAA6B,CAAC;CACxF,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAe;IAC/C,6BAAqB;IACrB,sCAAqB;
|
|
1
|
+
{"version":3,"file":"entry-point.di.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/entry-point.di.ts"],"names":[],"mappings":";;;AAAA,+CAAwD;AAExD,2DAA+E;AAC/E,qDAA4E;AAC5E,yDAA4F;AAC5F,yDAA4F;AAC5F,mEAAqE;AAExD,QAAA,2BAA2B,GAAG,IAAI,6BAAc,CAAY,2BAA2B,CAAC,CAAC;AAEzF,QAAA,qBAAqB,GAAsB,+BAAgB,CAAC;IACvE,OAAO,EAAE,mCAA2B;IACpC,UAAU,EAAE,kDAA0B;IACtC,IAAI,EAAE,CAAC,kCAAiB,EAAE,gDAA6B,EAAE,gDAA6B,CAAC;CACxF,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAe;IAC/C,6BAAqB;IACrB,GAAG,sCAAqB;IACxB,0CAAuB;IACvB,0CAAuB;CACxB,CAAC","sourcesContent":["import { InjectionToken, Provider } from 'injection-js';\nimport { Transform } from '../../graph/transform';\nimport { TransformProvider, provideTransform } from '../../graph/transform.di';\nimport { COMPILE_NGC_TOKEN, COMPILE_NGC_PROVIDERS } from './compile-ngc.di';\nimport { WRITE_BUNDLES_TRANSFORM, WRITE_BUNDLES_TRANSFORM_TOKEN } from './write-bundles.di';\nimport { WRITE_PACKAGE_TRANSFORM, WRITE_PACKAGE_TRANSFORM_TOKEN } from './write-package.di';\nimport { entryPointTransformFactory } from './entry-point.transform';\n\nexport const ENTRY_POINT_TRANSFORM_TOKEN = new InjectionToken<Transform>(`ng.v5.entryPointTransform`);\n\nexport const ENTRY_POINT_TRANSFORM: TransformProvider = provideTransform({\n provide: ENTRY_POINT_TRANSFORM_TOKEN,\n useFactory: entryPointTransformFactory,\n deps: [COMPILE_NGC_TOKEN, WRITE_BUNDLES_TRANSFORM_TOKEN, WRITE_PACKAGE_TRANSFORM_TOKEN],\n});\n\nexport const ENTRY_POINT_PROVIDERS: Provider[] = [\n ENTRY_POINT_TRANSFORM,\n ...COMPILE_NGC_PROVIDERS,\n WRITE_BUNDLES_TRANSFORM,\n WRITE_PACKAGE_TRANSFORM,\n];\n"]}
|
|
@@ -43,7 +43,7 @@ const nodes_1 = require("../nodes");
|
|
|
43
43
|
* @param writeBundles Transformation flattening ES2015 modules to ESM2015, UMD, and minified UMD.
|
|
44
44
|
* @param writePackage Transformation writing a distribution-ready `package.json` (for publishing to npm registry).
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
const entryPointTransformFactory = (compileTs, writeBundles, writePackage) => rxjs_1.pipe(
|
|
47
47
|
//tap(() => log.info(`Building from sources for entry point`)),
|
|
48
48
|
transform_1.transformFromPromise((graph) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
49
|
// Peek the first entry point from the graph
|
|
@@ -59,4 +59,5 @@ writeBundles, writePackage, transform_1.transformFromPromise((graph) => __awaite
|
|
|
59
59
|
const entryPoint = graph.find(nodes_1.byEntryPoint().and(select_1.isInProgress));
|
|
60
60
|
entryPoint.state = node_1.STATE_DONE;
|
|
61
61
|
})));
|
|
62
|
+
exports.entryPointTransformFactory = entryPointTransformFactory;
|
|
62
63
|
//# sourceMappingURL=entry-point.transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-point.transform.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/entry-point.transform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA4B;AAC5B,2CAA8C;AAC9C,+CAAkD;AAClD,qDAAwE;AACxE,uCAAuC;AACvC,oCAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"entry-point.transform.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/entry-point.transform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA4B;AAC5B,2CAA8C;AAC9C,+CAAkD;AAClD,qDAAwE;AACxE,uCAAuC;AACvC,oCAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,MAAM,0BAA0B,GAAG,CACxC,SAAoB,EACpB,YAAuB,EACvB,YAAuB,EACZ,EAAE,CACb,WAAI;AACF,+DAA+D;AAE/D,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,GAAG,CAAC,GAAG,CAAC,kFAAkF,CAAC,CAAC;IAC5F,GAAG,CAAC,GAAG,CAAC,yBAAyB,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,CAAC,CAAC;IACzE,GAAG,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;AAC5F,CAAC,CAAA,CAAC;AACF,iCAAiC;AACjC,SAAS;AACT,+CAA+C;AAC/C,YAAY,EACZ,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,CAGH,CAAC;AA1BS,QAAA,0BAA0B,8BA0BnC","sourcesContent":["import { pipe } from 'rxjs';\nimport { STATE_DONE } from '../../graph/node';\nimport { isInProgress } from '../../graph/select';\nimport { Transform, transformFromPromise } from '../../graph/transform';\nimport * as log from '../../utils/log';\nimport { byEntryPoint } from '../nodes';\n\n/**\n * A re-write of the `transformSources()` script that transforms an entry point from sources to distributable format.\n *\n * Sources are TypeScript source files accompanied by HTML templates and xCSS stylesheets.\n * See the Angular Package Format for a detailed description of what the distributables include.\n *\n * The current transformation pipeline can be thought of as:\n *\n * - clean\n * - compileTs\n * - downlevelTs\n * - writeBundles\n * - bundleToFesm15\n * - bundleToUmd\n * - bundleToUmdMin\n * - relocateSourceMaps\n * - writePackage\n * - copyStagedFiles (bundles, esm, dts, metadata, sourcemaps)\n * - writePackageJson\n *\n * The transformation pipeline is pluggable through the dependency injection system.\n * Sub-transformations are passed to this factory function as arguments.\n *\n * @param compileTs Transformation compiling typescript sources to ES2015 modules.\n * @param writeBundles Transformation flattening ES2015 modules to ESM2015, UMD, and minified UMD.\n * @param writePackage Transformation writing a distribution-ready `package.json` (for publishing to npm registry).\n */\nexport const entryPointTransformFactory = (\n compileTs: Transform,\n writeBundles: Transform,\n writePackage: Transform,\n): Transform =>\n pipe(\n //tap(() => log.info(`Building from sources for entry point`)),\n\n transformFromPromise(async (graph) => {\n // Peek the first entry point from the graph\n const entryPoint = graph.find(byEntryPoint().and(isInProgress));\n log.msg('\\n------------------------------------------------------------------------------');\n log.msg(`Building entry point '${entryPoint.data.entryPoint.moduleId}'`);\n log.msg('------------------------------------------------------------------------------');\n }),\n // TypeScript sources compilation\n compileTs,\n // After TypeScript: bundling and write package\n writeBundles,\n writePackage,\n transformFromPromise(async (graph) => {\n const entryPoint = graph.find(byEntryPoint().and(isInProgress));\n entryPoint.state = STATE_DONE;\n }),\n\n //tap(() => log.info(`Built.`))\n );\n"]}
|
|
@@ -5,7 +5,7 @@ const injection_js_1 = require("injection-js");
|
|
|
5
5
|
const transform_di_1 = require("../../graph/transform.di");
|
|
6
6
|
const tsconfig_1 = require("../../ts/tsconfig");
|
|
7
7
|
const init_tsconfig_transform_1 = require("./init-tsconfig.transform");
|
|
8
|
-
|
|
8
|
+
const provideTsConfig = (values) => {
|
|
9
9
|
return {
|
|
10
10
|
provide: exports.DEFAULT_TS_CONFIG_TOKEN,
|
|
11
11
|
useFactory: () => {
|
|
@@ -14,6 +14,7 @@ exports.provideTsConfig = (values) => {
|
|
|
14
14
|
deps: [],
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
+
exports.provideTsConfig = provideTsConfig;
|
|
17
18
|
exports.DEFAULT_TS_CONFIG_TOKEN = new injection_js_1.InjectionToken('ng.v5.defaultTsConfig');
|
|
18
19
|
exports.DEFAULT_TS_CONFIG_PROVIDER = exports.provideTsConfig();
|
|
19
20
|
exports.INIT_TS_CONFIG_TOKEN = new injection_js_1.InjectionToken('ng.v5.initTsConfigTransform');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-tsconfig.di.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/init-tsconfig.di.ts"],"names":[],"mappings":";;;AACA,+CAAwD;AAExD,2DAA+E;AAC/E,gDAA0D;AAC1D,uEAAyE;
|
|
1
|
+
{"version":3,"file":"init-tsconfig.di.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/init-tsconfig.di.ts"],"names":[],"mappings":";;;AACA,+CAAwD;AAExD,2DAA+E;AAC/E,gDAA0D;AAC1D,uEAAyE;AAElE,MAAM,eAAe,GAAG,CAAC,MAAqC,EAAY,EAAE;IACjF,OAAO;QACL,OAAO,EAAE,+BAAuB;QAChC,UAAU,EAAE,GAAG,EAAE;YACf,OAAO,gCAAqB,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,EAAE,EAAE;KACT,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,eAAe,mBAQ1B;AAEW,QAAA,uBAAuB,GAAG,IAAI,6BAAc,CAAsB,uBAAuB,CAAC,CAAC;AAE3F,QAAA,0BAA0B,GAAa,uBAAe,EAAE,CAAC;AAEzD,QAAA,oBAAoB,GAAG,IAAI,6BAAc,CAAY,6BAA6B,CAAC,CAAC;AAEpF,QAAA,wBAAwB,GAAsB,+BAAgB,CAAC;IAC1E,OAAO,EAAE,4BAAoB;IAC7B,UAAU,EAAE,sDAA4B;IACxC,IAAI,EAAE,CAAC,+BAAuB,CAAC;CAChC,CAAC,CAAC","sourcesContent":["import { ParsedConfiguration } from '@angular/compiler-cli';\nimport { InjectionToken, Provider } from 'injection-js';\nimport { Transform } from '../../graph/transform';\nimport { TransformProvider, provideTransform } from '../../graph/transform.di';\nimport { createDefaultTsConfig } from '../../ts/tsconfig';\nimport { initTsConfigTransformFactory } from './init-tsconfig.transform';\n\nexport const provideTsConfig = (values?: ParsedConfiguration | string): Provider => {\n return {\n provide: DEFAULT_TS_CONFIG_TOKEN,\n useFactory: () => {\n return createDefaultTsConfig(values);\n },\n deps: [],\n };\n};\n\nexport const DEFAULT_TS_CONFIG_TOKEN = new InjectionToken<ParsedConfiguration>('ng.v5.defaultTsConfig');\n\nexport const DEFAULT_TS_CONFIG_PROVIDER: Provider = provideTsConfig();\n\nexport const INIT_TS_CONFIG_TOKEN = new InjectionToken<Transform>('ng.v5.initTsConfigTransform');\n\nexport const INIT_TS_CONFIG_TRANSFORM: TransformProvider = provideTransform({\n provide: INIT_TS_CONFIG_TOKEN,\n useFactory: initTsConfigTransformFactory,\n deps: [DEFAULT_TS_CONFIG_TOKEN],\n});\n"]}
|
|
@@ -15,7 +15,7 @@ const transform_1 = require("../../graph/transform");
|
|
|
15
15
|
const nodes_1 = require("../nodes");
|
|
16
16
|
const tsconfig_1 = require("../../ts/tsconfig");
|
|
17
17
|
const log_1 = require("../../utils/log");
|
|
18
|
-
|
|
18
|
+
const initTsConfigTransformFactory = (defaultTsConfig) => transform_1.transformFromPromise((graph) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
19
|
// Initialize tsconfig for each entry point
|
|
20
20
|
const entryPoints = graph.filter(nodes_1.isEntryPoint);
|
|
21
21
|
tsconfig_1.initializeTsConfig(defaultTsConfig, entryPoints);
|
|
@@ -28,4 +28,5 @@ exports.initTsConfigTransformFactory = (defaultTsConfig) => transform_1.transfor
|
|
|
28
28
|
}
|
|
29
29
|
return graph;
|
|
30
30
|
}));
|
|
31
|
+
exports.initTsConfigTransformFactory = initTsConfigTransformFactory;
|
|
31
32
|
//# sourceMappingURL=init-tsconfig.transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-tsconfig.transform.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/init-tsconfig.transform.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6CAA2C;AAC3C,qDAAwE;AACxE,oCAAwD;AACxD,gDAAuD;AACvD,yCAAsC;
|
|
1
|
+
{"version":3,"file":"init-tsconfig.transform.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/init-tsconfig.transform.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6CAA2C;AAC3C,qDAAwE;AACxE,oCAAwD;AACxD,gDAAuD;AACvD,yCAAsC;AAE/B,MAAM,4BAA4B,GAAG,CAAC,eAAoC,EAAa,EAAE,CAC9F,gCAAoB,CAAC,CAAM,KAAK,EAAC,EAAE;IACjC,2CAA2C;IAC3C,MAAM,WAAW,GAAqB,KAAK,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;IACjE,6BAAkB,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IAEjD,IAAI,eAAe,CAAC,OAAO,CAAC,SAAS,EAAE;QACrC,MAAM,MAAM,GACV,kFAAkF;YAClF,uEAAuE;YACvE,qFAAqF;YACrF,gFAAgF,CAAC;QAEnF,SAAG,CAAC,cAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;KAC5B;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAA,CAAC,CAAC;AAjBQ,QAAA,4BAA4B,gCAiBpC","sourcesContent":["import { ParsedConfiguration } from '@angular/compiler-cli';\nimport { colors } from '../../utils/color';\nimport { Transform, transformFromPromise } from '../../graph/transform';\nimport { isEntryPoint, EntryPointNode } from '../nodes';\nimport { initializeTsConfig } from '../../ts/tsconfig';\nimport { msg } from '../../utils/log';\n\nexport const initTsConfigTransformFactory = (defaultTsConfig: ParsedConfiguration): Transform =>\n transformFromPromise(async graph => {\n // Initialize tsconfig for each entry point\n const entryPoints: EntryPointNode[] = graph.filter(isEntryPoint);\n initializeTsConfig(defaultTsConfig, entryPoints);\n\n if (defaultTsConfig.options.enableIvy) {\n const ivyMsg =\n '******************************************************************************\\n' +\n 'It is not recommended to publish Ivy libraries to NPM repositories.\\n' +\n 'Read more here: https://v9.angular.io/guide/ivy#maintaining-library-compatibility\\n' +\n '******************************************************************************';\n\n msg(colors.yellow(ivyMsg));\n }\n\n return graph;\n });\n"]}
|
|
@@ -38,7 +38,10 @@ exports.writeBundlesTransform = transform_1.transformFromPromise((graph) => __aw
|
|
|
38
38
|
entry: esm2015,
|
|
39
39
|
dependencyList: getDependencyListForGraph(graph),
|
|
40
40
|
};
|
|
41
|
-
const spinner = ora(
|
|
41
|
+
const spinner = ora({
|
|
42
|
+
hideCursor: false,
|
|
43
|
+
discardStdin: false,
|
|
44
|
+
});
|
|
42
45
|
try {
|
|
43
46
|
spinner.start('Bundling to FESM2015');
|
|
44
47
|
cache.rollupFESMCache = yield rollup_1.rollupBundleFile(Object.assign(Object.assign({}, opts), { moduleName: ngEntryPoint.moduleId, format: 'es', dest: fesm2015, cache: cache.rollupFESMCache }));
|