@typespec/compiler 0.47.0-dev.0 → 0.47.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/manifest.js +2 -2
  2. package/dist/src/core/cli/{args.d.ts → actions/compile/args.d.ts} +2 -2
  3. package/dist/src/core/cli/actions/compile/args.d.ts.map +1 -0
  4. package/dist/src/core/cli/{args.js → actions/compile/args.js} +5 -5
  5. package/dist/src/core/cli/actions/compile/args.js.map +1 -0
  6. package/dist/src/core/cli/actions/compile/compile.d.ts +6 -0
  7. package/dist/src/core/cli/actions/compile/compile.d.ts.map +1 -0
  8. package/dist/src/core/cli/actions/compile/compile.js +106 -0
  9. package/dist/src/core/cli/actions/compile/compile.js.map +1 -0
  10. package/dist/src/core/cli/actions/format.d.ts +8 -0
  11. package/dist/src/core/cli/actions/format.d.ts.map +1 -0
  12. package/dist/src/core/cli/actions/format.js +25 -0
  13. package/dist/src/core/cli/actions/format.js.map +1 -0
  14. package/dist/src/core/cli/actions/info.d.ts +6 -0
  15. package/dist/src/core/cli/actions/info.d.ts.map +1 -0
  16. package/dist/src/core/cli/actions/info.js +27 -0
  17. package/dist/src/core/cli/actions/info.js.map +1 -0
  18. package/dist/src/core/cli/actions/init.d.ts +6 -0
  19. package/dist/src/core/cli/actions/init.d.ts.map +1 -0
  20. package/dist/src/core/cli/actions/init.js +17 -0
  21. package/dist/src/core/cli/actions/init.js.map +1 -0
  22. package/dist/src/core/cli/actions/vs.d.ts +3 -0
  23. package/dist/src/core/cli/actions/vs.d.ts.map +1 -0
  24. package/dist/src/core/cli/actions/vs.js +54 -0
  25. package/dist/src/core/cli/actions/vs.js.map +1 -0
  26. package/dist/src/core/cli/actions/vscode.d.ts +3 -0
  27. package/dist/src/core/cli/actions/vscode.d.ts.map +1 -0
  28. package/dist/src/core/cli/actions/vscode.js +36 -0
  29. package/dist/src/core/cli/actions/vscode.js.map +1 -0
  30. package/dist/src/core/cli/cli.js +16 -356
  31. package/dist/src/core/cli/cli.js.map +1 -1
  32. package/dist/src/core/cli/index.d.ts +1 -1
  33. package/dist/src/core/cli/index.d.ts.map +1 -1
  34. package/dist/src/core/cli/index.js +1 -1
  35. package/dist/src/core/cli/index.js.map +1 -1
  36. package/dist/src/core/cli/install-vsix.d.ts +2 -0
  37. package/dist/src/core/cli/install-vsix.d.ts.map +1 -0
  38. package/dist/src/core/cli/install-vsix.js +41 -0
  39. package/dist/src/core/cli/install-vsix.js.map +1 -0
  40. package/dist/src/core/cli/utils.d.ts +27 -0
  41. package/dist/src/core/cli/utils.d.ts.map +1 -0
  42. package/dist/src/core/cli/utils.js +93 -0
  43. package/dist/src/core/cli/utils.js.map +1 -0
  44. package/dist/src/core/program.js +3 -3
  45. package/dist/src/core/program.js.map +1 -1
  46. package/package.json +1 -1
  47. package/dist/src/core/cli/args.d.ts.map +0 -1
  48. package/dist/src/core/cli/args.js.map +0 -1
