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.
Files changed (78) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +12 -12
  3. package/cli/main.d.ts +1 -0
  4. package/cli/main.js +4 -2
  5. package/cli/main.js.map +1 -1
  6. package/lib/brocc/build-graph.d.ts +1 -1
  7. package/lib/brocc/build-graph.js.map +1 -1
  8. package/lib/brocc/depth.js.map +1 -1
  9. package/lib/brocc/node.js.map +1 -1
  10. package/lib/brocc/select.js.map +1 -1
  11. package/lib/brocc/transform.di.js.map +1 -1
  12. package/lib/brocc/transform.js.map +1 -1
  13. package/lib/commands/build.command.d.ts +2 -0
  14. package/lib/commands/build.command.js +1 -0
  15. package/lib/commands/build.command.js.map +1 -1
  16. package/lib/commands/command.js.map +1 -1
  17. package/lib/file/file-cache.js +0 -1
  18. package/lib/file/file-cache.js.map +1 -1
  19. package/lib/file/file-watcher.js.map +1 -1
  20. package/lib/flatten/downlevel-transformer.js.map +1 -1
  21. package/lib/flatten/external-module-id-strategy.js.map +1 -1
  22. package/lib/flatten/flatten.js.map +1 -1
  23. package/lib/flatten/rollup.js +3 -0
  24. package/lib/flatten/rollup.js.map +1 -1
  25. package/lib/flatten/uglify.js.map +1 -1
  26. package/lib/flatten/umd-module-id-strategy.js.map +1 -1
  27. package/lib/ng-package-format/entry-point.d.ts +12 -12
  28. package/lib/ng-package-format/entry-point.js.map +1 -1
  29. package/lib/ng-package-format/package.d.ts +9 -9
  30. package/lib/ng-package-format/package.js.map +1 -1
  31. package/lib/ng-package-format/shared.d.ts +1 -1
  32. package/lib/ng-v5/discover-packages.js.map +1 -1
  33. package/lib/ng-v5/entry-point/resources/postcss-clean.js.map +1 -1
  34. package/lib/ng-v5/entry-point/resources/stylesheet-processor.d.ts +4 -4
  35. package/lib/ng-v5/entry-point/resources/stylesheet-processor.js +12 -10
  36. package/lib/ng-v5/entry-point/resources/stylesheet-processor.js.map +1 -1
  37. package/lib/ng-v5/entry-point/ts/compile-ngc.transform.js +7 -4
  38. package/lib/ng-v5/entry-point/ts/compile-ngc.transform.js.map +1 -1
  39. package/lib/ng-v5/entry-point/write-bundles.transform.js.map +1 -1
  40. package/lib/ng-v5/entry-point/write-package.transform.js +2 -1
  41. package/lib/ng-v5/entry-point/write-package.transform.js.map +1 -1
  42. package/lib/ng-v5/init/analyse-sources.transform.js +6 -4
  43. package/lib/ng-v5/init/analyse-sources.transform.js.map +1 -1
  44. package/lib/ng-v5/init/init-tsconfig.di.d.ts +1 -1
  45. package/lib/ng-v5/init/init-tsconfig.di.js.map +1 -1
  46. package/lib/ng-v5/init/init-tsconfig.transform.d.ts +1 -1
  47. package/lib/ng-v5/init/init-tsconfig.transform.js +1 -1
  48. package/lib/ng-v5/init/init-tsconfig.transform.js.map +1 -1
  49. package/lib/ng-v5/nodes.d.ts +3 -4
  50. package/lib/ng-v5/nodes.js +1 -2
  51. package/lib/ng-v5/nodes.js.map +1 -1
  52. package/lib/ng-v5/package.di.js.map +1 -1
  53. package/lib/ng-v5/package.transform.js +15 -23
  54. package/lib/ng-v5/package.transform.js.map +1 -1
  55. package/lib/ng-v5/packagr.d.ts +2 -2
  56. package/lib/ng-v5/packagr.js.map +1 -1
  57. package/lib/ngc/compile-source-files.d.ts +1 -2
  58. package/lib/ngc/compile-source-files.js +2 -15
  59. package/lib/ngc/compile-source-files.js.map +1 -1
  60. package/lib/ngc/create-emit-callback.js +2 -2
  61. package/lib/ngc/create-emit-callback.js.map +1 -1
  62. package/lib/ts/cache-compiler-host.js.map +1 -1
  63. package/lib/ts/conf/tsconfig.ngc.json +0 -2
  64. package/lib/ts/redirect-write-file-compiler-host.js +1 -1
  65. package/lib/ts/redirect-write-file-compiler-host.js.map +1 -1
  66. package/lib/ts/tsconfig.d.ts +14 -7
  67. package/lib/ts/tsconfig.js +69 -54
  68. package/lib/ts/tsconfig.js.map +1 -1
  69. package/lib/util/array.js.map +1 -1
  70. package/lib/util/copy.d.ts +2 -2
  71. package/lib/util/copy.js +5 -18
  72. package/lib/util/copy.js.map +1 -1
  73. package/lib/util/glob.js.map +1 -1
  74. package/lib/util/log.js.map +1 -1
  75. package/lib/util/path.js.map +1 -1
  76. package/lib/util/promisify.js.map +1 -1
  77. package/lib/util/rimraf.js.map +1 -1
  78. package/package.json +12 -12
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const ng = require("@angular/compiler-cli/src/perform_compile");
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
- return ng.readConfiguration(fileName);
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
- // minimal compilerOptions needed in order to avoid errors, with their associated default values
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
- tsConfig.options.jsx = ts.JsxEmit.Preserve;
69
+ jsx = ts.JsxEmit.Preserve;
79
70
  break;
