@farm.js/convex 0.1.0-beta.3 → 0.1.0-beta.5
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/dev.d.ts.map +1 -1
- package/dist/dev.js +17 -6
- package/package.json +3 -3
package/dist/dev.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAwB,MAAM,YAAY,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKpD,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,GAAG,gBAAgB,GAAG,SAAS,GAC1C,gBAAgB,GAAG,SAAS,CAG9B;AAiBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGxD;AASD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,cAAc,GACpB,IAAI,CA2BN;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAIrE;AAID,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,SAAM,GAAG,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAwB,MAAM,YAAY,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKpD,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,GAAG,gBAAgB,GAAG,SAAS,GAC1C,gBAAgB,GAAG,SAAS,CAG9B;AAiBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGxD;AASD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,cAAc,GACpB,IAAI,CA2BN;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAIrE;AAID,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,SAAM,GAAG,MAAM,IAAI,CAsB9E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,uJAkC1D"}
|
package/dist/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
-
import { existsSync, readFileSync
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createInterface } from "node:readline";
|
|
5
5
|
import { styleText } from "node:util";
|
|
@@ -74,16 +74,27 @@ export function stopConvexDev(state) {
|
|
|
74
74
|
const DEPLOYMENT_URL_PATTERN = /^(?:VITE_)?CONVEX_URL=\S/m;
|
|
75
75
|
/** Tell the developer to restart once convex dev has written the new deployment's URL. */
|
|
76
76
|
export function announceNewDeployment(root, interval = 500) {
|
|
77
|
-
const filePath = path.join(root, ".env.local");
|
|
78
77
|
console.warn("[farm:convex] CONVEX_URL is not set yet. convex dev will create a deployment; restart farm dev when it is ready.");
|
|
78
|
+
// A plain read on a timer, not fs.watchFile: it behaves the same on every platform and in
|
|
79
|
+
// worker threads, and it also sees a URL written before the check started.
|
|
80
|
+
let timer;
|
|
81
|
+
const stop = () => {
|
|
82
|
+
if (timer)
|
|
83
|
+
clearInterval(timer);
|
|
84
|
+
timer = undefined;
|
|
85
|
+
};
|
|
79
86
|
const check = () => {
|
|
80
87
|
if (!DEPLOYMENT_URL_PATTERN.test(readEnvironmentFile(root)))
|
|
81
|
-
return;
|
|
82
|
-
|
|
88
|
+
return false;
|
|
89
|
+
stop();
|
|
83
90
|
console.log("[farm:convex] Convex deployment is ready. Restart farm dev to connect to it.");
|
|
91
|
+
return true;
|
|
84
92
|
};
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
if (!check()) {
|
|
94
|
+
timer = setInterval(check, interval);
|
|
95
|
+
timer.unref?.();
|
|
96
|
+
}
|
|
97
|
+
return stop;
|
|
87
98
|
}
|
|
88
99
|
export function createConvexPlugin(input) {
|
|
89
100
|
let root = process.cwd();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm.js/convex",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.5",
|
|
4
4
|
"description": "Convex integration for Farm.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"convex",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"unstorage": "2.0.0-alpha.10",
|
|
54
|
-
"@farm.js/core": "0.1.
|
|
55
|
-
"@farm.js/integration-utils": "0.1.
|
|
54
|
+
"@farm.js/core": "0.1.46",
|
|
55
|
+
"@farm.js/integration-utils": "0.1.46"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/node": "^22.20.5",
|