typescript-to-lua 1.17.0 → 1.18.0

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.
@@ -7,7 +7,7 @@ export declare const lualibDiagnostic: ((message: string, file?: ts.SourceFile |
7
7
  };
8
8
  declare class LuaLibPlugin implements tstl.Plugin {
9
9
  visitors: {
10
- 311: (file: ts.SourceFile, context: tstl.TransformationContext) => tstl.File;
10
+ 312: (file: ts.SourceFile, context: tstl.TransformationContext) => tstl.File;
11
11
  };
12
12
  printer: tstl.Printer;
13
13
  afterPrint(program: ts.Program, options: tstl.CompilerOptions, emitHost: EmitHost, result: ProcessedFile[]): ts.Diagnostic[];
@@ -10,10 +10,11 @@ const utils_1 = require("../utils");
10
10
  const diagnostics_1 = require("./diagnostics");
11
11
  const CompilerOptions_1 = require("../CompilerOptions");
12
12
  const find_lua_requires_1 = require("./find-lua-requires");
13
+ const picomatch = require("picomatch");
13
14
  const resolver = resolve.ResolverFactory.createResolver({
14
15
  extensions: [".lua"],
15
16
  enforceExtension: true,
16
- fileSystem: { ...new resolve.CachedInputFileSystem(fs) },
17
+ fileSystem: { ...new resolve.CachedInputFileSystem(fs, 0) },
17
18
  useSyncFileSystemCalls: true,
18
19
  conditionNames: ["require", "node", "tstl", "default"],
19
20
  symlinks: false, // Do not resolve symlinks to their original paths (that breaks node_modules detection)
@@ -29,7 +30,9 @@ class ResolutionContext {
29
30
  this.processedDependencies = new Set();
30
31
  // value is false if already searched but not found
31
32
  this.pathToFile = new Map();
32
- this.noResolvePaths = new Set(options.noResolvePaths);
33
+ const unique = [...new Set(options.noResolvePaths)];
34
+ const matchers = unique.map(x => picomatch(x));
35
+ this.noResolvePaths = matchers;
33
36
  }
34
37
  addAndResolveDependencies(file) {
35
38
  if (this.resolvedFiles.has(file.fileName))
@@ -59,7 +62,7 @@ class ResolutionContext {
59
62
  this.resolvedFiles.set("lualib_bundle", { fileName: "lualib_bundle", code: "" });
60
63
  return;
61
64
  }
62
- if (this.noResolvePaths.has(required.requirePath)) {
65
+ if (this.noResolvePaths.find(isMatch => isMatch(required.requirePath))) {
63
66
  if (this.options.tstlVerbose) {
64
67
  console.log(`Skipping module resolution of ${required.requirePath} as it is in the tsconfig noResolvePaths.`);
65
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-to-lua",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua!",
5
5
  "repository": "https://github.com/TypeScriptToLua/TypeScriptToLua",
6
6
  "homepage": "https://typescripttolua.github.io/",
@@ -42,11 +42,12 @@
42
42
  "node": ">=16.10.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "typescript": "~5.1.3"
45
+ "typescript": "5.2.2"
46
46
  },
47
47
  "dependencies": {
48
48
  "@typescript-to-lua/language-extensions": "1.0.0",
49
49
  "enhanced-resolve": "^5.8.2",
50
+ "picomatch": "^2.3.1",
50
51
  "resolve": "^1.15.1",
51
52
  "source-map": "^0.7.3"
52
53
  },
@@ -55,10 +56,11 @@
55
56
  "@types/glob": "^7.1.1",
56
57
  "@types/jest": "^27.5.2",
57
58
  "@types/node": "^13.7.7",
59
+ "@types/picomatch": "^2.3.0",
58
60
  "@types/resolve": "1.14.0",
59
- "@typescript-eslint/eslint-plugin": "^5.55.0",
60
- "@typescript-eslint/parser": "^5.55.0",
61
- "eslint": "^8.36.0",
61
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
62
+ "@typescript-eslint/parser": "^5.62.0",
63
+ "eslint": "^8.47.0",
62
64
  "eslint-plugin-import": "^2.27.5",
63
65
  "eslint-plugin-jest": "^26.9.0",
64
66
  "fs-extra": "^8.1.0",
@@ -70,6 +72,6 @@
70
72
  "prettier": "^2.8.4",
71
73
  "ts-jest": "^29.1.0",
72
74
  "ts-node": "^10.9.1",
73
- "typescript": "~5.1.3"
75
+ "typescript": "^5.2.2"
74
76
  }
75
77
  }