ng-packagr 13.1.3 → 13.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.
@@ -34,6 +34,7 @@ function analyseEntryPoint(graph, entryPoint, entryPoints) {
34
34
  const primaryModuleId = packageNode.data.primary.moduleId;
35
35
  (0, log_1.debug)(`Analysing sources for ${moduleId}`);
36
36
  const tsConfigOptions = {
37
+ // Needed because of `Property 'extendedDiagnostics' is incompatible with index signature.`
37
38
  ...entryPoint.data.tsConfig.options,
38
39
  skipLibCheck: true,
39
40
  noLib: true,
@@ -1 +1 @@
1
- {"version":3,"file":"analyse-sources.transform.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/analyse-sources.transform.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA4B;AAC5B,8CAAqC;AACrC,4DAA4B;AAG5B,sEAAiE;AACjE,yCAAwC;AACxC,2CAAkD;AAClD,oCAAgF;AAEnE,QAAA,uBAAuB,GAAc,IAAA,WAAI,EACpD,IAAA,eAAG,EAAC,KAAK,CAAC,EAAE;IACV,MAAM,WAAW,GAAqB,KAAK,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;IACjE,MAAM,gBAAgB,GAAqB,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;IAEvF,KAAK,MAAM,UAAU,IAAI,gBAAgB,EAAE;QACzC,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;KACnD;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,CACH,CAAC;AAEF;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,KAAiB,EAAE,UAA0B,EAAE,WAA6B;IACrG,MAAM,EAAE,WAAW,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC;IAC1F,MAAM,UAAU,GAAG,WAAW,IAAK,WAAW,CA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AM,GAAG,IAAI,WAAW,EAAE;QAC7B,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;KACvD;IAED,KAAK,MAAM,UAAU,IAAI,qBAAqB,EAAE;QAC9C,MAAM,GAAG,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAE1C,IAAI,GAAG,EAAE;YACP,IAAA,WAAK,EAAC,iCAAiC,QAAQ,OAAO,UAAU,EAAE,CAAC,CAAC;YAEpE,IAAI,QAAQ,KAAK,UAAU,EAAE;gBAC3B,MAAM,IAAI,KAAK,CAAC,eAAe,UAAU,uCAAuC,CAAC,CAAC;aACnF;YAED,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,KAAK,CAAC,CAAC,EAAE;gBACnC,MAAM,IAAI,KAAK,CAAC,eAAe,UAAU,iCAAiC,QAAQ,GAAG,CAAC,CAAC;aACxF;YAED,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;SAC3B;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,eAAe,UAAU,yBAAyB,QAAQ,kBAAkB,CAAC,CAAC;SAC/F;KACF;AACH,CAAC","sourcesContent":["import { pipe } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport ts from 'typescript';\nimport { BuildGraph } from '../../graph/build-graph';\nimport { Transform } from '../../graph/transform';\nimport { cacheCompilerHost } from '../../ts/cache-compiler-host';\nimport { debug } from '../../utils/log';\nimport { ensureUnixPath } from '../../utils/path';\nimport { EntryPointNode, PackageNode, isEntryPoint, isPackage } from '../nodes';\n\nexport const analyseSourcesTransform: Transform = pipe(\n map(graph => {\n const entryPoints: EntryPointNode[] = graph.filter(isEntryPoint);\n const dirtyEntryPoints: EntryPointNode[] = entryPoints.filter(x => x.state !== 'done');\n\n for (const entryPoint of dirtyEntryPoints) {\n analyseEntryPoint(graph, entryPoint, entryPoints);\n }\n\n return graph;\n }),\n);\n\n/**\n * Analyses an entrypoint, searching for TypeScript dependencies and additional resources (Templates and Stylesheets).\n *\n * @param graph Build graph\n * @param entryPoint Current entry point that should be analysed.\n * @param entryPoints List of all entry points.\n */\nfunction analyseEntryPoint(graph: BuildGraph, entryPoint: EntryPointNode, entryPoints: EntryPointNode[]) {\n const { oldPrograms, analysesSourcesFileCache, moduleResolutionCache } = entryPoint.cache;\n const oldProgram = oldPrograms && (oldPrograms['analysis'] as ts.Program | undefined);\n const { moduleId } = entryPoint.data.entryPoint;\n const packageNode: PackageNode = graph.find(isPackage);\n const primaryModuleId = packageNode.data.primary.moduleId;\n\n debug(`Analysing sources for ${moduleId}`);\n const tsConfigOptions: ts.CompilerOptions = {\n ...entryPoint.data.tsConfig.options,\n skipLibCheck: true,\n noLib: true,\n noEmit: true,\n types: [],\n target: ts.ScriptTarget.Latest,\n strict: false,\n };\n\n const compilerHost = cacheCompilerHost(\n graph,\n entryPoint,\n tsConfigOptions,\n moduleResolutionCache,\n undefined,\n undefined,\n analysesSourcesFileCache,\n );\n\n const potentialDependencies = new Set<string>();\n\n compilerHost.resolveTypeReferenceDirectives = (\n moduleNames: string[],\n containingFile: string,\n redirectedReference: ts.ResolvedProjectReference | undefined,\n options: ts.CompilerOptions,\n ) => {\n return moduleNames.map(moduleName => {\n if (!moduleName.startsWith('.')) {\n if (moduleName === primaryModuleId || moduleName.startsWith(`${primaryModuleId}/`)) {\n potentialDependencies.add(moduleName);\n }\n\n return undefined;\n }\n\n const result = ts.resolveTypeReferenceDirective(\n moduleName,\n ensureUnixPath(containingFile),\n options,\n compilerHost,\n redirectedReference,\n ).resolvedTypeReferenceDirective;\n\n return result;\n });\n };\n\n compilerHost.resolveModuleNames = (\n moduleNames: string[],\n containingFile: string,\n _reusedNames: string[] | undefined,\n redirectedReference: ts.ResolvedProjectReference | undefined,\n options: ts.CompilerOptions,\n ) => {\n return moduleNames.map(moduleName => {\n if (!moduleName.startsWith('.')) {\n if (moduleName === primaryModuleId || moduleName.startsWith(`${primaryModuleId}/`)) {\n potentialDependencies.add(moduleName);\n }\n\n return undefined;\n }\n\n const { resolvedModule } = ts.resolveModuleName(\n moduleName,\n ensureUnixPath(containingFile),\n options,\n compilerHost,\n moduleResolutionCache,\n redirectedReference,\n );\n\n return resolvedModule;\n });\n };\n\n const program: ts.Program = ts.createProgram(\n entryPoint.data.tsConfig.rootNames,\n tsConfigOptions,\n compilerHost,\n oldProgram,\n );\n\n debug(`tsc program structure is reused: ${oldProgram ? (oldProgram as any).structureIsReused : 'No old program'}`);\n\n entryPoint.cache.oldPrograms = { ...entryPoint.cache.oldPrograms, ['analysis']: program };\n\n const entryPointsMapped: Record<string, EntryPointNode> = {};\n for (const dep of entryPoints) {\n entryPointsMapped[dep.data.entryPoint.moduleId] = dep;\n }\n\n for (const moduleName of potentialDependencies) {\n const dep = entryPointsMapped[moduleName];\n\n if (dep) {\n debug(`Found entry point dependency: ${moduleId} -> ${moduleName}`);\n\n if (moduleId === moduleName) {\n throw new Error(`Entry point ${moduleName} has a circular dependency on itself.`);\n }\n\n if (dep.some(n => entryPoint === n)) {\n throw new Error(`Entry point ${moduleName} has a circular dependency on ${moduleId}.`);\n }\n\n entryPoint.dependsOn(dep);\n } else {\n throw new Error(`Entry point ${moduleName} which is required by ${moduleId} doesn't exists.`);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"analyse-sources.transform.js","sourceRoot":"","sources":["../../../../src/lib/ng-package/entry-point/analyse-sources.transform.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA4B;AAC5B,8CAAqC;AACrC,4DAA4B;AAG5B,sEAAiE;AACjE,yCAAwC;AACxC,2CAAkD;AAClD,oCAAgF;AAEnE,QAAA,uBAAuB,GAAc,IAAA,WAAI,EACpD,IAAA,eAAG,EAAC,KAAK,CAAC,EAAE;IACV,MAAM,WAAW,GAAqB,KAAK,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;IACjE,MAAM,gBAAgB,GAAqB,WAAW,CAAC,MAAM,CAAC,CAAC,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 'rxjs';\nimport { map } from 'rxjs/operators';\nimport ts from 'typescript';\nimport { BuildGraph } from '../../graph/build-graph';\nimport { Transform } from '../../graph/transform';\nimport { cacheCompilerHost } from '../../ts/cache-compiler-host';\nimport { debug } from '../../utils/log';\nimport { ensureUnixPath } from '../../utils/path';\nimport { EntryPointNode, PackageNode, isEntryPoint, isPackage } from '../nodes';\n\nexport const analyseSourcesTransform: Transform = pipe(\n map(graph => {\n const entryPoints: EntryPointNode[] = graph.filter(isEntryPoint);\n const dirtyEntryPoints: EntryPointNode[] = entryPoints.filter(x => x.state !== 'done');\n\n for (const entryPoint of dirtyEntryPoints) {\n analyseEntryPoint(graph, entryPoint, entryPoints);\n }\n\n return graph;\n }),\n);\n\n/**\n * Analyses an entrypoint, searching for TypeScript dependencies and additional resources (Templates and Stylesheets).\n *\n * @param graph Build graph\n * @param entryPoint Current entry point that should be analysed.\n * @param entryPoints List of all entry points.\n */\nfunction analyseEntryPoint(graph: BuildGraph, entryPoint: EntryPointNode, entryPoints: EntryPointNode[]) {\n const { oldPrograms, analysesSourcesFileCache, moduleResolutionCache } = entryPoint.cache;\n const oldProgram = oldPrograms && (oldPrograms['analysis'] as ts.Program | undefined);\n const { moduleId } = entryPoint.data.entryPoint;\n const packageNode: PackageNode = graph.find(isPackage);\n const primaryModuleId = packageNode.data.primary.moduleId;\n\n debug(`Analysing sources for ${moduleId}`);\n const tsConfigOptions: ts.CompilerOptions = {\n // Needed because of `Property 'extendedDiagnostics' is incompatible with index signature.`\n ...(entryPoint.data.tsConfig.options as ts.CompilerOptions),\n skipLibCheck: true,\n noLib: true,\n noEmit: true,\n types: [],\n target: ts.ScriptTarget.Latest,\n strict: false,\n };\n\n const compilerHost = cacheCompilerHost(\n graph,\n entryPoint,\n tsConfigOptions,\n moduleResolutionCache,\n undefined,\n undefined,\n analysesSourcesFileCache,\n );\n\n const potentialDependencies = new Set<string>();\n\n compilerHost.resolveTypeReferenceDirectives = (\n moduleNames: string[],\n containingFile: string,\n redirectedReference: ts.ResolvedProjectReference | undefined,\n options: ts.CompilerOptions,\n ) => {\n return moduleNames.map(moduleName => {\n if (!moduleName.startsWith('.')) {\n if (moduleName === primaryModuleId || moduleName.startsWith(`${primaryModuleId}/`)) {\n potentialDependencies.add(moduleName);\n }\n\n return undefined;\n }\n\n const result = ts.resolveTypeReferenceDirective(\n moduleName,\n ensureUnixPath(containingFile),\n options,\n compilerHost,\n redirectedReference,\n ).resolvedTypeReferenceDirective;\n\n return result;\n });\n };\n\n compilerHost.resolveModuleNames = (\n moduleNames: string[],\n containingFile: string,\n _reusedNames: string[] | undefined,\n redirectedReference: ts.ResolvedProjectReference | undefined,\n options: ts.CompilerOptions,\n ) => {\n return moduleNames.map(moduleName => {\n if (!moduleName.startsWith('.')) {\n if (moduleName === primaryModuleId || moduleName.startsWith(`${primaryModuleId}/`)) {\n potentialDependencies.add(moduleName);\n }\n\n return undefined;\n }\n\n const { resolvedModule } = ts.resolveModuleName(\n moduleName,\n ensureUnixPath(containingFile),\n options,\n compilerHost,\n moduleResolutionCache,\n redirectedReference,\n );\n\n return resolvedModule;\n });\n };\n\n const program: ts.Program = ts.createProgram(\n entryPoint.data.tsConfig.rootNames,\n tsConfigOptions,\n compilerHost,\n oldProgram,\n );\n\n debug(`tsc program structure is reused: ${oldProgram ? (oldProgram as any).structureIsReused : 'No old program'}`);\n\n entryPoint.cache.oldPrograms = { ...entryPoint.cache.oldPrograms, ['analysis']: program };\n\n const entryPointsMapped: Record<string, EntryPointNode> = {};\n for (const dep of entryPoints) {\n entryPointsMapped[dep.data.entryPoint.moduleId] = dep;\n }\n\n for (const moduleName of potentialDependencies) {\n const dep = entryPointsMapped[moduleName];\n\n if (dep) {\n debug(`Found entry point dependency: ${moduleId} -> ${moduleName}`);\n\n if (moduleId === moduleName) {\n throw new Error(`Entry point ${moduleName} has a circular dependency on itself.`);\n }\n\n if (dep.some(n => entryPoint === n)) {\n throw new Error(`Entry point ${moduleName} has a circular dependency on ${moduleId}.`);\n }\n\n entryPoint.dependsOn(dep);\n } else {\n throw new Error(`Entry point ${moduleName} which is required by ${moduleId} doesn't exists.`);\n }\n }\n}\n"]}
@@ -83,7 +83,7 @@ async function initializeTsConfig(defaultTsConfig, entryPoints) {
83
83
  (0, log_1.warn)('Project is attempting to disable the Ivy compiler. ' +
84
84
  'Angular versions 13 and higher do not support View Engine compiler for libraries. ' +
85
85
  'The Ivy compiler will be used to build this project. ' +
86
- '\nFor additional information or if the build fails, please see https://angular.io/guide/ivy');
86
+ '\nFor additional information or if the build fails, please see https://v12.angular.io/guide/ivy');
87
87
  defaultTsConfigParsed.options.enableIvy = true;
88
88
  defaultTsConfigParsed.options.compilationMode = 'partial';
89
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../src/lib/ts/tsconfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,4DAA4B;AAE5B,kDAAoC;AACpC,sCAAoC;AACpC,8DAAyD;AAE5C,QAAA,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC;AACrF;;GAEG;AACH,KAAK,UAAU,mBAAmB,CAAC,QAAQ,GAAG,2BAAmB;IAC/D,8BAA8B;IAC9B,MAAM,YAAY,GAAoB;QACpC,gBAAgB,EAAE,oBAAE,CAAC,oBAAoB,CAAC,MAAM;QAChD,MAAM,EAAE,oBAAE,CAAC,YAAY,CAAC,MAAM;QAC9B,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;IAEF,MAAM,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AAC;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,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC;SACzD;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAzBD,oEAyBC","sourcesContent":["import type { CompilerOptions, ParsedConfiguration } from '@angular/compiler-cli';\nimport * as path from 'path';\nimport ts from 'typescript';\nimport { EntryPointNode } from '../ng-package/nodes';\nimport * as log from '../utils/log';\nimport { warn } from '../utils/log';\nimport { ngCompilerCli } from '../utils/ng-compiler-cli';\n\nexport const defaultTsConfigPath = path.join(__dirname, 'conf', 'tsconfig.ngc.json');\n/**\n * Reads the default TypeScript configuration.\n */\nasync function readDefaultTsConfig(fileName = defaultTsConfigPath): Promise<ParsedConfiguration> {\n // these options are mandatory\n const extraOptions: CompilerOptions = {\n moduleResolution: ts.ModuleResolutionKind.NodeJs,\n target: ts.ScriptTarget.ES2020,\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 const { readConfiguration } = await ngCompilerCli();\n\n return readConfiguration(fileName, extraOptions);\n}\n\n/**\n * Creates a parsed TypeScript configuration object.\n *\n * @param values File path or parsed configuration.\n */\nasync function createDefaultTsConfig(values?: ParsedConfiguration | string): Promise<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 async function initializeTsConfig(\n defaultTsConfig: ParsedConfiguration | string | undefined,\n entryPoints: EntryPointNode[],\n): Promise<void> {\n const defaultTsConfigParsed = await createDefaultTsConfig(defaultTsConfig);\n if (defaultTsConfigParsed.errors.length > 0) {\n const { formatDiagnostics } = await ngCompilerCli();\n throw new Error(formatDiagnostics(defaultTsConfigParsed.errors));\n }\n\n if (defaultTsConfigParsed.options.enableIvy === false) {\n warn(\n 'Project is attempting to disable the Ivy compiler. ' +\n 'Angular versions 13 and higher do not support View Engine compiler for libraries. ' +\n 'The Ivy compiler will be used to build this project. ' +\n '\\nFor additional information or if the build fails, please see https://angular.io/guide/ivy',\n );\n\n defaultTsConfigParsed.options.enableIvy = true;\n defaultTsConfigParsed.options.compilationMode = 'partial';\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 const tsConfig: ParsedConfiguration = JSON.parse(JSON.stringify(defaultTsConfigParsed));\n const overrideOptions: CompilerOptions = {\n flatModuleId: entryPoint.moduleId,\n flatModuleOutFile: `${entryPoint.flatModuleFile}.js`,\n basePath,\n rootDir: basePath,\n sourceRoot: '',\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: ParsedConfiguration,\n entryPoints: EntryPointNode[],\n pointToSource = false,\n): ParsedConfiguration {\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 (const 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].unshift(...mappedPath);\n }\n }\n\n return tsConfig;\n}\n"]}
1
+ {"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../src/lib/ts/tsconfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,4DAA4B;AAE5B,kDAAoC;AACpC,sCAAoC;AACpC,8DAAyD;AAE5C,QAAA,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC;AACrF;;GAEG;AACH,KAAK,UAAU,mBAAmB,CAAC,QAAQ,GAAG,2BAAmB;IAC/D,8BAA8B;IAC9B,MAAM,YAAY,GAAoB;QACpC,gBAAgB,EAAE,oBAAE,CAAC,oBAAoB,CAAC,MAAM;QAChD,MAAM,EAAE,oBAAE,CAAC,YAAY,CAAC,MAAM;QAC9B,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;IAEF,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,IAAA,+BAAa,GAAE,CAAC;IAEpD,OAAO,iBAAiB,CAAC,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,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;SAC/C;aAAM;YACL,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC;SACzD;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAzBD,oEAyBC","sourcesContent":["import type { CompilerOptions, ParsedConfiguration } from '@angular/compiler-cli';\nimport * as path from 'path';\nimport ts from 'typescript';\nimport { EntryPointNode } from '../ng-package/nodes';\nimport * as log from '../utils/log';\nimport { warn } from '../utils/log';\nimport { ngCompilerCli } from '../utils/ng-compiler-cli';\n\nexport const defaultTsConfigPath = path.join(__dirname, 'conf', 'tsconfig.ngc.json');\n/**\n * Reads the default TypeScript configuration.\n */\nasync function readDefaultTsConfig(fileName = defaultTsConfigPath): Promise<ParsedConfiguration> {\n // these options are mandatory\n const extraOptions: CompilerOptions = {\n moduleResolution: ts.ModuleResolutionKind.NodeJs,\n target: ts.ScriptTarget.ES2020,\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 const { readConfiguration } = await ngCompilerCli();\n\n return readConfiguration(fileName, extraOptions);\n}\n\n/**\n * Creates a parsed TypeScript configuration object.\n *\n * @param values File path or parsed configuration.\n */\nasync function createDefaultTsConfig(values?: ParsedConfiguration | string): Promise<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 async function initializeTsConfig(\n defaultTsConfig: ParsedConfiguration | string | undefined,\n entryPoints: EntryPointNode[],\n): Promise<void> {\n const defaultTsConfigParsed = await createDefaultTsConfig(defaultTsConfig);\n if (defaultTsConfigParsed.errors.length > 0) {\n const { formatDiagnostics } = await ngCompilerCli();\n throw new Error(formatDiagnostics(defaultTsConfigParsed.errors));\n }\n\n if (defaultTsConfigParsed.options.enableIvy === false) {\n warn(\n 'Project is attempting to disable the Ivy compiler. ' +\n 'Angular versions 13 and higher do not support View Engine compiler for libraries. ' +\n 'The Ivy compiler will be used to build this project. ' +\n '\\nFor additional information or if the build fails, please see https://v12.angular.io/guide/ivy',\n );\n\n defaultTsConfigParsed.options.enableIvy = true;\n defaultTsConfigParsed.options.compilationMode = 'partial';\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 const tsConfig: ParsedConfiguration = JSON.parse(JSON.stringify(defaultTsConfigParsed));\n const overrideOptions: CompilerOptions = {\n flatModuleId: entryPoint.moduleId,\n flatModuleOutFile: `${entryPoint.flatModuleFile}.js`,\n basePath,\n rootDir: basePath,\n sourceRoot: '',\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: ParsedConfiguration,\n entryPoints: EntryPointNode[],\n pointToSource = false,\n): ParsedConfiguration {\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 (const 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].unshift(...mappedPath);\n }\n }\n\n return tsConfig;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-packagr",
3
- "version": "13.1.3",
3
+ "version": "13.2.0",
4
4
  "description": "Compile and package Angular libraries in Angular Package Format (APF)",
5
5
  "keywords": [
6
6
  "apf",
@@ -18,7 +18,10 @@
18
18
  },
19
19
  "author": "David Herges <david@spektrakel.de>",
20
20
  "license": "MIT",
21
- "repository": "https://github.com/ng-packagr/ng-packagr.git",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/ng-packagr/ng-packagr.git"
24
+ },
22
25
  "homepage": "https://github.com/ng-packagr/ng-packagr",
23
26
  "bugs": {
24
27
  "url": "https://github.com/ng-packagr/ng-packagr/issues"
@@ -50,7 +53,7 @@
50
53
  "postcss-url": "^10.1.1",
51
54
  "rollup": "^2.45.1",
52
55
  "rollup-plugin-sourcemaps": "^0.6.3",
53
- "rxjs": "^6.5.0",
56
+ "rxjs": "^7.0.0",
54
57
  "sass": "^1.32.8",
55
58
  "stylus": "^0.56.0"
56
59
  },