Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issues with emitting declarationMap #1664

Merged
merged 1 commit into from Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration/samples/typings/src/nested/reference/index.ts
@@ -1,3 +1,3 @@
/// <reference path="./mocked.d.ts" />
/// <reference path="./mocked.ts" />

export const faz: Mocked = { foo: 'bar' };
2 changes: 1 addition & 1 deletion integration/samples/typings/src/validator.ts
@@ -1,4 +1,4 @@
/// <reference path="./chalk.d.ts" />
/// <reference path="./chalk.ts" />
import * as chalk from 'chalk';

export { chalk };
4 changes: 2 additions & 2 deletions src/lib/ng-package/entry-point/compile-ngc.transform.ts
Expand Up @@ -8,7 +8,7 @@ import * as log from '../../utils/log';
import { isEntryPointInProgress, EntryPointNode, isEntryPoint } from '../nodes';
import { StylesheetProcessor } from '../../styles/stylesheet-processor';

export const compileNgcTransform: Transform = transformFromPromise(async (graph) => {
export const compileNgcTransform: Transform = transformFromPromise(async graph => {
log.info(`Compiling TypeScript sources through ngc`);
const entryPoint = graph.find(isEntryPointInProgress()) as EntryPointNode;
const entryPoints = graph.filter(isEntryPoint) as EntryPointNode[];
Expand All @@ -30,10 +30,10 @@ export const compileNgcTransform: Transform = transformFromPromise(async (graph)
stylesheetProcessor,
{
outDir: path.dirname(esm2015),
declarationDir: path.dirname(declarations),
declaration: true,
target: ts.ScriptTarget.ES2015,
},
path.dirname(declarations),
ngccProcessor,
);

Expand Down
5 changes: 0 additions & 5 deletions src/lib/ngc/compile-source-files.ts
@@ -1,7 +1,6 @@
import * as ng from '@angular/compiler-cli';
import * as ts from 'typescript';
import * as log from '../utils/log';
import { redirectWriteFileCompilerHost } from '../ts/redirect-write-file-compiler-host';
import { cacheCompilerHost } from '../ts/cache-compiler-host';
import { StylesheetProcessor } from '../styles/stylesheet-processor';
import { BuildGraph } from '../graph/build-graph';
Expand All @@ -16,7 +15,6 @@ export async function compileSourceFiles(
moduleResolutionCache: ts.ModuleResolutionCache,
stylesheetProcessor: StylesheetProcessor,
extraOptions?: Partial<ng.CompilerOptions>,
declarationDir?: string,
ngccProcessor?: NgccProcessor,
) {
log.debug(`ngc (v${ng.VERSION.full})`);
Expand All @@ -31,9 +29,6 @@ export async function compileSourceFiles(
moduleResolutionCache,
stylesheetProcessor,
);
if (declarationDir) {
tsCompilerHost = redirectWriteFileCompilerHost(tsCompilerHost, tsConfigOptions.basePath, declarationDir);
}

if (tsConfigOptions.enableIvy && ngccProcessor) {
tsCompilerHost = ngccTransformCompilerHost(tsCompilerHost, tsConfigOptions, ngccProcessor, moduleResolutionCache);
Expand Down
33 changes: 0 additions & 33 deletions src/lib/ts/redirect-write-file-compiler-host.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/lib/ts/tsconfig.ts
Expand Up @@ -87,7 +87,6 @@ export const initializeTsConfig = (defaultTsConfig: ng.ParsedConfiguration, entr
flatModuleOutFile: `${entryPoint.flatModuleFile}.js`,
basePath,
rootDir: basePath,
declarationDir: basePath,
};

tsConfig.rootNames = [entryPoint.entryFilePath];
Expand Down