@b9g/platform 0.1.14-beta.0 → 0.1.14-beta.2
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/package.json +3 -20
- package/src/index.d.ts +0 -4
- package/src/index.js +0 -21
- package/src/runtime.d.ts +1 -1
- package/src/runtime.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b9g/platform",
|
|
3
|
-
"version": "0.1.14-beta.
|
|
3
|
+
"version": "0.1.14-beta.2",
|
|
4
4
|
"description": "The portable meta-framework built on web standards.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"service-worker",
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"@b9g/async-context": "^0.2.0-beta.0",
|
|
22
22
|
"@b9g/cache": "^0.2.0-beta.0",
|
|
23
23
|
"@b9g/filesystem": "^0.1.8",
|
|
24
|
-
"@b9g/zen": "^0.1.6",
|
|
25
24
|
"@logtape/logtape": "^1.2.0"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
@@ -31,26 +30,10 @@
|
|
|
31
30
|
"@b9g/platform-node": "^0.1.14-beta.0"
|
|
32
31
|
},
|
|
33
32
|
"peerDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@logtape/otel": "^1.0.0",
|
|
36
|
-
"@logtape/sentry": "^1.0.0",
|
|
37
|
-
"@logtape/syslog": "^1.0.0",
|
|
38
|
-
"@logtape/cloudwatch-logs": "^1.0.0"
|
|
33
|
+
"@b9g/zen": "^0.1.6"
|
|
39
34
|
},
|
|
40
35
|
"peerDependenciesMeta": {
|
|
41
|
-
"@
|
|
42
|
-
"optional": true
|
|
43
|
-
},
|
|
44
|
-
"@logtape/otel": {
|
|
45
|
-
"optional": true
|
|
46
|
-
},
|
|
47
|
-
"@logtape/sentry": {
|
|
48
|
-
"optional": true
|
|
49
|
-
},
|
|
50
|
-
"@logtape/syslog": {
|
|
51
|
-
"optional": true
|
|
52
|
-
},
|
|
53
|
-
"@logtape/cloudwatch-logs": {
|
|
36
|
+
"@b9g/zen": {
|
|
54
37
|
"optional": true
|
|
55
38
|
}
|
|
56
39
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -265,10 +265,6 @@ export declare function resolvePlatform(options: {
|
|
|
265
265
|
platform?: string;
|
|
266
266
|
};
|
|
267
267
|
}): string;
|
|
268
|
-
/**
|
|
269
|
-
* Create platform instance based on name
|
|
270
|
-
*/
|
|
271
|
-
export declare function createPlatform(platformName: string, options?: any): Promise<Platform>;
|
|
272
268
|
/**
|
|
273
269
|
* Base platform class with shared adapter loading logic
|
|
274
270
|
* Platform implementations extend this and provide platform-specific methods
|
package/src/index.js
CHANGED
|
@@ -55,26 +55,6 @@ function resolvePlatform(options) {
|
|
|
55
55
|
}
|
|
56
56
|
return detectDevelopmentPlatform();
|
|
57
57
|
}
|
|
58
|
-
async function createPlatform(platformName, options = {}) {
|
|
59
|
-
switch (platformName) {
|
|
60
|
-
case "node": {
|
|
61
|
-
const { default: NodePlatform } = await import("@b9g/platform-node");
|
|
62
|
-
return new NodePlatform(options);
|
|
63
|
-
}
|
|
64
|
-
case "bun": {
|
|
65
|
-
const { default: BunPlatform } = await import("@b9g/platform-bun");
|
|
66
|
-
return new BunPlatform(options);
|
|
67
|
-
}
|
|
68
|
-
case "cloudflare": {
|
|
69
|
-
const { default: CloudflarePlatform } = await import("@b9g/platform-cloudflare");
|
|
70
|
-
return new CloudflarePlatform(options);
|
|
71
|
-
}
|
|
72
|
-
default:
|
|
73
|
-
throw new Error(
|
|
74
|
-
`Unknown platform: ${platformName}. Valid platforms: node, bun, cloudflare`
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
58
|
var BasePlatform = class {
|
|
79
59
|
config;
|
|
80
60
|
constructor(config = {}) {
|
|
@@ -526,7 +506,6 @@ export {
|
|
|
526
506
|
CustomLoggerStorage,
|
|
527
507
|
ServiceWorkerPool,
|
|
528
508
|
createDatabaseFactory,
|
|
529
|
-
createPlatform,
|
|
530
509
|
detectDeploymentPlatform,
|
|
531
510
|
detectDevelopmentPlatform,
|
|
532
511
|
detectRuntime,
|
package/src/runtime.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export declare class CustomLoggerStorage implements LoggerStorage {
|
|
|
95
95
|
constructor(factory: LoggerFactory);
|
|
96
96
|
get(categories: string[]): Logger;
|
|
97
97
|
}
|
|
98
|
-
import { Database } from "@b9g/zen";
|
|
98
|
+
import type { Database } from "@b9g/zen";
|
|
99
99
|
/**
|
|
100
100
|
* Database configuration from shovel.json.
|
|
101
101
|
* Uses the unified impl pattern like directories and caches.
|
package/src/runtime.js
CHANGED
|
@@ -8,7 +8,6 @@ import { handleCacheResponse, PostMessageCache } from "@b9g/cache/postmessage";
|
|
|
8
8
|
import {
|
|
9
9
|
configure
|
|
10
10
|
} from "@logtape/logtape";
|
|
11
|
-
import { Database } from "@b9g/zen";
|
|
12
11
|
function parseCookieHeader(cookieHeader) {
|
|
13
12
|
const cookies = /* @__PURE__ */ new Map();
|
|
14
13
|
if (!cookieHeader) return cookies;
|
|
@@ -322,6 +321,7 @@ function createDatabaseFactory(configs) {
|
|
|
322
321
|
`Database "${name}" has no url. Ensure the database URL is configured.`
|
|
323
322
|
);
|
|
324
323
|
}
|
|
324
|
+
const { Database } = await import("@b9g/zen");
|
|
325
325
|
const driver = new impl(url, driverOptions);
|
|
326
326
|
const db = new Database(driver);
|
|
327
327
|
return {
|