@techdocs/cli 1.3.3-next.0 → 1.4.0-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 +25 -0
- package/dist/cjs/index/{PublisherConfig-f679e718.cjs.js → PublisherConfig-9dfc07ee.cjs.js} +3 -2
- package/dist/cjs/index/{PublisherConfig-f679e718.cjs.js.map → PublisherConfig-9dfc07ee.cjs.js.map} +1 -1
- package/dist/cjs/index/{generate-8f4ae280.cjs.js → generate-8722d4c2.cjs.js} +5 -4
- package/dist/cjs/index/generate-8722d4c2.cjs.js.map +1 -0
- package/dist/cjs/index/{migrate-20cb2ea3.cjs.js → migrate-5312e76c.cjs.js} +5 -3
- package/dist/cjs/index/{migrate-20cb2ea3.cjs.js.map → migrate-5312e76c.cjs.js.map} +1 -1
- package/dist/cjs/index/{mkdocs-9fabcb0c.cjs.js → mkdocs-b897f254.cjs.js} +4 -2
- package/dist/cjs/index/{mkdocs-9fabcb0c.cjs.js.map → mkdocs-b897f254.cjs.js.map} +1 -1
- package/dist/cjs/index/{publish-7e1bb507.cjs.js → publish-f0f203ef.cjs.js} +5 -3
- package/dist/cjs/index/{publish-7e1bb507.cjs.js.map → publish-f0f203ef.cjs.js.map} +1 -1
- package/dist/cjs/index/{serve-aea8398a.cjs.js → serve-8c722cc8.cjs.js} +4 -2
- package/dist/cjs/index/{serve-aea8398a.cjs.js.map → serve-8c722cc8.cjs.js.map} +1 -1
- package/dist/cjs/index/{utility-8be2be15.cjs.js → utility-2edd5bff.cjs.js} +16 -1
- package/dist/cjs/index/utility-2edd5bff.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +8 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/1032.90746959.chunk.js +3 -0
- package/dist/embedded-app/static/1032.90746959.chunk.js.map +1 -0
- package/dist/embedded-app/static/{1105.6191ca0a.chunk.js → 1105.0c932be4.chunk.js} +1 -1
- package/dist/embedded-app/static/{1105.6191ca0a.chunk.js.map → 1105.0c932be4.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.26a4caf6.chunk.js → 184.0de82ef1.chunk.js} +1 -1
- package/dist/embedded-app/static/{184.26a4caf6.chunk.js.map → 184.0de82ef1.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.184525b4.chunk.js → 2440.0219755d.chunk.js} +1 -1
- package/dist/embedded-app/static/{2440.184525b4.chunk.js.map → 2440.0219755d.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.68e9cdc0.chunk.js → 5458.36bd7281.chunk.js} +1 -1
- package/dist/embedded-app/static/{5458.68e9cdc0.chunk.js.map → 5458.36bd7281.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{732.e1699a4c.chunk.js → 732.b3a19fae.chunk.js} +1 -1
- package/dist/embedded-app/static/{732.e1699a4c.chunk.js.map → 732.b3a19fae.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.93e152cb.chunk.js → 7560.b6001518.chunk.js} +1 -1
- package/dist/embedded-app/static/{7560.93e152cb.chunk.js.map → 7560.b6001518.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7670.8383e359.chunk.js +3 -0
- package/dist/embedded-app/static/7670.8383e359.chunk.js.map +1 -0
- package/dist/embedded-app/static/7750.c29731fc.chunk.js +8 -0
- package/dist/embedded-app/static/7750.c29731fc.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9323.d3b0b6b6.chunk.js → 9323.f715e2ef.chunk.js} +1 -1
- package/dist/embedded-app/static/{9323.d3b0b6b6.chunk.js.map → 9323.f715e2ef.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9545.12d478b4.chunk.js +3 -0
- package/dist/embedded-app/static/{1032.91b320eb.chunk.js.map → 9545.12d478b4.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.a743fc85.chunk.js → 9770.94e79bff.chunk.js} +1 -1
- package/dist/embedded-app/static/{9770.a743fc85.chunk.js.map → 9770.94e79bff.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.e99a7512.js +503 -0
- package/dist/embedded-app/static/main.e99a7512.js.map +1 -0
- package/dist/embedded-app/static/{runtime.ca2552f1.js → runtime.e99a7512.js} +2 -2
- package/dist/embedded-app/static/{runtime.ca2552f1.js.map → runtime.e99a7512.js.map} +1 -1
- package/dist/embedded-app/static/vendor.e99a7512.js +270 -0
- package/dist/embedded-app/static/vendor.e99a7512.js.map +1 -0
- package/dist/index.cjs.js +9 -6
- package/dist/index.cjs.js.map +1 -1
- package/package.json +7 -7
- package/dist/cjs/index/generate-8f4ae280.cjs.js.map +0 -1
- package/dist/cjs/index/utility-8be2be15.cjs.js.map +0 -1
- package/dist/embedded-app/static/1032.91b320eb.chunk.js +0 -3
- package/dist/embedded-app/static/7670.433cf15c.chunk.js +0 -3
- package/dist/embedded-app/static/7670.433cf15c.chunk.js.map +0 -1
- package/dist/embedded-app/static/7750.90d0b9bd.chunk.js +0 -8
- package/dist/embedded-app/static/7750.90d0b9bd.chunk.js.map +0 -1
- package/dist/embedded-app/static/9545.27f02c72.chunk.js +0 -3
- package/dist/embedded-app/static/9545.27f02c72.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.ca2552f1.js +0 -503
- package/dist/embedded-app/static/main.ca2552f1.js.map +0 -1
- package/dist/embedded-app/static/vendor.ca2552f1.js +0 -270
- package/dist/embedded-app/static/vendor.ca2552f1.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -39,7 +39,7 @@ function registerCommands(program) {
|
|
|
39
39
|
"--legacyCopyReadmeMdToIndexMd",
|
|
40
40
|
"Attempt to ensure an index.md exists falling back to using <docs-dir>/README.md or README.md in case a default <docs-dir>/index.md is not provided.",
|
|
41
41
|
false
|
|
42
|
-
).alias("build").action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/generate-
|
|
42
|
+
).alias("build").action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/generate-8722d4c2.cjs.js'); }).then((m) => m.default)));
|
|
43
43
|
program.command("migrate").description(
|
|
44
44
|
"Migrate objects with case-sensitive entity triplets to lower-case versions."
|
|
45
45
|
).requiredOption(
|
|
@@ -83,7 +83,7 @@ function registerCommands(program) {
|
|
|
83
83
|
"--concurrency <MAX CONCURRENT REQS>",
|
|
84
84
|
"Optional Controls the number of API requests allowed to be performed simultaneously.",
|
|
85
85
|
"25"
|
|
86
|
-
).option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/migrate-
|
|
86
|
+
).option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/migrate-5312e76c.cjs.js'); }).then((m) => m.default)));
|
|
87
87
|
program.command("publish").description(
|
|
88
88
|
"Publish generated TechDocs site to an external storage AWS S3, Google GCS, etc."
|
|
89
89
|
).requiredOption(
|
|
@@ -111,6 +111,9 @@ function registerCommands(program) {
|
|
|
111
111
|
).option(
|
|
112
112
|
"--awsEndpoint <AWS ENDPOINT>",
|
|
113
113
|
"Optional AWS endpoint to send requests to."
|
|
114
|
+
).option(
|
|
115
|
+
"--awsProxy <HTTPS Proxy>",
|
|
116
|
+
"Optional Proxy to use for AWS requests."
|
|
114
117
|
).option("--awsS3sse <AWS SSE>", "Optional AWS S3 Server Side Encryption.").option(
|
|
115
118
|
"--awsS3ForcePathStyle",
|
|
116
119
|
"Optional AWS S3 option to force path style."
|
|
@@ -136,7 +139,7 @@ function registerCommands(program) {
|
|
|
136
139
|
"--directory <PATH>",
|
|
137
140
|
"Path of the directory containing generated files to publish",
|
|
138
141
|
"./site/"
|
|
139
|
-
).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/publish-
|
|
142
|
+
).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/publish-f0f203ef.cjs.js'); }).then((m) => m.default)));
|
|
140
143
|
program.command("serve:mkdocs").description("Serve a documentation project locally using MkDocs serve.").option(
|
|
141
144
|
"-i, --docker-image <DOCKER_IMAGE>",
|
|
142
145
|
"The mkdocs docker container to use",
|
|
@@ -154,7 +157,7 @@ function registerCommands(program) {
|
|
|
154
157
|
"--site-name",
|
|
155
158
|
"Name for site when using default MkDocs config",
|
|
156
159
|
"Documentation Site"
|
|
157
|
-
).option("-p, --port <PORT>", "Port to serve documentation locally", "8000").option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/mkdocs-
|
|
160
|
+
).option("-p, --port <PORT>", "Port to serve documentation locally", "8000").option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/mkdocs-b897f254.cjs.js'); }).then((m) => m.default)));
|
|
158
161
|
program.command("serve").description(
|
|
159
162
|
"Serve a documentation project locally in a Backstage app-like environment"
|
|
160
163
|
).option(
|
|
@@ -187,7 +190,7 @@ function registerCommands(program) {
|
|
|
187
190
|
"--preview-app-port can only be used together with --preview-app-bundle-path"
|
|
188
191
|
);
|
|
189
192
|
}
|
|
190
|
-
}).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/serve-
|
|
193
|
+
}).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/index/serve-8c722cc8.cjs.js'); }).then((m) => m.default)));
|
|
191
194
|
}
|
|
192
195
|
function lazy(getActionFunc) {
|
|
193
196
|
return async (...args) => {
|
|
@@ -202,7 +205,7 @@ function lazy(getActionFunc) {
|
|
|
202
205
|
};
|
|
203
206
|
}
|
|
204
207
|
|
|
205
|
-
var version = "1.
|
|
208
|
+
var version = "1.4.0-next.2";
|
|
206
209
|
|
|
207
210
|
const main = (argv) => {
|
|
208
211
|
commander.program.name("techdocs-cli").version(version);
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/commands/index.ts","../src/index.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 { Command } from 'commander';\nimport { TechdocsGenerator } from '@backstage/plugin-techdocs-node';\n\nconst defaultDockerImage = TechdocsGenerator.defaultDockerImage;\nconst defaultPreviewAppPort = '3000';\n\nexport function registerCommands(program: Command) {\n program\n .command('generate')\n .description('Generate TechDocs documentation site using MkDocs.')\n .option(\n '--source-dir <PATH>',\n 'Source directory containing mkdocs.yml and docs/ directory.',\n '.',\n )\n .option(\n '--output-dir <PATH>',\n 'Output directory containing generated TechDocs site.',\n './site/',\n )\n .option(\n '--docker-image <DOCKER_IMAGE>',\n 'The mkdocs docker container to use',\n defaultDockerImage,\n )\n .option('--no-pull', 'Do not pull the latest docker image')\n .option(\n '--no-docker',\n 'Do not use Docker, use MkDocs executable and plugins in current user environment.',\n )\n .option(\n '--techdocs-ref <HOST_TYPE:URL>',\n 'The repository hosting documentation source files e.g. url:https://ghe.mycompany.net.com/org/repo.' +\n '\\nThis value is same as the backstage.io/techdocs-ref annotation of the corresponding Backstage entity.' +\n '\\nIt is completely fine to skip this as it is only being used to set repo_url in mkdocs.yml if not found.\\n',\n )\n .option(\n '--etag <ETAG>',\n 'A unique identifier for the prepared tree e.g. commit SHA. If provided it will be stored in techdocs_metadata.json.',\n )\n .option(\n '--site-name',\n 'Name for site when using default MkDocs config',\n 'Documentation Site',\n )\n .option('-v --verbose', 'Enable verbose output.', false)\n .option(\n '--omitTechdocsCoreMkdocsPlugin',\n \"Don't patch MkDocs file automatically with techdocs-core plugin.\",\n false,\n )\n .option(\n '--legacyCopyReadmeMdToIndexMd',\n 'Attempt to ensure an index.md exists falling back to using <docs-dir>/README.md or README.md in case a default <docs-dir>/index.md is not provided.',\n false,\n )\n .alias('build')\n .action(lazy(() => import('./generate/generate').then(m => m.default)));\n\n program\n .command('migrate')\n .description(\n 'Migrate objects with case-sensitive entity triplets to lower-case versions.',\n )\n .requiredOption(\n '--publisher-type <TYPE>',\n '(Required always) awsS3 | googleGcs | azureBlobStorage | openStackSwift - same as techdocs.publisher.type in Backstage app-config.yaml',\n )\n .requiredOption(\n '--storage-name <BUCKET/CONTAINER NAME>',\n '(Required always) In case of AWS/GCS, use the bucket name. In case of Azure, use container name. Same as techdocs.publisher.[TYPE].bucketName',\n )\n .option(\n '--azureAccountName <AZURE ACCOUNT NAME>',\n '(Required for Azure) specify when --publisher-type azureBlobStorage',\n )\n .option(\n '--azureAccountKey <AZURE ACCOUNT KEY>',\n 'Azure Storage Account key to use for authentication. If not specified, you must set AZURE_TENANT_ID, AZURE_CLIENT_ID & AZURE_CLIENT_SECRET as environment variables.',\n )\n .option(\n '--awsRoleArn <AWS ROLE ARN>',\n 'Optional AWS ARN of role to be assumed.',\n )\n .option(\n '--awsEndpoint <AWS ENDPOINT>',\n 'Optional AWS endpoint to send requests to.',\n )\n .option(\n '--awsS3ForcePathStyle',\n 'Optional AWS S3 option to force path style.',\n )\n .option(\n '--osCredentialId <OPENSTACK SWIFT APPLICATION CREDENTIAL ID>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osSecret <OPENSTACK SWIFT APPLICATION CREDENTIAL SECRET>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osAuthUrl <OPENSTACK SWIFT AUTHURL>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osSwiftUrl <OPENSTACK SWIFT SWIFTURL>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--removeOriginal',\n 'Optional Files are copied by default. If flag is set, files are renamed/moved instead.',\n false,\n )\n .option(\n '--concurrency <MAX CONCURRENT REQS>',\n 'Optional Controls the number of API requests allowed to be performed simultaneously.',\n '25',\n )\n .option('-v --verbose', 'Enable verbose output.', false)\n .action(lazy(() => import('./migrate/migrate').then(m => m.default)));\n\n program\n .command('publish')\n .description(\n 'Publish generated TechDocs site to an external storage AWS S3, Google GCS, etc.',\n )\n .requiredOption(\n '--publisher-type <TYPE>',\n '(Required always) awsS3 | googleGcs | azureBlobStorage | openStackSwift - same as techdocs.publisher.type in Backstage app-config.yaml',\n )\n .requiredOption(\n '--storage-name <BUCKET/CONTAINER NAME>',\n '(Required always) In case of AWS/GCS, use the bucket name. In case of Azure, use container name. Same as techdocs.publisher.[TYPE].bucketName',\n )\n .requiredOption(\n '--entity <NAMESPACE/KIND/NAME>',\n '(Required always) Entity uid separated by / in namespace/kind/name order (case-sensitive). Example: default/Component/myEntity ',\n )\n .option(\n '--legacyUseCaseSensitiveTripletPaths',\n 'Publishes objects with cased entity triplet prefix when set (e.g. namespace/Kind/name). Only use if your TechDocs backend is configured the same way.',\n false,\n )\n .option(\n '--azureAccountName <AZURE ACCOUNT NAME>',\n '(Required for Azure) specify when --publisher-type azureBlobStorage',\n )\n .option(\n '--azureAccountKey <AZURE ACCOUNT KEY>',\n 'Azure Storage Account key to use for authentication. If not specified, you must set AZURE_TENANT_ID, AZURE_CLIENT_ID & AZURE_CLIENT_SECRET as environment variables.',\n )\n .option(\n '--awsRoleArn <AWS ROLE ARN>',\n 'Optional AWS ARN of role to be assumed.',\n )\n .option(\n '--awsEndpoint <AWS ENDPOINT>',\n 'Optional AWS endpoint to send requests to.',\n )\n .option('--awsS3sse <AWS SSE>', 'Optional AWS S3 Server Side Encryption.')\n .option(\n '--awsS3ForcePathStyle',\n 'Optional AWS S3 option to force path style.',\n )\n .option(\n '--awsBucketRootPath <AWS BUCKET ROOT PATH>',\n 'Optional sub-directory to store files in Amazon S3',\n )\n .option(\n '--osCredentialId <OPENSTACK SWIFT APPLICATION CREDENTIAL ID>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osSecret <OPENSTACK SWIFT APPLICATION CREDENTIAL SECRET>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osAuthUrl <OPENSTACK SWIFT AUTHURL>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osSwiftUrl <OPENSTACK SWIFT SWIFTURL>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--gcsBucketRootPath <GCS BUCKET ROOT PATH>',\n 'Optional sub-directory to store files in Google cloud storage',\n )\n .option(\n '--directory <PATH>',\n 'Path of the directory containing generated files to publish',\n './site/',\n )\n .action(lazy(() => import('./publish/publish').then(m => m.default)));\n\n program\n .command('serve:mkdocs')\n .description('Serve a documentation project locally using MkDocs serve.')\n .option(\n '-i, --docker-image <DOCKER_IMAGE>',\n 'The mkdocs docker container to use',\n defaultDockerImage,\n )\n .option(\n '--docker-entrypoint <DOCKER_ENTRYPOINT>',\n 'Override the image entrypoint',\n )\n .option(\n '--docker-option <DOCKER_OPTION...>',\n 'Extra options to pass to the docker run command, e.g. \"--add-host=internal.host:192.168.11.12\" (can be added multiple times).',\n )\n .option(\n '--no-docker',\n 'Do not use Docker, run `mkdocs serve` in current user environment.',\n )\n .option(\n '--site-name',\n 'Name for site when using default MkDocs config',\n 'Documentation Site',\n )\n .option('-p, --port <PORT>', 'Port to serve documentation locally', '8000')\n .option('-v --verbose', 'Enable verbose output.', false)\n .action(lazy(() => import('./serve/mkdocs').then(m => m.default)));\n\n program\n .command('serve')\n .description(\n 'Serve a documentation project locally in a Backstage app-like environment',\n )\n .option(\n '-i, --docker-image <DOCKER_IMAGE>',\n 'The mkdocs docker container to use',\n defaultDockerImage,\n )\n .option(\n '--docker-entrypoint <DOCKER_ENTRYPOINT>',\n 'Override the image entrypoint',\n )\n .option(\n '--docker-option <DOCKER_OPTION...>',\n 'Extra options to pass to the docker run command, e.g. \"--add-host=internal.host:192.168.11.12\" (can be added multiple times).',\n )\n .option(\n '--no-docker',\n 'Do not use Docker, use MkDocs executable in current user environment.',\n )\n .option(\n '--site-name',\n 'Name for site when using default MkDocs config',\n 'Documentation Site',\n )\n .option('--mkdocs-port <PORT>', 'Port for MkDocs server to use', '8000')\n .option('-v --verbose', 'Enable verbose output.', false)\n .option(\n '--preview-app-bundle-path <PATH_TO_BUNDLE>',\n 'Preview documentation using another web app',\n )\n .option(\n '--preview-app-port <PORT>',\n 'Port for the preview app to be served on',\n defaultPreviewAppPort,\n )\n .hook('preAction', command => {\n if (\n command.opts().previewAppPort !== defaultPreviewAppPort &&\n !command.opts().previewAppBundlePath\n ) {\n command.error(\n '--preview-app-port can only be used together with --preview-app-bundle-path',\n );\n }\n })\n .action(lazy(() => import('./serve/serve').then(m => m.default)));\n}\n\n// Wraps an action function so that it always exits and handles errors\n// Humbly taken from backstage-cli's registerCommands\nfunction lazy(\n getActionFunc: () => Promise<(...args: any[]) => Promise<void>>,\n): (...args: any[]) => Promise<never> {\n return async (...args: any[]) => {\n try {\n const actionFunc = await getActionFunc();\n await actionFunc(...args);\n process.exit(0);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error.message);\n process.exit(1);\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 { program } from 'commander';\nimport { registerCommands } from './commands';\nimport { version } from '../package.json';\n\nconst main = (argv: string[]) => {\n program.name('techdocs-cli').version(version);\n\n registerCommands(program);\n\n program.parse(argv);\n};\n\nmain(process.argv);\n"],"names":["TechdocsGenerator","program"],"mappings":";;;;;AAmBA,MAAM,qBAAqBA,oCAAkB,CAAA,kBAAA,CAAA;AAC7C,MAAM,qBAAwB,GAAA,MAAA,CAAA;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AE,IAAK,CAAA,CAAA,CAAA,KAAK,CAAE,CAAA,OAAO,CAAC,CAAC,CAAA,CAAA;AACpE,CAAA;AAIA,SAAS,KACP,aACoC,EAAA;AACpC,EAAA,OAAO,UAAU,IAAgB,KAAA;AAC/B,IAAI,IAAA;AACF,MAAM,MAAA,UAAA,GAAa,MAAM,aAAc,EAAA,CAAA;AACvC,MAAM,MAAA,UAAA,CAAW,GAAG,IAAI,CAAA,CAAA;AACxB,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA,CAAA;AAAA,aACP,KAAP,EAAA;AAEA,MAAQ,OAAA,CAAA,KAAA,CAAM,MAAM,OAAO,CAAA,CAAA;AAC3B,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA,CAAA;AAAA,KAChB;AAAA,GACF,CAAA;AACF;;;;AC/RA,MAAM,IAAA,GAAO,CAAC,IAAmB,KAAA;AAC/B,EAAAC,iBAAA,CAAQ,IAAK,CAAA,cAAc,CAAE,CAAA,OAAA,CAAQ,OAAO,CAAA,CAAA;AAE5C,EAAA,gBAAA,CAAiBA,iBAAO,CAAA,CAAA;AAExB,EAAAA,iBAAA,CAAQ,MAAM,IAAI,CAAA,CAAA;AACpB,CAAA,CAAA;AAEA,IAAA,CAAK,QAAQ,IAAI,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/commands/index.ts","../src/index.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 { Command } from 'commander';\nimport { TechdocsGenerator } from '@backstage/plugin-techdocs-node';\n\nconst defaultDockerImage = TechdocsGenerator.defaultDockerImage;\nconst defaultPreviewAppPort = '3000';\n\nexport function registerCommands(program: Command) {\n program\n .command('generate')\n .description('Generate TechDocs documentation site using MkDocs.')\n .option(\n '--source-dir <PATH>',\n 'Source directory containing mkdocs.yml and docs/ directory.',\n '.',\n )\n .option(\n '--output-dir <PATH>',\n 'Output directory containing generated TechDocs site.',\n './site/',\n )\n .option(\n '--docker-image <DOCKER_IMAGE>',\n 'The mkdocs docker container to use',\n defaultDockerImage,\n )\n .option('--no-pull', 'Do not pull the latest docker image')\n .option(\n '--no-docker',\n 'Do not use Docker, use MkDocs executable and plugins in current user environment.',\n )\n .option(\n '--techdocs-ref <HOST_TYPE:URL>',\n 'The repository hosting documentation source files e.g. url:https://ghe.mycompany.net.com/org/repo.' +\n '\\nThis value is same as the backstage.io/techdocs-ref annotation of the corresponding Backstage entity.' +\n '\\nIt is completely fine to skip this as it is only being used to set repo_url in mkdocs.yml if not found.\\n',\n )\n .option(\n '--etag <ETAG>',\n 'A unique identifier for the prepared tree e.g. commit SHA. If provided it will be stored in techdocs_metadata.json.',\n )\n .option(\n '--site-name',\n 'Name for site when using default MkDocs config',\n 'Documentation Site',\n )\n .option('-v --verbose', 'Enable verbose output.', false)\n .option(\n '--omitTechdocsCoreMkdocsPlugin',\n \"Don't patch MkDocs file automatically with techdocs-core plugin.\",\n false,\n )\n .option(\n '--legacyCopyReadmeMdToIndexMd',\n 'Attempt to ensure an index.md exists falling back to using <docs-dir>/README.md or README.md in case a default <docs-dir>/index.md is not provided.',\n false,\n )\n .alias('build')\n .action(lazy(() => import('./generate/generate').then(m => m.default)));\n\n program\n .command('migrate')\n .description(\n 'Migrate objects with case-sensitive entity triplets to lower-case versions.',\n )\n .requiredOption(\n '--publisher-type <TYPE>',\n '(Required always) awsS3 | googleGcs | azureBlobStorage | openStackSwift - same as techdocs.publisher.type in Backstage app-config.yaml',\n )\n .requiredOption(\n '--storage-name <BUCKET/CONTAINER NAME>',\n '(Required always) In case of AWS/GCS, use the bucket name. In case of Azure, use container name. Same as techdocs.publisher.[TYPE].bucketName',\n )\n .option(\n '--azureAccountName <AZURE ACCOUNT NAME>',\n '(Required for Azure) specify when --publisher-type azureBlobStorage',\n )\n .option(\n '--azureAccountKey <AZURE ACCOUNT KEY>',\n 'Azure Storage Account key to use for authentication. If not specified, you must set AZURE_TENANT_ID, AZURE_CLIENT_ID & AZURE_CLIENT_SECRET as environment variables.',\n )\n .option(\n '--awsRoleArn <AWS ROLE ARN>',\n 'Optional AWS ARN of role to be assumed.',\n )\n .option(\n '--awsEndpoint <AWS ENDPOINT>',\n 'Optional AWS endpoint to send requests to.',\n )\n .option(\n '--awsS3ForcePathStyle',\n 'Optional AWS S3 option to force path style.',\n )\n .option(\n '--osCredentialId <OPENSTACK SWIFT APPLICATION CREDENTIAL ID>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osSecret <OPENSTACK SWIFT APPLICATION CREDENTIAL SECRET>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osAuthUrl <OPENSTACK SWIFT AUTHURL>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osSwiftUrl <OPENSTACK SWIFT SWIFTURL>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--removeOriginal',\n 'Optional Files are copied by default. If flag is set, files are renamed/moved instead.',\n false,\n )\n .option(\n '--concurrency <MAX CONCURRENT REQS>',\n 'Optional Controls the number of API requests allowed to be performed simultaneously.',\n '25',\n )\n .option('-v --verbose', 'Enable verbose output.', false)\n .action(lazy(() => import('./migrate/migrate').then(m => m.default)));\n\n program\n .command('publish')\n .description(\n 'Publish generated TechDocs site to an external storage AWS S3, Google GCS, etc.',\n )\n .requiredOption(\n '--publisher-type <TYPE>',\n '(Required always) awsS3 | googleGcs | azureBlobStorage | openStackSwift - same as techdocs.publisher.type in Backstage app-config.yaml',\n )\n .requiredOption(\n '--storage-name <BUCKET/CONTAINER NAME>',\n '(Required always) In case of AWS/GCS, use the bucket name. In case of Azure, use container name. Same as techdocs.publisher.[TYPE].bucketName',\n )\n .requiredOption(\n '--entity <NAMESPACE/KIND/NAME>',\n '(Required always) Entity uid separated by / in namespace/kind/name order (case-sensitive). Example: default/Component/myEntity ',\n )\n .option(\n '--legacyUseCaseSensitiveTripletPaths',\n 'Publishes objects with cased entity triplet prefix when set (e.g. namespace/Kind/name). Only use if your TechDocs backend is configured the same way.',\n false,\n )\n .option(\n '--azureAccountName <AZURE ACCOUNT NAME>',\n '(Required for Azure) specify when --publisher-type azureBlobStorage',\n )\n .option(\n '--azureAccountKey <AZURE ACCOUNT KEY>',\n 'Azure Storage Account key to use for authentication. If not specified, you must set AZURE_TENANT_ID, AZURE_CLIENT_ID & AZURE_CLIENT_SECRET as environment variables.',\n )\n .option(\n '--awsRoleArn <AWS ROLE ARN>',\n 'Optional AWS ARN of role to be assumed.',\n )\n .option(\n '--awsEndpoint <AWS ENDPOINT>',\n 'Optional AWS endpoint to send requests to.',\n )\n .option(\n '--awsProxy <HTTPS Proxy>',\n 'Optional Proxy to use for AWS requests.',\n )\n .option('--awsS3sse <AWS SSE>', 'Optional AWS S3 Server Side Encryption.')\n .option(\n '--awsS3ForcePathStyle',\n 'Optional AWS S3 option to force path style.',\n )\n .option(\n '--awsBucketRootPath <AWS BUCKET ROOT PATH>',\n 'Optional sub-directory to store files in Amazon S3',\n )\n .option(\n '--osCredentialId <OPENSTACK SWIFT APPLICATION CREDENTIAL ID>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osSecret <OPENSTACK SWIFT APPLICATION CREDENTIAL SECRET>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osAuthUrl <OPENSTACK SWIFT AUTHURL>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--osSwiftUrl <OPENSTACK SWIFT SWIFTURL>',\n '(Required for OpenStack) specify when --publisher-type openStackSwift',\n )\n .option(\n '--gcsBucketRootPath <GCS BUCKET ROOT PATH>',\n 'Optional sub-directory to store files in Google cloud storage',\n )\n .option(\n '--directory <PATH>',\n 'Path of the directory containing generated files to publish',\n './site/',\n )\n .action(lazy(() => import('./publish/publish').then(m => m.default)));\n\n program\n .command('serve:mkdocs')\n .description('Serve a documentation project locally using MkDocs serve.')\n .option(\n '-i, --docker-image <DOCKER_IMAGE>',\n 'The mkdocs docker container to use',\n defaultDockerImage,\n )\n .option(\n '--docker-entrypoint <DOCKER_ENTRYPOINT>',\n 'Override the image entrypoint',\n )\n .option(\n '--docker-option <DOCKER_OPTION...>',\n 'Extra options to pass to the docker run command, e.g. \"--add-host=internal.host:192.168.11.12\" (can be added multiple times).',\n )\n .option(\n '--no-docker',\n 'Do not use Docker, run `mkdocs serve` in current user environment.',\n )\n .option(\n '--site-name',\n 'Name for site when using default MkDocs config',\n 'Documentation Site',\n )\n .option('-p, --port <PORT>', 'Port to serve documentation locally', '8000')\n .option('-v --verbose', 'Enable verbose output.', false)\n .action(lazy(() => import('./serve/mkdocs').then(m => m.default)));\n\n program\n .command('serve')\n .description(\n 'Serve a documentation project locally in a Backstage app-like environment',\n )\n .option(\n '-i, --docker-image <DOCKER_IMAGE>',\n 'The mkdocs docker container to use',\n defaultDockerImage,\n )\n .option(\n '--docker-entrypoint <DOCKER_ENTRYPOINT>',\n 'Override the image entrypoint',\n )\n .option(\n '--docker-option <DOCKER_OPTION...>',\n 'Extra options to pass to the docker run command, e.g. \"--add-host=internal.host:192.168.11.12\" (can be added multiple times).',\n )\n .option(\n '--no-docker',\n 'Do not use Docker, use MkDocs executable in current user environment.',\n )\n .option(\n '--site-name',\n 'Name for site when using default MkDocs config',\n 'Documentation Site',\n )\n .option('--mkdocs-port <PORT>', 'Port for MkDocs server to use', '8000')\n .option('-v --verbose', 'Enable verbose output.', false)\n .option(\n '--preview-app-bundle-path <PATH_TO_BUNDLE>',\n 'Preview documentation using another web app',\n )\n .option(\n '--preview-app-port <PORT>',\n 'Port for the preview app to be served on',\n defaultPreviewAppPort,\n )\n .hook('preAction', command => {\n if (\n command.opts().previewAppPort !== defaultPreviewAppPort &&\n !command.opts().previewAppBundlePath\n ) {\n command.error(\n '--preview-app-port can only be used together with --preview-app-bundle-path',\n );\n }\n })\n .action(lazy(() => import('./serve/serve').then(m => m.default)));\n}\n\n// Wraps an action function so that it always exits and handles errors\n// Humbly taken from backstage-cli's registerCommands\nfunction lazy(\n getActionFunc: () => Promise<(...args: any[]) => Promise<void>>,\n): (...args: any[]) => Promise<never> {\n return async (...args: any[]) => {\n try {\n const actionFunc = await getActionFunc();\n await actionFunc(...args);\n process.exit(0);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error.message);\n process.exit(1);\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 { program } from 'commander';\nimport { registerCommands } from './commands';\nimport { version } from '../package.json';\n\nconst main = (argv: string[]) => {\n program.name('techdocs-cli').version(version);\n\n registerCommands(program);\n\n program.parse(argv);\n};\n\nmain(process.argv);\n"],"names":["TechdocsGenerator","program"],"mappings":";;;;;AAmBA,MAAM,qBAAqBA,oCAAkB,CAAA,kBAAA,CAAA;AAC7C,MAAM,qBAAwB,GAAA,MAAA,CAAA;AAEvB,SAAS,iBAAiB,OAAkB,EAAA;AACjD,EAAA,OAAA,CACG,OAAQ,CAAA,UAAU,CAClB,CAAA,WAAA,CAAY,oDAAoD,CAChE,CAAA,MAAA;AAAA,IACC,qBAAA;AAAA,IACA,6DAAA;AAAA,IACA,GAAA;AAAA,GAED,CAAA,MAA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AAgB,KAAA;AAC/B,IAAI,IAAA;AACF,MAAM,MAAA,UAAA,GAAa,MAAM,aAAc,EAAA,CAAA;AACvC,MAAM,MAAA,UAAA,CAAW,GAAG,IAAI,CAAA,CAAA;AACxB,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA,CAAA;AAAA,aACP,KAAP,EAAA;AAEA,MAAQ,OAAA,CAAA,KAAA,CAAM,MAAM,OAAO,CAAA,CAAA;AAC3B,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA,CAAA;AAAA,KAChB;AAAA,GACF,CAAA;AACF;;;;ACnSA,MAAM,IAAA,GAAO,CAAC,IAAmB,KAAA;AAC/B,EAAAC,iBAAA,CAAQ,IAAK,CAAA,cAAc,CAAE,CAAA,OAAA,CAAQ,OAAO,CAAA,CAAA;AAE5C,EAAA,gBAAA,CAAiBA,iBAAO,CAAA,CAAA;AAExB,EAAAA,iBAAA,CAAQ,MAAM,IAAI,CAAA,CAAA;AACpB,CAAA,CAAA;AAEA,IAAA,CAAK,QAAQ,IAAI,CAAA;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techdocs/cli",
|
|
3
3
|
"description": "Utility CLI for managing TechDocs sites in Backstage.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0-next.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"techdocs-cli": "bin/techdocs-cli"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@backstage/cli": "^0.22.4-next.
|
|
39
|
+
"@backstage/cli": "^0.22.4-next.1",
|
|
40
40
|
"@frsource/cypress-plugin-visual-regression-diff": "^3.2.8",
|
|
41
41
|
"@types/commander": "^2.12.2",
|
|
42
42
|
"@types/fs-extra": "^9.0.6",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"ext": "ts"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@backstage/backend-common": "^0.18.3-next.
|
|
64
|
-
"@backstage/catalog-model": "^1.2.1-next.
|
|
65
|
-
"@backstage/cli-common": "^0.1.
|
|
66
|
-
"@backstage/config": "^1.0.
|
|
67
|
-
"@backstage/plugin-techdocs-node": "^1.
|
|
63
|
+
"@backstage/backend-common": "^0.18.3-next.2",
|
|
64
|
+
"@backstage/catalog-model": "^1.2.1-next.1",
|
|
65
|
+
"@backstage/cli-common": "^0.1.12-next.0",
|
|
66
|
+
"@backstage/config": "^1.0.7-next.0",
|
|
67
|
+
"@backstage/plugin-techdocs-node": "^1.6.0-next.2",
|
|
68
68
|
"@types/dockerode": "^3.3.0",
|
|
69
69
|
"commander": "^9.1.0",
|
|
70
70
|
"dockerode": "^3.3.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-8f4ae280.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 getMkdocsYml,\n} from '@backstage/plugin-techdocs-node';\nimport {\n ContainerRunner,\n DockerContainerRunner,\n} 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 { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n sourceDir,\n );\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: opts.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n legacyCopyReadmeMdToIndexMd,\n omitTechdocsCorePlugin,\n },\n },\n },\n });\n\n // Docker client (conditionally) used by the generators, based on techdocs.generators config.\n let containerRunner: ContainerRunner | undefined;\n\n if (opts.docker) {\n const dockerClient = new Docker();\n containerRunner = new DockerContainerRunner({ dockerClient });\n }\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 siteOptions: { name: opts.siteName },\n });\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","getMkdocsYml","config","ConfigReader","Docker","DockerContainerRunner","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","stdout"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,eAA8B,SAAS,IAAoB,EAAA;AAKzD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,SAAA,GAAYC,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAM,MAAA,SAAA,GAAYA,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,yBAAyB,IAAK,CAAA,4BAAA,CAAA;AACpC,EAAA,MAAM,cAAc,IAAK,CAAA,WAAA,CAAA;AACzB,EAAA,MAAM,YAAY,IAAK,CAAA,IAAA,CAAA;AACvB,EAAA,MAAM,8BAA8B,IAAK,CAAA,2BAAA,CAAA;AAEzC,EAAO,MAAA,CAAA,IAAA,CAAK,oBAAoB,SAAW,CAAA,CAAA,CAAA,CAAA;AAC3C,EAAO,MAAA,CAAA,IAAA,CAAK,kCAAkC,SAAW,CAAA,CAAA,CAAA,CAAA;AAEzD,EAAA,MAAA,CAAO,QAAQ,iDAAiD,CAAA,CAAA;AAEhE,EAAM,MAAAC,sBAAA,CAAG,UAAU,SAAS,CAAA,CAAA;AAE5B,EAAA,MAAM,EAAE,IAAA,EAAM,aAAe,EAAA,iBAAA,KAAsB,MAAMC,+BAAA;AAAA,IACvD,SAAA;AAAA,GACF,CAAA;AAEA,EAAM,MAAAC,QAAA,GAAS,IAAIC,mBAAa,CAAA;AAAA,IAC9B,QAAU,EAAA;AAAA,MACR,SAAW,EAAA;AAAA,QACT,KAAA,EAAO,IAAK,CAAA,MAAA,GAAS,QAAW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AAA,CAAA;AAED,EAAA,IAAI,iBAAmB,EAAA;AACrB,IAAQ,OAAA,CAAA,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAGR,sBAAA,CAAA,MAAA,CAAO,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AAEA,EAAA,MAAA,CAAO,KAAK,OAAO,CAAA,CAAA;AACrB;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utility-8be2be15.cjs.js","sources":["../../../src/lib/utility.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 */\nimport {\n RemoteProtocol,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport * as winston from 'winston';\n\nexport const convertTechDocsRefToLocationAnnotation = (\n techdocsRef: string,\n): ParsedLocationAnnotation => {\n // Split on the first colon for the protocol and the rest after the first split\n // is the location.\n const [type, target] = techdocsRef.split(/:(.+)/) as [\n RemoteProtocol?,\n string?,\n ];\n\n if (!type || !target) {\n throw new Error(\n `Can not parse --techdocs-ref ${techdocsRef}. Should be of type HOST:URL.`,\n );\n }\n\n return { type, target };\n};\n\nexport const createLogger = ({\n verbose = false,\n}: {\n verbose: boolean;\n}): winston.Logger => {\n const logger = winston.createLogger({\n level: verbose ? 'verbose' : 'info',\n transports: [\n new winston.transports.Console({ format: winston.format.simple() }),\n ],\n });\n\n return logger;\n};\n"],"names":["winston"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBa,MAAA,sCAAA,GAAyC,CACpD,WAC6B,KAAA;AAG7B,EAAA,MAAM,CAAC,IAAM,EAAA,MAAM,CAAI,GAAA,WAAA,CAAY,MAAM,OAAO,CAAA,CAAA;AAKhD,EAAI,IAAA,CAAC,IAAQ,IAAA,CAAC,MAAQ,EAAA;AACpB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAgC,6BAAA,EAAA,WAAA,CAAA,6BAAA,CAAA;AAAA,KAClC,CAAA;AAAA,GACF;AAEA,EAAO,OAAA,EAAE,MAAM,MAAO,EAAA,CAAA;AACxB,EAAA;AAEO,MAAM,eAAe,CAAC;AAAA,EAC3B,OAAU,GAAA,KAAA;AACZ,CAEsB,KAAA;AACpB,EAAM,MAAA,MAAA,GAASA,mBAAQ,YAAa,CAAA;AAAA,IAClC,KAAA,EAAO,UAAU,SAAY,GAAA,MAAA;AAAA,IAC7B,UAAY,EAAA;AAAA,MACV,IAAIA,kBAAQ,CAAA,UAAA,CAAW,OAAQ,CAAA,EAAE,QAAQA,kBAAQ,CAAA,MAAA,CAAO,MAAO,EAAA,EAAG,CAAA;AAAA,KACpE;AAAA,GACD,CAAA,CAAA;AAED,EAAO,OAAA,MAAA,CAAA;AACT;;;;;"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1032,732],{81032:function(y,i,n){n.r(i),n.d(i,{DependsOnResourcesCard:function(){return s}});var e=n(52322),c=n(25271),t=n(2784),r=n(732);function s(u){const{variant:a="gridItem"}=u;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:a,title:"Depends on resources",entityKind:"Resource",relationType:c.nP,columns:r.resourceEntityColumns,emptyMessage:"No resource is a dependency of this component",emptyHelpLink:r.componentEntityHelpLink,asRenderableEntities:r.asResourceEntities})}},732:function(y,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return u},asComponentEntities:function(){return f},asResourceEntities:function(){return h},asSystemEntities:function(){return g},componentEntityColumns:function(){return a},componentEntityHelpLink:function(){return p},resourceEntityColumns:function(){return C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return R}});var e=n(52322),c=n(90436),t=n(40303),r=n(2784),s=n(23196);function u(o){const{variant:l="gridItem",title:m,columns:j,entityKind:x,relationType:L,emptyMessage:k,emptyHelpLink:H,asRenderableEntities:D}=o,{entity:K}=(0,t.X2)(),{entities:S,loading:M,error:d}=(0,t.eK)(K,{type:L,kind:x});return M?(0,e.jsx)(s.rJ,{variant:l,title:m,children:(0,e.jsx)(s.Ex,{})}):d?(0,e.jsx)(s.rJ,{variant:l,title:m,children:(0,e.jsx)(s.Gk,{error:d})}):(0,e.jsx)(t.u3,{title:m,variant:l,emptyContent:(0,e.jsxs)("div",{style:{textAlign:"center"},children:[(0,e.jsx)(c.Z,{variant:"body1",children:k}),(0,e.jsx)(c.Z,{variant:"body2",children:(0,e.jsx)(s.rU,{to:H,children:"Learn how to change this."})})]}),columns:j,entities:D(S||[])})}const a=[t.u3.columns.createEntityRefColumn({defaultKind:"component"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],p="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",f=o=>o,C=[t.u3.columns.createEntityRefColumn({defaultKind:"resource"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],E="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",h=o=>o,v=[t.u3.columns.createEntityRefColumn({defaultKind:"system"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createMetadataDescriptionColumn()],R="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",g=o=>o}}]);})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=1032.91b320eb.chunk.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[7670],{27670:function(v,n,e){e.r(n),e.d(n,{CatalogSearchResultListItem:function(){return g}});var s=e(52322),u=e(2784),d=e(79692),r=e(86136),m=e(49378),h=e(95544),c=e(7089),x=e(23196),o=e(15096);const f=(0,d.Z)({item:{},flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}},{name:"CatalogSearchResultListItem"});function g(a){const l=a.result,t=a.highlight,i=f();return l?(0,s.jsxs)("div",{className:i.item,children:[a.icon&&(0,s.jsx)(r.Z,{children:typeof a.icon=="function"?a.icon(l):a.icon}),(0,s.jsxs)("div",{className:i.flexContainer,children:[(0,s.jsx)(m.Z,{className:i.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,s.jsx)(x.rU,{noTrack:!0,to:l.location,children:t!=null&&t.fields.title?(0,s.jsx)(o.FA,{text:t.fields.title,preTag:t.preTag,postTag:t.postTag}):l.title}),secondary:t!=null&&t.fields.text?(0,s.jsx)(o.FA,{text:t.fields.text,preTag:t.preTag,postTag:t.postTag}):l.text}),(0,s.jsxs)(h.Z,{children:[l.kind&&(0,s.jsx)(c.Z,{label:`Kind: ${l.kind}`,size:"small"}),l.lifecycle&&(0,s.jsx)(c.Z,{label:`Lifecycle: ${l.lifecycle}`,size:"small"})]})]})]}):null}}}]);})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=7670.433cf15c.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/7670.433cf15c.chunk.js","mappings":"yTA+BA,MAAMA,KAAYC,EAAAA,GAChB,CACEC,KAAM,CAAC,EACPC,cAAe,CACbC,SAAU,MACZ,EACAC,SAAU,CACRC,MAAO,OACPC,UAAW,YACXC,aAAc,MAChB,CACF,EACA,CAAEC,KAAM,6BAA8B,CAAC,EAgBlC,SAASC,EACdC,EACA,CACA,MAAMC,EAASD,EAAMC,OACfC,EAAYF,EAAME,UAElBC,EAAUd,EAAU,EAE1B,OAAKY,KAGH,QAACG,MAAAA,CAAIC,UAAWF,EAAQZ,K,UACrBS,EAAMM,SACL,OAACC,EAAAA,EAAYA,C,SACV,OAAOP,EAAMM,MAAS,WAAaN,EAAMM,KAAKL,CAAM,EAAID,EAAMM,I,MAGnE,QAACF,MAAAA,CAAIC,UAAWF,EAAQX,c,aACtB,OAACgB,EAAAA,EAAYA,CACXH,UAAWF,EAAQT,SACnBe,uBAAwB,CAAEC,QAAS,IAAK,EACxCC,WACE,OAACC,EAAAA,GAAIA,CAACC,QAAO,GAACC,GAAIb,EAAOc,S,SACtBb,GAAAA,MAAAA,EAAWc,OAAOC,SACjB,OAACC,EAAAA,GAA2BA,CAC1BC,KAAMjB,EAAUc,OAAOC,MACvBG,OAAQlB,EAAUkB,OAClBC,QAASnB,EAAUmB,O,GAGrBpB,EAAOgB,K,GAIbK,UACEpB,GAAAA,MAAAA,EAAWc,OAAOG,QAChB,OAACD,EAAAA,GAA2BA,CAC1BC,KAAMjB,EAAUc,OAAOG,KACvBC,OAAQlB,EAAUkB,OAClBC,QAASnB,EAAUmB,O,GAGrBpB,EAAOkB,I,MAIb,QAACI,EAAAA,EAAGA,C,UACDtB,EAAOuB,SAAQ,OAACC,EAAAA,EAAIA,CAACC,MAAO,SAASzB,EAAOuB,OAAQG,KAAK,O,GACzD1B,EAAO2B,cACN,OAACH,EAAAA,EAAIA,CAACC,MAAO,cAAczB,EAAO2B,YAAaD,KAAK,O,YAzC1C,IA+CtB,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx"],"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 React, { ReactNode } from 'react';\nimport {\n Box,\n Chip,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\n\nconst useStyles = makeStyles(\n {\n item: {},\n flexContainer: {\n flexWrap: 'wrap',\n },\n itemText: {\n width: '100%',\n wordBreak: 'break-all',\n marginBottom: '1rem',\n },\n },\n { name: 'CatalogSearchResultListItem' },\n);\n\n/**\n * Props for {@link CatalogSearchResultListItem}.\n *\n * @public\n */\nexport interface CatalogSearchResultListItemProps {\n icon?: ReactNode | ((result: IndexableDocument) => ReactNode);\n result?: IndexableDocument;\n highlight?: ResultHighlight;\n rank?: number;\n}\n\n/** @public */\nexport function CatalogSearchResultListItem(\n props: CatalogSearchResultListItemProps,\n) {\n const result = props.result as any;\n const highlight = props.highlight as ResultHighlight;\n\n const classes = useStyles();\n\n if (!result) return null;\n\n return (\n <div className={classes.item}>\n {props.icon && (\n <ListItemIcon>\n {typeof props.icon === 'function' ? props.icon(result) : props.icon}\n </ListItemIcon>\n )}\n <div className={classes.flexContainer}>\n <ListItemText\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n primary={\n <Link noTrack to={result.location}>\n {highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={highlight.fields.title}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.title\n )}\n </Link>\n }\n secondary={\n highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={highlight.fields.text}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.text\n )\n }\n />\n <Box>\n {result.kind && <Chip label={`Kind: ${result.kind}`} size=\"small\" />}\n {result.lifecycle && (\n <Chip label={`Lifecycle: ${result.lifecycle}`} size=\"small\" />\n )}\n </Box>\n </div>\n </div>\n );\n}\n"],"names":["useStyles","makeStyles","item","flexContainer","flexWrap","itemText","width","wordBreak","marginBottom","name","CatalogSearchResultListItem","props","result","highlight","classes","div","className","icon","ListItemIcon","ListItemText","primaryTypographyProps","variant","primary","Link","noTrack","to","location","fields","title","HighlightedSearchResultText","text","preTag","postTag","secondary","Box","kind","Chip","label","size","lifecycle"],"sourceRoot":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[7750],{17750:function(N,r,t){t.r(r),t.d(r,{EntityLinksCard:function(){return k}});var n=t(52322),h=t(40303),c=t(52160),Z=t(2784),u=t(79692),v=t(90436),g=t(77277),m=t(23196);const y=`metadata:
|
|
2
|
-
name: example
|
|
3
|
-
links:
|
|
4
|
-
- url: https://dashboard.example.com
|
|
5
|
-
title: My Dashboard
|
|
6
|
-
icon: dashboard`,p=(0,u.Z)(a=>({code:{borderRadius:6,margin:`${a.spacing(2)}px 0px`,background:a.palette.type==="dark"?"#444":"#fff"}}),{name:"PluginCatalogEntityLinksEmptyState"});function f(){const a=p();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Z,{variant:"body1",children:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:a.code,children:(0,n.jsx)(m.Oi,{text:y,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(g.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional",children:"Read more"})]})}var x=t(24851),L=t(60871);const k=a=>{var o;const{cols:j=void 0,variant:S}=a,{entity:i}=(0,h.X2)(),E=(0,L.qD)();var e;const b=s=>s&&(e=E.getSystemIcon(s))!==null&&e!==void 0?e:c.Z,d=i==null||(o=i.metadata)===null||o===void 0?void 0:o.links;return(0,n.jsx)(m.rJ,{title:"Links",variant:S,children:!d||d.length===0?(0,n.jsx)(f,{}):(0,n.jsx)(x.s,{cols:j,items:d.map(({url:s,title:l,icon:C})=>({text:l!=null?l:s,href:s,Icon:b(C)}))})})}}}]);})();
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=7750.90d0b9bd.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/7750.90d0b9bd.chunk.js","mappings":"mSAqBA,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA,uBAUdC,KAAYC,EAAAA,GAChBC,IAAU,CACRC,KAAM,CACJC,aAAc,EACdC,OAAQ,GAAGH,EAAMI,QAAQ,CAAC,UAC1BC,WAAYL,EAAMM,QAAQC,OAAS,OAAS,OAAS,MACvD,CACF,GACA,CAAEC,KAAM,oCAAqC,CAAC,EAGzC,SAASC,GAAwB,CACtC,MAAMC,EAAUZ,EAAU,EAE1B,SACE,oB,aACE,OAACa,EAAAA,EAAUA,CAACC,QAAQ,Q,SAAQ,oH,MAI5B,OAACC,MAAAA,CAAIC,UAAWJ,EAAQT,K,YACtB,OAACc,EAAAA,GAAWA,CACVC,KAAMnB,EACNoB,SAAS,OACTC,gBAAe,GACfC,mBAAoB,CAAC,EAAG,EAAG,EAAG,C,EAC9BC,YAAa,CAAEf,WAAY,UAAWgB,SAAU,MAAO,C,QAG3D,OAACC,EAAAA,EAAMA,CACLV,QAAQ,YACRW,MAAM,UACNC,OAAO,SACPC,KAAK,uF,SACN,W,KAKP,C,0BCvCO,MAAMC,EAAmBC,GAAgC,C,IAQhDC,EAPd,KAAM,CAAEC,KAAAA,EAAOC,OAAWlB,QAAAA,CAAQ,EAAIe,EAChC,CAAEC,OAAAA,CAAO,KAAIG,EAAAA,IAAU,EACvBC,KAAMC,EAAAA,IAAO,E,IAGXD,EADR,MAAME,EAAgBC,GACpBA,IAAMH,EAAAA,EAAII,cAAcD,CAAG,KAAHA,MAAlBH,IAAAA,OAAAA,EAAyCK,EAAAA,EAE3CC,EAAQV,GAAAA,OAAAA,EAAAA,EAAQW,YAAQ,MAAhBX,IAAAA,OAAAA,OAAAA,EAAkBU,MAEhC,SACE,OAACE,EAAAA,GAAQA,CAACC,MAAM,QAAQ7B,QAASA,E,SAC9B,CAAC0B,GAASA,EAAMI,SAAW,KAC1B,OAACjC,EAAqBA,CAAAA,CAAAA,KAEtB,OAACkC,EAAAA,EAAaA,CACZd,KAAMA,EACNe,MAAON,EAAMO,IAAI,CAAC,CAAEC,IAAAA,EAAKL,MAAAA,EAAOM,KAAAA,CAAK,KAAO,CAC1C/B,KAAMyB,GAAAA,KAAAA,EAASK,EACfrB,KAAMqB,EACNE,KAAMd,EAAaa,CAAI,CACzB,EAAE,C,IAKZ,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"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 { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: `${theme.spacing(2)}px 0px`,\n background: theme.palette.type === 'dark' ? '#444' : '#fff',\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["ENTITY_YAML","useStyles","makeStyles","theme","code","borderRadius","margin","spacing","background","palette","type","name","EntityLinksEmptyState","classes","Typography","variant","div","className","CodeSnippet","text","language","showLineNumbers","highlightedNumbers","customStyle","fontSize","Button","color","target","href","EntityLinksCard","props","entity","cols","undefined","useEntity","app","useApp","iconResolver","key","getSystemIcon","LanguageIcon","links","metadata","InfoCard","title","length","LinksGridList","items","map","url","icon","Icon"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[9545,732],{19545:function(y,i,n){n.r(i),n.d(i,{DependsOnComponentsCard:function(){return o}});var e=n(52322),r=n(25271),t=n(2784),c=n(732);function o(a){const{variant:u="gridItem",title:l="Depends on components"}=a;return(0,e.jsx)(c.RelatedEntitiesCard,{variant:u,title:l,entityKind:"Component",relationType:r.nP,columns:c.componentEntityColumns,emptyMessage:"No component is a dependency of this component",emptyHelpLink:c.componentEntityHelpLink,asRenderableEntities:c.asComponentEntities})}},732:function(y,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return a},asComponentEntities:function(){return f},asResourceEntities:function(){return h},asSystemEntities:function(){return j},componentEntityColumns:function(){return u},componentEntityHelpLink:function(){return l},resourceEntityColumns:function(){return C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return g}});var e=n(52322),r=n(90436),t=n(40303),c=n(2784),o=n(23196);function a(s){const{variant:m="gridItem",title:d,columns:x,entityKind:L,relationType:R,emptyMessage:k,emptyHelpLink:H,asRenderableEntities:D}=s,{entity:K}=(0,t.X2)(),{entities:S,loading:M,error:p}=(0,t.eK)(K,{type:R,kind:L});return M?(0,e.jsx)(o.rJ,{variant:m,title:d,children:(0,e.jsx)(o.Ex,{})}):p?(0,e.jsx)(o.rJ,{variant:m,title:d,children:(0,e.jsx)(o.Gk,{error:p})}):(0,e.jsx)(t.u3,{title:d,variant:m,emptyContent:(0,e.jsxs)("div",{style:{textAlign:"center"},children:[(0,e.jsx)(r.Z,{variant:"body1",children:k}),(0,e.jsx)(r.Z,{variant:"body2",children:(0,e.jsx)(o.rU,{to:H,children:"Learn how to change this."})})]}),columns:x,entities:D(S||[])})}const u=[t.u3.columns.createEntityRefColumn({defaultKind:"component"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",f=s=>s,C=[t.u3.columns.createEntityRefColumn({defaultKind:"resource"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],E="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",h=s=>s,v=[t.u3.columns.createEntityRefColumn({defaultKind:"system"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createMetadataDescriptionColumn()],g="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",j=s=>s}}]);})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=9545.27f02c72.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/9545.27f02c72.chunk.js","mappings":"iQAgCO,SAASA,EAAwBC,EAAqC,CAC3E,KAAM,CAAEC,QAAAA,EAAU,WAAYC,MAAAA,EAAQ,uBAAwB,EAAIF,EAClE,SACE,OAACG,E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AA,GAAAA,QAAAA,0BAA8C,EAC9CA,EAAAA,GAAAA,QAAAA,gCAAoD,C,EAEzCd,EACX,uFACWE,EAAuBG,GAClCA,EAEWkB,EAAuD,CAClET,EAAAA,GAAAA,QAAAA,sBAA0C,CAAEQ,YAAa,UAAW,CAAC,EACrER,EAAAA,GAAAA,QAAAA,kBAAsC,EACtCA,EAAAA,GAAAA,QAAAA,qBAAyC,EACzCA,EAAAA,GAAAA,QAAAA,0BAA8C,EAC9CA,EAAAA,GAAAA,QAAAA,gCAAoD,C,EAEzCU,EACX,sFACWC,EAAsBpB,GACjCA,EAEWqB,EAAmD,CAC9DZ,EAAAA,GAAAA,QAAAA,sBAA0C,CAAEQ,YAAa,QAAS,CAAC,EACnER,EAAAA,GAAAA,QAAAA,kBAAsC,EACtCA,EAAAA,GAAAA,QAAAA,gCAAoD,C,EAEzCa,EACX,oFACWC,EAAoBvB,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/DependsOnComponentsCard/DependsOnComponentsCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/presets.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 { RELATION_DEPENDS_ON } from '@backstage/catalog-model';\nimport { InfoCardVariants } from '@backstage/core-components';\nimport React from 'react';\nimport {\n asComponentEntities,\n componentEntityColumns,\n componentEntityHelpLink,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface DependsOnComponentsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nexport function DependsOnComponentsCard(props: DependsOnComponentsCardProps) {\n const { variant = 'gridItem', title = 'Depends on components' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Component\"\n relationType={RELATION_DEPENDS_ON}\n columns={componentEntityColumns}\n emptyMessage=\"No component is a dependency of this component\"\n emptyHelpLink={componentEntityHelpLink}\n asRenderableEntities={asComponentEntities}\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 { Entity } from '@backstage/catalog-model';\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 InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n TableColumn,\n} from '@backstage/core-components';\n\n/** @public */\nexport type RelatedEntitiesCardProps<T extends Entity> = {\n variant?: InfoCardVariants;\n title: string;\n columns: TableColumn<T>[];\n entityKind?: string;\n relationType: string;\n emptyMessage: string;\n emptyHelpLink: string;\n asRenderableEntities: (entities: Entity[]) => T[];\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<T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\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 <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard variant={variant} title={title}>\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">{emptyMessage}</Typography>\n <Typography variant=\"body2\">\n <Link to={emptyHelpLink}>Learn how to change this.</Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={asRenderableEntities(entities || [])}\n />\n );\n}\n","/*\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 */\nimport {\n ComponentEntity,\n Entity,\n ResourceEntity,\n SystemEntity,\n} from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport { TableColumn } from '@backstage/core-components';\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\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: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities: Entity[]): ComponentEntity[] =>\n entities as ComponentEntity[];\n\nexport const resourceEntityColumns: TableColumn<ResourceEntity>[] = [\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: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities: Entity[]): ResourceEntity[] =>\n entities as ResourceEntity[];\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities: Entity[]): SystemEntity[] =>\n entities as SystemEntity[];\n"],"names":["DependsOnComponentsCard","props","variant","title","RelatedEntitiesCard","entityKind","relationType","RELATION_DEPENDS_ON","columns","componentEntityColumns","emptyMessage","emptyHelpLink","componentEntityHelpLink","asRenderableEntities","asComponentEntities","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","defaultKind","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
|