Skip to content

Commit 23f63b4

Browse files
committed
- build
1 parent 4217346 commit 23f63b4

12 files changed

+27
-26
lines changed

dist/get-options-overrides.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as tsTypes from "typescript";
22
import { IOptions } from "./ioptions";
33
import { IContext } from "./context";
4-
export declare function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }: IOptions, preParsedTsconfig?: tsTypes.ParsedCommandLine): tsTypes.CompilerOptions;
4+
export declare function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot, cwd }: IOptions, preParsedTsconfig?: tsTypes.ParsedCommandLine): tsTypes.CompilerOptions;
55
export declare function createFilter(context: IContext, pluginOptions: IOptions, parsedConfig: tsTypes.ParsedCommandLine): any;
66
//# sourceMappingURL=get-options-overrides.d.ts.map

dist/get-options-overrides.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/host.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export declare class LanguageServiceHost implements tsTypes.LanguageServiceHost
88
private versions;
99
private service?;
1010
private fileNames;
11-
constructor(parsedConfig: tsTypes.ParsedCommandLine, transformers: TransformerFactoryCreator[]);
11+
constructor(parsedConfig: tsTypes.ParsedCommandLine, transformers: TransformerFactoryCreator[], cwd: string);
1212
reset(): void;
1313
setLanguageService(service: tsTypes.LanguageService): void;
1414
setSnapshot(fileName: string, data: string): tsTypes.IScriptSnapshot;

