oc 0.49.13 → 0.49.14
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/.github/workflows/node.js.yml +1 -1
- package/.nvmrc +1 -1
- package/CHANGELOG.md +11 -1
- package/dist/cli/commands.d.ts +163 -163
- package/dist/cli/commands.js +162 -162
- package/dist/cli/domain/clean.d.ts +2 -2
- package/dist/cli/domain/clean.js +24 -24
- package/dist/cli/domain/get-components-by-dir.d.ts +1 -1
- package/dist/cli/domain/get-components-by-dir.js +41 -41
- package/dist/cli/domain/get-mocked-plugins.d.ts +10 -10
- package/dist/cli/domain/get-mocked-plugins.js +89 -89
- package/dist/cli/domain/handle-dependencies/ensure-compiler-is-declared-as-devDependency.d.ts +6 -6
- package/dist/cli/domain/handle-dependencies/ensure-compiler-is-declared-as-devDependency.js +16 -16
- package/dist/cli/domain/handle-dependencies/get-compiler.d.ts +10 -10
- package/dist/cli/domain/handle-dependencies/get-compiler.js +28 -28
- package/dist/cli/domain/handle-dependencies/get-missing-dependencies.d.ts +1 -1
- package/dist/cli/domain/handle-dependencies/get-missing-dependencies.js +18 -18
- package/dist/cli/domain/handle-dependencies/index.d.ts +10 -10
- package/dist/cli/domain/handle-dependencies/index.js +70 -70
- package/dist/cli/domain/handle-dependencies/install-compiler.d.ts +8 -8
- package/dist/cli/domain/handle-dependencies/install-compiler.js +54 -54
- package/dist/cli/domain/handle-dependencies/install-missing-dependencies.d.ts +5 -5
- package/dist/cli/domain/handle-dependencies/install-missing-dependencies.js +59 -59
- package/dist/cli/domain/handle-dependencies/link-missing-dependencies.d.ts +6 -6
- package/dist/cli/domain/handle-dependencies/link-missing-dependencies.js +32 -32
- package/dist/cli/domain/handle-dependencies/require-template.d.ts +17 -17
- package/dist/cli/domain/handle-dependencies/require-template.js +34 -34
- package/dist/cli/domain/init-template/index.d.ts +10 -10
- package/dist/cli/domain/init-template/index.js +40 -40
- package/dist/cli/domain/init-template/install-template.d.ts +11 -11
- package/dist/cli/domain/init-template/install-template.js +54 -54
- package/dist/cli/domain/init-template/scaffold.d.ts +11 -11
- package/dist/cli/domain/init-template/scaffold.js +30 -30
- package/dist/cli/domain/local.d.ts +21 -2
- package/dist/cli/domain/local.js +82 -82
- package/dist/cli/domain/mock.d.ts +5 -5
- package/dist/cli/domain/mock.js +33 -33
- package/dist/cli/domain/package-components.d.ts +9 -9
- package/dist/cli/domain/package-components.js +67 -67
- package/dist/cli/domain/registry.d.ts +20 -6
- package/dist/cli/domain/registry.js +139 -139
- package/dist/cli/domain/url-parser.d.ts +14 -14
- package/dist/cli/domain/url-parser.js +31 -31
- package/dist/cli/domain/watch.d.ts +1 -1
- package/dist/cli/domain/watch.js +29 -29
- package/dist/cli/facade/clean.d.ts +16 -16
- package/dist/cli/facade/clean.js +58 -58
- package/dist/cli/facade/dev.d.ts +114 -114
- package/dist/cli/facade/dev.js +176 -176
- package/dist/cli/facade/init.d.ts +18 -18
- package/dist/cli/facade/init.js +39 -39
- package/dist/cli/facade/mock.d.ts +18 -18
- package/dist/cli/facade/mock.js +12 -12
- package/dist/cli/facade/package.d.ts +19 -18
- package/dist/cli/facade/package.js +49 -49
- package/dist/cli/facade/preview.d.ts +14 -14
- package/dist/cli/facade/preview.js +20 -20
- package/dist/cli/facade/publish.d.ts +24 -23
- package/dist/cli/facade/publish.js +145 -145
- package/dist/cli/facade/registry-add.d.ts +14 -14
- package/dist/cli/facade/registry-add.js +18 -18
- package/dist/cli/facade/registry-ls.d.ts +10 -10
- package/dist/cli/facade/registry-ls.js +27 -27
- package/dist/cli/facade/registry-remove.d.ts +14 -14
- package/dist/cli/facade/registry-remove.js +18 -18
- package/dist/cli/facade/registry.d.ts +5 -5
- package/dist/cli/facade/registry.js +9 -9
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +91 -91
- package/dist/cli/logger.d.ts +8 -8
- package/dist/cli/logger.js +19 -19
- package/dist/cli/programmatic-api.d.ts +84 -84
- package/dist/cli/programmatic-api.js +66 -66
- package/dist/cli/validate-command.d.ts +2 -2
- package/dist/cli/validate-command.js +18 -18
- package/dist/components/oc-client/_package/package.json +1 -1
- package/dist/components/oc-client/_package/src/oc-client.min.js +2 -2
- package/dist/components/oc-client/_package/src/oc-client.min.map +1 -1
- package/dist/components/oc-client/package.json +1 -1
- package/dist/components/oc-client/src/oc-client.min.js +2 -2
- package/dist/components/oc-client/src/oc-client.min.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -12
- package/dist/oc-cli.d.ts +2 -2
- package/dist/oc-cli.js +3 -3
- package/dist/registry/app-start.d.ts +3 -2
- package/dist/registry/app-start.js +44 -44
- package/dist/registry/domain/authentication.d.ts +7 -7
- package/dist/registry/domain/authentication.js +53 -53
- package/dist/registry/domain/components-cache/components-list.d.ts +8 -8
- package/dist/registry/domain/components-cache/components-list.js +50 -50
- package/dist/registry/domain/components-cache/index.d.ts +7 -7
- package/dist/registry/domain/components-cache/index.js +76 -76
- package/dist/registry/domain/components-details.d.ts +6 -6
- package/dist/registry/domain/components-details.js +64 -64
- package/dist/registry/domain/events-handler.d.ts +40 -40
- package/dist/registry/domain/events-handler.js +37 -37
- package/dist/registry/domain/extract-package.d.ts +8 -8
- package/dist/registry/domain/extract-package.js +30 -26
- package/dist/registry/domain/get-package-json-from-temp-dir.d.ts +2 -2
- package/dist/registry/domain/get-package-json-from-temp-dir.js +11 -11
- package/dist/registry/domain/nested-renderer.d.ts +14 -14
- package/dist/registry/domain/nested-renderer.js +59 -59
- package/dist/registry/domain/options-sanitiser.d.ts +6 -6
- package/dist/registry/domain/options-sanitiser.js +109 -106
- package/dist/registry/domain/plugins-initialiser.d.ts +3 -3
- package/dist/registry/domain/plugins-initialiser.js +95 -95
- package/dist/registry/domain/register-templates.d.ts +5 -5
- package/dist/registry/domain/register-templates.js +37 -30
- package/dist/registry/domain/repository.d.ts +22 -2
- package/dist/registry/domain/repository.js +237 -237
- package/dist/registry/domain/require-wrapper.d.ts +2 -2
- package/dist/registry/domain/require-wrapper.js +33 -33
- package/dist/registry/domain/sanitiser.d.ts +2 -2
- package/dist/registry/domain/sanitiser.js +52 -52
- package/dist/registry/domain/storage-adapter.d.ts +10 -10
- package/dist/registry/domain/storage-adapter.js +55 -55
- package/dist/registry/domain/url-builder.d.ts +10 -10
- package/dist/registry/domain/url-builder.js +60 -60
- package/dist/registry/domain/validators/component-parameters.d.ts +11 -11
- package/dist/registry/domain/validators/component-parameters.js +79 -79
- package/dist/registry/domain/validators/index.d.ts +16 -16
- package/dist/registry/domain/validators/index.js +29 -29
- package/dist/registry/domain/validators/node-version.d.ts +15 -15
- package/dist/registry/domain/validators/node-version.js +40 -40
- package/dist/registry/domain/validators/oc-cli-version.d.ts +15 -15
- package/dist/registry/domain/validators/oc-cli-version.js +34 -34
- package/dist/registry/domain/validators/package-json-validator.d.ts +13 -13
- package/dist/registry/domain/validators/package-json-validator.js +23 -23
- package/dist/registry/domain/validators/plugins-requirements.d.ts +9 -9
- package/dist/registry/domain/validators/plugins-requirements.js +22 -22
- package/dist/registry/domain/validators/registry-configuration.d.ts +9 -9
- package/dist/registry/domain/validators/registry-configuration.js +113 -113
- package/dist/registry/domain/validators/uploaded-package.d.ts +14 -14
- package/dist/registry/domain/validators/uploaded-package.js +25 -25
- package/dist/registry/domain/version-handler.d.ts +2 -2
- package/dist/registry/domain/version-handler.js +22 -22
- package/dist/registry/index.d.ts +48 -48
- package/dist/registry/index.js +107 -107
- package/dist/registry/middleware/base-url-handler.d.ts +2 -2
- package/dist/registry/middleware/base-url-handler.js +12 -12
- package/dist/registry/middleware/cors.d.ts +2 -2
- package/dist/registry/middleware/cors.js +11 -11
- package/dist/registry/middleware/discovery-handler.d.ts +2 -2
- package/dist/registry/middleware/discovery-handler.js +15 -15
- package/dist/registry/middleware/file-uploads.d.ts +2 -2
- package/dist/registry/middleware/file-uploads.js +23 -23
- package/dist/registry/middleware/index.d.ts +3 -3
- package/dist/registry/middleware/index.js +48 -48
- package/dist/registry/middleware/request-handler.d.ts +2 -2
- package/dist/registry/middleware/request-handler.js +30 -30
- package/dist/registry/router.d.ts +4 -3
- package/dist/registry/router.js +56 -56
- package/dist/registry/routes/component-info.d.ts +4 -3
- package/dist/registry/routes/component-info.js +90 -90
- package/dist/registry/routes/component-preview.d.ts +4 -3
- package/dist/registry/routes/component-preview.js +68 -68
- package/dist/registry/routes/component.d.ts +4 -3
- package/dist/registry/routes/component.js +43 -43
- package/dist/registry/routes/components.d.ts +4 -3
- package/dist/registry/routes/components.js +78 -78
- package/dist/registry/routes/dependencies.d.ts +3 -3
- package/dist/registry/routes/dependencies.js +28 -28
- package/dist/registry/routes/helpers/apply-default-values.d.ts +2 -2
- package/dist/registry/routes/helpers/apply-default-values.js +13 -13
- package/dist/registry/routes/helpers/get-available-dependencies.d.ts +8 -8
- package/dist/registry/routes/helpers/get-available-dependencies.js +24 -24
- package/dist/registry/routes/helpers/get-component-fallback.d.ts +17 -17
- package/dist/registry/routes/helpers/get-component-fallback.js +91 -91
- package/dist/registry/routes/helpers/get-component-retrieving-info.d.ts +20 -20
- package/dist/registry/routes/helpers/get-component-retrieving-info.js +24 -24
- package/dist/registry/routes/helpers/get-component.d.ts +34 -33
- package/dist/registry/routes/helpers/get-component.js +406 -406
- package/dist/registry/routes/helpers/get-components-history.d.ts +8 -8
- package/dist/registry/routes/helpers/get-components-history.js +28 -28
- package/dist/registry/routes/helpers/is-url-discoverable.d.ts +3 -3
- package/dist/registry/routes/helpers/is-url-discoverable.js +22 -22
- package/dist/registry/routes/index.d.ts +3 -3
- package/dist/registry/routes/index.js +93 -93
- package/dist/registry/routes/plugins.d.ts +3 -3
- package/dist/registry/routes/plugins.js +17 -17
- package/dist/registry/routes/publish.d.ts +3 -3
- package/dist/registry/routes/publish.js +97 -97
- package/dist/registry/routes/static-redirector.d.ts +3 -3
- package/dist/registry/routes/static-redirector.js +63 -63
- package/dist/registry/views/index.d.ts +2 -2
- package/dist/registry/views/index.js +39 -39
- package/dist/registry/views/info.d.ts +16 -16
- package/dist/registry/views/info.js +39 -39
- package/dist/registry/views/partials/component-author.d.ts +8 -8
- package/dist/registry/views/partials/component-author.js +20 -20
- package/dist/registry/views/partials/component-parameters.d.ts +5 -5
- package/dist/registry/views/partials/component-parameters.js +24 -24
- package/dist/registry/views/partials/component-state.d.ts +5 -5
- package/dist/registry/views/partials/component-state.js +6 -6
- package/dist/registry/views/partials/component-versions.d.ts +5 -5
- package/dist/registry/views/partials/component-versions.js +9 -9
- package/dist/registry/views/partials/components-dependencies.d.ts +2 -2
- package/dist/registry/views/partials/components-dependencies.js +12 -12
- package/dist/registry/views/partials/components-history.d.ts +2 -2
- package/dist/registry/views/partials/components-history.js +10 -10
- package/dist/registry/views/partials/components-list.d.ts +2 -2
- package/dist/registry/views/partials/components-list.js +26 -26
- package/dist/registry/views/partials/components-plugins.d.ts +2 -2
- package/dist/registry/views/partials/components-plugins.js +8 -8
- package/dist/registry/views/partials/components-templates.d.ts +2 -2
- package/dist/registry/views/partials/components-templates.js +14 -14
- package/dist/registry/views/partials/layout.d.ts +8 -8
- package/dist/registry/views/partials/layout.js +11 -11
- package/dist/registry/views/partials/property.d.ts +2 -2
- package/dist/registry/views/partials/property.js +11 -11
- package/dist/registry/views/partials/selected-checkbox.d.ts +4 -4
- package/dist/registry/views/partials/selected-checkbox.js +7 -7
- package/dist/registry/views/preview.d.ts +8 -8
- package/dist/registry/views/preview.js +9 -9
- package/dist/registry/views/static/index.d.ts +2 -2
- package/dist/registry/views/static/index.js +3 -3
- package/dist/registry/views/static/info.d.ts +2 -2
- package/dist/registry/views/static/info.js +3 -3
- package/dist/registry/views/static/style.d.ts +2 -2
- package/dist/registry/views/static/style.js +3 -3
- package/dist/resources/index.d.ts +134 -134
- package/dist/resources/index.js +145 -145
- package/dist/resources/settings.d.ts +17 -17
- package/dist/resources/settings.js +18 -18
- package/dist/types.d.ts +229 -287
- package/dist/types.js +2 -2
- package/dist/utils/clean-require.d.ts +16 -16
- package/dist/utils/clean-require.js +18 -18
- package/dist/utils/date-stringify.d.ts +1 -1
- package/dist/utils/date-stringify.js +22 -22
- package/dist/utils/error-to-string.d.ts +1 -1
- package/dist/utils/error-to-string.js +15 -15
- package/dist/utils/is-template-legacy.d.ts +3 -3
- package/dist/utils/is-template-legacy.js +6 -6
- package/dist/utils/is-template-valid.d.ts +4 -4
- package/dist/utils/is-template-valid.js +12 -12
- package/dist/utils/module-exists.d.ts +1 -1
- package/dist/utils/module-exists.js +15 -15
- package/dist/utils/npm-utils.d.ts +20 -20
- package/dist/utils/npm-utils.js +74 -74
- package/dist/utils/put.d.ts +2 -2
- package/dist/utils/put.js +29 -29
- package/dist/utils/strip-version.d.ts +1 -1
- package/dist/utils/strip-version.js +11 -11
- package/logintervals.md +1 -1
- package/package.json +7 -7
- package/src/cli/domain/local.ts +12 -5
- package/src/cli/domain/package-components.ts +1 -1
- package/src/cli/domain/registry.ts +10 -8
- package/src/cli/facade/clean.ts +1 -1
- package/src/cli/facade/dev.ts +1 -1
- package/src/cli/facade/init.ts +1 -1
- package/src/cli/facade/mock.ts +1 -1
- package/src/cli/facade/package.ts +2 -1
- package/src/cli/facade/preview.ts +1 -1
- package/src/cli/facade/publish.ts +3 -1
- package/src/cli/facade/registry-add.ts +1 -1
- package/src/cli/facade/registry-ls.ts +1 -1
- package/src/cli/facade/registry-remove.ts +1 -1
- package/src/cli/programmatic-api.ts +2 -3
- package/src/components/oc-client/_package/package.json +1 -1
- package/src/components/oc-client/_package/src/oc-client.min.js +2 -2
- package/src/components/oc-client/_package/src/oc-client.min.map +1 -1
- package/src/components/oc-client/package.json +1 -1
- package/src/components/oc-client/src/oc-client.min.js +2 -2
- package/src/components/oc-client/src/oc-client.min.map +1 -1
- package/src/oc-cli.js +0 -0
- package/src/registry/app-start.ts +2 -1
- package/src/registry/domain/components-cache/components-list.ts +2 -2
- package/src/registry/domain/extract-package.ts +7 -2
- package/src/registry/domain/options-sanitiser.ts +4 -0
- package/src/registry/domain/register-templates.ts +12 -2
- package/src/registry/domain/repository.ts +42 -17
- package/src/registry/index.ts +4 -1
- package/src/registry/router.ts +2 -1
- package/src/registry/routes/component-info.ts +2 -1
- package/src/registry/routes/component-preview.ts +2 -1
- package/src/registry/routes/component.ts +2 -1
- package/src/registry/routes/components.ts +2 -1
- package/src/registry/routes/helpers/get-component.ts +2 -1
- package/src/registry/routes/index.ts +2 -1
- package/src/registry/routes/publish.ts +3 -3
- package/src/registry/routes/static-redirector.ts +2 -2
- package/src/types.ts +2 -86
package/dist/cli/facade/dev.d.ts
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="express" />
|
|
3
|
-
/// <reference types="node/http" />
|
|
4
|
-
/// <reference types="got/dist/source/core/utils/timed-out" />
|
|
5
|
-
import { Logger } from '../logger';
|
|
6
|
-
import { Local } from '
|
|
7
|
-
declare const dev: ({ local, logger }: {
|
|
8
|
-
logger: Logger;
|
|
9
|
-
local: Local;
|
|
10
|
-
}) => {
|
|
11
|
-
(opts: {
|
|
12
|
-
prefix: string;
|
|
13
|
-
dirPath: string;
|
|
14
|
-
port?: number | undefined;
|
|
15
|
-
baseUrl: string;
|
|
16
|
-
fallbackRegistryUrl: string;
|
|
17
|
-
hotReloading?: boolean | undefined;
|
|
18
|
-
components?: string[] | undefined;
|
|
19
|
-
watch?: boolean | undefined;
|
|
20
|
-
verbose?: boolean | undefined;
|
|
21
|
-
production?: boolean | undefined;
|
|
22
|
-
}): Promise<{
|
|
23
|
-
close: (callback: (err?: string | Error | undefined) => void) => void | import("http").Server;
|
|
24
|
-
on: <T extends keyof {
|
|
25
|
-
error: {
|
|
26
|
-
code: string;
|
|
27
|
-
message: string;
|
|
28
|
-
};
|
|
29
|
-
start: unknown;
|
|
30
|
-
'cache-poll': number;
|
|
31
|
-
request: import("../../registry/domain/events-handler").RequestData;
|
|
32
|
-
'component-retrieved': {
|
|
33
|
-
headers: import("http").IncomingHttpHeaders;
|
|
34
|
-
name: string;
|
|
35
|
-
parameters: import("http").IncomingHttpHeaders;
|
|
36
|
-
requestVersion: string;
|
|
37
|
-
duration: number;
|
|
38
|
-
};
|
|
39
|
-
}>(eventName: T, listener: (data: {
|
|
40
|
-
error: {
|
|
41
|
-
code: string;
|
|
42
|
-
message: string;
|
|
43
|
-
};
|
|
44
|
-
start: unknown;
|
|
45
|
-
'cache-poll': number;
|
|
46
|
-
request: import("../../registry/domain/events-handler").RequestData;
|
|
47
|
-
'component-retrieved': {
|
|
48
|
-
headers: import("http").IncomingHttpHeaders;
|
|
49
|
-
name: string;
|
|
50
|
-
parameters: import("http").IncomingHttpHeaders;
|
|
51
|
-
requestVersion: string;
|
|
52
|
-
duration: number;
|
|
53
|
-
};
|
|
54
|
-
}[T]) => void) => void;
|
|
55
|
-
register: (plugin: Omit<import("../../types").Plugin, "callback">, callback?: ((...args: any[]) => void) | undefined) => void;
|
|
56
|
-
start: (callback: (err: unknown, data: {
|
|
57
|
-
app: import("express").Express;
|
|
58
|
-
server: import("http").Server;
|
|
59
|
-
}) => void) => Promise<void>;
|
|
60
|
-
app: import("express").Express;
|
|
61
|
-
}>;
|
|
62
|
-
(arguments__0: {
|
|
63
|
-
prefix: string;
|
|
64
|
-
dirPath: string;
|
|
65
|
-
port?: number | undefined;
|
|
66
|
-
baseUrl: string;
|
|
67
|
-
fallbackRegistryUrl: string;
|
|
68
|
-
hotReloading?: boolean | undefined;
|
|
69
|
-
components?: string[] | undefined;
|
|
70
|
-
watch?: boolean | undefined;
|
|
71
|
-
verbose?: boolean | undefined;
|
|
72
|
-
production?: boolean | undefined;
|
|
73
|
-
}, arguments__1: (error: unknown, value: {
|
|
74
|
-
close: (callback: (err?: string | Error | undefined) => void) => void | import("http").Server;
|
|
75
|
-
on: <T extends keyof {
|
|
76
|
-
error: {
|
|
77
|
-
code: string;
|
|
78
|
-
message: string;
|
|
79
|
-
};
|
|
80
|
-
start: unknown;
|
|
81
|
-
'cache-poll': number;
|
|
82
|
-
request: import("../../registry/domain/events-handler").RequestData;
|
|
83
|
-
'component-retrieved': {
|
|
84
|
-
headers: import("http").IncomingHttpHeaders;
|
|
85
|
-
name: string;
|
|
86
|
-
parameters: import("http").IncomingHttpHeaders;
|
|
87
|
-
requestVersion: string;
|
|
88
|
-
duration: number;
|
|
89
|
-
};
|
|
90
|
-
}>(eventName: T, listener: (data: {
|
|
91
|
-
error: {
|
|
92
|
-
code: string;
|
|
93
|
-
message: string;
|
|
94
|
-
};
|
|
95
|
-
start: unknown;
|
|
96
|
-
'cache-poll': number;
|
|
97
|
-
request: import("../../registry/domain/events-handler").RequestData;
|
|
98
|
-
'component-retrieved': {
|
|
99
|
-
headers: import("http").IncomingHttpHeaders;
|
|
100
|
-
name: string;
|
|
101
|
-
parameters: import("http").IncomingHttpHeaders;
|
|
102
|
-
requestVersion: string;
|
|
103
|
-
duration: number;
|
|
104
|
-
};
|
|
105
|
-
}[T]) => void) => void;
|
|
106
|
-
register: (plugin: Omit<import("../../types").Plugin, "callback">, callback?: ((...args: any[]) => void) | undefined) => void;
|
|
107
|
-
start: (callback: (err: unknown, data: {
|
|
108
|
-
app: import("express").Express;
|
|
109
|
-
server: import("http").Server;
|
|
110
|
-
}) => void) => Promise<void>;
|
|
111
|
-
app: import("express").Express;
|
|
112
|
-
}) => void): void;
|
|
113
|
-
};
|
|
114
|
-
export default dev;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="express" />
|
|
3
|
+
/// <reference types="node/http" />
|
|
4
|
+
/// <reference types="got/dist/source/core/utils/timed-out" />
|
|
5
|
+
import { Logger } from '../logger';
|
|
6
|
+
import type { Local } from '../domain/local';
|
|
7
|
+
declare const dev: ({ local, logger }: {
|
|
8
|
+
logger: Logger;
|
|
9
|
+
local: Local;
|
|
10
|
+
}) => {
|
|
11
|
+
(opts: {
|
|
12
|
+
prefix: string;
|
|
13
|
+
dirPath: string;
|
|
14
|
+
port?: number | undefined;
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
fallbackRegistryUrl: string;
|
|
17
|
+
hotReloading?: boolean | undefined;
|
|
18
|
+
components?: string[] | undefined;
|
|
19
|
+
watch?: boolean | undefined;
|
|
20
|
+
verbose?: boolean | undefined;
|
|
21
|
+
production?: boolean | undefined;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
close: (callback: (err?: string | Error | undefined) => void) => void | import("http").Server;
|
|
24
|
+
on: <T extends keyof {
|
|
25
|
+
error: {
|
|
26
|
+
code: string;
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
start: unknown;
|
|
30
|
+
'cache-poll': number;
|
|
31
|
+
request: import("../../registry/domain/events-handler").RequestData;
|
|
32
|
+
'component-retrieved': {
|
|
33
|
+
headers: import("http").IncomingHttpHeaders;
|
|
34
|
+
name: string;
|
|
35
|
+
parameters: import("http").IncomingHttpHeaders;
|
|
36
|
+
requestVersion: string;
|
|
37
|
+
duration: number;
|
|
38
|
+
};
|
|
39
|
+
}>(eventName: T, listener: (data: {
|
|
40
|
+
error: {
|
|
41
|
+
code: string;
|
|
42
|
+
message: string;
|
|
43
|
+
};
|
|
44
|
+
start: unknown;
|
|
45
|
+
'cache-poll': number;
|
|
46
|
+
request: import("../../registry/domain/events-handler").RequestData;
|
|
47
|
+
'component-retrieved': {
|
|
48
|
+
headers: import("http").IncomingHttpHeaders;
|
|
49
|
+
name: string;
|
|
50
|
+
parameters: import("http").IncomingHttpHeaders;
|
|
51
|
+
requestVersion: string;
|
|
52
|
+
duration: number;
|
|
53
|
+
};
|
|
54
|
+
}[T]) => void) => void;
|
|
55
|
+
register: (plugin: Omit<import("../../types").Plugin, "callback">, callback?: ((...args: any[]) => void) | undefined) => void;
|
|
56
|
+
start: (callback: (err: unknown, data: {
|
|
57
|
+
app: import("express").Express;
|
|
58
|
+
server: import("http").Server;
|
|
59
|
+
}) => void) => Promise<void>;
|
|
60
|
+
app: import("express").Express;
|
|
61
|
+
}>;
|
|
62
|
+
(arguments__0: {
|
|
63
|
+
prefix: string;
|
|
64
|
+
dirPath: string;
|
|
65
|
+
port?: number | undefined;
|
|
66
|
+
baseUrl: string;
|
|
67
|
+
fallbackRegistryUrl: string;
|
|
68
|
+
hotReloading?: boolean | undefined;
|
|
69
|
+
components?: string[] | undefined;
|
|
70
|
+
watch?: boolean | undefined;
|
|
71
|
+
verbose?: boolean | undefined;
|
|
72
|
+
production?: boolean | undefined;
|
|
73
|
+
}, arguments__1: (error: unknown, value: {
|
|
74
|
+
close: (callback: (err?: string | Error | undefined) => void) => void | import("http").Server;
|
|
75
|
+
on: <T extends keyof {
|
|
76
|
+
error: {
|
|
77
|
+
code: string;
|
|
78
|
+
message: string;
|
|
79
|
+
};
|
|
80
|
+
start: unknown;
|
|
81
|
+
'cache-poll': number;
|
|
82
|
+
request: import("../../registry/domain/events-handler").RequestData;
|
|
83
|
+
'component-retrieved': {
|
|
84
|
+
headers: import("http").IncomingHttpHeaders;
|
|
85
|
+
name: string;
|
|
86
|
+
parameters: import("http").IncomingHttpHeaders;
|
|
87
|
+
requestVersion: string;
|
|
88
|
+
duration: number;
|
|
89
|
+
};
|
|
90
|
+
}>(eventName: T, listener: (data: {
|
|
91
|
+
error: {
|
|
92
|
+
code: string;
|
|
93
|
+
message: string;
|
|
94
|
+
};
|
|
95
|
+
start: unknown;
|
|
96
|
+
'cache-poll': number;
|
|
97
|
+
request: import("../../registry/domain/events-handler").RequestData;
|
|
98
|
+
'component-retrieved': {
|
|
99
|
+
headers: import("http").IncomingHttpHeaders;
|
|
100
|
+
name: string;
|
|
101
|
+
parameters: import("http").IncomingHttpHeaders;
|
|
102
|
+
requestVersion: string;
|
|
103
|
+
duration: number;
|
|
104
|
+
};
|
|
105
|
+
}[T]) => void) => void;
|
|
106
|
+
register: (plugin: Omit<import("../../types").Plugin, "callback">, callback?: ((...args: any[]) => void) | undefined) => void;
|
|
107
|
+
start: (callback: (err: unknown, data: {
|
|
108
|
+
app: import("express").Express;
|
|
109
|
+
server: import("http").Server;
|
|
110
|
+
}) => void) => Promise<void>;
|
|
111
|
+
app: import("express").Express;
|
|
112
|
+
}) => void): void;
|
|
113
|
+
};
|
|
114
|
+
export default dev;
|
package/dist/cli/facade/dev.js
CHANGED
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
const safe_1 = __importDefault(require("colors/safe"));
|
|
26
|
-
const getport_1 = __importDefault(require("getport"));
|
|
27
|
-
const livereload_1 = __importDefault(require("livereload"));
|
|
28
|
-
const path_1 = __importDefault(require("path"));
|
|
29
|
-
const util_1 = require("util");
|
|
30
|
-
const universalify_1 = require("universalify");
|
|
31
|
-
const get_mocked_plugins_1 = __importDefault(require("../domain/get-mocked-plugins"));
|
|
32
|
-
const handle_dependencies_1 = __importDefault(require("../domain/handle-dependencies"));
|
|
33
|
-
const oc = __importStar(require("../../index"));
|
|
34
|
-
const index_1 = __importDefault(require("../../resources/index"));
|
|
35
|
-
const watch_1 = __importDefault(require("../domain/watch"));
|
|
36
|
-
const cliMessages = index_1.default.messages.cli;
|
|
37
|
-
const cliErrors = index_1.default.errors.cli;
|
|
38
|
-
const delay = (time = 0) => new Promise(res => setTimeout(res, time));
|
|
39
|
-
const getPort = (0, util_1.promisify)(getport_1.default);
|
|
40
|
-
const dev = ({ local, logger }) => (0, universalify_1.fromPromise)(async (opts) => {
|
|
41
|
-
const componentsDir = opts.dirPath;
|
|
42
|
-
const port = opts.port || 3000;
|
|
43
|
-
const baseUrl = opts.baseUrl || `http://localhost:${port}/`;
|
|
44
|
-
const fallbackRegistryUrl = opts.fallbackRegistryUrl;
|
|
45
|
-
const hotReloading = typeof opts.hotReloading === 'undefined' ? true : opts.hotReloading;
|
|
46
|
-
const optWatch = typeof opts.watch === 'undefined' ? true : opts.watch;
|
|
47
|
-
let packaging = false;
|
|
48
|
-
const watchForChanges = function ({ components, refreshLiveReload }, cb) {
|
|
49
|
-
(0, watch_1.default)(components, componentsDir, (err, changedFile, componentDir) => {
|
|
50
|
-
if (err) {
|
|
51
|
-
logger.err(index_1.default.errors.generic(String(err)));
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
logger.warn(cliMessages.CHANGES_DETECTED(changedFile));
|
|
55
|
-
if (!hotReloading) {
|
|
56
|
-
logger.warn(cliMessages.HOT_RELOADING_DISABLED);
|
|
57
|
-
}
|
|
58
|
-
else if (!componentDir) {
|
|
59
|
-
cb(components, refreshLiveReload);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
cb([componentDir], refreshLiveReload);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const packageComponents = async (componentsDirs) => {
|
|
68
|
-
if (!packaging) {
|
|
69
|
-
packaging = true;
|
|
70
|
-
logger.warn(cliMessages.PACKAGING_COMPONENTS, false);
|
|
71
|
-
for (const dir of componentsDirs) {
|
|
72
|
-
logger.warn(cliMessages.PACKAGING(dir), false);
|
|
73
|
-
const packageOptions = {
|
|
74
|
-
componentPath: dir,
|
|
75
|
-
minify: false,
|
|
76
|
-
verbose: opts.verbose,
|
|
77
|
-
production: opts.production
|
|
78
|
-
};
|
|
79
|
-
try {
|
|
80
|
-
await local.package(packageOptions);
|
|
81
|
-
packaging = false;
|
|
82
|
-
logger.ok('OK');
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
const errorDescription = error instanceof SyntaxError || !!error.message
|
|
86
|
-
? error.message
|
|
87
|
-
: error;
|
|
88
|
-
logger.err(cliErrors.PACKAGING_FAIL(dir, String(errorDescription)));
|
|
89
|
-
logger.warn(cliMessages.RETRYING_10_SECONDS);
|
|
90
|
-
await delay(10000);
|
|
91
|
-
packaging = false;
|
|
92
|
-
packageComponents(componentsDirs);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const registerPlugins = (registry) => {
|
|
98
|
-
const mockedPlugins = (0, get_mocked_plugins_1.default)(logger, componentsDir);
|
|
99
|
-
mockedPlugins.forEach(p => registry.register(p));
|
|
100
|
-
registry.on('request', data => {
|
|
101
|
-
if (data.errorCode === 'PLUGIN_MISSING_FROM_REGISTRY') {
|
|
102
|
-
logger.err(cliErrors.PLUGIN_MISSING_FROM_REGISTRY(String(data.errorDetails), safe_1.default.blue(index_1.default.commands.cli.MOCK_PLUGIN)));
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
logger.warn(cliMessages.SCANNING_COMPONENTS, true);
|
|
107
|
-
const components = await local.getComponentsByDir(componentsDir, opts.components);
|
|
108
|
-
if (!components.length) {
|
|
109
|
-
const err = cliErrors.DEV_FAIL(cliErrors.COMPONENTS_NOT_FOUND);
|
|
110
|
-
logger.err(err);
|
|
111
|
-
throw err;
|
|
112
|
-
}
|
|
113
|
-
logger.ok('OK');
|
|
114
|
-
components.forEach(component => logger.log(safe_1.default.green('├── ') + component));
|
|
115
|
-
const dependencies = await (0, handle_dependencies_1.default)({
|
|
116
|
-
components,
|
|
117
|
-
logger
|
|
118
|
-
}).catch(err => {
|
|
119
|
-
logger.err(err);
|
|
120
|
-
return Promise.reject(err);
|
|
121
|
-
});
|
|
122
|
-
await packageComponents(components);
|
|
123
|
-
let liveReload = {
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
125
|
-
refresher: () => { },
|
|
126
|
-
port: undefined
|
|
127
|
-
};
|
|
128
|
-
if (hotReloading) {
|
|
129
|
-
const otherPort = await getPort(port + 1).catch(err => {
|
|
130
|
-
logger.err(String(err));
|
|
131
|
-
return Promise.reject(err);
|
|
132
|
-
});
|
|
133
|
-
const liveReloadServer = livereload_1.default.createServer({
|
|
134
|
-
port: otherPort
|
|
135
|
-
});
|
|
136
|
-
const refresher = () => liveReloadServer.refresh('/');
|
|
137
|
-
liveReload = { refresher, port: otherPort };
|
|
138
|
-
}
|
|
139
|
-
const registry = oc.Registry({
|
|
140
|
-
baseUrl,
|
|
141
|
-
prefix: opts.prefix || '',
|
|
142
|
-
dependencies: dependencies.modules,
|
|
143
|
-
discovery: true,
|
|
144
|
-
env: { name: 'local' },
|
|
145
|
-
fallbackRegistryUrl,
|
|
146
|
-
hotReloading,
|
|
147
|
-
liveReloadPort: liveReload.port,
|
|
148
|
-
local: true,
|
|
149
|
-
components: opts.components,
|
|
150
|
-
path: path_1.default.resolve(componentsDir),
|
|
151
|
-
port,
|
|
152
|
-
templates: dependencies.templates,
|
|
153
|
-
verbosity: 1
|
|
154
|
-
});
|
|
155
|
-
registerPlugins(registry);
|
|
156
|
-
logger.warn(cliMessages.REGISTRY_STARTING(baseUrl));
|
|
157
|
-
if (liveReload.port) {
|
|
158
|
-
logger.warn(cliMessages.REGISTRY_LIVERELOAD_STARTING(String(liveReload.port)));
|
|
159
|
-
}
|
|
160
|
-
try {
|
|
161
|
-
await (0, util_1.promisify)(registry.start)();
|
|
162
|
-
if (optWatch) {
|
|
163
|
-
watchForChanges({ components, refreshLiveReload: liveReload.refresher }, packageComponents);
|
|
164
|
-
}
|
|
165
|
-
return registry;
|
|
166
|
-
}
|
|
167
|
-
catch (err) {
|
|
168
|
-
if (err.code === 'EADDRINUSE') {
|
|
169
|
-
// eslint-disable-next-line no-ex-assign
|
|
170
|
-
err = cliErrors.PORT_IS_BUSY(port);
|
|
171
|
-
}
|
|
172
|
-
logger.err(String(err));
|
|
173
|
-
throw err;
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
exports.default = dev;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
const safe_1 = __importDefault(require("colors/safe"));
|
|
26
|
+
const getport_1 = __importDefault(require("getport"));
|
|
27
|
+
const livereload_1 = __importDefault(require("livereload"));
|
|
28
|
+
const path_1 = __importDefault(require("path"));
|
|
29
|
+
const util_1 = require("util");
|
|
30
|
+
const universalify_1 = require("universalify");
|
|
31
|
+
const get_mocked_plugins_1 = __importDefault(require("../domain/get-mocked-plugins"));
|
|
32
|
+
const handle_dependencies_1 = __importDefault(require("../domain/handle-dependencies"));
|
|
33
|
+
const oc = __importStar(require("../../index"));
|
|
34
|
+
const index_1 = __importDefault(require("../../resources/index"));
|
|
35
|
+
const watch_1 = __importDefault(require("../domain/watch"));
|
|
36
|
+
const cliMessages = index_1.default.messages.cli;
|
|
37
|
+
const cliErrors = index_1.default.errors.cli;
|
|
38
|
+
const delay = (time = 0) => new Promise(res => setTimeout(res, time));
|
|
39
|
+
const getPort = (0, util_1.promisify)(getport_1.default);
|
|
40
|
+
const dev = ({ local, logger }) => (0, universalify_1.fromPromise)(async (opts) => {
|
|
41
|
+
const componentsDir = opts.dirPath;
|
|
42
|
+
const port = opts.port || 3000;
|
|
43
|
+
const baseUrl = opts.baseUrl || `http://localhost:${port}/`;
|
|
44
|
+
const fallbackRegistryUrl = opts.fallbackRegistryUrl;
|
|
45
|
+
const hotReloading = typeof opts.hotReloading === 'undefined' ? true : opts.hotReloading;
|
|
46
|
+
const optWatch = typeof opts.watch === 'undefined' ? true : opts.watch;
|
|
47
|
+
let packaging = false;
|
|
48
|
+
const watchForChanges = function ({ components, refreshLiveReload }, cb) {
|
|
49
|
+
(0, watch_1.default)(components, componentsDir, (err, changedFile, componentDir) => {
|
|
50
|
+
if (err) {
|
|
51
|
+
logger.err(index_1.default.errors.generic(String(err)));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
logger.warn(cliMessages.CHANGES_DETECTED(changedFile));
|
|
55
|
+
if (!hotReloading) {
|
|
56
|
+
logger.warn(cliMessages.HOT_RELOADING_DISABLED);
|
|
57
|
+
}
|
|
58
|
+
else if (!componentDir) {
|
|
59
|
+
cb(components, refreshLiveReload);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
cb([componentDir], refreshLiveReload);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const packageComponents = async (componentsDirs) => {
|
|
68
|
+
if (!packaging) {
|
|
69
|
+
packaging = true;
|
|
70
|
+
logger.warn(cliMessages.PACKAGING_COMPONENTS, false);
|
|
71
|
+
for (const dir of componentsDirs) {
|
|
72
|
+
logger.warn(cliMessages.PACKAGING(dir), false);
|
|
73
|
+
const packageOptions = {
|
|
74
|
+
componentPath: dir,
|
|
75
|
+
minify: false,
|
|
76
|
+
verbose: opts.verbose,
|
|
77
|
+
production: opts.production
|
|
78
|
+
};
|
|
79
|
+
try {
|
|
80
|
+
await local.package(packageOptions);
|
|
81
|
+
packaging = false;
|
|
82
|
+
logger.ok('OK');
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
const errorDescription = error instanceof SyntaxError || !!error.message
|
|
86
|
+
? error.message
|
|
87
|
+
: error;
|
|
88
|
+
logger.err(cliErrors.PACKAGING_FAIL(dir, String(errorDescription)));
|
|
89
|
+
logger.warn(cliMessages.RETRYING_10_SECONDS);
|
|
90
|
+
await delay(10000);
|
|
91
|
+
packaging = false;
|
|
92
|
+
packageComponents(componentsDirs);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const registerPlugins = (registry) => {
|
|
98
|
+
const mockedPlugins = (0, get_mocked_plugins_1.default)(logger, componentsDir);
|
|
99
|
+
mockedPlugins.forEach(p => registry.register(p));
|
|
100
|
+
registry.on('request', data => {
|
|
101
|
+
if (data.errorCode === 'PLUGIN_MISSING_FROM_REGISTRY') {
|
|
102
|
+
logger.err(cliErrors.PLUGIN_MISSING_FROM_REGISTRY(String(data.errorDetails), safe_1.default.blue(index_1.default.commands.cli.MOCK_PLUGIN)));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
logger.warn(cliMessages.SCANNING_COMPONENTS, true);
|
|
107
|
+
const components = await local.getComponentsByDir(componentsDir, opts.components);
|
|
108
|
+
if (!components.length) {
|
|
109
|
+
const err = cliErrors.DEV_FAIL(cliErrors.COMPONENTS_NOT_FOUND);
|
|
110
|
+
logger.err(err);
|
|
111
|
+
throw err;
|
|
112
|
+
}
|
|
113
|
+
logger.ok('OK');
|
|
114
|
+
components.forEach(component => logger.log(safe_1.default.green('├── ') + component));
|
|
115
|
+
const dependencies = await (0, handle_dependencies_1.default)({
|
|
116
|
+
components,
|
|
117
|
+
logger
|
|
118
|
+
}).catch(err => {
|
|
119
|
+
logger.err(err);
|
|
120
|
+
return Promise.reject(err);
|
|
121
|
+
});
|
|
122
|
+
await packageComponents(components);
|
|
123
|
+
let liveReload = {
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
125
|
+
refresher: () => { },
|
|
126
|
+
port: undefined
|
|
127
|
+
};
|
|
128
|
+
if (hotReloading) {
|
|
129
|
+
const otherPort = await getPort(port + 1).catch(err => {
|
|
130
|
+
logger.err(String(err));
|
|
131
|
+
return Promise.reject(err);
|
|
132
|
+
});
|
|
133
|
+
const liveReloadServer = livereload_1.default.createServer({
|
|
134
|
+
port: otherPort
|
|
135
|
+
});
|
|
136
|
+
const refresher = () => liveReloadServer.refresh('/');
|
|
137
|
+
liveReload = { refresher, port: otherPort };
|
|
138
|
+
}
|
|
139
|
+
const registry = oc.Registry({
|
|
140
|
+
baseUrl,
|
|
141
|
+
prefix: opts.prefix || '',
|
|
142
|
+
dependencies: dependencies.modules,
|
|
143
|
+
discovery: true,
|
|
144
|
+
env: { name: 'local' },
|
|
145
|
+
fallbackRegistryUrl,
|
|
146
|
+
hotReloading,
|
|
147
|
+
liveReloadPort: liveReload.port,
|
|
148
|
+
local: true,
|
|
149
|
+
components: opts.components,
|
|
150
|
+
path: path_1.default.resolve(componentsDir),
|
|
151
|
+
port,
|
|
152
|
+
templates: dependencies.templates,
|
|
153
|
+
verbosity: 1
|
|
154
|
+
});
|
|
155
|
+
registerPlugins(registry);
|
|
156
|
+
logger.warn(cliMessages.REGISTRY_STARTING(baseUrl));
|
|
157
|
+
if (liveReload.port) {
|
|
158
|
+
logger.warn(cliMessages.REGISTRY_LIVERELOAD_STARTING(String(liveReload.port)));
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
await (0, util_1.promisify)(registry.start)();
|
|
162
|
+
if (optWatch) {
|
|
163
|
+
watchForChanges({ components, refreshLiveReload: liveReload.refresher }, packageComponents);
|
|
164
|
+
}
|
|
165
|
+
return registry;
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
if (err.code === 'EADDRINUSE') {
|
|
169
|
+
// eslint-disable-next-line no-ex-assign
|
|
170
|
+
err = cliErrors.PORT_IS_BUSY(port);
|
|
171
|
+
}
|
|
172
|
+
logger.err(String(err));
|
|
173
|
+
throw err;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
exports.default = dev;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Local } from '
|
|
2
|
-
import { Logger } from '../logger';
|
|
3
|
-
declare const init: ({ local, logger }: {
|
|
4
|
-
local: Local;
|
|
5
|
-
logger: Logger;
|
|
6
|
-
}) => {
|
|
7
|
-
(opts: {
|
|
8
|
-
componentName: string;
|
|
9
|
-
componentPath: string;
|
|
10
|
-
templateType: string;
|
|
11
|
-
}): Promise<string>;
|
|
12
|
-
(arguments__0: {
|
|
13
|
-
componentName: string;
|
|
14
|
-
componentPath: string;
|
|
15
|
-
templateType: string;
|
|
16
|
-
}, arguments__1: (error: unknown, value: string) => void): void;
|
|
17
|
-
};
|
|
18
|
-
export default init;
|
|
1
|
+
import type { Local } from '../domain/local';
|
|
2
|
+
import { Logger } from '../logger';
|
|
3
|
+
declare const init: ({ local, logger }: {
|
|
4
|
+
local: Local;
|
|
5
|
+
logger: Logger;
|
|
6
|
+
}) => {
|
|
7
|
+
(opts: {
|
|
8
|
+
componentName: string;
|
|
9
|
+
componentPath: string;
|
|
10
|
+
templateType: string;
|
|
11
|
+
}): Promise<string>;
|
|
12
|
+
(arguments__0: {
|
|
13
|
+
componentName: string;
|
|
14
|
+
componentPath: string;
|
|
15
|
+
templateType: string;
|
|
16
|
+
}, arguments__1: (error: unknown, value: string) => void): void;
|
|
17
|
+
};
|
|
18
|
+
export default init;
|