80
71
  case 'react':
81
- tsConfig.options.jsx = ts.JsxEmit.React;
72
+ jsx = ts.JsxEmit.React;
82
73
  break;
83
74
  case 'react-native':
84
- tsConfig.options.jsx = ts.JsxEmit.ReactNative;
75
+ jsx = ts.JsxEmit.ReactNative;
85
76
  break;
86
77
  default:
87
78
  break;
88
79
  }
89
- // Add paths mappings for dependencies
90
- const entryPointDeps = entryPoints.filter(x => x.data.entryPoint.moduleId !== entryPoint.moduleId);
91
- if (entryPointDeps.length > 0) {
92
- if (!tsConfig.options.paths) {
93
- tsConfig.options.paths = {};
94
- }
95
- for (let dep of entryPointDeps) {
96
- const { entryPoint, destinationFiles } = dep.data;
97
- const { moduleId, entryFilePath } = entryPoint;
98
- const mappedPath = [destinationFiles.declarations, entryFilePath];
99
- if (!tsConfig.options.paths[moduleId]) {
100
- tsConfig.options.paths[moduleId] = mappedPath;
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
@@ -1 +1 @@
1
- {"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../src/lib/ts/tsconfig.ts"],"names":[],"mappings":";;AAAA,gEAAgE;AAGhE,6BAA6B;AAC7B,iCAAiC;AAEjC,mCAAmC;AAOnC;;GAEG;AACH,6BAAoC,QAAiB;IACnD,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QACd,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC;AAND,kDAMC;AAED;;;;GAIG;AACH,+BAAsC,MAA0B;IAC9D,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACZ,MAAM,CAAC,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC;QACtC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAAC,IAAI,CAAC,CAAC;QACN,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC;AACH,CAAC;AARD,sDAQC;AAED;;;GAGG;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CAAC,CAAC;gBAC/B,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;gBAClD,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;gBAC/C,MAAM,UAAU,GAAG,CAAC,gBAAgB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;gBAElE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;oBACtC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;gBAChD,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACN,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBACtD,CAAC;YACH,CAAC;QACH,CAAC;QAED,iBAAiB,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import * as ng from '@angular/compiler-cli/src/perform_compile';\n// XX: has or is using name 'ParsedConfiguration' ... but cannot be named\nimport { ParsedConfiguration } from '@angular/compiler-cli/src/perform_compile';\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 * TypeScript configuration used internally (marker typer).\n */\nexport type TsConfig = ng.ParsedConfiguration;\n\n/**\n * Reads the default TypeScript configuration.\n */\nexport function readDefaultTsConfig(fileName?: string): TsConfig {\n if (!fileName) {\n fileName = path.resolve(__dirname, 'conf', 'tsconfig.ngc.json');\n }\n\n return ng.readConfiguration(fileName);\n}\n\n/**\n * Creates a parsed TypeScript configuration object.\n *\n * @param values File path or parsed configuration.\n */\nexport function createDefaultTsConfig(values?: TsConfig | string): TsConfig {\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: TsConfig, entryPoints: EntryPointNode[]) => {\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: TsConfig = JSON.parse(JSON.stringify(defaultTsConfig));\n\n // minimal compilerOptions needed in order to avoid errors, with their associated default values\n // some are not overrided in order to keep the default associated TS errors if the user choose to set incorrect values\n const requiredOptions: Partial<ts.CompilerOptions> = {\n emitDecoratorMetadata: true,\n experimentalDecorators: true,\n moduleResolution: ts.ModuleResolutionKind.NodeJs,\n target: ts.ScriptTarget.ES2015,\n declaration: true,\n lib: ['dom', 'es2015']\n };\n\n const overrideConfig: Partial<TsConfig> = {\n rootNames: [entryPoint.entryFilePath],\n options: {\n flatModuleId: entryPoint.moduleId,\n flatModuleOutFile: `${entryPoint.flatModuleFile}.js`,\n basePath: basePath,\n rootDir: basePath,\n outDir: '',\n lib: entryPoint.languageLevel ? entryPoint.languageLevel.map(lib => `lib.${lib}.d.ts`) : tsConfig.options.lib,\n // setting this as basedir will rewire triple-slash references\n declarationDir: basePath,\n // required in order to avoid \"ENOENT: no such file or directory, .../.ng_pkg_build/...\" errors when using the programmatic API\n inlineSources: true,\n // setting the below here because these are a must have with these valus\n inlineSourceMap: true,\n sourceMap: false,\n sourceRoot: `ng://${entryPoint.moduleId}`\n }\n };\n\n tsConfig.rootNames = overrideConfig.rootNames;\n tsConfig.options = { ...requiredOptions, ...tsConfig.options, ...overrideConfig.options };\n\n switch (entryPoint.jsxConfig) {\n case 'preserve':\n tsConfig.options.jsx = ts.JsxEmit.Preserve;\n break;\n case 'react':\n tsConfig.options.jsx = ts.JsxEmit.React;\n break;\n case 'react-native':\n tsConfig.options.jsx = ts.JsxEmit.ReactNative;\n break;\n default:\n break;\n }\n\n // Add paths mappings for dependencies\n const entryPointDeps = entryPoints.filter(x => x.data.entryPoint.moduleId !== entryPoint.moduleId);\n if (entryPointDeps.length > 0) {\n if (!tsConfig.options.paths) {\n tsConfig.options.paths = {};\n }\n\n for (let dep of entryPointDeps) {\n const { entryPoint, destinationFiles } = dep.data;\n const { moduleId, entryFilePath } = entryPoint;\n const mappedPath = [destinationFiles.declarations, entryFilePath];\n\n if (!tsConfig.options.paths[moduleId]) {\n tsConfig.options.paths[moduleId] = mappedPath;\n } else {\n tsConfig.options.paths[moduleId].concat(mappedPath);\n }\n }\n }\n\n currentEntryPoint.data.tsConfig = tsConfig;\n });\n};\n"]}
1
+ {"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../src/lib/ts/tsconfig.ts"],"names":[],"mappings":";;AAAA,4CAA4C;AAC5C,6BAA6B;AAC7B,iCAAiC;AAEjC,mCAAmC;AAEnC;;GAEG;AACH,6BAAoC,QAAiB;IACnD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC;KACjE;IAED,8BAA8B;IAC9B,MAAM,YAAY,GAAuB;QACvC,gBAAgB,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM;QAChD,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;QAC9B,qBAAqB,EAAE,IAAI;QAC3B,sBAAsB,EAAE,IAAI;QAE5B,aAAa;QACb,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,IAAI;QACnB,eAAe,EAAE,IAAI;QAErB,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,IAAI;QAEjB,yBAAyB;QACzB,sBAAsB,EAAE,IAAI;QAE5B,sDAAsD;QACtD,YAAY,EAAE,eAAe;QAC7B,iBAAiB,EAAE,eAAe;KACnC,CAAC;IA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,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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src/lib/util/array.ts"],"names":[],"mappings":";;AAAA,iBAA2B,KAAc;IACvC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAFD,0BAEC;AAED,iBAA2B,KAAqB;IAC9C,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAFD,0BAEC;AAED,gBAA0B,KAAU;IAClC,8EAA8E;IAC9E,MAAM,CAAC,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"]}
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"]}
@@ -1,2 +1,2 @@
1
- import { AsyncOptions } from 'cpx';
2
- export declare function copyFiles(src: string | string[], dest: string, options?: AsyncOptions): Promise<void[]>;
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 cpx_1 = require("cpx");
12
- const promisify_1 = require("./promisify");
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 promises = array_1.toArray(src).map(src => {
18
- log_1.debug(`copyFiles from ${src} to ${dest}`);
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.copyFiles = copyFiles;
18
+ exports.copyFile = copyFile;
32
19
  //# sourceMappingURL=copy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../src/lib/util/copy.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,6BAAyC;AACzC,2CAAwC;AACxC,+BAA8B;AAC9B,mCAAkC;AAElC,mBAAgC,GAAsB,EAAE,IAAY,EAAE,OAAsB;;QAC1F,MAAM,QAAQ,GAAG,eAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACtC,WAAK,CAAC,kBAAkB,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;YAC1C,MAAM,CAAC,qBAAS,CAAO,eAAe,CAAC,EAAE;gBACvC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACZ,UAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;gBAC5C,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACN,UAAI,CAAC,GAAG,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;CAAA;AAbD,8BAaC","sourcesContent":["import { copy, AsyncOptions } from 'cpx';\nimport { promisify } from './promisify';\nimport { debug } from './log';\nimport { toArray } from './array';\n\nexport async function copyFiles(src: string | string[], dest: string, options?: AsyncOptions): Promise<void[]> {\n const promises = toArray(src).map(src => {\n debug(`copyFiles from ${src} to ${dest}`);\n return promisify<void>(resolveOrReject => {\n if (options) {\n copy(src, dest, options, resolveOrReject);\n } else {\n copy(src, dest, resolveOrReject);\n }\n });\n });\n\n return Promise.all(promises);\n}\n"]}
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"]}
@@ -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,MAAM,CAAC,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"]}
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"]}
@@ -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,EAAE,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,eAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3C,CAAC;IAAC,IAAI,CAAC,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC,CAAC;AAEW,QAAA,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE;IAClC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC;AAEW,QAAA,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE;IACrC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC;AAEW,QAAA,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE;IAClC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEW,QAAA,GAAG,GAAG,CAAC,GAAW,EAAE,EAAE;IACjC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC;AAEW,QAAA,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE;IACnC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC;IACpD,CAAC;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"]}
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,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,eAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;KAC1C;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;KAC7B;AACH,CAAC,CAAC;AAEW,QAAA,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE;IAClC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC;AAEW,QAAA,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE;IACrC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC;AAEW,QAAA,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE;IAClC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEW,QAAA,GAAG,GAAG,CAAC,GAAW,EAAE,EAAE;IACjC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC;AAEW,QAAA,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE;IACnC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACrB,OAAO,CAAC,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"]}
@@ -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,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACV,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAED,2FAA2F;IAC3F,iEAAiE;IACjE,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzD,MAAM,CAAC,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
+ {"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,MAAM,CAAC,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,QAAQ,CAAC,CAAC,CAAC,GAAU,EAAE,KAAS,EAAQ,EAAE;YACxC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACR,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC;YAAC,IAAI,CAAC,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;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"]}
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"]}
@@ -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,MAAM,CAAC,qBAAS,CAAO,CAAC,eAAe,EAAE,EAAE;QACzC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACT,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;QAC/B,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,EAAE,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;QACzB,CAAC;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"]}
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.0.0",
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/dherges/ng-packagr.git",
20
- "homepage": "https://github.com/dherges/ng-packagr",
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/dherges/ng-packagr/issues"
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.0.0",
42
- "node-sass": "^4.5.3",
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": "^7.3.0",
45
+ "postcss-url": "^8.0.0",
46
46
  "read-pkg-up": "^4.0.0",
47
47
  "rimraf": "^2.6.1",
48
- "rollup": "^0.63.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
  }