eddev 0.2.67-beta1 → 0.3.0-beta1
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/admin/components/ImageWell.d.ts +2 -2
- package/admin/components/ImageWell.js +51 -39
- package/admin/defineField.d.ts +2 -2
- package/admin/defineWidget.d.ts +1 -1
- package/admin/defineWidget.js +2 -2
- package/admin/index.js +1 -5
- package/admin/installFieldTypes.js +26 -26
- package/admin/runWidgets.js +28 -17
- package/admin/selectMedia.d.ts +2 -2
- package/admin/selectMedia.js +1 -1
- package/blocks/ContentBlocks.d.ts +6 -6
- package/blocks/ContentBlocks.js +66 -58
- package/blocks/ErrorBoundaryEditor.d.ts +1 -1
- package/blocks/ErrorBoundaryEditor.js +45 -16
- package/blocks/ErrorBoundaryFrontend.d.ts +1 -1
- package/blocks/ErrorBoundaryFrontend.js +45 -16
- package/blocks/InspectorControls.d.ts +1 -1
- package/blocks/InspectorControls.js +3 -3
- package/blocks/blockAttributes.d.ts +2 -2
- package/blocks/blockAttributes.js +44 -24
- package/blocks/index.js +1 -5
- package/blocks/inlineEditing.d.ts +6 -6
- package/blocks/inlineEditing.js +55 -36
- package/blocks/installGutenbergHooks.js +68 -48
- package/build/babel/plugin-name-defined-components.js +16 -15
- package/build/build-favicon.js +62 -11
- package/build/clean.js +52 -5
- package/build/create-codegen-worker.js +33 -78
- package/build/create-serverless-dev-worker.js +39 -61
- package/build/create-webpack-worker.js +33 -65
- package/build/file-tree.d.ts +2 -2
- package/build/file-tree.js +12 -12
- package/build/get-webpack-config.js +395 -341
- package/build/graphql-codegen/graphql-codegen-files.js +25 -31
- package/build/graphql-codegen/graphql-codegen-no-duplicates.js +4 -4
- package/build/graphql-codegen/graphql-codegen-queries.js +99 -102
- package/build/manifests/manifest-blocks.d.ts +1 -1
- package/build/manifests/manifest-blocks.js +29 -37
- package/build/manifests/manifest-fields.d.ts +1 -1
- package/build/manifests/manifest-fields.js +21 -23
- package/build/manifests/manifest-views.d.ts +1 -1
- package/build/manifests/manifest-views.js +25 -32
- package/build/manifests/manifest-widgets.d.ts +1 -1
- package/build/manifests/manifest-widgets.js +20 -22
- package/build/manifests/manifest.d.ts +2 -2
- package/build/manifests/manifest.js +94 -30
- package/build/reporter.d.ts +1 -1
- package/build/reporter.js +32 -29
- package/build/serverless/create-next-app.d.ts +1 -1
- package/build/serverless/create-next-app.js +467 -245
- package/build/state/codegen-state.d.ts +4 -4
- package/build/state/compiler-state.d.ts +5 -5
- package/build/state/serverless-state.d.ts +3 -3
- package/build/workers/codegen-worker-script.js +519 -393
- package/build/workers/serverless-worker-dev-script.js +4 -4
- package/build/workers/webpack-worker-script.js +156 -90
- package/cli/build.dev.d.ts +1 -1
- package/cli/build.dev.js +126 -79
- package/cli/build.prod.d.ts +1 -1
- package/cli/build.prod.js +98 -42
- package/cli/cli.js +28 -19
- package/cli/display/components/BundleDisplay.d.ts +1 -1
- package/cli/display/components/BundleDisplay.js +24 -13
- package/cli/display/components/CodegenDisplay.d.ts +1 -1
- package/cli/display/components/CodegenDisplay.js +25 -14
- package/cli/display/components/DevCLIDisplay.d.ts +2 -2
- package/cli/display/components/DevCLIDisplay.js +25 -14
- package/cli/display/components/Fullscreen.js +20 -9
- package/cli/display/components/ServerlessDisplay.d.ts +2 -2
- package/cli/display/components/ServerlessDisplay.js +26 -15
- package/cli/display/components/StatusIcon.d.ts +2 -2
- package/cli/display/components/StatusIcon.js +3 -3
- package/cli/preinstall.js +5 -4
- package/cli/setup.js +73 -25
- package/components/AdminBar.d.ts +1 -1
- package/components/AdminBar.js +3 -37
- package/components/BrowserRouter.d.ts +2 -2
- package/components/BrowserRouter.js +54 -41
- package/components/InlinePage.d.ts +2 -2
- package/components/InlinePage.js +29 -17
- package/components/NextRouter.d.ts +2 -2
- package/components/NextRouter.js +29 -20
- package/components/index.js +1 -5
- package/config/config-schema.d.ts +1 -1
- package/config/config-schema.js +1 -1
- package/config/create-schema-file.js +6 -6
- package/config/get-config.js +13 -10
- package/config/index.js +1 -5
- package/config/parse-config.js +1 -1
- package/config/print-zod-errors.js +3 -3
- package/dev-ui/components/BreakpointColumnHeader.d.ts +2 -2
- package/dev-ui/components/BreakpointColumnHeader.js +18 -7
- package/dev-ui/components/BreakpointIndicator.d.ts +1 -1
- package/dev-ui/components/BreakpointIndicator.js +32 -25
- package/dev-ui/components/DevUI.d.ts +1 -1
- package/dev-ui/components/DevUI.js +13 -13
- package/dev-ui/components/Launcher.d.ts +2 -2
- package/dev-ui/components/Launcher.js +25 -13
- package/dev-ui/components/PanelWrapper.d.ts +2 -2
- package/dev-ui/components/PanelWrapper.js +8 -8
- package/dev-ui/components/ResponsiveLerpControl.d.ts +2 -2
- package/dev-ui/components/ResponsiveLerpControl.js +38 -27
- package/dev-ui/components/ResponsiveScaleEditor.d.ts +4 -4
- package/dev-ui/components/ResponsiveScaleEditor.js +78 -64
- package/dev-ui/components/atoms/Button.js +1 -1
- package/dev-ui/components/atoms/Dropdown.d.ts +3 -3
- package/dev-ui/components/atoms/Dropdown.js +9 -8
- package/dev-ui/components/atoms/NumberField.d.ts +2 -2
- package/dev-ui/components/atoms/NumberField.js +42 -29
- package/dev-ui/components/atoms/Spacer.js +1 -1
- package/dev-ui/components/atoms/Text.js +1 -1
- package/dev-ui/components/atoms/ToggleButton.d.ts +2 -2
- package/dev-ui/components/atoms/ToggleButton.js +16 -5
- package/dev-ui/components/atoms/Tooltip.d.ts +2 -2
- package/dev-ui/components/atoms/Tooltip.js +20 -8
- package/dev-ui/components/panels/AppDataDebugger.d.ts +1 -1
- package/dev-ui/components/panels/AppDataDebugger.js +19 -8
- package/dev-ui/components/panels/ColorEditor.d.ts +1 -1
- package/dev-ui/components/panels/ColorEditor.js +42 -35
- package/dev-ui/components/panels/PageDataDebugger.d.ts +1 -1
- package/dev-ui/components/panels/PageDataDebugger.js +20 -8
- package/dev-ui/components/panels/QueryDebugger.d.ts +1 -1
- package/dev-ui/components/panels/QueryDebugger.js +24 -12
- package/dev-ui/components/panels/SpacingEditor.d.ts +1 -1
- package/dev-ui/components/panels/SpacingEditor.js +48 -34
- package/dev-ui/components/panels/TypographyEditor.d.ts +1 -1
- package/dev-ui/components/panels/TypographyEditor.js +46 -38
- package/dev-ui/hooks/useBreakpoint.d.ts +1 -1
- package/dev-ui/hooks/useBreakpoint.js +13 -13
- package/dev-ui/hooks/usePersistState.js +7 -6
- package/dev-ui/hooks/useStylesheet.js +6 -6
- package/dev-ui/icons.d.ts +15 -15
- package/dev-ui/icons.js +27 -16
- package/dev-ui/index.js +1 -5
- package/dev-ui/loader.d.ts +1 -1
- package/dev-ui/loader.js +9 -13
- package/dev-ui/panels.d.ts +2 -2
- package/dev-ui/panels.js +7 -7
- package/dev-ui/theme.js +3 -3
- package/dynamic/dynamic-component.js +1 -1
- package/dynamic/index.js +1 -5
- package/entry/Root.d.ts +2 -2
- package/entry/Root.js +26 -16
- package/entry/entry.admin.dev.js +4 -4
- package/entry/entry.admin.prod.js +4 -4
- package/entry/entry.monolith.dev.js +5 -5
- package/entry/entry.monolith.prod.js +5 -5
- package/gravityforms/gravity-forms.d.ts +2 -2
- package/gravityforms/index.js +1 -5
- package/gravityforms/useGravityForm.d.ts +2 -2
- package/gravityforms/useGravityForm.js +130 -126
- package/hooks/index.js +1 -5
- package/hooks/queryUtils.d.ts +14 -14
- package/hooks/queryUtils.js +192 -101
- package/hooks/useAppData.d.ts +2 -2
- package/hooks/useAppData.js +9 -9
- package/hooks/usePageLoad.js +4 -4
- package/hooks/useQueryDebug.d.ts +1 -1
- package/hooks/useQueryDebug.js +7 -7
- package/hooks/useRPC.d.ts +4 -4
- package/hooks/useRPC.js +3 -3
- package/package.json +11 -11
- package/routing/index.js +1 -5
- package/routing/remoteProps.d.ts +1 -1
- package/routing/remoteProps.js +72 -31
- package/routing/routing.d.ts +25 -15
- package/routing/routing.js +200 -112
- package/routing/updateEditLink.js +1 -1
- package/serverless/define-api.d.ts +1 -1
- package/serverless/define-rpc-router.js +4 -8
- package/serverless/index.js +2 -6
- package/style/createStitches.js +142 -164
- package/style/index.js +1 -5
- package/tsconfig.json +1 -1
- package/utils/Observable.d.ts +2 -2
- package/utils/Observable.js +15 -12
- package/utils/getRepoName.js +3 -3
- package/utils/promptIfRepoNameIncorrect.js +64 -18
- package/utils/refreshOverlayInterop.js +1 -1
- package/utils/reportErrorStack.d.ts +1 -1
- package/utils/reportErrorStack.js +1 -1
- package/utils/serverlessAppContext.js +1 -1
- package/utils/updateEnvFile.js +69 -19
- package/utils/useObservable.js +3 -3
- package/views/index.js +1 -5
|
@@ -1,115 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.createCodegenWorker = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
15
|
+
var worker_threads_1 = require("worker_threads");
|
|
16
|
+
var path_1 = require("path");
|
|
17
|
+
var Observable_1 = require("../utils/Observable");
|
|
7
18
|
function createCodegenWorker(opts) {
|
|
8
|
-
|
|
19
|
+
var worker = new worker_threads_1.Worker((0, path_1.join)(__dirname, "workers/codegen-worker-script.js"), {
|
|
9
20
|
workerData: opts,
|
|
10
21
|
stderr: true,
|
|
11
22
|
stdin: false,
|
|
12
23
|
stdout: true,
|
|
13
|
-
env: {
|
|
14
|
-
...process.env,
|
|
15
|
-
FORCE_COLOR: "1",
|
|
16
|
-
},
|
|
24
|
+
env: __assign(__assign({}, process.env), { FORCE_COLOR: "1" }),
|
|
17
25
|
});
|
|
18
|
-
worker.stderr.on("data", (chunk)
|
|
19
|
-
subject.update((state)
|
|
20
|
-
...state,
|
|
21
|
-
log: (state.log || "") + chunk,
|
|
22
|
-
}));
|
|
26
|
+
worker.stderr.on("data", function (chunk) {
|
|
27
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { log: (state.log || "") + chunk })); });
|
|
23
28
|
});
|
|
24
|
-
worker.stdout.on("data", (chunk)
|
|
29
|
+
worker.stdout.on("data", function (chunk) {
|
|
25
30
|
if (subject.value.status === "generating") {
|
|
26
|
-
subject.update((state)
|
|
27
|
-
...state,
|
|
28
|
-
log: String(chunk),
|
|
29
|
-
}));
|
|
31
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { log: String(chunk) })); });
|
|
30
32
|
}
|
|
31
33
|
else {
|
|
32
|
-
subject.update((state)
|
|
33
|
-
...state,
|
|
34
|
-
log: (state.log || "") + chunk,
|
|
35
|
-
}));
|
|
34
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { log: (state.log || "") + chunk })); });
|
|
36
35
|
}
|
|
37
36
|
});
|
|
38
|
-
|
|
37
|
+
var subject = new Observable_1.Observable({
|
|
39
38
|
title: "GraphQL Codegen",
|
|
40
39
|
status: "ready",
|
|
41
40
|
log: "",
|
|
42
41
|
});
|
|
43
|
-
worker.on("error", (err)
|
|
42
|
+
worker.on("error", function (err) {
|
|
44
43
|
console.log(err);
|
|
45
|
-
subject.update((state)
|
|
46
|
-
...state,
|
|
47
|
-
status: "error",
|
|
48
|
-
}));
|
|
44
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "error" })); });
|
|
49
45
|
});
|
|
50
|
-
worker.on("message", (data)
|
|
46
|
+
worker.on("message", function (data) {
|
|
51
47
|
if (data.code === "ready") {
|
|
52
|
-
subject.update((state)
|
|
53
|
-
...state,
|
|
54
|
-
status: "ready",
|
|
55
|
-
log: opts.retainLog ? state.log : "",
|
|
56
|
-
duration: 0,
|
|
57
|
-
errors: [],
|
|
58
|
-
}));
|
|
48
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "ready", log: opts.retainLog ? state.log : "", duration: 0, errors: [] })); });
|
|
59
49
|
}
|
|
60
50
|
else if (data.code === "fetching") {
|
|
61
|
-
subject.update((state)
|
|
62
|
-
...state,
|
|
63
|
-
status: "fetching",
|
|
64
|
-
log: opts.retainLog ? state.log : "",
|
|
65
|
-
duration: 0,
|
|
66
|
-
errors: [],
|
|
67
|
-
}));
|
|
51
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "fetching", log: opts.retainLog ? state.log : "", duration: 0, errors: [] })); });
|
|
68
52
|
}
|
|
69
53
|
else if (data.code === "generating") {
|
|
70
|
-
subject.update((state)
|
|
71
|
-
...state,
|
|
72
|
-
status: "generating",
|
|
73
|
-
errors: [],
|
|
74
|
-
duration: 0,
|
|
75
|
-
log: opts.retainLog ? state.log : "",
|
|
76
|
-
}));
|
|
54
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "generating", errors: [], duration: 0, log: opts.retainLog ? state.log : "" })); });
|
|
77
55
|
}
|
|
78
56
|
else if (data.code === "error") {
|
|
79
|
-
subject.update((state)
|
|
80
|
-
...state,
|
|
81
|
-
status: "error",
|
|
82
|
-
statusLabel: "",
|
|
83
|
-
duration: 0,
|
|
84
|
-
reason: undefined,
|
|
85
|
-
errors: data.errors,
|
|
86
|
-
}));
|
|
57
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "error", statusLabel: "", duration: 0, reason: undefined, errors: data.errors })); });
|
|
87
58
|
}
|
|
88
59
|
else if (data.code === "success") {
|
|
89
|
-
subject.update((state)
|
|
90
|
-
...state,
|
|
91
|
-
status: "success",
|
|
92
|
-
duration: data.duration,
|
|
93
|
-
reason: data.reason,
|
|
94
|
-
errors: [],
|
|
95
|
-
log: opts.retainLog ? state.log : "",
|
|
96
|
-
}));
|
|
60
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "success", duration: data.duration, reason: data.reason, errors: [], log: opts.retainLog ? state.log : "" })); });
|
|
97
61
|
}
|
|
98
62
|
else if (data.code === "invalidated") {
|
|
99
|
-
subject.update((state)
|
|
100
|
-
...state,
|
|
101
|
-
status: "invalidated",
|
|
102
|
-
reason: data.reason,
|
|
103
|
-
duration: 0,
|
|
104
|
-
}));
|
|
63
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "invalidated", reason: data.reason, duration: 0 })); });
|
|
105
64
|
}
|
|
106
65
|
});
|
|
107
|
-
worker.on("exit", ()
|
|
108
|
-
subject.update((state)
|
|
109
|
-
...state,
|
|
110
|
-
status: "success",
|
|
111
|
-
log: opts.retainLog ? state.log : "",
|
|
112
|
-
}));
|
|
66
|
+
worker.on("exit", function () {
|
|
67
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "success", log: opts.retainLog ? state.log : "" })); });
|
|
113
68
|
});
|
|
114
69
|
return subject;
|
|
115
70
|
}
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.createServerlessWorker = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
15
|
+
var worker_threads_1 = require("worker_threads");
|
|
16
|
+
var path_1 = require("path");
|
|
17
|
+
var Observable_1 = require("../utils/Observable");
|
|
7
18
|
function createServerlessWorker() {
|
|
8
|
-
|
|
19
|
+
var worker = new worker_threads_1.Worker((0, path_1.join)(__dirname, "workers/serverless-worker-dev-script.js"), {
|
|
9
20
|
workerData: {},
|
|
10
21
|
stderr: true,
|
|
11
22
|
stdin: false,
|
|
12
23
|
stdout: true,
|
|
13
|
-
env: {
|
|
14
|
-
...process.env,
|
|
15
|
-
FORCE_COLOR: "1",
|
|
16
|
-
},
|
|
24
|
+
env: __assign(__assign({}, process.env), { FORCE_COLOR: "1" }),
|
|
17
25
|
});
|
|
18
|
-
|
|
26
|
+
var subject = new Observable_1.Observable({
|
|
19
27
|
title: "Serverless",
|
|
20
28
|
status: "starting",
|
|
21
29
|
log: "",
|
|
22
30
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
var parseChunk = function (str) {
|
|
32
|
+
var escaped = JSON.stringify(str).replace(/(^"|"$)/g, "");
|
|
33
|
+
var status;
|
|
34
|
+
var duration = 0;
|
|
27
35
|
if (str.includes("\u001b[31merror\u001b[39m")) {
|
|
28
36
|
status = "error";
|
|
29
37
|
}
|
|
30
38
|
else if (str.includes("\u001b[35mevent\u001b[39m") && str.includes("successfully")) {
|
|
31
39
|
status = "success";
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
var secondsMatch = str.match(/[0-9.]+s/);
|
|
41
|
+
var msMatch = str.match(/[0-9.]+ ms/);
|
|
34
42
|
if (secondsMatch) {
|
|
35
43
|
duration = parseFloat(secondsMatch[0].replace("s", "")) * 1000;
|
|
36
44
|
}
|
|
@@ -43,71 +51,41 @@ function createServerlessWorker() {
|
|
|
43
51
|
}
|
|
44
52
|
return {
|
|
45
53
|
text: str,
|
|
46
|
-
status,
|
|
47
|
-
duration,
|
|
54
|
+
status: status,
|
|
55
|
+
duration: duration,
|
|
48
56
|
};
|
|
49
57
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
subject.update((state)
|
|
53
|
-
...state,
|
|
54
|
-
log: (state.log || "") + result.text,
|
|
55
|
-
status: result.status ? result.status : state.status,
|
|
56
|
-
duration: result.status === "success" ? result.duration : state.duration,
|
|
57
|
-
}));
|
|
58
|
+
var handleChunk = function (chunk) {
|
|
59
|
+
var result = parseChunk(String(chunk));
|
|
60
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { log: (state.log || "") + result.text, status: result.status ? result.status : state.status, duration: result.status === "success" ? result.duration : state.duration })); });
|
|
58
61
|
};
|
|
59
62
|
worker.stderr.on("data", handleChunk);
|
|
60
63
|
worker.stdout.on("data", handleChunk);
|
|
61
|
-
worker.on("error", (err)
|
|
64
|
+
worker.on("error", function (err) {
|
|
62
65
|
console.log(err);
|
|
63
|
-
subject.update((state)
|
|
64
|
-
...state,
|
|
65
|
-
status: "error",
|
|
66
|
-
}));
|
|
66
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "error" })); });
|
|
67
67
|
});
|
|
68
|
-
worker.on("exit", (code)
|
|
69
|
-
subject.update((state)
|
|
70
|
-
...state,
|
|
71
|
-
status: "error",
|
|
72
|
-
}));
|
|
68
|
+
worker.on("exit", function (code) {
|
|
69
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "error" })); });
|
|
73
70
|
});
|
|
74
|
-
worker.on("message", (data)
|
|
71
|
+
worker.on("message", function (data) {
|
|
75
72
|
if (data.code === "preparing") {
|
|
76
|
-
subject.update((state)
|
|
77
|
-
...state,
|
|
78
|
-
status: "preparing",
|
|
79
|
-
}));
|
|
73
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "preparing" })); });
|
|
80
74
|
}
|
|
81
75
|
else if (data.code === "packaging") {
|
|
82
|
-
subject.update((state)
|
|
83
|
-
...state,
|
|
84
|
-
status: "packaging",
|
|
85
|
-
}));
|
|
76
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "packaging" })); });
|
|
86
77
|
}
|
|
87
78
|
else if (data.code === "compiling") {
|
|
88
|
-
subject.update((state)
|
|
89
|
-
...state,
|
|
90
|
-
status: "compiling",
|
|
91
|
-
}));
|
|
79
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "compiling" })); });
|
|
92
80
|
}
|
|
93
81
|
else if (data.code === "finished") {
|
|
94
|
-
subject.update((state)
|
|
95
|
-
...state,
|
|
96
|
-
status: "success",
|
|
97
|
-
duration: data.duration,
|
|
98
|
-
}));
|
|
82
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "success", duration: data.duration })); });
|
|
99
83
|
}
|
|
100
84
|
else if (data.code === "error") {
|
|
101
|
-
subject.update((state)
|
|
102
|
-
...state,
|
|
103
|
-
status: "error",
|
|
104
|
-
}));
|
|
85
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "error" })); });
|
|
105
86
|
}
|
|
106
87
|
else if (data.code === "url") {
|
|
107
|
-
subject.update((state)
|
|
108
|
-
...state,
|
|
109
|
-
url: data.url,
|
|
110
|
-
}));
|
|
88
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { url: data.url })); });
|
|
111
89
|
}
|
|
112
90
|
});
|
|
113
91
|
// worker.on("exit", () => {
|
|
@@ -1,95 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.createWebpackWorker = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
15
|
+
var worker_threads_1 = require("worker_threads");
|
|
16
|
+
var path_1 = require("path");
|
|
17
|
+
var Observable_1 = require("../utils/Observable");
|
|
7
18
|
function createWebpackWorker(opts) {
|
|
8
|
-
|
|
19
|
+
var worker = new worker_threads_1.Worker((0, path_1.join)(__dirname, "workers/webpack-worker-script.js"), {
|
|
9
20
|
workerData: opts,
|
|
10
21
|
stderr: true,
|
|
11
22
|
stdin: false,
|
|
12
23
|
stdout: true,
|
|
13
|
-
env: {
|
|
14
|
-
...process.env,
|
|
15
|
-
FORCE_COLOR: "1",
|
|
16
|
-
},
|
|
24
|
+
env: __assign(__assign({}, process.env), { FORCE_COLOR: "1" }),
|
|
17
25
|
});
|
|
18
|
-
worker.stderr.on("data", (chunk)
|
|
19
|
-
subject.update((state)
|
|
20
|
-
...state,
|
|
21
|
-
log: (state.log || "") + chunk,
|
|
22
|
-
}));
|
|
26
|
+
worker.stderr.on("data", function (chunk) {
|
|
27
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { log: (state.log || "") + chunk })); });
|
|
23
28
|
});
|
|
24
|
-
worker.stdout.on("data", (chunk)
|
|
25
|
-
|
|
29
|
+
worker.stdout.on("data", function (chunk) {
|
|
30
|
+
var str = chunk.toString();
|
|
26
31
|
if (str.includes("Project is running at") || str.includes("webpack output is served from")) {
|
|
27
32
|
return;
|
|
28
33
|
}
|
|
29
|
-
subject.update((state)
|
|
30
|
-
...state,
|
|
31
|
-
log: (state.log || "") + str,
|
|
32
|
-
}));
|
|
34
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { log: (state.log || "") + str })); });
|
|
33
35
|
});
|
|
34
|
-
|
|
36
|
+
var subject = new Observable_1.Observable({
|
|
35
37
|
title: opts.title,
|
|
36
38
|
status: "starting",
|
|
37
39
|
});
|
|
38
|
-
worker.on("error", (err)
|
|
39
|
-
subject.update((state)
|
|
40
|
-
...state,
|
|
41
|
-
status: "error",
|
|
42
|
-
error: err,
|
|
43
|
-
}));
|
|
40
|
+
worker.on("error", function (err) {
|
|
41
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "error", error: err })); });
|
|
44
42
|
});
|
|
45
|
-
worker.on("message", (data)
|
|
43
|
+
worker.on("message", function (data) {
|
|
46
44
|
if (data.code === "compiling") {
|
|
47
|
-
subject.update((state)
|
|
48
|
-
...state,
|
|
49
|
-
status: "compiling",
|
|
50
|
-
statusLabel: state.status === "compiling" ? state.statusLabel : "",
|
|
51
|
-
log: opts.retainLog ? state.log : "",
|
|
52
|
-
duration: 0,
|
|
53
|
-
errors: [],
|
|
54
|
-
}));
|
|
45
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "compiling", statusLabel: state.status === "compiling" ? state.statusLabel : "", log: opts.retainLog ? state.log : "", duration: 0, errors: [] })); });
|
|
55
46
|
}
|
|
56
47
|
else if (data.code === "error") {
|
|
57
|
-
subject.update((state)
|
|
58
|
-
...state,
|
|
59
|
-
status: "error",
|
|
60
|
-
statusLabel: "",
|
|
61
|
-
duration: 0,
|
|
62
|
-
errors: data.errors,
|
|
63
|
-
}));
|
|
48
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "error", statusLabel: "", duration: 0, errors: data.errors })); });
|
|
64
49
|
}
|
|
65
50
|
else if (data.code === "finished") {
|
|
66
|
-
subject.update((state)
|
|
67
|
-
...state,
|
|
68
|
-
status: data.watching ? "waiting" : "success",
|
|
69
|
-
statusLabel: "",
|
|
70
|
-
duration: data.duration,
|
|
71
|
-
log: opts.retainLog ? state.log : "",
|
|
72
|
-
errors: data.errors,
|
|
73
|
-
}));
|
|
51
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: data.watching ? "waiting" : "success", statusLabel: "", duration: data.duration, log: opts.retainLog ? state.log : "", errors: data.errors })); });
|
|
74
52
|
}
|
|
75
53
|
else if (data.code === "invalidated") {
|
|
76
|
-
subject.update((state)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
statusLabel: data.changedFile
|
|
80
|
-
? `Rebuilding (${data.changedFile.replace(opts.baseDirectory, "")})`
|
|
81
|
-
: "Rebuilding (changes detected)",
|
|
82
|
-
log: opts.retainLog ? state.log : "",
|
|
83
|
-
duration: 0,
|
|
84
|
-
errors: [],
|
|
85
|
-
}));
|
|
54
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "compiling", statusLabel: data.changedFile
|
|
55
|
+
? "Rebuilding (".concat(data.changedFile.replace(opts.baseDirectory, ""), ")")
|
|
56
|
+
: "Rebuilding (changes detected)", log: opts.retainLog ? state.log : "", duration: 0, errors: [] })); });
|
|
86
57
|
}
|
|
87
58
|
});
|
|
88
|
-
worker.on("exit", ()
|
|
89
|
-
subject.update((state)
|
|
90
|
-
...state,
|
|
91
|
-
status: "success",
|
|
92
|
-
}));
|
|
59
|
+
worker.on("exit", function () {
|
|
60
|
+
subject.update(function (state) { return (__assign(__assign({}, state), { status: "success" })); });
|
|
93
61
|
});
|
|
94
62
|
return subject;
|
|
95
63
|
}
|
package/build/file-tree.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type FileList = string[];
|
|
2
|
-
type Disposer = () => void;
|
|
1
|
+
declare type FileList = string[];
|
|
2
|
+
declare type Disposer = () => void;
|
|
3
3
|
export declare function watchFileTree(pattern: string, callback: (files: FileList) => void): Promise<Disposer>;
|
|
4
4
|
export declare function getFileTree(pattern: string): Promise<FileList>;
|
|
5
5
|
export {};
|
package/build/file-tree.js
CHANGED
|
@@ -4,35 +4,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getFileTree = exports.watchFileTree = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var chokidar_1 = __importDefault(require("chokidar"));
|
|
8
|
+
var glob_promise_1 = __importDefault(require("glob-promise"));
|
|
9
9
|
function watchFileTree(pattern, callback) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return new Promise((resolve)
|
|
10
|
+
var files = [];
|
|
11
|
+
var ready = false;
|
|
12
|
+
return new Promise(function (resolve) {
|
|
13
13
|
// Watch, according
|
|
14
|
-
|
|
14
|
+
var watcher = chokidar_1.default
|
|
15
15
|
.watch(pattern)
|
|
16
|
-
.on("add", (path)
|
|
16
|
+
.on("add", function (path) {
|
|
17
17
|
files.push(path);
|
|
18
18
|
if (ready)
|
|
19
19
|
callback(files);
|
|
20
20
|
})
|
|
21
|
-
.on("unlink", (path)
|
|
22
|
-
|
|
21
|
+
.on("unlink", function (path) {
|
|
22
|
+
var i = files.indexOf(path);
|
|
23
23
|
if (i !== -1)
|
|
24
24
|
files.splice(i, 1);
|
|
25
25
|
if (ready)
|
|
26
26
|
callback(files);
|
|
27
27
|
})
|
|
28
|
-
.on("change", ()
|
|
28
|
+
.on("change", function () {
|
|
29
29
|
if (ready)
|
|
30
30
|
callback(files);
|
|
31
31
|
})
|
|
32
|
-
.on("ready", ()
|
|
32
|
+
.on("ready", function () {
|
|
33
33
|
ready = true;
|
|
34
34
|
callback(files);
|
|
35
|
-
resolve(()
|
|
35
|
+
resolve(function () {
|
|
36
36
|
watcher.close();
|
|
37
37
|
});
|
|
38
38
|
});
|