@@ -6,27 +6,18 @@ try {
6
6
  catch {
7
7
  // package only present in dev.
8
8
  }
9
- /* eslint-disable no-console */
10
- import { spawnSync } from "child_process";
11
- import { mkdtemp, readdir, rm } from "fs/promises";
12
- import watch from "node-watch";
13
- import os from "os";
14
- import { resolve } from "path";
15
- import { fileURLToPath } from "url";
16
9
  import yargs from "yargs";
17
- import { loadTypeSpecConfigForPath } from "../../config/index.js";
18
- import { InitTemplateError, initTypeSpecProject } from "../../init/index.js";
19
- import { compilerAssert, logDiagnostics } from "../diagnostics.js";
20
- import { resolveTypeSpecEntrypoint } from "../entrypoint-resolution.js";
21
- import { findUnformattedTypeSpecFiles, formatTypeSpecFiles } from "../formatter-fs.js";
22
10
  import { installTypeSpecDependencies } from "../install.js";
23
- import { createConsoleSink } from "../logger/index.js";
24
- import { NodeHost } from "../node-host.js";
25
- import { getAnyExtensionFromPath, getBaseFileName, joinPaths, resolvePath } from "../path-utils.js";
26
- import { compile } from "../program.js";
27
- import { ExternalError, typespecVersion } from "../util.js";
28
- import { getCompilerOptions } from "./args.js";
11
+ import { typespecVersion } from "../util.js";
12
+ import { compileAction } from "./actions/compile/compile.js";
13
+ import { formatAction } from "./actions/format.js";
14
+ import { printInfoAction } from "./actions/info.js";
15
+ import { initAction } from "./actions/init.js";
16
+ import { installVSExtension, uninstallVSExtension } from "./actions/vs.js";
17
+ import { installVSCodeExtension, uninstallVSCodeExtension } from "./actions/vscode.js";
18
+ import { createCLICompilerHost, handleInternalCompilerError } from "./utils.js";
29
19
  async function main() {
20
+ // eslint-disable-next-line no-console
30
21
  console.log(`TypeSpec compiler v${typespecVersion}\n`);
31
22
  await yargs(process.argv.slice(2))
32
23
  .scriptName("tsp")
@@ -113,23 +104,7 @@ async function main() {
113
104
  string: true,
114
105
  describe: "Key/value of arguments that are used in the configuration.",
115
106
  });
116
- }, async (args) => {
117
- const host = createCLICompilerHost(args);
118
- const diagnostics = [];
119
- const entrypoint = await resolveTypeSpecEntrypoint(host, resolvePath(process.cwd(), args.path), (diag) => diagnostics.push(diag));
120
- if (entrypoint === undefined || diagnostics.length > 0) {
121
- logDiagnostics(diagnostics, host.logSink);
122
- process.exit(1);
123
- }
124
- const cliOptions = await getCompilerOptionsOrExit(host, entrypoint, args);
125
- const program = await compileInput(host, entrypoint, cliOptions);
126
- if (program.hasError()) {
127
- process.exit(1);
128
- }
129
- if (program.emitters.length === 0 && !program.compilerOptions.noEmit) {
130
- console.log("No emitter was configured, no output was generated. Use `--emit <emitterName>` to pick emitter or specify it in the typespec config.");
131
- }
132
- })
107
+ }, async (args) => compileAction(args))
133
108
  .command("code", "Manage VS Code Extension.", (cmd) => {
134
109
  return cmd
135
110
  .demandCommand(1, "No command specified.")
@@ -166,335 +141,20 @@ async function main() {
166
141
  type: "boolean",
167
142
  describe: "Verify the files are formatted.",
168
143
  });
169
- }, async (args) => {
170
- if (args["check"]) {
171
- const unformatted = await findUnformattedTypeSpecFiles(args["include"], {
172
- exclude: args["exclude"],
173
- debug: args.debug,
174
- });
175
- if (unformatted.length > 0) {
176
- console.log(`Found ${unformatted.length} unformatted files:`);
177
- for (const file of unformatted) {
178
- console.log(` - ${file}`);
179
- }
180
- process.exit(1);
181
- }
182
- }
183
- else {
184
- await formatTypeSpecFiles(args["include"], {
185
- exclude: args["exclude"],
186
- debug: args.debug,
187
- });
188
- }
189
- })
144
+ }, async (args) => formatAction(args))
190
145
  .command("init [templatesUrl]", "Create a new TypeSpec project.", (cmd) => cmd.positional("templatesUrl", {
191
146
  description: "Url of the initialization template",
192
147
  type: "string",
193
- }), async (args) => {
194
- const host = createCLICompilerHost(args);
195
- try {
196
- await initTypeSpecProject(host, process.cwd(), args.templatesUrl);
197
- }
198
- catch (e) {
199
- if (e instanceof InitTemplateError) {
200
- logDiagnostics(e.diagnostics, host.logSink);
201
- process.exit(1);
202
- }
203
- throw e;
204
- }
205
- })
148
+ }), async (args) => initAction(args))
206
149
  .command("install", "Install typespec dependencies", () => { }, () => installTypeSpecDependencies(process.cwd()))
