Skip to content

Commit 8a8ed0a

Browse files
committed
update implementation based on the results of design meeting
1 parent 2b2b150 commit 8a8ed0a

149 files changed

Lines changed: 2583 additions & 3058 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/compiler/commandLineParser.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ namespace ts {
256256
type: {
257257
"node": ModuleResolutionKind.NodeJs,
258258
"classic": ModuleResolutionKind.Classic,
259-
// name is lowercased so we can still use hasProperty(userValue.toLower()) to check if user has entered the right value
260-
"baseurl": ModuleResolutionKind.BaseUrl,
261259
},
262260
description: Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
263261
error: Diagnostics.Argument_for_moduleResolution_option_must_be_node_classic_or_baseUrl,
@@ -529,8 +527,6 @@ namespace ts {
529527
const { options: optionsFromJsonConfigFile, errors } = convertCompilerOptionsFromJson(json["compilerOptions"], basePath, configFileName);
530528

531529
const options = extend(existingOptions, optionsFromJsonConfigFile);
532-
// set basePath as inferredBaseUrl so baseUrl module resolution strategy can still work even if user have not specified baseUrl explicity
533-
options.inferredBaseUrl = basePath;
534530

535531
return {
536532
options,

src/compiler/diagnosticMessages.json

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@
21592159
"category": "Error",
21602160
"code": 5059
21612161
},
2162-
"Option '{0}' can only be used when option 'moduleResolution' is 'baseUrl'.": {
2162+
"Option 'paths' cannot be used without specifying '--baseUrl' option.": {
21632163
"category": "Error",
21642164
"code": 5060
21652165
},
@@ -2171,14 +2171,6 @@
21712171
"category": "Error",
21722172
"code": 5062
21732173
},
2174-
"'moduleResolution' kind 'baseUrl' cannot be used without specifying '--baseUrl' option.": {
2175-
"category": "Error",
2176-
"code": 5063
2177-
},
2178-
"Module resolution kind cannot be determined automatically. Please specify module resolution explicitly via 'moduleResolution' option.": {
2179-
"category": "Error",
2180-
"code": 5064
2181-
},
21822174
"Concatenate and emit output to single file.": {
21832175
"category": "Message",
21842176
"code": 6001
@@ -2479,101 +2471,93 @@
24792471
"category": "Message",
24802472
"code": 6090
24812473
},
2482-
"Resolving rooted module name '{0}' - use it as a candidate location.": {
2474+
"'paths' option is specified, looking for a pattern to match module name '{0}'.": {
24832475
"category": "Message",
24842476
"code": 6091
24852477
},
2486-
"Resolving relative module name '{0}'.": {
2478+
"Module name '{0}', matched pattern '{1}'.": {
24872479
"category": "Message",
24882480
"code": 6092
24892481
},
2490-
"Resolving non-relative module name '{0}'.": {
2482+
"Trying substitution '{0}', candidate module location: '{1}'.": {
24912483
"category": "Message",
24922484
"code": 6093
24932485
},
2494-
"Converting relative module name '{0}' to absolute using '{1}' as a base directory => '{2}'.": {
2486+
"Resolving module name '{0}' relative to base url '{1}' - '{2}'.": {
24952487
"category": "Message",
24962488
"code": 6094
24972489
},
2498-
"'rootDirs' option is specified, searching for a longest matching prefix...": {
2490+
"Loading module as file / folder, candidate module location '{0}'.": {
24992491
"category": "Message",
25002492
"code": 6095
25012493
},
2502-
"Found longest matching rootDir '{0}', 'converted relative path '{1}', to non-relative path '{2}'": {
2494+
"File '{0}' does not exist.": {
25032495
"category": "Message",
25042496
"code": 6096
25052497
},
2506-
"'rootDirs' option is not specified, using '{0}' as candidate location.": {
2498+
"File '{0}' exist - use it as a module resolution result.": {
25072499
"category": "Message",
25082500
"code": 6097
25092501
},
2510-
"'paths' option is specified, looking for a pattern to match module name '{0}'.": {
2502+
"Loading module '{0}' from 'node_modules' folder.": {
25112503
"category": "Message",
25122504
"code": 6098
25132505
},
2514-
"Module name '{0}', matched pattern '{1}'.": {
2506+
"Found 'package.json' at '{0}'.": {
25152507
"category": "Message",
25162508
"code": 6099
25172509
},
2518-
"Trying substitution '{0}', candidate module location: '{1}'.": {
2510+
"'package.json' does not have 'typings' field.": {
25192511
"category": "Message",
25202512
"code": 6100
25212513
},
2522-
"Resolving module name '{0}' relative to base url '{1}' - '{2}'.": {
2514+
"'package.json' has 'typings' field '{0}' that references '{1}'.": {
25232515
"category": "Message",
25242516
"code": 6101
25252517
},
2526-
"Loading module '{0}' as file / folder, candidate module location '{1}'.": {
2518+
"Module name '{0}' contains '!' character.": {
25272519
"category": "Message",
25282520
"code": 6102
25292521
},
2530-
"File '{0}' does not exist.": {
2522+
"Allow javascript files to be compiled.": {
25312523
"category": "Message",
25322524
"code": 6103
25332525
},
2534-
"File '{0}' exist - use it as a module resolution result.": {
2535-
"category": "Message",
2526+
"Option '{0}' should have array of strings as a value.": {
2527+
"category": "Error",
25362528
"code": 6104
25372529
},
2538-
"Loading module '{0}' from 'node_modules' folder.": {
2530+
"Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'.": {
25392531
"category": "Message",
25402532
"code": 6105
25412533
},
2542-
"Found 'package.json' at '{0}'.": {
2534+
"Expected type of 'typings' field in 'package.json' to be 'string', got '{0}'.": {
25432535
"category": "Message",
25442536
"code": 6106
25452537
},
2546-
"'package.json' does not have 'typings' field.": {
2538+
"'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'": {
25472539
"category": "Message",
25482540
"code": 6107
25492541
},
2550-
"'package.json' has 'typings' field '{0}' that references '{1}'.": {
2542+
"'rootDirs' option is set, using it to resolve relative module name '{0}'": {
25512543
"category": "Message",
25522544
"code": 6108
25532545
},
2554-
"Module name '{0}' contains '!' character.": {
2546+
"Longest matching prefix for '{0}' is '{1}'": {
25552547
"category": "Message",
25562548
"code": 6109
25572549
},
2558-
"Allow javascript files to be compiled.": {
2550+
"Loading '{0}' from the root dir '{1}', candidate location '{2}'": {
25592551
"category": "Message",
25602552
"code": 6110
25612553
},
2562-
"Base url: '{0}'.": {
2554+
"Trying other entries in 'rootDirs'": {
25632555
"category": "Message",
25642556
"code": 6111
25652557
},
2566-
"Option '{0}' should have array of strings as a value.": {
2567-
"category": "Error",
2568-
"code": 6112
2569-
},
2570-
"Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'.": {
2558+
"Module resolution using 'rootDirs' has failed": {
25712559
"category": "Message",
2572-
"code": 6113
2573-
},
2574-
"Expected type of 'typings' field in 'package.json' to be 'string', got '{0}'.": {
2575-
"category": "Message",
2576-
"code": 6114
2560+
"code": 6112
25772561
},
25782562
"Variable '{0}' implicitly has an '{1}' type.": {
25792563
"category": "Error",

0 commit comments

Comments
 (0)