@kezh/my-custom-js-converter 1.6.0 → 1.6.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/test/run_tests.js DELETED
@@ -1,515 +0,0 @@
1
- const assert = require('assert');
2
- const fs = require('fs');
3
- const path = require('path');
4
- const { execSync } = require('child_process');
5
- const os = require('os');
6
-
7
- // ─── Constants ───────────────────────────────────────────────────────────────
8
- const PROJECT_ROOT = path.resolve(__dirname, '..');
9
- const COMPILED_CORE = path.join(PROJECT_ROOT, 'core');
10
- const FIXTURE_DIR = path.join(PROJECT_ROOT, 'test', 'fixtures', 'sample_project');
11
-
12
- // ─── Helpers ─────────────────────────────────────────────────────────────────
13
- let tempDir = '';
14
-
15
- function log(section, msg) {
16
- console.log(`\n[${section}] ${msg}`);
17
- }
18
-
19
- function setupTempProject() {
20
- tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'converter-test-'));
21
- log('SETUP', `Temp project: ${tempDir}`);
22
-
23
- // Create the parent project structure
24
- const srcDir = path.join(tempDir, 'src');
25
- const utilDir = path.join(srcDir, 'util');
26
- fs.mkdirSync(utilDir, { recursive: true });
27
- // libs 目录(通用依赖库,对应 config.libs: ["@/util"])
28
- const libUtilDir = path.join(tempDir, 'util');
29
- fs.mkdirSync(libUtilDir, { recursive: true });
30
-
31
- // Copy fixture source files
32
- fs.copyFileSync(
33
- path.join(FIXTURE_DIR, 'src', 'index.js'),
34
- path.join(srcDir, 'index.js')
35
- );
36
- fs.copyFileSync(
37
- path.join(FIXTURE_DIR, 'src', 'util', 'index.js'),
38
- path.join(utilDir, 'index.js')
39
- );
40
- fs.copyFileSync(
41
- path.join(FIXTURE_DIR, 'src', 'helper.js'),
42
- path.join(srcDir, 'helper.js')
43
- );
44
- // Copy libs 依赖文件
45
- fs.copyFileSync(
46
- path.join(FIXTURE_DIR, 'util', 'drawer.js'),
47
- path.join(libUtilDir, 'drawer.js')
48
- );
49
- fs.copyFileSync(
50
- path.join(FIXTURE_DIR, 'util', 'form.js'),
51
- path.join(libUtilDir, 'form.js')
52
- );
53
-
54
- // Copy config.json to parent project root
55
- fs.copyFileSync(
56
- path.join(FIXTURE_DIR, 'config.json'),
57
- path.join(tempDir, 'config.json')
58
- );
59
-
60
- // Create node_modules/@kezh/my-custom-js-converter symlink
61
- const modDir = path.join(tempDir, 'node_modules', '@kezh', 'my-custom-js-converter');
62
- fs.mkdirSync(modDir, { recursive: true });
63
-
64
- // Symlink the compiled core/ directory into the fake node_modules package
65
- const coreLink = path.join(modDir, 'core');
66
- if (os.platform() === 'win32') {
67
- // On Windows, use junction for directory symlinks (no admin needed)
68
- fs.symlinkSync(COMPILED_CORE, coreLink, 'junction');
69
- } else {
70
- fs.symlinkSync(COMPILED_CORE, coreLink);
71
- }
72
-
73
- // Also symlink package.json so the bin resolution works
74
- const pkgLink = path.join(modDir, 'package.json');
75
- if (os.platform() === 'win32') {
76
- // For files, just copy on Windows (symlink requires admin)
77
- fs.copyFileSync(path.join(PROJECT_ROOT, 'package.json'), pkgLink);
78
- } else {
79
- fs.symlinkSync(path.join(PROJECT_ROOT, 'package.json'), pkgLink);
80
- }
81
-
82
- log('SETUP', 'Fixture project created with node_modules symlink');
83
- }
84
-
85
- function cleanup() {
86
- if (tempDir && fs.existsSync(tempDir)) {
87
- fs.rmSync(tempDir, { recursive: true, force: true });
88
- log('CLEANUP', `Removed ${tempDir}`);
89
- }
90
- }
91
-
92
- function runEncode() {
93
- const encodeBin = path.join(tempDir, 'node_modules', '@kezh', 'my-custom-js-converter', 'core', 'encode', 'index.js');
94
- log('ENCODE', `Running: node ${encodeBin}`);
95
- const output = execSync(`node "${encodeBin}"`, {
96
- cwd: tempDir,
97
- encoding: 'utf-8',
98
- timeout: 30000
99
- });
100
- log('ENCODE', output);
101
- return output;
102
- }
103
-
104
- function runDecode() {
105
- const decodeBin = path.join(tempDir, 'node_modules', '@kezh', 'my-custom-js-converter', 'core', 'decode', 'index.js');
106
- log('DECODE', `Running: node ${decodeBin}`);
107
- const output = execSync(`node "${decodeBin}"`, {
108
- cwd: tempDir,
109
- encoding: 'utf-8',
110
- timeout: 30000
111
- });
112
- log('DECODE', output);
113
- return output;
114
- }
115
-
116
- // ─── Test Cases ──────────────────────────────────────────────────────────────
117
-
118
- // --- Encode tests ---
119
-
120
- function testEncodeOutputsExist() {
121
- log('TEST', 'Encode outputs exist');
122
-
123
- const codedPath = path.join(tempDir, 'src', 'coded.js');
124
- const mapPath = path.join(tempDir, 'src', '.setting', 'mod.map');
125
-
126
- assert.ok(fs.existsSync(codedPath), 'coded.js should exist after encode');
127
- assert.ok(fs.existsSync(mapPath), 'mod.map should exist after encode');
128
-
129
- log('TEST', '✓ coded.js and mod.map exist');
130
- }
131
-
132
- function testEncodeMapStructure() {
133
- log('TEST', 'Encode mod.map structure');
134
-
135
- const mapPath = path.join(tempDir, 'src', '.setting', 'mod.map');
136
- const map = JSON.parse(fs.readFileSync(mapPath, 'utf-8'));
137
-
138
- // Should have "self" key and dependency module keys
139
- assert.ok(map.self, 'mod.map should have "self" entry');
140
- assert.ok(map.self.dependencies, 'self should have dependencies');
141
- assert.ok(map.self.dependencies.util, 'self should depend on util');
142
- assert.ok(map.self.dependencies.helper, 'self should depend on helper');
143
- assert.ok(map.self.dependencies.drawer, 'self should depend on drawer');
144
- assert.ok(map.self.dependencies.form, 'self should depend on form');
145
-
146
- // Verify dependency method lists
147
- const utilMethods = map.self.dependencies.util.methods;
148
- const helperMethods = map.self.dependencies.helper.methods;
149
- assert.ok(utilMethods.includes('fetchData'), 'util dependency should include fetchData');
150
- assert.ok(utilMethods.includes('formatData'), 'util dependency should include formatData');
151
- assert.ok(helperMethods.includes('validate'), 'helper dependency should include validate');
152
- assert.ok(helperMethods.includes('transform'), 'helper dependency should include transform');
153
-
154
- // Verify util and helper module entries exist
155
- assert.ok(map.util, 'mod.map should have "util" entry');
156
- assert.ok(map.helper, 'mod.map should have "helper" entry');
157
- assert.ok(map.drawer, 'mod.map should have "drawer" entry');
158
- assert.ok(map.form, 'mod.map should have "form" entry');
159
-
160
- log('TEST', `✓ mod.map has keys: ${Object.keys(map).join(', ')}`);
161
- }
162
-
163
- function testEncodeMethodRenaming() {
164
- log('TEST', 'Encode method renaming (__modName suffix)');
165
-
166
- const codedPath = path.join(tempDir, 'src', 'coded.js');
167
- const coded = fs.readFileSync(codedPath, 'utf-8');
168
-
169
- // Encoded file should contain methods with __modName suffix
170
- assert.ok(coded.includes('__util'), 'Encoded file should contain __util suffix');
171
- assert.ok(coded.includes('__helper'), 'Encoded file should contain __helper suffix');
172
- assert.ok(coded.includes('__drawer'), 'Encoded file should contain __drawer suffix');
173
- assert.ok(coded.includes('__form'), 'Encoded file should contain __form suffix');
174
-
175
- // Specific renamed methods should exist
176
- assert.ok(coded.includes('fetchData__util'), 'fetchData__util should exist');
177
- assert.ok(coded.includes('formatData__util'), 'formatData__util should exist');
178
- assert.ok(coded.includes('validate__helper'), 'validate__helper should exist');
179
- assert.ok(coded.includes('transform__helper'), 'transform__helper should exist');
180
- assert.ok(coded.includes('pop__drawer'), 'pop__drawer should exist');
181
- assert.ok(coded.includes('setValue__form'), 'setValue__form should exist');
182
-
183
- log('TEST', '✓ Method renaming confirmed in coded.js');
184
- }
185
-
186
- function testEncodeSelfMethodsUnrenamed() {
187
- log('TEST', 'Encode self module methods keep original names');
188
-
189
- const codedPath = path.join(tempDir, 'src', 'coded.js');
190
- const coded = fs.readFileSync(codedPath, 'utf-8');
191
-
192
- // Self module methods (init, loadData, process) should NOT have __suffix
193
- assert.ok(coded.includes('init()'), 'init() should exist without suffix');
194
- assert.ok(coded.includes('loadData()'), 'loadData() should exist without suffix');
195
- assert.ok(coded.includes('process(name)'), 'process(name) should exist without suffix');
196
-
197
- log('TEST', '✓ Self module methods keep original names');
198
- }
199
-
200
- function testEncodeThisCallsRenamed() {
201
- log('TEST', 'Encode this.method() calls in self become this.method__dep()');
202
-
203
- const codedPath = path.join(tempDir, 'src', 'coded.js');
204
- const coded = fs.readFileSync(codedPath, 'utf-8');
205
-
206
- // In the self module, calls like util.formatData() become this.formatData__util()
207
- assert.ok(coded.includes('this.formatData__util'), 'this.formatData__util should exist');
208
- assert.ok(coded.includes('this.validate__helper'), 'this.validate__helper should exist');
209
- assert.ok(coded.includes('this.fetchData__util'), 'this.fetchData__util should exist');
210
- assert.ok(coded.includes('this.transform__helper'), 'this.transform__helper should exist');
211
- assert.ok(coded.includes('this.pop__drawer'), 'this.pop__drawer should exist');
212
- assert.ok(coded.includes('this.setValue__form'), 'this.setValue__form should exist');
213
-
214
- log('TEST', '✓ Dependency method calls renamed to this.method__dep()');
215
- }
216
-
217
- function testEncodeDependencyInternalCallsRenamed() {
218
- log('TEST', 'Encode this.method() inside dependency modules get __modName suffix');
219
-
220
- const codedPath = path.join(tempDir, 'src', 'coded.js');
221
- const coded = fs.readFileSync(codedPath, 'utf-8');
222
-
223
- // Inside util module, this.parseData() becomes this.parseData__util()
224
- assert.ok(coded.includes('this.parseData__util'), 'this.parseData__util should exist');
225
- // Inside helper module, this.check() becomes this.check__helper()
226
- assert.ok(coded.includes('this.check__helper'), 'this.check__helper should exist');
227
-
228
- log('TEST', '✓ Internal dependency method calls renamed correctly');
229
- }
230
-
231
- // --- Decode tests ---
232
-
233
- function testDecodeOutputsExist() {
234
- log('TEST', 'Decode outputs exist');
235
-
236
- const decodedPath = path.join(tempDir, 'src', 'decoded.js');
237
- assert.ok(fs.existsSync(decodedPath), 'decoded.js should exist after decode');
238
-
239
- log('TEST', '✓ decoded.js exists');
240
- }
241
-
242
- function testDecodeRestoresRequire() {
243
- log('TEST', 'Decode restores require() statements');
244
-
245
- const decodedPath = path.join(tempDir, 'src', 'decoded.js');
246
- const decoded = fs.readFileSync(decodedPath, 'utf-8');
247
-
248
- // Decoded file should have require() calls for dependencies
249
- const hasRequire = decoded.includes('require(');
250
- assert.ok(hasRequire, 'Decoded file should contain require() statements');
251
-
252
- // Should have require for both util and helper
253
- assert.ok(decoded.includes('util') && decoded.includes('require('),
254
- 'Decoded file should reference util in require');
255
- assert.ok(decoded.includes('helper') && decoded.includes('require('),
256
- 'Decoded file should reference helper in require');
257
-
258
- log('TEST', '✓ require() statements restored in decoded.js');
259
- }
260
-
261
- function testDecodeRemovesInlinedMethods() {
262
- log('TEST', 'Decode removes inlined dependency methods');
263
-
264
- const decodedPath = path.join(tempDir, 'src', 'decoded.js');
265
- const decoded = fs.readFileSync(decodedPath, 'utf-8');
266
-
267
- // After decode, dependency methods with __modName should be removed
268
- const hasInlinedUtilMethods = /this\.\w+__util/.test(decoded);
269
- const hasInlinedHelperMethods = /this\.\w+__helper/.test(decoded);
270
- assert.ok(!hasInlinedUtilMethods, 'Decoded file should not have this.method__util patterns');
271
- assert.ok(!hasInlinedHelperMethods, 'Decoded file should not have this.method__helper patterns');
272
-
273
- // Dependency method definitions should be removed
274
- assert.ok(!decoded.includes('fetchData__util'), 'fetchData__util definition should be removed');
275
- assert.ok(!decoded.includes('validate__helper'), 'validate__helper definition should be removed');
276
-
277
- log('TEST', '✓ Inlined dependency methods removed from decoded.js');
278
- }
279
-
280
- function testDecodeRestoresMethodNames() {
281
- log('TEST', 'Decode restores original method names');
282
-
283
- const decodedPath = path.join(tempDir, 'src', 'decoded.js');
284
- const decoded = fs.readFileSync(decodedPath, 'utf-8');
285
-
286
- // The decoded file should reference dependency methods via depName.method()
287
- assert.ok(decoded.includes('util.formatData') || decoded.includes('util.fetchData'),
288
- 'Decoded file should call util methods via util.method()');
289
- assert.ok(decoded.includes('helper.validate') || decoded.includes('helper.transform'),
290
- 'Decoded file should call helper methods via helper.method()');
291
- assert.ok(decoded.includes('drawer.pop'),
292
- 'Decoded file should call drawer methods via drawer.method()');
293
- assert.ok(decoded.includes('form.setValue'),
294
- 'Decoded file should call form methods via form.method()');
295
-
296
- log('TEST', '✓ Original method call patterns restored in decoded.js');
297
- }
298
-
299
- function testDecodeMountVariable() {
300
- log('TEST', 'Decode creates mount variable');
301
-
302
- const decodedPath = path.join(tempDir, 'src', 'decoded.js');
303
- const decoded = fs.readFileSync(decodedPath, 'utf-8');
304
-
305
- // The decoded file should have the mount variable (customEvent)
306
- assert.ok(decoded.includes('customEvent'), 'Decoded file should contain the mount variable "customEvent"');
307
- assert.ok(decoded.includes('module.exports = customEvent'), 'Decoded file should export customEvent');
308
-
309
- log('TEST', '✓ Mount variable "customEvent" present in decoded.js');
310
- }
311
-
312
- function testDecodeSelfMethodsPreserved() {
313
- log('TEST', 'Decode preserves self module methods');
314
-
315
- const decodedPath = path.join(tempDir, 'src', 'decoded.js');
316
- const decoded = fs.readFileSync(decodedPath, 'utf-8');
317
-
318
- // Self module methods should still be present
319
- assert.ok(decoded.includes('init()'), 'init() should be preserved');
320
- assert.ok(decoded.includes('loadData()'), 'loadData() should be preserved');
321
- assert.ok(decoded.includes('process(name)'), 'process(name) should be preserved');
322
-
323
- log('TEST', '✓ Self module methods preserved in decoded.js');
324
- }
325
-
326
- function testDecodeNoDoubleSuffix() {
327
- log('TEST', 'Decode does not leave any __modName suffixes');
328
-
329
- const decodedPath = path.join(tempDir, 'src', 'decoded.js');
330
- const decoded = fs.readFileSync(decodedPath, 'utf-8');
331
-
332
- // No method names should have __suffix pattern remaining
333
- const hasDoubleUnderscoreSuffix = /\w+__(util|helper|drawer|form)/.test(decoded);
334
- assert.ok(!hasDoubleUnderscoreSuffix, 'Decoded file should not contain any __modName suffixes');
335
-
336
- log('TEST', '✓ No __modName suffixes remain in decoded.js');
337
- }
338
-
339
- /**
340
- * 模拟本地 mod.map 缺失 drawer/form 依赖(未及时更新)
341
- * 从 mod.map 中删除 drawer 和 form 条目及 self 对它们的依赖
342
- */
343
- function stripMissingDepsFromMap() {
344
- log('SETUP', '模拟 mod.map 缺失 drawer/form 依赖');
345
-
346
- const mapPath = path.join(tempDir, 'src', '.setting', 'mod.map');
347
- const map = JSON.parse(fs.readFileSync(mapPath, 'utf-8'));
348
- delete map.self.dependencies.drawer;
349
- delete map.self.dependencies.form;
350
- delete map.drawer;
351
- delete map.form;
352
- fs.writeFileSync(mapPath, JSON.stringify(map, null, 4), 'utf-8');
353
-
354
- log('SETUP', '已从 mod.map 删除 drawer/form 条目');
355
- }
356
-
357
- function testDecodeSupplementsMissingDeps() {
358
- log('TEST', 'Decode supplements missing deps into mod.map');
359
-
360
- const mapPath = path.join(tempDir, 'src', '.setting', 'mod.map');
361
- const map = JSON.parse(fs.readFileSync(mapPath, 'utf-8'));
362
-
363
- // drawer 和 form 应被自动补充回 mod.map
364
- assert.ok(map.self && map.self.dependencies && map.self.dependencies.drawer,
365
- 'mod.map should have self.dependencies.drawer supplemented');
366
- assert.ok(map.self && map.self.dependencies && map.self.dependencies.form,
367
- 'mod.map should have self.dependencies.form supplemented');
368
- assert.ok(map.drawer, 'mod.map should have "drawer" entry supplemented');
369
- assert.ok(map.form, 'mod.map should have "form" entry supplemented');
370
-
371
- // 补充的 src 路径应指向 libs 目录下的文件
372
- assert.ok(map.drawer.src && map.drawer.src.includes('drawer'),
373
- 'drawer src should point to drawer file');
374
- assert.ok(map.form.src && map.form.src.includes('form'),
375
- 'form src should point to form file');
376
-
377
- log('TEST', '✓ Missing deps supplemented in mod.map');
378
- }
379
-
380
- function testDecodeRestoresMissingDepCalls() {
381
- log('TEST', 'Decode restores missing dep calls (this.pop__drawer -> drawer.pop)');
382
-
383
- const decodedPath = path.join(tempDir, 'src', 'decoded.js');
384
- const decoded = fs.readFileSync(decodedPath, 'utf-8');
385
-
386
- // this.pop__drawer(...) 应被还原为 drawer.pop(...)
387
- assert.ok(decoded.includes('drawer.pop'),
388
- 'this.pop__drawer should be restored to drawer.pop');
389
- // this.setValue__form(...) 应被还原为 form.setValue(...)
390
- assert.ok(decoded.includes('form.setValue'),
391
- 'this.setValue__form should be restored to form.setValue');
392
-
393
- // 内联的依赖方法定义应被删除
394
- assert.ok(!decoded.includes('pop__drawer'),
395
- 'pop__drawer definition should be removed');
396
- assert.ok(!decoded.includes('setValue__form'),
397
- 'setValue__form definition should be removed');
398
-
399
- // 应生成 require 语句
400
- assert.ok(/const\s+drawer\s*=\s*require/.test(decoded),
401
- 'should generate "const drawer = require(...)"');
402
- assert.ok(/const\s+form\s*=\s*require/.test(decoded),
403
- 'should generate "const form = require(...)"');
404
-
405
- log('TEST', '✓ Missing dep calls restored in decoded.js');
406
- }
407
-
408
- // ─── Main ────────────────────────────────────────────────────────────────────
409
-
410
- function main() {
411
- console.log('═══════════════════════════════════════════════════════');
412
- console.log(' my-custom-js-converter Integration Tests');
413
- console.log('═══════════════════════════════════════════════════════');
414
-
415
- let passed = 0;
416
- let failed = 0;
417
- const errors = [];
418
-
419
- // Ensure project is built
420
- if (!fs.existsSync(COMPILED_CORE)) {
421
- console.error('\nERROR: Project not built. Run "pnpm build" first.');
422
- process.exit(1);
423
- }
424
-
425
- try {
426
- // Setup
427
- setupTempProject();
428
-
429
- // ── Encode tests ──
430
- log('PHASE', '═══ ENCODE ═══');
431
- try {
432
- runEncode();
433
- } catch (err) {
434
- console.error('Encode command failed:', err.message);
435
- throw err;
436
- }
437
-
438
- const encodeTests = [
439
- testEncodeOutputsExist,
440
- testEncodeMapStructure,
441
- testEncodeMethodRenaming,
442
- testEncodeSelfMethodsUnrenamed,
443
- testEncodeThisCallsRenamed,
444
- testEncodeDependencyInternalCallsRenamed,
445
- ];
446
-
447
- for (const test of encodeTests) {
448
- try {
449
- test();
450
- passed++;
451
- } catch (err) {
452
- failed++;
453
- errors.push({ test: test.name, error: err.message });
454
- console.error(` ✗ ${test.name}: ${err.message}`);
455
- }
456
- }
457
-
458
- // ── Decode tests ──
459
- log('PHASE', '═══ DECODE ═══');
460
-
461
- // 模拟本地 mod.map 缺失 drawer/form 依赖(未及时更新)
462
- // decode 应自动从 config.libs 目录找回并补充 mod.map
463
- stripMissingDepsFromMap();
464
-
465
- try {
466
- runDecode();
467
- } catch (err) {
468
- console.error('Decode command failed:', err.message);
469
- throw err;
470
- }
471
-
472
- const decodeTests = [
473
- testDecodeOutputsExist,
474
- testDecodeRestoresRequire,
475
- testDecodeRemovesInlinedMethods,
476
- testDecodeRestoresMethodNames,
477
- testDecodeMountVariable,
478
- testDecodeSelfMethodsPreserved,
479
- testDecodeNoDoubleSuffix,
480
- testDecodeSupplementsMissingDeps,
481
- testDecodeRestoresMissingDepCalls,
482
- ];
483
-
484
- for (const test of decodeTests) {
485
- try {
486
- test();
487
- passed++;
488
- } catch (err) {
489
- failed++;
490
- errors.push({ test: test.name, error: err.message });
491
- console.error(` ✗ ${test.name}: ${err.message}`);
492
- }
493
- }
494
-
495
- } catch (err) {
496
- failed++;
497
- errors.push({ test: 'setup/run', error: err.message });
498
- } finally {
499
- cleanup();
500
- }
501
-
502
- // ── Summary ──
503
- console.log('\n═══════════════════════════════════════════════════════');
504
- console.log(` Results: ${passed} passed, ${failed} failed`);
505
- console.log('═══════════════════════════════════════════════════════');
506
-
507
- if (errors.length) {
508
- console.log('\nFailures:');
509
- errors.forEach((e, i) => console.log(` ${i + 1}. ${e.test}: ${e.error}`));
510
- }
511
-
512
- process.exit(failed > 0 ? 1 : 0);
513
- }
514
-
515
- main();
package/tsconfig.json DELETED
@@ -1,103 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
- "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
- // "jsx": "preserve", /* Specify what JSX code is generated. */
17
- // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
-
27
- /* Modules */
28
- "module": "commonjs", /* Specify what module code is generated. */
29
- "rootDir": "./src", /* Specify the root folder within your source files. */
30
- // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
- "types": ["node"], /* Specify type package names to be included without being referenced in a source file. */
36
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
- // "resolveJsonModule": true, /* Enable importing .json files. */
39
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
40
-
41
- /* JavaScript Support */
42
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45
-
46
- /* Emit */
47
- "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
49
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
50
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
51
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
52
- "outDir": "./core", /* Specify an output folder for all emitted files. */
53
- // "removeComments": true, /* Disable emitting comments. */
54
- // "noEmit": true, /* Disable emitting files from a compilation. */
55
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
56
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
57
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
59
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
62
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
63
- // "newLine": "crlf", /* Set the newline character for emitting files. */
64
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
65
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
66
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
67
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
68
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
69
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
70
-
71
- /* Interop Constraints */
72
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
74
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
75
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
76
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
77
-
78
- /* Type Checking */
79
- "strict": true, /* Enable all strict type-checking options. */
80
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
86
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
87
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
90
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
92
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
93
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
94
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
95
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
96
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
97
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
98
-
99
- /* Completeness */
100
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
- }
103
- }
@@ -1 +0,0 @@
1
- {"root":["./src/config/index.ts","./src/config/main_config.ts","./src/config/map_config.ts","./src/context/map_context.ts","./src/decode/index.ts","./src/encode/index.ts","./src/scanf/index.ts","./src/util/ast.ts","./src/util/logger.ts","./src/util/parent_path.ts","./src/util/version.ts"],"version":"6.0.3"}