@defold-typescript/transpiler 0.1.0 → 0.3.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 king8fisher (Anton Veretennikov)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # @defold-typescript/transpiler
2
+
3
+ The TypeScript-to-Lua build pipeline tuned for [Defold](https://defold.com/)'s
4
+ runtime — wraps [TypeScriptToLua](https://github.com/TypeScriptToLua/TypeScriptToLua)
5
+ with Defold-aware ambient typing, source maps, and incremental rebuild sessions.
6
+
7
+ ```sh
8
+ npm i @defold-typescript/transpiler
9
+ ```
10
+
11
+ Most users do not depend on this directly — the
12
+ [`defold-typescript`](https://www.npmjs.com/package/@defold-typescript/cli) CLI
13
+ drives it for you.
14
+
15
+ See the repository [README](https://github.com/king8fisher/defold-typescript#readme)
16
+ and [`docs/guide/`](https://github.com/king8fisher/defold-typescript/tree/main/docs/guide)
17
+ for the full workflow.
18
+
19
+ ## License
20
+
21
+ MIT
package/dist/index.js CHANGED
@@ -83,7 +83,7 @@ function eraseFactoryCall(expression, context) {
83
83
  if (name === undefined || fn === undefined) {
84
84
  continue;
85
85
  }
86
- const params = fn.parameters.filter((param) => !isThisParameter(param) && ts.isIdentifier(param.name)).map((param) => createIdentifier(param.name.text, param));
86
+ const params = fn.parameters.filter((param) => !isThisParameter(param) && ts.isIdentifier(param.name)).map((param) => context.transformExpression(param.name));
87
87
  const fnExpression = createFunctionExpression(createBlock(transformHookBody(fn, context)), params, undefined, NodeFlags.Declaration, fn);
88
88
  statements.push(createAssignmentStatement(createIdentifier(name), fnExpression, property));
89
89
  }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@defold-typescript/transpiler",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "TypeScript-to-Lua build pipeline tuned for Defold's runtime.",
5
+ "license": "MIT",
5
6
  "type": "module",
6
7
  "main": "./dist/index.js",
7
8
  "types": "./dist/index.d.ts",
@@ -27,7 +28,7 @@
27
28
  "test": "bun test"
28
29
  },
29
30
  "dependencies": {
30
- "@defold-typescript/types": "0.1.0",
31
+ "@defold-typescript/types": "0.3.0",
31
32
  "@typescript-to-lua/language-extensions": "1.19.0",
32
33
  "typescript-to-lua": "^1.36.0"
33
34
  }
@@ -98,7 +98,7 @@ function eraseFactoryCall(
98
98
  }
99
99
  const params: Identifier[] = fn.parameters
100
100
  .filter((param) => !isThisParameter(param) && ts.isIdentifier(param.name))
101
- .map((param) => createIdentifier((param.name as ts.Identifier).text, param));
101
+ .map((param) => context.transformExpression(param.name as ts.Identifier) as Identifier);
102
102
  const fnExpression = createFunctionExpression(
103
103
  createBlock(transformHookBody(fn, context)),
104
104
  params,