@defold-typescript/transpiler 0.42.0 → 0.44.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/dist/emitted-requires.d.ts +1 -1
- package/dist/hsm/async.ts +73 -0
- package/dist/hsm/debug.ts +119 -0
- package/dist/hsm/defold.ts +39 -0
- package/dist/hsm/index.ts +1418 -0
- package/dist/hsm-builtin.d.ts +26 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +340 -130
- package/dist/transpile.d.ts +11 -0
- package/package.json +4 -3
- package/src/emitted-requires.ts +6 -4
- package/src/hsm-builtin.ts +246 -0
- package/src/index.ts +11 -1
- package/src/session.ts +2 -0
- package/src/transpile.ts +118 -26
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Plugin } from "typescript-to-lua";
|
|
2
|
+
export declare const HSM_MODULE_SPECIFIER = "@defold-typescript/types/hsm";
|
|
3
|
+
export declare const HSM_REQUIRE_ROOT = "defold_typescript_hsm";
|
|
4
|
+
export declare const HSM_LUALIB_MODULES: ReadonlySet<string>;
|
|
5
|
+
export interface HsmModule {
|
|
6
|
+
/** The source file's basename without `.ts`. */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** What a user imports. */
|
|
9
|
+
readonly specifier: string;
|
|
10
|
+
/** What the import lowers to, and the module path the CLI writes it under. */
|
|
11
|
+
readonly requireName: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function hsmRequireName(name: string): string;
|
|
14
|
+
export declare function hsmSourceFiles(dir: string): string[];
|
|
15
|
+
export declare function resolveHsmSourceDir(packageRoot?: string): string | null;
|
|
16
|
+
export declare function requireHsmSourceDir(): string;
|
|
17
|
+
export declare function hsmModules(): readonly HsmModule[];
|
|
18
|
+
export declare function isHsmRequireName(requirePath: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The hsm modules a program needs: every one its chunks require, plus every one
|
|
21
|
+
* those require in turn. Read from emitted Lua rather than the import AST, so an
|
|
22
|
+
* import TypeScript elides (`import type`, an unused binding) selects nothing.
|
|
23
|
+
* `compile` runs only when some chunk requires a module.
|
|
24
|
+
*/
|
|
25
|
+
export declare function hsmClosure(chunks: Iterable<string>, compile: () => Readonly<Record<string, string>>): Record<string, string> | undefined;
|
|
26
|
+
export declare const hsmLoweringPlugin: Plugin;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export type { GuiFlipbookIndex } from "./gui-flipbook-index";
|
|
|
8
8
|
export { buildGuiFlipbookIndex } from "./gui-flipbook-index";
|
|
9
9
|
export type { GuiNodeIndex } from "./gui-node-index";
|
|
10
10
|
export { buildGuiNodeIndex, guiScriptResourceOf, guiScriptResourcesOf, } from "./gui-node-index";
|
|
11
|
+
export type { HsmModule } from "./hsm-builtin";
|
|
12
|
+
export { HSM_MODULE_SPECIFIER, HSM_REQUIRE_ROOT, hsmModules, hsmRequireName, hsmSourceFiles, requireHsmSourceDir, resolveHsmSourceDir, } from "./hsm-builtin";
|
|
11
13
|
export { buildInputActionIndex } from "./input-action-index";
|
|
12
14
|
export type { ExtensionDependency, LibraryIncludedEntries, LibrarySceneDocument, LibrarySceneDocuments, LibrarySharedEntry, } from "./library-dependencies";
|
|
13
15
|
export { archiveWrapperOf, isContainedResourcePath, LIBRARY_DEPENDENCY_ROOT, libraryIncludedEntries, readGameProjectDependencies, readLibrarySceneDocuments, } from "./library-dependencies";
|
|
@@ -36,7 +38,7 @@ export type { TextScriptPropertyFinding } from "./text-script-property";
|
|
|
36
38
|
export { findTextScriptProperties } from "./text-script-property";
|
|
37
39
|
export { TIMERS_REQUIRE_NAME } from "./timers-runtime";
|
|
38
40
|
export type { TranspileDiagnostic, TranspileProjectInput, TranspileProjectResult, TranspileResult, } from "./transpile";
|
|
39
|
-
export { transpile, transpileProject } from "./transpile";
|
|
41
|
+
export { compileHsmModules, transpile, transpileProject } from "./transpile";
|
|
40
42
|
export type { ClassifiedSlot } from "./url-address-slots";
|
|
41
43
|
export { addressClassOfArgument, addressEntryOfArgument, isAddressClass, isFragmentCaret, resolveClassifiedSlotAtPosition, } from "./url-address-slots";
|
|
42
44
|
export type { CrossWorldAddressFinding } from "./url-cross-world-address";
|