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
|
@@ -4,39 +4,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createFieldManifestGenerator = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var manifest_1 = require("./manifest");
|
|
8
|
+
var path_1 = __importDefault(require("path"));
|
|
9
|
+
var change_case_1 = require("change-case");
|
|
10
10
|
function createFieldManifestGenerator(opts) {
|
|
11
11
|
return (0, manifest_1.createManifestGenerator)({
|
|
12
12
|
glob: path_1.default.join(opts.baseDirectory, "/backend/fields/**.tsx"),
|
|
13
13
|
onGenerate: opts.onGenerate,
|
|
14
14
|
watch: opts.watch,
|
|
15
|
-
generate(fileNames) {
|
|
15
|
+
generate: function (fileNames) {
|
|
16
16
|
if (opts.isAdmin) {
|
|
17
|
-
|
|
18
|
-
.filter((file)
|
|
19
|
-
.map((file)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return { relative, name, module, componentName };
|
|
17
|
+
var files = fileNames
|
|
18
|
+
.filter(function (file) { return !file.includes("/_app"); })
|
|
19
|
+
.map(function (file) {
|
|
20
|
+
var relative = path_1.default.relative(opts.baseDirectory, file);
|
|
21
|
+
var name = path_1.default.basename(file).replace(/\.(jsx|tsx|ts|js)$/i, "");
|
|
22
|
+
var module = JSON.stringify("./" + relative);
|
|
23
|
+
var componentName = "FieldType" + (0, change_case_1.pascalCase)(name);
|
|
24
|
+
return { relative: relative, name: name, module: module, componentName: componentName };
|
|
25
25
|
});
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export default {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return
|
|
26
|
+
return "\n ".concat(files.map(function (_a) {
|
|
27
|
+
var componentName = _a.componentName, module = _a.module;
|
|
28
|
+
return "import ".concat(componentName, " from ").concat(module);
|
|
29
|
+
}).join("\n"), "\n\n export default {\n ").concat(files
|
|
30
|
+
.map(function (_a) {
|
|
31
|
+
var relative = _a.relative, componentName = _a.componentName, module = _a.module, name = _a.name;
|
|
32
|
+
return "\"".concat(name, "\": ").concat(componentName);
|
|
33
33
|
})
|
|
34
|
-
.join(",\n")}
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
34
|
+
.join(",\n"), "\n }\n ");
|
|
37
35
|
}
|
|
38
36
|
else {
|
|
39
|
-
return
|
|
37
|
+
return "export default {}";
|
|
40
38
|
}
|
|
41
39
|
},
|
|
42
40
|
});
|
|
@@ -4,52 +4,45 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createViewManifestGenerator = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var manifest_1 = require("./manifest");
|
|
8
|
+
var path_1 = __importDefault(require("path"));
|
|
9
|
+
var change_case_1 = require("change-case");
|
|
10
|
+
var JSX = /\.(jsx|tsx|ts|js)$/i;
|
|
11
11
|
function createViewManifestGenerator(opts) {
|
|
12
12
|
return (0, manifest_1.createManifestGenerator)({
|
|
13
13
|
glob: path_1.default.join(opts.baseDirectory, "/views/**/*.tsx"),
|
|
14
14
|
onGenerate: opts.onGenerate,
|
|
15
15
|
watch: opts.watch,
|
|
16
|
-
generate(fileNames) {
|
|
17
|
-
|
|
18
|
-
.filter((file)
|
|
19
|
-
.map((file)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return { relative, name, module, componentName };
|
|
16
|
+
generate: function (fileNames) {
|
|
17
|
+
var files = fileNames
|
|
18
|
+
.filter(function (file) { return !file.includes("/_app"); })
|
|
19
|
+
.map(function (file) {
|
|
20
|
+
var relative = path_1.default.relative(opts.baseDirectory, file).replace(JSX, "");
|
|
21
|
+
var name = path_1.default.basename(file).replace(JSX, "");
|
|
22
|
+
var module = JSON.stringify("./" + relative);
|
|
23
|
+
var componentName = "View" + (0, change_case_1.pascalCase)(name);
|
|
24
|
+
return { relative: relative, name: name, module: module, componentName: componentName };
|
|
25
25
|
});
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export { App }
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
${files
|
|
39
|
-
.map(({ relative, componentName, module }) => {
|
|
26
|
+
var useDynamicViews = false; //opts.isServerless
|
|
27
|
+
return "\n ".concat(useDynamicViews && "import { dynamic } from 'eddev/dynamic';", "\n import App from ").concat(JSON.stringify("./views/_app"), "\n\n ").concat(!useDynamicViews
|
|
28
|
+
? files.map(function (_a) {
|
|
29
|
+
var componentName = _a.componentName, module = _a.module;
|
|
30
|
+
return "import ".concat(componentName, " from ").concat(module);
|
|
31
|
+
}).join("\n")
|
|
32
|
+
: "", "\n\n export { App }\n\n export default {\n ").concat(files
|
|
33
|
+
.map(function (_a) {
|
|
34
|
+
var relative = _a.relative, componentName = _a.componentName, module = _a.module;
|
|
40
35
|
if (useDynamicViews) {
|
|
41
36
|
// In serverless mode, export @loadable components. Script tags will be
|
|
42
37
|
// auto-included in output HTML
|
|
43
|
-
return
|
|
38
|
+
return "\"".concat(relative, "\": dynamic(() => import(").concat(module, "))");
|
|
44
39
|
}
|
|
45
40
|
else {
|
|
46
41
|
// On non-serverless, the templates are bundled straight into the main app.
|
|
47
|
-
return
|
|
42
|
+
return "\"".concat(relative, "\": ").concat(componentName);
|
|
48
43
|
}
|
|
49
44
|
})
|
|
50
|
-
.join(",\n")}
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
45
|
+
.join(",\n"), "\n }\n ");
|
|
53
46
|
},
|
|
54
47
|
});
|
|
55
48
|
}
|
|
@@ -4,39 +4,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createWidgetManifestGenerator = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var manifest_1 = require("./manifest");
|
|
8
|
+
var path_1 = __importDefault(require("path"));
|
|
9
|
+
var change_case_1 = require("change-case");
|
|
10
10
|
function createWidgetManifestGenerator(opts) {
|
|
11
11
|
return (0, manifest_1.createManifestGenerator)({
|
|
12
12
|
glob: path_1.default.join(opts.baseDirectory, "/backend/widgets/*.tsx"),
|
|
13
13
|
onGenerate: opts.onGenerate,
|
|
14
14
|
watch: opts.watch,
|
|
15
|
-
generate(fileNames) {
|
|
15
|
+
generate: function (fileNames) {
|
|
16
16
|
if (opts.isAdmin) {
|
|
17
|
-
|
|
18
|
-
.filter((file)
|
|
19
|
-
.map((file)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return { relative, name, module, componentName };
|
|
17
|
+
var files = fileNames
|
|
18
|
+
.filter(function (file) { return !file.includes("/_app"); })
|
|
19
|
+
.map(function (file) {
|
|
20
|
+
var relative = path_1.default.relative(opts.baseDirectory, file);
|
|
21
|
+
var name = path_1.default.basename(file).replace(/\.(jsx|tsx|ts|js)$/i, "");
|
|
22
|
+
var module = JSON.stringify("./" + relative);
|
|
23
|
+
var componentName = "Widget" + (0, change_case_1.pascalCase)(name);
|
|
24
|
+
return { relative: relative, name: name, module: module, componentName: componentName };
|
|
25
25
|
});
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export default [
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
return "\n ".concat(files.map(function (_a) {
|
|
27
|
+
var componentName = _a.componentName, module = _a.module;
|
|
28
|
+
return "import ".concat(componentName, " from ").concat(module);
|
|
29
|
+
}).join("\n"), "\n\n export default [\n ").concat(files
|
|
30
|
+
.map(function (_a) {
|
|
31
|
+
var relative = _a.relative, componentName = _a.componentName, module = _a.module, name = _a.name;
|
|
32
32
|
return componentName;
|
|
33
33
|
})
|
|
34
|
-
.join(",\n")
|
|
35
|
-
]
|
|
36
|
-
`;
|
|
34
|
+
.join(",\n"), "\n ]\n ");
|
|
37
35
|
}
|
|
38
36
|
else {
|
|
39
|
-
return
|
|
37
|
+
return "export default {}";
|
|
40
38
|
}
|
|
41
39
|
},
|
|
42
40
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
type Options = {
|
|
1
|
+
declare type Options = {
|
|
2
2
|
glob: string;
|
|
3
3
|
watch: boolean;
|
|
4
4
|
generate: (files: string[]) => Promise<string> | string;
|
|
5
5
|
onGenerate: (value: string) => void;
|
|
6
6
|
};
|
|
7
|
-
type ManifestGenerator = {
|
|
7
|
+
declare type ManifestGenerator = {
|
|
8
8
|
close(): void;
|
|
9
9
|
};
|
|
10
10
|
export declare function createManifestGenerator(opts: Options): Promise<ManifestGenerator>;
|
|
@@ -1,36 +1,100 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.createManifestGenerator = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
close
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
var file_tree_1 = require("../file-tree");
|
|
41
|
+
function createManifestGenerator(opts) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
43
|
+
var resolvedFirst;
|
|
44
|
+
var _this = this;
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
resolvedFirst = false;
|
|
47
|
+
return [2 /*return*/, new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
|
|
48
|
+
var close, self, debouncer, files, update;
|
|
49
|
+
var _this = this;
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
switch (_a.label) {
|
|
52
|
+
case 0:
|
|
53
|
+
self = {
|
|
54
|
+
close: function () {
|
|
55
|
+
if (close)
|
|
56
|
+
close();
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
debouncer = 0;
|
|
60
|
+
files = [];
|
|
61
|
+
update = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
62
|
+
var value;
|
|
63
|
+
return __generator(this, function (_a) {
|
|
64
|
+
switch (_a.label) {
|
|
65
|
+
case 0: return [4 /*yield*/, opts.generate(files)];
|
|
66
|
+
case 1:
|
|
67
|
+
value = _a.sent();
|
|
68
|
+
clearTimeout(debouncer);
|
|
69
|
+
debouncer = setTimeout(function () {
|
|
70
|
+
opts.onGenerate(value);
|
|
71
|
+
}, 200);
|
|
72
|
+
if (!resolvedFirst) {
|
|
73
|
+
resolvedFirst = true;
|
|
74
|
+
resolve(self);
|
|
75
|
+
}
|
|
76
|
+
return [2 /*return*/];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}); };
|
|
80
|
+
if (!opts.watch) return [3 /*break*/, 2];
|
|
81
|
+
return [4 /*yield*/, (0, file_tree_1.watchFileTree)(opts.glob, function (updatedFiles) {
|
|
82
|
+
files = updatedFiles;
|
|
83
|
+
update();
|
|
84
|
+
})];
|
|
85
|
+
case 1:
|
|
86
|
+
close = _a.sent();
|
|
87
|
+
return [3 /*break*/, 4];
|
|
88
|
+
case 2: return [4 /*yield*/, (0, file_tree_1.getFileTree)(opts.glob)];
|
|
89
|
+
case 3:
|
|
90
|
+
files = _a.sent();
|
|
91
|
+
update();
|
|
92
|
+
_a.label = 4;
|
|
93
|
+
case 4: return [2 /*return*/];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}); })];
|
|
97
|
+
});
|
|
34
98
|
});
|
|
35
99
|
}
|
|
36
100
|
exports.createManifestGenerator = createManifestGenerator;
|
package/build/reporter.d.ts
CHANGED
package/build/reporter.js
CHANGED
|
@@ -4,15 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ReporterPlugin = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
var ReporterPlugin = /** @class */ (function () {
|
|
9
|
+
function ReporterPlugin(opts) {
|
|
10
10
|
this.title = opts.title;
|
|
11
11
|
}
|
|
12
|
-
apply(compiler) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
ReporterPlugin.prototype.apply = function (compiler) {
|
|
13
|
+
var _this = this;
|
|
14
|
+
var plugin = { name: "EDDevReporterPlugin" };
|
|
15
|
+
var log = function (type, message, errors) {
|
|
16
|
+
var label = " ".concat(type.toUpperCase(), " (").concat(_this.title, ") ");
|
|
16
17
|
if (type === "done") {
|
|
17
18
|
label = chalk_1.default.bgGreenBright.black(label);
|
|
18
19
|
}
|
|
@@ -30,10 +31,10 @@ class ReporterPlugin {
|
|
|
30
31
|
console.log(errors);
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
|
-
compiler.hooks.done.tap(plugin, (stats)
|
|
34
|
+
compiler.hooks.done.tap(plugin, function (stats) {
|
|
34
35
|
// console.log(this.title + ": Done")
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
var hasErrors = stats.hasErrors();
|
|
37
|
+
var hasWarnings = stats.hasWarnings();
|
|
37
38
|
// const status: StatusItem = {
|
|
38
39
|
// statusType: "success",
|
|
39
40
|
// message: "",
|
|
@@ -44,42 +45,44 @@ class ReporterPlugin {
|
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
if (hasErrors) {
|
|
47
|
-
|
|
48
|
-
.map((err)
|
|
48
|
+
var errors = extractErrorsFromStats(stats, "errors")
|
|
49
|
+
.map(function (err) { return err.message; })
|
|
49
50
|
.join("\n");
|
|
50
51
|
log("error", "Error compiling", errors);
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
54
|
if (hasWarnings) {
|
|
54
|
-
|
|
55
|
-
.map((err)
|
|
55
|
+
var warnings = extractErrorsFromStats(stats, "warnings")
|
|
56
|
+
.map(function (err) { return err.message; })
|
|
56
57
|
.join("\n");
|
|
57
58
|
log("warn", "Warnings encountered", warnings);
|
|
58
59
|
// log.warn("Warnings encountered %s", warnings)
|
|
59
60
|
// this.displayErrors(extractErrorsFromStats(stats, "warnings"), "warning")
|
|
60
61
|
}
|
|
61
62
|
});
|
|
62
|
-
compiler.hooks.invalid.tap(plugin, ()
|
|
63
|
+
compiler.hooks.invalid.tap(plugin, function () {
|
|
63
64
|
log("wait", "Building...");
|
|
64
65
|
});
|
|
65
|
-
}
|
|
66
|
-
displaySuccess(stats) {
|
|
66
|
+
};
|
|
67
|
+
ReporterPlugin.prototype.displaySuccess = function (stats) {
|
|
67
68
|
console.log("SUCCESS", this.title);
|
|
68
|
-
}
|
|
69
|
-
displayErrors(errors, type) {
|
|
69
|
+
};
|
|
70
|
+
ReporterPlugin.prototype.displayErrors = function (errors, type) {
|
|
70
71
|
console.log(type, this.title, errors);
|
|
71
|
-
}
|
|
72
|
-
|
|
72
|
+
};
|
|
73
|
+
return ReporterPlugin;
|
|
74
|
+
}());
|
|
73
75
|
exports.ReporterPlugin = ReporterPlugin;
|
|
74
76
|
function extractErrorsFromStats(stats, type) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
var findErrorsRecursive = function (compilation) {
|
|
78
|
+
var errors = compilation[type];
|
|
77
79
|
if (errors.length === 0 && compilation.children) {
|
|
78
|
-
for (
|
|
79
|
-
|
|
80
|
+
for (var _i = 0, _a = compilation.children; _i < _a.length; _i++) {
|
|
81
|
+
var child = _a[_i];
|
|
82
|
+
errors.push.apply(errors, findErrorsRecursive(child));
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
return uniqueBy(errors, (error)
|
|
85
|
+
return uniqueBy(errors, function (error) { return error.message; });
|
|
83
86
|
};
|
|
84
87
|
return findErrorsRecursive(stats.compilation);
|
|
85
88
|
}
|
|
@@ -91,9 +94,9 @@ function extractErrorsFromStats(stats, type) {
|
|
|
91
94
|
* ) = [{ id: 1 }, { id: 2 }]
|
|
92
95
|
*/
|
|
93
96
|
function uniqueBy(arr, fun) {
|
|
94
|
-
|
|
95
|
-
return arr.filter((el)
|
|
96
|
-
|
|
97
|
+
var seen = {};
|
|
98
|
+
return arr.filter(function (el) {
|
|
99
|
+
var e = fun(el);
|
|
97
100
|
return !(e in seen) && (seen[e] = 1);
|
|
98
101
|
});
|
|
99
102
|
}
|