@techdocs/cli 1.10.4 → 1.10.5-next.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.
- package/CHANGELOG.md +12 -0
- package/bin/techdocs-cli +4 -2
- package/dist/commands/generate/generate.cjs.js +1 -1
- package/dist/commands/generate/generate.cjs.js.map +1 -1
- package/dist/commands/publish/publish.cjs.js +1 -1
- package/dist/commands/publish/publish.cjs.js.map +1 -1
- package/dist/commands/serve/serve.cjs.js +1 -1
- package/dist/commands/serve/serve.cjs.js.map +1 -1
- package/dist/embedded-app/.config-schema.json +0 -33
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/1749.b97ecd54.chunk.js +2 -0
- package/dist/embedded-app/static/{1749.12caaf36.chunk.js.map → 1749.b97ecd54.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1994.4ab66df0.chunk.js +2 -0
- package/dist/embedded-app/static/{1994.10e5e0a5.chunk.js.map → 1994.4ab66df0.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4645.cc59b13f.chunk.js +2 -0
- package/dist/embedded-app/static/{4645.2529d0aa.chunk.js.map → 4645.cc59b13f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6138.9fb528c4.chunk.js → 4648.da64256f.chunk.js} +2 -2
- package/dist/embedded-app/static/{4648.df344fd4.chunk.js.map → 4648.da64256f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6138.d73686cf.chunk.js +2 -0
- package/dist/embedded-app/static/{6138.9fb528c4.chunk.js.map → 6138.d73686cf.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7174.820ed772.chunk.js +2 -0
- package/dist/embedded-app/static/7174.820ed772.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7186.0b7e4914.chunk.js → 7186.52010672.chunk.js} +2 -2
- package/dist/embedded-app/static/{7186.0b7e4914.chunk.js.map → 7186.52010672.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7203.a3686a7b.chunk.js +2 -0
- package/dist/embedded-app/static/{7203.c157eeae.chunk.js.map → 7203.a3686a7b.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7382.3e144128.chunk.js +2 -0
- package/dist/embedded-app/static/{7382.75824f8e.chunk.js.map → 7382.3e144128.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7526.1ff30a44.chunk.js +2 -0
- package/dist/embedded-app/static/{7526.dd1429dd.chunk.js.map → 7526.1ff30a44.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9050.c23899d5.chunk.js +2 -0
- package/dist/embedded-app/static/{9050.21dcd5d1.chunk.js.map → 9050.c23899d5.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9230.99f9d012.chunk.js +2 -0
- package/dist/embedded-app/static/{9230.885db42d.chunk.js.map → 9230.99f9d012.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9579.0eda17f2.chunk.js +2 -0
- package/dist/embedded-app/static/{9579.84d1dba2.chunk.js.map → 9579.0eda17f2.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.4899331a.js +527 -0
- package/dist/embedded-app/static/main.4899331a.js.map +1 -0
- package/dist/embedded-app/static/main.831e465c.css +2 -0
- package/dist/embedded-app/static/main.831e465c.css.map +1 -0
- package/dist/embedded-app/static/{module-date-fns.fe699224.js → module-date-fns.bfd1b82f.js} +2 -2
- package/dist/embedded-app/static/{module-date-fns.fe699224.js.map → module-date-fns.bfd1b82f.js.map} +1 -1
- package/dist/embedded-app/static/module-i18next.c154323c.js +2 -0
- package/dist/embedded-app/static/{module-i18next.685d0b2d.js.map → module-i18next.c154323c.js.map} +1 -1
- package/dist/embedded-app/static/module-lodash.c50623b1.js +2 -0
- package/dist/embedded-app/static/module-lodash.c50623b1.js.map +1 -0
- package/dist/embedded-app/static/module-material-table.40a11f4e.js +2 -0
- package/dist/embedded-app/static/{module-material-table.5a3a2d93.js.map → module-material-table.40a11f4e.js.map} +1 -1
- package/dist/embedded-app/static/module-material-ui.3c48b777.js +2 -0
- package/dist/embedded-app/static/{module-material-ui.9517effb.js.map → module-material-ui.3c48b777.js.map} +1 -1
- package/dist/embedded-app/static/module-mui.c5efba64.js +2 -0
- package/dist/embedded-app/static/{module-mui.375d6d62.js.map → module-mui.c5efba64.js.map} +1 -1
- package/dist/embedded-app/static/{module-react-beautiful-dnd.29de0c3a.js → module-react-beautiful-dnd.6e061f96.js} +2 -2
- package/dist/embedded-app/static/{module-react-beautiful-dnd.29de0c3a.js.map → module-react-beautiful-dnd.6e061f96.js.map} +1 -1
- package/dist/embedded-app/static/module-react-dom.c631e87d.js +2 -0
- package/dist/embedded-app/static/{module-react-dom.44002a3f.js.map → module-react-dom.c631e87d.js.map} +1 -1
- package/dist/embedded-app/static/module-remix-run.d87774b0.js +2 -0
- package/dist/embedded-app/static/{module-remix-run.8b5ff4b7.js.map → module-remix-run.d87774b0.js.map} +1 -1
- package/dist/embedded-app/static/module-zod.c31bff05.js +2 -0
- package/dist/embedded-app/static/{module-zod.4600b494.js.map → module-zod.c31bff05.js.map} +1 -1
- package/dist/embedded-app/static/react-syntax-highlighter/lowlight-import.df3f7284.chunk.js +2 -0
- package/dist/embedded-app/static/react-syntax-highlighter/{lowlight-import.7b0d2cbc.chunk.js.map → lowlight-import.df3f7284.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.f12aa553.js → runtime.f9c0ec96.js} +2 -2
- package/dist/embedded-app/static/{runtime.f12aa553.js.map → runtime.f9c0ec96.js.map} +1 -1
- package/dist/embedded-app/static/vendor.e4357869.js +2 -0
- package/dist/embedded-app/static/{vendor.c30d98c8.js.map → vendor.e4357869.js.map} +1 -1
- package/dist/lib/httpServer.cjs.js +1 -1
- package/dist/lib/httpServer.cjs.js.map +1 -1
- package/dist/lib/livereload.cjs.js.map +1 -1
- package/dist/lib/utility.cjs.js +4 -4
- package/dist/lib/utility.cjs.js.map +1 -1
- package/dist/package.json.cjs.js +1 -1
- package/package.json +7 -7
- package/dist/embedded-app/static/1749.12caaf36.chunk.js +0 -2
- package/dist/embedded-app/static/1994.10e5e0a5.chunk.js +0 -2
- package/dist/embedded-app/static/3222.d20eecea.chunk.js +0 -2
- package/dist/embedded-app/static/3222.d20eecea.chunk.js.map +0 -1
- package/dist/embedded-app/static/4645.2529d0aa.chunk.js +0 -2
- package/dist/embedded-app/static/4648.df344fd4.chunk.js +0 -2
- package/dist/embedded-app/static/7203.c157eeae.chunk.js +0 -2
- package/dist/embedded-app/static/7382.75824f8e.chunk.js +0 -2
- package/dist/embedded-app/static/7526.dd1429dd.chunk.js +0 -2
- package/dist/embedded-app/static/9050.21dcd5d1.chunk.js +0 -2
- package/dist/embedded-app/static/9230.885db42d.chunk.js +0 -2
- package/dist/embedded-app/static/9579.84d1dba2.chunk.js +0 -2
- package/dist/embedded-app/static/main.0c6dd09c.css +0 -2
- package/dist/embedded-app/static/main.0c6dd09c.css.map +0 -1
- package/dist/embedded-app/static/main.bd200dfa.js +0 -550
- package/dist/embedded-app/static/main.bd200dfa.js.map +0 -1
- package/dist/embedded-app/static/module-i18next.685d0b2d.js +0 -2
- package/dist/embedded-app/static/module-lodash.7d4f904e.js +0 -2
- package/dist/embedded-app/static/module-lodash.7d4f904e.js.map +0 -1
- package/dist/embedded-app/static/module-material-table.5a3a2d93.js +0 -2
- package/dist/embedded-app/static/module-material-ui.9517effb.js +0 -2
- package/dist/embedded-app/static/module-mui.375d6d62.js +0 -2
- package/dist/embedded-app/static/module-react-dom.44002a3f.js +0 -2
- package/dist/embedded-app/static/module-remix-run.8b5ff4b7.js +0 -2
- package/dist/embedded-app/static/module-zod.4600b494.js +0 -2
- package/dist/embedded-app/static/react-syntax-highlighter/lowlight-import.7b0d2cbc.chunk.js +0 -2
- package/dist/embedded-app/static/vendor.c30d98c8.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
+
## 1.10.5-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7455dae: Use node prefix on native imports
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-defaults@0.15.1-next.0
|
|
10
|
+
- @backstage/plugin-techdocs-node@1.14.1-next.0
|
|
11
|
+
- @backstage/cli-common@0.1.18-next.0
|
|
12
|
+
- @backstage/catalog-model@1.7.6
|
|
13
|
+
- @backstage/config@1.3.6
|
|
14
|
+
|
|
3
15
|
## 1.10.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/bin/techdocs-cli
CHANGED
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
const path = require('path');
|
|
18
|
+
const path = require('node:path');
|
|
19
19
|
|
|
20
20
|
// Figure out whether we're running inside the backstage repo or as an installed dependency
|
|
21
21
|
/* eslint-disable-next-line no-restricted-syntax */
|
|
22
|
-
const isLocal = require('fs').existsSync(
|
|
22
|
+
const isLocal = require('node:fs').existsSync(
|
|
23
|
+
path.resolve(__dirname, '../src'),
|
|
24
|
+
);
|
|
23
25
|
|
|
24
26
|
if (!isLocal) {
|
|
25
27
|
require('..');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var path = require('path');
|
|
5
|
+
var path = require('node:path');
|
|
6
6
|
var fs = require('fs-extra');
|
|
7
7
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
8
8
|
var config = require('@backstage/config');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.cjs.js","sources":["../../../src/commands/generate/generate.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport fs from 'fs-extra';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n getMkdocsYml,\n} from '@backstage/plugin-techdocs-node';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n getLogStream,\n} from '../../lib/utility';\n\nexport default async function generate(opts: OptionValues) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: opts.verbose });\n\n const sourceDir = resolve(opts.sourceDir);\n const outputDir = resolve(opts.outputDir);\n const omitTechdocsCorePlugin = opts.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = opts.dockerImage;\n const pullImage = opts.pull;\n const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;\n const defaultPlugins = opts.defaultPlugin;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n sourceDir,\n );\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: opts.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n legacyCopyReadmeMdToIndexMd,\n omitTechdocsCorePlugin,\n defaultPlugins,\n },\n },\n },\n });\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (opts.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n opts.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(opts.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: opts.etag,\n logStream: getLogStream(logger),\n siteOptions: { name: opts.siteName },\n runAsDefaultUser: opts.runAsDefaultUser,\n });\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","getMkdocsYml","config","ConfigReader","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","getLogStream"],"mappings":";;;;;;;;;;;;;;AA+BA,eAA8B,SAAS,IAAA,EAAoB;AAKzD,EAAA,MAAM,SAASA,oBAAA,CAAa,EAAE,OAAA,EAAS,IAAA,CAAK,SAAS,CAAA;AAErD,EAAA,MAAM,SAAA,GAAYC,YAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AACxC,EAAA,MAAM,SAAA,GAAYA,YAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AACxC,EAAA,MAAM,yBAAyB,IAAA,CAAK,4BAAA;AACpC,EAAA,MAAM,cAAc,IAAA,CAAK,WAAA;AACzB,EAAA,MAAM,YAAY,IAAA,CAAK,IAAA;AACvB,EAAA,MAAM,8BAA8B,IAAA,CAAK,2BAAA;AACzC,EAAA,MAAM,iBAAiB,IAAA,CAAK,aAAA;AAE5B,EAAA,MAAA,CAAO,IAAA,CAAK,CAAA,iBAAA,EAAoB,SAAS,CAAA,CAAE,CAAA;AAC3C,EAAA,MAAA,CAAO,IAAA,CAAK,CAAA,+BAAA,EAAkC,SAAS,CAAA,CAAE,CAAA;AAEzD,EAAA,MAAA,CAAO,QAAQ,iDAAiD,CAAA;AAEhE,EAAA,MAAMC,mBAAA,CAAG,UAAU,SAAS,CAAA;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AQ,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAAN,mBAAA,CAAG,MAAA,CAAO,aAAA,EAAe,EAAE,CAAA;AAAA,IAC7B,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,MAAA,CAAO,KAAK,OAAO,CAAA;AACrB;;;;"}
|
|
1
|
+
{"version":3,"file":"generate.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 'node:path';\nimport { OptionValues } from 'commander';\nimport fs from 'fs-extra';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n getMkdocsYml,\n} from '@backstage/plugin-techdocs-node';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n getLogStream,\n} from '../../lib/utility';\n\nexport default async function generate(opts: OptionValues) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: opts.verbose });\n\n const sourceDir = resolve(opts.sourceDir);\n const outputDir = resolve(opts.outputDir);\n const omitTechdocsCorePlugin = opts.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = opts.dockerImage;\n const pullImage = opts.pull;\n const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;\n const defaultPlugins = opts.defaultPlugin;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n sourceDir,\n );\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: opts.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n legacyCopyReadmeMdToIndexMd,\n omitTechdocsCorePlugin,\n defaultPlugins,\n },\n },\n },\n });\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (opts.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n opts.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(opts.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: opts.etag,\n logStream: getLogStream(logger),\n siteOptions: { name: opts.siteName },\n runAsDefaultUser: opts.runAsDefaultUser,\n });\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","getMkdocsYml","config","ConfigReader","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","getLogStream"],"mappings":";;;;;;;;;;;;;;AA+BA,eAA8B,SAAS,IAAA,EAAoB;AAKzD,EAAA,MAAM,SAASA,oBAAA,CAAa,EAAE,OAAA,EAAS,IAAA,CAAK,SAAS,CAAA;AAErD,EAAA,MAAM,SAAA,GAAYC,YAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AACxC,EAAA,MAAM,SAAA,GAAYA,YAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AACxC,EAAA,MAAM,yBAAyB,IAAA,CAAK,4BAAA;AACpC,EAAA,MAAM,cAAc,IAA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,EAAA,MAAM,kBAAkB,GAAA,CAAI;AAAA,IAC1B,QAAA,EAAU,SAAA;AAAA,IACV,SAAA;AAAA,IACA,GAAI,KAAK,WAAA,GACL;AAAA,MACE;AAAA,QAEF,EAAC;AAAA,IACL,MAAA;AAAA,IACA,MAAM,IAAA,CAAK,IAAA;AAAA,IACX,SAAA,EAAWI,qBAAa,MAAM,CAAA;AAAA,IAC9B,WAAA,EAAa,EAAE,IAAA,EAAM,IAAA,CAAK,QAAA,EAAS;AAAA,IACnC,kBAAkB,IAAA,CAAK;AAAA,GACxB,CAAA;AAED,EAAA,IAAI,iBAAA,EAAmB;AACrB,IAAA,OAAA,CAAQ,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAAN,mBAAA,CAAG,MAAA,CAAO,aAAA,EAAe,EAAE,CAAA;AAAA,IAC7B,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,MAAA,CAAO,KAAK,OAAO,CAAA;AACrB;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var path = require('path');
|
|
5
|
+
var path = require('node:path');
|
|
6
6
|
var utility = require('../../lib/utility.cjs.js');
|
|
7
7
|
var discovery = require('@backstage/backend-defaults/discovery');
|
|
8
8
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.cjs.js","sources":["../../../src/commands/publish/publish.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { HostDiscovery } from '@backstage/backend-defaults/discovery';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(opts: OptionValues): Promise<any> {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = opts.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(opts.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","discovery","HostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;AAwBA,eAA8B,QAAQ,IAAA,EAAkC;AACtE,EAAA,MAAM,SAASA,oBAAA,CAAa,EAAE,OAAA,EAAS,IAAA,CAAK,SAAS,CAAA;AAErD,EAAA,MAAM,MAAA,GAASC,+BAAA,CAAgB,cAAA,CAAe,IAAI,CAAA;AAClD,EAAA,MAAMC,WAAA,GAAYC,uBAAA,CAAc,UAAA,CAAW,MAAM,CAAA;AACjD,EAAA,MAAM,SAAA,GAAY,MAAMC,4BAAA,CAAU,UAAA,CAAW,QAAQ,EAAE,MAAA,aAAQF,aAAW,CAAA;AAG1E,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,MAAM,UAAU,YAAA,EAAa;AACrD,EAAA,IAAI,CAAC,WAAA,EAAa;AAEhB,IAAA,OAAO,OAAA,CAAQ,MAAA,CAAO,IAAI,KAAA,CAAM,EAAE,CAAC,CAAA;AAAA,EACrC;AAEA,EAAA,MAAM,CAAC,WAAW,IAAA,EAAM,IAAI,IAAI,IAAA,CAAK,MAAA,CAAO,MAAM,GAAG,CAAA;AACrD,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,IAAA;AAAA,IACA,QAAA,EAAU;AAAA,MACR,SAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,MAAM,SAAA,GAAYG,YAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AACxC,EAAA,MAAM,SAAA,CAAU,OAAA,CAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA;AAE7C,EAAA,OAAO,IAAA;AACT;;;;"}
|
|
1
|
+
{"version":3,"file":"publish.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 'node:path';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { HostDiscovery } from '@backstage/backend-defaults/discovery';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(opts: OptionValues): Promise<any> {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = opts.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(opts.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","discovery","HostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;AAwBA,eAA8B,QAAQ,IAAA,EAAkC;AACtE,EAAA,MAAM,SAASA,oBAAA,CAAa,EAAE,OAAA,EAAS,IAAA,CAAK,SAAS,CAAA;AAErD,EAAA,MAAM,MAAA,GAASC,+BAAA,CAAgB,cAAA,CAAe,IAAI,CAAA;AAClD,EAAA,MAAMC,WAAA,GAAYC,uBAAA,CAAc,UAAA,CAAW,MAAM,CAAA;AACjD,EAAA,MAAM,SAAA,GAAY,MAAMC,4BAAA,CAAU,UAAA,CAAW,QAAQ,EAAE,MAAA,aAAQF,aAAW,CAAA;AAG1E,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,MAAM,UAAU,YAAA,EAAa;AACrD,EAAA,IAAI,CAAC,WAAA,EAAa;AAEhB,IAAA,OAAO,OAAA,CAAQ,MAAA,CAAO,IAAI,KAAA,CAAM,EAAE,CAAC,CAAA;AAAA,EACrC;AAEA,EAAA,MAAM,CAAC,WAAW,IAAA,EAAM,IAAI,IAAI,IAAA,CAAK,MAAA,CAAO,MAAM,GAAG,CAAA;AACrD,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,IAAA;AAAA,IACA,QAAA,EAAU;AAAA,MACR,SAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,MAAM,SAAA,GAAYG,YAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AACxC,EAAA,MAAM,SAAA,CAAU,OAAA,CAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA;AAE7C,EAAA,OAAO,IAAA;AACT;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var path = require('path');
|
|
5
|
+
var path = require('node:path');
|
|
6
6
|
var openBrowser = require('react-dev-utils/openBrowser');
|
|
7
7
|
var cliCommon = require('@backstage/cli-common');
|
|
8
8
|
var httpServer = require('../../lib/httpServer.cjs.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.cjs.js","sources":["../../../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 { OptionValues } from 'commander';\nimport path from 'path';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { findPaths, RunOnOutput } from '@backstage/cli-common';\nimport HTTPServer from '../../lib/httpServer';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { createLogger } from '../../lib/utility';\nimport { getMkdocsYml } from '@backstage/plugin-techdocs-node';\nimport fs from 'fs-extra';\nimport { checkIfDockerIsOperational } from './utils';\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\nfunction getPreviewAppPath(opts: OptionValues): string {\n return opts.previewAppBundlePath ?? findPreviewBundlePath();\n}\n\nexport default async function serve(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n // Determine if we want to run in local dev mode or not\n // This will run the backstage http server on a different port and only used\n // for proxying mkdocs to the backstage app running locally (e.g. with webpack-dev-server)\n const isDevMode = Object.keys(process.env).includes('TECHDOCS_CLI_DEV_MODE')\n ? true\n : false;\n\n const backstageBackendPort = 7007;\n\n const mkdocsDockerAddr = `http://0.0.0.0:${opts.mkdocsPort}`;\n const mkdocsLocalAddr = `http://127.0.0.1:${opts.mkdocsPort}`;\n const mkdocsExpectedDevAddr = opts.docker\n ? mkdocsDockerAddr\n : mkdocsLocalAddr;\n const mkdocsConfigFileName = opts.mkdocsConfigFileName;\n const siteName = opts.siteName;\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml('./', {\n name: siteName,\n mkdocsConfigFileName,\n });\n\n // Validate that Docker is up and running\n if (opts.docker) {\n const isDockerOperational = await checkIfDockerIsOperational(logger);\n if (!isDockerOperational) {\n return;\n }\n }\n\n let mkdocsServerHasStarted = false;\n const mkdocsLogFunc: RunOnOutput = data => {\n // Sometimes the lines contain an unnecessary extra new line\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !mkdocsServerHasStarted &&\n line.includes(`Serving on ${mkdocsExpectedDevAddr}`)\n ) {\n mkdocsServerHasStarted = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n logger.info('Starting mkdocs server.');\n const mkdocsChildProcess = runMkdocsServer({\n port: opts.mkdocsPort,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n dockerOptions: opts.dockerOption,\n useDocker: opts.docker,\n onStdout: mkdocsLogFunc,\n onStderr: mkdocsLogFunc,\n mkdocsConfigFileName: mkdocsYmlPath,\n mkdocsParameterClean: opts.mkdocsParameterClean,\n mkdocsParameterDirtyReload: opts.mkdocsParameterDirtyreload,\n mkdocsParameterStrict: opts.mkdocsParameterStrict,\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 : opts.previewAppPort;\n const previewAppPath = getPreviewAppPath(opts);\n const httpServer = new HTTPServer(\n previewAppPath,\n port,\n mkdocsExpectedDevAddr,\n opts.verbose,\n );\n\n httpServer\n .serve()\n .catch(err => {\n logger.error('Failed to start HTTP server', 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 mkdocsChildProcess.waitForExit();\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n}\n"],"names":["path","findPaths","createLogger","getMkdocsYml","checkIfDockerIsOperational","runMkdocsServer","httpServer","HTTPServer","openBrowser","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,qBAAA,GAAgC;AACvC,EAAA,IAAI;AACF,IAAA,OAAOA,qBAAA,CAAK,IAAA;AAAA,MACVA,qBAAA,CAAK,OAAA,CAAQ,OAAA,CAAQ,OAAA,CAAQ,wCAAwC,CAAC,CAAA;AAAA,MACtE;AAAA,KACF;AAAA,EACF,CAAA,CAAA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licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OptionValues } from 'commander';\nimport path from 'node:path';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { findPaths, RunOnOutput } from '@backstage/cli-common';\nimport HTTPServer from '../../lib/httpServer';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { createLogger } from '../../lib/utility';\nimport { getMkdocsYml } from '@backstage/plugin-techdocs-node';\nimport fs from 'fs-extra';\nimport { checkIfDockerIsOperational } from './utils';\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\nfunction getPreviewAppPath(opts: OptionValues): string {\n return opts.previewAppBundlePath ?? findPreviewBundlePath();\n}\n\nexport default async function serve(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n // Determine if we want to run in local dev mode or not\n // This will run the backstage http server on a different port and only used\n // for proxying mkdocs to the backstage app running locally (e.g. with webpack-dev-server)\n const isDevMode = Object.keys(process.env).includes('TECHDOCS_CLI_DEV_MODE')\n ? true\n : false;\n\n const backstageBackendPort = 7007;\n\n const mkdocsDockerAddr = `http://0.0.0.0:${opts.mkdocsPort}`;\n const mkdocsLocalAddr = `http://127.0.0.1:${opts.mkdocsPort}`;\n const mkdocsExpectedDevAddr = opts.docker\n ? mkdocsDockerAddr\n : mkdocsLocalAddr;\n const mkdocsConfigFileName = opts.mkdocsConfigFileName;\n const siteName = opts.siteName;\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml('./', {\n name: siteName,\n mkdocsConfigFileName,\n });\n\n // Validate that Docker is up and running\n if (opts.docker) {\n const isDockerOperational = await checkIfDockerIsOperational(logger);\n if (!isDockerOperational) {\n return;\n }\n }\n\n let mkdocsServerHasStarted = false;\n const mkdocsLogFunc: RunOnOutput = data => {\n // Sometimes the lines contain an unnecessary extra new line\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !mkdocsServerHasStarted &&\n line.includes(`Serving on ${mkdocsExpectedDevAddr}`)\n ) {\n mkdocsServerHasStarted = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n logger.info('Starting mkdocs server.');\n const mkdocsChildProcess = runMkdocsServer({\n port: opts.mkdocsPort,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n dockerOptions: opts.dockerOption,\n useDocker: opts.docker,\n onStdout: mkdocsLogFunc,\n onStderr: mkdocsLogFunc,\n mkdocsConfigFileName: mkdocsYmlPath,\n mkdocsParameterClean: opts.mkdocsParameterClean,\n mkdocsParameterDirtyReload: opts.mkdocsParameterDirtyreload,\n mkdocsParameterStrict: opts.mkdocsParameterStrict,\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 : opts.previewAppPort;\n const previewAppPath = getPreviewAppPath(opts);\n const httpServer = new HTTPServer(\n previewAppPath,\n port,\n mkdocsExpectedDevAddr,\n opts.verbose,\n );\n\n httpServer\n .serve()\n .catch(err => {\n logger.error('Failed to start HTTP server', 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 mkdocsChildProcess.waitForExit();\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n}\n"],"names":["path","findPaths","createLogger","getMkdocsYml","checkIfDockerIsOperational","runMkdocsServer","httpServer","HTTPServer","openBrowser","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,qBAAA,GAAgC;AACvC,EAAA,IAAI;AACF,IAAA,OAAOA,qBAAA,CAAK,IAAA;AAAA,MACVA,qBAAA,CAAK,OAAA,CAAQ,OAAA,CAAQ,OAAA,CAAQ,wCAAwC,CAAC,CAAA;AAAA,MACtE;AAAA,KACF;AAAA,EACF,CAAA,CAAA,MAAQ;AASN,IAAA,OAAOC,mBAAA,CAAU,SAAS,CAAA,CAAE,UAAA,CAAW,mBAAmB,CAAA;AAAA,EAC5D;AACF;AAEA,SAAS,kBAAkB,IAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,wBAAwB,qBAAA,EAAsB;AAC5D;AAEA,eAA8B,MAAM,IAAA,EAAoB;AACtD,EAAA,MAAM,SAASC,oBAAA,CAAa,EAAE,OAAA,EAAS,I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cAAA,GAAiB,kBAAkB,IAAI,CAAA;AAC7C,EAAA,MAAMC,eAAa,IAAIC,kBAAA;AAAA,IACrB,cAAA;AAAA,IACA,IAAA;AAAA,IACA,qBAAA;AAAA,IACA,IAAA,CAAK;AAAA,GACP;AAEA,EAAAD,YAAA,CACG,KAAA,EAAM,CACN,KAAA,CAAM,CAAA,GAAA,KAAO;AACZ,IAAA,MAAA,CAAO,KAAA,CAAM,+BAA+B,GAAG,CAAA;AAC/C,IAAA,kBAAA,CAAmB,IAAA,EAAK;AACxB,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB,CAAC,CAAA,CACA,IAAA,CAAK,MAAM;AAEV,IAAAE,4BAAA,CAAY,CAAA,iBAAA,EAAoB,IAAI,CAAA,8BAAA,CAAgC,CAAA;AACpE,IAAA,MAAA,CAAO,IAAA;AAAA,MACL,iDAAiD,IAAI,CAAA;AAAA,gBAAA;AAAA,KACvD;AAAA,EACF,CAAC,CAAA;AAEH,EAAA,MAAM,mBAAmB,WAAA,EAAY;AAErC,EAAA,IAAI,iBAAA,EAAmB;AACrB,IAAA,OAAA,CAAQ,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAAC,mBAAA,CAAG,MAAA,CAAO,aAAA,EAAe,EAAE,CAAA;AAAA,IAC7B,CAAC,CAAA;AAAA,EACH;AACF;;;;"}
|
|
@@ -1044,39 +1044,6 @@
|
|
|
1044
1044
|
"app": {
|
|
1045
1045
|
"type": "object",
|
|
1046
1046
|
"properties": {
|
|
1047
|
-
"experimental": {
|
|
1048
|
-
"type": "object",
|
|
1049
|
-
"properties": {
|
|
1050
|
-
"packages": {
|
|
1051
|
-
"visibility": "frontend",
|
|
1052
|
-
"deepVisibility": "frontend",
|
|
1053
|
-
"deprecated": "This is no longer experimental; use `app.packages` instead.",
|
|
1054
|
-
"anyOf": [
|
|
1055
|
-
{
|
|
1056
|
-
"type": "object",
|
|
1057
|
-
"properties": {
|
|
1058
|
-
"include": {
|
|
1059
|
-
"type": "array",
|
|
1060
|
-
"items": {
|
|
1061
|
-
"type": "string"
|
|
1062
|
-
}
|
|
1063
|
-
},
|
|
1064
|
-
"exclude": {
|
|
1065
|
-
"type": "array",
|
|
1066
|
-
"items": {
|
|
1067
|
-
"type": "string"
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
},
|
|
1072
|
-
{
|
|
1073
|
-
"const": "all",
|
|
1074
|
-
"type": "string"
|
|
1075
|
-
}
|
|
1076
|
-
]
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
},
|
|
1080
1047
|
"packages": {
|
|
1081
1048
|
"description": "Controls what packages are loaded by the new frontend system.",
|
|
1082
1049
|
"visibility": "frontend",
|
|
@@ -1,4 +1,4 @@
|
|
|
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="color-scheme" content="light dark"/><meta name="description" content="Backstage is an open source framework for building developer portals"/><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><meta name="backstage-app-mode" content="public"><script defer="defer" src="/static/runtime.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="color-scheme" content="light dark"/><meta name="description" content="Backstage is an open source framework for building developer portals"/><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><meta name="backstage-app-mode" content="public"><script defer="defer" src="/static/runtime.f9c0ec96.js"></script><script defer="defer" src="/static/module-material-ui.3c48b777.js"></script><script defer="defer" src="/static/module-lodash.c50623b1.js"></script><script defer="defer" src="/static/module-date-fns.bfd1b82f.js"></script><script defer="defer" src="/static/module-mui.c5efba64.js"></script><script defer="defer" src="/static/module-material-table.40a11f4e.js"></script><script defer="defer" src="/static/module-micromark-core-commonmark.909b7d4e.js"></script><script defer="defer" src="/static/module-parse5.94980036.js"></script><script defer="defer" src="/static/module-zod.c31bff05.js"></script><script defer="defer" src="/static/module-react-dom.c631e87d.js"></script><script defer="defer" src="/static/module-i18next.c154323c.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.6e061f96.js"></script><script defer="defer" src="/static/module-remix-run.d87774b0.js"></script><script defer="defer" src="/static/vendor.e4357869.js"></script><script defer="defer" src="/static/main.4899331a.js"></script><link href="/static/main.831e465c.css" rel="stylesheet"><script type="backstage.io/config">[
|
|
2
2
|
{
|
|
3
3
|
"context": "app-config.yaml",
|
|
4
4
|
"data": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
color="#5bbad5"
|
|
44
44
|
/>
|
|
45
45
|
<title><%= config.getString('app.title') %></title>
|
|
46
|
-
<meta name="backstage-app-mode" content="public"><meta name="backstage-public-path" content="<%= publicPath %>/"><script defer src="<%= publicPath %>/static/runtime.
|
|
46
|
+
<meta name="backstage-app-mode" content="public"><meta name="backstage-public-path" content="<%= publicPath %>/"><script defer src="<%= publicPath %>/static/runtime.f9c0ec96.js"></script><script defer src="<%= publicPath %>/static/module-material-ui.3c48b777.js"></script><script defer src="<%= publicPath %>/static/module-lodash.c50623b1.js"></script><script defer src="<%= publicPath %>/static/module-date-fns.bfd1b82f.js"></script><script defer src="<%= publicPath %>/static/module-mui.c5efba64.js"></script><script defer src="<%= publicPath %>/static/module-material-table.40a11f4e.js"></script><script defer src="<%= publicPath %>/static/module-micromark-core-commonmark.909b7d4e.js"></script><script defer src="<%= publicPath %>/static/module-parse5.94980036.js"></script><script defer src="<%= publicPath %>/static/module-zod.c31bff05.js"></script><script defer src="<%= publicPath %>/static/module-react-dom.c631e87d.js"></script><script defer src="<%= publicPath %>/static/module-i18next.c154323c.js"></script><script defer src="<%= publicPath %>/static/module-react-beautiful-dnd.6e061f96.js"></script><script defer src="<%= publicPath %>/static/module-remix-run.d87774b0.js"></script><script defer src="<%= publicPath %>/static/vendor.e4357869.js"></script><script defer src="<%= publicPath %>/static/main.4899331a.js"></script><link href="<%= publicPath %>/static/main.831e465c.css" rel="stylesheet"></head>
|
|
47
47
|
<body>
|
|
48
48
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
49
49
|
<div id="root"></div>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["1749"],{52235(e,t,n){var i=n(4293),a=n(78920);t.default=void 0;var o=a(n(14041));t.default=(0,i(n(74044)).default)(o.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},98557(e,t,n){n.d(t,{M:()=>l});var i=n(31085),a=n(58837),o=n(71677),s=n(72501);let r=(0,a.A)({container:{overflow:"visible !important"},typo:{fontSize:"inherit",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":({line:e})=>e||1,"-webkit-box-orient":"vertical"}},{name:"BackstageOverflowTooltip"});function l(e){let t=r(e);return(0,i.jsx)(o.Ay,{title:e.title??(e.text||""),placement:e.placement,classes:e.tooltipClasses,children:(0,i.jsx)(s.A,{className:t.typo,variant:"inherit",children:e.text})})}},89439(e,t,n){n.d(t,{n:()=>O});var i=n(31085),a=n(40703),o=n(59469),s=n(48653),r=n(45685),l=n(37197),c=n(58837),d=n(24568),m=n(53373),u=n.n(m),p=n(9720),y=n(72501),h=n(52235),f=n(60603);let g=(0,c.A)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function x(e){let{link:t,title:n,onClick:a}=e,o=g();return(0,i.jsxs)(p.A,{children:[(0,i.jsx)(l.A,{}),(0,i.jsx)(f.N_,{to:t,onClick:a,underline:"none",children:(0,i.jsxs)(p.A,{display:"flex",alignItems:"center",className:o.root,children:[(0,i.jsx)(p.A,{className:o.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,i.jsx)(y.A,{children:(0,i.jsx)("strong",{children:n})})}),(0,i.jsx)(h.default,{className:o.arrow})]})})]})}var C=n(14041),b=n(45463),v=n(60691),j=n(89332),w=n(89595);let E=e=>{let{slackChannel:t}=e,{t:n}=(0,w.i)(j.O);return t?"string"==typeof t?(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t})}):t.href?(0,i.jsx)(b.z,{to:t.href,variant:"contained",children:t.name}):(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t.name})}):null},T=class extends C.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){let{slackChannel:e,children:t}=this.props,{error:n}=this.state;return n?(0,i.jsx)(v.b,{title:"Something Went Wrong",error:n,children:(0,i.jsx)(E,{slackChannel:e})}):t}},A=(0,c.A)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),k=(0,d.A)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(o.A),S={flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},L={fullHeight:{flex:1},gridItem:{flex:1}};function O(e){let{title:t,subheader:n,divider:c=!0,deepLink:d,slackChannel:m,errorBoundaryProps:p,variant:y,alignContent:h="normal",children:f,headerStyle:g,headerProps:C,icon:b,action:v,actionsClassName:j,actions:w,cardClassName:E,actionsTopRight:O,className:R,noPadding:M,titleTypographyProps:N,subheaderTypographyProps:B}=e,D=A(),K={},I={};return y&&y.split(/[\s]+/g).forEach(e=>{K={...K,...S[e]},I={...I,...L[e]}}),(0,i.jsx)(a.A,{style:K,className:R,children:(0,i.jsxs)(T,{...p||(m?{slackChannel:m}:{}),children:[t&&(0,i.jsx)(r.A,{classes:{root:u()(D.header),title:D.headerTitle,subheader:D.headerSubheader,avatar:D.headerAvatar,action:D.headerAction,content:D.headerContent},title:t,subheader:n||b?(0,i.jsxs)("div",{"data-testid":"info-card-subheader",children:[n&&(0,i.jsx)("div",{className:D.subheader,children:n}),b]}):null,action:v,style:{...g},titleTypographyProps:N,subheaderTypographyProps:B,...C}),O&&(0,i.jsx)(k,{children:O}),c&&(0,i.jsx)(l.A,{}),(0,i.jsx)(s.A,{className:u()(E,{[D.noPadding]:M,[D.contentAlignBottom]:"bottom"===h}),style:I,children:f}),w&&(0,i.jsx)(o.A,{className:j,children:w}),d&&(0,i.jsx)(x,{...d})]})})}},65671(e,t,n){n.d(t,{s:()=>g});var i=n(31085),a=n(58837),o=n(96403),s=n(98557),r=n(53320),l=n(7537),c=n(76025),d=n(53987),m=n(19857);let u=Object.freeze({createEntityRefColumn(e){let{defaultKind:t}=e;function n(e){return e.metadata?.title||(0,l.S)(e,{defaultKind:t})}return{title:(0,i.jsx)(m.g,{translationKey:"name"}),highlight:!0,customFilterAndSearch:(e,t)=>n(t).includes(e),customSort:(e,t)=>n(e).localeCompare(n(t)),render:e=>(0,i.jsx)(c.z,{entityRef:e,defaultKind:t,title:e.metadata?.title})}},createEntityRelationColumn(e){let{title:t,relation:n,defaultKind:a,filter:o}=e;function s(e){return(0,r.t)(e,n,o)}function c(e){return s(e).map(e=>(0,l.S)(e,{defaultKind:a})).join(", ")}return{title:t,customFilterAndSearch:(e,t)=>c(t).includes(e),customSort:(e,t)=>c(e).localeCompare(c(t)),render:e=>(0,i.jsx)(d.i,{entityRefs:s(e),defaultKind:a})}},createOwnerColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"owner"}),relation:o.vv,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"domain"}),relation:"partOf",defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"system"}),relation:"partOf",defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"description"}),field:"metadata.description",render:e=>(0,i.jsx)(s.M,{text:e.metadata.description,placement:"bottom-start",line:2})}),createSpecLifecycleColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"lifecycle"}),field:"spec.lifecycle"}),createSpecTypeColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"type"}),field:"spec.type"})}),p=[u.createEntityRefColumn({defaultKind:"system"}),u.createDomainColumn(),u.createOwnerColumn(),u.createMetadataDescriptionColumn()],y=[u.createEntityRefColumn({defaultKind:"component"}),u.createSystemColumn(),u.createOwnerColumn(),u.createSpecTypeColumn(),u.createSpecLifecycleColumn(),u.createMetadataDescriptionColumn()];var h=n(28499);let f=(0,a.A)(e=>({empty:{padding:e.spacing(2),display:"flex",justifyContent:"center"}})),g=e=>{let{entities:t,title:n,emptyContent:a,variant:o="gridItem",columns:s,tableOptions:r={}}=e,l=f(),c={minWidth:"0",width:"100%"};return"gridItem"===o&&(c.height="calc(100% - 10px)"),(0,i.jsx)(h.X,{columns:s,title:n,style:c,emptyContent:a&&(0,i.jsx)("div",{className:l.empty,children:a}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...r},data:t})};g.columns=u,g.systemEntityColumns=p,g.componentEntityColumns=y},19857(e,t,n){n.d(t,{g:()=>o});var i=n(89595),a=n(79811);let o=({translationKey:e})=>{let{t}=(0,i.i)(a.j);return t(`entityTableColumnTitle.${e}`)}},22845(e,t,n){n.d(t,{T7:()=>c,TY:()=>m,tN:()=>d});var i=n(31085),a=n(58077),o=n(92829),s=n(9135),r=n(20549);let l=(0,s.tK)("entity-context"),c=e=>{let{children:t,entity:n,loading:s,error:c,refresh:d}=e;return(0,i.jsx)(l.Provider,{value:(0,r.B)({1:{entity:n,loading:s,error:c,refresh:d}}),children:(0,i.jsx)(o.Ig,{attributes:{...n?{entityRef:(0,a.U2)(n)}:void 0},children:t})})};function d(){let e=(0,s.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");if(!t.entity)throw Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:t.entity}}function m(){let e=(0,s.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");let{entity:n,loading:i,error:a,refresh:o}=t;return{entity:n,loading:i,error:a,refresh:o}}},50010(e,t,n){n.d(t,{W:()=>i});let i=(0,n(97386).h)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create",supportButtonContent:"All your software catalog entities"},aboutCard:{title:"About",refreshButtonTitle:"Schedule entity refresh",editButtonTitle:"Edit Metadata",createSimilarButtonTitle:"Create something similar",refreshScheduledMessage:"Refresh scheduled",launchTemplate:"Launch Template",viewTechdocs:"View TechDocs",viewSource:"View Source",descriptionField:{label:"Description",value:"No description"},ownerField:{label:"Owner",value:"No Owner"},domainField:{label:"Domain",value:"No Domain"},systemField:{label:"System",value:"No System"},parentComponentField:{label:"Parent Component",value:"No Parent Component"},typeField:{label:"Type"},lifecycleField:{label:"Lifecycle"},tagsField:{label:"Tags",value:"No Tags"},targetsField:{label:"Targets"}},searchResultItem:{lifecycle:"Lifecycle",Owner:"Owner"},catalogTable:{warningPanelTitle:"Could not fetch catalog entities.",viewActionTitle:"View",editActionTitle:"Edit",starActionTitle:"Add to favorites",unStarActionTitle:"Remove from favorites"},dependencyOfComponentsCard:{title:"Dependency of components",emptyMessage:"No component depends on this component"},dependsOnComponentsCard:{title:"Depends on components",emptyMessage:"No component is a dependency of this component"},dependsOnResourcesCard:{title:"Depends on resources",emptyMessage:"No resource is a dependency of this component"},entityContextMenu:{copiedMessage:"Copied!",moreButtonTitle:"More",inspectMenuTitle:"Inspect entity",copyURLMenuTitle:"Copy entity URL",unregisterMenuTitle:"Unregister entity"},entityLabelsCard:{title:"Labels",emptyDescription:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityLabels:{warningPanelTitle:"Entity not found",ownerLabel:"Owner",lifecycleLabel:"Lifecycle"},entityLinksCard:{title:"Links",emptyDescription:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityNotFound:{title:"Entity was not found",description:"Want to help us build this? Check out our Getting Started documentation.",docButtonTitle:"DOCS"},deleteEntity:{dialogTitle:"Are you sure you want to delete this entity?",deleteButtonTitle:"Delete",cancelButtonTitle:"Cancel",description:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."},entityProcessingErrorsDescription:"The error below originates from",entityRelationWarningDescription:"This entity has relations to other entities, which can't be found in the catalog.\n Entities not found are: ",hasComponentsCard:{title:"Has components",emptyMessage:"No component is part of this system"},hasResourcesCard:{title:"Has resources",emptyMessage:"No resource is part of this system"},hasSubcomponentsCard:{title:"Has subcomponents",emptyMessage:"No subcomponent is part of this component"},hasSubdomainsCard:{title:"Has subdomains",emptyMessage:"No subdomain is part of this domain"},hasSystemsCard:{title:"Has systems",emptyMessage:"No system is part of this domain"},relatedEntitiesCard:{emptyHelpLinkTitle:"Learn how to change this"},systemDiagramCard:{title:"System Diagram",description:"Use pinch & zoom to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},7396(e,t,n){n.d(t,{DependsOnComponentsCard:()=>c});var i=n(31085),a=n(96403),o=n(79842),s=n(44849),r=n(50010),l=n(89595);function c(e){let{t}=(0,l.i)(r.W),{variant:n="gridItem",title:c=t("dependsOnComponentsCard.title"),columns:d=o.mz,tableOptions:m={}}=e;return(0,i.jsx)(s.p,{variant:n,title:c,entityKind:"Component",relationType:a.nC,columns:d,emptyMessage:t("dependsOnComponentsCard.emptyMessage"),emptyHelpLink:o.e2,asRenderableEntities:o.xJ,tableOptions:m})}},44849(e,t,n){n.d(t,{p:()=>A});var i=n(31085),a=n(72501),o=n(22845),s=n(58077),r=n(50509),l=n(73466),c=n(76272),d=n(65671),m=n(89439),u=n(55489),p=n(58837),y=n(37197),h=n(8109),f=n(5951),g=n(4809),x=n(55555),C=n(60691);let b=(0,p.A)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function v(e){let{title:t,error:n,defaultExpanded:a}=e,o=b();if("ResponseError"!==n.name)return(0,i.jsx)(C.b,{title:t??n.message,defaultExpanded:a,error:n});let{body:s,cause:r}=n,{request:l,response:c}=s,d=`${c.statusCode}: ${r.name}`,m=l&&`${l.method} ${l.url}`,u=r.message.replace(/\\n/g,"\n"),p=r.stack?.replace(/\\n/g,"\n"),v=JSON.stringify(s,void 0,2);return(0,i.jsxs)(C.b,{title:t??n.message,defaultExpanded:a,error:{name:d,message:u,stack:p},children:[m&&(0,i.jsxs)(h.A,{alignItems:"flex-start",children:[(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Request",secondary:l?`${m}`:void 0}),(0,i.jsx)(x.l,{text:m})]}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y.A,{component:"li",className:o.divider}),(0,i.jsx)(h.A,{alignItems:"flex-start",children:(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Full Error as JSON"})}),(0,i.jsx)(g.z,{language:"json",text:v,showCopyCodeButton:!0})]})]})}var j=n(60603),w=n(79842),E=n(50010),T=n(89595);let A=e=>{let{variant:t="gridItem",title:n,columns:p,entityKind:y,relationType:h,emptyMessage:f,emptyHelpLink:g,asRenderableEntities:x,tableOptions:C={}}=e,{t:b}=(0,T.i)(E.W),{entity:w}=(0,o.tN)(),{entities:A,loading:k,error:S}=function(e,t){let n=t?.type?.toLocaleLowerCase("en-US"),i=t?.kind?.toLocaleLowerCase("en-US"),a=(0,r.gf)(c.v),{loading:o,value:d,error:m}=(0,l.A)(async()=>{let t=e.relations?.filter(e=>(!n||e.type.toLocaleLowerCase("en-US")===n)&&(!i||(0,s.KU)(e.targetRef).kind===i));if(!t?.length)return[];let{items:o}=await a.getEntitiesByRefs({entityRefs:t.map(e=>e.targetRef)});return o.filter(e=>!!e)},[e,n,i]);return{entities:d,loading:o,error:m}}(w,{type:h,kind:y});return k?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(u.k,{})}):S?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(v,{error:S})}):(0,i.jsx)(d.s,{title:n,variant:t,emptyContent:(0,i.jsxs)("div",{style:{textAlign:"center"},children:[(0,i.jsx)(a.A,{variant:"body1",children:f}),(0,i.jsx)(a.A,{variant:"body2",children:(0,i.jsx)(j.N_,{to:g,externalLinkIcon:!0,children:b("relatedEntitiesCard.emptyHelpLinkTitle")})})]}),columns:p,entities:x(A||[]),tableOptions:C})};A.componentEntityColumns=w.mz,A.componentEntityHelpLink=w.e2,A.asComponentEntities=w.xJ,A.resourceEntityColumns=w.v9,A.resourceEntityHelpLink=w.nz,A.asResourceEntities=w.eB,A.systemEntityColumns=w.MW,A.systemEntityHelpLink=w.iU,A.asSystemEntities=w.vy,A.domainEntityColums=w.xO,A.domainEntityHelpLink=w.Xr,A.asDomainEntities=w.QS},79842(e,t,n){n.d(t,{MW:()=>d,QS:()=>h,Xr:()=>y,e2:()=>o,eB:()=>c,iU:()=>m,mz:()=>a,nz:()=>l,v9:()=>r,vy:()=>u,xJ:()=>s,xO:()=>p});var i=n(65671);let a=[i.s.columns.createEntityRefColumn({defaultKind:"component"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],o="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",s=e=>e,r=[i.s.columns.createEntityRefColumn({defaultKind:"resource"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",c=e=>e,d=[i.s.columns.createEntityRefColumn({defaultKind:"system"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],m="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",u=e=>e,p=[i.s.columns.createEntityRefColumn({defaultKind:"domain"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],y="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain",h=e=>e}}]);
|
|
2
|
+
//# sourceMappingURL=1749.b97ecd54.chunk.js.map
|