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
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const oc_storage_adapters_utils_1 = __importDefault(require("oc-storage-adapters-utils"));
|
|
9
|
-
function staticRedirector(repository) {
|
|
10
|
-
return function (req, res) {
|
|
11
|
-
let filePath;
|
|
12
|
-
const clientPath = `${res.conf.prefix || '/'}oc-client/client.js`;
|
|
13
|
-
const clientMapPath = `${res.conf.prefix || '/'}oc-client/oc-client.min.map`;
|
|
14
|
-
if (req.route.path === clientPath) {
|
|
15
|
-
if (res.conf.local) {
|
|
16
|
-
filePath = path_1.default.join(__dirname, '../../components/oc-client/_package/src/oc-client.min.js');
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return res.redirect(repository.getStaticClientPath());
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
else if (req.route.path === clientMapPath) {
|
|
23
|
-
if (res.conf.local) {
|
|
24
|
-
filePath = path_1.default.join(__dirname, '../../components/oc-client/_package/src/oc-client.min.map');
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return res.redirect(repository.getStaticClientMapPath());
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
else if (req.params['componentName'] === 'oc-client') {
|
|
31
|
-
filePath = path_1.default.join(__dirname, '../../components/oc-client/_package/' + req.params[0]);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
filePath =
|
|
35
|
-
path_1.default.join(res.conf.path, req.params['componentName']) +
|
|
36
|
-
'/_package/' +
|
|
37
|
-
req.params[0];
|
|
38
|
-
}
|
|
39
|
-
if (!fs_extra_1.default.existsSync(filePath)) {
|
|
40
|
-
res.errorDetails = `File ${filePath} not found`;
|
|
41
|
-
res.status(404).json({ err: res.errorDetails });
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const stats = fs_extra_1.default.statSync(filePath);
|
|
45
|
-
if (stats.isDirectory()) {
|
|
46
|
-
res.errorDetails = 'Forbidden: Directory Listing Denied';
|
|
47
|
-
res.status(403).json({ err: res.errorDetails });
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const fileStream = fs_extra_1.default.createReadStream(filePath);
|
|
51
|
-
const fileInfo = oc_storage_adapters_utils_1.default.getFileInfo(filePath);
|
|
52
|
-
if (fileInfo.mimeType) {
|
|
53
|
-
res.set('Content-Type', fileInfo.mimeType);
|
|
54
|
-
}
|
|
55
|
-
if (fileInfo.gzip) {
|
|
56
|
-
res.set('Content-Encoding', 'gzip');
|
|
57
|
-
}
|
|
58
|
-
fileStream.on('open', () => {
|
|
59
|
-
fileStream.pipe(res);
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
exports.default = staticRedirector;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const oc_storage_adapters_utils_1 = __importDefault(require("oc-storage-adapters-utils"));
|
|
9
|
+
function staticRedirector(repository) {
|
|
10
|
+
return function (req, res) {
|
|
11
|
+
let filePath;
|
|
12
|
+
const clientPath = `${res.conf.prefix || '/'}oc-client/client.js`;
|
|
13
|
+
const clientMapPath = `${res.conf.prefix || '/'}oc-client/oc-client.min.map`;
|
|
14
|
+
if (req.route.path === clientPath) {
|
|
15
|
+
if (res.conf.local) {
|
|
16
|
+
filePath = path_1.default.join(__dirname, '../../components/oc-client/_package/src/oc-client.min.js');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return res.redirect(repository.getStaticClientPath());
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else if (req.route.path === clientMapPath) {
|
|
23
|
+
if (res.conf.local) {
|
|
24
|
+
filePath = path_1.default.join(__dirname, '../../components/oc-client/_package/src/oc-client.min.map');
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return res.redirect(repository.getStaticClientMapPath());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (req.params['componentName'] === 'oc-client') {
|
|
31
|
+
filePath = path_1.default.join(__dirname, '../../components/oc-client/_package/' + req.params[0]);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
filePath =
|
|
35
|
+
path_1.default.join(res.conf.path, req.params['componentName']) +
|
|
36
|
+
'/_package/' +
|
|
37
|
+
req.params[0];
|
|
38
|
+
}
|
|
39
|
+
if (!fs_extra_1.default.existsSync(filePath)) {
|
|
40
|
+
res.errorDetails = `File ${filePath} not found`;
|
|
41
|
+
res.status(404).json({ err: res.errorDetails });
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const stats = fs_extra_1.default.statSync(filePath);
|
|
45
|
+
if (stats.isDirectory()) {
|
|
46
|
+
res.errorDetails = 'Forbidden: Directory Listing Denied';
|
|
47
|
+
res.status(403).json({ err: res.errorDetails });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const fileStream = fs_extra_1.default.createReadStream(filePath);
|
|
51
|
+
const fileInfo = oc_storage_adapters_utils_1.default.getFileInfo(filePath);
|
|
52
|
+
if (fileInfo.mimeType) {
|
|
53
|
+
res.set('Content-Type', fileInfo.mimeType);
|
|
54
|
+
}
|
|
55
|
+
if (fileInfo.gzip) {
|
|
56
|
+
res.set('Content-Encoding', 'gzip');
|
|
57
|
+
}
|
|
58
|
+
fileStream.on('open', () => {
|
|
59
|
+
fileStream.pipe(res);
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
exports.default = staticRedirector;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VM } from '../../types';
|
|
2
|
-
export default function indexView(vm: VM): string;
|
|
1
|
+
import { VM } from '../../types';
|
|
2
|
+
export default function indexView(vm: VM): string;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const components_dependencies_1 = __importDefault(require("./partials/components-dependencies"));
|
|
7
|
-
const components_history_1 = __importDefault(require("./partials/components-history"));
|
|
8
|
-
const components_list_1 = __importDefault(require("./partials/components-list"));
|
|
9
|
-
const components_templates_1 = __importDefault(require("./partials/components-templates"));
|
|
10
|
-
const components_plugins_1 = __importDefault(require("./partials/components-plugins"));
|
|
11
|
-
const index_1 = __importDefault(require("./static/index"));
|
|
12
|
-
const layout_1 = __importDefault(require("./partials/layout"));
|
|
13
|
-
const property_1 = __importDefault(require("./partials/property"));
|
|
14
|
-
function indexView(vm) {
|
|
15
|
-
const tabs = {
|
|
16
|
-
dependencies: (0, components_dependencies_1.default)(vm),
|
|
17
|
-
history: (0, components_history_1.default)(vm),
|
|
18
|
-
list: (0, components_list_1.default)(vm),
|
|
19
|
-
templates: (0, components_templates_1.default)(vm),
|
|
20
|
-
plugins: (0, components_plugins_1.default)(vm)
|
|
21
|
-
};
|
|
22
|
-
const layout = (0, layout_1.default)(vm);
|
|
23
|
-
const property = (0, property_1.default)();
|
|
24
|
-
const getCount = (state) => vm.stateCounts[state] || 0;
|
|
25
|
-
const isLocal = vm.type !== 'oc-registry';
|
|
26
|
-
const componentsValue = `${vm.components.length} (${getCount('experimental')} experimental, ${getCount('deprecated')} deprecated)`;
|
|
27
|
-
const extraLinks = ` | <a href="#components-history" class="tab-link">History</a>` +
|
|
28
|
-
` | <a href="#components-templates" class="tab-link">Available templates</a>` +
|
|
29
|
-
` | <a href="#components-dependencies" class="tab-link">Available dependencies</a>` +
|
|
30
|
-
` | <a href="#components-plugins" class="tab-link">Available plugins</a>`;
|
|
31
|
-
const registryType = isLocal ? 'Local dev registry' : 'On-line registry';
|
|
32
|
-
const componentReleases = !isLocal
|
|
33
|
-
? property('Components releases', vm.componentsReleases)
|
|
34
|
-
: '';
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const components_dependencies_1 = __importDefault(require("./partials/components-dependencies"));
|
|
7
|
+
const components_history_1 = __importDefault(require("./partials/components-history"));
|
|
8
|
+
const components_list_1 = __importDefault(require("./partials/components-list"));
|
|
9
|
+
const components_templates_1 = __importDefault(require("./partials/components-templates"));
|
|
10
|
+
const components_plugins_1 = __importDefault(require("./partials/components-plugins"));
|
|
11
|
+
const index_1 = __importDefault(require("./static/index"));
|
|
12
|
+
const layout_1 = __importDefault(require("./partials/layout"));
|
|
13
|
+
const property_1 = __importDefault(require("./partials/property"));
|
|
14
|
+
function indexView(vm) {
|
|
15
|
+
const tabs = {
|
|
16
|
+
dependencies: (0, components_dependencies_1.default)(vm),
|
|
17
|
+
history: (0, components_history_1.default)(vm),
|
|
18
|
+
list: (0, components_list_1.default)(vm),
|
|
19
|
+
templates: (0, components_templates_1.default)(vm),
|
|
20
|
+
plugins: (0, components_plugins_1.default)(vm)
|
|
21
|
+
};
|
|
22
|
+
const layout = (0, layout_1.default)(vm);
|
|
23
|
+
const property = (0, property_1.default)();
|
|
24
|
+
const getCount = (state) => vm.stateCounts[state] || 0;
|
|
25
|
+
const isLocal = vm.type !== 'oc-registry';
|
|
26
|
+
const componentsValue = `${vm.components.length} (${getCount('experimental')} experimental, ${getCount('deprecated')} deprecated)`;
|
|
27
|
+
const extraLinks = ` | <a href="#components-history" class="tab-link">History</a>` +
|
|
28
|
+
` | <a href="#components-templates" class="tab-link">Available templates</a>` +
|
|
29
|
+
` | <a href="#components-dependencies" class="tab-link">Available dependencies</a>` +
|
|
30
|
+
` | <a href="#components-plugins" class="tab-link">Available plugins</a>`;
|
|
31
|
+
const registryType = isLocal ? 'Local dev registry' : 'On-line registry';
|
|
32
|
+
const componentReleases = !isLocal
|
|
33
|
+
? property('Components releases', vm.componentsReleases)
|
|
34
|
+
: '';
|
|
35
35
|
const content = `${property('Base url', vm.href, true)}
|
|
36
36
|
${property('Version', vm.ocVersion)}
|
|
37
37
|
${property('Components', componentsValue)}
|
|
@@ -45,10 +45,10 @@ function indexView(vm) {
|
|
|
45
45
|
${tabs.history}
|
|
46
46
|
${tabs.templates}
|
|
47
47
|
${tabs.dependencies}
|
|
48
|
-
${tabs.plugins}`;
|
|
48
|
+
${tabs.plugins}`;
|
|
49
49
|
const scripts = `<script>
|
|
50
50
|
var q = "${encodeURIComponent(vm.q)}", componentsList = ${JSON.stringify(vm.componentsList)};
|
|
51
|
-
${index_1.default}</script>`;
|
|
52
|
-
return layout({ content, scripts });
|
|
53
|
-
}
|
|
54
|
-
exports.default = indexView;
|
|
51
|
+
${index_1.default}</script>`;
|
|
52
|
+
return layout({ content, scripts });
|
|
53
|
+
}
|
|
54
|
+
exports.default = indexView;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Component } from '../../types';
|
|
2
|
-
interface Vm {
|
|
3
|
-
parsedAuthor: {
|
|
4
|
-
name?: string;
|
|
5
|
-
email?: string;
|
|
6
|
-
url?: string;
|
|
7
|
-
};
|
|
8
|
-
component: Component;
|
|
9
|
-
dependencies: string[];
|
|
10
|
-
href: string;
|
|
11
|
-
sandBoxDefaultQs: string;
|
|
12
|
-
title: string;
|
|
13
|
-
repositoryUrl: string;
|
|
14
|
-
}
|
|
15
|
-
export default function info(vm: Vm): string;
|
|
16
|
-
export {};
|
|
1
|
+
import { Component } from '../../types';
|
|
2
|
+
interface Vm {
|
|
3
|
+
parsedAuthor: {
|
|
4
|
+
name?: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
};
|
|
8
|
+
component: Component;
|
|
9
|
+
dependencies: string[];
|
|
10
|
+
href: string;
|
|
11
|
+
sandBoxDefaultQs: string;
|
|
12
|
+
title: string;
|
|
13
|
+
repositoryUrl: string;
|
|
14
|
+
}
|
|
15
|
+
export default function info(vm: Vm): string;
|
|
16
|
+
export {};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const component_author_1 = __importDefault(require("./partials/component-author"));
|
|
7
|
-
const component_parameters_1 = __importDefault(require("./partials/component-parameters"));
|
|
8
|
-
const component_state_1 = __importDefault(require("./partials/component-state"));
|
|
9
|
-
const component_versions_1 = __importDefault(require("./partials/component-versions"));
|
|
10
|
-
const info_1 = __importDefault(require("./static/info"));
|
|
11
|
-
const layout_1 = __importDefault(require("./partials/layout"));
|
|
12
|
-
const property_1 = __importDefault(require("./partials/property"));
|
|
13
|
-
const is_template_legacy_1 = __importDefault(require("../../utils/is-template-legacy"));
|
|
14
|
-
function info(vm) {
|
|
15
|
-
const componentAuthor = (0, component_author_1.default)(vm);
|
|
16
|
-
const componentParameters = (0, component_parameters_1.default)(vm);
|
|
17
|
-
const componentState = (0, component_state_1.default)(vm);
|
|
18
|
-
const componentVersions = (0, component_versions_1.default)(vm);
|
|
19
|
-
const layout = (0, layout_1.default)(vm);
|
|
20
|
-
const property = (0, property_1.default)();
|
|
21
|
-
const showArray = (title, arr) => property(title, !!arr && arr.length > 0 ? arr.join(', ') : 'none');
|
|
22
|
-
const { component, dependencies, href, repositoryUrl, sandBoxDefaultQs } = vm;
|
|
23
|
-
const componentHref = `${href}${component.name}/${component.version}/${sandBoxDefaultQs}`;
|
|
24
|
-
const publishDate = component.oc.date
|
|
25
|
-
? new Date(component.oc.date)
|
|
26
|
-
: 'not available';
|
|
27
|
-
const publishAgent = component.oc.version
|
|
28
|
-
? `OC CLI ${component.oc.version}`
|
|
29
|
-
: 'not available';
|
|
30
|
-
const templateType = component.oc.files.template.type;
|
|
31
|
-
const compiler = `${templateType}-compiler`;
|
|
32
|
-
const template = `${templateType} (${(0, is_template_legacy_1.default)(templateType)
|
|
33
|
-
? 'legacy'
|
|
34
|
-
: compiler + '@' + component.oc.files.template.version})`;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const component_author_1 = __importDefault(require("./partials/component-author"));
|
|
7
|
+
const component_parameters_1 = __importDefault(require("./partials/component-parameters"));
|
|
8
|
+
const component_state_1 = __importDefault(require("./partials/component-state"));
|
|
9
|
+
const component_versions_1 = __importDefault(require("./partials/component-versions"));
|
|
10
|
+
const info_1 = __importDefault(require("./static/info"));
|
|
11
|
+
const layout_1 = __importDefault(require("./partials/layout"));
|
|
12
|
+
const property_1 = __importDefault(require("./partials/property"));
|
|
13
|
+
const is_template_legacy_1 = __importDefault(require("../../utils/is-template-legacy"));
|
|
14
|
+
function info(vm) {
|
|
15
|
+
const componentAuthor = (0, component_author_1.default)(vm);
|
|
16
|
+
const componentParameters = (0, component_parameters_1.default)(vm);
|
|
17
|
+
const componentState = (0, component_state_1.default)(vm);
|
|
18
|
+
const componentVersions = (0, component_versions_1.default)(vm);
|
|
19
|
+
const layout = (0, layout_1.default)(vm);
|
|
20
|
+
const property = (0, property_1.default)();
|
|
21
|
+
const showArray = (title, arr) => property(title, !!arr && arr.length > 0 ? arr.join(', ') : 'none');
|
|
22
|
+
const { component, dependencies, href, repositoryUrl, sandBoxDefaultQs } = vm;
|
|
23
|
+
const componentHref = `${href}${component.name}/${component.version}/${sandBoxDefaultQs}`;
|
|
24
|
+
const publishDate = component.oc.date
|
|
25
|
+
? new Date(component.oc.date)
|
|
26
|
+
: 'not available';
|
|
27
|
+
const publishAgent = component.oc.version
|
|
28
|
+
? `OC CLI ${component.oc.version}`
|
|
29
|
+
: 'not available';
|
|
30
|
+
const templateType = component.oc.files.template.type;
|
|
31
|
+
const compiler = `${templateType}-compiler`;
|
|
32
|
+
const template = `${templateType} (${(0, is_template_legacy_1.default)(templateType)
|
|
33
|
+
? 'legacy'
|
|
34
|
+
: compiler + '@' + component.oc.files.template.version})`;
|
|
35
35
|
const content = `<a class="back" href="${href}"><< All components</a>
|
|
36
36
|
<h2>${component.name} ${componentVersions()}</h2>
|
|
37
37
|
<p class="w-100">${component.description} ${componentState()}</p>
|
|
@@ -61,10 +61,10 @@ function info(vm) {
|
|
|
61
61
|
<a class="open-preview" href="#open">Open</a>
|
|
62
62
|
)
|
|
63
63
|
</h3>
|
|
64
|
-
<iframe class="preview" src="~preview/${sandBoxDefaultQs}"></iframe>`;
|
|
64
|
+
<iframe class="preview" src="~preview/${sandBoxDefaultQs}"></iframe>`;
|
|
65
65
|
const scripts = `<script>var thisComponentHref="${href}${component.name}/";
|
|
66
66
|
${info_1.default}
|
|
67
|
-
</script>`;
|
|
68
|
-
return layout({ content, scripts });
|
|
69
|
-
}
|
|
70
|
-
exports.default = info;
|
|
67
|
+
</script>`;
|
|
68
|
+
return layout({ content, scripts });
|
|
69
|
+
}
|
|
70
|
+
exports.default = info;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare const componentAuthor: (vm: {
|
|
2
|
-
parsedAuthor: {
|
|
3
|
-
name?: string;
|
|
4
|
-
email?: string;
|
|
5
|
-
url?: string;
|
|
6
|
-
};
|
|
7
|
-
}) => () => string;
|
|
8
|
-
export default componentAuthor;
|
|
1
|
+
declare const componentAuthor: (vm: {
|
|
2
|
+
parsedAuthor: {
|
|
3
|
+
name?: string;
|
|
4
|
+
email?: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
};
|
|
7
|
+
}) => () => string;
|
|
8
|
+
export default componentAuthor;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const componentAuthor = (vm) => () => {
|
|
4
|
-
const author = vm.parsedAuthor;
|
|
5
|
-
let placeholder = '';
|
|
6
|
-
if (!author.name && !author.email && !author.url) {
|
|
7
|
-
placeholder += `<span>not available</span>`;
|
|
8
|
-
}
|
|
9
|
-
if (author.name) {
|
|
10
|
-
placeholder += `<span>${author.name} </span>`;
|
|
11
|
-
}
|
|
12
|
-
if (author.email) {
|
|
13
|
-
placeholder += `<span><a href="mailto:${author.email}">${author.email}</a> </span>`;
|
|
14
|
-
}
|
|
15
|
-
if (author.url) {
|
|
16
|
-
placeholder += `<span><a href="${author.url}" target="_blank">${author.url}</a></span>`;
|
|
17
|
-
}
|
|
18
|
-
return `<div class="field"><p>Author:</p>${placeholder}</div>`;
|
|
19
|
-
};
|
|
20
|
-
exports.default = componentAuthor;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const componentAuthor = (vm) => () => {
|
|
4
|
+
const author = vm.parsedAuthor;
|
|
5
|
+
let placeholder = '';
|
|
6
|
+
if (!author.name && !author.email && !author.url) {
|
|
7
|
+
placeholder += `<span>not available</span>`;
|
|
8
|
+
}
|
|
9
|
+
if (author.name) {
|
|
10
|
+
placeholder += `<span>${author.name} </span>`;
|
|
11
|
+
}
|
|
12
|
+
if (author.email) {
|
|
13
|
+
placeholder += `<span><a href="mailto:${author.email}">${author.email}</a> </span>`;
|
|
14
|
+
}
|
|
15
|
+
if (author.url) {
|
|
16
|
+
placeholder += `<span><a href="${author.url}" target="_blank">${author.url}</a></span>`;
|
|
17
|
+
}
|
|
18
|
+
return `<div class="field"><p>Author:</p>${placeholder}</div>`;
|
|
19
|
+
};
|
|
20
|
+
exports.default = componentAuthor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component } from '../../../types';
|
|
2
|
-
declare const componentParameters: ({ component }: {
|
|
3
|
-
component: Component;
|
|
4
|
-
}) => () => string;
|
|
5
|
-
export default componentParameters;
|
|
1
|
+
import { Component } from '../../../types';
|
|
2
|
+
declare const componentParameters: ({ component }: {
|
|
3
|
+
component: Component;
|
|
4
|
+
}) => () => string;
|
|
5
|
+
export default componentParameters;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const componentParameters = ({ component }) => () => {
|
|
4
|
-
let parameters = `<h3>Parameters</h3>`;
|
|
5
|
-
if (!component.oc.parameters) {
|
|
6
|
-
return `${parameters}<p class="w-100">none</p>`;
|
|
7
|
-
}
|
|
8
|
-
const parameterRow = (param, paramName) => {
|
|
9
|
-
const mandatory = param.mandatory ? 'mandatory' : 'optional';
|
|
10
|
-
const description = param.description
|
|
11
|
-
? `<span>${param.description}</span><br /><br />`
|
|
12
|
-
: '';
|
|
13
|
-
const defaultParam = !param.mandatory && param.default
|
|
14
|
-
? `<br /><br /><span class="bold">Default:</span><span>${param.default}</span>`
|
|
15
|
-
: '';
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const componentParameters = ({ component }) => () => {
|
|
4
|
+
let parameters = `<h3>Parameters</h3>`;
|
|
5
|
+
if (!component.oc.parameters) {
|
|
6
|
+
return `${parameters}<p class="w-100">none</p>`;
|
|
7
|
+
}
|
|
8
|
+
const parameterRow = (param, paramName) => {
|
|
9
|
+
const mandatory = param.mandatory ? 'mandatory' : 'optional';
|
|
10
|
+
const description = param.description
|
|
11
|
+
? `<span>${param.description}</span><br /><br />`
|
|
12
|
+
: '';
|
|
13
|
+
const defaultParam = !param.mandatory && param.default
|
|
14
|
+
? `<br /><br /><span class="bold">Default:</span><span>${param.default}</span>`
|
|
15
|
+
: '';
|
|
16
16
|
return `<div class="row">
|
|
17
17
|
<div class="parameter">
|
|
18
18
|
<span class="bold">${paramName}</span>
|
|
@@ -24,18 +24,18 @@ const componentParameters = ({ component }) => () => {
|
|
|
24
24
|
<span>${param.example}</span>
|
|
25
25
|
${defaultParam}
|
|
26
26
|
</div>
|
|
27
|
-
</div>`;
|
|
28
|
-
};
|
|
29
|
-
const rows = Object.keys(component.oc.parameters)
|
|
30
|
-
.map(parameterName => parameterRow(component.oc.parameters[parameterName], parameterName))
|
|
31
|
-
.join('');
|
|
27
|
+
</div>`;
|
|
28
|
+
};
|
|
29
|
+
const rows = Object.keys(component.oc.parameters)
|
|
30
|
+
.map(parameterName => parameterRow(component.oc.parameters[parameterName], parameterName))
|
|
31
|
+
.join('');
|
|
32
32
|
parameters += `<div id="plugins" class="table">
|
|
33
33
|
<div class="row header">
|
|
34
34
|
<div class="parameter">Parameters</div>
|
|
35
35
|
<div class="parameter-description"></div>
|
|
36
36
|
</div>
|
|
37
37
|
${rows}
|
|
38
|
-
</div>`;
|
|
39
|
-
return parameters;
|
|
40
|
-
};
|
|
41
|
-
exports.default = componentParameters;
|
|
38
|
+
</div>`;
|
|
39
|
+
return parameters;
|
|
40
|
+
};
|
|
41
|
+
exports.default = componentParameters;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component } from '../../../types';
|
|
2
|
-
declare const componentState: ({ component }: {
|
|
3
|
-
component: Component;
|
|
4
|
-
}) => () => string;
|
|
5
|
-
export default componentState;
|
|
1
|
+
import { Component } from '../../../types';
|
|
2
|
+
declare const componentState: ({ component }: {
|
|
3
|
+
component: Component;
|
|
4
|
+
}) => () => string;
|
|
5
|
+
export default componentState;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const componentState = ({ component }) => () => !component.oc.state
|
|
4
|
-
? ''
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const componentState = ({ component }) => () => !component.oc.state
|
|
4
|
+
? ''
|
|
5
5
|
: `<span class="details-state">
|
|
6
6
|
<span class="component-state-${component.oc.state.toLowerCase()}">
|
|
7
7
|
${component.oc.state}
|
|
8
8
|
</span>
|
|
9
|
-
</span>`;
|
|
10
|
-
exports.default = componentState;
|
|
9
|
+
</span>`;
|
|
10
|
+
exports.default = componentState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component } from '../../../types';
|
|
2
|
-
declare const componentVersions: ({ component }: {
|
|
3
|
-
component: Component;
|
|
4
|
-
}) => () => string;
|
|
5
|
-
export default componentVersions;
|
|
1
|
+
import { Component } from '../../../types';
|
|
2
|
+
declare const componentVersions: ({ component }: {
|
|
3
|
+
component: Component;
|
|
4
|
+
}) => () => string;
|
|
5
|
+
export default componentVersions;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const componentVersions = ({ component }) => () => {
|
|
4
|
-
const componentOption = (version) => `<option value="${version}"${version === component.version ? ' selected="selected"' : ''}>${version}</option>`;
|
|
5
|
-
return `<select id="versions">${component.allVersions
|
|
6
|
-
.map(componentOption)
|
|
7
|
-
.join('')}</select>`;
|
|
8
|
-
};
|
|
9
|
-
exports.default = componentVersions;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const componentVersions = ({ component }) => () => {
|
|
4
|
+
const componentOption = (version) => `<option value="${version}"${version === component.version ? ' selected="selected"' : ''}>${version}</option>`;
|
|
5
|
+
return `<select id="versions">${component.allVersions
|
|
6
|
+
.map(componentOption)
|
|
7
|
+
.join('')}</select>`;
|
|
8
|
+
};
|
|
9
|
+
exports.default = componentVersions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VM } from '../../../types';
|
|
2
|
-
export default function componentsDependencies(vm: VM): string;
|
|
1
|
+
import { VM } from '../../../types';
|
|
2
|
+
export default function componentsDependencies(vm: VM): string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function componentsDependencies(vm) {
|
|
4
|
-
const dependencyRow = ({ core, link, name, version }) => {
|
|
5
|
-
const label = name + (core ? ` (node.js core dependency)` : `@${version}`);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function componentsDependencies(vm) {
|
|
4
|
+
const dependencyRow = ({ core, link, name, version }) => {
|
|
5
|
+
const label = name + (core ? ` (node.js core dependency)` : `@${version}`);
|
|
6
6
|
return `<a href="${link}" target="_blank">
|
|
7
7
|
<div class="componentRow row table">
|
|
8
8
|
<p class="release">${label}</p>
|
|
9
9
|
</div>
|
|
10
|
-
</a>`;
|
|
11
|
-
};
|
|
12
|
-
return `<div id="components-dependencies" class="box">${vm.availableDependencies
|
|
13
|
-
.map(dependencyRow)
|
|
14
|
-
.join('')}</div>`;
|
|
15
|
-
}
|
|
16
|
-
exports.default = componentsDependencies;
|
|
10
|
+
</a>`;
|
|
11
|
+
};
|
|
12
|
+
return `<div id="components-dependencies" class="box">${vm.availableDependencies
|
|
13
|
+
.map(dependencyRow)
|
|
14
|
+
.join('')}</div>`;
|
|
15
|
+
}
|
|
16
|
+
exports.default = componentsDependencies;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VM } from '../../../types';
|
|
2
|
-
export default function componentsHistory(vm: VM): string;
|
|
1
|
+
import { VM } from '../../../types';
|
|
2
|
+
export default function componentsHistory(vm: VM): string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function componentsHistory(vm) {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function componentsHistory(vm) {
|
|
4
4
|
const componentRow = ({ name, publishDate, version }) => `<a href="${name}/${version}/~info">
|
|
5
5
|
<div class="componentRow row table">
|
|
6
6
|
<p class="release">${publishDate} - Published ${name}@${version}</p>
|
|
7
7
|
</div>
|
|
8
|
-
</a>`;
|
|
9
|
-
const history = vm.componentsHistory || [];
|
|
10
|
-
return `<div id="components-history" class="box">${history
|
|
11
|
-
.map(componentRow)
|
|
12
|
-
.join('')}</div>`;
|
|
13
|
-
}
|
|
14
|
-
exports.default = componentsHistory;
|
|
8
|
+
</a>`;
|
|
9
|
+
const history = vm.componentsHistory || [];
|
|
10
|
+
return `<div id="components-history" class="box">${history
|
|
11
|
+
.map(componentRow)
|
|
12
|
+
.join('')}</div>`;
|
|
13
|
+
}
|
|
14
|
+
exports.default = componentsHistory;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VM } from '../../../types';
|
|
2
|
-
export default function componentsList(vm: VM): string;
|
|
1
|
+
import { VM } from '../../../types';
|
|
2
|
+
export default function componentsList(vm: VM): string;
|