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,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
var worker_threads_1 = require("worker_threads");
|
|
4
|
+
var create_next_app_1 = require("../serverless/create-next-app");
|
|
5
|
+
var sendSignal = function (sig) {
|
|
6
6
|
if (worker_threads_1.parentPort) {
|
|
7
7
|
worker_threads_1.parentPort.postMessage(sig);
|
|
8
8
|
}
|
|
@@ -15,7 +15,7 @@ function beginWork() {
|
|
|
15
15
|
baseDirectory: process.cwd(),
|
|
16
16
|
build: false,
|
|
17
17
|
dev: true,
|
|
18
|
-
sendSignal,
|
|
18
|
+
sendSignal: sendSignal,
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
beginWork();
|
|
@@ -1,105 +1,171 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
2
47
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
49
|
};
|
|
5
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
51
|
exports.beginWork = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
52
|
+
var webpack_1 = __importDefault(require("webpack"));
|
|
53
|
+
var webpack_dev_server_1 = __importDefault(require("webpack-dev-server"));
|
|
54
|
+
var worker_threads_1 = require("worker_threads");
|
|
55
|
+
var get_webpack_config_1 = __importDefault(require("../get-webpack-config"));
|
|
56
|
+
var clean_1 = require("../clean");
|
|
57
|
+
var sendSignal = function (sig) {
|
|
13
58
|
if (worker_threads_1.parentPort) {
|
|
14
59
|
worker_threads_1.parentPort.postMessage(sig);
|
|
15
60
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
sendSignal({
|
|
19
|
-
code: "compiling",
|
|
20
|
-
});
|
|
21
|
-
await (0, clean_1.cleanOutput)();
|
|
22
|
-
function extractErrorMessage(str) {
|
|
23
|
-
return str
|
|
24
|
-
.replace(/Module build failed[^\n]+\n/, "")
|
|
25
|
-
.replaceAll(opts.baseDirectory, "./")
|
|
26
|
-
.replace(/\s+at\s[\s\S]+/, "");
|
|
27
|
-
}
|
|
28
|
-
function webpackToCompilerError(err, type) {
|
|
29
|
-
return {
|
|
30
|
-
type,
|
|
31
|
-
details: err.details,
|
|
32
|
-
message: extractErrorMessage(err.message),
|
|
33
|
-
file: err.moduleName || "",
|
|
34
|
-
loc: err.loc,
|
|
35
|
-
};
|
|
61
|
+
else {
|
|
62
|
+
console.log("MSG", sig);
|
|
36
63
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
port: opts.hotPort,
|
|
46
|
-
writeToDisk: true,
|
|
47
|
-
transportMode: "ws",
|
|
48
|
-
publicPath: "/",
|
|
49
|
-
public: "http://127.0.0.1:" + opts.hotPort,
|
|
50
|
-
overlay: true,
|
|
51
|
-
sockPort: opts.hotPort,
|
|
52
|
-
contentBase: false,
|
|
53
|
-
noInfo: true,
|
|
54
|
-
https: false,
|
|
55
|
-
quiet: true,
|
|
56
|
-
// quiet: true,
|
|
57
|
-
// clientLogLevel: "silent",
|
|
58
|
-
headers: {
|
|
59
|
-
"Access-Control-Allow-Origin": "*",
|
|
60
|
-
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
61
|
-
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization",
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
server.listen(opts.hotPort);
|
|
65
|
-
}
|
|
66
|
-
compiler.hooks.beforeCompile.tap("eddev", () => {
|
|
67
|
-
sendSignal({
|
|
68
|
-
code: "compiling",
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
compiler.hooks.invalid.tap("eddev", (filename) => {
|
|
72
|
-
sendSignal({
|
|
73
|
-
code: "invalidated",
|
|
74
|
-
changedFile: filename,
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
compiler.hooks.done.tap("eddev", ({ compilation }) => {
|
|
78
|
-
const stats = compilation.getStats().toJson({
|
|
79
|
-
all: true,
|
|
80
|
-
errorDetails: true,
|
|
81
|
-
errors: true,
|
|
82
|
-
errorStack: true,
|
|
83
|
-
errorsCount: true,
|
|
84
|
-
colors: true,
|
|
85
|
-
timings: true,
|
|
86
|
-
});
|
|
87
|
-
const errors = stats.errors?.map((err) => webpackToCompilerError(err, "error")) || [];
|
|
88
|
-
const warnings = stats.warnings?.map((err) => webpackToCompilerError(err, "warning")) || [];
|
|
89
|
-
if (errors.length) {
|
|
90
|
-
sendSignal({
|
|
91
|
-
code: "error",
|
|
92
|
-
errors: [...warnings, ...errors],
|
|
93
|
-
});
|
|
64
|
+
};
|
|
65
|
+
function beginWork(opts) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
+
function extractErrorMessage(str) {
|
|
68
|
+
return str
|
|
69
|
+
.replace(/Module build failed[^\n]+\n/, "")
|
|
70
|
+
.replaceAll(opts.baseDirectory, "./")
|
|
71
|
+
.replace(/\s+at\s[\s\S]+/, "");
|
|
94
72
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
73
|
+
function webpackToCompilerError(err, type) {
|
|
74
|
+
return {
|
|
75
|
+
type: type,
|
|
76
|
+
details: err.details,
|
|
77
|
+
message: extractErrorMessage(err.message),
|
|
78
|
+
file: err.moduleName || "",
|
|
79
|
+
loc: err.loc,
|
|
80
|
+
};
|
|
101
81
|
}
|
|
82
|
+
var compiler, _a, server;
|
|
83
|
+
return __generator(this, function (_b) {
|
|
84
|
+
switch (_b.label) {
|
|
85
|
+
case 0:
|
|
86
|
+
sendSignal({
|
|
87
|
+
code: "compiling",
|
|
88
|
+
});
|
|
89
|
+
return [4 /*yield*/, (0, clean_1.cleanOutput)()];
|
|
90
|
+
case 1:
|
|
91
|
+
_b.sent();
|
|
92
|
+
_a = webpack_1.default;
|
|
93
|
+
return [4 /*yield*/, (0, get_webpack_config_1.default)(opts)];
|
|
94
|
+
case 2:
|
|
95
|
+
compiler = _a.apply(void 0, [_b.sent()]);
|
|
96
|
+
if (opts.hotPort) {
|
|
97
|
+
server = new webpack_dev_server_1.default(compiler, {
|
|
98
|
+
liveReload: false,
|
|
99
|
+
compress: true,
|
|
100
|
+
hotOnly: true,
|
|
101
|
+
disableHostCheck: true,
|
|
102
|
+
host: "127.0.0.1",
|
|
103
|
+
port: opts.hotPort,
|
|
104
|
+
writeToDisk: true,
|
|
105
|
+
transportMode: "ws",
|
|
106
|
+
publicPath: "/",
|
|
107
|
+
public: "http://127.0.0.1:" + opts.hotPort,
|
|
108
|
+
overlay: true,
|
|
109
|
+
sockPort: opts.hotPort,
|
|
110
|
+
contentBase: false,
|
|
111
|
+
noInfo: true,
|
|
112
|
+
https: false,
|
|
113
|
+
quiet: true,
|
|
114
|
+
// quiet: true,
|
|
115
|
+
// clientLogLevel: "silent",
|
|
116
|
+
headers: {
|
|
117
|
+
"Access-Control-Allow-Origin": "*",
|
|
118
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
119
|
+
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization",
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
server.listen(opts.hotPort);
|
|
123
|
+
}
|
|
124
|
+
compiler.hooks.beforeCompile.tap("eddev", function () {
|
|
125
|
+
sendSignal({
|
|
126
|
+
code: "compiling",
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
compiler.hooks.invalid.tap("eddev", function (filename) {
|
|
130
|
+
sendSignal({
|
|
131
|
+
code: "invalidated",
|
|
132
|
+
changedFile: filename,
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
compiler.hooks.done.tap("eddev", function (_a) {
|
|
136
|
+
var _b, _c;
|
|
137
|
+
var compilation = _a.compilation;
|
|
138
|
+
var stats = compilation.getStats().toJson({
|
|
139
|
+
all: true,
|
|
140
|
+
errorDetails: true,
|
|
141
|
+
errors: true,
|
|
142
|
+
errorStack: true,
|
|
143
|
+
errorsCount: true,
|
|
144
|
+
colors: true,
|
|
145
|
+
timings: true,
|
|
146
|
+
});
|
|
147
|
+
var errors = ((_b = stats.errors) === null || _b === void 0 ? void 0 : _b.map(function (err) { return webpackToCompilerError(err, "error"); })) || [];
|
|
148
|
+
var warnings = ((_c = stats.warnings) === null || _c === void 0 ? void 0 : _c.map(function (err) { return webpackToCompilerError(err, "warning"); })) || [];
|
|
149
|
+
if (errors.length) {
|
|
150
|
+
sendSignal({
|
|
151
|
+
code: "error",
|
|
152
|
+
errors: __spreadArray(__spreadArray([], warnings, true), errors, true),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
sendSignal({
|
|
157
|
+
code: "finished",
|
|
158
|
+
duration: stats.time,
|
|
159
|
+
errors: __spreadArray(__spreadArray([], warnings, true), errors, true),
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
return [2 /*return*/];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
102
166
|
});
|
|
103
167
|
}
|
|
104
168
|
exports.beginWork = beginWork;
|
|
105
|
-
|
|
169
|
+
if (worker_threads_1.parentPort) {
|
|
170
|
+
beginWork(worker_threads_1.workerData);
|
|
171
|
+
}
|
package/cli/build.dev.d.ts
CHANGED
package/cli/build.dev.js
CHANGED
|
@@ -1,89 +1,136 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
40
|
};
|
|
5
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
42
|
exports.devCommand = void 0;
|
|
7
|
-
|
|
43
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
44
|
// import inquirer from "inquirer"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
45
|
+
var promptIfRepoNameIncorrect_1 = require("../utils/promptIfRepoNameIncorrect");
|
|
46
|
+
var path_1 = __importDefault(require("path"));
|
|
47
|
+
var ink_1 = require("ink");
|
|
48
|
+
var DevCLIDisplay_1 = require("./display/components/DevCLIDisplay");
|
|
49
|
+
var create_webpack_worker_1 = require("../build/create-webpack-worker");
|
|
50
|
+
var create_codegen_worker_1 = require("../build/create-codegen-worker");
|
|
51
|
+
var create_schema_file_1 = require("../config/create-schema-file");
|
|
52
|
+
var get_config_1 = require("../config/get-config");
|
|
53
|
+
var print_zod_errors_1 = require("../config/print-zod-errors");
|
|
54
|
+
var Observable_1 = require("../utils/Observable");
|
|
55
|
+
var fs_extra_1 = require("fs-extra");
|
|
56
|
+
var create_serverless_dev_worker_1 = require("../build/create-serverless-dev-worker");
|
|
57
|
+
var build_favicon_1 = require("../build/build-favicon");
|
|
58
|
+
var compare_versions_1 = __importDefault(require("compare-versions"));
|
|
59
|
+
var chalk_1 = __importDefault(require("chalk"));
|
|
60
|
+
function devCommand(opts) {
|
|
61
|
+
var _a;
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
var version, requiredVersion, configResult, config, themeName, enableFrontend, enableAdmin, enableCodegen, enableServerless, frontendObservable, adminObservable, codegenObservable, configChanged, serverlessObservable;
|
|
64
|
+
return __generator(this, function (_b) {
|
|
65
|
+
switch (_b.label) {
|
|
66
|
+
case 0:
|
|
67
|
+
version = require(path_1.default.join(__dirname, "../package.json")).version;
|
|
68
|
+
requiredVersion = require(path_1.default.join(process.cwd(), "package.json")).devDependencies.eddev;
|
|
69
|
+
if ((0, compare_versions_1.default)(version, requiredVersion) < 0) {
|
|
70
|
+
console.log(chalk_1.default.red("\uD83D\uDEA8 Incorrect 'eddev' version installed!\n\uD83D\uDEA8 Your package.json requires ".concat(chalk_1.default.yellow(requiredVersion), ", but you have ").concat(chalk_1.default.yellow(version), ".\n\uD83D\uDEA8 Do you need to run 'yarn'?")));
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
(0, create_schema_file_1.createConfigSchemaFile)(path_1.default.resolve(process.cwd(), ".ed.config.schema.json"));
|
|
74
|
+
(0, build_favicon_1.buildFavicon)().catch(function () { });
|
|
75
|
+
return [4 /*yield*/, (0, promptIfRepoNameIncorrect_1.promptIfRepoThemeMismatch)()];
|
|
76
|
+
case 1:
|
|
77
|
+
_b.sent();
|
|
78
|
+
configResult = (0, get_config_1.getEDConfig)();
|
|
79
|
+
if (configResult.success === false) {
|
|
80
|
+
(0, print_zod_errors_1.printZodErrors)(configResult.error);
|
|
81
|
+
console.log("\nPlease fix the above config errors, and restart the dev command.");
|
|
82
|
+
return [2 /*return*/];
|
|
83
|
+
}
|
|
84
|
+
config = configResult.data;
|
|
85
|
+
themeName = path_1.default.basename(process.cwd());
|
|
86
|
+
enableFrontend = !opts.mode || opts.mode === "frontend";
|
|
87
|
+
enableAdmin = !opts.mode || opts.mode === "admin";
|
|
88
|
+
enableCodegen = !opts.mode || opts.mode === "codegen";
|
|
89
|
+
enableServerless = (_a = config.serverless) === null || _a === void 0 ? void 0 : _a.enabled;
|
|
90
|
+
frontendObservable = enableFrontend
|
|
91
|
+
? (0, create_webpack_worker_1.createWebpackWorker)({
|
|
92
|
+
title: "Frontend Bundle",
|
|
93
|
+
baseDirectory: process.cwd() + "/",
|
|
94
|
+
mode: "development",
|
|
95
|
+
target: "client",
|
|
96
|
+
serverless: opts.serverless,
|
|
97
|
+
themeName: themeName,
|
|
98
|
+
isAdmin: false,
|
|
99
|
+
hotPort: 8991,
|
|
100
|
+
retainLog: opts.retainLog,
|
|
101
|
+
})
|
|
102
|
+
: undefined;
|
|
103
|
+
adminObservable = enableAdmin
|
|
104
|
+
? (0, create_webpack_worker_1.createWebpackWorker)({
|
|
105
|
+
title: "Admin Client",
|
|
106
|
+
baseDirectory: process.cwd() + "/",
|
|
107
|
+
mode: "development",
|
|
108
|
+
target: "client",
|
|
109
|
+
serverless: false,
|
|
110
|
+
themeName: themeName,
|
|
111
|
+
isAdmin: true,
|
|
112
|
+
hotPort: 8992,
|
|
113
|
+
retainLog: opts.retainLog,
|
|
114
|
+
})
|
|
115
|
+
: undefined;
|
|
116
|
+
codegenObservable = enableCodegen
|
|
117
|
+
? (0, create_codegen_worker_1.createCodegenWorker)({
|
|
118
|
+
baseDirectory: process.cwd() + "/",
|
|
119
|
+
watch: true,
|
|
120
|
+
retainLog: opts.retainLog,
|
|
121
|
+
})
|
|
122
|
+
: undefined;
|
|
123
|
+
configChanged = new Observable_1.Observable(false);
|
|
124
|
+
(0, fs_extra_1.watchFile)((0, get_config_1.getEDConfigFile)(), {}, function () {
|
|
125
|
+
configChanged.update(true);
|
|
126
|
+
});
|
|
127
|
+
serverlessObservable = enableServerless ? (0, create_serverless_dev_worker_1.createServerlessWorker)() : undefined;
|
|
128
|
+
// Render output to screen
|
|
129
|
+
(0, ink_1.render)((0, jsx_runtime_1.jsx)(DevCLIDisplay_1.DevCLIDisplay, { bundles: [frontendObservable, adminObservable].filter(Boolean), serverless: serverlessObservable, codegen: codegenObservable, configChanged: configChanged }, void 0));
|
|
130
|
+
return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
83
133
|
});
|
|
84
|
-
const serverlessObservable = enableServerless ? (0, create_serverless_dev_worker_1.createServerlessWorker)() : undefined;
|
|
85
|
-
// Render output to screen
|
|
86
|
-
(0, ink_1.render)((0, jsx_runtime_1.jsx)(DevCLIDisplay_1.DevCLIDisplay, { bundles: [frontendObservable, adminObservable].filter(Boolean), serverless: serverlessObservable, codegen: codegenObservable, configChanged: configChanged }));
|
|
87
134
|
}
|
|
88
135
|
exports.devCommand = devCommand;
|
|
89
|
-
|
|
136
|
+
var delay = function (time) { return new Promise(function (resolve) { return setTimeout(resolve, time); }); };
|
package/cli/build.prod.d.ts
CHANGED