@techdocs/cli 1.4.3 → 1.4.4
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 +22 -0
- package/dist/cjs/{PublisherConfig-a2649fb7.cjs.js → PublisherConfig-cbad5748.cjs.js} +11 -5
- package/dist/cjs/{PublisherConfig-a2649fb7.cjs.js.map → PublisherConfig-cbad5748.cjs.js.map} +1 -1
- package/dist/cjs/generate-d9c4c0d9.cjs.js.map +1 -1
- package/dist/cjs/{migrate-32510d4d.cjs.js → migrate-6884188f.cjs.js} +2 -2
- package/dist/cjs/{migrate-32510d4d.cjs.js.map → migrate-6884188f.cjs.js.map} +1 -1
- package/dist/cjs/mkdocs-582c42fd.cjs.js.map +1 -1
- package/dist/cjs/mkdocsServer-99ec8af2.cjs.js.map +1 -1
- package/dist/cjs/{publish-2c1fe164.cjs.js → publish-009fdf9f.cjs.js} +2 -2
- package/dist/cjs/{publish-2c1fe164.cjs.js.map → publish-009fdf9f.cjs.js.map} +1 -1
- package/dist/cjs/{serve-461aaf60.cjs.js → serve-552eaafd.cjs.js} +12 -1
- package/dist/cjs/{serve-461aaf60.cjs.js.map → serve-552eaafd.cjs.js.map} +1 -1
- package/dist/cjs/utility-3c0df5a9.cjs.js.map +1 -1
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/1032.5be56bbf.chunk.js +3 -0
- package/dist/embedded-app/static/1032.5be56bbf.chunk.js.map +1 -0
- package/dist/embedded-app/static/{1049.fc74e20d.chunk.js → 1049.e59b8f46.chunk.js} +1 -1
- package/dist/embedded-app/static/{1049.fc74e20d.chunk.js.map → 1049.e59b8f46.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js +3 -0
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js.map +1 -0
- package/dist/embedded-app/static/184.78d680e0.chunk.js +3 -0
- package/dist/embedded-app/static/184.78d680e0.chunk.js.map +1 -0
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js +3 -0
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js.map +1 -0
- package/dist/embedded-app/static/5458.4a158b26.chunk.js +3 -0
- package/dist/embedded-app/static/5458.4a158b26.chunk.js.map +1 -0
- package/dist/embedded-app/static/6051.e6ab645f.chunk.js +4 -0
- package/dist/embedded-app/static/6051.e6ab645f.chunk.js.map +1 -0
- package/dist/embedded-app/static/732.fb0762a2.chunk.js +3 -0
- package/dist/embedded-app/static/732.fb0762a2.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7560.f715d7bd.chunk.js → 7560.8ef9e30a.chunk.js} +1 -1
- package/dist/embedded-app/static/7560.8ef9e30a.chunk.js.map +1 -0
- package/dist/embedded-app/static/7670.714e8960.chunk.js +3 -0
- package/dist/embedded-app/static/7670.714e8960.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7750.5d194dad.chunk.js → 7750.1b5340d0.chunk.js} +3 -3
- package/dist/embedded-app/static/7750.1b5340d0.chunk.js.map +1 -0
- package/dist/embedded-app/static/{8951.36f657ca.chunk.js → 8951.fea20091.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.36f657ca.chunk.js.map → 8951.fea20091.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.9cac24aa.chunk.js → 9323.61727faa.chunk.js} +1 -1
- package/dist/embedded-app/static/9323.61727faa.chunk.js.map +1 -0
- package/dist/embedded-app/static/9545.dea948d9.chunk.js +3 -0
- package/dist/embedded-app/static/9545.dea948d9.chunk.js.map +1 -0
- package/dist/embedded-app/static/9770.1e5df227.chunk.js +3 -0
- package/dist/embedded-app/static/9770.1e5df227.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.fef15b74.js +522 -0
- package/dist/embedded-app/static/main.fef15b74.js.map +1 -0
- package/dist/embedded-app/static/{module-material-table.e97c8359.js → module-material-table.1d463a12.js} +2 -2
- package/dist/embedded-app/static/{module-material-table.e97c8359.js.map → module-material-table.1d463a12.js.map} +1 -1
- package/dist/embedded-app/static/module-material-ui.1afbaa53.js +51 -0
- package/dist/embedded-app/static/module-material-ui.1afbaa53.js.map +1 -0
- package/dist/embedded-app/static/{module-octokit.a126d1a6.js → module-octokit.7416db07.js} +3 -3
- package/dist/embedded-app/static/{module-octokit.a126d1a6.js.map → module-octokit.7416db07.js.map} +1 -1
- package/dist/embedded-app/static/{module-react-beautiful-dnd.c3c3faee.js → module-react-beautiful-dnd.ad887878.js} +2 -2
- package/dist/embedded-app/static/{module-react-beautiful-dnd.c3c3faee.js.map → module-react-beautiful-dnd.ad887878.js.map} +1 -1
- package/dist/embedded-app/static/{module-react-dom.d698fbed.js → module-react-dom.bd3fd0c6.js} +1 -1
- package/dist/embedded-app/static/{module-react-dom.d698fbed.js.map → module-react-dom.bd3fd0c6.js.map} +1 -1
- package/dist/embedded-app/static/{module-react-router-dom.cf49e816.js → module-react-router-dom.ef191c8f.js} +1 -1
- package/dist/embedded-app/static/{module-react-router-dom.cf49e816.js.map → module-react-router-dom.ef191c8f.js.map} +1 -1
- package/dist/embedded-app/static/{module-react-router.a589137b.js → module-react-router.d2e96318.js} +1 -1
- package/dist/embedded-app/static/{module-react-router.a589137b.js.map → module-react-router.d2e96318.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.6328c68d.js → runtime.fef15b74.js} +2 -2
- package/dist/embedded-app/static/{runtime.6328c68d.js.map → runtime.fef15b74.js.map} +1 -1
- package/dist/embedded-app/static/vendor.fef15b74.js +212 -0
- package/dist/embedded-app/static/vendor.fef15b74.js.map +1 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/1032.be408b83.chunk.js +0 -3
- package/dist/embedded-app/static/1032.be408b83.chunk.js.map +0 -1
- package/dist/embedded-app/static/1105.c65d4e64.chunk.js +0 -3
- package/dist/embedded-app/static/1105.c65d4e64.chunk.js.map +0 -1
- package/dist/embedded-app/static/184.a8ac59c2.chunk.js +0 -3
- package/dist/embedded-app/static/184.a8ac59c2.chunk.js.map +0 -1
- package/dist/embedded-app/static/2440.b8e50edb.chunk.js +0 -3
- package/dist/embedded-app/static/2440.b8e50edb.chunk.js.map +0 -1
- package/dist/embedded-app/static/5458.38a11fde.chunk.js +0 -3
- package/dist/embedded-app/static/5458.38a11fde.chunk.js.map +0 -1
- package/dist/embedded-app/static/6051.098a0af9.chunk.js +0 -4
- package/dist/embedded-app/static/6051.098a0af9.chunk.js.map +0 -1
- package/dist/embedded-app/static/732.bb820d6a.chunk.js +0 -3
- package/dist/embedded-app/static/732.bb820d6a.chunk.js.map +0 -1
- package/dist/embedded-app/static/7560.f715d7bd.chunk.js.map +0 -1
- package/dist/embedded-app/static/7670.f17f89be.chunk.js +0 -3
- package/dist/embedded-app/static/7670.f17f89be.chunk.js.map +0 -1
- package/dist/embedded-app/static/7750.5d194dad.chunk.js.map +0 -1
- package/dist/embedded-app/static/9323.9cac24aa.chunk.js.map +0 -1
- package/dist/embedded-app/static/9545.3dc1ecf9.chunk.js +0 -3
- package/dist/embedded-app/static/9545.3dc1ecf9.chunk.js.map +0 -1
- package/dist/embedded-app/static/9770.c98e9dad.chunk.js +0 -3
- package/dist/embedded-app/static/9770.c98e9dad.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.6328c68d.js +0 -522
- package/dist/embedded-app/static/main.6328c68d.js.map +0 -1
- package/dist/embedded-app/static/module-material-ui.09dab505.js +0 -51
- package/dist/embedded-app/static/module-material-ui.09dab505.js.map +0 -1
- package/dist/embedded-app/static/vendor.6328c68d.js +0 -212
- package/dist/embedded-app/static/vendor.6328c68d.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -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/migrate-
|
|
86
|
+
).option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/migrate-6884188f.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(
|
|
@@ -139,7 +139,7 @@ function registerCommands(program) {
|
|
|
139
139
|
"--directory <PATH>",
|
|
140
140
|
"Path of the directory containing generated files to publish",
|
|
141
141
|
"./site/"
|
|
142
|
-
).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/publish-
|
|
142
|
+
).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/publish-009fdf9f.cjs.js'); }).then((m) => m.default)));
|
|
143
143
|
program.command("serve:mkdocs").description("Serve a documentation project locally using MkDocs serve.").option(
|
|
144
144
|
"-i, --docker-image <DOCKER_IMAGE>",
|
|
145
145
|
"The mkdocs docker container to use",
|
|
@@ -190,7 +190,7 @@ function registerCommands(program) {
|
|
|
190
190
|
"--preview-app-port can only be used together with --preview-app-bundle-path"
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
|
-
}).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/serve-
|
|
193
|
+
}).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/serve-552eaafd.cjs.js'); }).then((m) => m.default)));
|
|
194
194
|
}
|
|
195
195
|
function lazy(getActionFunc) {
|
|
196
196
|
return async (...args) => {
|
|
@@ -205,7 +205,7 @@ function lazy(getActionFunc) {
|
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
var version = "1.4.
|
|
208
|
+
var version = "1.4.4";
|
|
209
209
|
|
|
210
210
|
const main = (argv) => {
|
|
211
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(\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,MAAA;AAAA,IACC,qBAAA;AAAA,IACA,sDAAA;AAAA,IACA,SAAA;AAAA,GAED,CAAA,MAAA;AAAA,IACC,+BAAA;AAAA,IACA,oCAAA;AAAA,IACA,kBAAA;AAAA,GAED,CAAA,MAAA,CAAO,WAAa,EAAA,qCAAqC,CACzD,CAAA,MAAA;AAAA,IACC,aAAA;AAAA,IACA,mFAAA;AAAA,GAED,CAAA,MAAA;AAAA,IACC,gCAAA;AAAA,IACA,sTAAA;AAAA,GAID,CAAA,MAAA;AAAA,IACC,eAAA;AAAA,IACA,qHAAA;AAAA,GAED,CAAA,MAAA;AAAA,IACC,aAAA;AAAA,IACA,gDAAA;AAAA,IACA,oBAAA;AAAA,GAED,CAAA,MAAA,CAAO,cAAgB,EAAA,wBAAA,EAA0B,KAAK,CACtD,CAAA,MAAA;AAAA,IACC,gCAAA;AAAA,IACA,kEAAA;AAAA,IACA,KAAA;AAAA,GAED,CAAA,MAAA;AAAA,IACC,+BAAA;AAAA,IACA,qJAAA;AAAA,IACA,KAAA;AAAA,GAED,CAAA,KAAA,CAAM,OAAO,CAAA,CACb,OAAO,IAAK,CAAA,MAAM,oDAAO,gCAAqB,MAAE,IAAK,CAAA,CAAA,CAAA,KAAK,CAAE,CAAA,OAAO,CAAC,CAAC,CAAA,CAAA;AAExE,EACG,OAAA,CAAA,OAAA,CAAQ,SAAS,CACjB,CAAA,WAAA;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O,CAAA,cAAA,KAAmB,yBAClC,CAAC,OAAA,CAAQ,IAAK,EAAA,CAAE,oBAChB,EAAA;AACA,MAAQ,OAAA,CAAA,KAAA;AAAA,QACN,6EAAA;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CACA,MAAO,CAAA,IAAA,CAAK,MAAM,oDAAO,6BAAe,KAAA,CAAE,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;;;;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;;"}
|
|
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,MAA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A;AAAA,KACF;AAAA,GACD,CAAA,CACA,MAAO,CAAA,IAAA,CAAK,MAAM,oDAAO,6BAAe,KAAA,CAAE,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,KAAO,EAAA;AAEd,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.
|
|
4
|
+
"version": "1.4.4",
|
|
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.
|
|
39
|
+
"@backstage/cli": "^0.22.9",
|
|
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.19.
|
|
64
|
-
"@backstage/catalog-model": "^1.4.
|
|
63
|
+
"@backstage/backend-common": "^0.19.1",
|
|
64
|
+
"@backstage/catalog-model": "^1.4.1",
|
|
65
65
|
"@backstage/cli-common": "^0.1.12",
|
|
66
66
|
"@backstage/config": "^1.0.8",
|
|
67
|
-
"@backstage/plugin-techdocs-node": "^1.7.
|
|
67
|
+
"@backstage/plugin-techdocs-node": "^1.7.3",
|
|
68
68
|
"@types/dockerode": "^3.3.0",
|
|
69
69
|
"commander": "^9.1.0",
|
|
70
70
|
"dockerode": "^3.3.1",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1032,732],{81032:function(f,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",title:l="Depends on resources",columns:m=r.resourceEntityColumns}=u;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:a,title:l,entityKind:"Resource",relationType:c.nP,columns:m,emptyMessage:"No resource is a dependency of this component",emptyHelpLink:r.componentEntityHelpLink,asRenderableEntities:r.asResourceEntities})}},732:function(f,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return u},asComponentEntities:function(){return m},asResourceEntities:function(){return h},asSystemEntities:function(){return g},componentEntityColumns:function(){return a},componentEntityHelpLink:function(){return l},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(39709),r=n(2784),s=n(53974);function u(o){const{variant:d="gridItem",title:y,columns:j,entityKind:x,relationType:L,emptyMessage:k,emptyHelpLink:H,asRenderableEntities:D}=o,{entity:K}=(0,t.X2)(),{entities:S,loading:M,error:p}=(0,t.eK)(K,{type:L,kind:x});return M?(0,e.jsx)(s.rJ,{variant:d,title:y,children:(0,e.jsx)(s.Ex,{})}):p?(0,e.jsx)(s.rJ,{variant:d,title:y,children:(0,e.jsx)(s.Gk,{error:p})}):(0,e.jsx)(t.u3,{title:y,variant:d,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()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",m=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.be408b83.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/1032.be408b83.chunk.js","mappings":"gQAiCO,SAASA,EAAuBC,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,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtEV,EAAAA,GAAYtB,QAAQiC,kBAAkB,EACtCX,EAAAA,GAAYtB,QAAQkC,qBAAqB,EACzCZ,EAAAA,GAAYtB,QAAQmC,0BAA0B,EAC9Cb,EAAAA,GAAYtB,QAAQoC,gCAAgC,C,EAEzC5B,EACX,uFACW6B,EAAuBxB,GAClCA,EAEWZ,EAAuD,CAClEqB,EAAAA,GAAYtB,QAAQ+B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrEV,EAAAA,GAAYtB,QAAQiC,kBAAkB,EACtCX,EAAAA,GAAYtB,QAAQkC,qBAAqB,EACzCZ,EAAAA,GAAYtB,QAAQmC,0BAA0B,EAC9Cb,EAAAA,GAAYtB,QAAQoC,gCAAgC,C,EAEzCE,EACX,sFACW5B,EAAsBG,GACjCA,EAEW0B,EAAmD,CAC9DjB,EAAAA,GAAYtB,QAAQ+B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnEV,EAAAA,GAAYtB,QAAQiC,kBAAkB,EACtCX,EAAAA,GAAYtB,QAAQoC,gCAAgC,C,EAEzCI,EACX,oFACWC,EAAoB5B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/DependsOnResourcesCard/DependsOnResourcesCard.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, ResourceEntity } from '@backstage/catalog-model';\nimport { InfoCardVariants, TableColumn } from '@backstage/core-components';\nimport React from 'react';\nimport {\n asResourceEntities,\n componentEntityHelpLink,\n RelatedEntitiesCard,\n resourceEntityColumns,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface DependsOnResourcesCardProps {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ResourceEntity>[];\n}\n\nexport function DependsOnResourcesCard(props: DependsOnResourcesCardProps) {\n const {\n variant = 'gridItem',\n title = 'Depends on resources',\n columns = resourceEntityColumns,\n } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Resource\"\n relationType={RELATION_DEPENDS_ON}\n columns={columns}\n emptyMessage=\"No resource is a dependency of this component\"\n emptyHelpLink={componentEntityHelpLink}\n asRenderableEntities={asResourceEntities}\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":["DependsOnResourcesCard","props","variant","title","columns","resourceEntityColumns","RelatedEntitiesCard","entityKind","relationType","RELATION_DEPENDS_ON","emptyMessage","emptyHelpLink","componentEntityHelpLink","asRenderableEntities","asResourceEntities","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","componentEntityColumns","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","asComponentEntities","resourceEntityHelpLink","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1105,732],{1105:function(p,i,n){n.r(i),n.d(i,{HasComponentsCard:function(){return o}});var e=n(52322),c=n(25271),t=n(2784),r=n(732);function o(a){const{variant:u="gridItem"}=a;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:u,title:"Has components",entityKind:"Component",relationType:c.aS,columns:r.componentEntityColumns,emptyMessage:"No component is part of this system",emptyHelpLink:r.componentEntityHelpLink,asRenderableEntities:r.asComponentEntities})}},732:function(p,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 y},resourceEntityColumns:function(){return C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return g}});var e=n(52322),c=n(90436),t=n(39709),r=n(2784),o=n(53974);function a(s){const{variant:l="gridItem",title:m,columns:x,entityKind:H,relationType:L,emptyMessage:R,emptyHelpLink:k,asRenderableEntities:S}=s,{entity:K}=(0,t.X2)(),{entities:M,loading:T,error:d}=(0,t.eK)(K,{type:L,kind:H});return T?(0,e.jsx)(o.rJ,{variant:l,title:m,children:(0,e.jsx)(o.Ex,{})}):d?(0,e.jsx)(o.rJ,{variant:l,title:m,children:(0,e.jsx)(o.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:R}),(0,e.jsx)(c.Z,{variant:"body2",children:(0,e.jsx)(o.rU,{to:k,children:"Learn how to change this."})})]}),columns:x,entities:S(M||[])})}const u=[t.u3.columns.createEntityRefColumn({defaultKind:"component"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],y="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=1105.c65d4e64.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/1105.c65d4e64.chunk.js","mappings":"0PA+BO,SAASA,EAAkBC,EAA+B,CAC/D,KAAM,CAAEC,QAAAA,EAAU,UAAW,EAAID,EACjC,SACE,OAACE,EAAAA,oBAAmBA,CAClBD,QAASA,EACTE,MAAM,iBACNC,WAAW,YACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,uBACTC,aAAa,sCACbC,cAAeC,EAAAA,wBACfC,qBAAsBC,EAAAA,mB,EAG5B,C,mgBCYO,SAASX,EACdF,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVE,MAAAA,EACAI,QAAAA,EACAH,WAAAA,EACAC,aAAAA,EACAI,aAAAA,EACAC,cAAAA,EACAE,qBAAAA,CAAoB,EAClBZ,EAEE,CAAEc,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMf,EACNgB,KAAMjB,CACR,CAAC,EAED,OAAIa,KAEA,OAACK,EAAAA,GAAQA,CAACrB,QAASA,EAASE,MAAOA,E,YACjC,OAACoB,EAAAA,GAAQA,CAAAA,CAAAA,C,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","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.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_HAS_PART } 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 HasComponentsCardProps {\n variant?: InfoCardVariants;\n}\n\nexport function HasComponentsCard(props: HasComponentsCardProps) {\n const { variant = 'gridItem' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title=\"Has components\"\n entityKind=\"Component\"\n relationType={RELATION_HAS_PART}\n columns={componentEntityColumns}\n emptyMessage=\"No component is part of this system\"\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":["HasComponentsCard","props","variant","RelatedEntitiesCard","title","entityKind","relationType","RELATION_HAS_PART","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","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[184,732],{40184:function(y,i,n){n.r(i),n.d(i,{DependencyOfComponentsCard: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="Dependency of components"}=a;return(0,e.jsx)(c.RelatedEntitiesCard,{variant:u,title:l,entityKind:"Component",relationType:r.w$,columns:c.componentEntityColumns,emptyMessage:"No component depends on 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(39709),c=n(2784),o=n(53974);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=184.a8ac59c2.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/184.a8ac59c2.chunk.js","mappings":"mQAgCO,SAASA,EACdC,EAAsC,CAEtC,KAAM,CAAEC,QAAAA,EAAU,WAAYC,MAAAA,EAAQ,0BAA2B,EAAIF,EACrE,SACE,OAACG,EAAAA,oBAAmBA,CAClBF,QAASA,EACTC,MAAOA,EACPE,WAAW,YACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,uBACTC,aAAa,yCACbC,cAAeC,EAAAA,wBACfC,qBAAsBC,EAAAA,mB,EAG5B,C,mgBCSO,SAASV,EACdH,EAAkC,CAElC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AW,CAAC,EACrET,EAAAA,GAAYlB,QAAQ4B,kBAAkB,EACtCV,EAAAA,GAAYlB,QAAQ6B,qBAAqB,EACzCX,EAAAA,GAAYlB,QAAQ8B,0BAA0B,EAC9CZ,EAAAA,GAAYlB,QAAQ+B,gCAAgC,C,EAEzCE,EACX,sFACWC,EAAsBzB,GACjCA,EAEW0B,EAAmD,CAC9DjB,EAAAA,GAAYlB,QAAQ0B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnET,EAAAA,GAAYlB,QAAQ4B,kBAAkB,EACtCV,EAAAA,GAAYlB,QAAQ+B,gCAAgC,C,EAEzCK,EACX,oFACWC,EAAoB5B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.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_DEPENDENCY_OF } 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 DependencyOfComponentsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nexport function DependencyOfComponentsCard(\n props: DependencyOfComponentsCardProps,\n) {\n const { variant = 'gridItem', title = 'Dependency of components' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Component\"\n relationType={RELATION_DEPENDENCY_OF}\n columns={componentEntityColumns}\n emptyMessage=\"No component depends on 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":["DependencyOfComponentsCard","props","variant","title","RelatedEntitiesCard","entityKind","relationType","RELATION_DEPENDENCY_OF","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","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[2440,732],{82440:function(p,i,n){n.r(i),n.d(i,{HasSubcomponentsCard:function(){return o}});var e=n(52322),c=n(25271),t=n(2784),r=n(732);function o(a){const{variant:u="gridItem"}=a;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:u,title:"Has subcomponents",entityKind:"Component",relationType:c.aS,columns:r.componentEntityColumns,asRenderableEntities:r.asComponentEntities,emptyMessage:"No subcomponent is part of this component",emptyHelpLink:"https://backstage.io/docs/features/software-catalog/descriptor-format#specsubcomponentof-optional"})}},732:function(p,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 y},resourceEntityColumns:function(){return C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return g}});var e=n(52322),c=n(90436),t=n(39709),r=n(2784),o=n(53974);function a(s){const{variant:l="gridItem",title:m,columns:x,entityKind:H,relationType:L,emptyMessage:R,emptyHelpLink:k,asRenderableEntities:S}=s,{entity:b}=(0,t.X2)(),{entities:K,loading:M,error:d}=(0,t.eK)(b,{type:L,kind:H});return M?(0,e.jsx)(o.rJ,{variant:l,title:m,children:(0,e.jsx)(o.Ex,{})}):d?(0,e.jsx)(o.rJ,{variant:l,title:m,children:(0,e.jsx)(o.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:R}),(0,e.jsx)(c.Z,{variant:"body2",children:(0,e.jsx)(o.rU,{to:k,children:"Learn how to change this."})})]}),columns:x,entities:S(K||[])})}const u=[t.u3.columns.createEntityRefColumn({defaultKind:"component"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],y="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=2440.b8e50edb.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/2440.b8e50edb.chunk.js","mappings":"8PA8BO,SAASA,EAAqBC,EAAkC,CACrE,KAAM,CAAEC,QAAAA,EAAU,UAAW,EAAID,EACjC,SACE,OAACE,EAAAA,oBAAmBA,CAClBD,QAASA,EACTE,MAAM,oBACNC,WAAW,YACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,uBACTC,qBAAsBC,EAAAA,oBACtBC,aAAa,4CACbC,cAAc,mG,EAGpB,C,mgBCaO,SAASV,EACdF,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVE,MAAAA,EACAI,QAAAA,EACAH,WAAAA,EACAC,aAAAA,EACAM,aAAAA,EACAC,cAAAA,EACAH,qBAAAA,CAAoB,EAClBT,EAEE,CAAEa,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMd,EACNe,KAAMhB,CACR,CAAC,EAED,OAAIY,KAEA,OAACK,EAAAA,GAAQA,CAACpB,QAASA,EAASE,MAAOA,E,YACjC,OAACmB,EAAAA,GAAQA,CAAAA,CAAAA,C,GAKXL,KAEA,OAACI,EAAAA,GAAQA,CAACpB,QAASA,EAASE,MAAOA,E,YACjC,OAACoB,EAAAA,GAAkBA,CAACN,MAAOA,C,QAM/B,OAACO,EAAAA,GAAWA,CACVrB,MAAOA,EACPF,QAASA,EACTwB,gBACE,QAACC,MAAAA,CAAIC,MAAO,CAAEC,UAAW,QAAS,E,aAChC,OAACC,EAAAA,EAAUA,CAAC5B,QAAQ,Q,SAASU,C,MAC7B,OAACkB,EAAAA,EAAUA,CAAC5B,QAAQ,Q,YAClB,OAAC6B,EAAAA,GAAIA,CAACC,GAAInB,E,SAAe,2B,QAI/BL,QAASA,EACTQ,SAAUN,EAAqBM,GAAY,CAAC,CAAC,C,EAGnD,CCrFO,MAAMP,EAAyD,CACpEgB,EAAAA,GAAYjB,QAAQyB,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtET,EAAAA,GAAYjB,QAAQ2B,kBAAkB,EACtCV,EAAAA,GAAYjB,QAAQ4B,qBAAqB,EACzCX,EAAAA,GAAYjB,QAAQ6B,0BAA0B,EAC9CZ,EAAAA,GAAYjB,QAAQ8B,gCAAgC,C,EAEzCC,EACX,uFACW5B,EAAuBK,GAClCA,EAEWwB,EAAuD,CAClEf,EAAAA,GAAYjB,QAAQyB,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrET,EAAAA,GAAYjB,QAAQ2B,kBAAkB,EACtCV,EAAAA,GAAYjB,QAAQ4B,qBAAqB,EACzCX,EAAAA,GAAYjB,QAAQ6B,0BAA0B,EAC9CZ,EAAAA,GAAYjB,QAAQ8B,gCAAgC,C,EAEzCG,EACX,sFACWC,EAAsB1B,GACjCA,EAEW2B,EAAmD,CAC9DlB,EAAAA,GAAYjB,QAAQyB,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnET,EAAAA,GAAYjB,QAAQ2B,kBAAkB,EACtCV,EAAAA,GAAYjB,QAAQ8B,gCAAgC,C,EAEzCM,EACX,oFACWC,EAAoB7B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.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_HAS_PART } from '@backstage/catalog-model';\nimport { InfoCardVariants } from '@backstage/core-components';\nimport React from 'react';\nimport {\n asComponentEntities,\n componentEntityColumns,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface HasSubcomponentsCardProps {\n variant?: InfoCardVariants;\n}\n\nexport function HasSubcomponentsCard(props: HasSubcomponentsCardProps) {\n const { variant = 'gridItem' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title=\"Has subcomponents\"\n entityKind=\"Component\"\n relationType={RELATION_HAS_PART}\n columns={componentEntityColumns}\n asRenderableEntities={asComponentEntities}\n emptyMessage=\"No subcomponent is part of this component\"\n emptyHelpLink=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specsubcomponentof-optional\"\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":["HasSubcomponentsCard","props","variant","RelatedEntitiesCard","title","entityKind","relationType","RELATION_HAS_PART","columns","componentEntityColumns","asRenderableEntities","asComponentEntities","emptyMessage","emptyHelpLink","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","componentEntityHelpLink","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5458,732],{5458:function(y,i,n){n.r(i),n.d(i,{HasSystemsCard:function(){return s}});var e=n(52322),c=n(25271),t=n(2784),r=n(732);function s(a){const{variant:u="gridItem"}=a;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:u,title:"Has systems",entityKind:"System",relationType:c.aS,columns:r.systemEntityColumns,asRenderableEntities:r.asSystemEntities,emptyMessage:"No system is part of this domain",emptyHelpLink:r.systemEntityHelpLink})}},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 p},resourceEntityColumns:function(){return C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return g}});var e=n(52322),c=n(90436),t=n(39709),r=n(2784),s=n(53974);function a(o){const{variant:l="gridItem",title:m,columns:x,entityKind:H,relationType:L,emptyMessage:R,emptyHelpLink:S,asRenderableEntities:k}=o,{entity:K}=(0,t.X2)(),{entities:M,loading:T,error:d}=(0,t.eK)(K,{type:L,kind:H});return T?(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:R}),(0,e.jsx)(c.Z,{variant:"body2",children:(0,e.jsx)(s.rU,{to:S,children:"Learn how to change this."})})]}),columns:x,entities:k(M||[])})}const u=[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()],g="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",j=o=>o}}]);})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=5458.38a11fde.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/5458.38a11fde.chunk.js","mappings":"uPA+BO,SAASA,EAAeC,EAA4B,CACzD,KAAM,CAAEC,QAAAA,EAAU,UAAW,EAAID,EACjC,SACE,OAACE,EAAAA,oBAAmBA,CAClBD,QAASA,EACTE,MAAM,cACNC,WAAW,SACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,oBACTC,qBAAsBC,EAAAA,iBACtBC,aAAa,mCACbC,cAAeC,EAAAA,oB,EAGrB,C,mgBCYO,SAASX,EACdF,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVE,MAAAA,EACAI,QAAAA,EACAH,WAAAA,EACAC,aAAAA,EACAM,aAAAA,EACAC,cAAAA,EACAH,qBAAAA,CAAoB,EAClBT,EAEE,CAAEc,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMf,EACNgB,KAAMjB,CACR,CAAC,EAED,OA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YlB,QAAQ6B,kBAAkB,EACtCX,EAAAA,GAAYlB,QAAQgC,gCAAgC,C,EAEzC1B,EACX,oFACWH,EAAoBM,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.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_HAS_PART } from '@backstage/catalog-model';\nimport { InfoCardVariants } from '@backstage/core-components';\nimport React from 'react';\nimport {\n asSystemEntities,\n RelatedEntitiesCard,\n systemEntityColumns,\n systemEntityHelpLink,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface HasSystemsCardProps {\n variant?: InfoCardVariants;\n}\n\nexport function HasSystemsCard(props: HasSystemsCardProps) {\n const { variant = 'gridItem' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title=\"Has systems\"\n entityKind=\"System\"\n relationType={RELATION_HAS_PART}\n columns={systemEntityColumns}\n asRenderableEntities={asSystemEntities}\n emptyMessage=\"No system is part of this domain\"\n emptyHelpLink={systemEntityHelpLink}\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":["HasSystemsCard","props","variant","RelatedEntitiesCard","title","entityKind","relationType","RELATION_HAS_PART","columns","systemEntityColumns","asRenderableEntities","asSystemEntities","emptyMessage","emptyHelpLink","systemEntityHelpLink","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","componentEntityColumns","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","componentEntityHelpLink","asComponentEntities","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities"],"sourceRoot":""}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[6051],{76051:function(xe,L,c){c.r(L),c.d(L,{RealLogViewer:function(){return me}});var u=c(52322),C=c(95544),k=c(61837),W=c(19353),D=c(72779),b=c.n(D),g=c(2784),G=c(73557),P=c(63399),$=c(50166),v=c(87612),Y=c(46212);const B=(0,Y.Z)(),I=/\n\r?/g,R=Object.fromEntries(Object.entries({1:e=>({...e,bold:!0}),3:e=>({...e,italic:!0}),4:e=>({...e,underline:!0}),22:({bold:e,...n})=>n,23:({italic:e,...n})=>n,24:({underline:e,...n})=>n,30:e=>({...e,foreground:"black"}),31:e=>({...e,foreground:"red"}),32:e=>({...e,foreground:"green"}),33:e=>({...e,foreground:"yellow"}),34:e=>({...e,foreground:"blue"}),35:e=>({...e,foreground:"magenta"}),36:e=>({...e,foreground:"cyan"}),37:e=>({...e,foreground:"white"}),39:({foreground:e,...n})=>n,90:e=>({...e,foreground:"grey"}),40:e=>({...e,background:"black"}),41:e=>({...e,background:"red"}),42:e=>({...e,background:"green"}),43:e=>({...e,background:"yellow"}),44:e=>({...e,background:"blue"}),45:e=>({...e,background:"magenta"}),46:e=>({...e,background:"cyan"}),47:e=>({...e,background:"white"}),49:({background:e,...n})=>n}).map(([e,n])=>[`\x1B[${e}m`,n]));class j{lastChunk(){return this.chunks[this.chunks.length-1]}replaceLastChunk(n){n&&(this.chunks.splice(this.chunks.length-1,1,...n),this.text=this.chunks.map(t=>t.text).join("").toLocaleLowerCase("en-US"))}constructor(n=1,t=[]){(0,v._)(this,"lineNumber",void 0),(0,v._)(this,"chunks",void 0),(0,v._)(this,"text",void 0),this.lineNumber=n,this.chunks=t,this.text=t.map(s=>s.text).join("").toLocaleLowerCase("en-US")}}class J{process(n){if(this.text===n)return this.lines;if(n.startsWith(this.text)){var t;const r=this.lines.length>0?this.lines.length-1:0;var s;const i=(s=this.lines[r])!==null&&s!==void 0?s:new j,d=i.lastChunk();var o;const l=this.processLines(((o=d==null?void 0:d.text)!==null&&o!==void 0?o:"")+n.slice(this.text.length),d==null?void 0:d.modifiers,i==null?void 0:i.lineNumber);i.replaceLastChunk((t=l[0])===null||t===void 0?void 0:t.chunks),this.lines[r]=i,this.lines.push(...l.slice(1))}else this.lines=this.processLines(n);return this.text=n,this.lines}constructor(){(0,v._)(this,"text",""),(0,v._)(this,"lines",[]),(0,v._)(this,"processLines",(n,t={},s=1)=>{const o=[];let r=t,i=s,d=0;for(I.lastIndex=0;;){const h=I.exec(n);if(!h){const m=this.processText(n.slice(d),r);return o.push(new j(i,m)),o}const a=n.slice(d,h.index);d=h.index+h[0].length;const f=this.processText(a,r);o.push(new j(i,f));var l;r=(l=f[f.length-1].modifiers)!==null&&l!==void 0?l:r,i+=1}}),(0,v._)(this,"processText",(n,t)=>{const s=[];let o=t,r=0;for(B.lastIndex=0;;){const i=B.exec(n);if(!i)return s.push({text:n.slice(r),modifiers:o}),s;const d=n.slice(r,i.index);s.push({text:d,modifiers:o}),r=i.index+i[0].length,o=this.processCode(i[0],o)}}),(0,v._)(this,"processCode",(n,t)=>{var s,o;return(o=(s=R[n])===null||s===void 0?void 0:s.call(R,t))!==null&&o!==void 0?o:t})}}var Q=c(74600),F=c.n(Q),X=c(63494),w=c(15332);function q(e,n){const t=new Array;if(n.bold&&t.push(e.modifierBold),n.italic&&t.push(e.modifierItalic),n.underline&&t.push(e.modifierUnderline),n.foreground){const s=`modifierForeground${F()(n.foreground)}`;t.push(e[s])}if(n.background){const s=`modifierBackground${F()(n.background)}`;t.push(e[s])}return t.length>0?t.join(" "):void 0}function _(e,n){if(!n||!e.includes(n))return;const t=new Array;let s=0;for(;;){const o=e.indexOf(n,s);if(o===-1)break;const r=o+n.length;t.push({start:o,end:r}),s=r}return t}function ee(e,n){const t=_(e.text,n);if(!t)return e.chunks;const s=new Array;let o=0,r=0,i=t[r];for(const d of e.chunks){const{text:l,modifiers:h}=d;if(!i||o+l.length<i.start){s.push(d),o+=l.length;continue}let a=0;for(;i;){const m=Math.max(i.start-o,0);if(m>l.length)break;const p=Math.min(i.end-o,l.length);if(m>a&&s.push({text:l.slice(a,m),modifiers:h}),p>m&&s.push({modifiers:h,highlight:r,text:l.slice(m,p)}),a=p,i.end-o===p)r+=1,i=t[r];else break}a<l.length&&s.push({text:l.slice(a),modifiers:h}),o+=l.length}return s}const ne=({attributes:e,content:n})=>{const{href:t,...s}=e;return(0,u.jsx)(w.r,{to:t,...s,children:n})};function te({line:e,classes:n,searchText:t,highlightResultIndex:s}){const o=(0,g.useMemo)(()=>ee(e,t),[e,t]),r=(0,g.useMemo)(()=>o.map(({text:i,modifiers:d,highlight:l},h)=>(0,u.jsx)("span",{className:b()(q(n,d),l!==void 0&&(l===s?n.textSelectedHighlight:n.textHighlight)),children:(0,u.jsx)(X.Z,{options:{render:ne},children:i})},h)),[o,s,n]);return(0,u.jsx)(u.Fragment,{children:r})}var oe=c(86619),se=c(90436),re=c(48049),ie=c(51209),M=c(36444);function le(e){const{resultCount:n,resultIndexStep:t,toggleShouldFilter:s}=e;var o;const r=(o=e.resultIndex)!==null&&o!==void 0?o:0,i=d=>{d.key==="Enter"&&(d.metaKey||d.ctrlKey||d.altKey?s():t(d.shiftKey))};return(0,u.jsxs)(u.Fragment,{children:[n!==void 0&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(k.Z,{size:"small",onClick:()=>t(!0),children:(0,u.jsx)(re.Z,{})}),(0,u.jsxs)(se.Z,{children:[Math.min(r+1,n),"/",n]}),(0,u.jsx)(k.Z,{size:"small",onClick:()=>t(),children:(0,u.jsx)(ie.Z,{})})]}),(0,u.jsx)(oe.Z,{size:"small",variant:"standard",placeholder:"Search",value:e.searchInput,onKeyPress:i,onChange:d=>e.setSearchInput(d.target.value)}),(0,u.jsx)(k.Z,{size:"small",onClick:s,children:e.shouldFilter?(0,u.jsx)(M.Z,{color:"primary"}):(0,u.jsx)(M.Z,{color:"disabled"})})]})}var ce=c(79692),N=c(41128),S=c(31754),T=c(66054),z=c(81463),A=c(34505),E=c(57186),K=c(32720),H=c(92901),O=c(45410);const V=40,de=(0,ce.Z)(e=>({root:{background:e.palette.background.paper},header:{height:V,display:"flex",alignItems:"center",justifyContent:"flex-end"},log:{fontFamily:'"Monaco", monospace',fontSize:e.typography.pxToRem(12)},line:{position:"relative",whiteSpace:"pre","&:hover":{background:e.palette.action.hover}},lineSelected:{background:e.palette.action.selected,"&:hover":{background:e.palette.action.selected}},lineCopyButton:{position:"absolute",paddingTop:0,paddingBottom:0},lineNumber:{display:"inline-block",textAlign:"end",width:60,marginRight:e.spacing(1),cursor:"pointer"},textHighlight:{background:(0,N.Fq)(e.palette.info.main,.15)},textSelectedHighlight:{background:(0,N.Fq)(e.palette.info.main,.4)},modifierBold:{fontWeight:e.typography.fontWeightBold},modifierItalic:{fontStyle:"italic"},modifierUnderline:{textDecoration:"underline"},modifierForegroundBlack:{color:S.Z.black},modifierForegroundRed:{color:T.Z[500]},modifierForegroundGreen:{color:z.Z[500]},modifierForegroundYellow:{color:A.Z[500]},modifierForegroundBlue:{color:E.Z[500]},modifierForegroundMagenta:{color:K.Z[500]},modifierForegroundCyan:{color:H.Z[500]},modifierForegroundWhite:{color:S.Z.white},modifierForegroundGrey:{color:O.Z[500]},modifierBackgroundBlack:{background:S.Z.black},modifierBackgroundRed:{background:T.Z[500]},modifierBackgroundGreen:{background:z.Z[500]},modifierBackgroundYellow:{background:A.Z[500]},modifierBackgroundBlue:{background:E.Z[500]},modifierBackgroundMagenta:{background:K.Z[500]},modifierBackgroundCyan:{background:H.Z[500]},modifierBackgroundWhite:{background:S.Z.white},modifierBackgroundGrey:{background:O.Z[500]}}),{name:"BackstageLogViewer"});var ae=c(96686);function ue(e,n){if(!n)return{lines:e};const t=[],s=[];for(const o of e)if(o.text.includes(n)){t.push(o);let r=0,i=0;for(;;){const d=o.text.indexOf(n,r);if(d===-1)break;s.push({lineNumber:o.lineNumber,lineIndex:i++}),r=d+n.length}}return{lines:t,results:s}}function he(e){var n;const[t,s]=(0,g.useState)(""),o=t.toLocaleLowerCase("en-US"),[r,i]=(0,g.useState)(0),[d,l]=(0,ae.O)(!1),h=(0,g.useMemo)(()=>ue(e,o),[e,o]),a=h.results?h.results[Math.min(r,h.results.length-1)]:void 0,f=(n=h.results)===null||n===void 0?void 0:n.length,m=p=>{if(p){if(f!==void 0){const x=Math.min(r-1,f-2);i(x<0?f-1:x)}}else if(f!==void 0){const x=r+1;i(x>=f?0:x)}};return{lines:d?h.lines:e,searchText:o,searchInput:t,setSearchInput:s,shouldFilter:d,toggleShouldFilter:l,resultCount:f,resultIndex:r,resultIndexStep:m,resultLine:a==null?void 0:a.lineNumber,resultLineIndex:a==null?void 0:a.lineIndex}}var U=c(60871),fe=c(95074);function ge(e){const n=(0,U.h_)(U.VE),[t,s]=(0,g.useState)(),o=t?Math.min(t.start,t.end):void 0,r=t?Math.max(t.start,t.end):void 0,[{error:i},d]=(0,fe.Z)();return(0,g.useEffect)(()=>{i&&n.post(i)},[i,n]),{shouldShowButton(l){return o===l||r===l},isSelected(l){return t?o<=l&&l<=r:!1},setSelection(l,h){s(h?a=>a?{start:a.start,end:l}:{start:l,end:l}:a=>(a==null?void 0:a.start)===l&&(a==null?void 0:a.end)===l?void 0:{start:l,end:l})},copySelection(){if(t){const l=e.slice(Math.min(t.start,t.end)-1,Math.max(t.start,t.end)).map(h=>h.chunks.map(a=>a.text).join("")).join(`
|
|
2
|
-
`);d(l),s(void 0)}}}}function me(e){const n=de({classes:e.classes}),t=(0,g.useRef)(null),o=(0,g.useMemo)(()=>new J,[]).process(e.text),r=he(o),i=ge(o),d=(0,G.TH)();(0,g.useEffect)(()=>{r.resultLine!==void 0&&t.current&&t.current.scrollToItem(r.resultLine-1,"center")},[r.resultLine]),(0,g.useEffect)(()=>{if(d.hash){const h=parseInt(d.hash.replace(/\D/g,""),10);i.setSelection(h,!1)}},[]);const l=(h,a)=>{i.setSelection(h,a.shiftKey)};return(0,u.jsx)(P.Z,{children:({height:h,width:a})=>(0,u.jsxs)(C.Z,{style:{width:a,height:h},className:n.root,children:[(0,u.jsx)(C.Z,{className:n.header,children:(0,u.jsx)(le,{...r})}),(0,u.jsx)($.t7,{ref:t,className:n.log,height:(h||480)-V,width:a||640,itemData:r.lines,itemSize:20,itemCount:r.lines.length,children:({index:f,style:m,data:p})=>{const x=p[f],{lineNumber:y}=x;return(0,u.jsxs)(C.Z,{style:{...m},className:b()(n.line,{[n.lineSelected]:i.isSelected(y)}),children:[i.shouldShowButton(y)&&(0,u.jsx)(k.Z,{"data-testid":"copy-button",size:"small",className:n.lineCopyButton,onClick:()=>i.copySelection(),children:(0,u.jsx)(W.Z,{fontSize:"inherit"})}),(0,u.jsx)("a",{role:"row",target:"_self",href:`#line-${y}`,className:n.lineNumber,onClick:Z=>l(y,Z),onKeyPress:Z=>l(y,Z),children:y}),(0,u.jsx)(te,{line:x,classes:n,searchText:r.searchText,highlightResultIndex:r.resultLine===y?r.resultLineIndex:void 0})]})}})]})})}}}]);})();
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=6051.098a0af9.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file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KnM,CAAK,EACjB,CAAErB,WAAAA,CAAW,EAAIoB,EACvB,SACE,QAAC6L,EAAAA,EAAGA,CACFC,MAAO,CAAE,GAAGA,CAAM,EAClB/I,UAAWC,EAAAA,EAAW3C,EAAQL,KAAM,CAClC,CAACK,EAAQmG,YAAY,EAAG2E,EAAUV,WAAW7L,CAAU,CACzD,CAAC,E,UAEAuM,EAAUX,iBAAiB5L,CAAU,MACpC,OAACoF,EAAAA,EAAUA,CACTqI,cAAY,cACZpI,KAAK,QACLlB,UAAW1C,EAAQqG,eACnBxC,QAAS,IAAMiH,EAAUP,cAAc,E,YAEvC,OAAC0B,EAAAA,EAAQA,CAACrG,SAAS,S,QAGvB,OAACsG,IAAAA,CACCC,KAAK,MACLzH,OAAO,QACPzC,KAAM,SAAS1D,IACfmE,UAAW1C,EAAQzB,WACnBsF,QAASP,GAASgI,EAAiB/M,EAAY+E,CAAK,EACpDgB,WAAYhB,GAASgI,EAAiB/M,EAAY+E,CAAK,E,SAEtD/E,C,MAEH,OAAC8D,GAAOA,CACN1C,KAAMA,EACNK,QAASA,EACTU,WAAYmK,EAAOnK,WACnB4B,qBACEuI,EAAOvB,aAAe/K,EAClBsM,EAAOtB,gBACP/I,M,KAKd,C,OAMZ,C","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/AnsiProcessor.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogLine.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogViewerControls.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/styles.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSearch.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSelection.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/RealLogViewer.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 ansiRegexMaker from 'ansi-regex';\n\nconst ansiRegex = ansiRegexMaker();\nconst newlineRegex = /\\n\\r?/g;\n\n// A mapping of how each escape code changes the modifiers\nconst codeModifiers = Object.fromEntries(\n Object.entries({\n 1: m => ({ ...m, bold: true }),\n 3: m => ({ ...m, italic: true }),\n 4: m => ({ ...m, underline: true }),\n 22: ({ bold: _, ...m }) => m,\n 23: ({ italic: _, ...m }) => m,\n 24: ({ underline: _, ...m }) => m,\n 30: m => ({ ...m, foreground: 'black' }),\n 31: m => ({ ...m, foreground: 'red' }),\n 32: m => ({ ...m, foreground: 'green' }),\n 33: m => ({ ...m, foreground: 'yellow' }),\n 34: m => ({ ...m, foreground: 'blue' }),\n 35: m => ({ ...m, foreground: 'magenta' }),\n 36: m => ({ ...m, foreground: 'cyan' }),\n 37: m => ({ ...m, foreground: 'white' }),\n 39: ({ foreground: _, ...m }) => m,\n 90: m => ({ ...m, foreground: 'grey' }),\n 40: m => ({ ...m, background: 'black' }),\n 41: m => ({ ...m, background: 'red' }),\n 42: m => ({ ...m, background: 'green' }),\n 43: m => ({ ...m, background: 'yellow' }),\n 44: m => ({ ...m, background: 'blue' }),\n 45: m => ({ ...m, background: 'magenta' }),\n 46: m => ({ ...m, background: 'cyan' }),\n 47: m => ({ ...m, background: 'white' }),\n 49: ({ background: _, ...m }) => m,\n } as Record<string, (m: ChunkModifiers) => ChunkModifiers>).map(\n ([code, modifier]) => [`\\x1b[${code}m`, modifier],\n ),\n);\n\nexport type AnsiColor =\n | 'black'\n | 'red'\n | 'green'\n | 'yellow'\n | 'blue'\n | 'magenta'\n | 'cyan'\n | 'white'\n | 'grey';\n\nexport interface ChunkModifiers {\n foreground?: AnsiColor;\n background?: AnsiColor;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n}\n\nexport interface AnsiChunk {\n text: string;\n modifiers: ChunkModifiers;\n}\n\nexport class AnsiLine {\n text: string;\n\n constructor(\n readonly lineNumber: number = 1,\n readonly chunks: AnsiChunk[] = [],\n ) {\n this.text = chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n\n lastChunk(): AnsiChunk | undefined {\n return this.chunks[this.chunks.length - 1];\n }\n\n replaceLastChunk(newChunks?: AnsiChunk[]) {\n if (newChunks) {\n this.chunks.splice(this.chunks.length - 1, 1, ...newChunks);\n this.text = this.chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n }\n}\n\nexport class AnsiProcessor {\n private text: string = '';\n private lines: AnsiLine[] = [];\n\n /**\n * Processes a chunk of text while keeping internal state that optimizes\n * subsequent processing that appends to the text.\n */\n process(text: string): AnsiLine[] {\n if (this.text === text) {\n return this.lines;\n }\n\n if (text.startsWith(this.text)) {\n const lastLineIndex = this.lines.length > 0 ? this.lines.length - 1 : 0;\n const lastLine = this.lines[lastLineIndex] ?? new AnsiLine();\n const lastChunk = lastLine.lastChunk();\n\n const newLines = this.processLines(\n (lastChunk?.text ?? '') + text.slice(this.text.length),\n lastChunk?.modifiers,\n lastLine?.lineNumber,\n );\n lastLine.replaceLastChunk(newLines[0]?.chunks);\n\n this.lines[lastLineIndex] = lastLine;\n this.lines.push(...newLines.slice(1));\n } else {\n this.lines = this.processLines(text);\n }\n this.text = text;\n\n return this.lines;\n }\n\n // Split a chunk of text up into lines and process each line individually\n private processLines = (\n text: string,\n modifiers: ChunkModifiers = {},\n startingLineNumber: number = 1,\n ): AnsiLine[] => {\n const lines: AnsiLine[] = [];\n\n let currentModifiers = modifiers;\n let currentLineNumber = startingLineNumber;\n\n let prevIndex = 0;\n newlineRegex.lastIndex = 0;\n for (;;) {\n const match = newlineRegex.exec(text);\n if (!match) {\n const chunks = this.processText(\n text.slice(prevIndex),\n currentModifiers,\n );\n lines.push(new AnsiLine(currentLineNumber, chunks));\n return lines;\n }\n\n const line = text.slice(prevIndex, match.index);\n prevIndex = match.index + match[0].length;\n\n const chunks = this.processText(line, currentModifiers);\n lines.push(new AnsiLine(currentLineNumber, chunks));\n\n // Modifiers that are active in the last chunk are carried over to the next line\n currentModifiers =\n chunks[chunks.length - 1].modifiers ?? currentModifiers;\n currentLineNumber += 1;\n }\n };\n\n // Processing of a one individual text chunk\n private processText = (\n fullText: string,\n modifiers: ChunkModifiers,\n ): AnsiChunk[] => {\n const chunks: AnsiChunk[] = [];\n\n let currentModifiers = modifiers;\n\n let prevIndex = 0;\n ansiRegex.lastIndex = 0;\n for (;;) {\n const match = ansiRegex.exec(fullText);\n if (!match) {\n chunks.push({\n text: fullText.slice(prevIndex),\n modifiers: currentModifiers,\n });\n return chunks;\n }\n\n const text = fullText.slice(prevIndex, match.index);\n chunks.push({ text, modifiers: currentModifiers });\n\n // For every escape code that we encounter we keep track of where the\n // next chunk of text starts, and what modifiers it has\n prevIndex = match.index + match[0].length;\n currentModifiers = this.processCode(match[0], currentModifiers);\n }\n };\n\n private processCode = (\n code: string,\n modifiers: ChunkModifiers,\n ): ChunkModifiers => {\n return codeModifiers[code]?.(modifiers) ?? modifiers;\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 */\n\nimport React, { useMemo } from 'react';\nimport { AnsiChunk, AnsiLine, ChunkModifiers } from './AnsiProcessor';\nimport startCase from 'lodash/startCase';\nimport classnames from 'classnames';\nimport { useStyles } from './styles';\nimport Linkify from 'linkify-react';\nimport { Link } from '../Link';\n\nexport function getModifierClasses(\n classes: ReturnType<typeof useStyles>,\n modifiers: ChunkModifiers,\n) {\n const classNames = new Array<string>();\n if (modifiers.bold) {\n classNames.push(classes.modifierBold);\n }\n if (modifiers.italic) {\n classNames.push(classes.modifierItalic);\n }\n if (modifiers.underline) {\n classNames.push(classes.modifierUnderline);\n }\n if (modifiers.foreground) {\n const key = `modifierForeground${startCase(\n modifiers.foreground,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n if (modifiers.background) {\n const key = `modifierBackground${startCase(\n modifiers.background,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n return classNames.length > 0 ? classNames.join(' ') : undefined;\n}\n\nexport function findSearchResults(text: string, searchText: string) {\n if (!searchText || !text.includes(searchText)) {\n return undefined;\n }\n const searchResults = new Array<{ start: number; end: number }>();\n let offset = 0;\n for (;;) {\n const start = text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n const end = start + searchText.length;\n searchResults.push({ start, end });\n offset = end;\n }\n return searchResults;\n}\n\nexport interface HighlightAnsiChunk extends AnsiChunk {\n highlight?: number;\n}\n\nexport function calculateHighlightedChunks(\n line: AnsiLine,\n searchText: string,\n): HighlightAnsiChunk[] {\n const results = findSearchResults(line.text, searchText);\n if (!results) {\n return line.chunks;\n }\n\n const chunks = new Array<HighlightAnsiChunk>();\n\n let lineOffset = 0;\n let resultIndex = 0;\n let result = results[resultIndex];\n for (const chunk of line.chunks) {\n const { text, modifiers } = chunk;\n if (!result || lineOffset + text.length < result.start) {\n chunks.push(chunk);\n lineOffset += text.length;\n continue;\n }\n\n let localOffset = 0;\n while (result) {\n const localStart = Math.max(result.start - lineOffset, 0);\n if (localStart > text.length) {\n break; // The next result is not in this chunk\n }\n\n const localEnd = Math.min(result.end - lineOffset, text.length);\n\n const hasTextBeforeResult = localStart > localOffset;\n if (hasTextBeforeResult) {\n chunks.push({ text: text.slice(localOffset, localStart), modifiers });\n }\n const hasResultText = localEnd > localStart;\n if (hasResultText) {\n chunks.push({\n modifiers,\n highlight: resultIndex,\n text: text.slice(localStart, localEnd),\n });\n }\n\n localOffset = localEnd;\n\n const foundCompleteResult = result.end - lineOffset === localEnd;\n if (foundCompleteResult) {\n resultIndex += 1;\n result = results[resultIndex];\n } else {\n break; // The rest of the result is in the following chunks\n }\n }\n\n const hasTextAfterResult = localOffset < text.length;\n if (hasTextAfterResult) {\n chunks.push({ text: text.slice(localOffset), modifiers });\n }\n\n lineOffset += text.length;\n }\n\n return chunks;\n}\n\nconst renderLink = ({\n attributes,\n content,\n}: {\n attributes: { [attr: string]: any };\n content: string;\n}) => {\n const { href, ...props } = attributes;\n return (\n <Link to={href} {...props}>\n {content}\n </Link>\n );\n};\n\nexport interface LogLineProps {\n line: AnsiLine;\n classes: ReturnType<typeof useStyles>;\n searchText: string;\n highlightResultIndex?: number;\n}\n\nexport function LogLine({\n line,\n classes,\n searchText,\n highlightResultIndex,\n}: LogLineProps) {\n const chunks = useMemo(\n () => calculateHighlightedChunks(line, searchText),\n [line, searchText],\n );\n\n const elements = useMemo(\n () =>\n chunks.map(({ text, modifiers, highlight }, index) => (\n // eslint-disable-next-line react/forbid-elements\n <span\n key={index}\n className={classnames(\n getModifierClasses(classes, modifiers),\n highlight !== undefined &&\n (highlight === highlightResultIndex\n ? classes.textSelectedHighlight\n : classes.textHighlight),\n )}\n >\n <Linkify options={{ render: renderLink }}>{text}</Linkify>\n </span>\n )),\n [chunks, highlightResultIndex, classes],\n );\n\n return <>{elements}</>;\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 */\n\nimport React from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport { LogViewerSearch } from './useLogViewerSearch';\n\nexport interface LogViewerControlsProps extends LogViewerSearch {}\n\nexport function LogViewerControls(props: LogViewerControlsProps) {\n const { resultCount, resultIndexStep, toggleShouldFilter } = props;\n const resultIndex = props.resultIndex ?? 0;\n\n const handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n if (event.metaKey || event.ctrlKey || event.altKey) {\n toggleShouldFilter();\n } else {\n resultIndexStep(event.shiftKey);\n }\n }\n };\n\n return (\n <>\n {resultCount !== undefined && (\n <>\n <IconButton size=\"small\" onClick={() => resultIndexStep(true)}>\n <ChevronLeftIcon />\n </IconButton>\n <Typography>\n {Math.min(resultIndex + 1, resultCount)}/{resultCount}\n </Typography>\n <IconButton size=\"small\" onClick={() => resultIndexStep()}>\n <ChevronRightIcon />\n </IconButton>\n </>\n )}\n <TextField\n size=\"small\"\n variant=\"standard\"\n placeholder=\"Search\"\n value={props.searchInput}\n onKeyPress={handleKeyPress}\n onChange={e => props.setSearchInput(e.target.value)}\n />\n <IconButton size=\"small\" onClick={toggleShouldFilter}>\n {props.shouldFilter ? (\n <FilterListIcon color=\"primary\" />\n ) : (\n <FilterListIcon color=\"disabled\" />\n )}\n </IconButton>\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 */\n\nimport { alpha, makeStyles } from '@material-ui/core/styles';\nimport * as colors from '@material-ui/core/colors';\n\nexport const HEADER_SIZE = 40;\n\n/** @public Class keys for overriding LogViewer styles */\nexport type LogViewerClassKey =\n | 'root'\n | 'header'\n | 'log'\n | 'line'\n | 'lineSelected'\n | 'lineCopyButton'\n | 'lineNumber'\n | 'textHighlight'\n | 'textSelectedHighlight'\n | 'modifierBold'\n | 'modifierItalic'\n | 'modifierUnderline'\n | 'modifierForegroundBlack'\n | 'modifierForegroundRed'\n | 'modifierForegroundGreen'\n | 'modifierForegroundYellow'\n | 'modifierForegroundBlue'\n | 'modifierForegroundMagenta'\n | 'modifierForegroundCyan'\n | 'modifierForegroundWhite'\n | 'modifierForegroundGrey'\n | 'modifierBackgroundBlack'\n | 'modifierBackgroundRed'\n | 'modifierBackgroundGreen'\n | 'modifierBackgroundYellow'\n | 'modifierBackgroundBlue'\n | 'modifierBackgroundMagenta'\n | 'modifierBackgroundCyan'\n | 'modifierBackgroundWhite'\n | 'modifierBackgroundGrey';\n\nexport const useStyles = makeStyles(\n theme => ({\n root: {\n background: theme.palette.background.paper,\n },\n header: {\n height: HEADER_SIZE,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n },\n log: {\n fontFamily: '\"Monaco\", monospace',\n fontSize: theme.typography.pxToRem(12),\n },\n line: {\n position: 'relative',\n whiteSpace: 'pre',\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n },\n lineSelected: {\n background: theme.palette.action.selected,\n\n '&:hover': {\n background: theme.palette.action.selected,\n },\n },\n lineCopyButton: {\n position: 'absolute',\n paddingTop: 0,\n paddingBottom: 0,\n },\n lineNumber: {\n display: 'inline-block',\n textAlign: 'end',\n width: 60,\n marginRight: theme.spacing(1),\n cursor: 'pointer',\n },\n textHighlight: {\n background: alpha(theme.palette.info.main, 0.15),\n },\n textSelectedHighlight: {\n background: alpha(theme.palette.info.main, 0.4),\n },\n modifierBold: {\n fontWeight: theme.typography.fontWeightBold,\n },\n modifierItalic: {\n fontStyle: 'italic',\n },\n modifierUnderline: {\n textDecoration: 'underline',\n },\n modifierForegroundBlack: {\n color: colors.common.black,\n },\n modifierForegroundRed: {\n color: colors.red[500],\n },\n modifierForegroundGreen: {\n color: colors.green[500],\n },\n modifierForegroundYellow: {\n color: colors.yellow[500],\n },\n modifierForegroundBlue: {\n color: colors.blue[500],\n },\n modifierForegroundMagenta: {\n color: colors.purple[500],\n },\n modifierForegroundCyan: {\n color: colors.cyan[500],\n },\n modifierForegroundWhite: {\n color: colors.common.white,\n },\n modifierForegroundGrey: {\n color: colors.grey[500],\n },\n modifierBackgroundBlack: {\n background: colors.common.black,\n },\n modifierBackgroundRed: {\n background: colors.red[500],\n },\n modifierBackgroundGreen: {\n background: colors.green[500],\n },\n modifierBackgroundYellow: {\n background: colors.yellow[500],\n },\n modifierBackgroundBlue: {\n background: colors.blue[500],\n },\n modifierBackgroundMagenta: {\n background: colors.purple[500],\n },\n modifierBackgroundCyan: {\n background: colors.cyan[500],\n },\n modifierBackgroundWhite: {\n background: colors.common.white,\n },\n modifierBackgroundGrey: {\n background: colors.grey[500],\n },\n }),\n { name: 'BackstageLogViewer' },\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 */\n\nimport { useMemo, useState } from 'react';\nimport { useToggle } from '@react-hookz/web';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function applySearchFilter(lines: AnsiLine[], searchText: string) {\n if (!searchText) {\n return { lines };\n }\n\n const matchingLines = [];\n const searchResults = [];\n for (const line of lines) {\n if (line.text.includes(searchText)) {\n matchingLines.push(line);\n\n let offset = 0;\n let lineResultIndex = 0;\n for (;;) {\n const start = line.text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n searchResults.push({\n lineNumber: line.lineNumber,\n lineIndex: lineResultIndex++,\n });\n offset = start + searchText.length;\n }\n }\n }\n\n return {\n lines: matchingLines,\n results: searchResults,\n };\n}\n\nexport interface LogViewerSearch {\n lines: AnsiLine[];\n\n searchText: string;\n searchInput: string;\n setSearchInput: (searchInput: string) => void;\n\n shouldFilter: boolean;\n toggleShouldFilter: () => void;\n\n resultCount: number | undefined;\n resultIndex: number | undefined;\n resultIndexStep: (decrement?: boolean) => void;\n\n resultLine: number | undefined;\n resultLineIndex: number | undefined;\n}\n\nexport function useLogViewerSearch(lines: AnsiLine[]): LogViewerSearch {\n const [searchInput, setSearchInput] = useState('');\n const searchText = searchInput.toLocaleLowerCase('en-US');\n\n const [resultIndex, setResultIndex] = useState<number>(0);\n\n const [shouldFilter, toggleShouldFilter] = useToggle(false);\n\n const filter = useMemo(\n () => applySearchFilter(lines, searchText),\n [lines, searchText],\n );\n\n const searchResult = filter.results\n ? filter.results[Math.min(resultIndex, filter.results.length - 1)]\n : undefined;\n const resultCount = filter.results?.length;\n\n const resultIndexStep = (decrement?: boolean) => {\n if (decrement) {\n if (resultCount !== undefined) {\n const next = Math.min(resultIndex - 1, resultCount - 2);\n setResultIndex(next < 0 ? resultCount - 1 : next);\n }\n } else {\n if (resultCount !== undefined) {\n const next = resultIndex + 1;\n setResultIndex(next >= resultCount ? 0 : next);\n }\n }\n };\n\n return {\n lines: shouldFilter ? filter.lines : lines,\n searchText,\n searchInput,\n setSearchInput,\n shouldFilter,\n toggleShouldFilter,\n resultCount,\n resultIndex,\n resultIndexStep,\n resultLine: searchResult?.lineNumber,\n resultLineIndex: searchResult?.lineIndex,\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 */\n\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useEffect, useState } from 'react';\nimport useCopyToClipboard from 'react-use/lib/useCopyToClipboard';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function useLogViewerSelection(lines: AnsiLine[]) {\n const errorApi = useApi(errorApiRef);\n const [sel, setSelection] = useState<{ start: number; end: number }>();\n const start = sel ? Math.min(sel.start, sel.end) : undefined;\n const end = sel ? Math.max(sel.start, sel.end) : undefined;\n\n const [{ error }, copyToClipboard] = useCopyToClipboard();\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n return {\n shouldShowButton(line: number) {\n return start === line || end === line;\n },\n isSelected(line: number) {\n if (!sel) {\n return false;\n }\n return start! <= line && line <= end!;\n },\n setSelection(line: number, add: boolean) {\n if (add) {\n setSelection(s =>\n s ? { start: s.start, end: line } : { start: line, end: line },\n );\n } else {\n setSelection(s =>\n s?.start === line && s?.end === line\n ? undefined\n : { start: line, end: line },\n );\n }\n },\n copySelection() {\n if (sel) {\n const copyText = lines\n .slice(Math.min(sel.start, sel.end) - 1, Math.max(sel.start, sel.end))\n .map(l => l.chunks.map(c => c.text).join(''))\n .join('\\n');\n copyToClipboard(copyText);\n setSelection(undefined);\n }\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 Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport CopyIcon from '@material-ui/icons/FileCopy';\nimport classnames from 'classnames';\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { FixedSizeList } from 'react-window';\n\nimport { AnsiProcessor } from './AnsiProcessor';\nimport { LogLine } from './LogLine';\nimport { LogViewerControls } from './LogViewerControls';\nimport { HEADER_SIZE, useStyles } from './styles';\nimport { useLogViewerSearch } from './useLogViewerSearch';\nimport { useLogViewerSelection } from './useLogViewerSelection';\n\nexport interface RealLogViewerProps {\n text: string;\n classes?: { root?: string };\n}\n\nexport function RealLogViewer(props: RealLogViewerProps) {\n const classes = useStyles({ classes: props.classes });\n const listRef = useRef<FixedSizeList | null>(null);\n\n // The processor keeps state that optimizes appending to the text\n const processor = useMemo(() => new AnsiProcessor(), []);\n const lines = processor.process(props.text);\n\n const search = useLogViewerSearch(lines);\n const selection = useLogViewerSelection(lines);\n const location = useLocation();\n\n useEffect(() => {\n if (search.resultLine !== undefined && listRef.current) {\n listRef.current.scrollToItem(search.resultLine - 1, 'center');\n }\n }, [search.resultLine]);\n\n useEffect(() => {\n if (location.hash) {\n // #line-6 -> 6\n const line = parseInt(location.hash.replace(/\\D/g, ''), 10);\n selection.setSelection(line, false);\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleSelectLine = (\n line: number,\n event: { shiftKey: boolean; preventDefault: () => void },\n ) => {\n selection.setSelection(line, event.shiftKey);\n };\n\n return (\n <AutoSizer>\n {({ height, width }) => (\n <Box style={{ width, height }} className={classes.root}>\n <Box className={classes.header}>\n <LogViewerControls {...search} />\n </Box>\n <FixedSizeList\n ref={listRef}\n className={classes.log}\n height={(height || 480) - HEADER_SIZE}\n width={width || 640}\n itemData={search.lines}\n itemSize={20}\n itemCount={search.lines.length}\n >\n {({ index, style, data }) => {\n const line = data[index];\n const { lineNumber } = line;\n return (\n <Box\n style={{ ...style }}\n className={classnames(classes.line, {\n [classes.lineSelected]: selection.isSelected(lineNumber),\n })}\n >\n {selection.shouldShowButton(lineNumber) && (\n <IconButton\n data-testid=\"copy-button\"\n size=\"small\"\n className={classes.lineCopyButton}\n onClick={() => selection.copySelection()}\n >\n <CopyIcon fontSize=\"inherit\" />\n </IconButton>\n )}\n <a\n role=\"row\"\n target=\"_self\"\n href={`#line-${lineNumber}`}\n className={classes.lineNumber}\n onClick={event => handleSelectLine(lineNumber, event)}\n onKeyPress={event => handleSelectLine(lineNumber, event)}\n >\n {lineNumber}\n </a>\n <LogLine\n line={line}\n classes={classes}\n searchText={search.searchText}\n highlightResultIndex={\n search.resultLine === lineNumber\n ? search.resultLineIndex\n : undefined\n }\n />\n </Box>\n );\n }}\n </FixedSizeList>\n </Box>\n )}\n </AutoSizer>\n );\n}\n"],"names":["ansiRegex","ansiRegexMaker","newlineRegex","codeModifiers","Object","fromEntries","entries","m","bold","italic","underline","_","foreground","background","map","code","modifier","AnsiLine","lastChunk","chunks","length","replaceLastChunk","newChunks","splice","text","c","join","toLocaleLowerCase","constructor","lineNumber","AnsiProcessor","process","lines","startsWith","newLines","lastLineIndex","lastLine","processLines","slice","modifiers","push","startingLineNumber","currentModifiers","currentLineNumber","prevIndex","lastIndex","match","exec","processText","line","index","fullText","processCode","getModifierClasses","classes","classNames","Array","modifierBold","modifierItalic","modifierUnderline","key","startCase","undefined","findSearchResults","searchText","includes","searchResults","offset","start","indexOf","end","calculateHighlightedChunks","results","lineOffset","resultIndex","result","chunk","localOffset","localStart","Math","max","localEnd","min","highlight","renderLink","attributes","content","href","props","Link","to","LogLine","highlightResultIndex","useMemo","elements","span","className","classnames","textSelectedHighlight","textHighlight","Linkify","options","render","LogViewerControls","resultCount","resultIndexStep","toggleShouldFilter","handleKeyPress","event","metaKey","ctrlKey","altKey","shiftKey","IconButton","size","onClick","ChevronLeftIcon","Typography","ChevronRightIcon","TextField","variant","placeholder","value","searchInput","onKeyPress","onChange","e","setSearchInput","target","shouldFilter","FilterListIcon","color","HEADER_SIZE","useStyles","makeStyles","theme","root","palette","paper","header","height","display","alignItems","justifyContent","log","fontFamily","fontSize","typography","pxToRem","position","whiteSpace","action","hover","lineSelected","selected","lineCopyButton","paddingTop","paddingBottom","textAlign","width","marginRight","spacing","cursor","alpha","info","main","fontWeight","fontWeightBold","fontStyle","textDecoration","modifierForegroundBlack","colors","black","modifierForegroundRed","modifierForegroundGreen","modifierForegroundYellow","modifierForegroundBlue","modifierForegroundMagenta","modifierForegroundCyan","modifierForegroundWhite","white","modifierForegroundGrey","modifierBackgroundBlack","modifierBackgroundRed","modifierBackgroundGreen","modifierBackgroundYellow","modifierBackgroundBlue","modifierBackgroundMagenta","modifierBackgroundCyan","modifierBackgroundWhite","modifierBackgroundGrey","name","applySearchFilter","matchingLines","lineResultIndex","lineIndex","useLogViewerSearch","filter","useState","setResultIndex","useToggle","searchResult","decrement","next","resultLine","resultLineIndex","useLogViewerSelection","errorApi","useApi","errorApiRef","sel","setSelection","error","copyToClipboard","useCopyToClipboard","useEffect","post","shouldShowButton","isSelected","add","s","copySelection","copyText","l","RealLogViewer","listRef","useRef","search","selection","location","useLocation","current","scrollToItem","hash","parseInt","replace","handleSelectLine","AutoSizer","Box","style","FixedSizeList","ref","itemData","itemSize","itemCount","data","data-testid","CopyIcon","a","role"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[732],{732:function(b,r,e){e.r(r),e.d(r,{RelatedEntitiesCard:function(){return l},asComponentEntities:function(){return y},asResourceEntities:function(){return C},asSystemEntities:function(){return k},componentEntityColumns:function(){return m},componentEntityHelpLink:function(){return d},resourceEntityColumns:function(){return p},resourceEntityHelpLink:function(){return f},systemEntityColumns:function(){return E},systemEntityHelpLink:function(){return h}});var n=e(52322),u=e(90436),t=e(39709),M=e(2784),s=e(53974);function l(o){const{variant:c="gridItem",title:i,columns:g,entityKind:v,relationType:x,emptyMessage:j,emptyHelpLink:L,asRenderableEntities:R}=o,{entity:H}=(0,t.X2)(),{entities:S,loading:K,error:a}=(0,t.eK)(H,{type:x,kind:v});return K?(0,n.jsx)(s.rJ,{variant:c,title:i,children:(0,n.jsx)(s.Ex,{})}):a?(0,n.jsx)(s.rJ,{variant:c,title:i,children:(0,n.jsx)(s.Gk,{error:a})}):(0,n.jsx)(t.u3,{title:i,variant:c,emptyContent:(0,n.jsxs)("div",{style:{textAlign:"center"},children:[(0,n.jsx)(u.Z,{variant:"body1",children:j}),(0,n.jsx)(u.Z,{variant:"body2",children:(0,n.jsx)(s.rU,{to:L,children:"Learn how to change this."})})]}),columns:g,entities:R(S||[])})}const m=[t.u3.columns.createEntityRefColumn({defaultKind:"component"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],d="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",y=o=>o,p=[t.u3.columns.createEntityRefColumn({defaultKind:"resource"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],f="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",C=o=>o,E=[t.u3.columns.createEntityRefColumn({defaultKind:"system"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createMetadataDescriptionColumn()],h="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",k=o=>o}}]);})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=732.bb820d6a.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/732.bb820d6a.chunk.js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jB,QAAQ0B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrEV,EAAAA,GAAYjB,QAAQ4B,kBAAkB,EACtCX,EAAAA,GAAYjB,QAAQ6B,qBAAqB,EACzCZ,EAAAA,GAAYjB,QAAQ8B,0BAA0B,EAC9Cb,EAAAA,GAAYjB,QAAQ+B,gCAAgC,C,EAEzCI,EACX,sFACWC,EAAsB5B,GACjCA,EAEW6B,EAAmD,CAC9DpB,EAAAA,GAAYjB,QAAQ0B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnEV,EAAAA,GAAYjB,QAAQ4B,kBAAkB,EACtCX,EAAAA,GAAYjB,QAAQ+B,gCAAgC,C,EAEzCO,EACX,oFACWC,EAAoB/B,GAC/BA,C","sources":["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 { 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":["RelatedEntitiesCard","props","variant","title","columns","entityKind","relationType","emptyMessage","emptyHelpLink","asRenderableEntities","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","componentEntityColumns","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","componentEntityHelpLink","asComponentEntities","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
|
|
@@ -1 +0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A,C,IACnBA,EAAT,MAAO,CAAC,EAACA,GAAAA,EAAAA,EAAOyB,SAASC,eAAAA,MAAhB1B,IAAAA,SAAAA,EAA8B,2BAA2B,EACpE,CAAC,CACF,EAEK2B,EAAmBhB,EAAWC,CAAW,EAE/C,OAAIpB,KAEA,OAACoC,EAAAA,EAAmBA,C,YAClB,OAACC,EAAAA,GAAOA,C,YACN,OAACC,EAAAA,GAAQA,CAAAA,CAAAA,C,KAMbX,KAEA,OAACS,EAAAA,EAAmBA,C,YAClB,OAACC,EAAAA,GAAOA,C,YACN,OAACE,EAAAA,GAAYA,CACXC,SAAS,QACT7B,MAAM,0C,YAEN,OAAC8B,EAAAA,GAAWA,CAACC,SAAS,OAAOC,KAAMhB,EAAMiB,SAAS,C,YAQ1D,QAACR,EAAAA,EAAmBA,C,aAClB,OAACS,EAAAA,GAAUA,CACTC,cAAe1B,EACf2B,SAAUrD,GAAS2B,EAAe3B,CAAK,EACvCsD,KAAM7B,EAAW8B,IAAI,CAAC,CAAEC,MAAAA,CAAM,EAAGxD,KAAW,CAC1CyD,GAAIzD,EAAMkD,SAAS,EACnBM,MAAAA,CACF,EAAE,C,MAEJ,OAACb,EAAAA,GAAOA,CAACrB,cAAY,mB,SAClBmB,EAAiB/C,OAAO6D,IAAI,CAACzD,EAAQE,OACpC,OAACH,EAAAA,CAECC,OAAQA,EACRC,SAAYA,GAAsB,CAAC,EACnCC,MAAOA,C,EAHFA,CAAK,CAALA,C,KASjB,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/home/components/TechDocsCustomHome.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, { useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { makeStyles } from '@material-ui/core';\nimport { CSSProperties } from '@material-ui/styles';\nimport {\n CATALOG_FILTER_EXISTS,\n catalogApiRef,\n CatalogApi,\n useEntityOwnership,\n} from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\nimport { DocsTable } from './Tables';\nimport { DocsCardGrid } from './Grids';\nimport { TechDocsPageWrapper } from './TechDocsPageWrapper';\n\nimport {\n CodeSnippet,\n Content,\n HeaderTabs,\n Progress,\n WarningPanel,\n SupportButton,\n ContentHeader,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst panels = {\n DocsTable: DocsTable,\n DocsCardGrid: DocsCardGrid,\n};\n\n/**\n * Available panel types\n *\n * @public\n */\nexport type PanelType = 'DocsCardGrid' | 'DocsTable';\n\n/**\n * Type representing a TechDocsCustomHome panel.\n *\n * @public\n */\nexport interface PanelConfig {\n title: string;\n description: string;\n panelType: PanelType;\n panelCSS?: CSSProperties;\n filterPredicate: ((entity: Entity) => boolean) | string;\n}\n\n/**\n * Type representing a TechDocsCustomHome tab.\n *\n * @public\n */\nexport interface TabConfig {\n label: string;\n panels: PanelConfig[];\n}\n\n/**\n * Type representing a list of TechDocsCustomHome tabs.\n *\n * @public\n */\nexport type TabsConfig = TabConfig[];\n\nconst CustomPanel = ({\n config,\n entities,\n index,\n}: {\n config: PanelConfig;\n entities: Entity[];\n index: number;\n}) => {\n const useStyles = makeStyles({\n panelContainer: {\n marginBottom: '2rem',\n ...(config.panelCSS ? config.panelCSS : {}),\n },\n });\n const classes = useStyles();\n const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();\n\n const Panel = panels[config.panelType];\n\n const shownEntities = entities.filter(entity => {\n if (config.filterPredicate === 'ownedByUser') {\n if (loadingOwnership) {\n return false;\n }\n return isOwnedEntity(entity);\n }\n\n return (\n typeof config.filterPredicate === 'function' &&\n config.filterPredicate(entity)\n );\n });\n\n return (\n <>\n <ContentHeader title={config.title} description={config.description}>\n {index === 0 ? (\n <SupportButton>\n Discover documentation in your ecosystem.\n </SupportButton>\n ) : null}\n </ContentHeader>\n <div className={classes.panelContainer}>\n <Panel data-testid=\"techdocs-custom-panel\" entities={shownEntities} />\n </div>\n </>\n );\n};\n\n/**\n * Props for {@link TechDocsCustomHome}\n *\n * @public\n */\nexport type TechDocsCustomHomeProps = {\n tabsConfig: TabsConfig;\n};\n\nexport const TechDocsCustomHome = (props: TechDocsCustomHomeProps) => {\n const { tabsConfig } = props;\n const [selectedTab, setSelectedTab] = useState<number>(0);\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n\n const {\n value: entities,\n loading,\n error,\n } = useAsync(async () => {\n const response = await catalogApi.getEntities({\n filter: {\n 'metadata.annotations.backstage.io/techdocs-ref': CATALOG_FILTER_EXISTS,\n },\n fields: [\n 'apiVersion',\n 'kind',\n 'metadata',\n 'relations',\n 'spec.owner',\n 'spec.type',\n ],\n });\n return response.items.filter((entity: Entity) => {\n return !!entity.metadata.annotations?.['backstage.io/techdocs-ref'];\n });\n });\n\n const currentTabConfig = tabsConfig[selectedTab];\n\n if (loading) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <Progress />\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n if (error) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <WarningPanel\n severity=\"error\"\n title=\"Could not load available documentation.\"\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n return (\n <TechDocsPageWrapper>\n <HeaderTabs\n selectedIndex={selectedTab}\n onChange={index => setSelectedTab(index)}\n tabs={tabsConfig.map(({ label }, index) => ({\n id: index.toString(),\n label,\n }))}\n />\n <Content data-testid=\"techdocs-content\">\n {currentTabConfig.panels.map((config, index) => (\n <CustomPanel\n key={index}\n config={config}\n entities={!!entities ? entities : []}\n index={index}\n />\n ))}\n </Content>\n </TechDocsPageWrapper>\n );\n};\n"],"names":["panels","DocsTable","DocsCardGrid","CustomPanel","config","entities","index","classes","makeStyles","panelContainer","marginBottom","panelCSS","loading","loadingOwnership","isOwnedEntity","useEntityOwnership","Panel","panelType","shownEntities","filter","entity","filterPredicate","ContentHeader","title","description","SupportButton","div","className","data-testid","TechDocsCustomHome","props","tabsConfig","selectedTab","setSelectedTab","useState","catalogApi","useApi","catalogApiRef","value","error","useAsync","getEntities","CATALOG_FILTER_EXISTS","fields","items","metadata","annotations","currentTabConfig","TechDocsPageWrapper","Content","Progress","WarningPanel","severity","CodeSnippet","language","text","toString","HeaderTabs","selectedIndex","onChange","tabs","map","label","id"],"sourceRoot":""}
|
|
@@ -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 l=e(52322),u=e(2784),d=e(79692),r=e(86136),m=e(49378),h=e(95544),c=e(7089),x=e(53974),o=e(15096);const f=(0,d.Z)({item:{display:"flex"},flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}},{name:"CatalogSearchResultListItem"});function g(a){const s=a.result,t=a.highlight,i=f();return s?(0,l.jsxs)("div",{className:i.item,children:[a.icon&&(0,l.jsx)(r.Z,{children:typeof a.icon=="function"?a.icon(s):a.icon}),(0,l.jsxs)("div",{className:i.flexContainer,children:[(0,l.jsx)(m.Z,{className:i.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,l.jsx)(x.rU,{noTrack:!0,to:s.location,children:t!=null&&t.fields.title?(0,l.jsx)(o.FA,{text:t.fields.title,preTag:t.preTag,postTag:t.postTag}):s.title}),secondary:t!=null&&t.fields.text?(0,l.jsx)(o.FA,{text:t.fields.text,preTag:t.preTag,postTag:t.postTag}):s.text}),(0,l.jsxs)(h.Z,{children:[s.kind&&(0,l.jsx)(c.Z,{label:`Kind: ${s.kind}`,size:"small"}),s.lifecycle&&(0,l.jsx)(c.Z,{label:`Lifecycle: ${s.lifecycle}`,size:"small"})]})]})]}):null}}}]);})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=7670.f17f89be.chunk.js.map
|