@techdocs/cli 0.8.17 → 1.0.0

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/PublisherConfig-162efac5.cjs.js.map +1 -1
  3. package/dist/cjs/generate-143a6de3.cjs.js.map +1 -1
  4. package/dist/cjs/migrate-181e95f5.cjs.js.map +1 -1
  5. package/dist/cjs/mkdocs-30f530ff.cjs.js.map +1 -1
  6. package/dist/cjs/mkdocsServer-758a3ae9.cjs.js.map +1 -1
  7. package/dist/cjs/publish-7bf1e5f7.cjs.js.map +1 -1
  8. package/dist/cjs/serve-21d1e885.cjs.js.map +1 -1
  9. package/dist/cjs/utility-51f4a306.cjs.js.map +1 -1
  10. package/dist/embedded-app/.config-schema.json +34 -5
  11. package/dist/embedded-app/index.html +1 -1
  12. package/dist/embedded-app/static/{1553.b7bcb06c.chunk.js → 1553.925835b9.chunk.js} +2 -2
  13. package/dist/embedded-app/static/{1553.b7bcb06c.chunk.js.map → 1553.925835b9.chunk.js.map} +1 -1
  14. package/dist/embedded-app/static/{1959.6c1762da.chunk.js → 1959.2eb957a4.chunk.js} +2 -2
  15. package/dist/embedded-app/static/{1959.6c1762da.chunk.js.map → 1959.2eb957a4.chunk.js.map} +1 -1
  16. package/dist/embedded-app/static/{2426.92f98d58.chunk.js → 2426.f9952783.chunk.js} +2 -2
  17. package/dist/embedded-app/static/{2426.92f98d58.chunk.js.map → 2426.f9952783.chunk.js.map} +1 -1
  18. package/dist/embedded-app/static/3860.da7e5f63.chunk.js +3 -0
  19. package/dist/embedded-app/static/3860.da7e5f63.chunk.js.map +1 -0
  20. package/dist/embedded-app/static/{390.b97bc67e.chunk.js → 390.cd301478.chunk.js} +2 -2
  21. package/dist/embedded-app/static/{390.b97bc67e.chunk.js.map → 390.cd301478.chunk.js.map} +1 -1
  22. package/dist/embedded-app/static/{4022.482a5f92.chunk.js → 4022.313be9b5.chunk.js} +2 -2
  23. package/dist/embedded-app/static/{4022.482a5f92.chunk.js.map → 4022.313be9b5.chunk.js.map} +1 -1
  24. package/dist/embedded-app/static/{6235.a1086c98.chunk.js → 6235.b3634d50.chunk.js} +2 -2
  25. package/dist/embedded-app/static/{6235.a1086c98.chunk.js.map → 6235.b3634d50.chunk.js.map} +1 -1
  26. package/dist/embedded-app/static/{6583.035b49a3.chunk.js → 6583.c98b5125.chunk.js} +2 -2
  27. package/dist/embedded-app/static/{6583.035b49a3.chunk.js.map → 6583.c98b5125.chunk.js.map} +1 -1
  28. package/dist/embedded-app/static/{7110.cac06b1c.chunk.js → 7110.527cc68b.chunk.js} +2 -2
  29. package/dist/embedded-app/static/{7110.cac06b1c.chunk.js.map → 7110.527cc68b.chunk.js.map} +1 -1
  30. package/dist/embedded-app/static/7758.a6ab2713.chunk.js +3 -0
  31. package/dist/embedded-app/static/7758.a6ab2713.chunk.js.map +1 -0
  32. package/dist/embedded-app/static/{8061.b8ba1848.chunk.js → 8061.fd1f45d1.chunk.js} +2 -2
  33. package/dist/embedded-app/static/{8061.b8ba1848.chunk.js.map → 8061.fd1f45d1.chunk.js.map} +1 -1
  34. package/dist/embedded-app/static/8718.cd7bb850.chunk.js +4 -0
  35. package/dist/embedded-app/static/{8718.8a863f87.chunk.js.map → 8718.cd7bb850.chunk.js.map} +1 -1
  36. package/dist/embedded-app/static/{8792.e74d00e0.chunk.js → 8792.867bf73e.chunk.js} +2 -2
  37. package/dist/embedded-app/static/{8792.e74d00e0.chunk.js.map → 8792.867bf73e.chunk.js.map} +1 -1
  38. package/dist/embedded-app/static/{9028.0f028f46.chunk.js → 9028.200536ea.chunk.js} +2 -2
  39. package/dist/embedded-app/static/{9028.0f028f46.chunk.js.map → 9028.200536ea.chunk.js.map} +1 -1
  40. package/dist/embedded-app/static/main.0b0e8219.js +476 -0
  41. package/dist/embedded-app/static/main.0b0e8219.js.map +1 -0
  42. package/dist/embedded-app/static/{module-material-table.a73fb7f5.js → module-material-table.cbad0c40.js} +2 -2
  43. package/dist/embedded-app/static/{module-material-table.a73fb7f5.js.map → module-material-table.cbad0c40.js.map} +1 -1
  44. package/dist/embedded-app/static/module-react-beautiful-dnd.a9014a2e.js +67 -0
  45. package/dist/embedded-app/static/module-react-beautiful-dnd.a9014a2e.js.map +1 -0
  46. package/dist/embedded-app/static/{runtime.cc995f30.js → runtime.0b0e8219.js} +2 -2
  47. package/dist/embedded-app/static/runtime.0b0e8219.js.map +1 -0
  48. package/dist/embedded-app/static/vendor.0b0e8219.js +140 -0
  49. package/dist/embedded-app/static/vendor.0b0e8219.js.map +1 -0
  50. package/dist/index.cjs.js +1 -1
  51. package/dist/index.cjs.js.map +1 -1
  52. package/package.json +8 -8
  53. package/dist/embedded-app/static/5011.c8e98520.chunk.js +0 -3
  54. package/dist/embedded-app/static/5011.c8e98520.chunk.js.map +0 -1
  55. package/dist/embedded-app/static/7758.cb484a7b.chunk.js +0 -3
  56. package/dist/embedded-app/static/7758.cb484a7b.chunk.js.map +0 -1
  57. package/dist/embedded-app/static/8718.8a863f87.chunk.js +0 -4
  58. package/dist/embedded-app/static/main.cc995f30.js +0 -444
  59. package/dist/embedded-app/static/main.cc995f30.js.map +0 -1
  60. package/dist/embedded-app/static/module-react-beautiful-dnd.2ab2ffc2.js +0 -67
  61. package/dist/embedded-app/static/module-react-beautiful-dnd.2ab2ffc2.js.map +0 -1
  62. package/dist/embedded-app/static/runtime.cc995f30.js.map +0 -1
  63. package/dist/embedded-app/static/vendor.cc995f30.js +0 -140
  64. package/dist/embedded-app/static/vendor.cc995f30.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @techdocs/cli
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - b58c70c223: This package has been promoted to v1.0! To understand how this change affects the package, please check out our [versioning policy](https://backstage.io/docs/overview/versioning-policy).
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @backstage/backend-common@0.13.1
13
+ - @backstage/catalog-model@1.0.0
14
+ - @backstage/config@1.0.0
15
+ - @backstage/plugin-techdocs-node@1.0.0
16
+
3
17
  ## 0.8.17
4
18
 
5
19
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"PublisherConfig-162efac5.cjs.js","sources":["../../src/lib/PublisherConfig.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConfigReader } from '@backstage/config';\nimport { Command } from 'commander';\n\ntype Publisher = keyof typeof PublisherConfig['configFactories'];\ntype PublisherConfiguration = {\n [p in Publisher]?: any;\n} & {\n type: Publisher;\n};\n\n/**\n * Helper when working with publisher-related configurations.\n */\nexport class PublisherConfig {\n /**\n * Maps publisher-specific config keys to config getters.\n */\n private static configFactories = {\n awsS3: PublisherConfig.getValidAwsS3Config,\n azureBlobStorage: PublisherConfig.getValidAzureConfig,\n googleGcs: PublisherConfig.getValidGoogleGcsConfig,\n openStackSwift: PublisherConfig.getValidOpenStackSwiftConfig,\n };\n\n /**\n * Returns Backstage config suitable for use when instantiating a Publisher. If\n * there are any missing or invalid options provided, an error is thrown.\n *\n * Note: This assumes that proper credentials are set in Environment\n * variables for the respective GCS/AWS clients to work.\n */\n static getValidConfig(cmd: Command): ConfigReader {\n const publisherType = cmd.publisherType;\n\n if (!PublisherConfig.isKnownPublisher(publisherType)) {\n throw new Error(`Unknown publisher type ${cmd.publisherType}`);\n }\n\n return new ConfigReader({\n // This backend config is not used at all. Just something needed a create a mock discovery instance.\n backend: {\n baseUrl: 'http://localhost:7007',\n listen: {\n port: 7007,\n },\n },\n techdocs: {\n publisher: PublisherConfig.configFactories[publisherType](cmd),\n legacyUseCaseSensitiveTripletPaths:\n cmd.legacyUseCaseSensitiveTripletPaths,\n },\n });\n }\n\n /**\n * Typeguard to ensure the publisher has a known config getter.\n */\n private static isKnownPublisher(\n type: string,\n ): type is keyof typeof PublisherConfig['configFactories'] {\n return PublisherConfig.configFactories.hasOwnProperty(type);\n }\n\n /**\n * Retrieve valid AWS S3 configuration based on the command.\n */\n private static getValidAwsS3Config(cmd: Command): PublisherConfiguration {\n return {\n type: 'awsS3',\n awsS3: {\n bucketName: cmd.storageName,\n ...(cmd.awsBucketRootPath && { bucketRootPath: cmd.awsBucketRootPath }),\n ...(cmd.awsRoleArn && { credentials: { roleArn: cmd.awsRoleArn } }),\n ...(cmd.awsEndpoint && { endpoint: cmd.awsEndpoint }),\n ...(cmd.awsS3ForcePathStyle && { s3ForcePathStyle: true }),\n ...(cmd.awsS3sse && { sse: cmd.awsS3sse }),\n },\n };\n }\n\n /**\n * Retrieve valid Azure Blob Storage configuration based on the command.\n */\n private static getValidAzureConfig(cmd: Command): PublisherConfiguration {\n if (!cmd.azureAccountName) {\n throw new Error(\n `azureBlobStorage requires --azureAccountName to be specified`,\n );\n }\n\n return {\n type: 'azureBlobStorage',\n azureBlobStorage: {\n containerName: cmd.storageName,\n credentials: {\n accountName: cmd.azureAccountName,\n accountKey: cmd.azureAccountKey,\n },\n },\n };\n }\n\n /**\n * Retrieve valid GCS configuration based on the command.\n */\n private static getValidGoogleGcsConfig(cmd: Command): PublisherConfiguration {\n return {\n type: 'googleGcs',\n googleGcs: {\n bucketName: cmd.storageName,\n ...(cmd.gcsBucketRootPath && { bucketRootPath: cmd.gcsBucketRootPath }),\n },\n };\n }\n\n /**\n * Retrieves valid OpenStack Swift configuration based on the command.\n */\n private static getValidOpenStackSwiftConfig(\n cmd: Command,\n ): PublisherConfiguration {\n const missingParams = [\n 'osCredentialId',\n 'osSecret',\n 'osAuthUrl',\n 'osSwiftUrl',\n ].filter((param: string) => !cmd[param]);\n\n if (missingParams.length) {\n throw new Error(\n `openStackSwift requires the following params to be specified: ${missingParams.join(\n ', ',\n )}`,\n );\n }\n\n return {\n type: 'openStackSwift',\n openStackSwift: {\n containerName: cmd.storageName,\n credentials: {\n id: cmd.osCredentialId,\n secret: cmd.osSecret,\n },\n authUrl: cmd.osAuthUrl,\n swiftUrl: cmd.osSwiftUrl,\n },\n };\n }\n}\n"],"names":["ConfigReader"],"mappings":";;;;AA6BO,+BAAsB;AAAA,SAkBpB,eAAe,KAA4B;AAChD,UAAM,gBAAgB,IAAI;AAE1B,QAAI,CAAC,iBAAgB,iBAAiB,gBAAgB;AACpD,YAAM,IAAI,MAAM,0BAA0B,IAAI;AAAA;AAGhD,WAAO,IAAIA,oBAAa;AAAA,MAEtB,SAAS;AAAA,QACP,SAAS;AAAA,QACT,QAAQ;AAAA,UACN,MAAM;AAAA;AAAA;AAAA,MAGV,UAAU;AAAA,QACR,WAAW,iBAAgB,gBAAgB,eAAe;AAAA,QAC1D,oCACE,IAAI;AAAA;AAAA;AAAA;AAAA,SAQG,iBACb,MACyD;AACzD,WAAO,iBAAgB,gBAAgB,eAAe;AAAA;AAAA,SAMzC,oBAAoB,KAAsC;AACvE,WAAO;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,QACL,YAAY,IAAI;AAAA,WACZ,IAAI,qBAAqB,EAAE,gBAAgB,IAAI;AAAA,WAC/C,IAAI,cAAc,EAAE,aAAa,EAAE,SAAS,IAAI;AAAA,WAChD,IAAI,eAAe,EAAE,UAAU,IAAI;AAAA,WACnC,IAAI,uBAAuB,EAAE,kBAAkB;AAAA,WAC/C,IAAI,YAAY,EAAE,KAAK,IAAI;AAAA;AAAA;AAAA;AAAA,SAQtB,oBAAoB,KAAsC;AACvE,QAAI,CAAC,IAAI,kBAAkB;AACzB,YAAM,IAAI,MACR;AAAA;AAIJ,WAAO;AAAA,MACL,MAAM;AAAA,MACN,kBAAkB;AAAA,QAChB,eAAe,IAAI;AAAA,QACnB,aAAa;AAAA,UACX,aAAa,IAAI;AAAA,UACjB,YAAY,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,SAST,wBAAwB,KAAsC;AAC3E,WAAO;AAAA,MACL,MAAM;AAAA,MACN,WAAW;AAAA,QACT,YAAY,IAAI;AAAA,WACZ,IAAI,qBAAqB,EAAE,gBAAgB,IAAI;AAAA;AAAA;AAAA;AAAA,SAQ1C,6BACb,KACwB;AACxB,UAAM,gBAAgB;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,CAAC,UAAkB,CAAC,IAAI;AAEjC,QAAI,cAAc,QAAQ;AACxB,YAAM,IAAI,MACR,iEAAiE,cAAc,KAC7E;AAAA;AAKN,WAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,QACd,eAAe,IAAI;AAAA,QACnB,aAAa;AAAA,UACX,IAAI,IAAI;AAAA,UACR,QAAQ,IAAI;AAAA;AAAA,QAEd,SAAS,IAAI;AAAA,QACb,UAAU,IAAI;AAAA;AAAA;AAAA;AAAA;;AApIf,gBAIU,kBAAkB;AAAA,EAC/B,OAAO,iBAAgB;AAAA,EACvB,kBAAkB,iBAAgB;AAAA,EAClC,WAAW,iBAAgB;AAAA,EAC3B,gBAAgB,iBAAgB;AAAA;;;;"}
1
+ {"version":3,"file":"PublisherConfig-162efac5.cjs.js","sources":["../../src/lib/PublisherConfig.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConfigReader } from '@backstage/config';\nimport { Command } from 'commander';\n\ntype Publisher = keyof typeof PublisherConfig['configFactories'];\ntype PublisherConfiguration = {\n [p in Publisher]?: any;\n} & {\n type: Publisher;\n};\n\n/**\n * Helper when working with publisher-related configurations.\n */\nexport class PublisherConfig {\n /**\n * Maps publisher-specific config keys to config getters.\n */\n private static configFactories = {\n awsS3: PublisherConfig.getValidAwsS3Config,\n azureBlobStorage: PublisherConfig.getValidAzureConfig,\n googleGcs: PublisherConfig.getValidGoogleGcsConfig,\n openStackSwift: PublisherConfig.getValidOpenStackSwiftConfig,\n };\n\n /**\n * Returns Backstage config suitable for use when instantiating a Publisher. If\n * there are any missing or invalid options provided, an error is thrown.\n *\n * Note: This assumes that proper credentials are set in Environment\n * variables for the respective GCS/AWS clients to work.\n */\n static getValidConfig(cmd: Command): ConfigReader {\n const publisherType = cmd.publisherType;\n\n if (!PublisherConfig.isKnownPublisher(publisherType)) {\n throw new Error(`Unknown publisher type ${cmd.publisherType}`);\n }\n\n return new ConfigReader({\n // This backend config is not used at all. Just something needed a create a mock discovery instance.\n backend: {\n baseUrl: 'http://localhost:7007',\n listen: {\n port: 7007,\n },\n },\n techdocs: {\n publisher: PublisherConfig.configFactories[publisherType](cmd),\n legacyUseCaseSensitiveTripletPaths:\n cmd.legacyUseCaseSensitiveTripletPaths,\n },\n });\n }\n\n /**\n * Typeguard to ensure the publisher has a known config getter.\n */\n private static isKnownPublisher(\n type: string,\n ): type is keyof typeof PublisherConfig['configFactories'] {\n return PublisherConfig.configFactories.hasOwnProperty(type);\n }\n\n /**\n * Retrieve valid AWS S3 configuration based on the command.\n */\n private static getValidAwsS3Config(cmd: Command): PublisherConfiguration {\n return {\n type: 'awsS3',\n awsS3: {\n bucketName: cmd.storageName,\n ...(cmd.awsBucketRootPath && { bucketRootPath: cmd.awsBucketRootPath }),\n ...(cmd.awsRoleArn && { credentials: { roleArn: cmd.awsRoleArn } }),\n ...(cmd.awsEndpoint && { endpoint: cmd.awsEndpoint }),\n ...(cmd.awsS3ForcePathStyle && { s3ForcePathStyle: true }),\n ...(cmd.awsS3sse && { sse: cmd.awsS3sse }),\n },\n };\n }\n\n /**\n * Retrieve valid Azure Blob Storage configuration based on the command.\n */\n private static getValidAzureConfig(cmd: Command): PublisherConfiguration {\n if (!cmd.azureAccountName) {\n throw new Error(\n `azureBlobStorage requires --azureAccountName to be specified`,\n );\n }\n\n return {\n type: 'azureBlobStorage',\n azureBlobStorage: {\n containerName: cmd.storageName,\n credentials: {\n accountName: cmd.azureAccountName,\n accountKey: cmd.azureAccountKey,\n },\n },\n };\n }\n\n /**\n * Retrieve valid GCS configuration based on the command.\n */\n private static getValidGoogleGcsConfig(cmd: Command): PublisherConfiguration {\n return {\n type: 'googleGcs',\n googleGcs: {\n bucketName: cmd.storageName,\n ...(cmd.gcsBucketRootPath && { bucketRootPath: cmd.gcsBucketRootPath }),\n },\n };\n }\n\n /**\n * Retrieves valid OpenStack Swift configuration based on the command.\n */\n private static getValidOpenStackSwiftConfig(\n cmd: Command,\n ): PublisherConfiguration {\n const missingParams = [\n 'osCredentialId',\n 'osSecret',\n 'osAuthUrl',\n 'osSwiftUrl',\n ].filter((param: string) => !cmd[param]);\n\n if (missingParams.length) {\n throw new Error(\n `openStackSwift requires the following params to be specified: ${missingParams.join(\n ', ',\n )}`,\n );\n }\n\n return {\n type: 'openStackSwift',\n openStackSwift: {\n containerName: cmd.storageName,\n credentials: {\n id: cmd.osCredentialId,\n secret: cmd.osSecret,\n },\n authUrl: cmd.osAuthUrl,\n swiftUrl: cmd.osSwiftUrl,\n },\n };\n }\n}\n"],"names":["ConfigReader"],"mappings":";;;;AA6BO,MAAsB,gBAAA,GAAA,MAAA;AAAA,EAAA,OAkBpB,eAAe,GAA4B,EAAA;AAChD,IAAA,MAAM,gBAAgB,GAAI,CAAA,aAAA,CAAA;AAE1B,IAAI,IAAA,CAAC,gBAAgB,CAAA,gBAAA,CAAiB,aAAgB,CAAA,EAAA;AACpD,MAAM,MAAA,IAAI,KAAM,CAA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AI,CAAA,QAAA;AAAA,SAAA;AAAA,QAEd,SAAS,GAAI,CAAA,SAAA;AAAA,QACb,UAAU,GAAI,CAAA,UAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAAA,GAAA;AAAA,CAAA,CAAA;AApIf,IAAA,eAAA,GAAA,iBAAA;AAAA,gBAIU,eAAkB,GAAA;AAAA,EAC/B,OAAO,gBAAgB,CAAA,mBAAA;AAAA,EACvB,kBAAkB,gBAAgB,CAAA,mBAAA;AAAA,EAClC,WAAW,gBAAgB,CAAA,uBAAA;AAAA,EAC3B,gBAAgB,gBAAgB,CAAA,4BAAA;AAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"generate-143a6de3.cjs.js","sources":["../../src/commands/generate/generate.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { Command } from 'commander';\nimport fs from 'fs-extra';\nimport Docker from 'dockerode';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport { DockerContainerRunner } from '@backstage/backend-common';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n} from '../../lib/utility';\nimport { stdout } from 'process';\n\nexport default async function generate(cmd: Command) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: cmd.verbose });\n\n const sourceDir = resolve(cmd.sourceDir);\n const outputDir = resolve(cmd.outputDir);\n const omitTechdocsCorePlugin = cmd.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = cmd.dockerImage;\n const pullImage = cmd.pull;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: cmd.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n omitTechdocsCorePlugin,\n },\n },\n },\n });\n\n // Docker client (conditionally) used by the generators, based on techdocs.generators config.\n const dockerClient = new Docker();\n const containerRunner = new DockerContainerRunner({ dockerClient });\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (cmd.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n cmd.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n containerRunner,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(cmd.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: cmd.etag,\n ...(process.env.LOG_LEVEL === 'debug' ? { logStream: stdout } : {}),\n });\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","config","ConfigReader","Docker","DockerContainerRunner","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","stdout"],"mappings":";;;;;;;;;;;;;;;;;wBAgCuC,KAAc;AAKnD,QAAM,SAASA,qBAAa,EAAE,SAAS,IAAI;AAE3C,QAAM,YAAYC,aAAQ,IAAI;AAC9B,QAAM,YAAYA,aAAQ,IAAI;AAC9B,QAAM,yBAAyB,IAAI;AACnC,QAAM,cAAc,IAAI;AACxB,QAAM,YAAY,IAAI;AAEtB,SAAO,KAAK,oBAAoB;AAChC,SAAO,KAAK,kCAAkC;AAE9C,SAAO,QAAQ;AAEf,QAAMC,uBAAG,UAAU;AAEnB,QAAMC,WAAS,IAAIC,oBAAa;AAAA,IAC9B,UAAU;AAAA,MACR,WAAW;AAAA,QACT,OAAO,IAAI,SAAS,WAAW;AAAA,QAC/B;AAAA,QACA;AAAA,QACA,QAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA;AAOR,QAAM,eAAe,IAAIC;AACzB,QAAM,kBAAkB,IAAIC,oCAAsB,EAAE;AAEpD,MAAI,2BAA2B;AAC/B,MAAI,IAAI,aAAa;AACnB,QAAI;AACF,iCAA2BC,+CACzB,IAAI;AAAA,aAEC,KAAP;AACA,aAAO,MAAM,IAAI;AAAA;AAAA;AAKrB,QAAM,oBAAoB,MAAMC,qCAAkB,WAAWL,UAAQ;AAAA,IACnE;AAAA,IACA;AAAA;AAGF,SAAO,KAAK;AAEZ,QAAM,kBAAkB,IAAI;AAAA,IAC1B,UAAU;AAAA,IACV;AAAA,OACI,IAAI,cACJ;AAAA,MACE;AAAA,QAEF;AAAA,IACJ;AAAA,IACA,MAAM,IAAI;AAAA,OACN,QAAQ,IAAI,cAAc,UAAU,EAAE,WAAWM,qBAAW;AAAA;AAGlE,SAAO,KAAK;AAAA;;;;"}
1
+ {"version":3,"file":"generate-143a6de3.cjs.js","sources":["../../src/commands/generate/generate.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { Command } from 'commander';\nimport fs from 'fs-extra';\nimport Docker from 'dockerode';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport { DockerContainerRunner } from '@backstage/backend-common';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n} from '../../lib/utility';\nimport { stdout } from 'process';\n\nexport default async function generate(cmd: Command) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: cmd.verbose });\n\n const sourceDir = resolve(cmd.sourceDir);\n const outputDir = resolve(cmd.outputDir);\n const omitTechdocsCorePlugin = cmd.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = cmd.dockerImage;\n const pullImage = cmd.pull;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: cmd.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n omitTechdocsCorePlugin,\n },\n },\n },\n });\n\n // Docker client (conditionally) used by the generators, based on techdocs.generators config.\n const dockerClient = new Docker();\n const containerRunner = new DockerContainerRunner({ dockerClient });\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (cmd.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n cmd.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n containerRunner,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(cmd.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: cmd.etag,\n ...(process.env.LOG_LEVEL === 'debug' ? { logStream: stdout } : {}),\n });\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","config","ConfigReader","Docker","DockerContainerRunner","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","stdout"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,eAAA,QAAA,CAAuC,GAAc,EAAA;AAKnD,EAAA,MAAM,MAAS,GAAAA,oBAAA,CAAa,EAAE,OAAA,EAAS,GAAI,CAAA,OAAA,EAAA,CAAA,CAAA;AAE3C,EAAM,MAAA,SAAA,GAAYC,aAAQ,GAAI,CAAA,SAAA,CAAA,CAAA;AAC9B,EAAM,MAAA,SAAA,GAAYA,aAAQ,GAAI,CAAA,SAAA,CAAA,CAAA;AAC9B,EAAA,MAAM,yBAAyB,GAAI,CAAA,4BAAA,CAAA;AACnC,EAAA,MAAM,cAAc,GAAI,CAAA,WAAA,CAAA;AACxB,EAAA,MAAM,YAAY,GAAI,CAAA,IAAA,CAAA;AAEtB,EAAA,MAAA,CAAO,KAAK,CAAoB,iBAAA,EAAA,SAAA,CAAA,CAAA,CAAA,CAAA;AAChC,EAAA,MAAA,CAAO,KAAK,CAAkC,+BAAA,EAAA,SAAA,CAAA,CAAA,CAAA,CAAA;AAE9C,EAAA,MAAA,CAAO,OAAQ,CAAA,iDAAA,CAAA,CAAA;AAEf,EAAA,MAAMC,uBAAG,SAAU,CAAA,SAAA,CAAA,CAAA;AAEnB,EAAM,MAAAC,QAAA,GAAS,IAAIC,mBAAa,CAAA;AAAA,IAC9B,QAAU,EAAA;AAAA,MACR,SAAW,EAAA;AAAA,QACT,KAAA,EAAO,GAAI,CAAA,MAAA,GAAS,QAAW,GAAA,OAAA;AAAA,QAC/B,WAAA;AAAA,QACA,SAAA;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,sBAAA;AAAA,SAAA;AAAA,OAAA;AAAA,KAAA;AAAA,GAAA,CAAA,CAAA;AAOR,EAAA,MAAM,eAAe,IAAIC,0BAAA,EAAA,CAAA;AACzB,EAAM,MAAA,eAAA,GAAkB,IAAIC,mCAAA,CAAsB,EAAE,YAAA,EAAA,CAAA,CAAA;AAEpD,EAAA,IAAI,wBAA2B,GAAA,EAAA,CAAA;AAC/B,EAAA,IAAI,IAAI,WAAa,EAAA;AACnB,IAAI,IAAA;AACF,MAAA,wBAAA,GAA2BC,+CACzB,GAAI,CAAA,WAAA,CAAA,CAAA;AAAA,KAAA,CAAA,OAEC,GAAP,EAAA;AACA,MAAA,MAAA,CAAO,MAAM,GAAI,CAAA,OAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA;AAKrB,EAAA,MAAM,iBAAoB,GAAA,MAAMC,oCAAkB,CAAA,UAAA,CAAWL,QAAQ,EAAA;AAAA,IACnE,MAAA;AAAA,IACA,eAAA;AAAA,GAAA,CAAA,CAAA;AAGF,EAAA,MAAA,CAAO,IAAK,CAAA,6BAAA,CAAA,CAAA;AAEZ,EAAA,MAAM,kBAAkB,GAAI,CAAA;AAAA,IAC1B,QAAU,EAAA,SAAA;AAAA,IACV,SAAA;AAAA,IAAA,GACI,IAAI,WACJ,GAAA;AAAA,MACE,wBAAA;AAAA,KAEF,GAAA,EAAA;AAAA,IACJ,MAAA;AAAA,IACA,MAAM,GAAI,CAAA,IAAA;AAAA,IAAA,GACN,QAAQ,GAAI,CAAA,SAAA,KAAc,OAAU,GAAA,EAAE,WAAWM,gBAAW,EAAA,GAAA,EAAA;AAAA,GAAA,CAAA,CAAA;AAGlE,EAAA,MAAA,CAAO,IAAK,CAAA,OAAA,CAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"migrate-181e95f5.cjs.js","sources":["../../src/commands/migrate/migrate.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SingleHostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Command } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function migrate(cmd: Command) {\n const logger = createLogger({ verbose: cmd.verbose });\n\n const config = PublisherConfig.getValidConfig(cmd);\n const discovery = SingleHostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n if (!publisher.migrateDocsCase) {\n throw new Error(`Migration not implemented for ${cmd.publisherType}`);\n }\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n throw new Error('');\n }\n\n // Validate and parse migration arguments.\n const removeOriginal = cmd.removeOriginal;\n const numericConcurrency = parseInt(cmd.concurrency, 10);\n\n if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {\n throw new Error(\n `Concurrency must be a number greater than 1. ${cmd.concurrency} provided.`,\n );\n }\n\n await publisher.migrateDocsCase({\n concurrency: numericConcurrency,\n removeOriginal,\n });\n}\n"],"names":["createLogger","PublisherConfig","SingleHostDiscovery","Publisher"],"mappings":";;;;;;;;;uBAsBsC,KAAc;AAClD,QAAM,SAASA,qBAAa,EAAE,SAAS,IAAI;AAE3C,QAAM,SAASC,gCAAgB,eAAe;AAC9C,QAAM,YAAYC,kCAAoB,WAAW;AACjD,QAAM,YAAY,MAAMC,6BAAU,WAAW,QAAQ,EAAE,QAAQ;AAE/D,MAAI,CAAC,UAAU,iBAAiB;AAC9B,UAAM,IAAI,MAAM,iCAAiC,IAAI;AAAA;AAIvD,QAAM,EAAE,gBAAgB,MAAM,UAAU;AACxC,MAAI,CAAC,aAAa;AAEhB,UAAM,IAAI,MAAM;AAAA;AAIlB,QAAM,iBAAiB,IAAI;AAC3B,QAAM,qBAAqB,SAAS,IAAI,aAAa;AAErD,MAAI,CAAC,OAAO,UAAU,uBAAuB,sBAAsB,GAAG;AACpE,UAAM,IAAI,MACR,gDAAgD,IAAI;AAAA;AAIxD,QAAM,UAAU,gBAAgB;AAAA,IAC9B,aAAa;AAAA,IACb;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"migrate-181e95f5.cjs.js","sources":["../../src/commands/migrate/migrate.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SingleHostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Command } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function migrate(cmd: Command) {\n const logger = createLogger({ verbose: cmd.verbose });\n\n const config = PublisherConfig.getValidConfig(cmd);\n const discovery = SingleHostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n if (!publisher.migrateDocsCase) {\n throw new Error(`Migration not implemented for ${cmd.publisherType}`);\n }\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n throw new Error('');\n }\n\n // Validate and parse migration arguments.\n const removeOriginal = cmd.removeOriginal;\n const numericConcurrency = parseInt(cmd.concurrency, 10);\n\n if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {\n throw new Error(\n `Concurrency must be a number greater than 1. ${cmd.concurrency} provided.`,\n );\n }\n\n await publisher.migrateDocsCase({\n concurrency: numericConcurrency,\n removeOriginal,\n });\n}\n"],"names":["createLogger","PublisherConfig","SingleHostDiscovery","Publisher"],"mappings":";;;;;;;;;AAsBA,eAAA,OAAA,CAAsC,GAAc,EAAA;AAClD,EAAA,MAAM,MAAS,GAAAA,oBAAA,CAAa,EAAE,OAAA,EAAS,GAAI,CAAA,OAAA,EAAA,CAAA,CAAA;AAE3C,EAAM,MAAA,MAAA,GAASC,gCAAgB,cAAe,CAAA,GAAA,CAAA,CAAA;AAC9C,EAAM,MAAA,SAAA,GAAYC,kCAAoB,UAAW,CAAA,MAAA,CAAA,CAAA;AACjD,EAAA,MAAM,YAAY,MAAMC,4BAAA,CAAU,UAAW,CAAA,MAAA,EAAQ,EAAE,MAAQ,EAAA,SAAA,EAAA,CAAA,CAAA;AAE/D,EAAI,IAAA,CAAC,UAAU,eAAiB,EAAA;AAC9B,IAAM,MAAA,IAAI,KAAM,CAAA,CAAA,8BAAA,EAAiC,GAAI,CAAA,aAAA,CAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAIvD,EAAM,MAAA,EAAE,WAAgB,EAAA,GAAA,MAAM,SAAU,CAAA,YAAA,EAAA,CAAA;AACxC,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAA,MAAM,IAAI,KAAM,CAAA,EAAA,CAAA,CAAA;AAAA,GAAA;AAIlB,EAAA,MAAM,iBAAiB,GAAI,CAAA,cAAA,CAAA;AAC3B,EAAM,MAAA,kBAAA,GAAqB,QAAS,CAAA,GAAA,CAAI,WAAa,EAAA,EAAA,CAAA,CAAA;AAErD,EAAA,IAAI,CAAC,MAAA,CAAO,SAAU,CAAA,kBAAA,CAAA,IAAuB,sBAAsB,CAAG,EAAA;AACpE,IAAM,MAAA,IAAI,KACR,CAAA,CAAA,6CAAA,EAAgD,GAAI,CAAA,WAAA,CAAA,UAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAIxD,EAAA,MAAM,UAAU,eAAgB,CAAA;AAAA,IAC9B,WAAa,EAAA,kBAAA;AAAA,IACb,cAAA;AAAA,GAAA,CAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"mkdocs-30f530ff.cjs.js","sources":["../../src/commands/serve/mkdocs.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Command } from 'commander';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { createLogger } from '../../lib/utility';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\n\nexport default async function serveMkdocs(cmd: Command) {\n const logger = createLogger({ verbose: cmd.verbose });\n\n const dockerAddr = `http://0.0.0.0:${cmd.port}`;\n const localAddr = `http://127.0.0.1:${cmd.port}`;\n const expectedDevAddr = cmd.docker ? dockerAddr : localAddr;\n // We want to open browser only once based on a log.\n let boolOpenBrowserTriggered = false;\n\n const logFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line in between\n const logLines = data.toString().split('\\n');\n const logPrefix = cmd.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n // Logs from container is verbose.\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !boolOpenBrowserTriggered &&\n line.includes(`Serving on ${expectedDevAddr}`)\n ) {\n // Always open the local address, since 0.0.0.0 belongs to docker\n logger.info(`\\nStarting mkdocs server on ${localAddr}\\n`);\n openBrowser(localAddr);\n boolOpenBrowserTriggered = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n\n // Commander stores --no-docker in cmd.docker variable\n const childProcess = await runMkdocsServer({\n port: cmd.port,\n dockerImage: cmd.dockerImage,\n useDocker: cmd.docker,\n stdoutLogFunc: logFunc,\n stderrLogFunc: logFunc,\n });\n\n // Keep waiting for user to cancel the process\n await waitForSignal([childProcess]);\n}\n"],"names":["createLogger","runMkdocsServer","waitForSignal"],"mappings":";;;;;;;;;;;;2BAsB0C,KAAc;AACtD,QAAM,SAASA,qBAAa,EAAE,SAAS,IAAI;AAE3C,QAAM,aAAa,kBAAkB,IAAI;AACzC,QAAM,YAAY,oBAAoB,IAAI;AAC1C,QAAM,kBAAkB,IAAI,SAAS,aAAa;AAElD,MAAI,2BAA2B;AAE/B,QAAM,UAAmB,UAAQ;AAE/B,UAAM,WAAW,KAAK,WAAW,MAAM;AACvC,UAAM,YAAY,IAAI,SAAS,oBAAoB;AACnD,aAAS,QAAQ,UAAQ;AACvB,UAAI,SAAS,IAAI;AACf;AAAA;AAIF,aAAO,QAAQ,GAAG,aAAa;AAG/B,UACE,CAAC,4BACD,KAAK,SAAS,cAAc,oBAC5B;AAEA,eAAO,KAAK;AAAA,4BAA+B;AAAA;AAC3C,wCAAY;AACZ,mCAA2B;AAAA;AAAA;AAAA;AASjC,QAAM,eAAe,MAAMC,6BAAgB;AAAA,IACzC,MAAM,IAAI;AAAA,IACV,aAAa,IAAI;AAAA,IACjB,WAAW,IAAI;AAAA,IACf,eAAe;AAAA,IACf,eAAe;AAAA;AAIjB,QAAMC,2BAAc,CAAC;AAAA;;;;"}
1
+ {"version":3,"file":"mkdocs-30f530ff.cjs.js","sources":["../../src/commands/serve/mkdocs.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Command } from 'commander';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { createLogger } from '../../lib/utility';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\n\nexport default async function serveMkdocs(cmd: Command) {\n const logger = createLogger({ verbose: cmd.verbose });\n\n const dockerAddr = `http://0.0.0.0:${cmd.port}`;\n const localAddr = `http://127.0.0.1:${cmd.port}`;\n const expectedDevAddr = cmd.docker ? dockerAddr : localAddr;\n // We want to open browser only once based on a log.\n let boolOpenBrowserTriggered = false;\n\n const logFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line in between\n const logLines = data.toString().split('\\n');\n const logPrefix = cmd.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n // Logs from container is verbose.\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !boolOpenBrowserTriggered &&\n line.includes(`Serving on ${expectedDevAddr}`)\n ) {\n // Always open the local address, since 0.0.0.0 belongs to docker\n logger.info(`\\nStarting mkdocs server on ${localAddr}\\n`);\n openBrowser(localAddr);\n boolOpenBrowserTriggered = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n\n // Commander stores --no-docker in cmd.docker variable\n const childProcess = await runMkdocsServer({\n port: cmd.port,\n dockerImage: cmd.dockerImage,\n useDocker: cmd.docker,\n stdoutLogFunc: logFunc,\n stderrLogFunc: logFunc,\n });\n\n // Keep waiting for user to cancel the process\n await waitForSignal([childProcess]);\n}\n"],"names":["createLogger","openBrowser","runMkdocsServer","waitForSignal"],"mappings":";;;;;;;;;;;;AAsBA,eAAA,WAAA,CAA0C,GAAc,EAAA;AACtD,EAAA,MAAM,MAAS,GAAAA,oBAAA,CAAa,EAAE,OAAA,EAAS,GAAI,CAAA,OAAA,EAAA,CAAA,CAAA;AAE3C,EAAM,MAAA,UAAA,GAAa,kBAAkB,GAAI,CAAA,IAAA,CAAA,CAAA,CAAA;AACzC,EAAM,MAAA,SAAA,GAAY,oBAAoB,GAAI,CAAA,IAAA,CAAA,CAAA,CAAA;AAC1C,EAAM,MAAA,eAAA,GAAkB,GAAI,CAAA,MAAA,GAAS,UAAa,GAAA,SAAA,CAAA;AAElD,EAAA,IAAI,wBAA2B,GAAA,KAAA,CAAA;AAE/B,EAAA,MAAM,UAAmB,CAAQ,IAAA,KAAA;AAE/B,IAAM,MAAA,QAAA,GAAW,IAAK,CAAA,QAAA,EAAA,CAAW,KAAM,CAAA,IAAA,CAAA,CAAA;AACvC,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,MAAA,GAAS,iBAAoB,GAAA,UAAA,CAAA;AACnD,IAAA,QAAA,CAAS,QAAQ,CAAQ,IAAA,KAAA;AACvB,MAAA,IAAI,SAAS,EAAI,EAAA;AACf,QAAA,OAAA;AAAA,OAAA;AAIF,MAAO,MAAA,CAAA,OAAA,CAAQ,GAAG,SAAa,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AAG/B,MAAA,IACE,CAAC,wBAAA,IACD,IAAK,CAAA,QAAA,CAAS,cAAc,eAC5B,CAAA,CAAA,CAAA,EAAA;AAEA,QAAA,MAAA,CAAO,IAAK,CAAA,CAAA;AAAA,0BAA+B,EAAA,SAAA,CAAA;AAAA,CAAA,CAAA,CAAA;AAC3C,QAAYC,+BAAA,CAAA,SAAA,CAAA,CAAA;AACZ,QAA2B,wBAAA,GAAA,IAAA,CAAA;AAAA,OAAA;AAAA,KAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AASjC,EAAM,MAAA,YAAA,GAAe,MAAMC,4BAAgB,CAAA;AAAA,IACzC,MAAM,GAAI,CAAA,IAAA;AAAA,IACV,aAAa,GAAI,CAAA,WAAA;AAAA,IACjB,WAAW,GAAI,CAAA,MAAA;AAAA,IACf,aAAe,EAAA,OAAA;AAAA,IACf,aAAe,EAAA,OAAA;AAAA,GAAA,CAAA,CAAA;AAIjB,EAAA,MAAMC,2BAAc,CAAC,YAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"mkdocsServer-758a3ae9.cjs.js","sources":["../../src/lib/run.ts","../../src/lib/mkdocsServer.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { spawn, SpawnOptions, ChildProcess } from 'child_process';\n\nexport type LogFunc = (data: Buffer | string) => void;\ntype SpawnOptionsPartialEnv = Omit<SpawnOptions, 'env'> & {\n env?: Partial<NodeJS.ProcessEnv>;\n // Pipe stdout to this log function\n stdoutLogFunc?: LogFunc;\n // Pipe stderr to this log function\n stderrLogFunc?: LogFunc;\n};\n\n// TODO: Accept log functions to pipe logs with.\n// Runs a child command, returning the child process instance.\n// Use it along with waitForSignal to run a long running process e.g. mkdocs serve\nexport const run = async (\n name: string,\n args: string[] = [],\n options: SpawnOptionsPartialEnv = {},\n): Promise<ChildProcess> => {\n const { stdoutLogFunc, stderrLogFunc } = options;\n\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n FORCE_COLOR: 'true',\n ...(options.env ?? {}),\n };\n\n // Refer: https://nodejs.org/api/child_process.html#child_process_subprocess_stdio\n const stdio = [\n 'inherit',\n stdoutLogFunc ? 'pipe' : 'inherit',\n stderrLogFunc ? 'pipe' : 'inherit',\n ] as ('inherit' | 'pipe')[];\n\n const childProcess = spawn(name, args, {\n stdio: stdio,\n ...options,\n env,\n });\n\n if (stdoutLogFunc && childProcess.stdout) {\n childProcess.stdout.on('data', stdoutLogFunc);\n }\n if (stderrLogFunc && childProcess.stderr) {\n childProcess.stderr.on('data', stderrLogFunc);\n }\n\n return childProcess;\n};\n\n// Block indefinitely and wait for a signal to kill the child process(es)\n// Throw error if any child process errors\n// Resolves only when all processes exit with status code 0\nexport async function waitForSignal(\n childProcesses: Array<ChildProcess>,\n): Promise<void> {\n const promises: Array<Promise<void>> = [];\n\n for (const signal of ['SIGINT', 'SIGTERM'] as const) {\n process.on(signal, () => {\n childProcesses.forEach(childProcess => {\n childProcess.kill();\n });\n });\n }\n\n childProcesses.forEach(childProcess => {\n if (typeof childProcess.exitCode === 'number') {\n if (childProcess.exitCode) {\n throw new Error(`Non zero exit code from child process`);\n }\n return;\n }\n\n promises.push(\n new Promise<void>((resolve, reject) => {\n childProcess.once('error', reject);\n childProcess.once('exit', resolve);\n }),\n );\n });\n\n await Promise.all(promises);\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 { ChildProcess } from 'child_process';\nimport { run, LogFunc } from './run';\n\nexport const runMkdocsServer = async (options: {\n port?: string;\n useDocker?: boolean;\n dockerImage?: string;\n stdoutLogFunc?: LogFunc;\n stderrLogFunc?: LogFunc;\n}): Promise<ChildProcess> => {\n const port = options.port ?? '8000';\n const useDocker = options.useDocker ?? true;\n const dockerImage = options.dockerImage ?? 'spotify/techdocs';\n\n if (useDocker) {\n return await run(\n 'docker',\n [\n 'run',\n '--rm',\n '-w',\n '/content',\n '-v',\n `${process.cwd()}:/content`,\n '-p',\n `${port}:${port}`,\n '-it',\n dockerImage,\n 'serve',\n '--dev-addr',\n `0.0.0.0:${port}`,\n ],\n {\n stdoutLogFunc: options.stdoutLogFunc,\n stderrLogFunc: options.stderrLogFunc,\n },\n );\n }\n\n return await run('mkdocs', ['serve', '--dev-addr', `127.0.0.1:${port}`], {\n stdoutLogFunc: options.stdoutLogFunc,\n stderrLogFunc: options.stderrLogFunc,\n });\n};\n"],"names":["spawn"],"mappings":";;;;MA6Ba,MAAM,OACjB,MACA,OAAiB,IACjB,UAAkC,OACR;AAjC5B;AAkCE,QAAM,EAAE,eAAe,kBAAkB;AAEzC,QAAM,MAAyB;AAAA,OAC1B,QAAQ;AAAA,IACX,aAAa;AAAA,OACT,cAAQ,QAAR,YAAe;AAAA;AAIrB,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,gBAAgB,SAAS;AAAA,IACzB,gBAAgB,SAAS;AAAA;AAG3B,QAAM,eAAeA,oBAAM,MAAM,MAAM;AAAA,IACrC;AAAA,OACG;AAAA,IACH;AAAA;AAGF,MAAI,iBAAiB,aAAa,QAAQ;AACxC,iBAAa,OAAO,GAAG,QAAQ;AAAA;AAEjC,MAAI,iBAAiB,aAAa,QAAQ;AACxC,iBAAa,OAAO,GAAG,QAAQ;AAAA;AAGjC,SAAO;AAAA;6BAOP,gBACe;AACf,QAAM,WAAiC;AAEvC,aAAW,UAAU,CAAC,UAAU,YAAqB;AACnD,YAAQ,GAAG,QAAQ,MAAM;AACvB,qBAAe,QAAQ,kBAAgB;AACrC,qBAAa;AAAA;AAAA;AAAA;AAKnB,iBAAe,QAAQ,kBAAgB;AACrC,QAAI,OAAO,aAAa,aAAa,UAAU;AAC7C,UAAI,aAAa,UAAU;AACzB,cAAM,IAAI,MAAM;AAAA;AAElB;AAAA;AAGF,aAAS,KACP,IAAI,QAAc,CAAC,SAAS,WAAW;AACrC,mBAAa,KAAK,SAAS;AAC3B,mBAAa,KAAK,QAAQ;AAAA;AAAA;AAKhC,QAAM,QAAQ,IAAI;AAAA;;MC9EP,kBAAkB,OAAO,YAMT;AAzB7B;AA0BE,QAAM,OAAO,cAAQ,SAAR,YAAgB;AAC7B,QAAM,YAAY,cAAQ,cAAR,YAAqB;AACvC,QAAM,cAAc,cAAQ,gBAAR,YAAuB;AAE3C,MAAI,WAAW;AACb,WAAO,MAAM,IACX,UACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG,QAAQ;AAAA,MACX;AAAA,MACA,GAAG,QAAQ;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,OAEb;AAAA,MACE,eAAe,QAAQ;AAAA,MACvB,eAAe,QAAQ;AAAA;AAAA;AAK7B,SAAO,MAAM,IAAI,UAAU,CAAC,SAAS,cAAc,aAAa,SAAS;AAAA,IACvE,eAAe,QAAQ;AAAA,IACvB,eAAe,QAAQ;AAAA;AAAA;;;;;"}
1
+ {"version":3,"file":"mkdocsServer-758a3ae9.cjs.js","sources":["../../src/lib/run.ts","../../src/lib/mkdocsServer.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { spawn, SpawnOptions, ChildProcess } from 'child_process';\n\nexport type LogFunc = (data: Buffer | string) => void;\ntype SpawnOptionsPartialEnv = Omit<SpawnOptions, 'env'> & {\n env?: Partial<NodeJS.ProcessEnv>;\n // Pipe stdout to this log function\n stdoutLogFunc?: LogFunc;\n // Pipe stderr to this log function\n stderrLogFunc?: LogFunc;\n};\n\n// TODO: Accept log functions to pipe logs with.\n// Runs a child command, returning the child process instance.\n// Use it along with waitForSignal to run a long running process e.g. mkdocs serve\nexport const run = async (\n name: string,\n args: string[] = [],\n options: SpawnOptionsPartialEnv = {},\n): Promise<ChildProcess> => {\n const { stdoutLogFunc, stderrLogFunc } = options;\n\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n FORCE_COLOR: 'true',\n ...(options.env ?? {}),\n };\n\n // Refer: https://nodejs.org/api/child_process.html#child_process_subprocess_stdio\n const stdio = [\n 'inherit',\n stdoutLogFunc ? 'pipe' : 'inherit',\n stderrLogFunc ? 'pipe' : 'inherit',\n ] as ('inherit' | 'pipe')[];\n\n const childProcess = spawn(name, args, {\n stdio: stdio,\n ...options,\n env,\n });\n\n if (stdoutLogFunc && childProcess.stdout) {\n childProcess.stdout.on('data', stdoutLogFunc);\n }\n if (stderrLogFunc && childProcess.stderr) {\n childProcess.stderr.on('data', stderrLogFunc);\n }\n\n return childProcess;\n};\n\n// Block indefinitely and wait for a signal to kill the child process(es)\n// Throw error if any child process errors\n// Resolves only when all processes exit with status code 0\nexport async function waitForSignal(\n childProcesses: Array<ChildProcess>,\n): Promise<void> {\n const promises: Array<Promise<void>> = [];\n\n for (const signal of ['SIGINT', 'SIGTERM'] as const) {\n process.on(signal, () => {\n childProcesses.forEach(childProcess => {\n childProcess.kill();\n });\n });\n }\n\n childProcesses.forEach(childProcess => {\n if (typeof childProcess.exitCode === 'number') {\n if (childProcess.exitCode) {\n throw new Error(`Non zero exit code from child process`);\n }\n return;\n }\n\n promises.push(\n new Promise<void>((resolve, reject) => {\n childProcess.once('error', reject);\n childProcess.once('exit', resolve);\n }),\n );\n });\n\n await Promise.all(promises);\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 { ChildProcess } from 'child_process';\nimport { run, LogFunc } from './run';\n\nexport const runMkdocsServer = async (options: {\n port?: string;\n useDocker?: boolean;\n dockerImage?: string;\n stdoutLogFunc?: LogFunc;\n stderrLogFunc?: LogFunc;\n}): Promise<ChildProcess> => {\n const port = options.port ?? '8000';\n const useDocker = options.useDocker ?? true;\n const dockerImage = options.dockerImage ?? 'spotify/techdocs';\n\n if (useDocker) {\n return await run(\n 'docker',\n [\n 'run',\n '--rm',\n '-w',\n '/content',\n '-v',\n `${process.cwd()}:/content`,\n '-p',\n `${port}:${port}`,\n '-it',\n dockerImage,\n 'serve',\n '--dev-addr',\n `0.0.0.0:${port}`,\n ],\n {\n stdoutLogFunc: options.stdoutLogFunc,\n stderrLogFunc: options.stderrLogFunc,\n },\n );\n }\n\n return await run('mkdocs', ['serve', '--dev-addr', `127.0.0.1:${port}`], {\n stdoutLogFunc: options.stdoutLogFunc,\n stderrLogFunc: options.stderrLogFunc,\n });\n};\n"],"names":["spawn"],"mappings":";;;;AA6BO,MAAM,MAAM,OACjB,IAAA,EACA,IAAiB,GAAA,EAAA,EACjB,UAAkC,EACR,KAAA;AAjC5B,EAAA,IAAA,EAAA,CAAA;AAkCE,EAAM,MAAA,EAAE,eAAe,aAAkB,EAAA,GAAA,OAAA,CAAA;AAEzC,EAAA,MAAM,GAAyB,GAAA;AAAA,IAAA,GAC1B,OAAQ,CAAA,GAAA;AAAA,IACX,WAAa,EAAA,MAAA;AAA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,EAAA,IAAA,CAAA,CAAA;AAAA,KAEb,EAAA;AAAA,MACE,eAAe,OAAQ,CAAA,aAAA;AAAA,MACvB,eAAe,OAAQ,CAAA,aAAA;AAAA,KAAA,CAAA,CAAA;AAAA,GAAA;AAK7B,EAAA,OAAO,MAAM,GAAI,CAAA,QAAA,EAAU,CAAC,OAAS,EAAA,YAAA,EAAc,aAAa,IAAS,CAAA,CAAA,CAAA,EAAA;AAAA,IACvE,eAAe,OAAQ,CAAA,aAAA;AAAA,IACvB,eAAe,OAAQ,CAAA,aAAA;AAAA,GAAA,CAAA,CAAA;AAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"publish-7bf1e5f7.cjs.js","sources":["../../src/commands/publish/publish.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { Command } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { SingleHostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(cmd: Command): Promise<any> {\n const logger = createLogger({ verbose: cmd.verbose });\n\n const config = PublisherConfig.getValidConfig(cmd);\n const discovery = SingleHostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = cmd.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(cmd.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","SingleHostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;uBAwBsC,KAA4B;AAChE,QAAM,SAASA,qBAAa,EAAE,SAAS,IAAI;AAE3C,QAAM,SAASC,gCAAgB,eAAe;AAC9C,QAAM,YAAYC,kCAAoB,WAAW;AACjD,QAAM,YAAY,MAAMC,6BAAU,WAAW,QAAQ,EAAE,QAAQ;AAG/D,QAAM,EAAE,gBAAgB,MAAM,UAAU;AACxC,MAAI,CAAC,aAAa;AAEhB,WAAO,QAAQ,OAAO,IAAI,MAAM;AAAA;AAGlC,QAAM,CAAC,WAAW,MAAM,QAAQ,IAAI,OAAO,MAAM;AACjD,QAAM,SAAS;AAAA,IACb;AAAA,IACA,UAAU;AAAA,MACR;AAAA,MACA;AAAA;AAAA;AAIJ,QAAM,YAAYC,aAAQ,IAAI;AAC9B,QAAM,UAAU,QAAQ,EAAE,QAAQ;AAElC,SAAO;AAAA;;;;"}
1
+ {"version":3,"file":"publish-7bf1e5f7.cjs.js","sources":["../../src/commands/publish/publish.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { Command } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { SingleHostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(cmd: Command): Promise<any> {\n const logger = createLogger({ verbose: cmd.verbose });\n\n const config = PublisherConfig.getValidConfig(cmd);\n const discovery = SingleHostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = cmd.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(cmd.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","SingleHostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;AAwBA,eAAA,OAAA,CAAsC,GAA4B,EAAA;AAChE,EAAA,MAAM,MAAS,GAAAA,oBAAA,CAAa,EAAE,OAAA,EAAS,GAAI,CAAA,OAAA,EAAA,CAAA,CAAA;AAE3C,EAAM,MAAA,MAAA,GAASC,gCAAgB,cAAe,CAAA,GAAA,CAAA,CAAA;AAC9C,EAAM,MAAA,SAAA,GAAYC,kCAAoB,UAAW,CAAA,MAAA,CAAA,CAAA;AACjD,EAAA,MAAM,YAAY,MAAMC,4BAAA,CAAU,UAAW,CAAA,MAAA,EAAQ,EAAE,MAAQ,EAAA,SAAA,EAAA,CAAA,CAAA;AAG/D,EAAM,MAAA,EAAE,WAAgB,EAAA,GAAA,MAAM,SAAU,CAAA,YAAA,EAAA,CAAA;AACxC,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAO,OAAA,OAAA,CAAQ,MAAO,CAAA,IAAI,KAAM,CAAA,EAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAGlC,EAAA,MAAM,CAAC,SAAW,EAAA,IAAA,EAAM,IAAQ,CAAA,GAAA,GAAA,CAAI,OAAO,KAAM,CAAA,GAAA,CAAA,CAAA;AACjD,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,IAAA;AAAA,IACA,QAAU,EAAA;AAAA,MACR,SAAA;AAAA,MACA,IAAA;AAAA,KAAA;AAAA,GAAA,CAAA;AAIJ,EAAM,MAAA,SAAA,GAAYC,aAAQ,GAAI,CAAA,SAAA,CAAA,CAAA;AAC9B,EAAM,MAAA,SAAA,CAAU,OAAQ,CAAA,EAAE,MAAQ,EAAA,SAAA,EAAA,CAAA,CAAA;AAElC,EAAO,OAAA,IAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"serve-21d1e885.cjs.js","sources":["../../src/lib/httpServer.ts","../../src/commands/serve/serve.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport serveHandler from 'serve-handler';\nimport http from 'http';\nimport httpProxy from 'http-proxy';\nimport { createLogger } from './utility';\n\nexport default class HTTPServer {\n private readonly proxyEndpoint: string;\n private readonly backstageBundleDir: string;\n private readonly backstagePort: number;\n private readonly mkdocsPort: number;\n private readonly verbose: boolean;\n\n constructor(\n backstageBundleDir: string,\n backstagePort: number,\n mkdocsPort: number,\n verbose: boolean,\n ) {\n this.proxyEndpoint = '/api/';\n this.backstageBundleDir = backstageBundleDir;\n this.backstagePort = backstagePort;\n this.mkdocsPort = mkdocsPort;\n this.verbose = verbose;\n }\n\n // Create a Proxy for mkdocs server\n private createProxy() {\n const proxy = httpProxy.createProxyServer({\n target: `http://localhost:${this.mkdocsPort}`,\n });\n\n return (request: http.IncomingMessage): [httpProxy, string] => {\n // If the request goes to /api/ we want to remove /api/ from the prefix of the request URL.\n // e.g. ['/', 'api', pathChunks]\n const [, , ...pathChunks] = request.url?.split('/') ?? [];\n const forwardPath = pathChunks.join('/');\n\n return [proxy, forwardPath];\n };\n }\n\n public async serve(): Promise<http.Server> {\n return new Promise<http.Server>((resolve, reject) => {\n const proxyHandler = this.createProxy();\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n if (request.url?.startsWith(this.proxyEndpoint)) {\n const [proxy, forwardPath] = proxyHandler(request);\n\n proxy.on('error', (error: Error) => {\n reject(error);\n });\n\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n\n request.url = forwardPath;\n proxy.web(request, response);\n return;\n }\n\n // This endpoint is used by the frontend to detect where the backend is running.\n if (request.url === '/.detect') {\n response.setHeader('Content-Type', 'text/plain');\n response.end('techdocs-cli-server');\n return;\n }\n\n serveHandler(request, response, {\n public: this.backstageBundleDir,\n trailingSlash: true,\n rewrites: [{ source: '**', destination: 'index.html' }],\n });\n },\n );\n\n const logger = createLogger({ verbose: false });\n server.listen(this.backstagePort, () => {\n if (this.verbose) {\n logger.info(\n `[techdocs-preview-bundle] Running local version of Backstage at http://localhost:${this.backstagePort}`,\n );\n }\n resolve(server);\n });\n\n server.on('error', (error: Error) => {\n reject(error);\n });\n });\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Command } from 'commander';\nimport path from 'path';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { findPaths } from '@backstage/cli-common';\nimport HTTPServer from '../../lib/httpServer';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { createLogger } from '../../lib/utility';\n\nfunction findPreviewBundlePath(): string {\n try {\n return path.join(\n path.dirname(require.resolve('techdocs-cli-embedded-app/package.json')),\n 'dist',\n );\n } catch {\n // If the techdocs-cli-embedded-app package is not available it means we're\n // running a published package. For published packages the preview bundle is\n // copied to dist/embedded-app be the prepack script.\n //\n // This can be tested by running `yarn pack` and extracting the resulting tarball into a directory.\n // Within the extracted directory, run `npm install --only=prod`.\n // Once that's done you can test the CLI in any directory using `node <tmp-dir>/package <command>`.\n // eslint-disable-next-line no-restricted-syntax\n return findPaths(__dirname).resolveOwn('dist/embedded-app');\n }\n}\n\nexport default async function serve(cmd: Command) {\n const logger = createLogger({ verbose: cmd.verbose });\n\n // Determine if we want to run in local dev mode or not\n // This will run the backstage http server on a different port and only used\n // for proxying mkdocs to the backstage app running locally (e.g. with webpack-dev-server)\n const isDevMode = Object.keys(process.env).includes('TECHDOCS_CLI_DEV_MODE')\n ? true\n : false;\n\n // TODO: Backstage app port should also be configurable as a CLI option. However, since we bundle\n // a backstage app, we define app.baseUrl in the app-config.yaml.\n // Hence, it is complicated to make this configurable.\n const backstagePort = 3000;\n const backstageBackendPort = 7007;\n\n const mkdocsDockerAddr = `http://0.0.0.0:${cmd.mkdocsPort}`;\n const mkdocsLocalAddr = `http://127.0.0.1:${cmd.mkdocsPort}`;\n const mkdocsExpectedDevAddr = cmd.docker ? mkdocsDockerAddr : mkdocsLocalAddr;\n\n let mkdocsServerHasStarted = false;\n const mkdocsLogFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line\n const logLines = data.toString().split('\\n');\n const logPrefix = cmd.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !mkdocsServerHasStarted &&\n line.includes(`Serving on ${mkdocsExpectedDevAddr}`)\n ) {\n mkdocsServerHasStarted = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n logger.info('Starting mkdocs server.');\n const mkdocsChildProcess = await runMkdocsServer({\n port: cmd.mkdocsPort,\n dockerImage: cmd.dockerImage,\n useDocker: cmd.docker,\n stdoutLogFunc: mkdocsLogFunc,\n stderrLogFunc: mkdocsLogFunc,\n });\n\n // Wait until mkdocs server has started so that Backstage starts with docs loaded\n // Takes 1-5 seconds\n for (let attempt = 0; attempt < 30; attempt++) {\n await new Promise(r => setTimeout(r, 3000));\n if (mkdocsServerHasStarted) {\n break;\n }\n logger.info('Waiting for mkdocs server to start...');\n }\n\n if (!mkdocsServerHasStarted) {\n logger.error(\n 'mkdocs server did not start. Exiting. Try re-running command with -v option for more details.',\n );\n }\n\n const port = isDevMode ? backstageBackendPort : backstagePort;\n const httpServer = new HTTPServer(\n findPreviewBundlePath(),\n port,\n cmd.mkdocsPort,\n cmd.verbose,\n );\n\n httpServer\n .serve()\n .catch(err => {\n logger.error(err);\n mkdocsChildProcess.kill();\n process.exit(1);\n })\n .then(() => {\n // The last three things default/component/local/ don't matter. They can be anything.\n openBrowser(`http://localhost:${port}/docs/default/component/local/`);\n logger.info(\n `Serving docs in Backstage at http://localhost:${port}/docs/default/component/local/\\nOpening browser.`,\n );\n });\n\n await waitForSignal([mkdocsChildProcess]);\n}\n"],"names":["httpProxy","http","createLogger","path","findPaths","runMkdocsServer","waitForSignal"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAqBgC;AAAA,EAO9B,YACE,oBACA,eACA,YACA,SACA;AACA,SAAK,gBAAgB;AACrB,SAAK,qBAAqB;AAC1B,SAAK,gBAAgB;AACrB,SAAK,aAAa;AAClB,SAAK,UAAU;AAAA;AAAA,EAIT,cAAc;A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BAAc,CAAC;AAAA;;;;"}
1
+ {"version":3,"file":"serve-21d1e885.cjs.js","sources":["../../src/lib/httpServer.ts","../../src/commands/serve/serve.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport serveHandler from 'serve-handler';\nimport http from 'http';\nimport httpProxy from 'http-proxy';\nimport { createLogger } from './utility';\n\nexport default class HTTPServer {\n private readonly proxyEndpoint: string;\n private readonly backstageBundleDir: string;\n private readonly backstagePort: number;\n private readonly mkdocsPort: number;\n private readonly verbose: boolean;\n\n constructor(\n backstageBundleDir: string,\n backstagePort: number,\n mkdocsPort: number,\n verbose: boolean,\n ) {\n this.proxyEndpoint = '/api/';\n this.backstageBundleDir = backstageBundleDir;\n this.backstagePort = backstagePort;\n this.mkdocsPort = mkdocsPort;\n this.verbose = verbose;\n }\n\n // Create a Proxy for mkdocs server\n private createProxy() {\n const proxy = httpProxy.createProxyServer({\n target: `http://localhost:${this.mkdocsPort}`,\n });\n\n return (request: http.IncomingMessage): [httpProxy, string] => {\n // If the request goes to /api/ we want to remove /api/ from the prefix of the request URL.\n // e.g. ['/', 'api', pathChunks]\n const [, , ...pathChunks] = request.url?.split('/') ?? [];\n const forwardPath = pathChunks.join('/');\n\n return [proxy, forwardPath];\n };\n }\n\n public async serve(): Promise<http.Server> {\n return new Promise<http.Server>((resolve, reject) => {\n const proxyHandler = this.createProxy();\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n if (request.url?.startsWith(this.proxyEndpoint)) {\n const [proxy, forwardPath] = proxyHandler(request);\n\n proxy.on('error', (error: Error) => {\n reject(error);\n });\n\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n\n request.url = forwardPath;\n proxy.web(request, response);\n return;\n }\n\n // This endpoint is used by the frontend to detect where the backend is running.\n if (request.url === '/.detect') {\n response.setHeader('Content-Type', 'text/plain');\n response.end('techdocs-cli-server');\n return;\n }\n\n serveHandler(request, response, {\n public: this.backstageBundleDir,\n trailingSlash: true,\n rewrites: [{ source: '**', destination: 'index.html' }],\n });\n },\n );\n\n const logger = createLogger({ verbose: false });\n server.listen(this.backstagePort, () => {\n if (this.verbose) {\n logger.info(\n `[techdocs-preview-bundle] Running local version of Backstage at http://localhost:${this.backstagePort}`,\n );\n }\n resolve(server);\n });\n\n server.on('error', (error: Error) => {\n reject(error);\n });\n });\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Command } from 'commander';\nimport path from 'path';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { findPaths } from '@backstage/cli-common';\nimport HTTPServer from '../../lib/httpServer';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { createLogger } from '../../lib/utility';\n\nfunction findPreviewBundlePath(): string {\n try {\n return path.join(\n path.dirname(require.resolve('techdocs-cli-embedded-app/package.json')),\n 'dist',\n );\n } catch {\n // If the techdocs-cli-embedded-app package is not available it means we're\n // running a published package. For published packages the preview bundle is\n // copied to dist/embedded-app be the prepack script.\n //\n // This can be tested by running `yarn pack` and extracting the resulting tarball into a directory.\n // Within the extracted directory, run `npm install --only=prod`.\n // Once that's done you can test the CLI in any directory using `node <tmp-dir>/package <command>`.\n // eslint-disable-next-line no-restricted-syntax\n return findPaths(__dirname).resolveOwn('dist/embedded-app');\n }\n}\n\nexport default async function serve(cmd: Command) {\n const logger = createLogger({ verbose: cmd.verbose });\n\n // Determine if we want to run in local dev mode or not\n // This will run the backstage http server on a different port and only used\n // for proxying mkdocs to the backstage app running locally (e.g. with webpack-dev-server)\n const isDevMode = Object.keys(process.env).includes('TECHDOCS_CLI_DEV_MODE')\n ? true\n : false;\n\n // TODO: Backstage app port should also be configurable as a CLI option. However, since we bundle\n // a backstage app, we define app.baseUrl in the app-config.yaml.\n // Hence, it is complicated to make this configurable.\n const backstagePort = 3000;\n const backstageBackendPort = 7007;\n\n const mkdocsDockerAddr = `http://0.0.0.0:${cmd.mkdocsPort}`;\n const mkdocsLocalAddr = `http://127.0.0.1:${cmd.mkdocsPort}`;\n const mkdocsExpectedDevAddr = cmd.docker ? mkdocsDockerAddr : mkdocsLocalAddr;\n\n let mkdocsServerHasStarted = false;\n const mkdocsLogFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line\n const logLines = data.toString().split('\\n');\n const logPrefix = cmd.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !mkdocsServerHasStarted &&\n line.includes(`Serving on ${mkdocsExpectedDevAddr}`)\n ) {\n mkdocsServerHasStarted = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n logger.info('Starting mkdocs server.');\n const mkdocsChildProcess = await runMkdocsServer({\n port: cmd.mkdocsPort,\n dockerImage: cmd.dockerImage,\n useDocker: cmd.docker,\n stdoutLogFunc: mkdocsLogFunc,\n stderrLogFunc: mkdocsLogFunc,\n });\n\n // Wait until mkdocs server has started so that Backstage starts with docs loaded\n // Takes 1-5 seconds\n for (let attempt = 0; attempt < 30; attempt++) {\n await new Promise(r => setTimeout(r, 3000));\n if (mkdocsServerHasStarted) {\n break;\n }\n logger.info('Waiting for mkdocs server to start...');\n }\n\n if (!mkdocsServerHasStarted) {\n logger.error(\n 'mkdocs server did not start. Exiting. Try re-running command with -v option for more details.',\n );\n }\n\n const port = isDevMode ? backstageBackendPort : backstagePort;\n const httpServer = new HTTPServer(\n findPreviewBundlePath(),\n port,\n cmd.mkdocsPort,\n cmd.verbose,\n );\n\n httpServer\n .serve()\n .catch(err => {\n logger.error(err);\n mkdocsChildProcess.kill();\n process.exit(1);\n })\n .then(() => {\n // The last three things default/component/local/ don't matter. They can be anything.\n openBrowser(`http://localhost:${port}/docs/default/component/local/`);\n logger.info(\n `Serving docs in Backstage at http://localhost:${port}/docs/default/component/local/\\nOpening browser.`,\n );\n });\n\n await waitForSignal([mkdocsChildProcess]);\n}\n"],"names":["httpProxy","http","serveHandler","createLogger","path","findPaths","runMkdocsServer","openBrowser","waitForSignal"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBgC,MAAA,UAAA,CAAA;AAAA,EAO9B,WACE,CAAA,kBAAA,EACA,aACA,EAAA,UAAA,EACA,OACA,EAAA;AACA,IAAA,IAAA,CAAK,aAAgB,GAAA,OAAA,CAAA;AACrB,IAAA,IAAA,CAAK,kBAAqB,GAAA,kBAAA,CAAA;AAC1B,IAAA,IAAA,CAAK,aAAgB,GAAA,aAAA,CAAA;AACrB,IAAA,IAAA,CAAK,UAAa,GAAA,UAAA,CAAA;AAClB,IAAA,IAAA,CAAK,OAAU,GAAA,OAAA,CAAA;AAAA,GAAA;AAAA,EAIT,WAAc,GAAA;AACpB,IAAM,MAAA,KAAA,GAAQA,8BAAU,iBAAkB,CAAA;AAAA,MACxC,MAAA,EAAQ,oBAAoB,IAAK,CAAA,UAAA,CAAA,CAAA;AAAA,K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CAAQ,IAAK,CAAA,CAAA,CAAA,CAAA;AAAA,GAAA,CAAA,CAEd,KAAK,MAAM;AAEV,IAAAC,+BAAA,CAAY,CAAoB,iBAAA,EAAA,IAAA,CAAA,8BAAA,CAAA,CAAA,CAAA;AAChC,IAAA,MAAA,CAAO,KACL,CAAiD,8CAAA,EAAA,IAAA,CAAA;AAAA,gBAAA,CAAA,CAAA,CAAA;AAAA,GAAA,CAAA,CAAA;AAIvD,EAAA,MAAMC,2BAAc,CAAC,kBAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utility-51f4a306.cjs.js","sources":["../../src/lib/utility.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n RemoteProtocol,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport * as winston from 'winston';\n\nexport const convertTechDocsRefToLocationAnnotation = (\n techdocsRef: string,\n): ParsedLocationAnnotation => {\n // Split on the first colon for the protocol and the rest after the first split\n // is the location.\n const [type, target] = techdocsRef.split(/:(.+)/) as [\n RemoteProtocol?,\n string?,\n ];\n\n if (!type || !target) {\n throw new Error(\n `Can not parse --techdocs-ref ${techdocsRef}. Should be of type HOST:URL.`,\n );\n }\n\n return { type, target };\n};\n\nexport const createLogger = ({\n verbose = false,\n}: {\n verbose: boolean;\n}): winston.Logger => {\n const logger = winston.createLogger({\n level: verbose ? 'verbose' : 'info',\n transports: [\n new winston.transports.Console({ format: winston.format.simple() }),\n ],\n });\n\n return logger;\n};\n"],"names":["winston"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAqBa,yCAAyC,CACpD,gBAC6B;AAG7B,QAAM,CAAC,MAAM,UAAU,YAAY,MAAM;AAKzC,MAAI,CAAC,QAAQ,CAAC,QAAQ;AACpB,UAAM,IAAI,MACR,gCAAgC;AAAA;AAIpC,SAAO,EAAE,MAAM;AAAA;MAGJ,eAAe,CAAC;AAAA,EAC3B,UAAU;AAAA,MAGU;AACpB,QAAM,SAASA,mBAAQ,aAAa;AAAA,IAClC,OAAO,UAAU,YAAY;AAAA,IAC7B,YAAY;AAAA,MACV,IAAIA,mBAAQ,WAAW,QAAQ,EAAE,QAAQA,mBAAQ,OAAO;AAAA;AAAA;AAI5D,SAAO;AAAA;;;;;"}
1
+ {"version":3,"file":"utility-51f4a306.cjs.js","sources":["../../src/lib/utility.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n RemoteProtocol,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport * as winston from 'winston';\n\nexport const convertTechDocsRefToLocationAnnotation = (\n techdocsRef: string,\n): ParsedLocationAnnotation => {\n // Split on the first colon for the protocol and the rest after the first split\n // is the location.\n const [type, target] = techdocsRef.split(/:(.+)/) as [\n RemoteProtocol?,\n string?,\n ];\n\n if (!type || !target) {\n throw new Error(\n `Can not parse --techdocs-ref ${techdocsRef}. Should be of type HOST:URL.`,\n );\n }\n\n return { type, target };\n};\n\nexport const createLogger = ({\n verbose = false,\n}: {\n verbose: boolean;\n}): winston.Logger => {\n const logger = winston.createLogger({\n level: verbose ? 'verbose' : 'info',\n transports: [\n new winston.transports.Console({ format: winston.format.simple() }),\n ],\n });\n\n return logger;\n};\n"],"names":["winston"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBa,MAAA,sCAAA,GAAyC,CACpD,WAC6B,KAAA;AAG7B,EAAA,MAAM,CAAC,IAAA,EAAM,MAAU,CAAA,GAAA,WAAA,CAAY,KAAM,CAAA,OAAA,CAAA,CAAA;AAKzC,EAAI,IAAA,CAAC,IAAQ,IAAA,CAAC,MAAQ,EAAA;AACpB,IAAM,MAAA,IAAI,MACR,CAAgC,6BAAA,EAAA,WAAA,CAAA,6BAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAIpC,EAAA,OAAO,EAAE,IAAM,EAAA,MAAA,EAAA,CAAA;AAAA,EAAA;AAGV,MAAM,eAAe,CAAC;AAAA,EAC3B,OAAU,GAAA,KAAA;AAAA,CAGU,KAAA;AACpB,EAAM,MAAA,MAAA,GAASA,mBAAQ,YAAa,CAAA;AAAA,IAClC,KAAA,EAAO,UAAU,SAAY,GAAA,MAAA;AAAA,IAC7B,UAAY,EAAA;AAAA,MACV,IAAIA,kBAAQ,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,EAAQA,mBAAQ,MAAO,CAAA,MAAA,EAAA,EAAA,CAAA;AAAA,KAAA;AAAA,GAAA,CAAA,CAAA;AAI5D,EAAO,OAAA,MAAA,CAAA;AAAA;;;;;"}
@@ -271,11 +271,6 @@
271
271
  "visibility": "frontend",
272
272
  "type": "boolean"
273
273
  },
274
- "requestUrl": {
275
- "visibility": "frontend",
276
- "deprecated": "",
277
- "type": "string"
278
- },
279
274
  "sanitizer": {
280
275
  "type": "object",
281
276
  "properties": {
@@ -369,6 +364,38 @@
369
364
  ]
370
365
  }
371
366
  },
367
+ "gerrit": {
368
+ "description": "Integration configuration for Gerrit",
369
+ "type": "array",
370
+ "items": {
371
+ "type": "object",
372
+ "properties": {
373
+ "host": {
374
+ "description": "The hostname of the given Gerrit instance",
375
+ "visibility": "frontend",
376
+ "type": "string"
377
+ },
378
+ "baseUrl": {
379
+ "description": "The base url for the Gerrit instance.",
380
+ "visibility": "frontend",
381
+ "type": "string"
382
+ },
383
+ "username": {
384
+ "description": "The username to use for authenticated requests.",
385
+ "visibility": "secret",
386
+ "type": "string"
387
+ },
388
+ "password": {
389
+ "description": "Gerrit password used to authenticate requests. This can be either a password\nor a generated access token.",
390
+ "visibility": "secret",
391
+ "type": "string"
392
+ }
393
+ },
394
+ "required": [
395
+ "host"
396
+ ]
397
+ }
398
+ },
372
399
  "github": {
373
400
  "description": "Integration configuration for GitHub",
374
401
  "type": "array",
@@ -643,6 +670,7 @@
643
670
  "client": {
644
671
  "description": "Default database client to use",
645
672
  "enum": [
673
+ "better-sqlite3",
646
674
  "pg",
647
675
  "sqlite3"
648
676
  ],
@@ -693,6 +721,7 @@
693
721
  "client": {
694
722
  "description": "Database client override",
695
723
  "enum": [
724
+ "better-sqlite3",
696
725
  "pg",
697
726
  "sqlite3"
698
727
  ],
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.cc995f30.js"></script><script defer="defer" src="/static/module-material-ui.3c0e2d92.js"></script><script defer="defer" src="/static/module-lodash.f158b49a.js"></script><script defer="defer" src="/static/module-date-fns.a08d117e.js"></script><script defer="defer" src="/static/module-ajv.ed51f4b8.js"></script><script defer="defer" src="/static/module-material-table.a73fb7f5.js"></script><script defer="defer" src="/static/module-yaml.574c3290.js"></script><script defer="defer" src="/static/module-hot-loader.7c7a4226.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.2ab2ffc2.js"></script><script defer="defer" src="/static/vendor.cc995f30.js"></script><script defer="defer" src="/static/main.cc995f30.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.0b0e8219.js"></script><script defer="defer" src="/static/module-material-ui.3c0e2d92.js"></script><script defer="defer" src="/static/module-lodash.f158b49a.js"></script><script defer="defer" src="/static/module-date-fns.a08d117e.js"></script><script defer="defer" src="/static/module-ajv.ed51f4b8.js"></script><script defer="defer" src="/static/module-material-table.cbad0c40.js"></script><script defer="defer" src="/static/module-yaml.574c3290.js"></script><script defer="defer" src="/static/module-hot-loader.7c7a4226.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.a9014a2e.js"></script><script defer="defer" src="/static/vendor.0b0e8219.js"></script><script defer="defer" src="/static/main.0b0e8219.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -1,3 +1,3 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1553,2426],{11553:function(y,i,n){n.r(i),n.d(i,{HasResourcesCard:function(){return s}});var r=n(48023),t=n(2784),e=n(62426);function s(a){const{variant:c="gridItem"}=a;return t.createElement(e.RelatedEntitiesCard,{variant:c,title:"Has resources",entityKind:"Resource",relationType:r.aS,columns:e.resourceEntityColumns,asRenderableEntities:e.asResourceEntities,emptyMessage:"No resource is part of this system",emptyHelpLink:e.resourceEntityHelpLink})}},62426:function(y,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return a},asComponentEntities:function(){return d},asResourceEntities:function(){return C},asSystemEntities:function(){return b},componentEntityColumns:function(){return c},componentEntityHelpLink:function(){return E},resourceEntityColumns:function(){return p},resourceEntityHelpLink:function(){return f},systemEntityColumns:function(){return T},systemEntityHelpLink:function(){return R}});var r=n(90436),t=n(22707),e=n(2784),s=n(9118);function a(o){const{variant:l="gridItem",title:u,columns:v,entityKind:g,relationType:h,emptyMessage:L,emptyHelpLink:k,asRenderableEntities:H}=o,{entity:S}=(0,t.useEntity)(),{entities:K,loading:M,error:m}=(0,t.useRelatedEntities)(S,{type:h,kind:g});return M?e.createElement(s.InfoCard,{variant:l,title:u},e.createElement(s.Progress,null)):m?e.createElement(s.InfoCard,{variant:l,title:u},e.createElement(s.ResponseErrorPanel,{error:m})):e.createElement(t.EntityTable,{title:u,variant:l,emptyContent:e.createElement("div",{style:{textAlign:"center"}},e.createElement(r.Z,{variant:"body1"},L),e.createElement(r.Z,{variant:"body2"},e.createElement(s.Link,{to:k},"Learn how to change this."))),columns:v,entities:H(K||[])})}const c=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"component"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],E="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",d=o=>o,p=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"resource"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],f="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",C=o=>o,T=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"system"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],R="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",b=o=>o}}]);})();
1
+ "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1553,2426],{11553:function(y,i,n){n.r(i),n.d(i,{HasResourcesCard:function(){return s}});var r=n(48023),t=n(2784),e=n(62426);function s(a){const{variant:c="gridItem"}=a;return t.createElement(e.RelatedEntitiesCard,{variant:c,title:"Has resources",entityKind:"Resource",relationType:r.aS,columns:e.resourceEntityColumns,asRenderableEntities:e.asResourceEntities,emptyMessage:"No resource is part of this system",emptyHelpLink:e.resourceEntityHelpLink})}},62426:function(y,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return a},asComponentEntities:function(){return d},asResourceEntities:function(){return C},asSystemEntities:function(){return b},componentEntityColumns:function(){return c},componentEntityHelpLink:function(){return E},resourceEntityColumns:function(){return p},resourceEntityHelpLink:function(){return f},systemEntityColumns:function(){return T},systemEntityHelpLink:function(){return R}});var r=n(90436),t=n(53479),e=n(2784),s=n(9118);function a(o){const{variant:l="gridItem",title:u,columns:v,entityKind:g,relationType:h,emptyMessage:L,emptyHelpLink:k,asRenderableEntities:H}=o,{entity:S}=(0,t.useEntity)(),{entities:K,loading:M,error:m}=(0,t.useRelatedEntities)(S,{type:h,kind:g});return M?e.createElement(s.InfoCard,{variant:l,title:u},e.createElement(s.Progress,null)):m?e.createElement(s.InfoCard,{variant:l,title:u},e.createElement(s.ResponseErrorPanel,{error:m})):e.createElement(t.EntityTable,{title:u,variant:l,emptyContent:e.createElement("div",{style:{textAlign:"center"}},e.createElement(r.Z,{variant:"body1"},L),e.createElement(r.Z,{variant:"body2"},e.createElement(s.Link,{to:k},"Learn how to change this."))),columns:v,entities:H(K||[])})}const c=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"component"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],E="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",d=o=>o,p=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"resource"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],f="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",C=o=>o,T=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"system"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],R="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",b=o=>o}}]);})();
2
2
 
3
- //# sourceMappingURL=1553.b7bcb06c.chunk.js.map
3
+ //# sourceMappingURL=1553.925835b9.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts"],"names":[],"mappings":"kPA8BO,WAA0B,EAAO,CACtC,KAAM,CAAE,UAAU,YAAe,EACjC,MACE,iBAAoB,sBAAqB,CACvC,QAAS,EACT,MAAO,gBACP,WAAY,WACZ,aAAc,KACd,QAAS,wBACT,qBAAsB,qBACtB,aAAc,qCACd,cAAe,6B,ufCed,WACL,EACA,CACA,KAAM,CACJ,UAAU,WACV,QACA,UACA,aACA,eACA,eACA,gBACA,wBACE,EAEE,CAAE,UAAW,kBACb,CAAE,WAAU,UAAS,SAAU,yBAAmB,EAAQ,CAC9D,KAAM,EACN,KAAM,IAGR,MAAI,GAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,GACrD,gBAAoB,WAAU,OAKlC,EAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,GACrD,gBAAoB,qBAAoB,CAAE,MAAO,KAMvD,gBAAoB,cAAa,CAC/B,MAAO,EACP,QAAS,EACT,aACE,gBAAoB,MAAO,CAAE,MAAO,CAAE,UAAW,WAC7C,gBAAoB,IAAY,CAAE,QAAS,SAAW,GACtD,gBAAoB,IAAY,CAAE,QAAS,SACzC,gBAAoB,OAAM,CAAE,GAAI,GAAiB,+BAIzD,QAAS,EACT,SAAU,EAAqB,GAAY,MCjF1C,KAAM,GAAyB,CACpC,4CAA0C,CAAE,YAAa,cACzD,0CACA,6CACA,kDACA,yDAEW,EACX,uFACW,EAAuB,GAClC,EAEW,EAAwB,CACnC,4CAA0C,CAAE,YAAa,aACzD,0CACA,6CACA,kDACA,yDAEW,EACX,sFACW,EAAsB,GACjC,EAEW,EAAsB,CACjC,4CAA0C,CAAE,YAAa,WACzD,0CACA,yDAEW,EACX,oFACW,EAAoB,GAC/B","file":"static/1553.b7bcb06c.chunk.js","sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { RELATION_HAS_PART } from '@backstage/catalog-model';\nimport React from 'react';\nimport {\n asResourceEntities,\n RelatedEntitiesCard,\n resourceEntityColumns,\n resourceEntityHelpLink,\n} from '../RelatedEntitiesCard';\n\n/** @public */\n\n\n\n\nexport function HasResourcesCard(props) {\n const { variant = 'gridItem' } = props;\n return (\n React.createElement(RelatedEntitiesCard, {\n variant: variant,\n title: \"Has resources\" ,\n entityKind: \"Resource\",\n relationType: RELATION_HAS_PART,\n columns: resourceEntityColumns,\n asRenderableEntities: asResourceEntities,\n emptyMessage: \"No resource is part of this system\" ,\n emptyHelpLink: resourceEntityHelpLink,}\n )\n );\n}\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n Link,\n Progress,\n ResponseErrorPanel,\n\n} from '@backstage/core-components';\n\n/** @public */\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard(\n props,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(Progress, null )\n )\n );\n }\n\n if (error) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(ResponseErrorPanel, { error: error,} )\n )\n );\n }\n\n return (\n React.createElement(EntityTable, {\n title: title,\n variant: variant,\n emptyContent: \n React.createElement('div', { style: { textAlign: 'center' },}\n , React.createElement(Typography, { variant: \"body1\",}, emptyMessage)\n , React.createElement(Typography, { variant: \"body2\",}\n , React.createElement(Link, { to: emptyHelpLink,}, \"Learn how to change this.\" )\n )\n )\n ,\n columns: columns,\n entities: asRenderableEntities(entities || []),}\n )\n );\n}\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { EntityTable } from '@backstage/plugin-catalog-react';\n\n\nexport const componentEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities) =>\n entities ;\n\nexport const resourceEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities) =>\n entities ;\n\nexport const systemEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities) =>\n entities ;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts"],"names":[],"mappings":"kPA8BO,WAA0B,EAAO,CACtC,KAAM,CAAE,UAAU,YAAe,EACjC,MACE,iBAAoB,sBAAqB,CACvC,QAAS,EACT,MAAO,gBACP,WAAY,WACZ,aAAc,KACd,QAAS,wBACT,qBAAsB,qBACtB,aAAc,qCACd,cAAe,6B,ufCed,WACL,EACA,CACA,KAAM,CACJ,UAAU,WACV,QACA,UACA,aACA,eACA,eACA,gBACA,wBACE,EAEE,CAAE,UAAW,kBACb,CAAE,WAAU,UAAS,SAAU,yBAAmB,EAAQ,CAC9D,KAAM,EACN,KAAM,IAGR,MAAI,GAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,GACrD,gBAAoB,WAAU,OAKlC,EAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,GACrD,gBAAoB,qBAAoB,CAAE,MAAO,KAMvD,gBAAoB,cAAa,CAC/B,MAAO,EACP,QAAS,EACT,aACE,gBAAoB,MAAO,CAAE,MAAO,CAAE,UAAW,WAC7C,gBAAoB,IAAY,CAAE,QAAS,SAAW,GACtD,gBAAoB,IAAY,CAAE,QAAS,SACzC,gBAAoB,OAAM,CAAE,GAAI,GAAiB,+BAIzD,QAAS,EACT,SAAU,EAAqB,GAAY,MCjF1C,KAAM,GAAyB,CACpC,4CAA0C,CAAE,YAAa,cACzD,0CACA,6CACA,kDACA,yDAEW,EACX,uFACW,EAAuB,GAClC,EAEW,EAAwB,CACnC,4CAA0C,CAAE,YAAa,aACzD,0CACA,6CACA,kDACA,yDAEW,EACX,sFACW,EAAsB,GACjC,EAEW,EAAsB,CACjC,4CAA0C,CAAE,YAAa,WACzD,0CACA,yDAEW,EACX,oFACW,EAAoB,GAC/B","file":"static/1553.925835b9.chunk.js","sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { RELATION_HAS_PART } from '@backstage/catalog-model';\nimport React from 'react';\nimport {\n asResourceEntities,\n RelatedEntitiesCard,\n resourceEntityColumns,\n resourceEntityHelpLink,\n} from '../RelatedEntitiesCard';\n\n/** @public */\n\n\n\n\nexport function HasResourcesCard(props) {\n const { variant = 'gridItem' } = props;\n return (\n React.createElement(RelatedEntitiesCard, {\n variant: variant,\n title: \"Has resources\" ,\n entityKind: \"Resource\",\n relationType: RELATION_HAS_PART,\n columns: resourceEntityColumns,\n asRenderableEntities: asResourceEntities,\n emptyMessage: \"No resource is part of this system\" ,\n emptyHelpLink: resourceEntityHelpLink,}\n )\n );\n}\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n Link,\n Progress,\n ResponseErrorPanel,\n\n} from '@backstage/core-components';\n\n/** @public */\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard(\n props,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(Progress, null )\n )\n );\n }\n\n if (error) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(ResponseErrorPanel, { error: error,} )\n )\n );\n }\n\n return (\n React.createElement(EntityTable, {\n title: title,\n variant: variant,\n emptyContent: \n React.createElement('div', { style: { textAlign: 'center' },}\n , React.createElement(Typography, { variant: \"body1\",}, emptyMessage)\n , React.createElement(Typography, { variant: \"body2\",}\n , React.createElement(Link, { to: emptyHelpLink,}, \"Learn how to change this.\" )\n )\n )\n ,\n columns: columns,\n entities: asRenderableEntities(entities || []),}\n )\n );\n}\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { EntityTable } from '@backstage/plugin-catalog-react';\n\n\nexport const componentEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities) =>\n entities ;\n\nexport const resourceEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities) =>\n entities ;\n\nexport const systemEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities) =>\n entities ;\n"],"sourceRoot":""}
@@ -1,8 +1,8 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1959],{52160:function(Z,m,n){var v,d=n(14859),e=n(93291);v={value:!0},m.Z=void 0;var h=e(n(2784)),f=d(n(50175)),y=(0,f.default)(h.createElement("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}),"Language");m.Z=y},81959:function(Z,m,n){n.r(m),n.d(m,{EntityLinksCard:function(){return D}});var v=n(22707),d=n(52160),e=n(2784),h=n(79692),f=n(90436),y=n(77277),E=n(9118);const L=`metadata:
1
+ "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1959],{52160:function(Z,m,n){var v,d=n(14859),e=n(93291);v={value:!0},m.Z=void 0;var h=e(n(2784)),f=d(n(50175)),y=(0,f.default)(h.createElement("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}),"Language");m.Z=y},81959:function(Z,m,n){n.r(m),n.d(m,{EntityLinksCard:function(){return D}});var v=n(53479),d=n(52160),e=n(2784),h=n(79692),f=n(90436),y=n(77277),E=n(9118);const L=`metadata:
2
2
  name: example
3
3
  links:
4
4
  - url: https://dashboard.example.com
5
5
  title: My Dashboard
6
6
  icon: dashboard`,x=(0,h.Z)(a=>({code:{borderRadius:6,margin:`${a.spacing(2)}px 0px`,background:a.palette.type==="dark"?"#444":"#fff"}}),{name:"PluginCatalogEntityLinksEmptyState"});function C(){const a=x();return e.createElement(e.Fragment,null,e.createElement(f.Z,{variant:"body1"},"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:"),e.createElement("div",{className:a.code},e.createElement(E.CodeSnippet,{text:L,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})),e.createElement(y.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional"},"Read more"))}var I=n(90348),b=n(11861),k=n(95544);const z=(0,h.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function S(a){const{href:c,text:o,Icon:s}=a,l=z();return e.createElement(k.Z,{display:"flex"},e.createElement(k.Z,{mr:1,className:l.svgIcon},e.createElement(f.Z,{component:"div"},s?e.createElement(s,null):e.createElement(d.Z,null))),e.createElement(k.Z,{flexGrow:"1"},e.createElement(E.Link,{to:c,target:"_blank",rel:"noopener"},o||c)))}var u=n(41156);const M={xs:1,sm:1,md:1,lg:2,xl:3};function N(a){var s,l;const c=[(0,u.Z)(t=>t.breakpoints.up("xl"))?"xl":null,(0,u.Z)(t=>t.breakpoints.up("lg"))?"lg":null,(0,u.Z)(t=>t.breakpoints.up("md"))?"md":null,(0,u.Z)(t=>t.breakpoints.up("sm"))?"sm":null,(0,u.Z)(t=>t.breakpoints.up("xs"))?"xs":null];let o=1;if(typeof a=="number")o=a;else{const t=(s=c.find(r=>r!==null))!=null?s:"xs";o=(l=a==null?void 0:a[t])!=null?l:M[t]}return o}function R(a){const{items:c,cols:o=void 0}=a,s=N(o);return e.createElement(I.Z,{rowHeight:"auto",cols:s},c.map(({text:l,href:t,Icon:r},g)=>e.createElement(b.Z,{key:g},e.createElement(S,{href:t,text:l!=null?l:t,Icon:r}))))}var A=n(36964);function D(a){var g;const{cols:c=void 0,variant:o}=a,{entity:s}=(0,v.useEntity)(),l=(0,A.useApp)(),t=p=>{var i;return p&&(i=l.getSystemIcon(p))!=null?i:d.Z},r=(g=s==null?void 0:s.metadata)==null?void 0:g.links;return e.createElement(E.InfoCard,{title:"Links",variant:o},!r||r.length===0?e.createElement(C,null):e.createElement(R,{cols:c,items:r.map(({url:p,title:i,icon:H})=>({text:i!=null?i:p,href:p,Icon:t(H)}))}))}}}]);})();
7
7
 
8
- //# sourceMappingURL=1959.6c1762da.chunk.js.map
8
+ //# sourceMappingURL=1959.2eb957a4.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://techdocs-cli-embedded-app/../node_modules/@material-ui/icons/Language.js","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/IconLink.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/useDynamicColumns.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"names":[],"mappings":"yJAEI,EAAyB,EAAQ,OAEjC,EAA0B,EAAQ,OAEtC,EAA6C,CAC3C,MAAO,IAET,EAAQ,EAAU,OAElB,GAAI,GAAQ,EAAwB,EAAQ,OAExC,EAAiB,EAAuB,EAAQ,QAEhD,EAAY,GAAG,EAAe,SAAuB,EAAM,cAAc,OAAQ,CACnF,EAAG,8yBACD,YAEJ,EAAQ,EAAU,G,0JCElB,KAAM,GAAc;AAAA;AAAA;AAAA;AAAA;AAAA,uBAUd,EAAY,QAChB,GAAU,EACR,KAAM,CACJ,aAAc,EACd,OAAQ,GAAG,EAAM,QAAQ,WACzB,WAAY,EAAM,QAAQ,OAAS,OAAS,OAAS,UAGzD,CAAE,KAAM,uCAGH,YAAiC,CACtC,KAAM,GAAU,IAEhB,MACE,iBAAoB,WAAgB,KA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OAAsB,EAAY,GAGhD,MAAO,GCbF,WAAuB,EAAO,CACnC,KAAM,CAAE,QAAO,OAAO,QAAc,EAC9B,EAAY,EAAkB,GAEpC,MACE,iBAAoB,IAAW,CAAE,UAAW,OAAQ,KAAM,GACtD,EAAM,IAAI,CAAC,CAAE,OAAM,OAAM,QAAQ,IACjC,gBAAoB,IAAe,CAAE,IAAK,GACtC,gBAAoB,EAAU,CAAE,KAAM,EAAM,KAAM,UAAQ,EAAM,KAAM,O,eCX3E,WAAyB,EAAO,C,MACrC,KAAM,CAAE,OAAO,OAAW,WAAY,EAChC,CAAE,UAAW,kBACb,EAAM,eAEN,EAAgB,GAAK,C,MACzB,UAAM,KAAI,cAAc,KAAlB,OAAyC,KAE3C,EAAQ,oBAAQ,WAAR,cAAkB,MAEhC,MACE,iBAAoB,WAAU,CAAE,MAAO,QAAS,QAAS,GACrD,CAAC,GAAS,EAAM,SAAW,EAC3B,gBAAoB,EAAuB,MAE3C,gBAAoB,EAAe,CACjC,KAAM,EACN,MAAO,EAAM,IAAI,CAAC,CAAE,MAAK,QAAO,UAAY,EAC1C,KAAM,UAAS,EACf,KAAM,EACN,KAAM,EAAa","file":"static/1959.6c1762da.chunk.js","sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z\"\n}), 'Language');\n\nexports.default = _default;","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\n\n\nconst useStyles = makeStyles(\n theme => ({\n code: {\n borderRadius: 6,\n margin: `${theme.spacing(2)}px 0px`,\n background: theme.palette.type === 'dark' ? '#444' : '#fff',\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n React.createElement(React.Fragment, null\n , React.createElement(Typography, { variant: \"body1\",}, \"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:\"\n\n\n )\n , React.createElement('div', { className: classes.code,}\n , React.createElement(CodeSnippet, {\n text: ENTITY_YAML,\n language: \"yaml\",\n showLineNumbers: true,\n highlightedNumbers: [3, 4, 5, 6],\n customStyle: { background: 'inherit', fontSize: '115%' },}\n )\n )\n , React.createElement(Button, {\n variant: \"contained\",\n color: \"primary\",\n target: \"_blank\",\n href: \"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\",}\n , \"Read more\"\n\n )\n )\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles, Box, Typography } from '@material-ui/core';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { Link } from '@backstage/core-components';\n\n\nconst useStyles = makeStyles({\n svgIcon: {\n display: 'inline-block',\n '& svg': {\n display: 'inline-block',\n fontSize: 'inherit',\n verticalAlign: 'baseline',\n },\n },\n});\n\nexport function IconLink(props\n\n\n\n) {\n const { href, text, Icon } = props;\n const classes = useStyles();\n\n return (\n React.createElement(Box, { display: \"flex\",}\n , React.createElement(Box, { mr: 1, className: classes.svgIcon,}\n , React.createElement(Typography, { component: \"div\",}\n , Icon ? React.createElement(Icon, null ) : React.createElement(LanguageIcon, null )\n )\n )\n , React.createElement(Box, { flexGrow: \"1\",}\n , React.createElement(Link, { to: href, target: \"_blank\", rel: \"noopener\",}\n , text || href\n )\n )\n )\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useMediaQuery } from '@material-ui/core';\n\n\nconst colDefaults = {\n xs: 1,\n sm: 1,\n md: 1,\n lg: 2,\n xl: 3,\n};\n\nexport function useDynamicColumns(\n cols,\n) {\n const matches = [\n useMediaQuery((theme) => theme.breakpoints.up('xl')) ? 'xl' : null,\n useMediaQuery((theme) => theme.breakpoints.up('lg')) ? 'lg' : null,\n useMediaQuery((theme) => theme.breakpoints.up('md')) ? 'md' : null,\n useMediaQuery((theme) => theme.breakpoints.up('sm')) ? 'sm' : null,\n useMediaQuery((theme) => theme.breakpoints.up('xs')) ? 'xs' : null,\n ];\n\n let numOfCols = 1;\n\n if (typeof cols === 'number') {\n numOfCols = cols;\n } else {\n const breakpoint = matches.find(k => k !== null) ?? 'xs';\n numOfCols = cols?.[breakpoint] ?? colDefaults[breakpoint];\n }\n\n return numOfCols;\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 { ImageList, ImageListItem } from '@material-ui/core';\nimport React from 'react';\nimport { IconLink } from './IconLink';\n\nimport { useDynamicColumns } from './useDynamicColumns';\n\n\n\n\n\n\n\n\n\n\n\n\n\nexport function LinksGridList(props) {\n const { items, cols = undefined } = props;\n const numOfCols = useDynamicColumns(cols);\n\n return (\n React.createElement(ImageList, { rowHeight: \"auto\", cols: numOfCols,}\n , items.map(({ text, href, Icon }, i) => (\n React.createElement(ImageListItem, { key: i,}\n , React.createElement(IconLink, { href: href, text: text ?? href, Icon: Icon,} )\n )\n ))\n )\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\n\nimport { useApp } from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\n\n/** @public */\n\n\n\n\n\nexport function EntityLinksCard(props) {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key) =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n React.createElement(InfoCard, { title: \"Links\", variant: variant,}\n , !links || links.length === 0 ? (\n React.createElement(EntityLinksEmptyState, null )\n ) : (\n React.createElement(LinksGridList, {\n cols: cols,\n items: links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n })),}\n )\n )\n )\n );\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://techdocs-cli-embedded-app/../node_modules/@material-ui/icons/Language.js","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/IconLink.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/useDynamicColumns.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"names":[],"mappings":"yJAEI,EAAyB,EAAQ,OAEjC,EAA0B,EAAQ,OAEtC,EAA6C,CAC3C,MAAO,IAET,EAAQ,EAAU,OAElB,GAAI,GAAQ,EAAwB,EAAQ,OAExC,EAAiB,EAAuB,EAAQ,QAEhD,EAAY,GAAG,EAAe,SAAuB,EAAM,cAAc,OAAQ,CACnF,EAAG,8yBACD,YAEJ,EAAQ,EAAU,G,0JCElB,KAAM,GAAc;AAAA;AAAA;AAAA;AAAA;AAAA,uBAUd,EAAY,QAChB,GAAU,EACR,KAAM,CACJ,aAAc,EACd,OAAQ,GAAG,EAAM,QAAQ,WACzB,WAAY,EAAM,QAAQ,OAAS,OAAS,OAAS,UAGzD,CAAE,KAAM,uCAGH,YAAiC,CACtC,KAAM,GAAU,IAEhB,MACE,iBAAoB,WAAgB,KAChC,gBAAoB,IAAY,CAAE,QAAS,SAAW,sHAItD,gBAAoB,MAAO,CAAE,UAAW,EAAQ,MAC9C,gBAAoB,cAAa,CACjC,KAAM,EACN,SAAU,OACV,gBAAiB,GACjB,mBAAoB,CAAC,EAAG,EAAG,EAAG,GAC9B,YAAa,CAAE,WAAY,UAAW,SAAU,WAGlD,gBAAoB,IAAQ,CAC5B,QAAS,YACT,MAAO,UACP,OAAQ,SACR,KAAM,wFACN,c,qCC3CR,KAAM,GAAY,QAAW,CAC3B,QAAS,CACP,QAAS,eACT,QAAS,CACP,QAAS,eACT,SAAU,UACV,cAAe,eAKd,WAAkB,EAIvB,CACA,KAAM,CAAE,OAAM,OAAM,QAAS,EACvB,EAAU,IAEhB,MACE,iBAAoB,IAAK,CAAE,QAAS,QAChC,gBAAoB,IAAK,CAAE,GAAI,EAAG,UAAW,EAAQ,SACnD,gB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,GAAS,EAAM,SAAW,EAC3B,gBAAoB,EAAuB,MAE3C,gBAAoB,EAAe,CACjC,KAAM,EACN,MAAO,EAAM,IAAI,CAAC,CAAE,MAAK,QAAO,UAAY,EAC1C,KAAM,UAAS,EACf,KAAM,EACN,KAAM,EAAa","file":"static/1959.2eb957a4.chunk.js","sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z\"\n}), 'Language');\n\nexports.default = _default;","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\n\n\nconst useStyles = makeStyles(\n theme => ({\n code: {\n borderRadius: 6,\n margin: `${theme.spacing(2)}px 0px`,\n background: theme.palette.type === 'dark' ? '#444' : '#fff',\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n React.createElement(React.Fragment, null\n , React.createElement(Typography, { variant: \"body1\",}, \"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:\"\n\n\n )\n , React.createElement('div', { className: classes.code,}\n , React.createElement(CodeSnippet, {\n text: ENTITY_YAML,\n language: \"yaml\",\n showLineNumbers: true,\n highlightedNumbers: [3, 4, 5, 6],\n customStyle: { background: 'inherit', fontSize: '115%' },}\n )\n )\n , React.createElement(Button, {\n variant: \"contained\",\n color: \"primary\",\n target: \"_blank\",\n href: \"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\",}\n , \"Read more\"\n\n )\n )\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles, Box, Typography } from '@material-ui/core';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { Link } from '@backstage/core-components';\n\n\nconst useStyles = makeStyles({\n svgIcon: {\n display: 'inline-block',\n '& svg': {\n display: 'inline-block',\n fontSize: 'inherit',\n verticalAlign: 'baseline',\n },\n },\n});\n\nexport function IconLink(props\n\n\n\n) {\n const { href, text, Icon } = props;\n const classes = useStyles();\n\n return (\n React.createElement(Box, { display: \"flex\",}\n , React.createElement(Box, { mr: 1, className: classes.svgIcon,}\n , React.createElement(Typography, { component: \"div\",}\n , Icon ? React.createElement(Icon, null ) : React.createElement(LanguageIcon, null )\n )\n )\n , React.createElement(Box, { flexGrow: \"1\",}\n , React.createElement(Link, { to: href, target: \"_blank\", rel: \"noopener\",}\n , text || href\n )\n )\n )\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useMediaQuery } from '@material-ui/core';\n\n\nconst colDefaults = {\n xs: 1,\n sm: 1,\n md: 1,\n lg: 2,\n xl: 3,\n};\n\nexport function useDynamicColumns(\n cols,\n) {\n const matches = [\n useMediaQuery((theme) => theme.breakpoints.up('xl')) ? 'xl' : null,\n useMediaQuery((theme) => theme.breakpoints.up('lg')) ? 'lg' : null,\n useMediaQuery((theme) => theme.breakpoints.up('md')) ? 'md' : null,\n useMediaQuery((theme) => theme.breakpoints.up('sm')) ? 'sm' : null,\n useMediaQuery((theme) => theme.breakpoints.up('xs')) ? 'xs' : null,\n ];\n\n let numOfCols = 1;\n\n if (typeof cols === 'number') {\n numOfCols = cols;\n } else {\n const breakpoint = matches.find(k => k !== null) ?? 'xs';\n numOfCols = cols?.[breakpoint] ?? colDefaults[breakpoint];\n }\n\n return numOfCols;\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 { ImageList, ImageListItem } from '@material-ui/core';\nimport React from 'react';\nimport { IconLink } from './IconLink';\n\nimport { useDynamicColumns } from './useDynamicColumns';\n\n\n\n\n\n\n\n\n\n\n\n\n\nexport function LinksGridList(props) {\n const { items, cols = undefined } = props;\n const numOfCols = useDynamicColumns(cols);\n\n return (\n React.createElement(ImageList, { rowHeight: \"auto\", cols: numOfCols,}\n , items.map(({ text, href, Icon }, i) => (\n React.createElement(ImageListItem, { key: i,}\n , React.createElement(IconLink, { href: href, text: text ?? href, Icon: Icon,} )\n )\n ))\n )\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\n\nimport { useApp } from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\n\n/** @public */\n\n\n\n\n\nexport function EntityLinksCard(props) {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key) =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n React.createElement(InfoCard, { title: \"Links\", variant: variant,}\n , !links || links.length === 0 ? (\n React.createElement(EntityLinksEmptyState, null )\n ) : (\n React.createElement(LinksGridList, {\n cols: cols,\n items: links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n })),}\n )\n )\n )\n );\n}\n"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[2426],{62426:function(K,r,o){o.r(r),o.d(r,{RelatedEntitiesCard:function(){return u},asComponentEntities:function(){return E},asResourceEntities:function(){return f},asSystemEntities:function(){return T},componentEntityColumns:function(){return m},componentEntityHelpLink:function(){return y},resourceEntityColumns:function(){return d},resourceEntityHelpLink:function(){return p},systemEntityColumns:function(){return C},systemEntityHelpLink:function(){return b}});var a=o(90436),t=o(22707),e=o(2784),s=o(9118);function u(n){const{variant:i="gridItem",title:c,columns:k,entityKind:g,relationType:h,emptyMessage:v,emptyHelpLink:L,asRenderableEntities:R}=n,{entity:H}=(0,t.useEntity)(),{entities:S,loading:w,error:l}=(0,t.useRelatedEntities)(H,{type:h,kind:g});return w?e.createElement(s.InfoCard,{variant:i,title:c},e.createElement(s.Progress,null)):l?e.createElement(s.InfoCard,{variant:i,title:c},e.createElement(s.ResponseErrorPanel,{error:l})):e.createElement(t.EntityTable,{title:c,variant:i,emptyContent:e.createElement("div",{style:{textAlign:"center"}},e.createElement(a.Z,{variant:"body1"},v),e.createElement(a.Z,{variant:"body2"},e.createElement(s.Link,{to:L},"Learn how to change this."))),columns:k,entities:R(S||[])})}const m=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"component"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],y="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",E=n=>n,d=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"resource"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],p="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",f=n=>n,C=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"system"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],b="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",T=n=>n}}]);})();
1
+ "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[2426],{62426:function(K,r,o){o.r(r),o.d(r,{RelatedEntitiesCard:function(){return u},asComponentEntities:function(){return E},asResourceEntities:function(){return f},asSystemEntities:function(){return T},componentEntityColumns:function(){return m},componentEntityHelpLink:function(){return y},resourceEntityColumns:function(){return d},resourceEntityHelpLink:function(){return p},systemEntityColumns:function(){return C},systemEntityHelpLink:function(){return b}});var a=o(90436),t=o(53479),e=o(2784),s=o(9118);function u(n){const{variant:i="gridItem",title:c,columns:k,entityKind:g,relationType:h,emptyMessage:v,emptyHelpLink:L,asRenderableEntities:R}=n,{entity:H}=(0,t.useEntity)(),{entities:S,loading:w,error:l}=(0,t.useRelatedEntities)(H,{type:h,kind:g});return w?e.createElement(s.InfoCard,{variant:i,title:c},e.createElement(s.Progress,null)):l?e.createElement(s.InfoCard,{variant:i,title:c},e.createElement(s.ResponseErrorPanel,{error:l})):e.createElement(t.EntityTable,{title:c,variant:i,emptyContent:e.createElement("div",{style:{textAlign:"center"}},e.createElement(a.Z,{variant:"body1"},v),e.createElement(a.Z,{variant:"body2"},e.createElement(s.Link,{to:L},"Learn how to change this."))),columns:k,entities:R(S||[])})}const m=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"component"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],y="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",E=n=>n,d=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"resource"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createSpecTypeColumn(),t.EntityTable.columns.createSpecLifecycleColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],p="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",f=n=>n,C=[t.EntityTable.columns.createEntityRefColumn({defaultKind:"system"}),t.EntityTable.columns.createOwnerColumn(),t.EntityTable.columns.createMetadataDescriptionColumn()],b="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",T=n=>n}}]);})();
2
2
 
3
- //# sourceMappingURL=2426.92f98d58.chunk.js.map
3
+ //# sourceMappingURL=2426.f9952783.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts"],"names":[],"mappings":"onBAwDO,WACL,EACA,CACA,KAAM,CACJ,UAAU,WACV,QACA,UACA,aACA,eACA,eACA,gBACA,wBACE,EAEE,CAAE,UAAW,kBACb,CAAE,WAAU,UAAS,SAAU,yBAAmB,EAAQ,CAC9D,KAAM,EACN,KAAM,IAGR,MAAI,GAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,GACrD,gBAAoB,WAAU,OAKlC,EAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,GACrD,gBAAoB,qBAAoB,CAAE,MAAO,KAMvD,gBAAoB,cAAa,CAC/B,MAAO,EACP,QAAS,EACT,aACE,gBAAoB,MAAO,CAAE,MAAO,CAAE,UAAW,WAC7C,gBAAoB,IAAY,CAAE,QAAS,SAAW,GACtD,gBAAoB,IAAY,CAAE,QAAS,SACzC,gBAAoB,OAAM,CAAE,GAAI,GAAiB,+BAIzD,QAAS,EACT,SAAU,EAAqB,GAAY,MCjF1C,KAAM,GAAyB,CACpC,4CAA0C,CAAE,YAAa,cACzD,0CACA,6CACA,kDACA,yDAEW,EACX,uFACW,EAAuB,GAClC,EAEW,EAAwB,CACnC,4CAA0C,CAAE,YAAa,aACzD,0CACA,6CACA,kDACA,yDAEW,EACX,sFACW,EAAsB,GACjC,EAEW,EAAsB,CACjC,4CAA0C,CAAE,YAAa,WACzD,0CACA,yDAEW,EACX,oFACW,EAAoB,GAC/B","file":"static/2426.92f98d58.chunk.js","sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n Link,\n Progress,\n ResponseErrorPanel,\n\n} from '@backstage/core-components';\n\n/** @public */\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard(\n props,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(Progress, null )\n )\n );\n }\n\n if (error) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(ResponseErrorPanel, { error: error,} )\n )\n );\n }\n\n return (\n React.createElement(EntityTable, {\n title: title,\n variant: variant,\n emptyContent: \n React.createElement('div', { style: { textAlign: 'center' },}\n , React.createElement(Typography, { variant: \"body1\",}, emptyMessage)\n , React.createElement(Typography, { variant: \"body2\",}\n , React.createElement(Link, { to: emptyHelpLink,}, \"Learn how to change this.\" )\n )\n )\n ,\n columns: columns,\n entities: asRenderableEntities(entities || []),}\n )\n );\n}\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { EntityTable } from '@backstage/plugin-catalog-react';\n\n\nexport const componentEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities) =>\n entities ;\n\nexport const resourceEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities) =>\n entities ;\n\nexport const systemEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities) =>\n entities ;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../node_modules/@sucrase/webpack-loader/dist/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts"],"names":[],"mappings":"onBAwDO,WACL,EACA,CACA,KAAM,CACJ,UAAU,WACV,QACA,UACA,aACA,eACA,eACA,gBACA,wBACE,EAEE,CAAE,UAAW,kBACb,CAAE,WAAU,UAAS,SAAU,yBAAmB,EAAQ,CAC9D,KAAM,EACN,KAAM,IAGR,MAAI,GAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,GACrD,gBAAoB,WAAU,OAKlC,EAEA,gBAAoB,WAAU,CAAE,QAAS,EAAS,MAAO,GACrD,gBAAoB,qBAAoB,CAAE,MAAO,KAMvD,gBAAoB,cAAa,CAC/B,MAAO,EACP,QAAS,EACT,aACE,gBAAoB,MAAO,CAAE,MAAO,CAAE,UAAW,WAC7C,gBAAoB,IAAY,CAAE,QAAS,SAAW,GACtD,gBAAoB,IAAY,CAAE,QAAS,SACzC,gBAAoB,OAAM,CAAE,GAAI,GAAiB,+BAIzD,QAAS,EACT,SAAU,EAAqB,GAAY,MCjF1C,KAAM,GAAyB,CACpC,4CAA0C,CAAE,YAAa,cACzD,0CACA,6CACA,kDACA,yDAEW,EACX,uFACW,EAAuB,GAClC,EAEW,EAAwB,CACnC,4CAA0C,CAAE,YAAa,aACzD,0CACA,6CACA,kDACA,yDAEW,EACX,sFACW,EAAsB,GACjC,EAEW,EAAsB,CACjC,4CAA0C,CAAE,YAAa,WACzD,0CACA,yDAEW,EACX,oFACW,EAAoB,GAC/B","file":"static/2426.f9952783.chunk.js","sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n Link,\n Progress,\n ResponseErrorPanel,\n\n} from '@backstage/core-components';\n\n/** @public */\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard(\n props,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(Progress, null )\n )\n );\n }\n\n if (error) {\n return (\n React.createElement(InfoCard, { variant: variant, title: title,}\n , React.createElement(ResponseErrorPanel, { error: error,} )\n )\n );\n }\n\n return (\n React.createElement(EntityTable, {\n title: title,\n variant: variant,\n emptyContent: \n React.createElement('div', { style: { textAlign: 'center' },}\n , React.createElement(Typography, { variant: \"body1\",}, emptyMessage)\n , React.createElement(Typography, { variant: \"body2\",}\n , React.createElement(Link, { to: emptyHelpLink,}, \"Learn how to change this.\" )\n )\n )\n ,\n columns: columns,\n entities: asRenderableEntities(entities || []),}\n )\n );\n}\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { EntityTable } from '@backstage/plugin-catalog-react';\n\n\nexport const componentEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities) =>\n entities ;\n\nexport const resourceEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities) =>\n entities ;\n\nexport const systemEntityColumns = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities) =>\n entities ;\n"],"sourceRoot":""}