fullstacked 0.12.2-1414 → 0.12.2-1419
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/fullstacked_modules/@types/csstype/index.d.ts +23593 -0
- package/fullstacked_modules/@types/style/index.d.ts +1 -1
- package/fullstacked_modules/auto_update.ts +27 -27
- package/fullstacked_modules/bridge/index.ts +5 -0
- package/fullstacked_modules/bridge/platform/node.ts +1 -3
- package/fullstacked_modules/build/index.ts +2 -2
- package/fullstacked_modules/components/snackbar.ts +1 -2
- package/fullstacked_modules/core_message.ts +6 -0
- package/fullstacked_modules/debug.ts +3 -0
- package/fullstacked_modules/git.ts +1 -0
- package/fullstacked_modules/packages.ts +1 -1
- package/fullstacked_modules/style.ts +1 -1
- package/index.js +13 -9
- package/package.json +2 -2
- package/fullstacked_modules/@fullstacked/ui/index.js +0 -669
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import git from "./git";
|
|
2
|
-
import { Button } from "@fullstacked/ui";
|
|
3
2
|
import { SnackBar } from "./components/snackbar";
|
|
4
3
|
import packages from "./packages";
|
|
5
4
|
import build from "./build";
|
|
5
|
+
import debug from "./debug";
|
|
6
6
|
|
|
7
7
|
let lastUpdateCheck = 0;
|
|
8
8
|
const updateCheckDelay = 1000 * 10; // 10sec;
|
|
9
|
-
let
|
|
9
|
+
let checking = false;
|
|
10
10
|
let disabled = false;
|
|
11
11
|
|
|
12
12
|
export function disableAutoUpdate() {
|
|
@@ -16,42 +16,42 @@ export function enableAutoUpdate() {
|
|
|
16
16
|
disabled = false;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
function checkForUpdates() {
|
|
20
20
|
window.requestAnimationFrame(checkForUpdates);
|
|
21
21
|
|
|
22
22
|
const now = Date.now();
|
|
23
|
-
if (disabled || now - lastUpdateCheck < updateCheckDelay ||
|
|
23
|
+
if (disabled || now - lastUpdateCheck < updateCheckDelay || checking) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
checking = true;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
git.pull().then(async (pullResponse) => {
|
|
30
|
+
if (pullResponse === git.PullResponse.DID_PULL) {
|
|
31
|
+
let preventReload = false;
|
|
32
|
+
const preventReloadButton = document.createElement("button");
|
|
33
|
+
preventReloadButton.innerText = "Stop";
|
|
34
|
+
preventReloadButton.onclick = () => {
|
|
35
|
+
preventReload = true;
|
|
36
|
+
snackbar.dismiss();
|
|
37
|
+
};
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
preventReloadButton.onclick = () => {
|
|
39
|
-
preventReload = true;
|
|
40
|
-
snackbar.dismiss();
|
|
41
|
-
};
|
|
39
|
+
const snackbar = SnackBar({
|
|
40
|
+
message: "Project has updated. Rebuilding...",
|
|
41
|
+
button: preventReloadButton
|
|
42
|
+
});
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
button: preventReloadButton
|
|
46
|
-
});
|
|
44
|
+
await update();
|
|
45
|
+
snackbar.dismiss();
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
if (!preventReload) {
|
|
48
|
+
window.location.reload();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
checking = false;
|
|
54
|
+
lastUpdateCheck = now;
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
if (await git.hasGit()) {
|
|
@@ -9,6 +9,11 @@ import { BridgeNode, initCallbackNode } from "./platform/node";
|
|
|
9
9
|
import { BridgeWasm } from "./platform/wasm";
|
|
10
10
|
import { BridgeWindows, initRespondWindows } from "./platform/windows";
|
|
11
11
|
import { serializeArgs } from "./serialization";
|
|
12
|
+
import { debug } from "../debug";
|
|
13
|
+
|
|
14
|
+
if (debug) {
|
|
15
|
+
console.log("Running DEBUG");
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
export type Bridge = (
|
|
14
19
|
payload: Uint8Array,
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Bridge } from "..";
|
|
2
2
|
import { deserializeArgs } from "../serialization";
|
|
3
3
|
|
|
4
|
-
const bridge = globalThis.fetch;
|
|
5
|
-
|
|
6
4
|
export const BridgeNode: Bridge = async (
|
|
7
5
|
payload: Uint8Array<ArrayBuffer>,
|
|
8
6
|
transformer?: (responseArgs: any[]) => any
|
|
9
7
|
) => {
|
|
10
|
-
const response = await
|
|
8
|
+
const response = await fetch("/call", {
|
|
11
9
|
method: "POST",
|
|
12
10
|
body: payload
|
|
13
11
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Project } from "../../editor/types";
|
|
1
|
+
import type { Project } from "../../editor/types";
|
|
2
2
|
import { bridge } from "../bridge";
|
|
3
3
|
import {
|
|
4
4
|
getLowestKeyIdAvailable,
|
|
@@ -27,7 +27,7 @@ async function buildStyle(projectId: string, entrypoint: string) {
|
|
|
27
27
|
|
|
28
28
|
core_message.addListener("build-style", async (messageStr) => {
|
|
29
29
|
const { id, entryPoint, projectId } = JSON.parse(messageStr);
|
|
30
|
-
const result = entryPoint.endsWith(".
|
|
30
|
+
const result = entryPoint.endsWith(".mjs")
|
|
31
31
|
? await buildStyle(projectId, entryPoint)
|
|
32
32
|
: await buildSASS(entryPoint, {
|
|
33
33
|
projectId,
|
|
@@ -3,13 +3,12 @@ This file must follow the figma design
|
|
|
3
3
|
https://www.figma.com/design/xb3JBRCvEWpbwGda03T5QQ/Mockups?node-id=415-3655
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { Button } from "@fullstacked/ui";
|
|
7
6
|
import { snackBarClass, snackBarsContainerClass } from "./snackbar.s";
|
|
8
7
|
|
|
9
8
|
type SnackBarOpt = {
|
|
10
9
|
message: string;
|
|
11
10
|
autoDismissTimeout?: number;
|
|
12
|
-
button?:
|
|
11
|
+
button?: HTMLButtonElement;
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
let snackBarsContainer: HTMLDivElement;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SnackBar } from "./components/snackbar";
|
|
2
|
+
import { debug } from "./debug";
|
|
2
3
|
|
|
3
4
|
const coreMessageListeners = new Map<string, Set<(message: string) => void>>();
|
|
4
5
|
export const addListener = (
|
|
@@ -49,6 +50,11 @@ globalThis.oncoremessage = (messageType: string, message: string) => {
|
|
|
49
50
|
|
|
50
51
|
addListener("hello", console.log);
|
|
51
52
|
addListener("log", console.log);
|
|
53
|
+
addListener("debug-log", (message) => {
|
|
54
|
+
if (debug) {
|
|
55
|
+
console.log(message);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
52
58
|
addListener("alert", (message) => {
|
|
53
59
|
SnackBar({
|
|
54
60
|
message,
|
package/index.js
CHANGED
|
@@ -183,11 +183,15 @@ async function createWebView(instance, onClose, onFirstConnection) {
|
|
|
183
183
|
});
|
|
184
184
|
const send = (m) => {
|
|
185
185
|
const jsonStr = JSON.stringify(m);
|
|
186
|
-
webSockets.forEach((
|
|
186
|
+
webSockets.forEach((ws) => ws.send(jsonStr));
|
|
187
187
|
};
|
|
188
188
|
server.listen(port);
|
|
189
189
|
if (!process.env.NO_OPEN) {
|
|
190
|
-
|
|
190
|
+
let url2 = `http://localhost:${port}`;
|
|
191
|
+
if (process.argv.includes("--debug")) {
|
|
192
|
+
url2 += "?debug";
|
|
193
|
+
}
|
|
194
|
+
open(url2);
|
|
191
195
|
}
|
|
192
196
|
return {
|
|
193
197
|
message: (type, message) => {
|
|
@@ -201,7 +205,7 @@ async function createWebView(instance, onClose, onFirstConnection) {
|
|
|
201
205
|
}
|
|
202
206
|
function createHandler(instance) {
|
|
203
207
|
return async (req, res) => {
|
|
204
|
-
let [pathname
|
|
208
|
+
let [pathname] = req.url.split("?");
|
|
205
209
|
pathname = decodeURI(pathname);
|
|
206
210
|
if (pathname === "/platform") {
|
|
207
211
|
res.writeHead(200, {
|
|
@@ -315,14 +319,14 @@ function getNextAvailablePort(port = 9e3, host = "0.0.0.0") {
|
|
|
315
319
|
function createWebSocketServer(server, cb2) {
|
|
316
320
|
const webSockets = /* @__PURE__ */ new Set();
|
|
317
321
|
const wss = new WebSocketServer({ noServer: true });
|
|
318
|
-
const onClose = (
|
|
319
|
-
webSockets.delete(
|
|
322
|
+
const onClose = (ws) => {
|
|
323
|
+
webSockets.delete(ws);
|
|
320
324
|
cb2.onSocketClose();
|
|
321
325
|
};
|
|
322
|
-
const handleUpgrade = (
|
|
323
|
-
webSockets.add(
|
|
326
|
+
const handleUpgrade = (ws) => {
|
|
327
|
+
webSockets.add(ws);
|
|
324
328
|
cb2.onSocketOpen();
|
|
325
|
-
|
|
329
|
+
ws.on("close", () => onClose(ws));
|
|
326
330
|
};
|
|
327
331
|
const onUpgrade = (...args) => {
|
|
328
332
|
wss.handleUpgrade(...args, handleUpgrade);
|
|
@@ -454,7 +458,7 @@ async function buildLocalProject(directory) {
|
|
|
454
458
|
const cb2 = async (_, messageType, message) => {
|
|
455
459
|
if (messageType === "build-style") {
|
|
456
460
|
const { id, entryPoint, projectId } = JSON.parse(message);
|
|
457
|
-
const result = entryPoint.endsWith(".
|
|
461
|
+
const result = entryPoint.endsWith(".mjs") ? await buildStyle(
|
|
458
462
|
"file://" + path2.resolve(process.cwd(), projectId, entryPoint).replace(/\\/g, "/")
|
|
459
463
|
) : await buildSASS(entryPoint, {
|
|
460
464
|
canonicalize: (filePath) => filePath.startsWith("file://") ? new URL(filePath) : new URL(
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fullstacked",
|
|
3
|
-
"version": "0.12.2-
|
|
3
|
+
"version": "0.12.2-1419",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "node build.js",
|
|
6
6
|
"postbuild": "node build.js --binding",
|
|
7
|
-
"start": "npm run build && node index.js --lib ../../core/bin --root ~/FullStacked --config ~/.config/fullstacked --editor ../../out/build",
|
|
7
|
+
"start": "npm run build && node index.js --debug --lib ../../core/bin --root ~/FullStacked --config ~/.config/fullstacked --editor ../../out/build",
|
|
8
8
|
"prepack": "node build.js"
|
|
9
9
|
},
|
|
10
10
|
"bin": {
|