@typespec/compiler 0.47.0-dev.13 → 0.47.0-dev.16
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.
- package/dist/manifest.js +2 -2
- package/dist/src/core/checker.d.ts.map +1 -1
- package/dist/src/core/checker.js +139 -66
- package/dist/src/core/checker.js.map +1 -1
- package/dist/src/core/cli/actions/compile/compile.d.ts.map +1 -1
- package/dist/src/core/cli/actions/compile/compile.js +59 -51
- package/dist/src/core/cli/actions/compile/compile.js.map +1 -1
- package/dist/src/core/cli/actions/compile/watch.d.ts +15 -0
- package/dist/src/core/cli/actions/compile/watch.d.ts.map +1 -0
- package/dist/src/core/cli/actions/compile/watch.js +59 -0
- package/dist/src/core/cli/actions/compile/watch.js.map +1 -0
- package/package.json +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../../src/core/cli/actions/compile/compile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../../src/core/cli/actions/compile/compile.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAC;AAG/D,wBAAsB,aAAa,CACjC,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,iBAmB1D"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import watch from "node-watch";
|
|
2
1
|
import { resolve } from "path";
|
|
3
2
|
import { logDiagnostics } from "../../../diagnostics.js";
|
|
4
3
|
import { resolveTypeSpecEntrypoint } from "../../../entrypoint-resolution.js";
|
|
5
|
-
import {
|
|
4
|
+
import { resolvePath } from "../../../path-utils.js";
|
|
6
5
|
import { compile as compileProgram } from "../../../program.js";
|
|
7
6
|
import { handleInternalCompilerError, logDiagnosticCount } from "../../utils.js";
|
|
8
7
|
import { getCompilerOptions } from "./args.js";
|
|
8
|
+
import { createWatchHost, createWatcher } from "./watch.js";
|
|
9
9
|
export async function compileAction(host, args) {
|
|
10
10
|
const diagnostics = [];
|
|
11
11
|
const entrypoint = await resolveTypeSpecEntrypoint(host, resolvePath(process.cwd(), args.path), (diag) => diagnostics.push(diag));
|
|
@@ -14,13 +14,11 @@ export async function compileAction(host, args) {
|
|
|
14
14
|
process.exit(1);
|
|
15
15
|
}
|
|
16
16
|
const cliOptions = await getCompilerOptionsOrExit(host, entrypoint, args);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
process.exit(1);
|
|
17
|
+
if (cliOptions.watchForChanges) {
|
|
18
|
+
await compileWatch(host, entrypoint, cliOptions);
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
console.log("No emitter was configured, no output was generated. Use `--emit <emitterName>` to pick emitter or specify it in the typespec config.");
|
|
20
|
+
else {
|
|
21
|
+
await compileOnce(host, entrypoint, cliOptions);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
async function getCompilerOptionsOrExit(host, entrypoint, args) {
|
|
@@ -34,22 +32,28 @@ async function getCompilerOptionsOrExit(host, entrypoint, args) {
|
|
|
34
32
|
}
|
|
35
33
|
return options;
|
|
36
34
|
}
|
|
37
|
-
function
|
|
35
|
+
async function compileOnce(host, path, compilerOptions) {
|
|
36
|
+
try {
|
|
37
|
+
const program = await compileProgram(host, resolve(path), compilerOptions);
|
|
38
|
+
logProgramResult(host, program);
|
|
39
|
+
if (program.hasError()) {
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
handleInternalCompilerError(e);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function compileWatch(host, path, compilerOptions) {
|
|
38
48
|
let compileRequested = false;
|
|
39
49
|
let currentCompilePromise = undefined;
|
|
40
|
-
const log = (message, ...optionalParams) => {
|
|
41
|
-
const prefix = compilerOptions.watchForChanges ? `[${new Date().toLocaleTimeString()}] ` : "";
|
|
42
|
-
// eslint-disable-next-line no-console
|
|
43
|
-
console.log(`${prefix}${message}`, ...optionalParams);
|
|
44
|
-
};
|
|
45
50
|
const runCompilePromise = () => {
|
|
46
51
|
// Don't run the compiler if it's already running
|
|
47
|
-
if (
|
|
52
|
+
if (currentCompilePromise === undefined) {
|
|
48
53
|
// Clear the console before compiling in watch mode
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
55
|
+
console.clear();
|
|
56
|
+
watchHost === null || watchHost === void 0 ? void 0 : watchHost.forceJSReload();
|
|
53
57
|
currentCompilePromise = compileProgram(host, resolve(path), compilerOptions)
|
|
54
58
|
.then(onCompileFinished)
|
|
55
59
|
.catch(handleInternalCompilerError);
|
|
@@ -59,47 +63,51 @@ function compileInput(host, path, compilerOptions, printSuccess = true) {
|
|
|
59
63
|
}
|
|
60
64
|
return currentCompilePromise;
|
|
61
65
|
};
|
|
62
|
-
const
|
|
66
|
+
const scheduleCompile = () => void runCompilePromise();
|
|
67
|
+
const watcher = createWatcher((_name) => {
|
|
68
|
+
scheduleCompile();
|
|
69
|
+
});
|
|
70
|
+
const watchHost = (host = createWatchHost());
|
|
63
71
|
const onCompileFinished = (program) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
logDiagnostics(program.diagnostics, host.logSink);
|
|
67
|
-
logDiagnosticCount(program.diagnostics);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
if (printSuccess) {
|
|
71
|
-
log("Compilation completed successfully.");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// eslint-disable-next-line no-console
|
|
75
|
-
console.log(); // Insert a newline
|
|
72
|
+
watcher === null || watcher === void 0 ? void 0 : watcher.updateWatchedFiles([...program.sourceFiles.keys(), ...program.jsSourceFiles.keys()]);
|
|
73
|
+
logProgramResult(host, program, { showTimestamp: true });
|
|
76
74
|
currentCompilePromise = undefined;
|
|
77
|
-
if (
|
|
75
|
+
if (compileRequested) {
|
|
78
76
|
compileRequested = false;
|
|
79
|
-
|
|
77
|
+
scheduleCompile();
|
|
80
78
|
}
|
|
81
79
|
return program;
|
|
82
80
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
runCompile();
|
|
92
|
-
});
|
|
93
|
-
// Handle Ctrl+C for termination
|
|
94
|
-
process.on("SIGINT", () => {
|
|
95
|
-
watcher.close();
|
|
96
|
-
// eslint-disable-next-line no-console
|
|
97
|
-
console.info("Terminating watcher...\n");
|
|
98
|
-
});
|
|
81
|
+
scheduleCompile();
|
|
82
|
+
return new Promise((resolve, reject) => {
|
|
83
|
+
// Handle Ctrl+C for termination
|
|
84
|
+
process.on("SIGINT", () => {
|
|
85
|
+
watcher.close();
|
|
86
|
+
// eslint-disable-next-line no-console
|
|
87
|
+
console.info("Terminating watcher...\n");
|
|
88
|
+
resolve();
|
|
99
89
|
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function logProgramResult(host, program, { showTimestamp } = {}) {
|
|
93
|
+
const log = (message, ...optionalParams) => {
|
|
94
|
+
const timestamp = showTimestamp ? `[${new Date().toLocaleTimeString()}] ` : "";
|
|
95
|
+
// eslint-disable-next-line no-console
|
|
96
|
+
console.log(`${timestamp}${message}`, ...optionalParams);
|
|
97
|
+
};
|
|
98
|
+
if (program.diagnostics.length > 0) {
|
|
99
|
+
log("Diagnostics were reported during compilation:\n");
|
|
100
|
+
logDiagnostics(program.diagnostics, host.logSink);
|
|
101
|
+
logDiagnosticCount(program.diagnostics);
|
|
100
102
|
}
|
|
101
103
|
else {
|
|
102
|
-
|
|
104
|
+
log("Compilation completed successfully.");
|
|
105
|
+
}
|
|
106
|
+
// eslint-disable-next-line no-console
|
|
107
|
+
console.log(); // Insert a newline
|
|
108
|
+
if (program.emitters.length === 0 && !program.compilerOptions.noEmit) {
|
|
109
|
+
// eslint-disable-next-line no-console
|
|
110
|
+
log("No emitter was configured, no output was generated. Use `--emit <emitterName>` to pick emitter or specify it in the typespec config.");
|
|
103
111
|
}
|
|
104
112
|
}
|
|
105
113
|
//# sourceMappingURL=compile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../../../../src/core/cli/actions/compile/compile.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../../../../src/core/cli/actions/compile/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAW,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGzE,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAkB,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAA6B,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAAqB,EACrB,IAAyD;IAEzD,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,MAAM,UAAU,GAAG,MAAM,yBAAyB,CAChD,IAAI,EACJ,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EACrC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CACjC,CA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;QACL,GAAG,CAAC,qCAAqC,CAAC,CAAC;KAC5C;IACD,sCAAsC;IACtC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,mBAAmB;IAElC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE;QACpE,sCAAsC;QACtC,GAAG,CACD,sIAAsI,CACvI,CAAC;KACH;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { WatchEventType } from "fs";
|
|
3
|
+
import { CompilerHost } from "../../../types.js";
|
|
4
|
+
export interface ProjectWatcher {
|
|
5
|
+
/** Set the files to watch. */
|
|
6
|
+
readonly updateWatchedFiles: (files: string[]) => void;
|
|
7
|
+
/** Close the watcher. */
|
|
8
|
+
readonly close: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface WatchHost extends CompilerHost {
|
|
11
|
+
forceJSReload(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function createWatcher(onFileChanged: (event: WatchEventType, name: string) => void): ProjectWatcher;
|
|
14
|
+
export declare function createWatchHost(): WatchHost;
|
|
15
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../../../../src/core/cli/actions/compile/watch.ts"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAS,MAAM,IAAI,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAEvD,yBAAyB;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,aAAa,IAAI,IAAI,CAAC;CACvB;AAED,wBAAgB,aAAa,CAC3B,aAAa,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAC3D,cAAc,CAmChB;AAED,wBAAgB,eAAe,IAAI,SAAS,CAU3C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { watch } from "fs";
|
|
2
|
+
import { pathToFileURL } from "url";
|
|
3
|
+
import { NodeHost } from "../../../node-host.js";
|
|
4
|
+
export function createWatcher(onFileChanged) {
|
|
5
|
+
const current = new Map();
|
|
6
|
+
const dupFilter = createDupsFilter();
|
|
7
|
+
return { updateWatchedFiles, close };
|
|
8
|
+
function watchFile(file) {
|
|
9
|
+
const watcher = watch(file, dupFilter((event, _name) => {
|
|
10
|
+
onFileChanged(event, file);
|
|
11
|
+
}));
|
|
12
|
+
return watcher;
|
|
13
|
+
}
|
|
14
|
+
function close() {
|
|
15
|
+
for (const watcher of current.values()) {
|
|
16
|
+
watcher.close();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function updateWatchedFiles(files) {
|
|
20
|
+
var _a;
|
|
21
|
+
const cleanup = new Set(current.keys());
|
|
22
|
+
for (const file of files) {
|
|
23
|
+
if (!current.has(file)) {
|
|
24
|
+
current.set(file, watchFile(file));
|
|
25
|
+
}
|
|
26
|
+
cleanup.delete(file);
|
|
27
|
+
}
|
|
28
|
+
for (const file of cleanup) {
|
|
29
|
+
(_a = current.get(file)) === null || _a === void 0 ? void 0 : _a.close();
|
|
30
|
+
current.delete(file);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export function createWatchHost() {
|
|
35
|
+
let count = 0;
|
|
36
|
+
return {
|
|
37
|
+
...NodeHost,
|
|
38
|
+
forceJSReload,
|
|
39
|
+
getJsImport: (path) => import(pathToFileURL(path).href + `?=${count}`),
|
|
40
|
+
};
|
|
41
|
+
function forceJSReload() {
|
|
42
|
+
count++;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function createDupsFilter() {
|
|
46
|
+
let memo = {};
|
|
47
|
+
return function (fn) {
|
|
48
|
+
return function (event, name) {
|
|
49
|
+
memo[name] = [event, name];
|
|
50
|
+
setTimeout(function () {
|
|
51
|
+
Object.values(memo).forEach((args) => {
|
|
52
|
+
fn(...args);
|
|
53
|
+
});
|
|
54
|
+
memo = {};
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../../../../../src/core/cli/actions/compile/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,EAAE,MAAM,IAAI,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAejD,MAAM,UAAU,aAAa,CAC3B,aAA4D;IAE5D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC7C,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;IAErC,SAAS,SAAS,CAAC,IAAY;QAC7B,MAAM,OAAO,GAAG,KAAK,CACnB,IAAI,EACJ,SAAS,CAAC,CAAC,KAAqB,EAAE,KAAa,EAAE,EAAE;YACjD,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC7B,CAAC,CAAC,CACH,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,SAAS,KAAK;QACZ,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE;YACtC,OAAO,CAAC,KAAK,EAAE,CAAC;SACjB;IACH,CAAC;IAED,SAAS,kBAAkB,CAAC,KAAe;;QACzC,MAAM,OAAO,GAAG,IAAI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AC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/compiler",
|
|
3
|
-
"version": "0.47.0-dev.
|
|
3
|
+
"version": "0.47.0-dev.16",
|
|
4
4
|
"description": "TypeSpec Compiler Preview",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"vscode-languageserver": "~8.1.0",
|
|
70
70
|
"vscode-languageserver-textdocument": "~1.0.1",
|
|
71
71
|
"yargs": "~17.7.1",
|
|
72
|
-
"node-watch": "~0.7.1",
|
|
73
72
|
"change-case": "~4.1.2"
|
|
74
73
|
},
|
|
75
74
|
"devDependencies": {
|