sandlot 0.1.4 → 0.2.1

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.
Files changed (115) hide show
  1. package/dist/browser/bundler.d.ts +68 -0
  2. package/dist/browser/bundler.d.ts.map +1 -0
  3. package/dist/browser/executor.d.ts +46 -0
  4. package/dist/browser/executor.d.ts.map +1 -0
  5. package/dist/browser/index.d.ts +9 -0
  6. package/dist/browser/index.d.ts.map +1 -0
  7. package/dist/browser/index.js +2690 -0
  8. package/dist/browser/preset.d.ts +63 -0
  9. package/dist/browser/preset.d.ts.map +1 -0
  10. package/dist/commands/index.d.ts +20 -11
  11. package/dist/commands/index.d.ts.map +1 -1
  12. package/dist/commands/types.d.ts +37 -130
  13. package/dist/commands/types.d.ts.map +1 -1
  14. package/dist/core/bundler-utils.d.ts +142 -0
  15. package/dist/core/bundler-utils.d.ts.map +1 -0
  16. package/dist/core/esm-types-resolver.d.ts +125 -0
  17. package/dist/core/esm-types-resolver.d.ts.map +1 -0
  18. package/dist/core/executor.d.ts +35 -0
  19. package/dist/core/executor.d.ts.map +1 -0
  20. package/dist/{fs.d.ts → core/fs.d.ts} +27 -29
  21. package/dist/core/fs.d.ts.map +1 -0
  22. package/dist/core/sandbox.d.ts +30 -0
  23. package/dist/core/sandbox.d.ts.map +1 -0
  24. package/dist/core/sandlot.d.ts +30 -0
  25. package/dist/core/sandlot.d.ts.map +1 -0
  26. package/dist/core/shared-module-registry.d.ts +46 -0
  27. package/dist/core/shared-module-registry.d.ts.map +1 -0
  28. package/dist/core/typechecker.d.ts +60 -0
  29. package/dist/core/typechecker.d.ts.map +1 -0
  30. package/dist/index.d.ts +11 -16
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +1398 -2010
  33. package/dist/node/bundler.d.ts +48 -0
  34. package/dist/node/bundler.d.ts.map +1 -0
  35. package/dist/node/executor.d.ts +48 -0
  36. package/dist/node/executor.d.ts.map +1 -0
  37. package/dist/node/index.d.ts +9 -0
  38. package/dist/node/index.d.ts.map +1 -0
  39. package/dist/node/index.js +2644 -0
  40. package/dist/node/preset.d.ts +62 -0
  41. package/dist/node/preset.d.ts.map +1 -0
  42. package/dist/types.d.ts +528 -0
  43. package/dist/types.d.ts.map +1 -0
  44. package/package.json +16 -6
  45. package/src/browser/bundler.ts +294 -0
  46. package/src/browser/executor.ts +71 -0
  47. package/src/browser/index.ts +57 -0
  48. package/src/browser/preset.ts +179 -0
  49. package/src/commands/index.ts +498 -37
  50. package/src/commands/types.ts +117 -145
  51. package/src/core/bundler-utils.ts +630 -0
  52. package/src/core/esm-types-resolver.ts +432 -0
  53. package/src/core/executor.ts +161 -0
  54. package/src/{fs.ts → core/fs.ts} +59 -37
  55. package/src/core/sandbox.ts +624 -0
  56. package/src/core/sandlot.ts +77 -0
  57. package/src/core/shared-module-registry.ts +138 -0
  58. package/src/core/typechecker.ts +609 -0
  59. package/src/index.ts +106 -139
  60. package/src/node/bundler.ts +194 -0
  61. package/src/node/executor.ts +87 -0
  62. package/src/node/index.ts +39 -0
  63. package/src/node/preset.ts +178 -0
  64. package/src/types.ts +672 -0
  65. package/README.md +0 -243
  66. package/dist/build-emitter.d.ts +0 -47
  67. package/dist/build-emitter.d.ts.map +0 -1
  68. package/dist/builder.d.ts +0 -370
  69. package/dist/builder.d.ts.map +0 -1
  70. package/dist/bundler.d.ts +0 -152
  71. package/dist/bundler.d.ts.map +0 -1
  72. package/dist/commands/compile.d.ts +0 -13
  73. package/dist/commands/compile.d.ts.map +0 -1
  74. package/dist/commands/packages.d.ts +0 -17
  75. package/dist/commands/packages.d.ts.map +0 -1
  76. package/dist/commands/run.d.ts +0 -40
  77. package/dist/commands/run.d.ts.map +0 -1
  78. package/dist/commands.d.ts +0 -179
  79. package/dist/commands.d.ts.map +0 -1
  80. package/dist/fs.d.ts.map +0 -1
  81. package/dist/internal.d.ts +0 -79
  82. package/dist/internal.d.ts.map +0 -1
  83. package/dist/internal.js +0 -1942
  84. package/dist/loader.d.ts +0 -164
  85. package/dist/loader.d.ts.map +0 -1
  86. package/dist/packages.d.ts +0 -199
  87. package/dist/packages.d.ts.map +0 -1
  88. package/dist/runner.d.ts +0 -314
  89. package/dist/runner.d.ts.map +0 -1
  90. package/dist/sandbox-manager.d.ts +0 -261
  91. package/dist/sandbox-manager.d.ts.map +0 -1
  92. package/dist/sandbox.d.ts +0 -267
  93. package/dist/sandbox.d.ts.map +0 -1
  94. package/dist/shared-modules.d.ts +0 -148
  95. package/dist/shared-modules.d.ts.map +0 -1
  96. package/dist/shared-resources.d.ts +0 -102
  97. package/dist/shared-resources.d.ts.map +0 -1
  98. package/dist/ts-libs.d.ts +0 -85
  99. package/dist/ts-libs.d.ts.map +0 -1
  100. package/dist/typechecker.d.ts +0 -127
  101. package/dist/typechecker.d.ts.map +0 -1
  102. package/src/build-emitter.ts +0 -64
  103. package/src/builder.ts +0 -498
  104. package/src/bundler.ts +0 -575
  105. package/src/commands/compile.ts +0 -236
  106. package/src/commands/packages.ts +0 -154
  107. package/src/commands/run.ts +0 -245
  108. package/src/internal.ts +0 -119
  109. package/src/loader.ts +0 -229
  110. package/src/packages.ts +0 -936
  111. package/src/sandbox.ts +0 -398
  112. package/src/shared-modules.ts +0 -280
  113. package/src/shared-resources.ts +0 -166
  114. package/src/ts-libs.ts +0 -218
  115. package/src/typechecker.ts +0 -635
