@jackctaylor/roblox-ts 3.0.0-projectrefs.2 → 3.0.0-projectrefs.4

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/out/CLI/cli.js CHANGED
File without changes
@@ -186,10 +186,10 @@ module.exports = typescript_1.default.identity({
186
186
  return { diagnostics: allDiagnostics, emitSkipped: depEmitSkipped || rootResult.emitSkipped };
187
187
  }
188
188
  if (rootData.projectOptions.watch) {
189
+ const EMIT_INTERVAL = 200;
189
190
  const CHOKIDAR_OPTIONS = {
190
191
  awaitWriteFinish: {
191
- pollInterval: 10,
192
- stabilityThreshold: 50,
192
+ stabilityThreshold: EMIT_INTERVAL,
193
193
  },
194
194
  ignoreInitial: true,
195
195
  };
@@ -374,28 +374,36 @@ module.exports = typescript_1.default.identity({
374
374
  function closeEventCollection() {
375
375
  collecting = false;
376
376
  collectionTimeout = undefined;
377
+ reportText("File change detected. Starting incremental compilation...");
377
378
  reportEmitResult(runCompile());
378
379
  }
379
380
  function openEventCollection() {
380
381
  if (!collecting) {
381
382
  collecting = true;
382
- reportText("File change detected. Starting incremental compilation...");
383
383
  }
384
384
  if (collectionTimeout) {
385
385
  clearTimeout(collectionTimeout);
386
386
  }
387
- collectionTimeout = setTimeout(closeEventCollection, 100);
387
+ collectionTimeout = setTimeout(closeEventCollection, EMIT_INTERVAL);
388
388
  }
389
389
  function collectAddEvent(fsPath) {
390
- filesToAdd.add(fixSlashes(fsPath));
390
+ const norm = fixSlashes(fsPath);
391
+ filesToDelete.delete(norm);
392
+ filesToChange.delete(norm);
393
+ filesToAdd.add(norm);
391
394
  openEventCollection();
392
395
  }
393
396
  function collectChangeEvent(fsPath) {
394
- filesToChange.add(fixSlashes(fsPath));
397
+ const norm = fixSlashes(fsPath);
398
+ filesToDelete.delete(norm);
399
+ filesToChange.add(norm);
395
400
  openEventCollection();
396
401
  }
397
402
  function collectDeleteEvent(fsPath) {
398
- filesToDelete.add(fixSlashes(fsPath));
403
+ const norm = fixSlashes(fsPath);
404
+ filesToAdd.delete(norm);
405
+ filesToChange.delete(norm);
406
+ filesToDelete.add(norm);
399
407
  openEventCollection();
400
408
  }
401
409
  const allRootDirs = [];
@@ -107,11 +107,13 @@ function transformer(program, config) {
107
107
  node.moduleSpecifier &&
108
108
  typescript_1.default.isStringLiteral(node.moduleSpecifier))
109
109
  return update(node, node.moduleSpecifier.text, p => {
110
- const newNode = factory.cloneNode(node.moduleSpecifier);
111
- typescript_1.default.setSourceMapRange(newNode, typescript_1.default.getSourceMapRange(node));
112
- typescript_1.default.setTextRange(newNode, node.moduleSpecifier);
113
- newNode.text = p.text;
114
- return Object.assign(node, { moduleSpecifier: newNode });
110
+ const moduleSpecifier = factory.createStringLiteral(p.text);
111
+ typescript_1.default.setSourceMapRange(moduleSpecifier, typescript_1.default.getSourceMapRange(node));
112
+ typescript_1.default.setTextRange(moduleSpecifier, node.moduleSpecifier);
113
+ if (typescript_1.default.isImportDeclaration(node)) {
114
+ return factory.updateImportDeclaration(node, node.modifiers, node.importClause, moduleSpecifier, node.attributes);
115
+ }
116
+ return factory.updateExportDeclaration(node, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.attributes);
115
117
  });
116
118
  if (typescript_1.default.isImportTypeNode(node)) {
117
119
  const argument = node.argument;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackctaylor/roblox-ts",
3
- "version": "3.0.0-projectrefs.2",
3
+ "version": "3.0.0-projectrefs.4",
4
4
  "description": "A TypeScript-to-Luau Compiler for Roblox",
5
5
  "main": "out/CLI/index.js",
6
6
  "repository": {