Skip to content

Commit 1b82f38

Browse files
committed
Merge branch 'main' into remove-lint-type-checking
2 parents ea08526 + 0993c01 commit 1b82f38

File tree

7 files changed

+87
-40
lines changed

7 files changed

+87
-40
lines changed

Herebyfile.mjs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ function entrypointBuildTask(options) {
320320
const outDir = path.dirname(options.output);
321321
await fs.promises.mkdir(outDir, { recursive: true });
322322
const moduleSpecifier = path.relative(outDir, options.builtEntrypoint);
323-
await fs.promises.writeFile(options.output, `module.exports = require("./${moduleSpecifier}")`);
323+
await fs.promises.writeFile(options.output, `module.exports = require("./${moduleSpecifier.replace(/[\\/]/g, "/")}")`);
324324
},
325325
});
326326

@@ -354,7 +354,7 @@ function entrypointBuildTask(options) {
354354
}
355355

356356

357-
const { main: tsc, watch: watchTsc } = entrypointBuildTask({
357+
const { main: tsc, build: buildTsc, watch: watchTsc } = entrypointBuildTask({
358358
name: "tsc",
359359
description: "Builds the command-line compiler",
360360
buildDeps: [generateDiagnostics],
@@ -392,7 +392,7 @@ export const dtsServices = task({
392392
});
393393

394394

395-
const { main: tsserver, watch: watchTsserver } = entrypointBuildTask({
395+
const { main: tsserver, build: buildTsserver, watch: watchTsserver } = entrypointBuildTask({
396396
name: "tsserver",
397397
description: "Builds the language server",
398398
buildDeps: [generateDiagnostics],
@@ -410,10 +410,15 @@ const { main: tsserver, watch: watchTsserver } = entrypointBuildTask({
410410
export { tsserver, watchTsserver };
411411

412412

413+
const buildMin = task({
414+
name: "build-min",
415+
dependencies: [buildTsc, buildTsserver],
416+
});
417+
413418
export const min = task({
414419
name: "min",
415420
description: "Builds only tsc and tsserver",
416-
dependencies: [tsc, tsserver],
421+
dependencies: [tsc, tsserver].concat(cmdLineOptions.typecheck ? [buildMin] : []),
417422
});
418423

419424
export const watchMin = task({
@@ -577,10 +582,15 @@ export const watchOtherOutputs = task({
577582
dependencies: [watchCancellationToken, watchTypingsInstaller, watchWatchGuard, generateTypesMap, copyBuiltLocalDiagnosticMessages],
578583
});
579584

585+
const buildLocal = task({
586+
name: "build-local",
587+
dependencies: [buildTsc, buildTsserver, buildServices, buildLssl]
588+
});
589+
580590
export const local = task({
581591
name: "local",
582592
description: "Builds the full compiler and services",
583-
dependencies: [localize, tsc, tsserver, services, lssl, otherOutputs, dts, buildSrc],
593+
dependencies: [localize, tsc, tsserver, services, lssl, otherOutputs, dts].concat(cmdLineOptions.typecheck ? [buildLocal] : []),
584594
});
585595
export default local;
586596

@@ -591,11 +601,12 @@ export const watchLocal = task({
591601
dependencies: [localize, watchTsc, watchTsserver, watchServices, watchLssl, watchOtherOutputs, dts, watchSrc],
592602
});
593603

604+
const runtestsDeps = [tests, generateLibs].concat(cmdLineOptions.typecheck ? [dts, buildSrc] : []);
594605

595606
export const runTests = task({
596607
name: "runtests",
597608
description: "Runs the tests using the built run.js file.",
598-
dependencies: [tests, generateLibs, dts, buildSrc],
609+
dependencies: runtestsDeps,
599610
run: () => runConsoleTests(testRunner, "mocha-fivemat-progress-reporter", /*runInParallel*/ false),
600611
});
601612
// task("runtests").flags = {
@@ -617,7 +628,7 @@ export const runTests = task({
617628
export const runTestsParallel = task({
618629
name: "runtests-parallel",
619630
description: "Runs all the tests in parallel using the built run.js file.",
620-
dependencies: [tests, generateLibs, dts, buildSrc],
631+
dependencies: runtestsDeps,
621632
run: () => runConsoleTests(testRunner, "min", /*runInParallel*/ cmdLineOptions.workers > 1),
622633
});
623634
// task("runtests-parallel").flags = {

scripts/build/options.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import os from "os";
44
const ci = ["1", "true"].includes(process.env.CI ?? "");
55

66
const parsed = minimist(process.argv.slice(2), {
7-
boolean: ["dirty", "light", "colors", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built", "ci", "bundle"],
7+
boolean: ["dirty", "light", "colors", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built", "ci", "bundle", "typecheck"],
88
string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
99
alias: {
1010
/* eslint-disable quote-props */
@@ -39,7 +39,8 @@ const parsed = minimist(process.argv.slice(2), {
3939
dirty: false,
4040
built: false,
4141
ci,
42-
bundle: true
42+
bundle: true,
43+
typecheck: true,
4344
}
4445
});
4546

@@ -80,5 +81,6 @@ export default options;
8081
* @property {string} shardId
8182
* @property {string} break
8283
* @property {boolean} bundle
84+
* @property {boolean} typecheck
8385
*/
8486
void 0;

scripts/eslint/rules/jsdoc-format.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ module.exports = createRule({
172172
TSIndexSignature: checkDeclaration,
173173
TSMethodSignature: checkDeclaration,
174174
TSParameterProperty: checkDeclaration,
175+
PropertyDefinition: checkDeclaration,
176+
MethodDefinition: checkDeclaration,
175177
};
176178
},
177179
});

src/server/editorServices.ts

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,9 @@ export class ProjectService {
718718

719719
/**
720720
* Container of all known scripts
721+
*
722+
* @internal
721723
*/
722-
/** @internal */
723724
readonly filenameToScriptInfo = new Map<string, ScriptInfo>();
724725
private readonly nodeModulesWatchers = new Map<string, NodeModulesWatcher>();
725726
/**
@@ -733,8 +734,9 @@ export class ProjectService {
733734

734735
/**
735736
* Map to the real path of the infos
737+
*
738+
* @internal
736739
*/
737-
/** @internal */
738740
readonly realpathToScriptInfos: MultiMap<Path, ScriptInfo> | undefined;
739741
/**
740742
* maps external project file name to list of config files that were the part of this project
@@ -786,8 +788,11 @@ export class ProjectService {
786788
* In this case the exists could be true/false based on config file is present or not
787789
* - Or it is present if we have configured project open with config file at that location
788790
* In this case the exists property is always true
791+
*
792+
*
793+
* @internal
789794
*/
790-
/** @internal */ readonly configFileExistenceInfoCache = new Map<NormalizedPath, ConfigFileExistenceInfo>();
795+
readonly configFileExistenceInfoCache = new Map<NormalizedPath, ConfigFileExistenceInfo>();
791796
/** @internal */ readonly throttledOperations: ThrottledOperations;
792797

793798
private readonly hostConfiguration: HostConfiguration;
@@ -1344,8 +1349,9 @@ export class ProjectService {
13441349

13451350
/**
13461351
* This is to watch whenever files are added or removed to the wildcard directories
1352+
*
1353+
* @internal
13471354
*/
1348-
/** @internal */
13491355
private watchWildcardDirectory(directory: Path, flags: WatchDirectoryFlags, configFileName: NormalizedPath, config: ParsedConfig) {
13501356
return this.watchFactory.watchDirectory(
13511357
directory,
@@ -1774,8 +1780,9 @@ export class ProjectService {
17741780
/**
17751781
* Close the config file watcher in the cached ConfigFileExistenceInfo
17761782
* if there arent any open files that are root of inferred project and there is no parsed config held by any project
1783+
*
1784+
* @internal
17771785
*/
1778-
/** @internal */
17791786
private closeConfigFileWatcherOnReleaseOfOpenFile(configFileExistenceInfo: ConfigFileExistenceInfo) {
17801787
// Close the config file watcher if there are no more open files that are root of inferred project
17811788
// or if there are no projects that need to watch this config file existence info
@@ -1822,8 +1829,9 @@ export class ProjectService {
18221829

18231830
/**
18241831
* This is called by inferred project whenever script info is added as a root
1832+
*
1833+
* @internal
18251834
*/
1826-
/** @internal */
18271835
startWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo) {
18281836
Debug.assert(info.isScriptOpen());
18291837
this.forEachConfigFileLocation(info, (canonicalConfigFilePath, configFileName) => {
@@ -1852,8 +1860,9 @@ export class ProjectService {
18521860

18531861
/**
18541862
* This is called by inferred project whenever root script info is removed from it
1863+
*
1864+
* @internal
18551865
*/
1856-
/** @internal */
18571866
stopWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo) {
18581867
this.forEachConfigFileLocation(info, canonicalConfigFilePath => {
18591868
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
@@ -2168,8 +2177,9 @@ export class ProjectService {
21682177

21692178
/**
21702179
* Read the config file of the project, and update the project root file names.
2180+
*
2181+
* @internal
21712182
*/
2172-
/** @internal */
21732183
private loadConfiguredProject(project: ConfiguredProject, reason: string) {
21742184
tracing?.push(tracing.Phase.Session, "loadConfiguredProject", { configFilePath: project.canonicalConfigFilePath });
21752185
this.sendProjectLoadingStartEvent(project, reason);
@@ -2434,8 +2444,9 @@ export class ProjectService {
24342444

24352445
/**
24362446
* Reload the file names from config file specs and update the project graph
2447+
*
2448+
* @internal
24372449
*/
2438-
/** @internal */
24392450
reloadFileNamesOfConfiguredProject(project: ConfiguredProject) {
24402451
const fileNames = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath)!.config!);
24412452
project.updateErrorOnNoInputFiles(fileNames);
@@ -2466,8 +2477,9 @@ export class ProjectService {
24662477

24672478
/**
24682479
* Read the config file of the project again by clearing the cache and update the project graph
2480+
*
2481+
* @internal
24692482
*/
2470-
/** @internal */
24712483
reloadConfiguredProject(project: ConfiguredProject, reason: string, isInitialLoad: boolean, clearSemanticCache: boolean) {
24722484
// At this point, there is no reason to not have configFile in the host
24732485
const host = project.getCachedDirectoryStructureHost();
@@ -2632,8 +2644,9 @@ export class ProjectService {
26322644
/**
26332645
* Returns the projects that contain script info through SymLink
26342646
* Note that this does not return projects in info.containingProjects
2647+
*
2648+
* @internal
26352649
*/
2636-
/** @internal */
26372650
getSymlinkedProjects(info: ScriptInfo): MultiMap<Path, Project> | undefined {
26382651
let projects: MultiMap<Path, Project> | undefined;
26392652
if (this.realpathToScriptInfos) {
@@ -4149,8 +4162,9 @@ export class ProjectService {
41494162

41504163
/**
41514164
* Waits for any ongoing plugin enablement requests to complete.
4165+
*
4166+
* @internal
41524167
*/
4153-
/** @internal */
41544168
async waitForPendingPlugins() {
41554169
while (this.currentPluginEnablementPromise) {
41564170
await this.currentPluginEnablementPromise;
@@ -4159,8 +4173,9 @@ export class ProjectService {
41594173

41604174
/**
41614175
* Starts enabling any requested plugins without waiting for the result.
4176+
*
4177+
* @internal
41624178
*/
4163-
/** @internal */
41644179
enableRequestedPlugins() {
41654180
if (this.pendingPluginEnablements) {
41664181
void this.enableRequestedPluginsAsync();

src/server/project.ts

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,15 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
175175
private missingFilesMap: ESMap<Path, FileWatcher> | undefined;
176176
private generatedFilesMap: GeneratedFileWatcherMap | undefined;
177177

178-
/*@internal*/
178+
/** @internal */
179179
protected readonly plugins: PluginModuleWithName[] = [];
180180

181-
/** @internal */
182181
/**
183182
* This is map from files to unresolved imports in it
184183
* Maop does not contain entries for files that do not have unresolved imports
185184
* This helps in containing the set of files to invalidate
185+
*
186+
* @internal
186187
*/
187188
cachedUnresolvedImportsPerFile = new Map<Path, readonly string[]>();
188189

@@ -1642,7 +1643,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
16421643
return !!this.program && this.program.isSourceOfProjectReferenceRedirect(fileName);
16431644
}
16441645

1645-
/*@internal*/
1646+
/** @internal */
16461647
protected getGlobalPluginSearchPaths() {
16471648
// Search any globally-specified probe paths, then our peer node_modules
16481649
return [
@@ -1679,8 +1680,9 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
16791680

16801681
/**
16811682
* Performs the initial steps of enabling a plugin by finding and instantiating the module for a plugin synchronously using 'require'.
1683+
*
1684+
* @internal
16821685
*/
1683-
/** @internal */
16841686
beginEnablePluginSync(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): BeginEnablePluginResult {
16851687
Debug.assertIsDefined(this.projectService.host.require);
16861688

@@ -1696,8 +1698,9 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
16961698

16971699
/**
16981700
* Performs the initial steps of enabling a plugin by finding and instantiating the module for a plugin asynchronously using dynamic `import`.
1701+
*
1702+
* @internal
16991703
*/
1700-
/** @internal */
17011704
async beginEnablePluginAsync(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): Promise<BeginEnablePluginResult> {
17021705
Debug.assertIsDefined(this.projectService.host.importPlugin);
17031706

@@ -1719,8 +1722,9 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
17191722

17201723
/**
17211724
* Performs the remaining steps of enabling a plugin after its module has been instantiated.
1725+
*
1726+
* @internal
17221727
*/
1723-
/** @internal */
17241728
endEnablePlugin({ pluginConfigEntry, pluginConfigOverrides, resolvedModule, errorLogs }: BeginEnablePluginResult) {
17251729
if (resolvedModule) {
17261730
const configurationOverride = pluginConfigOverrides && pluginConfigOverrides.get(pluginConfigEntry.name);
@@ -2015,8 +2019,11 @@ export class InferredProject extends Project {
20152019
/** this is canonical project root path */
20162020
readonly projectRootPath: string | undefined;
20172021

2018-
/** @internal */
2019-
/** stored only if their is no projectRootPath and this isnt single inferred project */
2022+
/**
2023+
* stored only if their is no projectRootPath and this isnt single inferred project
2024+
*
2025+
* @internal
2026+
*/
20202027
readonly canonicalCurrentDirectory: string | undefined;
20212028

20222029
/** @internal */
@@ -2412,8 +2419,11 @@ export class ConfiguredProject extends Project {
24122419

24132420
private projectReferences: readonly ProjectReference[] | undefined;
24142421

2415-
/** Potential project references before the project is actually loaded (read config file) */
2416-
/** @internal */
2422+
/**
2423+
* Potential project references before the project is actually loaded (read config file)
2424+
*
2425+
* @internal
2426+
*/
24172427
potentialProjectReferences: Set<string> | undefined;
24182428

24192429
/** @internal */
@@ -2630,8 +2640,11 @@ export class ConfiguredProject extends Project {
26302640
!this.canConfigFileJsonReportNoInputFiles;
26312641
}
26322642

2633-
/** @internal */
2634-
/** Find the configured project from the project references in project which contains the info directly */
2643+
/**
2644+
* Find the configured project from the project references in project which contains the info directly
2645+
*
2646+
* @internal
2647+
*/
26352648
getDefaultChildProjectFromProjectWithReferences(info: ScriptInfo) {
26362649
return forEachResolvedProjectReferenceProject(
26372650
this,
@@ -2643,8 +2656,11 @@ export class ConfiguredProject extends Project {
26432656
);
26442657
}
26452658

2646-
/** Returns true if the project is needed by any of the open script info/external project */
2647-
/** @internal */
2659+
/**
2660+
* Returns true if the project is needed by any of the open script info/external project
2661+
*
2662+
* @internal
2663+
*/
26482664
hasOpenRef() {
26492665
if (!!this.externalProjectRefCount) {
26502666
return true;

src/server/scriptInfo.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,11 @@ export class ScriptInfo {
317317
/** @internal */
318318
readonly isDynamic: boolean;
319319

320-
/** @internal */
321-
/** Set to real path if path is different from info.path */
320+
/**
321+
* Set to real path if path is different from info.path
322+
*
323+
* @internal
324+
*/
322325
private realpath: Path | undefined;
323326

324327
/** @internal */

0 commit comments

Comments
 (0)