ng-packagr 4.0.0 → 4.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/CHANGELOG.md +68 -0
- package/README.md +12 -12
- package/cli/main.d.ts +1 -0
- package/cli/main.js +4 -2
- package/cli/main.js.map +1 -1
- package/lib/brocc/build-graph.d.ts +1 -1
- package/lib/brocc/build-graph.js.map +1 -1
- package/lib/brocc/depth.js.map +1 -1
- package/lib/brocc/node.js.map +1 -1
- package/lib/brocc/select.js.map +1 -1
- package/lib/brocc/transform.di.js.map +1 -1
- package/lib/brocc/transform.js.map +1 -1
- package/lib/commands/build.command.d.ts +2 -0
- package/lib/commands/build.command.js +1 -0
- package/lib/commands/build.command.js.map +1 -1
- package/lib/commands/command.js.map +1 -1
- package/lib/file/file-cache.js +0 -1
- package/lib/file/file-cache.js.map +1 -1
- package/lib/file/file-watcher.js.map +1 -1
- package/lib/flatten/downlevel-transformer.js.map +1 -1
- package/lib/flatten/external-module-id-strategy.js.map +1 -1
- package/lib/flatten/flatten.js.map +1 -1
- package/lib/flatten/rollup.js +3 -0
- package/lib/flatten/rollup.js.map +1 -1
- package/lib/flatten/uglify.js.map +1 -1
- package/lib/flatten/umd-module-id-strategy.js.map +1 -1
- package/lib/ng-package-format/entry-point.d.ts +12 -12
- package/lib/ng-package-format/entry-point.js.map +1 -1
- package/lib/ng-package-format/package.d.ts +9 -9
- package/lib/ng-package-format/package.js.map +1 -1
- package/lib/ng-package-format/shared.d.ts +1 -1
- package/lib/ng-v5/discover-packages.js.map +1 -1
- package/lib/ng-v5/entry-point/resources/postcss-clean.js.map +1 -1
- package/lib/ng-v5/entry-point/resources/stylesheet-processor.d.ts +4 -4
- package/lib/ng-v5/entry-point/resources/stylesheet-processor.js +12 -10
- package/lib/ng-v5/entry-point/resources/stylesheet-processor.js.map +1 -1
- package/lib/ng-v5/entry-point/ts/compile-ngc.transform.js +7 -4
- package/lib/ng-v5/entry-point/ts/compile-ngc.transform.js.map +1 -1
- package/lib/ng-v5/entry-point/write-bundles.transform.js.map +1 -1
- package/lib/ng-v5/entry-point/write-package.transform.js +2 -1
- package/lib/ng-v5/entry-point/write-package.transform.js.map +1 -1
- package/lib/ng-v5/init/analyse-sources.transform.js +6 -4
- package/lib/ng-v5/init/analyse-sources.transform.js.map +1 -1
- package/lib/ng-v5/init/init-tsconfig.di.d.ts +1 -1
- package/lib/ng-v5/init/init-tsconfig.di.js.map +1 -1
- package/lib/ng-v5/init/init-tsconfig.transform.d.ts +1 -1
- package/lib/ng-v5/init/init-tsconfig.transform.js +1 -1
- package/lib/ng-v5/init/init-tsconfig.transform.js.map +1 -1
- package/lib/ng-v5/nodes.d.ts +3 -4
- package/lib/ng-v5/nodes.js +1 -2
- package/lib/ng-v5/nodes.js.map +1 -1
- package/lib/ng-v5/package.di.js.map +1 -1
- package/lib/ng-v5/package.transform.js +15 -23
- package/lib/ng-v5/package.transform.js.map +1 -1
- package/lib/ng-v5/packagr.d.ts +2 -2
- package/lib/ng-v5/packagr.js.map +1 -1
- package/lib/ngc/compile-source-files.d.ts +1 -2
- package/lib/ngc/compile-source-files.js +2 -15
- package/lib/ngc/compile-source-files.js.map +1 -1
- package/lib/ngc/create-emit-callback.js +2 -2
- package/lib/ngc/create-emit-callback.js.map +1 -1
- package/lib/ts/cache-compiler-host.js.map +1 -1
- package/lib/ts/conf/tsconfig.ngc.json +0 -2
- package/lib/ts/redirect-write-file-compiler-host.js +1 -1
- package/lib/ts/redirect-write-file-compiler-host.js.map +1 -1
- package/lib/ts/tsconfig.d.ts +14 -7
- package/lib/ts/tsconfig.js +69 -54
- package/lib/ts/tsconfig.js.map +1 -1
- package/lib/util/array.js.map +1 -1
- package/lib/util/copy.d.ts +2 -2
- package/lib/util/copy.js +5 -18
- package/lib/util/copy.js.map +1 -1
- package/lib/util/glob.js.map +1 -1
- package/lib/util/log.js.map +1 -1
- package/lib/util/path.js.map +1 -1
- package/lib/util/promisify.js.map +1 -1
- package/lib/util/rimraf.js.map +1 -1
- package/package.json +12 -12
package/lib/ts/tsconfig.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ng = require("@angular/compiler-cli
|
|
3
|
+
const ng = require("@angular/compiler-cli");
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const ts = require("typescript");
|
|
6
6
|
const log = require("../util/log");
|
|
@@ -11,7 +11,25 @@ function readDefaultTsConfig(fileName) {
|
|
|
11
11
|
if (!fileName) {
|
|
12
12
|
fileName = path.resolve(__dirname, 'conf', 'tsconfig.ngc.json');
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
// these options are mandatory
|
|
15
|
+
const extraOptions = {
|
|
16
|
+
moduleResolution: ts.ModuleResolutionKind.NodeJs,
|
|
17
|
+
target: ts.ScriptTarget.ES2015,
|
|
18
|
+
emitDecoratorMetadata: true,
|
|
19
|
+
experimentalDecorators: true,
|
|
20
|
+
// sourcemaps
|
|
21
|
+
sourceMap: false,
|
|
22
|
+
inlineSources: true,
|
|
23
|
+
inlineSourceMap: true,
|
|
24
|
+
outDir: '',
|
|
25
|
+
declaration: true,
|
|
26
|
+
// ng compiler to options
|
|
27
|
+
enableResourceInlining: true,
|
|
28
|
+
// these are required to set the appropriate EmitFlags
|
|
29
|
+
flatModuleId: 'AUTOGENERATED',
|
|
30
|
+
flatModuleOutFile: 'AUTOGENERATED'
|
|
31
|
+
};
|
|
32
|
+
return ng.readConfiguration(fileName, extraOptions);
|
|
15
33
|
}
|
|
16
34
|
exports.readDefaultTsConfig = readDefaultTsConfig;
|
|
17
35
|
/**
|
|
@@ -36,75 +54,72 @@ exports.createDefaultTsConfig = createDefaultTsConfig;
|
|
|
36
54
|
* default config with entry point-specific values.
|
|
37
55
|
*/
|
|
38
56
|
exports.initializeTsConfig = (defaultTsConfig, entryPoints) => {
|
|
57
|
+
if (defaultTsConfig.errors.length > 0) {
|
|
58
|
+
throw ng.formatDiagnostics(defaultTsConfig.errors);
|
|
59
|
+
}
|
|
39
60
|
entryPoints.forEach(currentEntryPoint => {
|
|
40
61
|
const { entryPoint } = currentEntryPoint.data;
|
|
41
62
|
log.debug(`Initializing tsconfig for ${entryPoint.moduleId}`);
|
|
42
63
|
const basePath = path.dirname(entryPoint.entryFilePath);
|
|
43
64
|
// Resolve defaults from DI token and create a deep copy of the defaults
|
|
44
65
|
let tsConfig = JSON.parse(JSON.stringify(defaultTsConfig));
|
|
45
|
-
|
|
46
|
-
// some are not overrided in order to keep the default associated TS errors if the user choose to set incorrect values
|
|
47
|
-
const requiredOptions = {
|
|
48
|
-
emitDecoratorMetadata: true,
|
|
49
|
-
experimentalDecorators: true,
|
|
50
|
-
moduleResolution: ts.ModuleResolutionKind.NodeJs,
|
|
51
|
-
target: ts.ScriptTarget.ES2015,
|
|
52
|
-
declaration: true,
|
|
53
|
-
lib: ['dom', 'es2015']
|
|
54
|
-
};
|
|
55
|
-
const overrideConfig = {
|
|
56
|
-
rootNames: [entryPoint.entryFilePath],
|
|
57
|
-
options: {
|
|
58
|
-
flatModuleId: entryPoint.moduleId,
|
|
59
|
-
flatModuleOutFile: `${entryPoint.flatModuleFile}.js`,
|
|
60
|
-
basePath: basePath,
|
|
61
|
-
rootDir: basePath,
|
|
62
|
-
outDir: '',
|
|
63
|
-
lib: entryPoint.languageLevel ? entryPoint.languageLevel.map(lib => `lib.${lib}.d.ts`) : tsConfig.options.lib,
|
|
64
|
-
// setting this as basedir will rewire triple-slash references
|
|
65
|
-
declarationDir: basePath,
|
|
66
|
-
// required in order to avoid "ENOENT: no such file or directory, .../.ng_pkg_build/..." errors when using the programmatic API
|
|
67
|
-
inlineSources: true,
|
|
68
|
-
// setting the below here because these are a must have with these valus
|
|
69
|
-
inlineSourceMap: true,
|
|
70
|
-
sourceMap: false,
|
|
71
|
-
sourceRoot: `ng://${entryPoint.moduleId}`
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
tsConfig.rootNames = overrideConfig.rootNames;
|
|
75
|
-
tsConfig.options = Object.assign({}, requiredOptions, tsConfig.options, overrideConfig.options);
|
|
66
|
+
let jsx = tsConfig.options.jsx;
|
|
76
67
|
switch (entryPoint.jsxConfig) {
|
|
77
68
|
case 'preserve':
|
|
78
|
-
|
|
69
|
+
jsx = ts.JsxEmit.Preserve;
|
|
79
70
|
break;
|
|
80
71
|
case 'react':
|
|
81
|
-
|
|
72
|
+
jsx = ts.JsxEmit.React;
|
|
82
73
|
break;
|
|
83
74
|
case 'react-native':
|
|
84
|
-
|
|
75
|
+
jsx = ts.JsxEmit.ReactNative;
|
|
85
76
|
break;
|
|
86
77
|
default:
|
|
87
78
|
break;
|
|
88
79
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
tsConfig.options.paths[moduleId].concat(mappedPath);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
80
|
+
const overrideOptions = {
|
|
81
|
+
flatModuleId: entryPoint.moduleId,
|
|
82
|
+
flatModuleOutFile: `${entryPoint.flatModuleFile}.js`,
|
|
83
|
+
basePath,
|
|
84
|
+
rootDir: basePath,
|
|
85
|
+
lib: entryPoint.languageLevel ? entryPoint.languageLevel.map(lib => `lib.${lib}.d.ts`) : tsConfig.options.lib,
|
|
86
|
+
declarationDir: basePath,
|
|
87
|
+
sourceRoot: `ng://${entryPoint.moduleId}`,
|
|
88
|
+
jsx
|
|
89
|
+
};
|
|
90
|
+
tsConfig.rootNames = [entryPoint.entryFilePath];
|
|
91
|
+
tsConfig.options = Object.assign({}, tsConfig.options, overrideOptions);
|
|
107
92
|
currentEntryPoint.data.tsConfig = tsConfig;
|
|
108
93
|
});
|
|
109
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* Set the paths for entrypoint dependencies.
|
|
97
|
+
*
|
|
98
|
+
* This doesn't mutate the object.
|
|
99
|
+
*
|
|
100
|
+
* @param parsedTsConfig - A parsed tsconfig
|
|
101
|
+
* @param entryPoints - A list of entryPoints
|
|
102
|
+
* @param pointToSource Point the path mapping to either the source code or emitted declarations.
|
|
103
|
+
* Typically for analysis one should point to the source files while for a compilation once should use the emitted declarations
|
|
104
|
+
*/
|
|
105
|
+
function setDependenciesTsConfigPaths(parsedTsConfig, entryPoints, pointToSource = false) {
|
|
106
|
+
const tsConfig = JSON.parse(JSON.stringify(parsedTsConfig));
|
|
107
|
+
// Add paths mappings for dependencies
|
|
108
|
+
if (!tsConfig.options.paths) {
|
|
109
|
+
tsConfig.options.paths = {};
|
|
110
|
+
}
|
|
111
|
+
for (let dep of entryPoints) {
|
|
112
|
+
const { entryPoint } = dep.data;
|
|
113
|
+
const { moduleId, destinationFiles, entryFilePath } = entryPoint;
|
|
114
|
+
const mappedPath = [pointToSource ? entryFilePath : destinationFiles.declarations];
|
|
115
|
+
if (!tsConfig.options.paths[moduleId]) {
|
|
116
|
+
tsConfig.options.paths[moduleId] = mappedPath;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
tsConfig.options.paths[moduleId].concat(mappedPath).reverse();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return tsConfig;
|
|
123
|
+
}
|
|
124
|
+
exports.setDependenciesTsConfigPaths = setDependenciesTsConfigPaths;
|
|
110
125
|
//# sourceMappingURL=tsconfig.js.map
|
package/lib/ts/tsconfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../src/lib/ts/tsconfig.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../src/lib/ts/tsconfig.ts"],"names":[],"mappings":";;AAAA,4CAA4C;AAC5C,6BAA6B;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CAAC,CAAC;QAChD,QAAQ,CAAC,OAAO,qBAAQ,QAAQ,CAAC,OAAO,EAAK,eAAe,CAAE,CAAC;QAC/D,iBAAiB,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,sCACE,cAAsC,EACtC,WAA6B,EAC7B,aAAa,GAAG,KAAK;IAErB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;IAE5D,sCAAsC;IACtC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE;QAC3B,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;KAC7B;IAED,KAAK,IAAI,GAAG,IAAI,WAAW,EAAE;QAC3B,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;QAChC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;QACjE,MAAM,UAAU,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAEnF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;YACrC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;SAC/C;aAAM;YACL,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;SAC/D;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAzBD,oEAyBC","sourcesContent":["import * as ng from '@angular/compiler-cli';\nimport * as path from 'path';\nimport * as ts from 'typescript';\nimport { EntryPointNode } from '../ng-v5/nodes';\nimport * as log from '../util/log';\n\n/**\n * Reads the default TypeScript configuration.\n */\nexport function readDefaultTsConfig(fileName?: string): ng.ParsedConfiguration {\n if (!fileName) {\n fileName = path.resolve(__dirname, 'conf', 'tsconfig.ngc.json');\n }\n\n // these options are mandatory\n const extraOptions: ng.CompilerOptions = {\n moduleResolution: ts.ModuleResolutionKind.NodeJs,\n target: ts.ScriptTarget.ES2015,\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n\n // sourcemaps\n sourceMap: false,\n inlineSources: true,\n inlineSourceMap: true,\n\n outDir: '',\n declaration: true,\n\n // ng compiler to options\n enableResourceInlining: true,\n\n // these are required to set the appropriate EmitFlags\n flatModuleId: 'AUTOGENERATED',\n flatModuleOutFile: 'AUTOGENERATED'\n };\n\n return ng.readConfiguration(fileName, extraOptions);\n}\n\n/**\n * Creates a parsed TypeScript configuration object.\n *\n * @param values File path or parsed configuration.\n */\nexport function createDefaultTsConfig(values?: ng.ParsedConfiguration | string): ng.ParsedConfiguration {\n if (!values) {\n return readDefaultTsConfig();\n } else if (typeof values === 'string') {\n return readDefaultTsConfig(values);\n } else {\n return values;\n }\n}\n\n/**\n * Initializes TypeScript Compiler options and Angular Compiler options by overriding the\n * default config with entry point-specific values.\n */\nexport const initializeTsConfig = (defaultTsConfig: ng.ParsedConfiguration, entryPoints: EntryPointNode[]) => {\n if (defaultTsConfig.errors.length > 0) {\n throw ng.formatDiagnostics(defaultTsConfig.errors);\n }\n\n entryPoints.forEach(currentEntryPoint => {\n const { entryPoint } = currentEntryPoint.data;\n log.debug(`Initializing tsconfig for ${entryPoint.moduleId}`);\n const basePath = path.dirname(entryPoint.entryFilePath);\n\n // Resolve defaults from DI token and create a deep copy of the defaults\n let tsConfig: ng.ParsedConfiguration = JSON.parse(JSON.stringify(defaultTsConfig));\n\n let jsx = tsConfig.options.jsx;\n switch (entryPoint.jsxConfig) {\n case 'preserve':\n jsx = ts.JsxEmit.Preserve;\n break;\n case 'react':\n jsx = ts.JsxEmit.React;\n break;\n case 'react-native':\n jsx = ts.JsxEmit.ReactNative;\n break;\n default:\n break;\n }\n\n const overrideOptions: ng.CompilerOptions = {\n flatModuleId: entryPoint.moduleId,\n flatModuleOutFile: `${entryPoint.flatModuleFile}.js`,\n basePath,\n rootDir: basePath,\n lib: entryPoint.languageLevel ? entryPoint.languageLevel.map(lib => `lib.${lib}.d.ts`) : tsConfig.options.lib,\n declarationDir: basePath,\n sourceRoot: `ng://${entryPoint.moduleId}`,\n jsx\n };\n\n tsConfig.rootNames = [entryPoint.entryFilePath];\n tsConfig.options = { ...tsConfig.options, ...overrideOptions };\n currentEntryPoint.data.tsConfig = tsConfig;\n });\n};\n\n/**\n * Set the paths for entrypoint dependencies.\n *\n * This doesn't mutate the object.\n *\n * @param parsedTsConfig - A parsed tsconfig\n * @param entryPoints - A list of entryPoints\n * @param pointToSource Point the path mapping to either the source code or emitted declarations.\n * Typically for analysis one should point to the source files while for a compilation once should use the emitted declarations\n */\nexport function setDependenciesTsConfigPaths(\n parsedTsConfig: ng.ParsedConfiguration,\n entryPoints: EntryPointNode[],\n pointToSource = false\n) {\n const tsConfig = JSON.parse(JSON.stringify(parsedTsConfig));\n\n // Add paths mappings for dependencies\n if (!tsConfig.options.paths) {\n tsConfig.options.paths = {};\n }\n\n for (let dep of entryPoints) {\n const { entryPoint } = dep.data;\n const { moduleId, destinationFiles, entryFilePath } = entryPoint;\n const mappedPath = [pointToSource ? entryFilePath : destinationFiles.declarations];\n\n if (!tsConfig.options.paths[moduleId]) {\n tsConfig.options.paths[moduleId] = mappedPath;\n } else {\n tsConfig.options.paths[moduleId].concat(mappedPath).reverse();\n }\n }\n\n return tsConfig;\n}\n"]}
|
package/lib/util/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src/lib/util/array.ts"],"names":[],"mappings":";;AAAA,iBAA2B,KAAc;IACvC,
|
|
1
|
+
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src/lib/util/array.ts"],"names":[],"mappings":";;AAAA,iBAA2B,KAAc;IACvC,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAFD,0BAEC;AAED,iBAA2B,KAAqB;IAC9C,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAFD,0BAEC;AAED,gBAA0B,KAAU;IAClC,8EAA8E;IAC9E,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAQ,CAAC,CAAC;AACpC,CAAC;AAHD,wBAGC","sourcesContent":["export function toArray<T>(value: T | T[]): T[] {\n return [].concat(value);\n}\n\nexport function flatten<T>(value: Array<T | T[]>): T[] {\n return [].concat.apply([], value);\n}\n\nexport function unique<T>(value: T[]): T[] {\n // todo: his has been fixed in TypeScript 2.8 remove the casting when updating\n return [...new Set(value) as any];\n}\n"]}
|
package/lib/util/copy.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function
|
|
1
|
+
import { CopyOptions } from 'fs-extra';
|
|
2
|
+
export declare function copyFile(src: string, dest: string, options?: CopyOptions): Promise<void>;
|
package/lib/util/copy.js
CHANGED
|
@@ -8,25 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const log_1 = require("./log");
|
|
14
|
-
const array_1 = require("./array");
|
|
15
|
-
function copyFiles(src, dest, options) {
|
|
11
|
+
const fs_extra_1 = require("fs-extra");
|
|
12
|
+
function copyFile(src, dest, options) {
|
|
16
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
return promisify_1.promisify(resolveOrReject => {
|
|
20
|
-
if (options) {
|
|
21
|
-
cpx_1.copy(src, dest, options, resolveOrReject);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
cpx_1.copy(src, dest, resolveOrReject);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
return Promise.all(promises);
|
|
14
|
+
const exists = yield fs_extra_1.pathExists(src);
|
|
15
|
+
return exists ? fs_extra_1.copy(src, dest, options) : undefined;
|
|
29
16
|
});
|
|
30
17
|
}
|
|
31
|
-
exports.
|
|
18
|
+
exports.copyFile = copyFile;
|
|
32
19
|
//# sourceMappingURL=copy.js.map
|
package/lib/util/copy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../src/lib/util/copy.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../src/lib/util/copy.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,uCAAyD;AAEzD,kBAA+B,GAAW,EAAE,IAAY,EAAE,OAAqB;;QAC7E,MAAM,MAAM,GAAG,MAAM,qBAAU,CAAC,GAAG,CAAC,CAAC;QAErC,OAAO,MAAM,CAAC,CAAC,CAAC,eAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvD,CAAC;CAAA;AAJD,4BAIC","sourcesContent":["import { copy, CopyOptions, pathExists } from 'fs-extra';\n\nexport async function copyFile(src: string, dest: string, options?: CopyOptions): Promise<void> {\n const exists = await pathExists(src);\n\n return exists ? copy(src, dest, options) : undefined;\n}\n"]}
|
package/lib/util/glob.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../../src/lib/util/glob.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,6BAA6B;AAC7B,2CAAwC;AACxC,mCAA2C;AAE3C,mBAAgC,OAA0B,EAAE,OAAuB;;QACjF,MAAM,WAAW,GAAG,OAAO,CAAC,EAAE,CAAC,qBAAS,CAAW,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;QAC/G,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,eAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QACnE,
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../../src/lib/util/glob.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,6BAA6B;AAC7B,2CAAwC;AACxC,mCAA2C;AAE3C,mBAAgC,OAA0B,EAAE,OAAuB;;QACjF,MAAM,WAAW,GAAG,OAAO,CAAC,EAAE,CAAC,qBAAS,CAAW,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;QAC/G,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,eAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QACnE,OAAO,eAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CAAA;AAJD,8BAIC","sourcesContent":["import * as glob from 'glob';\nimport { promisify } from './promisify';\nimport { flatten, toArray } from './array';\n\nexport async function globFiles(pattern: string | string[], options?: glob.IOptions): Promise<string[]> {\n const globPromise = pattern => promisify<string[]>(resolveOrReject => glob(pattern, options, resolveOrReject));\n const files = await Promise.all(toArray(pattern).map(globPromise));\n return flatten(files);\n}\n"]}
|
package/lib/util/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/lib/util/log.ts"],"names":[],"mappings":";;AAAA,iCAA0B;AAEb,QAAA,KAAK,GAAG,CAAC,GAAmB,EAAE,EAAE;IAC3C,
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"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GAAG,CAAC,eAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC;KACnD;AACH,CAAC,CAAC","sourcesContent":["import chalk from 'chalk';\n\nexport const error = (err: string | Error) => {\n if (err instanceof Error) {\n console.log('\\n' + chalk.red('BUILD ERROR'));\n console.log(chalk.red(err.message));\n console.log(chalk.red(err.stack) + '\\n');\n } else {\n console.log(chalk.red(err));\n }\n};\n\nexport const warn = (msg: string) => {\n console.log(chalk.yellow(msg));\n};\n\nexport const success = (msg: string) => {\n console.log(chalk.green(msg));\n};\n\nexport const info = (msg: string) => {\n console.log(chalk.blue(msg));\n};\n\nexport const msg = (msg: string) => {\n console.log(chalk.white(msg));\n};\n\nexport const debug = (msg: string) => {\n if (process.env.DEBUG) {\n console.log(chalk.inverse.cyan(`[debug] ${msg}`));\n }\n};\n"]}
|
package/lib/util/path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../src/lib/util/path.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AAEpB,QAAA,cAAc,GACzB,CAAC,IAAa,EAAiB,EAAE;IAC/B,
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../src/lib/util/path.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AAEpB,QAAA,cAAc,GACzB,CAAC,IAAa,EAAiB,EAAE;IAC/B,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IAED,2FAA2F;IAC3F,iEAAiE;IACjE,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC,CAAA","sourcesContent":["import * as nodePath from 'path';\n\nexport const ensureUnixPath =\n (path?: string): string | null => {\n if (!path) {\n return null;\n }\n\n // we use a regex instead of the character literal due to a bug in some versions of node.js\n // the path separator needs to be preceded by an escape character\n const regex = new RegExp('\\\\' + nodePath.win32.sep, 'g');\n return path.replace(regex, nodePath.posix.sep);\n }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../../src/lib/util/promisify.ts"],"names":[],"mappings":";;AAGA,mBAA6B,QAAuD;IAClF,
|
|
1
|
+
{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../../src/lib/util/promisify.ts"],"names":[],"mappings":";;AAGA,mBAA6B,QAAuD;IAClF,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,QAAQ,CAAC,CAAC,CAAC,GAAU,EAAE,KAAS,EAAQ,EAAE;YACxC,IAAI,GAAG,EAAE;gBACP,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,CAAC;aAChB;QACH,CAAC,CAAC,CAAC,CAAA;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAVD,8BAUC","sourcesContent":["\nexport type PromiseCallback<T> = (err: Error, value?: T) => void;\n\nexport function promisify<T>(resolver: (resolveOrReject: PromiseCallback<T>) => void): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n resolver(((err: Error, value?: T): void => {\n if (err) {\n reject(err);\n } else {\n resolve(value);\n }\n }))\n });\n}\n"]}
|
package/lib/util/rimraf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rimraf.js","sourceRoot":"","sources":["../../../src/lib/util/rimraf.ts"],"names":[],"mappings":";;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC7B,2CAAwC;AACxC,+BAA8B;AAEjB,QAAA,MAAM,GAAG,CAAC,CAAM,EAAE,IAAU,EAAE,EAAE;IAC3C,WAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAErB,
|
|
1
|
+
{"version":3,"file":"rimraf.js","sourceRoot":"","sources":["../../../src/lib/util/rimraf.ts"],"names":[],"mappings":";;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC7B,2CAAwC;AACxC,+BAA8B;AAEjB,QAAA,MAAM,GAAG,CAAC,CAAM,EAAE,IAAU,EAAE,EAAE;IAC3C,WAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAErB,OAAO,qBAAS,CAAO,CAAC,eAAe,EAAE,EAAE;QACzC,IAAI,IAAI,EAAE;YACR,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;SAC9B;aAAM;YACL,EAAE,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC","sourcesContent":["const rm = require('rimraf');\nimport { promisify } from './promisify';\nimport { debug } from './log';\n\nexport const rimraf = (f: any, opts?: any) => {\n debug(`rimraf ${f}`);\n\n return promisify<void>((resolveOrReject) => {\n if (opts) {\n rm(f, opts, resolveOrReject);\n } else {\n rm(f, resolveOrReject);\n }\n });\n\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng-packagr",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Compile and package a TypeScript library to Angular Package Format",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
],
|
|
17
17
|
"author": "David Herges <david@spektrakel.de>",
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"repository": "https://github.com/
|
|
20
|
-
"homepage": "https://github.com/
|
|
19
|
+
"repository": "https://github.com/ng-packagr/ng-packagr.git",
|
|
20
|
+
"homepage": "https://github.com/ng-packagr/ng-packagr",
|
|
21
21
|
"bugs": {
|
|
22
|
-
"url": "https://github.com/
|
|
22
|
+
"url": "https://github.com/ng-packagr/ng-packagr/issues"
|
|
23
23
|
},
|
|
24
24
|
"bin": {
|
|
25
25
|
"ng-packagr": "./cli/main.js"
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"chokidar": "^2.0.3",
|
|
35
35
|
"clean-css": "^4.1.11",
|
|
36
36
|
"commander": "^2.12.0",
|
|
37
|
-
"cpx": "^1.5.0",
|
|
38
37
|
"fs-extra": "^7.0.0",
|
|
39
38
|
"glob": "^7.1.2",
|
|
40
39
|
"injection-js": "^2.2.1",
|
|
41
|
-
"less": "^3.
|
|
42
|
-
"
|
|
40
|
+
"less": "^3.8.0",
|
|
41
|
+
"less-plugin-npm-import": "^2.1.0",
|
|
42
|
+
"node-sass": "^4.9.3",
|
|
43
43
|
"node-sass-tilde-importer": "^1.0.0",
|
|
44
44
|
"postcss": "^7.0.0",
|
|
45
|
-
"postcss-url": "^
|
|
45
|
+
"postcss-url": "^8.0.0",
|
|
46
46
|
"read-pkg-up": "^4.0.0",
|
|
47
47
|
"rimraf": "^2.6.1",
|
|
48
|
-
"rollup": "^0.
|
|
48
|
+
"rollup": "^0.66.0",
|
|
49
49
|
"rollup-plugin-commonjs": "^9.1.3",
|
|
50
50
|
"rollup-plugin-node-resolve": "^3.0.0",
|
|
51
51
|
"rollup-plugin-sourcemaps": "^0.4.2",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"update-notifier": "^2.3.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@angular/compiler": "^6.0.0",
|
|
59
|
-
"@angular/compiler-cli": "^6.0.0",
|
|
58
|
+
"@angular/compiler": "^6.0.0 || ^7.0.0-beta.0",
|
|
59
|
+
"@angular/compiler-cli": "^6.0.0 || ^7.0.0-beta.0",
|
|
60
60
|
"tsickle": ">=0.27.3",
|
|
61
61
|
"tslib": "^1.9.0",
|
|
62
|
-
"typescript": "^2.7.0"
|
|
62
|
+
"typescript": "^2.7.0 || ~3.0.1"
|
|
63
63
|
}
|
|
64
64
|
}
|