eddev 0.2.65 → 0.2.67-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 -3
- package/admin/components/ImageWell.js +39 -51
- package/admin/defineField.d.ts +2 -2
- package/admin/defineWidget.d.ts +1 -1
- package/admin/defineWidget.js +2 -2
- package/admin/index.js +5 -1
- package/admin/installFieldTypes.js +26 -26
- package/admin/runWidgets.js +17 -28
- package/admin/selectMedia.d.ts +2 -2
- package/admin/selectMedia.js +1 -1
- package/blocks/ContentBlocks.d.ts +6 -6
- package/blocks/ContentBlocks.js +58 -66
- package/blocks/ErrorBoundaryEditor.d.ts +1 -1
- package/blocks/ErrorBoundaryEditor.js +16 -45
- package/blocks/ErrorBoundaryFrontend.d.ts +1 -1
- package/blocks/ErrorBoundaryFrontend.js +16 -45
- package/blocks/InspectorControls.d.ts +1 -1
- package/blocks/InspectorControls.js +3 -3
- package/blocks/blockAttributes.d.ts +2 -2
- package/blocks/blockAttributes.js +24 -44
- package/blocks/index.js +5 -1
- package/blocks/inlineEditing.d.ts +7 -7
- package/blocks/inlineEditing.js +36 -55
- package/blocks/installGutenbergHooks.js +48 -68
- package/build/babel/plugin-name-defined-components.js +15 -16
- package/build/build-favicon.js +11 -62
- package/build/clean.js +5 -52
- package/build/create-codegen-worker.js +78 -33
- package/build/create-serverless-dev-worker.js +61 -39
- package/build/create-webpack-worker.js +65 -33
- package/build/file-tree.d.ts +2 -2
- package/build/file-tree.js +12 -12
- package/build/get-webpack-config.js +341 -395
- package/build/graphql-codegen/graphql-codegen-files.js +31 -25
- package/build/graphql-codegen/graphql-codegen-no-duplicates.js +4 -4
- package/build/graphql-codegen/graphql-codegen-queries.js +102 -99
- package/build/manifests/manifest-blocks.d.ts +1 -1
- package/build/manifests/manifest-blocks.js +37 -29
- package/build/manifests/manifest-fields.d.ts +1 -1
- package/build/manifests/manifest-fields.js +23 -21
- package/build/manifests/manifest-views.d.ts +1 -1
- package/build/manifests/manifest-views.js +32 -25
- package/build/manifests/manifest-widgets.d.ts +1 -1
- package/build/manifests/manifest-widgets.js +22 -20
- package/build/manifests/manifest.d.ts +2 -2
- package/build/manifests/manifest.js +30 -90
- package/build/reporter.d.ts +1 -1
- package/build/reporter.js +29 -32
- package/build/serverless/create-next-app.d.ts +1 -1
- package/build/serverless/create-next-app.js +245 -467
- 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 +392 -507
- package/build/workers/serverless-worker-dev-script.js +4 -4
- package/build/workers/webpack-worker-script.js +89 -150
- package/cli/build.dev.d.ts +1 -1
- package/cli/build.dev.js +79 -126
- package/cli/build.prod.d.ts +1 -1
- package/cli/build.prod.js +42 -98
- package/cli/cli.js +16 -55
- package/cli/display/components/BundleDisplay.d.ts +1 -2
- package/cli/display/components/BundleDisplay.js +13 -24
- package/cli/display/components/CodegenDisplay.d.ts +1 -2
- package/cli/display/components/CodegenDisplay.js +14 -25
- package/cli/display/components/DevCLIDisplay.d.ts +2 -3
- package/cli/display/components/DevCLIDisplay.js +14 -25
- package/cli/display/components/Fullscreen.js +9 -20
- package/cli/display/components/ServerlessDisplay.d.ts +2 -3
- package/cli/display/components/ServerlessDisplay.js +15 -26
- package/cli/display/components/StatusIcon.d.ts +2 -3
- package/cli/display/components/StatusIcon.js +3 -3
- package/cli/preinstall.js +4 -5
- package/cli/setup.js +25 -73
- package/components/AdminBar.d.ts +1 -2
- package/components/AdminBar.js +37 -3
- package/components/BrowserRouter.d.ts +2 -2
- package/components/BrowserRouter.js +41 -54
- package/components/InlinePage.d.ts +2 -2
- package/components/InlinePage.js +17 -29
- package/components/NextRouter.d.ts +2 -2
- package/components/NextRouter.js +20 -29
- package/components/index.js +5 -1
- 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 +10 -13
- package/config/index.js +5 -1
- package/config/parse-config.js +1 -1
- package/config/print-zod-errors.js +3 -3
- package/dev-ui/components/BreakpointColumnHeader.d.ts +2 -3
- package/dev-ui/components/BreakpointColumnHeader.js +7 -18
- package/dev-ui/components/BreakpointIndicator.d.ts +1 -2
- package/dev-ui/components/BreakpointIndicator.js +25 -32
- package/dev-ui/components/DevUI.d.ts +1 -2
- package/dev-ui/components/DevUI.js +13 -13
- package/dev-ui/components/Launcher.d.ts +2 -2
- package/dev-ui/components/Launcher.js +13 -25
- 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 -3
- package/dev-ui/components/ResponsiveLerpControl.js +27 -38
- package/dev-ui/components/ResponsiveScaleEditor.d.ts +4 -5
- package/dev-ui/components/ResponsiveScaleEditor.js +64 -78
- 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 +8 -9
- package/dev-ui/components/atoms/NumberField.d.ts +2 -3
- package/dev-ui/components/atoms/NumberField.js +29 -42
- 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 +5 -16
- package/dev-ui/components/atoms/Tooltip.d.ts +2 -2
- package/dev-ui/components/atoms/Tooltip.js +8 -20
- package/dev-ui/components/panels/AppDataDebugger.d.ts +1 -2
- package/dev-ui/components/panels/AppDataDebugger.js +8 -19
- package/dev-ui/components/panels/ColorEditor.d.ts +1 -2
- package/dev-ui/components/panels/ColorEditor.js +35 -42
- package/dev-ui/components/panels/PageDataDebugger.d.ts +1 -2
- package/dev-ui/components/panels/PageDataDebugger.js +8 -20
- package/dev-ui/components/panels/QueryDebugger.d.ts +1 -2
- package/dev-ui/components/panels/QueryDebugger.js +12 -24
- package/dev-ui/components/panels/SpacingEditor.d.ts +1 -2
- package/dev-ui/components/panels/SpacingEditor.js +34 -48
- package/dev-ui/components/panels/TypographyEditor.d.ts +1 -2
- package/dev-ui/components/panels/TypographyEditor.js +38 -46
- package/dev-ui/hooks/useBreakpoint.d.ts +1 -1
- package/dev-ui/hooks/useBreakpoint.js +13 -13
- package/dev-ui/hooks/usePersistState.js +6 -7
- package/dev-ui/hooks/useStylesheet.js +6 -6
- package/dev-ui/icons.d.ts +15 -16
- package/dev-ui/icons.js +16 -27
- package/dev-ui/index.js +5 -1
- package/dev-ui/loader.d.ts +1 -2
- package/dev-ui/loader.js +13 -9
- package/dev-ui/panels.d.ts +2 -2
- package/dev-ui/panels.js +7 -7
- package/dev-ui/theme.d.ts +96 -70
- package/dev-ui/theme.js +3 -3
- package/dynamic/dynamic-component.d.ts +1 -10
- package/dynamic/dynamic-component.js +1 -1
- package/dynamic/index.js +5 -1
- package/entry/Root.d.ts +2 -3
- package/entry/Root.js +16 -26
- 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 +5 -1
- package/gravityforms/useGravityForm.d.ts +2 -2
- package/gravityforms/useGravityForm.js +126 -130
- package/hooks/index.js +5 -1
- package/hooks/queryUtils.d.ts +14 -14
- package/hooks/queryUtils.js +101 -192
- 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 +7 -7
- package/routing/index.js +5 -1
- package/routing/remoteProps.d.ts +1 -1
- package/routing/remoteProps.js +31 -72
- package/routing/routing.d.ts +15 -15
- package/routing/routing.js +108 -170
- package/routing/updateEditLink.js +1 -1
- package/serverless/define-api.d.ts +1 -1
- package/serverless/define-rpc-router.js +8 -4
- package/serverless/index.js +6 -2
- package/serverless-template/_utils/fetch-wordpress-props.ts +0 -4
- package/serverless-template/_utils/fetch-wp.ts +0 -1
- package/style/createStitches.d.ts +375 -783
- package/style/createStitches.js +164 -142
- package/style/index.js +5 -1
- package/tsconfig.json +1 -1
- package/utils/Observable.d.ts +2 -2
- package/utils/Observable.js +12 -15
- package/utils/getRepoName.js +3 -3
- package/utils/promptIfRepoNameIncorrect.js +18 -64
- 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 +19 -69
- package/utils/useObservable.js +3 -3
- package/views/index.js +5 -1
package/cli/build.prod.js
CHANGED
|
@@ -1,107 +1,51 @@
|
|
|
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
4
|
};
|
|
41
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
6
|
exports.prodCommand = void 0;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
function prodCommand(opts) {
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
target: "client",
|
|
86
|
-
serverless: opts.serverless,
|
|
87
|
-
themeName: themeName,
|
|
88
|
-
isAdmin: true,
|
|
89
|
-
})];
|
|
90
|
-
case 4:
|
|
91
|
-
compiler = _a.apply(void 0, [_b.concat([
|
|
92
|
-
_c.sent()
|
|
93
|
-
])]);
|
|
94
|
-
compiler.run(function (err, stats) {
|
|
95
|
-
if (stats === null || stats === void 0 ? void 0 : stats.hasErrors()) {
|
|
96
|
-
process.exit(1);
|
|
97
|
-
}
|
|
98
|
-
if (err) {
|
|
99
|
-
process.exit(1);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
return [2 /*return*/];
|
|
103
|
-
}
|
|
104
|
-
});
|
|
7
|
+
const get_webpack_config_1 = __importDefault(require("../build/get-webpack-config"));
|
|
8
|
+
const webpack_1 = require("webpack");
|
|
9
|
+
const promptIfRepoNameIncorrect_1 = require("../utils/promptIfRepoNameIncorrect");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const clean_1 = require("../build/clean");
|
|
12
|
+
const build_favicon_1 = require("../build/build-favicon");
|
|
13
|
+
async function prodCommand(opts) {
|
|
14
|
+
const contentBase = process.cwd() + "/dist/";
|
|
15
|
+
(0, build_favicon_1.buildFavicon)().catch((err) => {
|
|
16
|
+
console.log("Error building favicon:");
|
|
17
|
+
console.error(err);
|
|
18
|
+
});
|
|
19
|
+
await (0, promptIfRepoNameIncorrect_1.promptIfRepoThemeMismatch)();
|
|
20
|
+
const themeName = path_1.default.basename(process.cwd());
|
|
21
|
+
await (0, clean_1.cleanOutput)();
|
|
22
|
+
const compiler = (0, webpack_1.webpack)([
|
|
23
|
+
await (0, get_webpack_config_1.default)({
|
|
24
|
+
title: "Frontend Client",
|
|
25
|
+
baseDirectory: process.cwd() + "/",
|
|
26
|
+
mode: "production",
|
|
27
|
+
target: "client",
|
|
28
|
+
serverless: opts.serverless,
|
|
29
|
+
themeName: themeName,
|
|
30
|
+
isAdmin: false,
|
|
31
|
+
}),
|
|
32
|
+
await (0, get_webpack_config_1.default)({
|
|
33
|
+
title: "Admin Client",
|
|
34
|
+
baseDirectory: process.cwd() + "/",
|
|
35
|
+
mode: "production",
|
|
36
|
+
target: "client",
|
|
37
|
+
serverless: opts.serverless,
|
|
38
|
+
themeName: themeName,
|
|
39
|
+
isAdmin: true,
|
|
40
|
+
}),
|
|
41
|
+
]);
|
|
42
|
+
compiler.run((err, stats) => {
|
|
43
|
+
if (stats?.hasErrors()) {
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
if (err) {
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
105
49
|
});
|
|
106
50
|
}
|
|
107
51
|
exports.prodCommand = prodCommand;
|
package/cli/cli.js
CHANGED
|
@@ -1,45 +1,9 @@
|
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const create_next_app_1 = require("../build/serverless/create-next-app");
|
|
5
|
+
const setup_1 = require("./setup");
|
|
6
|
+
const program = new commander_1.Command();
|
|
43
7
|
program.version("0.0.1");
|
|
44
8
|
require("dotenv").config();
|
|
45
9
|
program
|
|
@@ -48,8 +12,8 @@ program
|
|
|
48
12
|
.option("-s, --serverless", 'Build in "serverless" mode', false)
|
|
49
13
|
.option("-m, --mode <mode>", 'Defaults to all modes, but use "frontend", "admin" or "codegen" to run in just one mode', undefined)
|
|
50
14
|
.option("--verbose", "Enables log retention", false)
|
|
51
|
-
.action(
|
|
52
|
-
|
|
15
|
+
.action((options) => {
|
|
16
|
+
const devCommand = require("./build.dev").devCommand;
|
|
53
17
|
devCommand({
|
|
54
18
|
serverless: options.serverless,
|
|
55
19
|
mode: options.mode,
|
|
@@ -59,14 +23,14 @@ program
|
|
|
59
23
|
program
|
|
60
24
|
.command("preinstall")
|
|
61
25
|
.description("Pre-installs for Vercel")
|
|
62
|
-
.action(
|
|
63
|
-
|
|
26
|
+
.action((options) => {
|
|
27
|
+
const main = require("./preinstall").main;
|
|
64
28
|
main();
|
|
65
29
|
});
|
|
66
30
|
program
|
|
67
31
|
.command("build")
|
|
68
32
|
.description("Build in production mode")
|
|
69
|
-
.action(
|
|
33
|
+
.action((options) => {
|
|
70
34
|
if (process.env.VERCEL) {
|
|
71
35
|
(0, create_next_app_1.createNextApp)({
|
|
72
36
|
baseDirectory: process.cwd(),
|
|
@@ -75,7 +39,7 @@ program
|
|
|
75
39
|
});
|
|
76
40
|
}
|
|
77
41
|
else {
|
|
78
|
-
|
|
42
|
+
const prodCommand = require("./build.prod").prodCommand;
|
|
79
43
|
prodCommand({
|
|
80
44
|
serverless: options.serverless,
|
|
81
45
|
});
|
|
@@ -94,7 +58,7 @@ program
|
|
|
94
58
|
program
|
|
95
59
|
.command("next")
|
|
96
60
|
.description("Run the serverless app in standalone mode")
|
|
97
|
-
.action(
|
|
61
|
+
.action((options) => {
|
|
98
62
|
(0, create_next_app_1.createNextApp)({
|
|
99
63
|
baseDirectory: process.cwd(),
|
|
100
64
|
dev: true,
|
|
@@ -104,17 +68,14 @@ program
|
|
|
104
68
|
program
|
|
105
69
|
.command("setup")
|
|
106
70
|
.description("Initialize the WordPress theme interactively")
|
|
107
|
-
.action(
|
|
71
|
+
.action(() => {
|
|
108
72
|
(0, setup_1.setupTheme)();
|
|
109
73
|
});
|
|
110
74
|
program
|
|
111
75
|
.command("generate")
|
|
112
76
|
.description("Generate GraphQL Schemas")
|
|
113
|
-
.action(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return [2 /*return*/];
|
|
118
|
-
});
|
|
119
|
-
}); });
|
|
77
|
+
.action(async () => {
|
|
78
|
+
console.log("This command has been deprecated! Please use `yarn dev` instead.");
|
|
79
|
+
process.exit();
|
|
80
|
+
});
|
|
120
81
|
program.parse(process.argv);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CompilerState } from "../../../build/state/compiler-state";
|
|
3
2
|
import { Observable } from "../../../utils/Observable";
|
|
4
3
|
export declare function BundleDisplay(props: {
|
|
5
4
|
bundle: Observable<CompilerState>;
|
|
6
|
-
}): JSX.Element;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +1,12 @@
|
|
|
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
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.BundleDisplay = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ink_1 = require("ink");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const useObservable_1 = require("../../../utils/useObservable");
|
|
8
|
+
const StatusIcon_1 = require("./StatusIcon");
|
|
9
|
+
const statusLabels = {
|
|
21
10
|
compiling: "Compiling...",
|
|
22
11
|
error: "Error!",
|
|
23
12
|
starting: "Preparing to start...",
|
|
@@ -25,7 +14,7 @@ var statusLabels = {
|
|
|
25
14
|
waiting: "Success! Watching for file changes...",
|
|
26
15
|
};
|
|
27
16
|
function StatusLabel(props) {
|
|
28
|
-
|
|
17
|
+
const color = (0, react_1.useMemo)(() => {
|
|
29
18
|
if (props.status === "compiling") {
|
|
30
19
|
return "yellowBright";
|
|
31
20
|
}
|
|
@@ -39,18 +28,18 @@ function StatusLabel(props) {
|
|
|
39
28
|
return "whiteBright";
|
|
40
29
|
}
|
|
41
30
|
}, [props.status]);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)(ink_1.Text,
|
|
31
|
+
const label = props.statusLabel || statusLabels[props.status];
|
|
32
|
+
const duration = props.duration ? `(${props.duration}ms)` : "";
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(ink_1.Text, { color: color, children: [label, " ", duration] }));
|
|
45
34
|
}
|
|
46
35
|
function BundleDisplay(props) {
|
|
47
|
-
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)(ink_1.Box,
|
|
36
|
+
const data = (0, useObservable_1.useObservable)(props.bundle);
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)(ink_1.Box, { width: "100%", flexDirection: "column", children: [(0, jsx_runtime_1.jsxs)(ink_1.Box, { width: "100%", paddingX: 1, borderStyle: "round", borderColor: data.status === "success" ? "green" : data.status === "error" ? "red" : "yellow", flexDirection: "row", children: [(0, jsx_runtime_1.jsx)(ink_1.Box, { width: 2, flexGrow: 0, flexShrink: 0, children: (0, jsx_runtime_1.jsx)(StatusIcon_1.StatusIcon, { icon: data.status === "success" || data.status === "waiting"
|
|
49
38
|
? "tick"
|
|
50
39
|
: data.status === "compiling"
|
|
51
40
|
? "loading"
|
|
52
41
|
: data.status === "error"
|
|
53
42
|
? "error"
|
|
54
|
-
: "none" }
|
|
43
|
+
: "none" }) }), (0, jsx_runtime_1.jsx)(ink_1.Box, { children: (0, jsx_runtime_1.jsxs)(ink_1.Box, { children: [(0, jsx_runtime_1.jsxs)(ink_1.Text, { bold: true, children: [data.title, " "] }), (0, jsx_runtime_1.jsx)(StatusLabel, { status: data.status, statusLabel: data.statusLabel, duration: data.duration })] }) })] }), (0, jsx_runtime_1.jsxs)(ink_1.Box, { flexGrow: 1, flexDirection: "column", children: [Array.isArray(data.errors) && data.errors.length > 0 ? ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", children: data.errors.map((err, i) => ((0, jsx_runtime_1.jsxs)(ink_1.Box, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(ink_1.Box, { children: (0, jsx_runtime_1.jsx)(ink_1.Text, { color: err.type === "error" ? "red" : "yellow", bold: true, children: err.type === "error" ? "The following error occurred" : "Please be aware of the following warning" }) }), (0, jsx_runtime_1.jsx)(ink_1.Box, { children: (0, jsx_runtime_1.jsx)(ink_1.Text, { children: err.message }) })] }))) })) : null, data.log ? ((0, jsx_runtime_1.jsx)(ink_1.Box, { children: (0, jsx_runtime_1.jsx)(ink_1.Text, { children: data.log }) })) : null] })] }));
|
|
55
44
|
}
|
|
56
45
|
exports.BundleDisplay = BundleDisplay;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CodegenState } from "../../../build/state/codegen-state";
|
|
3
2
|
import { Observable } from "../../../utils/Observable";
|
|
4
3
|
export declare function CodegenDisplay(props: {
|
|
5
4
|
codegen: Observable<CodegenState>;
|
|
6
|
-
}): JSX.Element;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +1,12 @@
|
|
|
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
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.CodegenDisplay = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ink_1 = require("ink");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const useObservable_1 = require("../../../utils/useObservable");
|
|
8
|
+
const StatusIcon_1 = require("./StatusIcon");
|
|
9
|
+
const statusLabels = {
|
|
21
10
|
generating: "Generating...",
|
|
22
11
|
error: "Error!",
|
|
23
12
|
success: "Complete",
|
|
@@ -26,7 +15,7 @@ var statusLabels = {
|
|
|
26
15
|
invalidated: "Detected file change",
|
|
27
16
|
};
|
|
28
17
|
function StatusLabel(props) {
|
|
29
|
-
|
|
18
|
+
const color = (0, react_1.useMemo)(() => {
|
|
30
19
|
if (props.status === "generating" || props.status === "fetching" || props.status === "invalidated") {
|
|
31
20
|
return "yellowBright";
|
|
32
21
|
}
|
|
@@ -40,23 +29,23 @@ function StatusLabel(props) {
|
|
|
40
29
|
return "whiteBright";
|
|
41
30
|
}
|
|
42
31
|
}, [props.status]);
|
|
43
|
-
|
|
32
|
+
let label = props.statusLabel || statusLabels[props.status];
|
|
44
33
|
if (props.reason) {
|
|
45
|
-
label +=
|
|
34
|
+
label += ` (${props.reason})`;
|
|
46
35
|
}
|
|
47
36
|
if (props.duration) {
|
|
48
|
-
label +=
|
|
37
|
+
label += ` (${props.duration}ms)`;
|
|
49
38
|
}
|
|
50
|
-
return (0, jsx_runtime_1.jsx)(ink_1.Text,
|
|
39
|
+
return (0, jsx_runtime_1.jsx)(ink_1.Text, { color: color, children: label });
|
|
51
40
|
}
|
|
52
41
|
function CodegenDisplay(props) {
|
|
53
|
-
|
|
54
|
-
return ((0, jsx_runtime_1.jsxs)(ink_1.Box,
|
|
42
|
+
const data = (0, useObservable_1.useObservable)(props.codegen);
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(ink_1.Box, { width: "100%", flexDirection: "column", children: [(0, jsx_runtime_1.jsxs)(ink_1.Box, { width: "100%", paddingX: 1, borderStyle: "round", borderColor: data.status === "success" ? "green" : data.status === "error" ? "red" : "yellow", flexDirection: "row", children: [(0, jsx_runtime_1.jsx)(ink_1.Box, { width: 2, flexGrow: 0, flexShrink: 0, children: (0, jsx_runtime_1.jsx)(StatusIcon_1.StatusIcon, { icon: data.status === "success" || data.status === "ready"
|
|
55
44
|
? "tick"
|
|
56
45
|
: data.status === "generating" || data.status === "fetching" || data.status === "invalidated"
|
|
57
46
|
? "loading"
|
|
58
47
|
: data.status === "error"
|
|
59
48
|
? "error"
|
|
60
|
-
: "none" }
|
|
49
|
+
: "none" }) }), (0, jsx_runtime_1.jsx)(ink_1.Box, { children: (0, jsx_runtime_1.jsxs)(ink_1.Box, { children: [(0, jsx_runtime_1.jsxs)(ink_1.Text, { bold: true, children: [data.title, " "] }), (0, jsx_runtime_1.jsx)(StatusLabel, { status: data.status, statusLabel: "", reason: data.reason, duration: data.duration })] }) })] }), (0, jsx_runtime_1.jsxs)(ink_1.Box, { flexGrow: 1, flexDirection: "column", children: [Array.isArray(data.errors) && data.errors.length > 0 ? ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", children: data.errors.map((err, i) => ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", children: (0, jsx_runtime_1.jsx)(ink_1.Box, { children: (0, jsx_runtime_1.jsx)(ink_1.Text, { children: err }) }) }))) })) : null, data.log ? ((0, jsx_runtime_1.jsx)(ink_1.Box, { children: (0, jsx_runtime_1.jsx)(ink_1.Text, { children: data.log }) })) : null] })] }));
|
|
61
50
|
}
|
|
62
51
|
exports.CodegenDisplay = CodegenDisplay;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CodegenState } from "../../../build/state/codegen-state";
|
|
3
2
|
import { CompilerState } from "../../../build/state/compiler-state";
|
|
4
3
|
import { ServerlessState } from "../../../build/state/serverless-state";
|
|
5
4
|
import { Observable } from "../../../utils/Observable";
|
|
6
|
-
|
|
5
|
+
type Props = {
|
|
7
6
|
bundles: Observable<CompilerState>[];
|
|
8
7
|
serverless?: Observable<ServerlessState>;
|
|
9
8
|
codegen?: Observable<CodegenState>;
|
|
10
9
|
configChanged: Observable<boolean>;
|
|
11
10
|
};
|
|
12
|
-
export declare function DevCLIDisplay(props: Props): JSX.Element;
|
|
11
|
+
export declare function DevCLIDisplay(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -1,42 +1,31 @@
|
|
|
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
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.DevCLIDisplay = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ink_1 = require("ink");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const useObservable_1 = require("../../../utils/useObservable");
|
|
8
|
+
const BundleDisplay_1 = require("./BundleDisplay");
|
|
9
|
+
const CodegenDisplay_1 = require("./CodegenDisplay");
|
|
10
|
+
const Fullscreen_1 = require("./Fullscreen");
|
|
11
|
+
const ServerlessDisplay_1 = require("./ServerlessDisplay");
|
|
12
|
+
const MODE_LABELS = {
|
|
24
13
|
serverless: "Serverless Log",
|
|
25
14
|
bundles: "Build Log",
|
|
26
15
|
};
|
|
27
16
|
function DevCLIDisplay(props) {
|
|
28
|
-
|
|
29
|
-
(0, ink_1.useInput)(
|
|
17
|
+
const [mode, setMode] = (0, react_1.useState)("bundles");
|
|
18
|
+
(0, ink_1.useInput)((ev, key) => {
|
|
30
19
|
if (ev.charAt(0) === "z") {
|
|
31
20
|
if (props.serverless) {
|
|
32
|
-
setMode(
|
|
21
|
+
setMode((mode) => (mode === "bundles" ? "serverless" : "bundles"));
|
|
33
22
|
}
|
|
34
23
|
}
|
|
35
24
|
else if (ev.charAt(0) === "c" || ev.charAt(0) === "q" || key.escape) {
|
|
36
25
|
process.exit(0);
|
|
37
26
|
}
|
|
38
27
|
});
|
|
39
|
-
|
|
40
|
-
return ((0, jsx_runtime_1.jsx)(Fullscreen_1.Fullscreen, { children: (0, jsx_runtime_1.jsxs)(ink_1.Box,
|
|
28
|
+
const configChanged = (0, useObservable_1.useObservable)(props.configChanged);
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(Fullscreen_1.Fullscreen, { children: (0, jsx_runtime_1.jsxs)(ink_1.Box, { width: "100%", height: "100%", flexDirection: "column", minHeight: "100%", children: [mode === "bundles" ? ((0, jsx_runtime_1.jsxs)(ink_1.Box, { width: "100%", flexGrow: 1, flexDirection: "column", children: [props.bundles.map((bundle, i) => ((0, jsx_runtime_1.jsx)(BundleDisplay_1.BundleDisplay, { bundle: bundle }, i))), props.codegen && (0, jsx_runtime_1.jsx)(CodegenDisplay_1.CodegenDisplay, { codegen: props.codegen }), props.serverless && (0, jsx_runtime_1.jsx)(ServerlessDisplay_1.ServerlessDisplay, { serverless: props.serverless })] })) : mode === "serverless" ? ((0, jsx_runtime_1.jsx)(ink_1.Box, { width: "100%", flexGrow: 1, flexDirection: "column", children: (0, jsx_runtime_1.jsx)(ServerlessDisplay_1.ServerlessLog, { serverless: props.serverless }) })) : null, configChanged && ((0, jsx_runtime_1.jsx)(ink_1.Box, { paddingX: 1, borderColor: "yellow", borderStyle: "round", children: (0, jsx_runtime_1.jsxs)(ink_1.Text, { color: "yellow", children: ["\uD83D\uDEA8 Change detected in ", (0, jsx_runtime_1.jsx)(ink_1.Text, { color: "yellowBright", children: "ed.config.json" }), " \u2014 Please restart", " ", (0, jsx_runtime_1.jsx)(ink_1.Text, { color: "yellowBright", children: "yarn dev" })] }) })), (0, jsx_runtime_1.jsxs)(ink_1.Box, { paddingX: 1, borderColor: "cyan", borderStyle: "round", flexDirection: "row", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(ink_1.Box, { children: (0, jsx_runtime_1.jsx)(ink_1.Text, { bold: true, color: "cyanBright", children: MODE_LABELS[mode] }) }), (0, jsx_runtime_1.jsxs)(ink_1.Box, { children: [props.serverless && ((0, jsx_runtime_1.jsxs)(ink_1.Text, { children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { bold: true, color: "white", children: "z" }), ": Toggle Serverless Log", " "] })), (0, jsx_runtime_1.jsxs)(ink_1.Text, { children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { bold: true, color: "white", children: "q" }), ": Quit"] })] })] })] }) }));
|
|
41
30
|
}
|
|
42
31
|
exports.DevCLIDisplay = DevCLIDisplay;
|
|
@@ -1,26 +1,15 @@
|
|
|
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
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.Fullscreen = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ink_1 = require("ink");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const Fullscreen = (props) => {
|
|
8
|
+
const [size, setSize] = (0, react_1.useState)({
|
|
20
9
|
columns: process.stdout.columns,
|
|
21
10
|
rows: process.stdout.rows,
|
|
22
|
-
})
|
|
23
|
-
(0, react_1.useEffect)(
|
|
11
|
+
});
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
24
13
|
function onResize() {
|
|
25
14
|
setSize({
|
|
26
15
|
columns: process.stdout.columns,
|
|
@@ -29,11 +18,11 @@ var Fullscreen = function (props) {
|
|
|
29
18
|
}
|
|
30
19
|
process.stdout.on("resize", onResize);
|
|
31
20
|
// process.stdout.write("\x1b[?1049h")
|
|
32
|
-
return
|
|
21
|
+
return () => {
|
|
33
22
|
process.stdout.off("resize", onResize);
|
|
34
23
|
// process.stdout.write("\x1b[?1049l")
|
|
35
24
|
};
|
|
36
25
|
}, []);
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)(ink_1.Box,
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(ink_1.Box, { width: size.columns, minHeight: size.rows, children: props.children }));
|
|
38
27
|
};
|
|
39
28
|
exports.Fullscreen = Fullscreen;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ServerlessState } from "../../../build/state/serverless-state";
|
|
3
2
|
import { Observable } from "../../../utils/Observable";
|
|
4
3
|
export declare function ServerlessDisplay(props: {
|
|
5
4
|
serverless: Observable<ServerlessState>;
|
|
6
|
-
}): JSX.Element;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export declare function ServerlessLog(props: {
|
|
8
7
|
serverless: Observable<ServerlessState>;
|
|
9
|
-
}): JSX.Element;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|