@plandesk/api 1.0.0-beta.1 → 1.0.0-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/dist/index.js +3 -1
- package/dist/worker.js +7 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -30,8 +30,10 @@ export { InvalidTriageError, InvalidTriageInputError, SyncUnavailableError, Sync
|
|
|
30
30
|
import { readFileSync } from 'node:fs';
|
|
31
31
|
import { dirname, join } from 'node:path';
|
|
32
32
|
import { fileURLToPath } from 'node:url';
|
|
33
|
-
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '../package.json');
|
|
34
33
|
export const version = () => {
|
|
34
|
+
// Lazy: module-level fileURLToPath(import.meta.url) breaks the Cloudflare
|
|
35
|
+
// Workers bundle. Resolve only when version() is actually called.
|
|
36
|
+
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '../package.json');
|
|
35
37
|
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
36
38
|
return pkg.version;
|
|
37
39
|
};
|
package/dist/worker.js
CHANGED
|
@@ -83,8 +83,13 @@ export default {
|
|
|
83
83
|
}
|
|
84
84
|
const db = await getDb(env);
|
|
85
85
|
const authInstance = await getBetterAuth(env, db, betterAuth);
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
// Storage is optional: only wire S3/R2 when its credentials are present.
|
|
87
|
+
// Without them the app still runs (file uploads/artifacts are unavailable),
|
|
88
|
+
// rather than throwing on every request — mirrors `plandesk serve`.
|
|
89
|
+
const storage = env.PLANDESK_S3_BUCKET !== undefined && env.PLANDESK_S3_BUCKET !== ''
|
|
90
|
+
? createS3Adapter({ db, config: s3ConfigFromEnv(env) })
|
|
91
|
+
: undefined;
|
|
92
|
+
const services = createServices({ db, ...(storage !== undefined ? { storage } : {}) });
|
|
88
93
|
const app = createApp({
|
|
89
94
|
db,
|
|
90
95
|
services,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plandesk/api",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@libsql/kysely-libsql": "^0.4.1",
|
|
27
27
|
"better-auth": "1.6.23",
|
|
28
28
|
"hono": "^4.12.23",
|
|
29
|
-
"@plandesk/db": "1.0.0-beta.
|
|
29
|
+
"@plandesk/db": "1.0.0-beta.2"
|
|
30
30
|
},
|
|
31
31
|
"description": "Plan Desk REST + SSE API and service layer (local-first planning workspace).",
|
|
32
32
|
"license": "MIT",
|