@base44/functions-compiler 0.1.5 → 0.1.6
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/README.md +23 -9
- package/lib/src/assembly.js +2 -2
- package/lib/src/assembly.js.map +1 -1
- package/lib/src/assets.d.ts +7 -0
- package/lib/src/assets.js +15 -0
- package/lib/src/assets.js.map +1 -0
- package/lib/src/deno-bundle.js +2 -2
- package/lib/src/deno-bundle.js.map +1 -1
- package/lib/src/esbuild/deno-resolver.js +28 -24
- package/lib/src/esbuild/deno-resolver.js.map +1 -1
- package/lib/src/esbuild/private-data-sources-virtual.js +2 -3
- package/lib/src/esbuild/private-data-sources-virtual.js.map +1 -1
- package/lib/src/esbuild/runtime-context-specifier.d.ts +1 -0
- package/lib/src/esbuild/runtime-context-specifier.js +3 -0
- package/lib/src/esbuild/runtime-context-specifier.js.map +1 -0
- package/lib/src/esbuild/runtime-context-virtual.d.ts +2 -1
- package/lib/src/esbuild/runtime-context-virtual.js +4 -4
- package/lib/src/esbuild/runtime-context-virtual.js.map +1 -1
- package/lib/src/esbuild/runtime-virtual.js +4 -21
- package/lib/src/esbuild/runtime-virtual.js.map +1 -1
- package/lib/src/fetch-guard.js +4 -2
- package/lib/src/fetch-guard.js.map +1 -1
- package/lib/src/generated/assets.d.ts +1 -0
- package/lib/src/generated/assets.js +30 -0
- package/lib/src/generated/assets.js.map +1 -0
- package/lib/src/lazy-deps.d.ts +2 -0
- package/lib/src/lazy-deps.js +11 -0
- package/lib/src/lazy-deps.js.map +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/lib/src/worker-entry.js +4 -12
- package/lib/src/worker-entry.js.map +1 -1
- package/package.json +4 -3
- package/lib/dist/activation-shim.mjs +0 -357
- package/lib/dist/actor.mjs +0 -1131
- package/lib/dist/deno-shim.mjs +0 -2347
- package/lib/src/private-data-sources/build-http.ts +0 -51
- package/lib/src/private-data-sources/elasticsearch.ts +0 -8
- package/lib/src/private-data-sources/http-url.ts +0 -23
- package/lib/src/private-data-sources/http.ts +0 -6
- package/lib/src/private-data-sources/hyperdrive.ts +0 -48
- package/lib/src/private-data-sources/ioredis-adapter.ts +0 -229
- package/lib/src/private-data-sources/manifest.ts +0 -150
- package/lib/src/private-data-sources/mariadb.ts +0 -8
- package/lib/src/private-data-sources/mongodb.ts +0 -70
- package/lib/src/private-data-sources/mysql.ts +0 -8
- package/lib/src/private-data-sources/node-net-adapter.ts +0 -247
- package/lib/src/private-data-sources/oracle.ts +0 -34
- package/lib/src/private-data-sources/postgres.ts +0 -8
- package/lib/src/private-data-sources/redis-auth.ts +0 -83
- package/lib/src/private-data-sources/redis.ts +0 -47
- package/lib/src/private-data-sources/runtime-environment.ts +0 -4
- package/lib/src/private-data-sources/runtime-manifest-store.ts +0 -32
- package/lib/src/private-data-sources/sqlserver.ts +0 -22
- package/lib/src/private-data-sources/tcp.ts +0 -86
- package/lib/src/private-data-sources/tedious-adapter.ts +0 -67
- package/lib/src/private-data-sources/types.ts +0 -29
- package/lib/src/runtime/index.ts +0 -30
- package/lib/src/runtime-context.ts +0 -29
package/lib/src/runtime/index.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Platform module served for `import { ... } from "base44:runtime"`.
|
|
2
|
-
//
|
|
3
|
-
// The generated Worker entry owns the per-request AsyncLocalStorage store
|
|
4
|
-
// (module-scoped there), so this module reaches request state through the
|
|
5
|
-
// `globalThis.Base44` bridge the entry prelude installs — same pattern as the
|
|
6
|
-
// private-data-sources modules reading their manifest.
|
|
7
|
-
|
|
8
|
-
interface Base44Bridge {
|
|
9
|
-
waitUntil(promise: Promise<unknown>): void;
|
|
10
|
-
secrets: { get(name: string): string | undefined };
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function bridge(): Base44Bridge {
|
|
14
|
-
return (globalThis as { Base44?: Base44Bridge }).Base44 as Base44Bridge;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Extend this invocation until `promise` settles — background work after the
|
|
18
|
-
* Response returns. Rides ctx.waitUntil; best-effort, not durable. Returns the
|
|
19
|
-
* same promise so it composes. */
|
|
20
|
-
export function waitUntil<T>(promise: Promise<T>): Promise<T> {
|
|
21
|
-
bridge().waitUntil(promise);
|
|
22
|
-
return promise;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** App secrets, read from the Worker env binding of the current request. */
|
|
26
|
-
export const secrets: { get(name: string): string | undefined } = {
|
|
27
|
-
get(name: string): string | undefined {
|
|
28
|
-
return bridge().secrets.get(name);
|
|
29
|
-
},
|
|
30
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
|
|
3
|
-
export interface WorkerRuntimeContext {
|
|
4
|
-
env: "prod" | "preview";
|
|
5
|
-
fn?: string;
|
|
6
|
-
secrets: Record<string, unknown>;
|
|
7
|
-
workerEnv: Record<string, unknown>;
|
|
8
|
-
waitUntil(promise: Promise<unknown>): void;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const runtimeContext = new AsyncLocalStorage<WorkerRuntimeContext>();
|
|
13
|
-
|
|
14
|
-
export function currentWorkerRuntimeContext():
|
|
15
|
-
| WorkerRuntimeContext
|
|
16
|
-
| undefined {
|
|
17
|
-
return runtimeContext.getStore();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function workerEnvironment(): Record<string, unknown> {
|
|
21
|
-
return currentWorkerRuntimeContext()?.workerEnv ?? {};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function runWithWorkerEnvironment<T>(
|
|
25
|
-
context: WorkerRuntimeContext,
|
|
26
|
-
callback: () => T,
|
|
27
|
-
): T {
|
|
28
|
-
return runtimeContext.run(context, callback);
|
|
29
|
-
}
|