207
- .command("info", "Show information about current TypeSpec compiler.", () => { }, (args) => printInfo(createCLICompilerHost(args)))
150
+ .command("info", "Show information about current TypeSpec compiler.", () => { }, (args) => printInfoAction(createCLICompilerHost(args)))
208
151
  .version(typespecVersion)
209
152
  .demandCommand(1, "You must use one of the supported commands.").argv;
210
153
  }
211
- function compileInput(host, path, compilerOptions, printSuccess = true) {
212
- let compileRequested = false;
213
- let currentCompilePromise = undefined;
214
- const log = (message, ...optionalParams) => {
215
- const prefix = compilerOptions.watchForChanges ? `[${new Date().toLocaleTimeString()}] ` : "";
216
- console.log(`${prefix}${message}`, ...optionalParams);
217
- };
218
- const runCompilePromise = () => {
219
- // Don't run the compiler if it's already running
220
- if (!currentCompilePromise) {
221
- // Clear the console before compiling in watch mode
222
- if (compilerOptions.watchForChanges) {
223
- console.clear();
224
- }
225
- currentCompilePromise = compile(host, resolve(path), compilerOptions)
226
- .then(onCompileFinished)
227
- .catch(internalCompilerError);
228
- }
229
- else {
230
- compileRequested = true;
231
- }
232
- return currentCompilePromise;
233
- };
234
- const runCompile = () => void runCompilePromise();
235
- const onCompileFinished = (program) => {
236
- if (program.diagnostics.length > 0) {
237
- log("Diagnostics were reported during compilation:\n");
238
- logDiagnostics(program.diagnostics, host.logSink);
239
- logDiagnosticCount(program.diagnostics);
240
- }
241
- else {
242
- if (printSuccess) {
243
- log("Compilation completed successfully.");
244
- }
245
- }
246
- console.log(); // Insert a newline
247
- currentCompilePromise = undefined;
248
- if (compilerOptions.watchForChanges && compileRequested) {
249
- compileRequested = false;
250
- runCompile();
251
- }
252
- return program;
253
- };
254
- if (compilerOptions.watchForChanges) {
255
- runCompile();
256
- return new Promise((resolve, reject) => {
257
- const watcher = watch(path, {
258
- recursive: true,
259
- filter: (f) => [".js", ".tsp", ".cadl"].indexOf(getAnyExtensionFromPath(f)) > -1 &&
260
- !/node_modules/.test(f),
261
- }, (e, name) => {
262
- runCompile();
263
- });
264
- // Handle Ctrl+C for termination
265
- process.on("SIGINT", () => {
266
- watcher.close();
267
- console.info("Terminating watcher...\n");
268
- });
269
- });
270
- }
271
- else {
272
- return runCompilePromise();
273
- }
274
- }
275
- function logDiagnosticCount(diagnostics) {
276
- const errorCount = diagnostics.filter((x) => x.severity === "error").length;
277
- const warningCount = diagnostics.filter((x) => x.severity === "warning").length;
278
- const addSuffix = (count, suffix) => count > 1 ? `${count} ${suffix}s` : count === 1 ? `${count} ${suffix}` : undefined;
279
- const errorText = addSuffix(errorCount, "error");
280
- const warningText = addSuffix(warningCount, "warning");
281
- console.log(`\nFound ${[errorText, warningText].filter((x) => x !== undefined).join(", ")}.`);
282
- }
283
- function createCLICompilerHost(args) {
284
- return { ...NodeHost, logSink: createConsoleSink({ pretty: args.pretty }) };
285
- }
286
- async function getCompilerOptionsOrExit(host, entrypoint, args) {
287
- const [options, diagnostics] = await getCompilerOptions(host, entrypoint, process.cwd(), args, process.env);
288
- if (diagnostics.length > 0) {
289
- logDiagnostics(diagnostics, host.logSink);
290
- }
291
- if (options === undefined) {
292
- logDiagnosticCount(diagnostics);
293
- process.exit(1);
294
- }
295
- return options;
296
- }
297
- async function installVsix(pkg, install, debug) {
298
- var _a;
299
- // download npm package to temporary directory
300
- const temp = await mkdtemp(joinPaths(os.tmpdir(), "typespec"));
301
- const npmArgs = ["install"];
302
- // hide npm output unless --debug was passed to typespec
303
- if (!debug) {
304
- npmArgs.push("--silent");
305
- }
306
- // NOTE: Using cwd=temp with `--prefix .` instead of `--prefix ${temp}` to
307
- // workaround https://github.com/npm/cli/issues/3256. It's still important
308
- // to pass --prefix even though we're using cwd as otherwise, npm might
309
- // find a package.json file in a parent directory and install to that
310
- // directory.
311
- npmArgs.push("--prefix", ".");
312
- // To debug with a locally built package rather than pulling from npm,
313
- // specify the full path to the packed .tgz using TYPESPEC_DEBUG_VSIX_TGZ
314
- // environment variable.
315
- npmArgs.push((_a = process.env.TYPESPEC_DEBUG_VSIX_TGZ) !== null && _a !== void 0 ? _a : pkg);
316
- run("npm", npmArgs, { cwd: temp, debug });
317
- // locate .vsix
318
- const dir = joinPaths(temp, "node_modules", pkg);
319
- const files = await readdir(dir);
320
- const vsixPaths = [];
321
- for (const file of files) {
322
- if (file.endsWith(".vsix")) {
323
- vsixPaths.push(joinPaths(dir, file));
324
- }
325
- }
326
- compilerAssert(vsixPaths.length > 0, `Installed ${pkg} from npm, but didn't find any .vsix files in it.`);
327
- // install extension
328
- install(vsixPaths);
329
- // delete temporary directory
330
- await rm(temp, { recursive: true });
331
- }
332
- function runCode(codeArgs, insiders, debug) {
333
- try {
334
- run(insiders ? "code-insiders" : "code", codeArgs, {
335
- // VS Code's CLI emits node warnings that we can't do anything about. Suppress them.
336
- extraEnv: { NODE_NO_WARNINGS: "1" },
337
- debug,
338
- allowNotFound: true,
339
- });
340
- }
341
- catch (error) {
342
- if (error.code === "ENOENT") {
343
- console.error(`error: Couldn't find VS Code 'code' command in PATH. Make sure you have the VS Code executable added to the system PATH.`);
344
- if (process.platform === "darwin") {
345
- console.log("See instruction for Mac OS here https://code.visualstudio.com/docs/setup/mac");
346
- }
347
- if (debug) {
348
- console.log(error.stack);
349
- }
350
- process.exit(1);
351
- }
352
- }
353
- }
354
- async function installVSCodeExtension(insiders, debug) {
355
- await installVsix("typespec-vscode", (vsixPaths) => {
356
- runCode(["--install-extension", vsixPaths[0]], insiders, debug);
357
- }, debug);
358
- }
359
- async function uninstallVSCodeExtension(insiders, debug) {
360
- await runCode(["--uninstall-extension", "microsoft.typespec-vscode"], insiders, debug);
361
- }
362
- function getVsixInstallerPath() {
363
- return getVSInstallerPath("resources/app/ServiceHub/Services/Microsoft.VisualStudio.Setup.Service/VSIXInstaller.exe");
364
- }
365
- function getVSWherePath() {
366
- return getVSInstallerPath("vswhere.exe");
367
- }
368
- function getVSInstallerPath(relativePath) {
369
- var _a;
370
- if (process.platform !== "win32") {
371
- console.error("error: Visual Studio extension is not supported on non-Windows.");
372
- process.exit(1);
373
- }
374
- return joinPaths((_a = process.env["ProgramFiles(x86)"]) !== null && _a !== void 0 ? _a : "", "Microsoft Visual Studio/Installer", relativePath);
375
- }
376
- function isVSInstalled(versionRange) {
377
- const vswhere = getVSWherePath();
378
- const proc = run(vswhere, ["-property", "instanceid", "-prerelease", "-version", versionRange], {
379
- stdio: [null, "pipe", "inherit"],
380
- allowNotFound: true,
381
- });
382
- return proc.status === 0 && proc.stdout;
383
- }
384
- const VSIX_ALREADY_INSTALLED = 1001;
385
- const VSIX_NOT_INSTALLED = 1002;
386
- const VSIX_USER_CANCELED = 2005;
387
- const VS_SUPPORTED_VERSION_RANGE = "[17.0,)";
388
- async function installVSExtension(debug) {
389
- const vsixInstaller = getVsixInstallerPath();
390
- if (!isVSInstalled(VS_SUPPORTED_VERSION_RANGE)) {
391
- console.error("error: No compatible version of Visual Studio found.");
392
- process.exit(1);
393
- }
394
- await installVsix("typespec-vs", (vsixPaths) => {
395
- for (const vsix of vsixPaths) {
396
- console.log(`Installing extension for Visual Studio...`);
397
- run(vsixInstaller, [vsix], {
398
- allowedExitCodes: [VSIX_ALREADY_INSTALLED, VSIX_USER_CANCELED],
399
- });
400
- }
401
- }, debug);
402
- }
403
- async function uninstallVSExtension() {
404
- const vsixInstaller = getVsixInstallerPath();
405
- run(vsixInstaller, ["/uninstall:88b9492f-c019-492c-8aeb-f325a7e4cf23"], {
406
- allowedExitCodes: [VSIX_NOT_INSTALLED, VSIX_USER_CANCELED],
407
- });
408
- }
409
- /**
410
- * Print the resolved TypeSpec configuration.
411
- */
412
- async function printInfo(host) {
413
- var _a;
414
- const cwd = process.cwd();
415
- console.log(`Module: ${fileURLToPath(import.meta.url)}`);
416
- const config = await loadTypeSpecConfigForPath(host, cwd);
417
- const jsyaml = await import("js-yaml");
418
- const excluded = ["diagnostics", "filename"];
419
- const replacer = (emitter, value) => excluded.includes(emitter) ? undefined : value;
420
- console.log(`User Config: ${(_a = config.filename) !== null && _a !== void 0 ? _a : "No config file found"}`);
421
- console.log("-----------");
422
- console.log(jsyaml.dump(config, { replacer }));
423
- console.log("-----------");
424
- logDiagnostics(config.diagnostics, host.logSink);
425
- logDiagnosticCount(config.diagnostics);
426
- if (config.diagnostics.some((d) => d.severity === "error")) {
427
- process.exit(1);
428
- }
429
- }
430
- // NOTE: We could also use { shell: true } to let windows find the .cmd, but that breaks
431
- // ENOENT checking and handles spaces poorly in some cases.
432
- const isCmdOnWindows = ["code", "code-insiders", "npm"];
433
- function run(command, commandArgs, options) {
434
- var _a, _b, _c;
435
- if (options === null || options === void 0 ? void 0 : options.debug) {
436
- if (options) {
437
- console.log(options);
438
- }
439
- console.log(`> ${command} ${commandArgs.join(" ")}\n`);
440
- }
441
- if (options === null || options === void 0 ? void 0 : options.extraEnv) {
442
- options.env = {
443
- ...((_a = options === null || options === void 0 ? void 0 : options.env) !== null && _a !== void 0 ? _a : process.env),
444
- ...options.extraEnv,
445
- };
446
- }
447
- const baseCommandName = getBaseFileName(command);
448
- if (process.platform === "win32" && isCmdOnWindows.includes(command)) {
449
- command += ".cmd";
450
- }
451
- const finalOptions = {
452
- encoding: "utf-8",
453
- stdio: "inherit",
454
- ...(options !== null && options !== void 0 ? options : {}),
455
- };
456
- const proc = spawnSync(command, commandArgs, finalOptions);
457
- if (options === null || options === void 0 ? void 0 : options.debug) {
458
- console.log(proc);
459
- }
460
- if (proc.error) {
461
- if (proc.error.code === "ENOENT" && !(options === null || options === void 0 ? void 0 : options.allowNotFound)) {
462
- console.error(`error: Command '${baseCommandName}' not found.`);
463
- if (options === null || options === void 0 ? void 0 : options.debug) {
464
- console.log(proc.error.stack);
465
- }
466
- process.exit(1);
467
- }
468
- else {
469
- throw proc.error;
470
- }
471
- }
472
- if (proc.status !== 0 && !((_b = options === null || options === void 0 ? void 0 : options.allowedExitCodes) === null || _b === void 0 ? void 0 : _b.includes((_c = proc.status) !== null && _c !== void 0 ? _c : 0))) {
473
- console.error(`error: Command '${baseCommandName} ${commandArgs.join(" ")}' failed with exit code ${proc.status}.`);
474
- process.exit(proc.status || 1);
475
- }
476
- return proc;
477
- }
478
- function internalCompilerError(error) {
479
- // NOTE: An expected error, like one thrown for bad input, shouldn't reach
480
- // here, but be handled somewhere else. If we reach here, it should be
481
- // considered a bug and therefore we should not suppress the stack trace as
482
- // that risks losing it in the case of a bug that does not repro easily.
483
- if (error instanceof ExternalError) {
484
- // ExternalError should already have all the relevant information needed when thrown.
485
- console.error(error);
486
- }
487
- else {
488
- console.error("Internal compiler error!");
489
- console.error("File issue at https://github.com/microsoft/typespec");
490
- console.error();
491
- console.error(error);
492
- }
493
- process.exit(1);
494
- }
495
154
  process.on("unhandledRejection", (error) => {
155
+ // eslint-disable-next-line no-console
496
156
  console.error("Unhandled promise rejection!");
497
- internalCompilerError(error);
157
+ handleInternalCompilerError(error);
498
158
  });