dist/host.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/index.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/ioptions.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface ICustomTransformer {
77
}
88
export declare type TransformerFactoryCreator = (ls: tsTypes.LanguageService) => tsTypes.CustomTransformers | ICustomTransformer;
99
export interface IOptions {
10+
cwd: string;
1011
include: string | string[];
1112
exclude: string | string[];
1213
check: boolean;

dist/ioptions.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/rollup-plugin-typescript2.cjs.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -17222,13 +17222,13 @@ function normalize(fileName) {
1722217222
}
1722317223

1722417224
class LanguageServiceHost {
17225-
constructor(parsedConfig, transformers) {
17225+
constructor(parsedConfig, transformers, cwd) {
1722617226
this.parsedConfig = parsedConfig;
1722717227
this.transformers = transformers;
17228-
this.cwd = process.cwd();
1722917228
this.snapshots = {};
1723017229
this.versions = {};
1723117230
this.fileNames = new Set(parsedConfig.fileNames);
17231+
this.cwd = cwd;
1723217232
}
1723317233
reset() {
1723417234
this.snapshots = {};
@@ -24964,7 +24964,7 @@ function printDiagnostics(context, diagnostics, pretty) {
2496424964

2496524965
// tslint:disable-next-line:no-var-requires
2496624966
const createRollupFilter = require("rollup-pluginutils").createFilter;
24967-
function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsedTsconfig) {
24967+
function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot, cwd }, preParsedTsconfig) {
2496824968
const overrides = {
2496924969
noEmitHelpers: false,
2497024970
importHelpers: true,
@@ -24982,7 +24982,7 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
2498224982
if (!declaration)
2498324983
overrides.declarationDir = undefined;
2498424984
if (declaration && !useTsconfigDeclarationDir)
24985-
overrides.declarationDir = process.cwd();
24985+
overrides.declarationDir = cwd;
2498624986
// unsetting sourceRoot if sourceMap is not enabled (in case original tsconfig had inlineSourceMap set that is being unset and would cause TS5051)
2498724987
const sourceMap = preParsedTsconfig.options.sourceMap;
2498824988
if (!sourceMap)
@@ -25024,12 +25024,12 @@ function checkTsConfig(parsedConfig) {
2502425024
}
2502525025

2502625026
function parseTsConfig(context, pluginOptions) {
25027-
const fileName = tsModule.findConfigFile(process.cwd(), tsModule.sys.fileExists, pluginOptions.tsconfig);
25027+
const fileName = tsModule.findConfigFile(pluginOptions.cwd, tsModule.sys.fileExists, pluginOptions.tsconfig);
2502825028
// if the value was provided, but no file, fail hard
2502925029
if (pluginOptions.tsconfig !== undefined && !fileName)
2503025030
throw new Error(`failed to open '${fileName}'`);
2503125031
let loadedConfig = {};
25032-
let baseDir = process.cwd();
25032+
let baseDir = pluginOptions.cwd;
2503325033
let configFileName;
2503425034
let pretty = false;
2503525035
if (fileName) {
@@ -27263,6 +27263,7 @@ const typescript = (options) => {
2726327263
transformers: [],
2726427264
tsconfigDefaults: {},
2726527265
objectHashIgnoreUnknownHack: false,
27266+
cwd: process.cwd(),
2726627267
});
2726727268
if (!pluginOptions.typescript) {
2726827269
pluginOptions.typescript = require("typescript");
@@ -27291,7 +27292,7 @@ const typescript = (options) => {
2729127292
context.info(`running in watch mode`);
2729227293
}
2729327294
filter = createFilter(context, pluginOptions, parsedConfig);
27294-
servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers);
27295+
servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers, pluginOptions.cwd);
2729527296
service = tsModule.createLanguageService(servicesHost, tsModule.createDocumentRegistry());
2729627297
servicesHost.setLanguageService(service);
2729727298
// printing compiler option errors
@@ -27455,7 +27456,7 @@ const typescript = (options) => {
2745527456
tsModule.sys.writeFile(fileName, entry.text, entry.writeByteOrderMark);
2745627457
}
2745727458
else {
27458-
const relativePath = path.relative(process.cwd(), fileName);
27459+
const relativePath = path.relative(pluginOptions.cwd, fileName);
2745927460
context.debug(() => `${safe_5("emitting declarations")} for '${key}' to '${relativePath}'`);
2746027461
this.emitFile({
2746127462
type: "asset",

dist/rollup-plugin-typescript2.cjs.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rollup-plugin-typescript2.es.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -17216,13 +17216,13 @@ function normalize(fileName) {
1721617216
}
1721717217

1721817218
class LanguageServiceHost {
17219-
constructor(parsedConfig, transformers) {
17219+
constructor(parsedConfig, transformers, cwd) {
1722017220
this.parsedConfig = parsedConfig;
1722117221
this.transformers = transformers;
17222-
this.cwd = process.cwd();
1722317222
this.snapshots = {};
1722417223
this.versions = {};
1722517224
this.fileNames = new Set(parsedConfig.fileNames);
17225+
this.cwd = cwd;
1722617226
}
1722717227
reset() {
1722817228
this.snapshots = {};
@@ -24958,7 +24958,7 @@ function printDiagnostics(context, diagnostics, pretty) {
2495824958

2495924959
// tslint:disable-next-line:no-var-requires
2496024960
const createRollupFilter = require("rollup-pluginutils").createFilter;
24961-
function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsedTsconfig) {
24961+
function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot, cwd }, preParsedTsconfig) {
2496224962
const overrides = {
2496324963
noEmitHelpers: false,
2496424964
importHelpers: true,
@@ -24976,7 +24976,7 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
2497624976
if (!declaration)
2497724977
overrides.declarationDir = undefined;
2497824978
if (declaration && !useTsconfigDeclarationDir)
24979-
overrides.declarationDir = process.cwd();
24979+
overrides.declarationDir = cwd;
2498024980
// unsetting sourceRoot if sourceMap is not enabled (in case original tsconfig had inlineSourceMap set that is being unset and would cause TS5051)
2498124981
const sourceMap = preParsedTsconfig.options.sourceMap;
2498224982
if (!sourceMap)
@@ -25018,12 +25018,12 @@ function checkTsConfig(parsedConfig) {
2501825018
}
2501925019

2502025020
function parseTsConfig(context, pluginOptions) {
25021-
const fileName = tsModule.findConfigFile(process.cwd(), tsModule.sys.fileExists, pluginOptions.tsconfig);
25021+
const fileName = tsModule.findConfigFile(pluginOptions.cwd, tsModule.sys.fileExists, pluginOptions.tsconfig);
2502225022
// if the value was provided, but no file, fail hard
2502325023
if (pluginOptions.tsconfig !== undefined && !fileName)
2502425024
throw new Error(`failed to open '${fileName}'`);
2502525025
let loadedConfig = {};
25026-
let baseDir = process.cwd();
25026+
let baseDir = pluginOptions.cwd;
2502725027
let configFileName;
2502825028
let pretty = false;
2502925029
if (fileName) {
@@ -27257,6 +27257,7 @@ const typescript = (options) => {
2725727257
transformers: [],
2725827258
tsconfigDefaults: {},
2725927259
objectHashIgnoreUnknownHack: false,
27260+
cwd: process.cwd(),
2726027261
});
2726127262
if (!pluginOptions.typescript) {
2726227263
pluginOptions.typescript = require("typescript");
@@ -27285,7 +27286,7 @@ const typescript = (options) => {
2728527286
context.info(`running in watch mode`);
2728627287
}
2728727288
filter = createFilter(context, pluginOptions, parsedConfig);
27288-
servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers);
27289+
servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers, pluginOptions.cwd);
2728927290
service = tsModule.createLanguageService(servicesHost, tsModule.createDocumentRegistry());
2729027291
servicesHost.setLanguageService(service);
2729127292
// printing compiler option errors
@@ -27449,7 +27450,7 @@ const typescript = (options) => {
2744927450
tsModule.sys.writeFile(fileName, entry.text, entry.writeByteOrderMark);
2745027451
}
2745127452
else {
27452-
const relativePath = relative(process.cwd(), fileName);
27453+
const relativePath = relative(pluginOptions.cwd, fileName);
2745327454
context.debug(() => `${safe_5("emitting declarations")} for '${key}' to '${relativePath}'`);
2745427455
this.emitFile({
2745527456
type: "asset",

dist/rollup-plugin-typescript2.es.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
359359
else
360360
{
361361
const relativePath = relative(pluginOptions.cwd, fileName);
362-
console.log('>>> DEBUG2', pluginOptions.cwd, relativePath, fileName);
363362
context.debug(() => `${blue("emitting declarations")} for '${key}' to '${relativePath}'`);
364363
this.emitFile({
365364
type: "asset",
@@ -369,7 +368,6 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
369368
}
370369
};
371370

372-
console.log('>>> DEBUG', 'declarations', declarations);
373371
_.each(declarations, ({ type, map }, key) =>
374372
{
375373
emitDeclaration(key, ".d.ts", type);

0 commit comments

Comments
 (0)