@defold-typescript/cli 0.5.5 → 0.6.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/bin.js +1414 -395
- package/dist/bob-command.d.ts +31 -0
- package/dist/bob.d.ts +19 -0
- package/dist/boot-path.d.ts +5 -0
- package/dist/build-output.d.ts +7 -1
- package/dist/debug-launcher.d.ts +7 -1
- package/dist/directory-walls.d.ts +23 -0
- package/dist/dispatch.d.ts +6 -0
- package/dist/index.js +1268 -248
- package/dist/init.d.ts +1 -2
- package/dist/install-reminder.d.ts +1 -0
- package/dist/json-output.d.ts +26 -2
- package/dist/materialize.d.ts +0 -3
- package/dist/mise-scaffold.d.ts +1 -1
- package/dist/scan.d.ts +1 -0
- package/dist/script-kind.d.ts +2 -1
- package/dist/setup-debug.d.ts +40 -0
- package/dist/wall-interactive.d.ts +16 -0
- package/dist/wall.d.ts +4 -0
- package/dist/watch.d.ts +1 -0
- package/package.json +4 -3
- package/src/bob-command.ts +137 -0
- package/src/bob.ts +59 -0
- package/src/boot-path.ts +113 -0
- package/src/build-output.ts +67 -3
- package/src/build-session.ts +31 -11
- package/src/build.ts +6 -5
- package/src/debug-launcher.ts +36 -12
- package/src/directory-walls.ts +214 -0
- package/src/dispatch.ts +264 -18
- package/src/init.ts +83 -38
- package/src/install-reminder.ts +18 -0
- package/src/json-output.ts +52 -7
- package/src/materialize.ts +14 -12
- package/src/mise-scaffold.ts +16 -10
- package/src/scan.ts +7 -1
- package/src/script-kind.ts +31 -19
- package/src/setup-debug.ts +422 -0
- package/src/wall-interactive.ts +60 -0
- package/src/wall.ts +71 -0
- package/src/watch.ts +15 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const DEFOLD_SUBCOMMANDS: readonly ["resolve", "build", "bundle"];
|
|
2
|
+
export type DefoldSubcommand = (typeof DEFOLD_SUBCOMMANDS)[number];
|
|
3
|
+
export declare function isDefoldSubcommand(value: string | undefined): value is DefoldSubcommand;
|
|
4
|
+
export declare function composeBobArgv(opts: {
|
|
5
|
+
java: string;
|
|
6
|
+
jar: string;
|
|
7
|
+
subcommand: string;
|
|
8
|
+
buildServer?: string;
|
|
9
|
+
}): string[];
|
|
10
|
+
export interface DefoldIo {
|
|
11
|
+
readonly cacheDir: string;
|
|
12
|
+
readonly fetchSha: () => Promise<string>;
|
|
13
|
+
readonly probe: (candidate: string) => boolean;
|
|
14
|
+
readonly javaProbe: (cmd: string) => boolean;
|
|
15
|
+
readonly spawn: (argv: string[], cwd: string) => Promise<number>;
|
|
16
|
+
readonly download: (url: string, dest: string) => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface DefoldCommandResult {
|
|
19
|
+
readonly ok: boolean;
|
|
20
|
+
readonly subcommand: string;
|
|
21
|
+
readonly exitCode: number;
|
|
22
|
+
readonly argv: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function runDefoldCommand(opts: {
|
|
25
|
+
cwd: string;
|
|
26
|
+
subcommand: string;
|
|
27
|
+
java?: string;
|
|
28
|
+
buildServer?: string;
|
|
29
|
+
io: DefoldIo;
|
|
30
|
+
}): Promise<DefoldCommandResult>;
|
|
31
|
+
export declare function defaultDefoldIo(): DefoldIo;
|
package/dist/bob.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function bobDownloadUrl(sha1: string): string;
|
|
2
|
+
export declare function bobCacheDir(env?: NodeJS.ProcessEnv, home?: () => string): string;
|
|
3
|
+
export declare function bobCachePath(opts: {
|
|
4
|
+
sha1: string;
|
|
5
|
+
cacheDir: string;
|
|
6
|
+
}): string;
|
|
7
|
+
export interface ResolvedBobJar {
|
|
8
|
+
readonly jarPath: string;
|
|
9
|
+
readonly cached: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveBobJar(opts: {
|
|
12
|
+
sha1: string;
|
|
13
|
+
cacheDir: string;
|
|
14
|
+
probe: (candidate: string) => boolean;
|
|
15
|
+
}): ResolvedBobJar;
|
|
16
|
+
export declare function resolveJava(opts: {
|
|
17
|
+
override?: string;
|
|
18
|
+
probe: (cmd: string) => boolean;
|
|
19
|
+
}): string;
|
package/dist/build-output.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TranspileDiagnostic } from "@defold-typescript/transpiler";
|
|
2
|
+
import type { ScriptKind } from "./script-kind";
|
|
2
3
|
export interface BuildConfig {
|
|
3
4
|
readonly outDir: string | undefined;
|
|
4
5
|
readonly include: string[];
|
|
@@ -6,7 +7,12 @@ export interface BuildConfig {
|
|
|
6
7
|
export declare function toPosix(p: string, sep?: string): string;
|
|
7
8
|
export declare function isTranspilerSource(rel: string): boolean;
|
|
8
9
|
export declare function readBuildConfig(cwd: string): BuildConfig;
|
|
9
|
-
export
|
|
10
|
+
export type SourceOutputKind = ScriptKind | "module";
|
|
11
|
+
export declare function detectSourceOutputKind(source: string): SourceOutputKind;
|
|
12
|
+
export declare function detectSourceScriptKind(source: string): ScriptKind;
|
|
13
|
+
export declare function computeOutputRel(rel: string, config: BuildConfig, kind: SourceOutputKind): string;
|
|
14
|
+
export declare function computeScriptRel(rel: string, config: BuildConfig, kind?: ScriptKind): string;
|
|
15
|
+
export declare function outputRelsForSource(rel: string, config: BuildConfig): string[];
|
|
10
16
|
export declare function collectFailures(diagnostics: readonly TranspileDiagnostic[]): Map<string, string[]>;
|
|
11
17
|
export declare function throwIfFailures(failures: ReadonlyMap<string, string[]>): void;
|
|
12
18
|
export declare function writeScriptFile(cwd: string, scriptRel: string, lua: string, map: string | undefined): void;
|
package/dist/debug-launcher.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ export interface EngineTarget {
|
|
|
3
3
|
readonly buildFolder: string;
|
|
4
4
|
readonly executable: string;
|
|
5
5
|
}
|
|
6
|
+
export declare const ENGINE_INFO_URL = "https://d.defold.com/stable/info.json";
|
|
7
|
+
export declare const ENGINE_ARCHIVE_BASE = "https://d.defold.com/archive/stable";
|
|
6
8
|
export declare const DEBUG_LAUNCHER_REL = ".vscode/defold-debug.ts";
|
|
7
|
-
export declare function targetPlatform(platform: NodeJS.Platform): EngineTarget;
|
|
9
|
+
export declare function targetPlatform(platform: NodeJS.Platform, arch: string): EngineTarget;
|
|
8
10
|
export declare function engineDownloadUrl(sha1: string, enginePlatform: string, executable: string): string;
|
|
9
11
|
export interface ResolveEngineOptions {
|
|
10
12
|
readonly cwd: string;
|
|
@@ -24,6 +26,8 @@ export declare function debugLaunchConfig(): {
|
|
|
24
26
|
command: string;
|
|
25
27
|
};
|
|
26
28
|
args: string[];
|
|
29
|
+
scriptFiles: string[];
|
|
30
|
+
scriptRoots: string[];
|
|
27
31
|
};
|
|
28
32
|
export declare const VSCODE_LAUNCH_CONTENT: {
|
|
29
33
|
version: string;
|
|
@@ -38,6 +42,8 @@ export declare const VSCODE_LAUNCH_CONTENT: {
|
|
|
38
42
|
command: string;
|
|
39
43
|
};
|
|
40
44
|
args: string[];
|
|
45
|
+
scriptFiles: string[];
|
|
46
|
+
scriptRoots: string[];
|
|
41
47
|
}[];
|
|
42
48
|
};
|
|
43
49
|
export declare const DEBUG_LAUNCHER_SOURCE: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ScriptKind } from "./script-kind";
|
|
2
|
+
export interface DirectoryWall {
|
|
3
|
+
readonly dir: string;
|
|
4
|
+
readonly kind: ScriptKind;
|
|
5
|
+
readonly typesEntrypoint: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function planDirectoryWalls(cwd: string): DirectoryWall[];
|
|
8
|
+
export declare function groupSourceScriptKindsByDirectory(cwd: string): Map<string, Set<ScriptKind>>;
|
|
9
|
+
export declare function planSourceDirectoryWalls(cwd: string): DirectoryWall[];
|
|
10
|
+
interface WallTsconfig {
|
|
11
|
+
readonly extends: string;
|
|
12
|
+
readonly compilerOptions: {
|
|
13
|
+
readonly composite: true;
|
|
14
|
+
readonly typeRoots: null;
|
|
15
|
+
readonly types: string[];
|
|
16
|
+
};
|
|
17
|
+
readonly include: readonly ["**/*.ts"];
|
|
18
|
+
readonly exclude: readonly [];
|
|
19
|
+
}
|
|
20
|
+
export declare function directoryWallTsconfig(wall: DirectoryWall): WallTsconfig;
|
|
21
|
+
export declare function wireWallReferences(cwd: string, walls: readonly DirectoryWall[]): void;
|
|
22
|
+
export declare function writeDirectoryWallTsconfigs(cwd: string, walls: DirectoryWall[]): string[];
|
|
23
|
+
export {};
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { RegistryTarget } from "./api-registry";
|
|
2
|
+
import { type DefoldIo } from "./bob-command";
|
|
2
3
|
import { type RefDocResolveOptions } from "./materialize";
|
|
4
|
+
import { type CheckboxPrompt } from "./wall-interactive";
|
|
3
5
|
import { type RunWatchHandle, type WatcherFactory } from "./watch";
|
|
4
6
|
export interface DispatchIo {
|
|
5
7
|
readonly stdout: NodeJS.WritableStream;
|
|
@@ -14,5 +16,9 @@ export interface DispatchInternals {
|
|
|
14
16
|
readonly resolveOpts?: RefDocResolveOptions;
|
|
15
17
|
readonly refDocRegistry?: readonly RegistryTarget[];
|
|
16
18
|
readonly cliVersion?: string;
|
|
19
|
+
readonly defoldIo?: Partial<DefoldIo>;
|
|
20
|
+
readonly cwd?: string;
|
|
21
|
+
readonly isTty?: boolean;
|
|
22
|
+
readonly wallCheckbox?: CheckboxPrompt;
|
|
17
23
|
}
|
|
18
24
|
export declare function dispatch(argv: string[], io: DispatchIo, internals?: DispatchInternals): number | Promise<number>;
|