package/dist/bundler.d.ts DELETED
@@ -1,152 +0,0 @@
1
- import type { IFileSystem } from "just-bash/browser";
2
- import type * as EsbuildTypes from "esbuild-wasm";
3
- /**
4
- * How to handle npm package imports (bare imports like "react").
5
- *
6
- * - "cdn" (default): Rewrite to esm.sh CDN URLs using installed package versions.
7
- * Requires packages to be installed via the `install` command.
8
- * - "external": Mark as external, don't rewrite. The consumer must handle
9
- * module resolution (useful for SSR or custom bundling).
10
- * - "bundle": Attempt to bundle from node_modules. Rarely useful in browser
11
- * since node_modules typically doesn't exist in the virtual filesystem.
12
- */
13
- export type NpmImportsMode = "cdn" | "external" | "bundle";
14
- /**
15
- * Options for bundling
16
- */
17
- export interface BundleOptions {
18
- /**
19
- * The virtual filesystem to read source files from
20
- */
21
- fs: IFileSystem;
22
- /**
23
- * Entry point path (absolute path in the virtual filesystem)
24
- */
25
- entryPoint: string;
26
- /**
27
- * Module names to mark as external (won't be bundled).
28
- * These are in addition to bare imports when using npmImports: "external".
29
- */
30
- external?: string[];
31
- /**
32
- * How to handle npm package imports (bare imports like "react").
33
- *
34
- * - "cdn" (default): Rewrite to esm.sh CDN URLs using installed package versions
35
- * - "external": Mark as external, don't rewrite (consumer must handle)
36
- * - "bundle": Attempt to bundle from node_modules (rarely useful in browser)
37
- */
38
- npmImports?: NpmImportsMode;
39
- /**
40
- * Module IDs that should be resolved from the host's SharedModuleRegistry
41
- * instead of esm.sh CDN. The host must have registered these modules.
42
- *
43
- * Example: ['react', 'react-dom/client']
44
- *
45
- * When specified, imports of these modules will use the host's instances,
46
- * allowing dynamic components to share React context, hooks, etc.
47
- */
48
- sharedModules?: string[];
49
- /**
50
- * Output format: 'esm' (default), 'iife', or 'cjs'
51
- */
52
- format?: "esm" | "iife" | "cjs";
53
- /**
54
- * Enable minification
55
- * Default: false
56
- */
57
- minify?: boolean;
58
- /**
59
- * Enable source maps (inline)
60
- * Default: false
61
- */
62
- sourcemap?: boolean;
63
- /**
64
- * Global name for IIFE format
65
- */
66
- globalName?: string;
67
- /**
68
- * Target environment(s)
69
- * Default: ['es2020']
70
- */
71
- target?: string[];
72
- }
73
- /**
74
- * Result of bundling
75
- */
76
- export interface BundleResult {
77
- /**
78
- * The bundled JavaScript code
79
- */
80
- code: string;
81
- /**
82
- * Any warnings from esbuild
83
- */
84
- warnings: EsbuildTypes.Message[];
85
- /**
86
- * List of files that were included in the bundle
87
- */
88
- includedFiles: string[];
89
- }
90
- /**
91
- * Initialize esbuild. Called automatically on first bundle.
92
- * Can be called explicitly to pre-warm.
93
- *
94
- * In browser environments, this loads and initializes esbuild-wasm.
95
- * In server environments (Node.js, Bun, Deno), this loads native esbuild
96
- * which doesn't require WASM initialization.
97
- */
98
- export declare function initBundler(): Promise<void>;
99
- /**
100
- * Bundle TypeScript/JavaScript files from a virtual filesystem
101
- *
102
- * @example
103
- * ```ts
104
- * const fs = Filesystem.create({
105
- * initialFiles: {
106
- * "/src/index.ts": "export const hello = 'world';",
107
- * "/src/utils.ts": "export function add(a: number, b: number) { return a + b; }",
108
- * }
109
- * });
110
- *
111
- * const result = await bundle({
112
- * fs,
113
- * entryPoint: "/src/index.ts",
114
- * });
115
- *
116
- * console.log(result.code);
117
- * ```
118
- */
119
- export declare function bundle(options: BundleOptions): Promise<BundleResult>;
120
- /**
121
- * Bundle and return a blob URL for dynamic import
122
- *
123
- * @example
124
- * ```ts
125
- * const url = await bundleToUrl({
126
- * fs,
127
- * entryPoint: "/src/index.ts",
128
- * });
129
- *
130
- * const module = await import(url);
131
- * console.log(module.hello); // 'world'
132
- *
133
- * // Clean up when done
134
- * URL.revokeObjectURL(url);
135
- * ```
136
- */
137
- export declare function bundleToUrl(options: BundleOptions): Promise<string>;
138
- /**
139
- * Bundle and immediately import the module
140
- *
141
- * @example
142
- * ```ts
143
- * const module = await bundleAndImport<{ hello: string }>({
144
- * fs,
145
- * entryPoint: "/src/index.ts",
146
- * });
147
- *
148
- * console.log(module.hello); // 'world'
149
- * ```
150
- */
151
- export declare function bundleAndImport<T = unknown>(options: BundleOptions): Promise<T>;
152
- //# sourceMappingURL=bundler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,KAAK,YAAY,MAAM,cAAc,CAAC;AAuDlD;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IAC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} from "./types";
5
- /**
6
- * Create the `tsc` command for type checking
7
- */
8
- export declare function createTscCommand(deps: CommandDeps): import("just-bash/browser").Command;
9
- /**
10
- * Create the `build` command for bundling (with automatic type checking)
11
- */
12
- export declare function createBuildCommand(deps: CommandDeps): import("just-bash/browser").Command;
13
- //# sourceMappingURL=compile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,SAAS,CAAC;AAElE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,uCA4DjD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,uCA6JnD"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Package management commands: install, uninstall, list
3
- */
4
- import type { CommandDeps } from "./types";
5
- /**
6
- * Create the `install` command for adding packages from npm
7
- */
8
- export declare function createInstallCommand(deps: CommandDeps): import("just-bash/browser").Command;
9
- /**
10
- * Create the `uninstall` command for removing packages
11
- */
12
- export declare function createUninstallCommand(deps: CommandDeps): import("just-bash/browser").Command;
13
- /**
14
- * Create the `list` command (alias: `ls`) for showing installed packages
15
- */
16
- export declare function createListCommand(deps: CommandDeps): import("just-bash/browser").Command;
17
- //# sourceMappingURL=packages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../src/commands/packages.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,uCAoDrD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,uCA+CvD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,uCAiClD"}
@@ -1,40 +0,0 @@
1
- /**
2
- * Run command for executing code in the sandbox.
3
- */
4
- import type { CommandDeps } from "./types";
5
- /**
6
- * Create the `run` command for executing code in the sandbox.
7
- *
8
- * The run command:
9
- * 1. Builds the entry point (with type checking by default)
10
- * 2. Dynamically imports the bundle
11
- * 3. If a `main` export exists, calls it with a RunContext
12
- * 4. Captures all console output (log, warn, error)
13
- * 5. Returns the captured output and any return value from main()
14
- *
15
- * Usage:
16
- * run [entry] [--skip-typecheck|-s] [--timeout|-t <ms>] [-- args...]
17
- *
18
- * Code can be written in two styles:
19
- *
20
- * 1. Script style (top-level code, runs on import):
21
- * ```ts
22
- * console.log("Hello from script!");
23
- * const result = 2 + 2;
24
- * console.log("Result:", result);
25
- * ```
26
- *
27
- * 2. Main function style (with context access):
28
- * ```ts
29
- * import type { RunContext } from "sandlot";
30
- *
31
- * export async function main(ctx: RunContext) {
32
- * ctx.log("Reading file...");
33
- * const content = await ctx.fs.readFile("/data/input.txt");
34
- * ctx.log("Content:", content);
35
- * return { success: true };
36
- * }
37
- * ```
38
- */
39
- export declare function createRunCommand(deps: CommandDeps): import("just-bash/browser").Command;
40
- //# sourceMappingURL=run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,SAAS,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,uCAwMjD"}
@@ -1,179 +0,0 @@
1
- /**
2
- * Command factories for sandbox bash environments.
3
- *
4
- * Pure factories that create commands for type checking and bundling.
5
- * No global state - all dependencies are passed in explicitly.
6
- */
7
- import { type IFileSystem } from "just-bash/browser";
8
- import { type BundleResult } from "./bundler";
9
- import { type TypesCache } from "./packages";
10
- /**
11
- * Dependencies required by command factories
12
- */
13
- export interface CommandDeps {
14
- /**
15
- * The virtual filesystem to operate on
16
- */
17
- fs: IFileSystem;
18
- /**
19
- * Pre-loaded TypeScript lib files for type checking
20
- */
21
- libFiles: Map<string, string>;
22
- /**
23
- * Path to tsconfig.json in the virtual filesystem
24
- */
25
- tsconfigPath: string;
26
- /**
27
- * Callback invoked when a build succeeds
28
- */
29
- onBuild?: (result: BundleResult) => void | Promise<void>;
30
- /**
31
- * Cache for package type definitions.
32
- * When provided, avoids redundant network fetches for packages
33
- * that have already been installed in other sandboxes.
34
- */
35
- typesCache?: TypesCache;
36
- /**
37
- * Options for the `run` command
38
- */
39
- runOptions?: RunOptions;
40
- /**
41
- * Module IDs that should be resolved from the host's SharedModuleRegistry
42
- * instead of esm.sh CDN. The host must have registered these modules.
43
- *
44
- * Example: ['react', 'react-dom/client']
45
- */
46
- sharedModules?: string[];
47
- }
48
- /**
49
- * Runtime context passed to the `main()` function when code is executed.
50
- * This provides sandboxed code with access to sandbox capabilities.
51
- */
52
- export interface RunContext {
53
- /**
54
- * The virtual filesystem - read/write files within the sandbox
55
- */
56
- fs: IFileSystem;
57
- /**
58
- * Environment variables (configurable per-sandbox)
59
- */
60
- env: Record<string, string>;
61
- /**
62
- * Command-line arguments passed to `run`
63
- */
64
- args: string[];
65
- /**
66
- * Explicit logging function (alternative to console.log)
67
- */
68
- log: (...args: unknown[]) => void;
69
- /**
70
- * Explicit error logging function (alternative to console.error)
71
- */
72
- error: (...args: unknown[]) => void;
73
- }
74
- /**
75
- * Options for configuring the `run` command behavior
76
- */
77
- export interface RunOptions {
78
- /**
79
- * Environment variables available via ctx.env
80
- */
81
- env?: Record<string, string>;
82
- /**
83
- * Maximum execution time in milliseconds (default: 30000 = 30s)
84
- * Set to 0 to disable timeout.
85
- */
86
- timeout?: number;
87
- /**
88
- * Whether to skip type checking before running (default: false)
89
- */
90
- skipTypecheck?: boolean;
91
- }
92
- /**
93
- * Result of running code via the `run` command
94
- */
95
- export interface RunResult {
96
- /**
97
- * Captured console output (log, warn, error)
98
- */
99
- logs: string[];
100
- /**
101
- * Return value from main() if present
102
- */
103
- returnValue?: unknown;
104
- /**
105
- * Execution time in milliseconds
106
- */
107
- executionTimeMs: number;
108
- }
109
- /**
110
- * Format esbuild messages (warnings/errors) for display
111
- */
112
- export declare function formatEsbuildMessages(messages: {
113
- text: string;
114
- location?: {
115
- file?: string;
116
- line?: number;
117
- column?: number;
118
- } | null;
119
- }[]): string;
120
- /**
121
- * Create the `tsc` command for type checking
122
- */
123
- export declare function createTscCommand(deps: CommandDeps): import("just-bash/browser").Command;
124
- /**
125
- * Create the `build` command for bundling (with automatic type checking)
126
- */
127
- export declare function createBuildCommand(deps: CommandDeps): import("just-bash/browser").Command;
128
- /**
129
- * Create the `install` command for adding packages from npm
130
- */
131
- export declare function createInstallCommand(deps: CommandDeps): import("just-bash/browser").Command;
132
- /**
133
- * Create the `uninstall` command for removing packages
134
- */
135
- export declare function createUninstallCommand(deps: CommandDeps): import("just-bash/browser").Command;
136
- /**
137
- * Create the `list` command (alias: `ls`) for showing installed packages
138
- */
139
- export declare function createListCommand(deps: CommandDeps): import("just-bash/browser").Command;
140
- /**
141
- * Create the `run` command for executing code in the sandbox.
142
- *
143
- * The run command:
144
- * 1. Builds the entry point (with type checking by default)
145
- * 2. Dynamically imports the bundle
146
- * 3. If a `main` export exists, calls it with a RunContext
147
- * 4. Captures all console output (log, warn, error)
148
- * 5. Returns the captured output and any return value from main()
149
- *
150
- * Usage:
151
- * run [entry] [--skip-typecheck|-s] [--timeout|-t <ms>] [-- args...]
152
- *
153
- * Code can be written in two styles:
154
- *
155
- * 1. Script style (top-level code, runs on import):
156
- * ```ts
157
- * console.log("Hello from script!");
158
- * const result = 2 + 2;
159
- * console.log("Result:", result);
160
- * ```
161
- *
162
- * 2. Main function style (with context access):
163
- * ```ts
164
- * import type { RunContext } from "sandlot";
165
- *
166
- * export async function main(ctx: RunContext) {
167
- * ctx.log("Reading file...");
168
- * const content = await ctx.fs.readFile("/data/input.txt");
169
- * ctx.log("Content:", content);
170
- * return { success: true };
171
- * }
172
- * ```
173
- */
174
- export declare function createRunCommand(deps: CommandDeps): import("just-bash/browser").Command;
175
- /**
176
- * Create all default sandbox commands
177
- */
178
- export declare function createDefaultCommands(deps: CommandDeps): import("just-bash/browser").Command[];
179
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEzF,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAkD,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7F;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,WAAW,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,EAAE,EAAE,WAAW,CAAC;IAEhB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,C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lot/internal' only when the main API doesn't meet your needs.
6
- *
7
- * @module sandlot/internal
8
- */
9
- /**
10
- * Create a blob URL for a bundle. Prefer `loadModule` from 'sandlot' instead.
11
- * Remember to call `revokeModuleUrl()` when done to free memory.
12
- */
13
- export { createModuleUrl, revokeModuleUrl } from "./loader";
14
- /**
15
- * Parse a package specifier like "lodash@4.17.21" into name and version.
16
- */
17
- export { parsePackageSpec } from "./packages";
18
- /**
19
- * Resolve an import path to an esm.sh URL using installed package versions.
20
- */
21
- export { resolveToEsmUrl } from "./packages";
22
- /**
23
- * Parse an import path into package name and subpath.
24
- */
25
- export { parseImportPath } from "./packages";
26
- /**
27
- * In-memory cache for package types (DTS files from esm.sh).
28
- */
29
- export { InMemoryTypesCache } from "./packages";
30
- /**
31
- * Parse `/// <reference lib="..." />` directives from TypeScript source.
32
- */
33
- export { parseLibReferences } from "./ts-libs";
34
- /**
35
- * Convert a lib name (e.g., "ES2020") to its filename (e.g., "lib.es2020.d.ts").
36
- */
37
- export { libNameToFileName } from "./ts-libs";
38
- /**
39
- * Extract the lib name from a filename (e.g., "lib.es2020.d.ts" -> "ES2020").
40
- */
41
- export { extractLibName } from "./ts-libs";
42
- /**
43
- * Fetch a single TypeScript lib file from CDN.
44
- */
45
- export { fetchLibFile } from "./ts-libs";
46
- /**
47
- * Fetch multiple TypeScript lib files, resolving dependencies.
48
- */
49
- export { fetchAllLibs } from "./ts-libs";
50
- /**
51
- * Cache for TypeScript lib files.
52
- */
53
- export { LibCache } from "./ts-libs";
54
- /**
55
- * The SharedModuleRegistry class. Prefer `registerSharedModules` from 'sandlot'.
56
- */
57
- export { SharedModuleRegistry } from "./shared-modules";
58
- /**
59
- * Get the global shared module registry instance.
60
- */
61
- export { getSharedModuleRegistry } from "./shared-modules";
62
- /**
63
- * Check if the global registry exists.
64
- */
65
- export { hasSharedModuleRegistry } from "./shared-modules";
66
- /**
67
- * Get the runtime code for accessing a shared module.
68
- */
69
- export { getSharedModuleRuntimeCode } from "./shared-modules";
70
- /**
71
- * Format esbuild messages for display.
72
- */
73
- export { formatEsbuildMessages } from "./commands";
74
- /**
75
- * Build event emitter for sandbox environments.
76
- * Use this for custom build event handling in advanced use cases.
77
- */
78
- export { BuildEmitter } from "./build-emitter";
79
- //# sourceMappingURL=internal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAM5D;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMhD;;GAEG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAMrC;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD;;GAEG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAM9D;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAMnD;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}