Skip to content

Commit 42080b3

Browse files
committed
Merge pull request #687 from TypeStrong/bump-tsconfig
Update to latest `tsconfig`
2 parents 3ea6707 + a528653 commit 42080b3

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

dist/main/tsconfig/tsconfig.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ var path = require('path');
6565
var tsconfig = require('tsconfig');
6666
var os = require('os');
6767
var detectIndent = require('detect-indent');
68-
var extend = require('xtend');
6968
var formatting = require('./formatting');
7069
var projectFileName = 'tsconfig.json';
7170
var defaultFilesGlob = [
@@ -202,17 +201,13 @@ function getProjectSync(pathOrSrcFile) {
202201
throw new Error(exports.errors.GET_PROJECT_FAILED_TO_OPEN_PROJECT_FILE);
203202
}
204203
try {
205-
projectSpec = tsconfig.parseFileSync(projectFileTextContent, projectFile);
204+
projectSpec = tsconfig.parseFileSync(projectFileTextContent, projectFile, { resolvePaths: false });
206205
}
207206
catch (ex) {
208207
throw errorWithDetails(new Error(exports.errors.GET_PROJECT_JSON_PARSE_FAILED), { projectFilePath: fsu.consistentPath(projectFile), error: ex.message });
209208
}
210209
if (projectSpec.filesGlob) {
211-
var relativeProjectSpec = extend(projectSpec, {
212-
files: projectSpec.files.map(function (x) { return fsu.consistentPath(path.relative(projectFileDirectory, x)); }),
213-
exclude: projectSpec.exclude.map(function (x) { return fsu.consistentPath(path.relative(projectFileDirectory, x)); })
214-
});
215-
var prettyJSONProjectSpec = prettyJSON(relativeProjectSpec, detectIndent(projectFileTextContent).indent);
210+
var prettyJSONProjectSpec = prettyJSON(projectSpec, detectIndent(projectFileTextContent).indent);
216211
if (prettyJSONProjectSpec !== projectFileTextContent) {
217212
fs.writeFileSync(projectFile, prettyJSONProjectSpec);
218213
}
@@ -235,7 +230,7 @@ function getProjectSync(pathOrSrcFile) {
235230
}
236231
var project = {
237232
compilerOptions: {},
238-
files: projectSpec.files,
233+
files: projectSpec.files.map(function (x) { return path.resolve(projectFileDirectory, x); }),
239234
filesGlob: projectSpec.filesGlob,
240235
formatCodeOptions: formatting.makeFormatCodeOptions(projectSpec.formatCodeOptions),
241236
compileOnSave: projectSpec.compileOnSave == undefined ? true : projectSpec.compileOnSave,

lib/main/tsconfig/tsconfig.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,19 +377,14 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
377377
}
378378

379379
try {
380-
projectSpec = tsconfig.parseFileSync(projectFileTextContent, projectFile);
380+
projectSpec = tsconfig.parseFileSync(projectFileTextContent, projectFile, { resolvePaths: false });
381381
} catch (ex) {
382382
throw errorWithDetails<GET_PROJECT_JSON_PARSE_FAILED_Details>(
383383
new Error(errors.GET_PROJECT_JSON_PARSE_FAILED), { projectFilePath: fsu.consistentPath(projectFile), error: ex.message });
384384
}
385385

386386
if (projectSpec.filesGlob) { // for filesGlob we keep the files in sync
387-
var relativeProjectSpec = extend(projectSpec, {
388-
files: projectSpec.files.map(x => fsu.consistentPath(path.relative(projectFileDirectory, x))),
389-
exclude: projectSpec.exclude.map(x => fsu.consistentPath(path.relative(projectFileDirectory, x)))
390-
});
391-
392-
var prettyJSONProjectSpec = prettyJSON(relativeProjectSpec, detectIndent(projectFileTextContent).indent);
387+
var prettyJSONProjectSpec = prettyJSON(projectSpec, detectIndent(projectFileTextContent).indent);
393388

394389
if (prettyJSONProjectSpec !== projectFileTextContent) {
395390
fs.writeFileSync(projectFile, prettyJSONProjectSpec);
@@ -416,7 +411,7 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
416411

417412
var project: TypeScriptProjectSpecification = {
418413
compilerOptions: {},
419-
files: projectSpec.files,
414+
files: projectSpec.files.map(x => path.resolve(projectFileDirectory, x)),
420415
filesGlob: projectSpec.filesGlob,
421416
formatCodeOptions: formatting.makeFormatCodeOptions(projectSpec.formatCodeOptions),
422417
compileOnSave: projectSpec.compileOnSave == undefined ? true : projectSpec.compileOnSave,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"ntypescript": "1.201510270605.1",
5858
"react": "^0.13.3",
5959
"season": "^5.1.4",
60-
"tsconfig": "^2.0.1",
60+
"tsconfig": "^2.1.0",
6161
"xtend": "^4.0.0"
6262
},
6363
"devDependencies": {},

0 commit comments

Comments
 (0)