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