499
- main().catch(internalCompilerError);
159
+ main().catch(handleInternalCompilerError);
500
160
  //# sourceMappingURL=cli.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../src/core/cli/cli.ts"],"names":[],"mappings":"AAAA,IAAI;IACF,6DAA6D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,OAAO,CAAC,eAAe,CAAC;SACxB,aAAa,CAAC,CAAC,EAAE,6CAA6C,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,KAAc,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC9C,2BAA2B,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC,CAAC;AAEH,IAAI,EAAE,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export * from "./args.js";
1
+ export * from "./actions/compile/args.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/cli/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/cli/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -1,2 +1,2 @@
1
- export * from "./args.js";
1
+ export * from "./actions/compile/args.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/cli/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/cli/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function installVsix(pkg: string, install: (vsixPaths: string[]) => void, debug: boolean): Promise<void>;
2
+ //# sourceMappingURL=install-vsix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-vsix.d.ts","sourceRoot":"","sources":["../../../../src/core/cli/install-vsix.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,CAC/B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,EACtC,KAAK,EAAE,OAAO,iBA6Cf"}
@@ -0,0 +1,41 @@
1
+ import { mkdtemp, readdir, rm } from "fs/promises";
2
+ import os from "os";
3
+ import { compilerAssert } from "../diagnostics.js";
4
+ import { joinPaths } from "../path-utils.js";
5
+ import { run } from "./utils.js";
6
+ export async function installVsix(pkg, install, debug) {
7
+ var _a;
8
+ // download npm package to temporary directory
9
+ const temp = await mkdtemp(joinPaths(os.tmpdir(), "typespec"));
10
+ const npmArgs = ["install"];
11
+ // hide npm output unless --debug was passed to typespec
12
+ if (!debug) {
13
+ npmArgs.push("--silent");
14
+ }
15
+ // NOTE: Using cwd=temp with `--prefix .` instead of `--prefix ${temp}` to
16
+ // workaround https://github.com/npm/cli/issues/3256. It's still important
17
+ // to pass --prefix even though we're using cwd as otherwise, npm might
18
+ // find a package.json file in a parent directory and install to that
19
+ // directory.
20
+ npmArgs.push("--prefix", ".");
21
+ // To debug with a locally built package rather than pulling from npm,
22
+ // specify the full path to the packed .tgz using TYPESPEC_DEBUG_VSIX_TGZ
23
+ // environment variable.
24
+ npmArgs.push((_a = process.env.TYPESPEC_DEBUG_VSIX_TGZ) !== null && _a !== void 0 ? _a : pkg);
25
+ run("npm", npmArgs, { cwd: temp, debug });
26
+ // locate .vsix
27
+ const dir = joinPaths(temp, "node_modules", pkg);
28
+ const files = await readdir(dir);
29
+ const vsixPaths = [];
30
+ for (const file of files) {
31
+ if (file.endsWith(".vsix")) {
32
+ vsixPaths.push(joinPaths(dir, file));
33
+ }
34
+ }
35
+ compilerAssert(vsixPaths.length > 0, `Installed ${pkg} from npm, but didn't find any .vsix files in it.`);
36
+ // install extension
37
+ install(vsixPaths);
38
+ // delete temporary directory
39
+ await rm(temp, { recursive: true });
40
+ }
41
+ //# sourceMappingURL=install-vsix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-vsix.js","sourceRoot":"","sources":["../../../../src/core/cli/install-vsix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I,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC1B,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;SACtC;KACF;IAED,cAAc,CACZ,SAAS,CAAC,MAAM,GAAG,CAAC,EACpB,aAAa,GAAG,mDAAmD,CACpE,CAAC;IAEF,oBAAoB;IACpB,OAAO,CAAC,SAAS,CAAC,CAAC;IAEnB,6BAA6B;IAC7B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,27 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
3
+ import { SpawnSyncOptionsWithStringEncoding } from "child_process";
4
+ import { CompilerHost, Diagnostic } from "../types.js";
5
+ export interface RunOptions extends Partial<SpawnSyncOptionsWithStringEncoding> {
6
+ readonly debug?: boolean;
7
+ readonly extraEnv?: NodeJS.ProcessEnv;
8
+ readonly allowNotFound?: boolean;
9
+ readonly allowedExitCodes?: number[];
10
+ }
11
+ export declare function createCLICompilerHost(options: {
12
+ pretty?: boolean;
13
+ }): CompilerHost;
14
+ export declare function run(command: string, commandArgs: string[], options?: RunOptions): import("child_process").SpawnSyncReturns<string>;
15
+ export declare function logDiagnosticCount(diagnostics: readonly Diagnostic[]): void;
16
+ /**
17
+ * Handle an internal compiler error.
18
+ *
19
+ * NOTE: An expected error, like one thrown for bad input, shouldn't reach
20
+ * here, but be handled somewhere else. If we reach here, it should be
21
+ * considered a bug and therefore we should not suppress the stack trace as
22
+ * that risks losing it in the case of a bug that does not repro easily.
23
+ *
24
+ * @param error error thrown
25
+ */
26
+ export declare function handleInternalCompilerError(error: unknown): never;
27
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/core/cli/utils.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,kCAAkC,EAAa,MAAM,eAAe,CAAC;AAM9E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMvD,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,kCAAkC,CAAC;IAC7E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACtC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CACtC;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,CAEjF;AAED,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,UAAU,oDAqD/E;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,QAWpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAcjE"}
@@ -0,0 +1,93 @@
1
+ // NOTE: We could also use { shell: true } to let windows find the .cmd, but that breaks
2
+ import { spawnSync } from "child_process";
3
+ import { inspect } from "util";
4
+ import { createConsoleSink } from "../logger/console-sink.js";
5
+ import { createLogger } from "../logger/logger.js";
6
+ import { NodeHost } from "../node-host.js";
7
+ import { getBaseFileName } from "../path-utils.js";
8
+ import { ExternalError } from "../util.js";
9
+ // ENOENT checking and handles spaces poorly in some cases.
10
+ const isCmdOnWindows = ["code", "code-insiders", "npm"];
11
+ export function createCLICompilerHost(options) {
12
+ return { ...NodeHost, logSink: createConsoleSink({ pretty: options.pretty }) };
13
+ }
14
+ export function run(command, commandArgs, options) {
15
+ var _a, _b, _c;
16
+ const logger = createLogger({
17
+ sink: NodeHost.logSink,
18
+ level: (options === null || options === void 0 ? void 0 : options.debug) ? "trace" : "warning",
19
+ });
20
+ if (options) {
21
+ logger.trace(inspect(options, { depth: null }));
22
+ }
23
+ logger.trace(`> ${command} ${commandArgs.join(" ")}\n`);
24
+ if (options === null || options === void 0 ? void 0 : options.extraEnv) {
25
+ options.env = {
26
+ ...((_a = options === null || options === void 0 ? void 0 : options.env) !== null && _a !== void 0 ? _a : process.env),
27
+ ...options.extraEnv,
28
+ };
29
+ }
30
+ const baseCommandName = getBaseFileName(command);
31
+ if (process.platform === "win32" && isCmdOnWindows.includes(command)) {
32
+ command += ".cmd";
33
+ }
34
+ const finalOptions = {
35
+ encoding: "utf-8",
36
+ stdio: "inherit",
37
+ ...(options !== null && options !== void 0 ? options : {}),
38
+ };
39
+ const proc = spawnSync(command, commandArgs, finalOptions);
40
+ logger.trace(inspect(proc, { depth: null }));
41
+ if (proc.error) {
42
+ if (proc.error.code === "ENOENT" && !(options === null || options === void 0 ? void 0 : options.allowNotFound)) {
43
+ logger.error(`error: Command '${baseCommandName}' not found.`);
44
+ if ((options === null || options === void 0 ? void 0 : options.debug) && proc.error.stack) {
45
+ logger.error(proc.error.stack);
46
+ }
47
+ process.exit(1);
48
+ }
49
+ else {
50
+ throw proc.error;
51
+ }
52
+ }
53
+ if (proc.status !== 0 && !((_b = options === null || options === void 0 ? void 0 : options.allowedExitCodes) === null || _b === void 0 ? void 0 : _b.includes((_c = proc.status) !== null && _c !== void 0 ? _c : 0))) {
54
+ logger.error(`error: Command '${baseCommandName} ${commandArgs.join(" ")}' failed with exit code ${proc.status}.`);
55
+ process.exit(proc.status || 1);
56
+ }
57
+ return proc;
58
+ }
59
+ export function logDiagnosticCount(diagnostics) {
60
+ const errorCount = diagnostics.filter((x) => x.severity === "error").length;
61
+ const warningCount = diagnostics.filter((x) => x.severity === "warning").length;
62
+ const addSuffix = (count, suffix) => count > 1 ? `${count} ${suffix}s` : count === 1 ? `${count} ${suffix}` : undefined;
63
+ const errorText = addSuffix(errorCount, "error");
64
+ const warningText = addSuffix(warningCount, "warning");
65
+ // eslint-disable-next-line no-console
66
+ console.log(`\nFound ${[errorText, warningText].filter((x) => x !== undefined).join(", ")}.`);
67
+ }
68
+ /**
69
+ * Handle an internal compiler error.
70
+ *
71
+ * NOTE: An expected error, like one thrown for bad input, shouldn't reach
72
+ * here, but be handled somewhere else. If we reach here, it should be
73
+ * considered a bug and therefore we should not suppress the stack trace as
74
+ * that risks losing it in the case of a bug that does not repro easily.
75
+ *
76
+ * @param error error thrown
77
+ */
78
+ export function handleInternalCompilerError(error) {
79
+ /* eslint-disable no-console */
80
+ if (error instanceof ExternalError) {
81
+ // ExternalError should already have all the relevant information needed when thrown.
82
+ console.error(error);
83
+ }
84
+ else {
85
+ console.error("Internal compiler error!");
86
+ console.error("File issue at https://github.com/microsoft/typespec");
87
+ console.error();
88
+ console.error(error);
89
+ }
90
+ /* eslint-enable no-console */
91
+ process.exit(1);
92
+ }
93
+ //# sourceMappingURL=utils.js.map