@mohsen-azimi/tsz-dev 0.1.1 → 0.1.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.
- package/bin/tsz-server.js +305 -0
- package/bin/tsz.js +149 -0
- package/bundler/package.json +1 -1
- package/bundler/tsz_wasm_bg.wasm +0 -0
- package/node/package.json +1 -1
- package/node/tsz_wasm_bg.wasm +0 -0
- package/package.json +6 -2
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// tsz-server — Language Server Protocol server using the @mohsen-azimi/tsz-dev WASM module.
|
|
3
|
+
// Communicates over stdin/stdout using the LSP JSON-RPC protocol.
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { TsLanguageService, TsProgram } = require(
|
|
9
|
+
path.join(__dirname, '..', 'node', 'tsz_wasm.js')
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
// ─── LSP Transport (stdin/stdout Content-Length framing) ──────────────────────
|
|
13
|
+
class LspTransport {
|
|
14
|
+
constructor() {
|
|
15
|
+
this._buf = Buffer.alloc(0);
|
|
16
|
+
process.stdin.on('data', (chunk) => this._onData(chunk));
|
|
17
|
+
process.stdin.on('end', () => process.exit(0));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
_onData(chunk) {
|
|
21
|
+
this._buf = Buffer.concat([this._buf, chunk]);
|
|
22
|
+
this._processBuffer();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_processBuffer() {
|
|
26
|
+
while (true) {
|
|
27
|
+
const headerEnd = this._buf.indexOf('\r\n\r\n');
|
|
28
|
+
if (headerEnd === -1) return;
|
|
29
|
+
|
|
30
|
+
const header = this._buf.slice(0, headerEnd).toString('ascii');
|
|
31
|
+
const match = header.match(/Content-Length:\s*(\d+)/i);
|
|
32
|
+
if (!match) { this._buf = this._buf.slice(headerEnd + 4); continue; }
|
|
33
|
+
|
|
34
|
+
const contentLength = parseInt(match[1], 10);
|
|
35
|
+
const bodyStart = headerEnd + 4;
|
|
36
|
+
if (this._buf.length < bodyStart + contentLength) return;
|
|
37
|
+
|
|
38
|
+
const body = this._buf.slice(bodyStart, bodyStart + contentLength).toString('utf8');
|
|
39
|
+
this._buf = this._buf.slice(bodyStart + contentLength);
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const msg = JSON.parse(body);
|
|
43
|
+
this.onMessage(msg);
|
|
44
|
+
} catch { /* ignore parse errors */ }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
send(msg) {
|
|
49
|
+
const body = JSON.stringify(msg);
|
|
50
|
+
const header = `Content-Length: ${Buffer.byteLength(body, 'utf8')}\r\n\r\n`;
|
|
51
|
+
process.stdout.write(header + body);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Override this
|
|
55
|
+
onMessage(_msg) {}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ─── Server ───────────────────────────────────────────────────────────────────
|
|
59
|
+
class TszServer {
|
|
60
|
+
constructor() {
|
|
61
|
+
this._transport = new LspTransport();
|
|
62
|
+
this._transport.onMessage = (msg) => this._handle(msg);
|
|
63
|
+
this._documents = new Map(); // uri -> { text, service }
|
|
64
|
+
this._initialized = false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
_handle(msg) {
|
|
68
|
+
const { id, method, params } = msg;
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
if (method === 'initialize') {
|
|
72
|
+
this._initialized = true;
|
|
73
|
+
this._reply(id, {
|
|
74
|
+
capabilities: {
|
|
75
|
+
textDocumentSync: { openClose: true, change: 1 /* Full */ },
|
|
76
|
+
completionProvider: { triggerCharacters: ['.', '"', "'", '/', '@'] },
|
|
77
|
+
hoverProvider: true,
|
|
78
|
+
definitionProvider: true,
|
|
79
|
+
referencesProvider: true,
|
|
80
|
+
},
|
|
81
|
+
serverInfo: { name: 'tsz-server', version: '0.1.1' },
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
} else if (method === 'initialized') {
|
|
85
|
+
// notification, no reply
|
|
86
|
+
|
|
87
|
+
} else if (method === 'shutdown') {
|
|
88
|
+
this._reply(id, null);
|
|
89
|
+
|
|
90
|
+
} else if (method === 'exit') {
|
|
91
|
+
process.exit(0);
|
|
92
|
+
|
|
93
|
+
} else if (method === 'textDocument/didOpen') {
|
|
94
|
+
const { textDocument } = params;
|
|
95
|
+
this._openDocument(textDocument.uri, textDocument.text);
|
|
96
|
+
this._publishDiagnostics(textDocument.uri);
|
|
97
|
+
|
|
98
|
+
} else if (method === 'textDocument/didChange') {
|
|
99
|
+
const { textDocument, contentChanges } = params;
|
|
100
|
+
const text = contentChanges[contentChanges.length - 1].text;
|
|
101
|
+
this._updateDocument(textDocument.uri, text);
|
|
102
|
+
this._publishDiagnostics(textDocument.uri);
|
|
103
|
+
|
|
104
|
+
} else if (method === 'textDocument/didClose') {
|
|
105
|
+
this._documents.delete(params.textDocument.uri);
|
|
106
|
+
// Clear diagnostics
|
|
107
|
+
this._transport.send({
|
|
108
|
+
jsonrpc: '2.0', method: 'textDocument/publishDiagnostics',
|
|
109
|
+
params: { uri: params.textDocument.uri, diagnostics: [] },
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
} else if (method === 'textDocument/completion') {
|
|
113
|
+
const result = this._completion(params);
|
|
114
|
+
this._reply(id, result);
|
|
115
|
+
|
|
116
|
+
} else if (method === 'textDocument/hover') {
|
|
117
|
+
const result = this._hover(params);
|
|
118
|
+
this._reply(id, result);
|
|
119
|
+
|
|
120
|
+
} else if (method === 'textDocument/definition') {
|
|
121
|
+
const result = this._definition(params);
|
|
122
|
+
this._reply(id, result);
|
|
123
|
+
|
|
124
|
+
} else if (method === 'textDocument/references') {
|
|
125
|
+
const result = this._references(params);
|
|
126
|
+
this._reply(id, result);
|
|
127
|
+
|
|
128
|
+
} else if (id != null) {
|
|
129
|
+
this._reply(id, null);
|
|
130
|
+
}
|
|
131
|
+
} catch (err) {
|
|
132
|
+
if (id != null) {
|
|
133
|
+
this._error(id, -32603, `Internal error: ${err.message}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
_reply(id, result) {
|
|
139
|
+
this._transport.send({ jsonrpc: '2.0', id, result });
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_error(id, code, message) {
|
|
143
|
+
this._transport.send({ jsonrpc: '2.0', id, error: { code, message } });
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
_getService(uri) {
|
|
147
|
+
return this._documents.get(uri);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
_openDocument(uri, text) {
|
|
151
|
+
const fileName = this._uriToPath(uri);
|
|
152
|
+
const service = new TsLanguageService(fileName, text);
|
|
153
|
+
this._documents.set(uri, { text, service });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
_updateDocument(uri, text) {
|
|
157
|
+
const doc = this._documents.get(uri);
|
|
158
|
+
if (doc) {
|
|
159
|
+
doc.text = text;
|
|
160
|
+
doc.service.updateSource(text);
|
|
161
|
+
} else {
|
|
162
|
+
this._openDocument(uri, text);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
_publishDiagnostics(uri) {
|
|
167
|
+
const doc = this._getService(uri);
|
|
168
|
+
if (!doc) return;
|
|
169
|
+
|
|
170
|
+
// Use TsProgram for diagnostics (more accurate than language service)
|
|
171
|
+
const fileName = this._uriToPath(uri);
|
|
172
|
+
const program = new TsProgram();
|
|
173
|
+
program.addSourceFile(fileName, doc.text);
|
|
174
|
+
let diags = [];
|
|
175
|
+
try {
|
|
176
|
+
const raw = JSON.parse(program.getSemanticDiagnosticsJson(undefined));
|
|
177
|
+
diags = raw.map((d) => this._toLspDiagnostic(d, doc.text));
|
|
178
|
+
} catch { /* ignore */ }
|
|
179
|
+
|
|
180
|
+
this._transport.send({
|
|
181
|
+
jsonrpc: '2.0',
|
|
182
|
+
method: 'textDocument/publishDiagnostics',
|
|
183
|
+
params: { uri, diagnostics: diags },
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
_toLspDiagnostic(d, text) {
|
|
188
|
+
const lines = text.split('\n');
|
|
189
|
+
const line = d.line != null ? d.line : 0;
|
|
190
|
+
const char = d.character != null ? d.character : 0;
|
|
191
|
+
const endLine = d.endLine != null ? d.endLine : line;
|
|
192
|
+
const endChar = d.endCharacter != null ? d.endCharacter : char + (d.length || 1);
|
|
193
|
+
|
|
194
|
+
const severityMap = { error: 1, warning: 2, suggestion: 3, message: 4 };
|
|
195
|
+
const severity = severityMap[String(d.category || 'error').toLowerCase()] || 1;
|
|
196
|
+
|
|
197
|
+
return {
|
|
198
|
+
range: {
|
|
199
|
+
start: { line, character: char },
|
|
200
|
+
end: { line: endLine, character: endChar },
|
|
201
|
+
},
|
|
202
|
+
severity,
|
|
203
|
+
code: d.code,
|
|
204
|
+
source: 'tsz',
|
|
205
|
+
message: d.messageText || d.message || '',
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
_uriToPath(uri) {
|
|
210
|
+
return uri.replace(/^file:\/\//, '').replace(/%20/g, ' ');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
_positionToOffset(text, line, character) {
|
|
214
|
+
const lines = text.split('\n');
|
|
215
|
+
let offset = 0;
|
|
216
|
+
for (let i = 0; i < Math.min(line, lines.length - 1); i++) {
|
|
217
|
+
offset += lines[i].length + 1;
|
|
218
|
+
}
|
|
219
|
+
return offset + character;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
_completion(params) {
|
|
223
|
+
const { textDocument, position } = params;
|
|
224
|
+
const doc = this._getService(textDocument.uri);
|
|
225
|
+
if (!doc) return { isIncomplete: false, items: [] };
|
|
226
|
+
|
|
227
|
+
const offset = this._positionToOffset(doc.text, position.line, position.character);
|
|
228
|
+
try {
|
|
229
|
+
const raw = JSON.parse(doc.service.getCompletionsAtPosition(offset));
|
|
230
|
+
if (!raw || !raw.entries) return { isIncomplete: false, items: [] };
|
|
231
|
+
return {
|
|
232
|
+
isIncomplete: false,
|
|
233
|
+
items: raw.entries.map((e) => ({
|
|
234
|
+
label: e.name,
|
|
235
|
+
kind: this._completionKind(e.kind),
|
|
236
|
+
detail: e.kindModifiers,
|
|
237
|
+
})),
|
|
238
|
+
};
|
|
239
|
+
} catch { return { isIncomplete: false, items: [] }; }
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
_completionKind(kind) {
|
|
243
|
+
const map = {
|
|
244
|
+
function: 3, method: 2, property: 10, field: 5, variable: 6,
|
|
245
|
+
class: 7, interface: 8, module: 9, keyword: 14, text: 1,
|
|
246
|
+
};
|
|
247
|
+
return map[kind] || 1;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
_hover(params) {
|
|
251
|
+
const { textDocument, position } = params;
|
|
252
|
+
const doc = this._getService(textDocument.uri);
|
|
253
|
+
if (!doc) return null;
|
|
254
|
+
|
|
255
|
+
const offset = this._positionToOffset(doc.text, position.line, position.character);
|
|
256
|
+
try {
|
|
257
|
+
const raw = JSON.parse(doc.service.getQuickInfoAtPosition(offset));
|
|
258
|
+
if (!raw || !raw.displayString) return null;
|
|
259
|
+
return {
|
|
260
|
+
contents: { kind: 'markdown', value: '```typescript\n' + raw.displayString + '\n```' },
|
|
261
|
+
};
|
|
262
|
+
} catch { return null; }
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
_definition(params) {
|
|
266
|
+
const { textDocument, position } = params;
|
|
267
|
+
const doc = this._getService(textDocument.uri);
|
|
268
|
+
if (!doc) return null;
|
|
269
|
+
|
|
270
|
+
const offset = this._positionToOffset(doc.text, position.line, position.character);
|
|
271
|
+
try {
|
|
272
|
+
const raw = JSON.parse(doc.service.getDefinitionAtPosition(offset));
|
|
273
|
+
if (!raw || !raw.length) return null;
|
|
274
|
+
return raw.map((def) => ({
|
|
275
|
+
uri: 'file://' + def.fileName,
|
|
276
|
+
range: {
|
|
277
|
+
start: { line: def.line || 0, character: def.character || 0 },
|
|
278
|
+
end: { line: def.endLine || def.line || 0, character: def.endCharacter || def.character || 0 },
|
|
279
|
+
},
|
|
280
|
+
}));
|
|
281
|
+
} catch { return null; }
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
_references(params) {
|
|
285
|
+
const { textDocument, position } = params;
|
|
286
|
+
const doc = this._getService(textDocument.uri);
|
|
287
|
+
if (!doc) return [];
|
|
288
|
+
|
|
289
|
+
const offset = this._positionToOffset(doc.text, position.line, position.character);
|
|
290
|
+
try {
|
|
291
|
+
const raw = JSON.parse(doc.service.getReferencesAtPosition(offset));
|
|
292
|
+
if (!raw || !raw.length) return [];
|
|
293
|
+
return raw.map((ref) => ({
|
|
294
|
+
uri: 'file://' + ref.fileName,
|
|
295
|
+
range: {
|
|
296
|
+
start: { line: ref.line || 0, character: ref.character || 0 },
|
|
297
|
+
end: { line: ref.endLine || ref.line || 0, character: ref.endCharacter || ref.character || 0 },
|
|
298
|
+
},
|
|
299
|
+
}));
|
|
300
|
+
} catch { return []; }
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Start
|
|
305
|
+
new TszServer();
|
package/bin/tsz.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// tsz — type-checker CLI using the @mohsen-azimi/tsz-dev WASM module.
|
|
3
|
+
// Usage: tsz [options] [file1.ts file2.ts ...]
|
|
4
|
+
// --strict Enable strict mode
|
|
5
|
+
// --noEmit Type-check only (implied, tsz never emits)
|
|
6
|
+
// --project <path> Read tsconfig.json from <path> (default: tsconfig.json)
|
|
7
|
+
// --help Show this message
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
|
|
14
|
+
// Resolve the Node.js WASM build relative to this script's location.
|
|
15
|
+
// pkg/
|
|
16
|
+
// bin/tsz.js ← this file
|
|
17
|
+
// node/tsz_wasm.js ← CJS WASM module
|
|
18
|
+
const pkgDir = path.resolve(__dirname, '..');
|
|
19
|
+
const { TsProgram } = require(path.join(pkgDir, 'node', 'tsz_wasm.js'));
|
|
20
|
+
|
|
21
|
+
// ─── CLI argument parsing ─────────────────────────────────────────────────────
|
|
22
|
+
const args = process.argv.slice(2);
|
|
23
|
+
const files = [];
|
|
24
|
+
const options = {};
|
|
25
|
+
let i = 0;
|
|
26
|
+
|
|
27
|
+
while (i < args.length) {
|
|
28
|
+
const a = args[i];
|
|
29
|
+
if (a === '--help' || a === '-h') {
|
|
30
|
+
console.log([
|
|
31
|
+
'Usage: tsz [options] [file...]',
|
|
32
|
+
'',
|
|
33
|
+
'Options:',
|
|
34
|
+
' --strict Enable strict mode',
|
|
35
|
+
' --project <path> Path to tsconfig.json directory (default: .)',
|
|
36
|
+
' --help Show this help',
|
|
37
|
+
].join('\n'));
|
|
38
|
+
process.exit(0);
|
|
39
|
+
} else if (a === '--strict') {
|
|
40
|
+
options.strict = true;
|
|
41
|
+
} else if (a === '--project' || a === '-p') {
|
|
42
|
+
options.project = args[++i];
|
|
43
|
+
} else if (!a.startsWith('-')) {
|
|
44
|
+
files.push(path.resolve(a));
|
|
45
|
+
}
|
|
46
|
+
i++;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ─── Collect input files ──────────────────────────────────────────────────────
|
|
50
|
+
function readTsConfig(dir) {
|
|
51
|
+
const tsconfigPath = path.join(dir, 'tsconfig.json');
|
|
52
|
+
if (!fs.existsSync(tsconfigPath)) return null;
|
|
53
|
+
try {
|
|
54
|
+
const raw = fs.readFileSync(tsconfigPath, 'utf8');
|
|
55
|
+
// Strip single-line comments (tsconfig allows them)
|
|
56
|
+
const stripped = raw.replace(/\/\/[^\n]*/g, '');
|
|
57
|
+
return JSON.parse(stripped);
|
|
58
|
+
} catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function collectFiles(rootDir, tsconfig) {
|
|
64
|
+
const include = (tsconfig && tsconfig.include) || ['**/*.ts', '**/*.tsx'];
|
|
65
|
+
const exclude = new Set((tsconfig && tsconfig.exclude) || ['node_modules', 'dist', 'build']);
|
|
66
|
+
const collected = [];
|
|
67
|
+
|
|
68
|
+
function walk(dir) {
|
|
69
|
+
let entries;
|
|
70
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
71
|
+
for (const e of entries) {
|
|
72
|
+
if (exclude.has(e.name)) continue;
|
|
73
|
+
const full = path.join(dir, e.name);
|
|
74
|
+
if (e.isDirectory()) {
|
|
75
|
+
walk(full);
|
|
76
|
+
} else if (e.isFile() && /\.(ts|tsx)$/.test(e.name) && !e.name.endsWith('.d.ts')) {
|
|
77
|
+
collected.push(full);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
walk(rootDir);
|
|
83
|
+
return collected;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let inputFiles = files;
|
|
87
|
+
if (inputFiles.length === 0) {
|
|
88
|
+
const projectDir = path.resolve(options.project || '.');
|
|
89
|
+
const tsconfig = readTsConfig(projectDir);
|
|
90
|
+
inputFiles = collectFiles(projectDir, tsconfig);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (inputFiles.length === 0) {
|
|
94
|
+
console.error('tsz: no input files');
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ─── Run type checker ─────────────────────────────────────────────────────────
|
|
99
|
+
const program = new TsProgram();
|
|
100
|
+
program.setCompilerOptions(JSON.stringify(options));
|
|
101
|
+
|
|
102
|
+
for (const file of inputFiles) {
|
|
103
|
+
try {
|
|
104
|
+
const text = fs.readFileSync(file, 'utf8');
|
|
105
|
+
program.addSourceFile(file, text);
|
|
106
|
+
} catch (err) {
|
|
107
|
+
console.error(`tsz: cannot read ${file}: ${err.message}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
let diagnostics;
|
|
112
|
+
try {
|
|
113
|
+
diagnostics = JSON.parse(program.getSemanticDiagnosticsJson(undefined));
|
|
114
|
+
} catch (err) {
|
|
115
|
+
console.error(`tsz: internal error: ${err.message}`);
|
|
116
|
+
process.exit(2);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ─── Format and print diagnostics ─────────────────────────────────────────────
|
|
120
|
+
// Match tsc output format: path(line,col): error TS####: message
|
|
121
|
+
let errorCount = 0;
|
|
122
|
+
let warningCount = 0;
|
|
123
|
+
|
|
124
|
+
for (const d of diagnostics) {
|
|
125
|
+
const category = String(d.category || 'error').toLowerCase();
|
|
126
|
+
if (category === 'error') errorCount++;
|
|
127
|
+
else if (category === 'warning') warningCount++;
|
|
128
|
+
|
|
129
|
+
const file = d.file || '<unknown>';
|
|
130
|
+
const relFile = path.relative(process.cwd(), file);
|
|
131
|
+
const line = (d.line != null ? d.line + 1 : '?');
|
|
132
|
+
const col = (d.character != null ? d.character + 1 : '?');
|
|
133
|
+
const code = d.code ? `TS${d.code}` : '';
|
|
134
|
+
|
|
135
|
+
console.error(`${relFile}(${line},${col}): ${category} ${code}: ${d.messageText || d.message || ''}`);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (diagnostics.length === 0) {
|
|
139
|
+
console.log('tsz: no errors found');
|
|
140
|
+
process.exit(0);
|
|
141
|
+
} else {
|
|
142
|
+
if (errorCount > 0) {
|
|
143
|
+
console.error(`\nFound ${errorCount} error${errorCount === 1 ? '' : 's'}${warningCount > 0 ? ` and ${warningCount} warning${warningCount === 1 ? '' : 's'}` : ''}.`);
|
|
144
|
+
process.exit(1);
|
|
145
|
+
} else {
|
|
146
|
+
console.error(`\nFound ${warningCount} warning${warningCount === 1 ? '' : 's'}.`);
|
|
147
|
+
process.exit(0);
|
|
148
|
+
}
|
|
149
|
+
}
|
package/bundler/package.json
CHANGED
package/bundler/tsz_wasm_bg.wasm
CHANGED
|
Binary file
|
package/node/package.json
CHANGED
package/node/tsz_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mohsen-azimi/tsz-dev",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "WebAssembly bindings for the tsz TypeScript compiler",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Mohsen Azimi <mohsen@users.noreply.github.com>",
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"keywords": ["typescript", "type-checker", "compiler", "wasm"],
|
|
12
12
|
"main": "node/tsz_wasm.js",
|
|
13
13
|
"types": "node/tsz_wasm.d.ts",
|
|
14
|
+
"bin": {
|
|
15
|
+
"tsz": "./bin/tsz.js",
|
|
16
|
+
"tsz-server": "./bin/tsz-server.js"
|
|
17
|
+
},
|
|
14
18
|
"exports": {
|
|
15
19
|
".": {
|
|
16
20
|
"require": "./node/tsz_wasm.js",
|
|
@@ -18,5 +22,5 @@
|
|
|
18
22
|
"types": "./node/tsz_wasm.d.ts"
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
|
-
"files": ["node/", "bundler/", "LICENSE.txt"]
|
|
25
|
+
"files": ["node/", "bundler/", "bin/", "LICENSE.txt"]
|
|
22
26
|
}
|