@techdocs/cli 1.1.0 → 1.1.1-next.2
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/CHANGELOG.md +28 -0
- package/dist/cjs/{PublisherConfig-162efac5.cjs.js → PublisherConfig-7a0dc71c.cjs.js} +32 -28
- package/dist/cjs/PublisherConfig-7a0dc71c.cjs.js.map +1 -0
- package/dist/cjs/{generate-67f1ab98.cjs.js → generate-b637bb78.cjs.js} +14 -14
- package/dist/cjs/generate-b637bb78.cjs.js.map +1 -0
- package/dist/cjs/{migrate-181e95f5.cjs.js → migrate-122ec4bf.cjs.js} +9 -9
- package/dist/cjs/migrate-122ec4bf.cjs.js.map +1 -0
- package/dist/cjs/{mkdocs-7c045a2a.cjs.js → mkdocs-3c3898e8.cjs.js} +11 -11
- package/dist/cjs/mkdocs-3c3898e8.cjs.js.map +1 -0
- package/dist/cjs/{publish-7bf1e5f7.cjs.js → publish-efa348a5.cjs.js} +7 -7
- package/dist/cjs/publish-efa348a5.cjs.js.map +1 -0
- package/dist/cjs/{serve-66a37894.cjs.js → serve-aa1ff626.cjs.js} +12 -12
- package/dist/cjs/serve-aa1ff626.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +56 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/1553.0a1ffcc9.chunk.js +3 -0
- package/dist/embedded-app/static/1553.0a1ffcc9.chunk.js.map +1 -0
- package/dist/embedded-app/static/{1959.38a96998.chunk.js → 1959.54b727f3.chunk.js} +2 -2
- package/dist/embedded-app/static/{1959.38a96998.chunk.js.map → 1959.54b727f3.chunk.js.map} +1 -1
- package/dist/embedded-app/static/2426.75b31251.chunk.js +3 -0
- package/dist/embedded-app/static/2426.75b31251.chunk.js.map +1 -0
- package/dist/embedded-app/static/3860.8a0dac3d.chunk.js +3 -0
- package/dist/embedded-app/static/3860.8a0dac3d.chunk.js.map +1 -0
- package/dist/embedded-app/static/390.97868757.chunk.js +3 -0
- package/dist/embedded-app/static/390.97868757.chunk.js.map +1 -0
- package/dist/embedded-app/static/4022.f3d67914.chunk.js +3 -0
- package/dist/embedded-app/static/{2426.56947b7f.chunk.js.map → 4022.f3d67914.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6235.5c01917c.chunk.js +3 -0
- package/dist/embedded-app/static/6235.5c01917c.chunk.js.map +1 -0
- package/dist/embedded-app/static/7110.4f2d78ba.chunk.js +3 -0
- package/dist/embedded-app/static/{7110.7d2c1934.chunk.js.map → 7110.4f2d78ba.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7758.e94e2380.chunk.js +3 -0
- package/dist/embedded-app/static/{7758.f316879f.chunk.js.map → 7758.e94e2380.chunk.js.map} +1 -1
- package/dist/embedded-app/static/8061.a19d3b9a.chunk.js +3 -0
- package/dist/embedded-app/static/8061.a19d3b9a.chunk.js.map +1 -0
- package/dist/embedded-app/static/8792.2624b294.chunk.js +3 -0
- package/dist/embedded-app/static/8792.2624b294.chunk.js.map +1 -0
- package/dist/embedded-app/static/9028.e4b797db.chunk.js +3 -0
- package/dist/embedded-app/static/9028.e4b797db.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.536dc3bc.js +476 -0
- package/dist/embedded-app/static/main.536dc3bc.js.map +1 -0
- package/dist/embedded-app/static/module-ajv.d6f6d109.js +3 -3
- package/dist/embedded-app/static/module-ajv.d6f6d109.js.map +1 -1
- package/dist/embedded-app/static/module-date-fns.5015b34b.js +3 -0
- package/dist/embedded-app/static/module-date-fns.5015b34b.js.map +1 -0
- package/dist/embedded-app/static/module-hot-loader.7c7a4226.js +25 -0
- package/dist/embedded-app/static/module-hot-loader.7c7a4226.js.map +1 -0
- package/dist/embedded-app/static/{module-material-table.cbad0c40.js → module-material-table.fcca9670.js} +2 -2
- package/dist/embedded-app/static/{module-material-table.cbad0c40.js.map → module-material-table.fcca9670.js.map} +1 -1
- package/dist/embedded-app/static/{module-material-ui.84a6ac87.js → module-material-ui.2f7d5af1.js} +2 -2
- package/dist/embedded-app/static/module-material-ui.2f7d5af1.js.map +1 -0
- package/dist/embedded-app/static/react-syntax-highlighter/lowlight-import.c14d776e.chunk.js +1 -1
- package/dist/embedded-app/static/{runtime.3efd9679.js → runtime.536dc3bc.js} +2 -2
- package/dist/embedded-app/static/runtime.536dc3bc.js.map +1 -0
- package/dist/embedded-app/static/vendor.536dc3bc.js +105 -0
- package/dist/embedded-app/static/vendor.536dc3bc.js.map +1 -0
- package/dist/index.cjs.js +10 -14
- package/dist/index.cjs.js.map +1 -1
- package/package.json +10 -10
- package/dist/cjs/PublisherConfig-162efac5.cjs.js.map +0 -1
- package/dist/cjs/generate-67f1ab98.cjs.js.map +0 -1
- package/dist/cjs/migrate-181e95f5.cjs.js.map +0 -1
- package/dist/cjs/mkdocs-7c045a2a.cjs.js.map +0 -1
- package/dist/cjs/publish-7bf1e5f7.cjs.js.map +0 -1
- package/dist/cjs/serve-66a37894.cjs.js.map +0 -1
- package/dist/embedded-app/static/1553.a26067ce.chunk.js +0 -3
- package/dist/embedded-app/static/1553.a26067ce.chunk.js.map +0 -1
- package/dist/embedded-app/static/2426.56947b7f.chunk.js +0 -3
- package/dist/embedded-app/static/3860.da7e5f63.chunk.js +0 -3
- package/dist/embedded-app/static/3860.da7e5f63.chunk.js.map +0 -1
- package/dist/embedded-app/static/390.a67c5759.chunk.js +0 -3
- package/dist/embedded-app/static/390.a67c5759.chunk.js.map +0 -1
- package/dist/embedded-app/static/4022.fa355d30.chunk.js +0 -3
- package/dist/embedded-app/static/4022.fa355d30.chunk.js.map +0 -1
- package/dist/embedded-app/static/6235.ec27c62a.chunk.js +0 -3
- package/dist/embedded-app/static/6235.ec27c62a.chunk.js.map +0 -1
- package/dist/embedded-app/static/7110.7d2c1934.chunk.js +0 -3
- package/dist/embedded-app/static/7758.f316879f.chunk.js +0 -3
- package/dist/embedded-app/static/8061.ec7736bc.chunk.js +0 -3
- package/dist/embedded-app/static/8061.ec7736bc.chunk.js.map +0 -1
- package/dist/embedded-app/static/8792.8a74fd9c.chunk.js +0 -3
- package/dist/embedded-app/static/8792.8a74fd9c.chunk.js.map +0 -1
- package/dist/embedded-app/static/9028.77f3e990.chunk.js +0 -3
- package/dist/embedded-app/static/9028.77f3e990.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.3efd9679.js +0 -476
- package/dist/embedded-app/static/main.3efd9679.js.map +0 -1
- package/dist/embedded-app/static/module-aria-query.f720b73c.js +0 -9
- package/dist/embedded-app/static/module-aria-query.f720b73c.js.map +0 -1
- package/dist/embedded-app/static/module-date-fns.a08d117e.js +0 -3
- package/dist/embedded-app/static/module-date-fns.a08d117e.js.map +0 -1
- package/dist/embedded-app/static/module-hot-loader.7955a91c.js +0 -32
- package/dist/embedded-app/static/module-hot-loader.7955a91c.js.map +0 -1
- package/dist/embedded-app/static/module-material-ui.84a6ac87.js.map +0 -1
- package/dist/embedded-app/static/module-testing-library.633b23c6.js +0 -57
- package/dist/embedded-app/static/module-testing-library.633b23c6.js.map +0 -1
- package/dist/embedded-app/static/runtime.3efd9679.js.map +0 -1
- package/dist/embedded-app/static/vendor.3efd9679.js +0 -117
- package/dist/embedded-app/static/vendor.3efd9679.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
+
## 1.1.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/backend-common@0.13.3-next.2
|
|
9
|
+
- @backstage/cli-common@0.1.9-next.0
|
|
10
|
+
- @backstage/config@1.0.1-next.0
|
|
11
|
+
- @backstage/catalog-model@1.0.2-next.0
|
|
12
|
+
- @backstage/plugin-techdocs-node@1.1.1-next.1
|
|
13
|
+
|
|
14
|
+
## 1.1.1-next.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 52fddad92d: The TechDocs CLI's embedded app now imports all API refs from the `@backstage/plugin-techdocs-react` package.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @backstage/backend-common@0.13.3-next.1
|
|
21
|
+
|
|
22
|
+
## 1.1.1-next.0
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 344ea56acc: Bump `commander` to version 9.1.0
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @backstage/backend-common@0.13.3-next.0
|
|
29
|
+
- @backstage/plugin-techdocs-node@1.1.1-next.0
|
|
30
|
+
|
|
3
31
|
## 1.1.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var config = require('@backstage/config');
|
|
4
4
|
|
|
5
5
|
const _PublisherConfig = class {
|
|
6
|
-
static getValidConfig(
|
|
7
|
-
const publisherType =
|
|
6
|
+
static getValidConfig(opts) {
|
|
7
|
+
const publisherType = opts.publisherType;
|
|
8
8
|
if (!_PublisherConfig.isKnownPublisher(publisherType)) {
|
|
9
|
-
throw new Error(`Unknown publisher type ${
|
|
9
|
+
throw new Error(`Unknown publisher type ${opts.publisherType}`);
|
|
10
10
|
}
|
|
11
11
|
return new config.ConfigReader({
|
|
12
12
|
backend: {
|
|
@@ -16,71 +16,75 @@ const _PublisherConfig = class {
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
techdocs: {
|
|
19
|
-
publisher: _PublisherConfig.configFactories[publisherType](
|
|
20
|
-
legacyUseCaseSensitiveTripletPaths:
|
|
19
|
+
publisher: _PublisherConfig.configFactories[publisherType](opts),
|
|
20
|
+
legacyUseCaseSensitiveTripletPaths: opts.legacyUseCaseSensitiveTripletPaths
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
static isKnownPublisher(type) {
|
|
25
25
|
return _PublisherConfig.configFactories.hasOwnProperty(type);
|
|
26
26
|
}
|
|
27
|
-
static getValidAwsS3Config(
|
|
27
|
+
static getValidAwsS3Config(opts) {
|
|
28
28
|
return {
|
|
29
29
|
type: "awsS3",
|
|
30
30
|
awsS3: {
|
|
31
|
-
bucketName:
|
|
32
|
-
...
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...
|
|
36
|
-
...
|
|
31
|
+
bucketName: opts.storageName,
|
|
32
|
+
...opts.awsBucketRootPath && {
|
|
33
|
+
bucketRootPath: opts.awsBucketRootPath
|
|
34
|
+
},
|
|
35
|
+
...opts.awsRoleArn && { credentials: { roleArn: opts.awsRoleArn } },
|
|
36
|
+
...opts.awsEndpoint && { endpoint: opts.awsEndpoint },
|
|
37
|
+
...opts.awsS3ForcePathStyle && { s3ForcePathStyle: true },
|
|
38
|
+
...opts.awsS3sse && { sse: opts.awsS3sse }
|
|
37
39
|
}
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
|
-
static getValidAzureConfig(
|
|
41
|
-
if (!
|
|
42
|
+
static getValidAzureConfig(opts) {
|
|
43
|
+
if (!opts.azureAccountName) {
|
|
42
44
|
throw new Error(`azureBlobStorage requires --azureAccountName to be specified`);
|
|
43
45
|
}
|
|
44
46
|
return {
|
|
45
47
|
type: "azureBlobStorage",
|
|
46
48
|
azureBlobStorage: {
|
|
47
|
-
containerName:
|
|
49
|
+
containerName: opts.storageName,
|
|
48
50
|
credentials: {
|
|
49
|
-
accountName:
|
|
50
|
-
accountKey:
|
|
51
|
+
accountName: opts.azureAccountName,
|
|
52
|
+
accountKey: opts.azureAccountKey
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
|
-
static getValidGoogleGcsConfig(
|
|
57
|
+
static getValidGoogleGcsConfig(opts) {
|
|
56
58
|
return {
|
|
57
59
|
type: "googleGcs",
|
|
58
60
|
googleGcs: {
|
|
59
|
-
bucketName:
|
|
60
|
-
...
|
|
61
|
+
bucketName: opts.storageName,
|
|
62
|
+
...opts.gcsBucketRootPath && {
|
|
63
|
+
bucketRootPath: opts.gcsBucketRootPath
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
};
|
|
63
67
|
}
|
|
64
|
-
static getValidOpenStackSwiftConfig(
|
|
68
|
+
static getValidOpenStackSwiftConfig(opts) {
|
|
65
69
|
const missingParams = [
|
|
66
70
|
"osCredentialId",
|
|
67
71
|
"osSecret",
|
|
68
72
|
"osAuthUrl",
|
|
69
73
|
"osSwiftUrl"
|
|
70
|
-
].filter((param) => !
|
|
74
|
+
].filter((param) => !opts[param]);
|
|
71
75
|
if (missingParams.length) {
|
|
72
76
|
throw new Error(`openStackSwift requires the following params to be specified: ${missingParams.join(", ")}`);
|
|
73
77
|
}
|
|
74
78
|
return {
|
|
75
79
|
type: "openStackSwift",
|
|
76
80
|
openStackSwift: {
|
|
77
|
-
containerName:
|
|
81
|
+
containerName: opts.storageName,
|
|
78
82
|
credentials: {
|
|
79
|
-
id:
|
|
80
|
-
secret:
|
|
83
|
+
id: opts.osCredentialId,
|
|
84
|
+
secret: opts.osSecret
|
|
81
85
|
},
|
|
82
|
-
authUrl:
|
|
83
|
-
swiftUrl:
|
|
86
|
+
authUrl: opts.osAuthUrl,
|
|
87
|
+
swiftUrl: opts.osSwiftUrl
|
|
84
88
|
}
|
|
85
89
|
};
|
|
86
90
|
}
|
|
@@ -94,4 +98,4 @@ PublisherConfig.configFactories = {
|
|
|
94
98
|
};
|
|
95
99
|
|
|
96
100
|
exports.PublisherConfig = PublisherConfig;
|
|
97
|
-
//# sourceMappingURL=PublisherConfig-
|
|
101
|
+
//# sourceMappingURL=PublisherConfig-7a0dc71c.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublisherConfig-7a0dc71c.cjs.js","sources":["../../src/lib/PublisherConfig.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConfigReader } from '@backstage/config';\nimport { OptionValues } from 'commander';\n\ntype Publisher = keyof typeof PublisherConfig['configFactories'];\ntype PublisherConfiguration = {\n [p in Publisher]?: any;\n} & {\n type: Publisher;\n};\n\n/**\n * Helper when working with publisher-related configurations.\n */\nexport class PublisherConfig {\n /**\n * Maps publisher-specific config keys to config getters.\n */\n private static configFactories = {\n awsS3: PublisherConfig.getValidAwsS3Config,\n azureBlobStorage: PublisherConfig.getValidAzureConfig,\n googleGcs: PublisherConfig.getValidGoogleGcsConfig,\n openStackSwift: PublisherConfig.getValidOpenStackSwiftConfig,\n };\n\n /**\n * Returns Backstage config suitable for use when instantiating a Publisher. If\n * there are any missing or invalid options provided, an error is thrown.\n *\n * Note: This assumes that proper credentials are set in Environment\n * variables for the respective GCS/AWS clients to work.\n */\n static getValidConfig(opts: OptionValues): ConfigReader {\n const publisherType = opts.publisherType;\n\n if (!PublisherConfig.isKnownPublisher(publisherType)) {\n throw new Error(`Unknown publisher type ${opts.publisherType}`);\n }\n\n return new ConfigReader({\n // This backend config is not used at all. Just something needed a create a mock discovery instance.\n backend: {\n baseUrl: 'http://localhost:7007',\n listen: {\n port: 7007,\n },\n },\n techdocs: {\n publisher: PublisherConfig.configFactories[publisherType](opts),\n legacyUseCaseSensitiveTripletPaths:\n opts.legacyUseCaseSensitiveTripletPaths,\n },\n });\n }\n\n /**\n * Typeguard to ensure the publisher has a known config getter.\n */\n private static isKnownPublisher(\n type: string,\n ): type is keyof typeof PublisherConfig['configFactories'] {\n return PublisherConfig.configFactories.hasOwnProperty(type);\n }\n\n /**\n * Retrieve valid AWS S3 configuration based on the command.\n */\n private static getValidAwsS3Config(\n opts: OptionValues,\n ): PublisherConfiguration {\n return {\n type: 'awsS3',\n awsS3: {\n bucketName: opts.storageName,\n ...(opts.awsBucketRootPath && {\n bucketRootPath: opts.awsBucketRootPath,\n }),\n ...(opts.awsRoleArn && { credentials: { roleArn: opts.awsRoleArn } }),\n ...(opts.awsEndpoint && { endpoint: opts.awsEndpoint }),\n ...(opts.awsS3ForcePathStyle && { s3ForcePathStyle: true }),\n ...(opts.awsS3sse && { sse: opts.awsS3sse }),\n },\n };\n }\n\n /**\n * Retrieve valid Azure Blob Storage configuration based on the command.\n */\n private static getValidAzureConfig(\n opts: OptionValues,\n ): PublisherConfiguration {\n if (!opts.azureAccountName) {\n throw new Error(\n `azureBlobStorage requires --azureAccountName to be specified`,\n );\n }\n\n return {\n type: 'azureBlobStorage',\n azureBlobStorage: {\n containerName: opts.storageName,\n credentials: {\n accountName: opts.azureAccountName,\n accountKey: opts.azureAccountKey,\n },\n },\n };\n }\n\n /**\n * Retrieve valid GCS configuration based on the command.\n */\n private static getValidGoogleGcsConfig(\n opts: OptionValues,\n ): PublisherConfiguration {\n return {\n type: 'googleGcs',\n googleGcs: {\n bucketName: opts.storageName,\n ...(opts.gcsBucketRootPath && {\n bucketRootPath: opts.gcsBucketRootPath,\n }),\n },\n };\n }\n\n /**\n * Retrieves valid OpenStack Swift configuration based on the command.\n */\n private static getValidOpenStackSwiftConfig(\n opts: OptionValues,\n ): PublisherConfiguration {\n const missingParams = [\n 'osCredentialId',\n 'osSecret',\n 'osAuthUrl',\n 'osSwiftUrl',\n ].filter((param: string) => !opts[param]);\n\n if (missingParams.length) {\n throw new Error(\n `openStackSwift requires the following params to be specified: ${missingParams.join(\n ', ',\n )}`,\n );\n }\n\n return {\n type: 'openStackSwift',\n openStackSwift: {\n containerName: opts.storageName,\n credentials: {\n id: opts.osCredentialId,\n secret: opts.osSecret,\n },\n authUrl: opts.osAuthUrl,\n swiftUrl: opts.osSwiftUrl,\n },\n };\n }\n}\n"],"names":["ConfigReader"],"mappings":";;;;AACA,MAAM,gBAAgB,GAAG,MAAM;AAC/B,EAAE,OAAO,cAAc,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C9B,MAAM,MAAM,IAAI,KAAK,CAAC,CAAC,8DAA8D,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnH,KAAK;AACL,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,gBAAgB;AAC5B,MAAM,cAAc,EAAE;AACtB,QAAQ,aAAa,EAAE,IAAI,CAAC,WAAW;AACvC,QAAQ,WAAW,EAAE;AACrB,UAAU,EAAE,EAAE,IAAI,CAAC,cAAc;AACjC,UAAU,MAAM,EAAE,IAAI,CAAC,QAAQ;AAC/B,SAAS;AACT,QAAQ,OAAO,EAAE,IAAI,CAAC,SAAS;AAC/B,QAAQ,QAAQ,EAAE,IAAI,CAAC,UAAU;AACjC,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;AACQ,IAAC,eAAe,GAAG,iBAAiB;AAC9C,eAAe,CAAC,eAAe,GAAG;AAClC,EAAE,KAAK,EAAE,gBAAgB,CAAC,mBAAmB;AAC7C,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,mBAAmB;AACxD,EAAE,SAAS,EAAE,gBAAgB,CAAC,uBAAuB;AACrD,EAAE,cAAc,EAAE,gBAAgB,CAAC,4BAA4B;AAC/D,CAAC;;;;"}
|
|
@@ -15,14 +15,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
15
15
|
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
16
16
|
var Docker__default = /*#__PURE__*/_interopDefaultLegacy(Docker);
|
|
17
17
|
|
|
18
|
-
async function generate(
|
|
19
|
-
const logger = utility.createLogger({ verbose:
|
|
20
|
-
const sourceDir = path.resolve(
|
|
21
|
-
const outputDir = path.resolve(
|
|
22
|
-
const omitTechdocsCorePlugin =
|
|
23
|
-
const dockerImage =
|
|
24
|
-
const pullImage =
|
|
25
|
-
const legacyCopyReadmeMdToIndexMd =
|
|
18
|
+
async function generate(opts) {
|
|
19
|
+
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
20
|
+
const sourceDir = path.resolve(opts.sourceDir);
|
|
21
|
+
const outputDir = path.resolve(opts.outputDir);
|
|
22
|
+
const omitTechdocsCorePlugin = opts.omitTechdocsCoreMkdocsPlugin;
|
|
23
|
+
const dockerImage = opts.dockerImage;
|
|
24
|
+
const pullImage = opts.pull;
|
|
25
|
+
const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;
|
|
26
26
|
logger.info(`Using source dir ${sourceDir}`);
|
|
27
27
|
logger.info(`Will output generated files in ${outputDir}`);
|
|
28
28
|
logger.verbose("Creating output directory if it does not exist.");
|
|
@@ -30,7 +30,7 @@ async function generate(cmd) {
|
|
|
30
30
|
const config$1 = new config.ConfigReader({
|
|
31
31
|
techdocs: {
|
|
32
32
|
generator: {
|
|
33
|
-
runIn:
|
|
33
|
+
runIn: opts.docker ? "docker" : "local",
|
|
34
34
|
dockerImage,
|
|
35
35
|
pullImage,
|
|
36
36
|
legacyCopyReadmeMdToIndexMd,
|
|
@@ -43,9 +43,9 @@ async function generate(cmd) {
|
|
|
43
43
|
const dockerClient = new Docker__default["default"]();
|
|
44
44
|
const containerRunner = new backendCommon.DockerContainerRunner({ dockerClient });
|
|
45
45
|
let parsedLocationAnnotation = {};
|
|
46
|
-
if (
|
|
46
|
+
if (opts.techdocsRef) {
|
|
47
47
|
try {
|
|
48
|
-
parsedLocationAnnotation = utility.convertTechDocsRefToLocationAnnotation(
|
|
48
|
+
parsedLocationAnnotation = utility.convertTechDocsRefToLocationAnnotation(opts.techdocsRef);
|
|
49
49
|
} catch (err) {
|
|
50
50
|
logger.error(err.message);
|
|
51
51
|
}
|
|
@@ -58,15 +58,15 @@ async function generate(cmd) {
|
|
|
58
58
|
await techdocsGenerator.run({
|
|
59
59
|
inputDir: sourceDir,
|
|
60
60
|
outputDir,
|
|
61
|
-
...
|
|
61
|
+
...opts.techdocsRef ? {
|
|
62
62
|
parsedLocationAnnotation
|
|
63
63
|
} : {},
|
|
64
64
|
logger,
|
|
65
|
-
etag:
|
|
65
|
+
etag: opts.etag,
|
|
66
66
|
...process.env.LOG_LEVEL === "debug" ? { logStream: process$1.stdout } : {}
|
|
67
67
|
});
|
|
68
68
|
logger.info("Done!");
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
exports["default"] = generate;
|
|
72
|
-
//# sourceMappingURL=generate-
|
|
72
|
+
//# sourceMappingURL=generate-b637bb78.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-b637bb78.cjs.js","sources":["../../src/commands/generate/generate.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport fs from 'fs-extra';\nimport Docker from 'dockerode';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport { DockerContainerRunner } from '@backstage/backend-common';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n} from '../../lib/utility';\nimport { stdout } from 'process';\n\nexport default async function generate(opts: OptionValues) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: opts.verbose });\n\n const sourceDir = resolve(opts.sourceDir);\n const outputDir = resolve(opts.outputDir);\n const omitTechdocsCorePlugin = opts.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = opts.dockerImage;\n const pullImage = opts.pull;\n const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: opts.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n legacyCopyReadmeMdToIndexMd,\n mkdocs: {\n omitTechdocsCorePlugin,\n },\n },\n },\n });\n\n // Docker client (conditionally) used by the generators, based on techdocs.generators config.\n const dockerClient = new Docker();\n const containerRunner = new DockerContainerRunner({ dockerClient });\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (opts.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n opts.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n containerRunner,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(opts.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: opts.etag,\n ...(process.env.LOG_LEVEL === 'debug' ? { logStream: stdout } : {}),\n });\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","config","ConfigReader","Docker","DockerContainerRunner","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","stdout"],"mappings":";;;;;;;;;;;;;;;;;AAae,eAAe,QAAQ,CAAC,IAAI,EAAE;AAC7C,EAAE,MAAM,MAAM,GAAGA,oBAAY,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AACzD,EAAE,MAAM,SAAS,GAAGC,YAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC5C,EAAE,MAAM,SAA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,CAAC,OAAO,GAAG,EAAE;AAClB,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAChC,KAAK;AACL,GAAG;AACH,EAAE,MAAM,iBAAiB,GAAG,MAAMC,oCAAiB,CAAC,UAAU,CAACL,QAAM,EAAE;AACvE,IAAI,MAAM;AACV,IAAI,eAAe;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAC7C,EAAE,MAAM,iBAAiB,CAAC,GAAG,CAAC;AAC9B,IAAI,QAAQ,EAAE,SAAS;AACvB,IAAI,SAAS;AACb,IAAI,GAAG,IAAI,CAAC,WAAW,GAAG;AAC1B,MAAM,wBAAwB;AAC9B,KAAK,GAAG,EAAE;AACV,IAAI,MAAM;AACV,IAAI,IAAI,EAAE,IAAI,CAAC,IAAI;AACnB,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,OAAO,GAAG,EAAE,SAAS,EAAEM,gBAAM,EAAE,GAAG,EAAE;AACrE,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACvB;;;;"}
|
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
var backendCommon = require('@backstage/backend-common');
|
|
4
4
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
5
5
|
var utility = require('./utility-51f4a306.cjs.js');
|
|
6
|
-
var PublisherConfig = require('./PublisherConfig-
|
|
6
|
+
var PublisherConfig = require('./PublisherConfig-7a0dc71c.cjs.js');
|
|
7
7
|
require('winston');
|
|
8
8
|
require('@backstage/config');
|
|
9
9
|
|
|
10
|
-
async function migrate(
|
|
11
|
-
const logger = utility.createLogger({ verbose:
|
|
12
|
-
const config = PublisherConfig.PublisherConfig.getValidConfig(
|
|
10
|
+
async function migrate(opts) {
|
|
11
|
+
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
12
|
+
const config = PublisherConfig.PublisherConfig.getValidConfig(opts);
|
|
13
13
|
const discovery = backendCommon.SingleHostDiscovery.fromConfig(config);
|
|
14
14
|
const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery });
|
|
15
15
|
if (!publisher.migrateDocsCase) {
|
|
16
|
-
throw new Error(`Migration not implemented for ${
|
|
16
|
+
throw new Error(`Migration not implemented for ${opts.publisherType}`);
|
|
17
17
|
}
|
|
18
18
|
const { isAvailable } = await publisher.getReadiness();
|
|
19
19
|
if (!isAvailable) {
|
|
20
20
|
throw new Error("");
|
|
21
21
|
}
|
|
22
|
-
const removeOriginal =
|
|
23
|
-
const numericConcurrency = parseInt(
|
|
22
|
+
const removeOriginal = opts.removeOriginal;
|
|
23
|
+
const numericConcurrency = parseInt(opts.concurrency, 10);
|
|
24
24
|
if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {
|
|
25
|
-
throw new Error(`Concurrency must be a number greater than 1. ${
|
|
25
|
+
throw new Error(`Concurrency must be a number greater than 1. ${opts.concurrency} provided.`);
|
|
26
26
|
}
|
|
27
27
|
await publisher.migrateDocsCase({
|
|
28
28
|
concurrency: numericConcurrency,
|
|
@@ -31,4 +31,4 @@ async function migrate(cmd) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
exports["default"] = migrate;
|
|
34
|
-
//# sourceMappingURL=migrate-
|
|
34
|
+
//# sourceMappingURL=migrate-122ec4bf.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-122ec4bf.cjs.js","sources":["../../src/commands/migrate/migrate.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SingleHostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function migrate(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = SingleHostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n if (!publisher.migrateDocsCase) {\n throw new Error(`Migration not implemented for ${opts.publisherType}`);\n }\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n throw new Error('');\n }\n\n // Validate and parse migration arguments.\n const removeOriginal = opts.removeOriginal;\n const numericConcurrency = parseInt(opts.concurrency, 10);\n\n if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {\n throw new Error(\n `Concurrency must be a number greater than 1. ${opts.concurrency} provided.`,\n );\n }\n\n await publisher.migrateDocsCase({\n concurrency: numericConcurrency,\n removeOriginal,\n });\n}\n"],"names":["createLogger","PublisherConfig","SingleHostDiscovery","Publisher"],"mappings":";;;;;;;;;AAIe,eAAe,OAAO,CAAC,IAAI,EAAE;AAC5C,EAAE,MAAM,MAAM,GAAGA,oBAAY,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AACzD,EAAE,MAAM,MAAM,GAAGC,+BAAe,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACtD,EAAE,MAAM,SAAS,GAAGC,iCAAmB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3D,EAAE,MAAM,SAAS,GAAG,MAAMC,4BAAS,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAC9E,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE;AAClC,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,8BAA8B,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC3E,GAAG;AACH,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,SAAS,CAAC,YAAY,EAAE,CAAC;AACzD,EAAE,IAAI,CAAC,WAAW,EAAE;AACpB,IAAI,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;AACxB,GAAG;AACH,EAAE,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;AAC7C,EAAE,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAC5D,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,kBAAkB,IAAI,CAAC,EAAE;AACxE,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,6CAA6C,EAAE,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;AAClG,GAAG;AACH,EAAE,MAAM,SAAS,CAAC,eAAe,CAAC;AAClC,IAAI,WAAW,EAAE,kBAAkB;AACnC,IAAI,cAAc;AAClB,GAAG,CAAC,CAAC;AACL;;;;"}
|
|
@@ -10,15 +10,15 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var openBrowser__default = /*#__PURE__*/_interopDefaultLegacy(openBrowser);
|
|
12
12
|
|
|
13
|
-
async function serveMkdocs(
|
|
14
|
-
const logger = utility.createLogger({ verbose:
|
|
15
|
-
const dockerAddr = `http://0.0.0.0:${
|
|
16
|
-
const localAddr = `http://127.0.0.1:${
|
|
17
|
-
const expectedDevAddr =
|
|
13
|
+
async function serveMkdocs(opts) {
|
|
14
|
+
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
15
|
+
const dockerAddr = `http://0.0.0.0:${opts.port}`;
|
|
16
|
+
const localAddr = `http://127.0.0.1:${opts.port}`;
|
|
17
|
+
const expectedDevAddr = opts.docker ? dockerAddr : localAddr;
|
|
18
18
|
let boolOpenBrowserTriggered = false;
|
|
19
19
|
const logFunc = (data) => {
|
|
20
20
|
const logLines = data.toString().split("\n");
|
|
21
|
-
const logPrefix =
|
|
21
|
+
const logPrefix = opts.docker ? "[docker/mkdocs]" : "[mkdocs]";
|
|
22
22
|
logLines.forEach((line) => {
|
|
23
23
|
if (line === "") {
|
|
24
24
|
return;
|
|
@@ -34,10 +34,10 @@ Starting mkdocs server on ${localAddr}
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
const childProcess = await mkdocsServer.runMkdocsServer({
|
|
37
|
-
port:
|
|
38
|
-
dockerImage:
|
|
39
|
-
dockerEntrypoint:
|
|
40
|
-
useDocker:
|
|
37
|
+
port: opts.port,
|
|
38
|
+
dockerImage: opts.dockerImage,
|
|
39
|
+
dockerEntrypoint: opts.dockerEntrypoint,
|
|
40
|
+
useDocker: opts.docker,
|
|
41
41
|
stdoutLogFunc: logFunc,
|
|
42
42
|
stderrLogFunc: logFunc
|
|
43
43
|
});
|
|
@@ -45,4 +45,4 @@ Starting mkdocs server on ${localAddr}
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
exports["default"] = serveMkdocs;
|
|
48
|
-
//# sourceMappingURL=mkdocs-
|
|
48
|
+
//# sourceMappingURL=mkdocs-3c3898e8.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mkdocs-3c3898e8.cjs.js","sources":["../../src/commands/serve/mkdocs.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OptionValues } from 'commander';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { createLogger } from '../../lib/utility';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\n\nexport default async function serveMkdocs(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const dockerAddr = `http://0.0.0.0:${opts.port}`;\n const localAddr = `http://127.0.0.1:${opts.port}`;\n const expectedDevAddr = opts.docker ? dockerAddr : localAddr;\n // We want to open browser only once based on a log.\n let boolOpenBrowserTriggered = false;\n\n const logFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line in between\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n // Logs from container is verbose.\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !boolOpenBrowserTriggered &&\n line.includes(`Serving on ${expectedDevAddr}`)\n ) {\n // Always open the local address, since 0.0.0.0 belongs to docker\n logger.info(`\\nStarting mkdocs server on ${localAddr}\\n`);\n openBrowser(localAddr);\n boolOpenBrowserTriggered = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n\n // Commander stores --no-docker in cmd.docker variable\n const childProcess = await runMkdocsServer({\n port: opts.port,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n useDocker: opts.docker,\n stdoutLogFunc: logFunc,\n stderrLogFunc: logFunc,\n });\n\n // Keep waiting for user to cancel the process\n await waitForSignal([childProcess]);\n}\n"],"names":["createLogger","openBrowser","runMkdocsServer","waitForSignal"],"mappings":";;;;;;;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AAC;AACJ,EAAE,MAAM,YAAY,GAAG,MAAMC,4BAAe,CAAC;AAC7C,IAAI,IAAI,EAAE,IAAI,CAAC,IAAI;AACnB,IAAI,WAAW,EAAE,IAAI,CAAC,WAAW;AACjC,IAAI,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;AAC3C,IAAI,SAAS,EAAE,IAAI,CAAC,MAAM;AAC1B,IAAI,aAAa,EAAE,OAAO;AAC1B,IAAI,aAAa,EAAE,OAAO;AAC1B,GAAG,CAAC,CAAC;AACL,EAAE,MAAMC,0BAAa,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;AACtC;;;;"}
|
|
@@ -4,20 +4,20 @@ var path = require('path');
|
|
|
4
4
|
var utility = require('./utility-51f4a306.cjs.js');
|
|
5
5
|
var backendCommon = require('@backstage/backend-common');
|
|
6
6
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
7
|
-
var PublisherConfig = require('./PublisherConfig-
|
|
7
|
+
var PublisherConfig = require('./PublisherConfig-7a0dc71c.cjs.js');
|
|
8
8
|
require('winston');
|
|
9
9
|
require('@backstage/config');
|
|
10
10
|
|
|
11
|
-
async function publish(
|
|
12
|
-
const logger = utility.createLogger({ verbose:
|
|
13
|
-
const config = PublisherConfig.PublisherConfig.getValidConfig(
|
|
11
|
+
async function publish(opts) {
|
|
12
|
+
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
13
|
+
const config = PublisherConfig.PublisherConfig.getValidConfig(opts);
|
|
14
14
|
const discovery = backendCommon.SingleHostDiscovery.fromConfig(config);
|
|
15
15
|
const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery });
|
|
16
16
|
const { isAvailable } = await publisher.getReadiness();
|
|
17
17
|
if (!isAvailable) {
|
|
18
18
|
return Promise.reject(new Error(""));
|
|
19
19
|
}
|
|
20
|
-
const [namespace, kind, name] =
|
|
20
|
+
const [namespace, kind, name] = opts.entity.split("/");
|
|
21
21
|
const entity = {
|
|
22
22
|
kind,
|
|
23
23
|
metadata: {
|
|
@@ -25,10 +25,10 @@ async function publish(cmd) {
|
|
|
25
25
|
name
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
const directory = path.resolve(
|
|
28
|
+
const directory = path.resolve(opts.directory);
|
|
29
29
|
await publisher.publish({ entity, directory });
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
exports["default"] = publish;
|
|
34
|
-
//# sourceMappingURL=publish-
|
|
34
|
+
//# sourceMappingURL=publish-efa348a5.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-efa348a5.cjs.js","sources":["../../src/commands/publish/publish.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { SingleHostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(opts: OptionValues): Promise<any> {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = SingleHostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = opts.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(opts.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","SingleHostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;AAKe,eAAe,OAAO,CAAC,IAAI,EAAE;AAC5C,EAAE,MAAM,MAAM,GAAGA,oBAAY,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AACzD,EAAE,MAAM,MAAM,GAAGC,+BAAe,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACtD,EAAE,MAAM,SAAS,GAAGC,iCAAmB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3D,EAAE,MAAM,SAAS,GAAG,MAAMC,4BAAS,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAC9E,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,SAAS,CAAC,YAAY,EAAE,CAAC;AACzD,EAAE,IAAI,CAAC,WAAW,EAAE;AACpB,IAAI,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AACzC,GAAG;AACH,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzD,EAAE,MAAM,MAAM,GAAG;AACjB,IAAI,IAAI;AACR,IAAI,QAAQ,EAAE;AACd,MAAM,SAAS;AACf,MAAM,IAAI;AACV,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,MAAM,SAAS,GAAGC,YAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC5C,EAAE,MAAM,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AACjD,EAAE,OAAO,IAAI,CAAC;AACd;;;;"}
|
|
@@ -86,18 +86,18 @@ function findPreviewBundlePath() {
|
|
|
86
86
|
return cliCommon.findPaths(__dirname).resolveOwn("dist/embedded-app");
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
async function serve(
|
|
90
|
-
const logger = utility.createLogger({ verbose:
|
|
89
|
+
async function serve(opts) {
|
|
90
|
+
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
91
91
|
const isDevMode = Object.keys(process.env).includes("TECHDOCS_CLI_DEV_MODE") ? true : false;
|
|
92
92
|
const backstagePort = 3e3;
|
|
93
93
|
const backstageBackendPort = 7007;
|
|
94
|
-
const mkdocsDockerAddr = `http://0.0.0.0:${
|
|
95
|
-
const mkdocsLocalAddr = `http://127.0.0.1:${
|
|
96
|
-
const mkdocsExpectedDevAddr =
|
|
94
|
+
const mkdocsDockerAddr = `http://0.0.0.0:${opts.mkdocsPort}`;
|
|
95
|
+
const mkdocsLocalAddr = `http://127.0.0.1:${opts.mkdocsPort}`;
|
|
96
|
+
const mkdocsExpectedDevAddr = opts.docker ? mkdocsDockerAddr : mkdocsLocalAddr;
|
|
97
97
|
let mkdocsServerHasStarted = false;
|
|
98
98
|
const mkdocsLogFunc = (data) => {
|
|
99
99
|
const logLines = data.toString().split("\n");
|
|
100
|
-
const logPrefix =
|
|
100
|
+
const logPrefix = opts.docker ? "[docker/mkdocs]" : "[mkdocs]";
|
|
101
101
|
logLines.forEach((line) => {
|
|
102
102
|
if (line === "") {
|
|
103
103
|
return;
|
|
@@ -110,10 +110,10 @@ async function serve(cmd) {
|
|
|
110
110
|
};
|
|
111
111
|
logger.info("Starting mkdocs server.");
|
|
112
112
|
const mkdocsChildProcess = await mkdocsServer.runMkdocsServer({
|
|
113
|
-
port:
|
|
114
|
-
dockerImage:
|
|
115
|
-
dockerEntrypoint:
|
|
116
|
-
useDocker:
|
|
113
|
+
port: opts.mkdocsPort,
|
|
114
|
+
dockerImage: opts.dockerImage,
|
|
115
|
+
dockerEntrypoint: opts.dockerEntrypoint,
|
|
116
|
+
useDocker: opts.docker,
|
|
117
117
|
stdoutLogFunc: mkdocsLogFunc,
|
|
118
118
|
stderrLogFunc: mkdocsLogFunc
|
|
119
119
|
});
|
|
@@ -128,7 +128,7 @@ async function serve(cmd) {
|
|
|
128
128
|
logger.error("mkdocs server did not start. Exiting. Try re-running command with -v option for more details.");
|
|
129
129
|
}
|
|
130
130
|
const port = isDevMode ? backstageBackendPort : backstagePort;
|
|
131
|
-
const httpServer = new HTTPServer(findPreviewBundlePath(), port,
|
|
131
|
+
const httpServer = new HTTPServer(findPreviewBundlePath(), port, opts.mkdocsPort, opts.verbose);
|
|
132
132
|
httpServer.serve().catch((err) => {
|
|
133
133
|
logger.error(err);
|
|
134
134
|
mkdocsChildProcess.kill();
|
|
@@ -142,4 +142,4 @@ Opening browser.`);
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
exports["default"] = serve;
|
|
145
|
-
//# sourceMappingURL=serve-
|
|
145
|
+
//# sourceMappingURL=serve-aa1ff626.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-aa1ff626.cjs.js","sources":["../../src/lib/httpServer.ts","../../src/commands/serve/serve.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport serveHandler from 'serve-handler';\nimport http from 'http';\nimport httpProxy from 'http-proxy';\nimport { createLogger } from './utility';\n\nexport default class HTTPServer {\n private readonly proxyEndpoint: string;\n private readonly backstageBundleDir: string;\n private readonly backstagePort: number;\n private readonly mkdocsPort: number;\n private readonly verbose: boolean;\n\n constructor(\n backstageBundleDir: string,\n backstagePort: number,\n mkdocsPort: number,\n verbose: boolean,\n ) {\n this.proxyEndpoint = '/api/';\n this.backstageBundleDir = backstageBundleDir;\n this.backstagePort = backstagePort;\n this.mkdocsPort = mkdocsPort;\n this.verbose = verbose;\n }\n\n // Create a Proxy for mkdocs server\n private createProxy() {\n const proxy = httpProxy.createProxyServer({\n target: `http://localhost:${this.mkdocsPort}`,\n });\n\n return (request: http.IncomingMessage): [httpProxy, string] => {\n // If the request goes to /api/ we want to remove /api/ from the prefix of the request URL.\n // e.g. ['/', 'api', pathChunks]\n const [, , ...pathChunks] = request.url?.split('/') ?? [];\n const forwardPath = pathChunks.join('/');\n\n return [proxy, forwardPath];\n };\n }\n\n public async serve(): Promise<http.Server> {\n return new Promise<http.Server>((resolve, reject) => {\n const proxyHandler = this.createProxy();\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n if (request.url?.startsWith(this.proxyEndpoint)) {\n const [proxy, forwardPath] = proxyHandler(request);\n\n proxy.on('error', (error: Error) => {\n reject(error);\n });\n\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n\n request.url = forwardPath;\n proxy.web(request, response);\n return;\n }\n\n // This endpoint is used by the frontend to detect where the backend is running.\n if (request.url === '/.detect') {\n response.setHeader('Content-Type', 'text/plain');\n response.end('techdocs-cli-server');\n return;\n }\n\n serveHandler(request, response, {\n public: this.backstageBundleDir,\n trailingSlash: true,\n rewrites: [{ source: '**', destination: 'index.html' }],\n });\n },\n );\n\n const logger = createLogger({ verbose: false });\n server.listen(this.backstagePort, () => {\n if (this.verbose) {\n logger.info(\n `[techdocs-preview-bundle] Running local version of Backstage at http://localhost:${this.backstagePort}`,\n );\n }\n resolve(server);\n });\n\n server.on('error', (error: Error) => {\n reject(error);\n });\n });\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OptionValues } from 'commander';\nimport path from 'path';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { findPaths } from '@backstage/cli-common';\nimport HTTPServer from '../../lib/httpServer';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { createLogger } from '../../lib/utility';\n\nfunction findPreviewBundlePath(): string {\n try {\n return path.join(\n path.dirname(require.resolve('techdocs-cli-embedded-app/package.json')),\n 'dist',\n );\n } catch {\n // If the techdocs-cli-embedded-app package is not available it means we're\n // running a published package. For published packages the preview bundle is\n // copied to dist/embedded-app be the prepack script.\n //\n // This can be tested by running `yarn pack` and extracting the resulting tarball into a directory.\n // Within the extracted directory, run `npm install --only=prod`.\n // Once that's done you can test the CLI in any directory using `node <tmp-dir>/package <command>`.\n // eslint-disable-next-line no-restricted-syntax\n return findPaths(__dirname).resolveOwn('dist/embedded-app');\n }\n}\n\nexport default async function serve(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n // Determine if we want to run in local dev mode or not\n // This will run the backstage http server on a different port and only used\n // for proxying mkdocs to the backstage app running locally (e.g. with webpack-dev-server)\n const isDevMode = Object.keys(process.env).includes('TECHDOCS_CLI_DEV_MODE')\n ? true\n : false;\n\n // TODO: Backstage app port should also be configurable as a CLI option. However, since we bundle\n // a backstage app, we define app.baseUrl in the app-config.yaml.\n // Hence, it is complicated to make this configurable.\n const backstagePort = 3000;\n const backstageBackendPort = 7007;\n\n const mkdocsDockerAddr = `http://0.0.0.0:${opts.mkdocsPort}`;\n const mkdocsLocalAddr = `http://127.0.0.1:${opts.mkdocsPort}`;\n const mkdocsExpectedDevAddr = opts.docker\n ? mkdocsDockerAddr\n : mkdocsLocalAddr;\n\n let mkdocsServerHasStarted = false;\n const mkdocsLogFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !mkdocsServerHasStarted &&\n line.includes(`Serving on ${mkdocsExpectedDevAddr}`)\n ) {\n mkdocsServerHasStarted = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n logger.info('Starting mkdocs server.');\n const mkdocsChildProcess = await runMkdocsServer({\n port: opts.mkdocsPort,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n useDocker: opts.docker,\n stdoutLogFunc: mkdocsLogFunc,\n stderrLogFunc: mkdocsLogFunc,\n });\n\n // Wait until mkdocs server has started so that Backstage starts with docs loaded\n // Takes 1-5 seconds\n for (let attempt = 0; attempt < 30; attempt++) {\n await new Promise(r => setTimeout(r, 3000));\n if (mkdocsServerHasStarted) {\n break;\n }\n logger.info('Waiting for mkdocs server to start...');\n }\n\n if (!mkdocsServerHasStarted) {\n logger.error(\n 'mkdocs server did not start. Exiting. Try re-running command with -v option for more details.',\n );\n }\n\n const port = isDevMode ? backstageBackendPort : backstagePort;\n const httpServer = new HTTPServer(\n findPreviewBundlePath(),\n port,\n opts.mkdocsPort,\n opts.verbose,\n );\n\n httpServer\n .serve()\n .catch(err => {\n logger.error(err);\n mkdocsChildProcess.kill();\n process.exit(1);\n })\n .then(() => {\n // The last three things default/component/local/ don't matter. They can be anything.\n openBrowser(`http://localhost:${port}/docs/default/component/local/`);\n logger.info(\n `Serving docs in Backstage at http://localhost:${port}/docs/default/component/local/\\nOpening browser.`,\n );\n });\n\n await waitForSignal([mkdocsChildProcess]);\n}\n"],"names":["httpProxy","http","serveHandler","createLogger","path","findPaths","runMkdocsServer","openBrowser","waitForSignal"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIe,MAAM,UAAU,CAAC;AAChC,EAAE,WAAW,CAAC,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE;AACtE,IAAI,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;AACjC,IAAI,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACjD,IAAI,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;AACvC,IAAI,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AACjC,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AAC3B,GAAG;AACH,EAAE,WAAW,GAAG;AAChB,IAAI,MAAM,KAAK,GAAGA,6BAAS,CAAC,iBAAiB,CAAC;AAC9C,MAAM,MAAM,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AACnD,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,CAAC,OAAO,KAAK;AACxB,MAAM,IAAI,EAAE,EAAE,EAAE,CAAC;AACjB,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;AAC/G,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAClC,KAAK,CAAC;AACN,GAAG;AACH,EAAE,MAAM,KAAK,GAAG;AAChB,IAAI,OAAO,IAAI,OAAO,CAAC,C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AAE,IAAI,CAAC;AACtE,gBAAgB,CAAC,CAAC,CAAC;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,MAAMC,0BAAa,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC5C;;;;"}
|
|
@@ -329,6 +329,7 @@
|
|
|
329
329
|
},
|
|
330
330
|
"bitbucket": {
|
|
331
331
|
"description": "Integration configuration for Bitbucket",
|
|
332
|
+
"deprecated": "replaced by bitbucketCloud and bitbucketServer",
|
|
332
333
|
"type": "array",
|
|
333
334
|
"items": {
|
|
334
335
|
"type": "object",
|
|
@@ -364,6 +365,56 @@
|
|
|
364
365
|
]
|
|
365
366
|
}
|
|
366
367
|
},
|
|
368
|
+
"bitbucketCloud": {
|
|
369
|
+
"description": "Integration configuration for Bitbucket Cloud",
|
|
370
|
+
"type": "array",
|
|
371
|
+
"items": {
|
|
372
|
+
"type": "object",
|
|
373
|
+
"properties": {
|
|
374
|
+
"username": {
|
|
375
|
+
"description": "The username to use for authenticated requests.",
|
|
376
|
+
"visibility": "secret",
|
|
377
|
+
"type": "string"
|
|
378
|
+
},
|
|
379
|
+
"appPassword": {
|
|
380
|
+
"description": "Bitbucket Cloud app password used to authenticate requests.",
|
|
381
|
+
"visibility": "secret",
|
|
382
|
+
"type": "string"
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
"required": [
|
|
386
|
+
"appPassword",
|
|
387
|
+
"username"
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"bitbucketServer": {
|
|
392
|
+
"description": "Integration configuration for Bitbucket Server",
|
|
393
|
+
"type": "array",
|
|
394
|
+
"items": {
|
|
395
|
+
"type": "object",
|
|
396
|
+
"properties": {
|
|
397
|
+
"host": {
|
|
398
|
+
"description": "The hostname of the given Bitbucket Server instance",
|
|
399
|
+
"visibility": "frontend",
|
|
400
|
+
"type": "string"
|
|
401
|
+
},
|
|
402
|
+
"token": {
|
|
403
|
+
"description": "Token used to authenticate requests.",
|
|
404
|
+
"visibility": "secret",
|
|
405
|
+
"type": "string"
|
|
406
|
+
},
|
|
407
|
+
"apiBaseUrl": {
|
|
408
|
+
"description": "The base url for the Bitbucket Server API, for example https://<host>/rest/api/1.0",
|
|
409
|
+
"visibility": "frontend",
|
|
410
|
+
"type": "string"
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
"required": [
|
|
414
|
+
"host"
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
},
|
|
367
418
|
"gerrit": {
|
|
368
419
|
"description": "Integration configuration for Gerrit",
|
|
369
420
|
"type": "array",
|
|
@@ -380,6 +431,11 @@
|
|
|
380
431
|
"visibility": "frontend",
|
|
381
432
|
"type": "string"
|
|
382
433
|
},
|
|
434
|
+
"cloneUrl": {
|
|
435
|
+
"description": "The base url for cloning repos.",
|
|
436
|
+
"visibility": "frontend",
|
|
437
|
+
"type": "string"
|
|
438
|
+
},
|
|
383
439
|
"username": {
|
|
384
440
|
"description": "The username to use for authenticated requests.",
|
|
385
441
|
"visibility": "secret",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.536dc3bc.js"></script><script defer="defer" src="/static/module-material-ui.2f7d5af1.js"></script><script defer="defer" src="/static/module-lodash.055be129.js"></script><script defer="defer" src="/static/module-date-fns.5015b34b.js"></script><script defer="defer" src="/static/module-ajv.d6f6d109.js"></script><script defer="defer" src="/static/module-material-table.fcca9670.js"></script><script defer="defer" src="/static/module-yaml.57b26e04.js"></script><script defer="defer" src="/static/module-hot-loader.7c7a4226.js"></script><script defer="defer" src="/static/module-jss.cb0efade.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.a9014a2e.js"></script><script defer="defer" src="/static/vendor.536dc3bc.js"></script><script defer="defer" src="/static/main.536dc3bc.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1553,2426],{11553:function(y,i,n){n.r(i),n.d(i,{HasResourcesCard:function(){return s}});var r=n(48023),t=n(2784),e=n(62426);function s(a){const{variant:c="gridItem"}=a;return t.createElement(e.RelatedEntitiesCard,{variant:c,title:"Has resources",entityKind:"Resource",relationType:r.aS,columns:e.resourceEntityColumns,asRenderableEntities:e.asResourceEntities,emptyMessage:"No resource is part of this system",emptyHelpLink:e.resourceEntityHelpLink})}},62426:function(y,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return a},asComponentEntities:function(){return d},asResourceEntities:function(){return C},asSystemEntities:function(){return b},componentEntityColumns:function(){return c},componentEntityHelpLink:function(){return E},resourceEntityColumns:function(){return p},resourceEntityHelpLink:function(){return f},systemEntityColumns:function(){return T},systemEntityHelpLink:function(){return R}});var r=n(90436),t=n(53479),e=n(2784),s=n(53492);function a(o){const{variant:l="gridItem",title:u,columns:v,entityKind:g,relationType:h,emptyMessage:L,emptyHelpLink:k,asRenderableEntities:H}=o,{entity:S}=(0,t.useEntity)(),{entities:K,loading:M,error:m}=(0,t.useRelatedEntities)(S,{type:h,kind:g});return M?e.createElement(s.InfoCard,{variant:l,title:u},e.createElement(s.Progress,null)):m?e.createElement(s.InfoCard,{variant:l,title:u},e.createElement(s.ResponseErrorPanel,{error:m})):e.createElement(t.EntityTable,{title:u,variant:l,emptyContent:e.createElement("div",{style:{textAlign:"center"}},e.createElement(r.Z,{variant:"body1"},L),e.createElement(r.Z,{variant:"body2"},e.createElement(s.Link,{to:k},"Learn how to change this."))),columns:v,entities:H(K||[])})}const c=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"component"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],E="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",d=o=>o,p=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"resource"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],f="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",C=o=>o,T=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"system"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],R="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",b=o=>o}}]);})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=1553.0a1ffcc9.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts"],"names":[],"mappings":"kPA+BO,WAA0B,EAAO,CACtC,KAAM,CAAE,UAAU,YAAe,EACjC,MACE,iBAAoB,sBAAqB,CACvC,QAAS,EACT,MAAO,gBACP,WAAY,WACZ,aAAc,KACd,QAAS,wBACT,qBAAsB,qBACtB,aAAc,qCACd,cAAe,wBAAuB,CACxC,CAEJ,C,0fCYO,WACL,EACA,CACA,KAAM,CACJ,UAAU,WACV,QACA,UACA,aACA,eACA,eACA,gBACA,wBACE,EAEE,CAAE,UAAW,gBAAU,EACvB,CAAE,WAAU,UAAS,SAAU,yBAAmB,EAAQ,CAC9D,KAAM,EACN,KAAM,CACR,CAAC,EAED,MAAI,GAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,CAAM,EAC3D,gBAAoB,WAAU,IAAK,CACvC,EAIA,EAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,CAAM,EAC3D,gBAAoB,qBAAoB,CAAE,MAAO,CAAM,CAAE,CAC7D,EAKF,gBAAoB,cAAa,CAC/B,MAAO,EACP,QAAS,EACT,aACE,gBAAoB,MAAO,CAAE,MAAO,CAAE,UAAW,QAAS,CAAE,EACxD,gBAAoB,IAAY,CAAE,QAAS,OAAQ,EAAG,CAAY,EAClE,gBAAoB,IAAY,CAAE,QAAS,OAAQ,EACjD,gBAAoB,OAAM,CAAE,GAAI,CAAc,EAAG,2BAA+B,CACpF,CACF,EAEF,QAAS,EACT,SAAU,EAAqB,GAAY,CAAC,CAAC,CAAE,CACjD,CAEJ,CCrFO,KAAM,GAAyB,CACpC,4CAA0C,CAAE,YAAa,WAAY,CAAC,EACtE,wCAAsC,EACtC,2CAAyC,EACzC,gDAA8C,EAC9C,sDAAoD,CACtD,EACa,EACX,uFACW,EAAuB,GAClC,EAEW,EAAwB,CACnC,4CAA0C,CAAE,YAAa,UAAW,CAAC,EACrE,wCAAsC,EACtC,2CAAyC,EACzC,gDAA8C,EAC9C,sDAAoD,CACtD,EACa,EACX,sFACW,EAAsB,GACjC,EAEW,EAAsB,CACjC,4CAA0C,CAAE,YAAa,QAAS,CAAC,EACnE,wCAAsC,EACtC,sDAAoD,CACtD,EACa,EACX,oFACW,EAAoB,GAC/B,C","file":"static/1553.0a1ffcc9.chunk.js","sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { RELATION_HAS_PART } from '@backstage/catalog-model';\n\nimport React from 'react';\nimport {\n asResourceEntities,\n RelatedEntitiesCard,\n resourceEntityColumns,\n resourceEntityHelpLink,\n} from '../RelatedEntitiesCard';\n\n/** @public */\n\n\n\n\nexport function HasResourcesCard(props) {\n const { variant = 'gridItem' } = props;\n return (\n React.createElement(RelatedEntitiesCard, {\n variant: variant,\n title: \"Has resources\" ,\n entityKind: \"Resource\",\n relationType: RELATION_HAS_PART,\n columns: resourceEntityColumns,\n asRenderableEntities: asResourceEntities,\n emptyMessage: \"No resource is part of this system\" ,\n emptyHelpLink: resourceEntityHelpLink,}\n )\n );\n}\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n\n Link,\n Progress,\n ResponseErrorPanel,\n\n} from '@backstage/core-components';\n\n/** @public */\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard(\n props,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(Progress, null )\n )\n );\n }\n\n if (error) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(ResponseErrorPanel, { error: error,} )\n )\n );\n }\n\n return (\n React.createElement(EntityTable, {\n title: title,\n variant: variant,\n emptyContent: \n React.createElement('div', { style: { textAlign: 'center' },}\n , React.createElement(Typography, { variant: \"body1\",}, emptyMessage)\n , React.createElement(Typography, { variant: \"body2\",}\n , React.createElement(Link, { to: emptyHelpLink,}, \"Learn how to change this.\" )\n )\n )\n ,\n columns: columns,\n entities: asRenderableEntities(entities || []),}\n )\n );\n}\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { EntityTable } from '@backstage/plugin-catalog-react';\n\n\nexport const componentEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities) =>\n entities ;\n\nexport const resourceEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities) =>\n entities ;\n\nexport const systemEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities) =>\n entities ;\n"],"sourceRoot":""}
|