@techdocs/cli 0.0.0-nightly-20231009021144 → 0.0.0-nightly-20231010021207

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 (27) hide show
  1. package/CHANGELOG.md +10 -6
  2. package/dist/cjs/{mkdocs-582c42fd.cjs.js → mkdocs-571e2dc0.cjs.js} +2 -2
  3. package/dist/cjs/{mkdocs-582c42fd.cjs.js.map → mkdocs-571e2dc0.cjs.js.map} +1 -1
  4. package/dist/cjs/{mkdocsServer-99ec8af2.cjs.js → mkdocsServer-107b8efd.cjs.js} +16 -6
  5. package/dist/cjs/mkdocsServer-107b8efd.cjs.js.map +1 -0
  6. package/dist/cjs/{serve-552eaafd.cjs.js → serve-bf2ff8e3.cjs.js} +10 -7
  7. package/dist/cjs/serve-bf2ff8e3.cjs.js.map +1 -0
  8. package/dist/embedded-app/index.html +1 -1
  9. package/dist/embedded-app/static/{main.98b9a6c4.js → main.27fe9d3c.js} +1 -1
  10. package/dist/embedded-app/static/{main.98b9a6c4.js.map → main.27fe9d3c.js.map} +1 -1
  11. package/dist/embedded-app/static/module-react-router-dom.65ce4c09.js +22 -0
  12. package/dist/embedded-app/static/module-react-router-dom.65ce4c09.js.map +1 -0
  13. package/dist/embedded-app/static/module-react-router.652daaf3.js +22 -0
  14. package/dist/embedded-app/static/module-react-router.652daaf3.js.map +1 -0
  15. package/dist/embedded-app/static/{runtime.98b9a6c4.js → runtime.27fe9d3c.js} +1 -1
  16. package/dist/embedded-app/static/{runtime.98b9a6c4.js.map → runtime.27fe9d3c.js.map} +1 -1
  17. package/dist/embedded-app/static/{vendor.98b9a6c4.js → vendor.27fe9d3c.js} +1 -1
  18. package/dist/embedded-app/static/{vendor.98b9a6c4.js.map → vendor.27fe9d3c.js.map} +1 -1
  19. package/dist/index.cjs.js +5 -2
  20. package/dist/index.cjs.js.map +1 -1
  21. package/package.json +7 -7
  22. package/dist/cjs/mkdocsServer-99ec8af2.cjs.js.map +0 -1
  23. package/dist/cjs/serve-552eaafd.cjs.js.map +0 -1
  24. package/dist/embedded-app/static/module-react-router-dom.a0f835fd.js +0 -22
  25. package/dist/embedded-app/static/module-react-router-dom.a0f835fd.js.map +0 -1
  26. package/dist/embedded-app/static/module-react-router.8e9755f1.js +0 -22
  27. package/dist/embedded-app/static/module-react-router.8e9755f1.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,17 +1,21 @@
1
1
  # @techdocs/cli
2
2
 
3
- ## 0.0.0-nightly-20231009021144
3
+ ## 0.0.0-nightly-20231010021207
4
+
5
+ ### Minor Changes
6
+
7
+ - d06b30b050ba: Add possibility to use a mkdocs config file with a different name than `mkdocs.<yaml|yml> with the serve command using the `--mkdocs-config-file-name` argument
4
8
 
5
9
  ### Patch Changes
6
10
 
7
11
  - de42eebaafc5: Bumped dev dependencies `@types/node` and `mock-fs`.
8
12
  - 2b6e5720515c: Restructured tests.
9
13
  - Updated dependencies
10
- - @backstage/backend-common@0.0.0-nightly-20231009021144
11
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20231009021144
12
- - @backstage/catalog-model@0.0.0-nightly-20231009021144
13
- - @backstage/cli-common@0.0.0-nightly-20231009021144
14
- - @backstage/config@0.0.0-nightly-20231009021144
14
+ - @backstage/backend-common@0.0.0-nightly-20231010021207
15
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20231010021207
16
+ - @backstage/catalog-model@0.0.0-nightly-20231010021207
17
+ - @backstage/cli-common@0.0.0-nightly-20231010021207
18
+ - @backstage/config@0.0.0-nightly-20231010021207
15
19
 
16
20
  ## 1.5.2-next.1
17
21
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  var openBrowser = require('react-dev-utils/openBrowser');
4
4
  var utility = require('./utility-3c0df5a9.cjs.js');
5
- var mkdocsServer = require('./mkdocsServer-99ec8af2.cjs.js');
5
+ var mkdocsServer = require('./mkdocsServer-107b8efd.cjs.js');
6
6
  var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
7
7
  var fs = require('fs-extra');
8
8
  require('winston');
@@ -60,4 +60,4 @@ Starting mkdocs server on ${localAddr}
60
60
  }
61
61
 
62
62
  exports["default"] = serveMkdocs;
63
- //# sourceMappingURL=mkdocs-582c42fd.cjs.js.map
63
+ //# sourceMappingURL=mkdocs-571e2dc0.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mkdocs-582c42fd.cjs.js","sources":["../../src/commands/serve/mkdocs.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OptionValues } from 'commander';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { createLogger } from '../../lib/utility';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { getMkdocsYml } from '@backstage/plugin-techdocs-node';\nimport fs from 'fs-extra';\n\nexport default async function serveMkdocs(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const dockerAddr = `http://0.0.0.0:${opts.port}`;\n const localAddr = `http://127.0.0.1:${opts.port}`;\n const expectedDevAddr = opts.docker ? dockerAddr : localAddr;\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n './',\n opts.siteName,\n );\n\n // We want to open browser only once based on a log.\n let boolOpenBrowserTriggered = false;\n\n const logFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line in between\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n // Logs from container is verbose.\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !boolOpenBrowserTriggered &&\n line.includes(`Serving on ${expectedDevAddr}`)\n ) {\n // Always open the local address, since 0.0.0.0 belongs to docker\n logger.info(`\\nStarting mkdocs server on ${localAddr}\\n`);\n openBrowser(localAddr);\n boolOpenBrowserTriggered = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n\n // Commander stores --no-docker in cmd.docker variable\n const childProcess = await runMkdocsServer({\n port: opts.port,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n dockerOptions: opts.dockerOption,\n useDocker: opts.docker,\n stdoutLogFunc: logFunc,\n stderrLogFunc: logFunc,\n });\n\n // Keep waiting for user to cancel the process\n await waitForSignal([childProcess]);\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n}\n"],"names":["createLogger","getMkdocsYml","openBrowser","runMkdocsServer","waitForSignal","fs"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,eAA8B,YAAY,IAAoB,EAAA;AAC5D,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,UAAA,GAAa,CAAkB,eAAA,EAAA,IAAA,CAAK,IAAI,CAAA,CAAA,CAAA;AAC9C,EAAM,MAAA,SAAA,GAAY,CAAoB,iBAAA,EAAA,IAAA,CAAK,IAAI,CAAA,CAAA,CAAA;AAC/C,EAAM,MAAA,eAAA,GAAkB,IAAK,CAAA,MAAA,GAAS,UAAa,GAAA,SAAA,CAAA;AAEnD,EAAA,MAAM,EAAE,IAAA,EAAM,aAAe,EAAA,iBAAA,KAAsB,MAAMC,+BAAA;AAAA,IACvD,IAAA;AAAA,IACA,IAAK,CAAA,QAAA;AAAA,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ACrB,IAAQ,OAAA,CAAA,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAGC,sBAAA,CAAA,MAAA,CAAO,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AACF;;;;"}
1
+ {"version":3,"file":"mkdocs-571e2dc0.cjs.js","sources":["../../src/commands/serve/mkdocs.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OptionValues } from 'commander';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { createLogger } from '../../lib/utility';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { getMkdocsYml } from '@backstage/plugin-techdocs-node';\nimport fs from 'fs-extra';\n\nexport default async function serveMkdocs(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const dockerAddr = `http://0.0.0.0:${opts.port}`;\n const localAddr = `http://127.0.0.1:${opts.port}`;\n const expectedDevAddr = opts.docker ? dockerAddr : localAddr;\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n './',\n opts.siteName,\n );\n\n // We want to open browser only once based on a log.\n let boolOpenBrowserTriggered = false;\n\n const logFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line in between\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n // Logs from container is verbose.\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !boolOpenBrowserTriggered &&\n line.includes(`Serving on ${expectedDevAddr}`)\n ) {\n // Always open the local address, since 0.0.0.0 belongs to docker\n logger.info(`\\nStarting mkdocs server on ${localAddr}\\n`);\n openBrowser(localAddr);\n boolOpenBrowserTriggered = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n\n // Commander stores --no-docker in cmd.docker variable\n const childProcess = await runMkdocsServer({\n port: opts.port,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n dockerOptions: opts.dockerOption,\n useDocker: opts.docker,\n stdoutLogFunc: logFunc,\n stderrLogFunc: logFunc,\n });\n\n // Keep waiting for user to cancel the process\n await waitForSignal([childProcess]);\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n}\n"],"names":["createLogger","getMkdocsYml","openBrowser","runMkdocsServer","waitForSignal","fs"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,eAA8B,YAAY,IAAoB,EAAA;AAC5D,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,UAAA,GAAa,CAAkB,eAAA,EAAA,IAAA,CAAK,IAAI,CAAA,CAAA,CAAA;AAC9C,EAAM,MAAA,SAAA,GAAY,CAAoB,iBAAA,EAAA,IAAA,CAAK,IAAI,CAAA,CAAA,CAAA;AAC/C,EAAM,MAAA,eAAA,GAAkB,IAAK,CAAA,MAAA,GAAS,UAAa,GAAA,SAAA,CAAA;AAEnD,EAAA,MAAM,EAAE,IAAA,EAAM,aAAe,EAAA,iBAAA,KAAsB,MAAMC,+BAAA;AAAA,IACvD,IAAA;AAAA,IACA,IAAK,CAAA,QAAA;AAAA,GACP,CAAA;AAGA,EAAA,IAAI,wBAA2B,GAAA,KAAA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;AAC7B,MAAGC,sBAAA,CAAA,MAAA,CAAO,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AACF;;;;"}
@@ -77,7 +77,8 @@ const runMkdocsServer = async (options) => {
77
77
  dockerImage,
78
78
  "serve",
79
79
  "--dev-addr",
80
- `0.0.0.0:${port}`
80
+ `0.0.0.0:${port}`,
81
+ ...options.mkdocsConfigFileName ? ["--config-file", options.mkdocsConfigFileName] : []
81
82
  ],
82
83
  {
83
84
  stdoutLogFunc: options.stdoutLogFunc,
@@ -85,12 +86,21 @@ const runMkdocsServer = async (options) => {
85
86
  }
86
87
  );
87
88
  }
88
- return await run("mkdocs", ["serve", "--dev-addr", `127.0.0.1:${port}`], {
89
- stdoutLogFunc: options.stdoutLogFunc,
90
- stderrLogFunc: options.stderrLogFunc
91
- });
89
+ return await run(
90
+ "mkdocs",
91
+ [
92
+ "serve",
93
+ "--dev-addr",
94
+ `127.0.0.1:${port}`,
95
+ ...options.mkdocsConfigFileName ? ["--config-file", options.mkdocsConfigFileName] : []
96
+ ],
97
+ {
98
+ stdoutLogFunc: options.stdoutLogFunc,
99
+ stderrLogFunc: options.stderrLogFunc
100
+ }
101
+ );
92
102
  };
93
103
 
94
104
  exports.runMkdocsServer = runMkdocsServer;
95
105
  exports.waitForSignal = waitForSignal;
96
- //# sourceMappingURL=mkdocsServer-99ec8af2.cjs.js.map
106
+ //# sourceMappingURL=mkdocsServer-107b8efd.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mkdocsServer-107b8efd.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 stop 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 dockerEntrypoint?: string;\n dockerOptions?: string[];\n stdoutLogFunc?: LogFunc;\n stderrLogFunc?: LogFunc;\n mkdocsConfigFileName?: string;\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 ...(options.dockerEntrypoint\n ? ['--entrypoint', options.dockerEntrypoint]\n : []),\n ...(options.dockerOptions || []),\n dockerImage,\n 'serve',\n '--dev-addr',\n `0.0.0.0:${port}`,\n ...(options.mkdocsConfigFileName\n ? ['--config-file', options.mkdocsConfigFileName]\n : []),\n ],\n {\n stdoutLogFunc: options.stdoutLogFunc,\n stderrLogFunc: options.stderrLogFunc,\n },\n );\n }\n\n return await run(\n 'mkdocs',\n [\n 'serve',\n '--dev-addr',\n `127.0.0.1:${port}`,\n ...(options.mkdocsConfigFileName\n ? ['--config-file', options.mkdocsConfigFileName]\n : []),\n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GAAA,kBAAA,CAAA;AAE3C,EAAA,IAAI,SAAW,EAAA;AACb,IAAA,OAAO,MAAM,GAAA;AAAA,MACX,QAAA;AAAA,MACA;AAAA,QACE,KAAA;AAAA,QACA,MAAA;AAAA,QACA,IAAA;AAAA,QACA,UAAA;AAAA,QACA,IAAA;AAAA,QACA,CAAA,EAAG,OAAQ,CAAA,GAAA,EAAK,CAAA,SAAA,CAAA;AAAA,QAChB,IAAA;AAAA,QACA,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAAA,QACf,KAAA;AAAA,QACA,GAAI,QAAQ,gBACR,GAAA,CAAC,gBAAgB,OAAQ,CAAA,gBAAgB,IACzC,EAAC;AAAA,QACL,GAAI,OAAQ,CAAA,aAAA,IAAiB,EAAC;AAAA,QAC9B,WAAA;AAAA,QACA,OAAA;AAAA,QACA,YAAA;AAAA,QACA,WAAW,IAAI,CAAA,CAAA;AAAA,QACf,GAAI,QAAQ,oBACR,GAAA,CAAC,iBAAiB,OAAQ,CAAA,oBAAoB,IAC9C,EAAC;AAAA,OACP;AAAA,MACA;AAAA,QACE,eAAe,OAAQ,CAAA,aAAA;AAAA,QACvB,eAAe,OAAQ,CAAA,aAAA;AAAA,OACzB;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAA,OAAO,MAAM,GAAA;AAAA,IACX,QAAA;AAAA,IACA;AAAA,MACE,OAAA;AAAA,MACA,YAAA;AAAA,MACA,aAAa,IAAI,CAAA,CAAA;AAAA,MACjB,GAAI,QAAQ,oBACR,GAAA,CAAC,iBAAiB,OAAQ,CAAA,oBAAoB,IAC9C,EAAC;AAAA,KACP;AAAA,IACA;AAAA,MACE,eAAe,OAAQ,CAAA,aAAA;AAAA,MACvB,eAAe,OAAQ,CAAA,aAAA;AAAA,KACzB;AAAA,GACF,CAAA;AACF;;;;;"}
@@ -7,7 +7,7 @@ var serveHandler = require('serve-handler');
7
7
  var http = require('http');
8
8
  var httpProxy = require('http-proxy');
9
9
  var utility = require('./utility-3c0df5a9.cjs.js');
10
- var mkdocsServer = require('./mkdocsServer-99ec8af2.cjs.js');
10
+ var mkdocsServer = require('./mkdocsServer-107b8efd.cjs.js');
11
11
  var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
12
12
  var fs = require('fs-extra');
13
13
  require('winston');
@@ -121,10 +121,12 @@ async function serve(opts) {
121
121
  const mkdocsDockerAddr = `http://0.0.0.0:${opts.mkdocsPort}`;
122
122
  const mkdocsLocalAddr = `http://127.0.0.1:${opts.mkdocsPort}`;
123
123
  const mkdocsExpectedDevAddr = opts.docker ? mkdocsDockerAddr : mkdocsLocalAddr;
124
- const { path: mkdocsYmlPath, configIsTemporary } = await pluginTechdocsNode.getMkdocsYml(
125
- "./",
126
- opts.siteName
127
- );
124
+ const mkdocsConfigFileName = opts.mkdocsConfigFileName;
125
+ const siteName = opts.siteName;
126
+ const { path: mkdocsYmlPath, configIsTemporary } = await pluginTechdocsNode.getMkdocsYml("./", {
127
+ name: siteName,
128
+ mkdocsConfigFileName
129
+ });
128
130
  let mkdocsServerHasStarted = false;
129
131
  const mkdocsLogFunc = (data) => {
130
132
  const logLines = data.toString().split("\n");
@@ -147,7 +149,8 @@ async function serve(opts) {
147
149
  dockerOptions: opts.dockerOption,
148
150
  useDocker: opts.docker,
149
151
  stdoutLogFunc: mkdocsLogFunc,
150
- stderrLogFunc: mkdocsLogFunc
152
+ stderrLogFunc: mkdocsLogFunc,
153
+ mkdocsConfigFileName: mkdocsYmlPath
151
154
  });
152
155
  for (let attempt = 0; attempt < 30; attempt++) {
153
156
  await new Promise((r) => setTimeout(r, 3e3));
@@ -189,4 +192,4 @@ Opening browser.`
189
192
  }
190
193
 
191
194
  exports["default"] = serve;
192
- //# sourceMappingURL=serve-552eaafd.cjs.js.map
195
+ //# sourceMappingURL=serve-bf2ff8e3.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve-bf2ff8e3.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 mkdocsTargetAddress: string;\n private readonly verbose: boolean;\n\n constructor(\n backstageBundleDir: string,\n backstagePort: number,\n mkdocsTargetAddress: string,\n verbose: boolean,\n ) {\n this.proxyEndpoint = '/api/techdocs/';\n this.backstageBundleDir = backstageBundleDir;\n this.backstagePort = backstagePort;\n this.mkdocsTargetAddress = mkdocsTargetAddress;\n this.verbose = verbose;\n }\n\n // Create a Proxy for mkdocs server\n private createProxy() {\n const proxy = httpProxy.createProxyServer({\n target: this.mkdocsTargetAddress,\n });\n\n return (request: http.IncomingMessage): [httpProxy, string] => {\n // If the request path is prefixed with this.proxyEndpoint, remove it.\n const proxyEndpointPath = new RegExp(`^${this.proxyEndpoint}`, 'i');\n const forwardPath = request.url?.replace(proxyEndpointPath, '') || '';\n\n return [proxy, forwardPath];\n };\n }\n\n public async serve(): Promise<http.Server> {\n return new Promise<http.Server>((resolve, reject) => {\n const proxyHandler = this.createProxy();\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n if (request.url?.startsWith(this.proxyEndpoint)) {\n const [proxy, forwardPath] = proxyHandler(request);\n\n proxy.on('error', (error: Error) => {\n reject(error);\n });\n\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n\n request.url = forwardPath;\n proxy.web(request, response);\n return;\n }\n\n // This endpoint is used by the frontend to detect where the backend is running.\n if (request.url === '/.detect') {\n response.setHeader('Content-Type', 'text/plain');\n response.end('techdocs-cli-server');\n return;\n }\n\n serveHandler(request, response, {\n public: this.backstageBundleDir,\n trailingSlash: true,\n rewrites: [{ source: '**', destination: 'index.html' }],\n });\n },\n );\n\n const logger = createLogger({ verbose: false });\n server.listen(this.backstagePort, () => {\n if (this.verbose) {\n logger.info(\n `[techdocs-preview-bundle] Running local version of Backstage at http://localhost:${this.backstagePort}`,\n );\n }\n resolve(server);\n });\n\n server.on('error', (error: Error) => {\n reject(error);\n });\n });\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OptionValues } from 'commander';\nimport path from 'path';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { findPaths } from '@backstage/cli-common';\nimport HTTPServer from '../../lib/httpServer';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { createLogger } from '../../lib/utility';\nimport { getMkdocsYml } from '@backstage/plugin-techdocs-node';\nimport fs from 'fs-extra';\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 let mkdocsServerHasStarted = false;\n const mkdocsLogFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !mkdocsServerHasStarted &&\n line.includes(`Serving on ${mkdocsExpectedDevAddr}`)\n ) {\n mkdocsServerHasStarted = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n logger.info('Starting mkdocs server.');\n const mkdocsChildProcess = await runMkdocsServer({\n port: opts.mkdocsPort,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n dockerOptions: opts.dockerOption,\n useDocker: opts.docker,\n stdoutLogFunc: mkdocsLogFunc,\n stderrLogFunc: mkdocsLogFunc,\n mkdocsConfigFileName: mkdocsYmlPath,\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 waitForSignal([mkdocsChildProcess]);\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n}\n"],"names":["httpProxy","http","serveHandler","createLogger","path","findPaths","getMkdocsYml","runMkdocsServer","openBrowser","waitForSignal","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAqB,UAAW,CAAA;AAAA,EAO9B,WACE,CAAA,kBAAA,EACA,aACA,EAAA,mBAAA,EACA,OACA,EAAA;AAXF,IAAiB,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,oBAAA,CAAA,C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,CAAC,CAAA,CAAA;AAAA,GACf,CACA,CAAA,IAAA,CAAK,MAAM;AAEV,IAAYC,+BAAA,CAAA,CAAA,iBAAA,EAAoB,IAAI,CAAgC,8BAAA,CAAA,CAAA,CAAA;AACpE,IAAO,MAAA,CAAA,IAAA;AAAA,MACL,iDAAiD,IAAI,CAAA;AAAA,gBAAA,CAAA;AAAA,KACvD,CAAA;AAAA,GACD,CAAA,CAAA;AAEH,EAAM,MAAAC,0BAAA,CAAc,CAAC,kBAAkB,CAAC,CAAA,CAAA;AAExC,EAAA,IAAI,iBAAmB,EAAA;AACrB,IAAQ,OAAA,CAAA,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAGC,sBAAA,CAAA,MAAA,CAAO,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AACF;;;;"}
@@ -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="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.98b9a6c4.js"></script><script defer="defer" src="/static/module-material-ui.bdbd8daa.js"></script><script defer="defer" src="/static/module-lodash.adfd55fe.js"></script><script defer="defer" src="/static/module-date-fns.b8b6c380.js"></script><script defer="defer" src="/static/module-material-table.0f5635dd.js"></script><script defer="defer" src="/static/module-react-dom.07625e59.js"></script><script defer="defer" src="/static/module-react-router.8e9755f1.js"></script><script defer="defer" src="/static/module-react-router-dom.a0f835fd.js"></script><script defer="defer" src="/static/module-zod.9e0f365e.js"></script><script defer="defer" src="/static/module-i18next.db8a27ed.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.62627182.js"></script><script defer="defer" src="/static/vendor.98b9a6c4.js"></script><script defer="defer" src="/static/main.98b9a6c4.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="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.27fe9d3c.js"></script><script defer="defer" src="/static/module-material-ui.bdbd8daa.js"></script><script defer="defer" src="/static/module-lodash.adfd55fe.js"></script><script defer="defer" src="/static/module-date-fns.b8b6c380.js"></script><script defer="defer" src="/static/module-material-table.0f5635dd.js"></script><script defer="defer" src="/static/module-react-dom.07625e59.js"></script><script defer="defer" src="/static/module-react-router.652daaf3.js"></script><script defer="defer" src="/static/module-react-router-dom.65ce4c09.js"></script><script defer="defer" src="/static/module-zod.9e0f365e.js"></script><script defer="defer" src="/static/module-i18next.db8a27ed.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.62627182.js"></script><script defer="defer" src="/static/vendor.27fe9d3c.js"></script><script defer="defer" src="/static/main.27fe9d3c.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -484,4 +484,4 @@ ${Z.href}
484
484
 
485
485
  Feedback:`),Lt=(Q==null?void 0:Q.type)==="github"?(0,go.B)(V.href,"blob"):V.href,Bt=mo()(Lt),Vt=`/${Bt.organization}/${Bt.name}`,Pt=Z.cloneNode();switch(Q==null?void 0:Q.type){case"gitlab":Pt.href=`${V.origin}${Vt}/issues/new?issue[title]=${St}&issue[description]=${wt}`;break;case"github":Pt.href=`${V.origin}${Vt}/issues/new?title=${St}&body=${wt}`;break;default:return b}return un.render(i.createElement(po.Z),Pt),Pt.style.paddingLeft="5px",Pt.title="Leave feedback for this page",Pt.id="git-feedback-link",Z==null||Z.insertAdjacentElement("beforebegin",Pt),b},Eo=()=>h=>(h.addEventListener(A,function b(){if(window.location.hash){var j;const Z=window.location.hash.slice(1);h==null||(j=h.querySelector(`[id="${Z}"]`))===null||j===void 0||j.scrollIntoView()}h.removeEventListener(A,b)}),h),xo=()=>h=>(setTimeout(()=>{const b=h==null?void 0:h.querySelectorAll("li.md-nav__item--active");b.length!==0&&(b.forEach(Z=>{const V=Z==null?void 0:Z.querySelector("input");V!=null&&V.checked||V==null||V.click()}),b[b.length-1].scrollIntoView())},200),h);var Co=t(15459),Ao=t(80030),So=t(72379),Oo=t(41547),bo=t(95074);const Po=(0,Co.Z)(h=>({tooltip:{fontSize:"inherit",color:h.palette.text.primary,margin:0,padding:h.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Ao.ZP),Mn=()=>(0,o.jsx)(So.Z,{children:(0,o.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),Ln=({text:h})=>{const[b,j]=(0,i.useState)(!1),[,Z]=(0,bo.Z)(),V=(0,i.useCallback)(()=>{Z(h),j(!0)},[h,Z]),Q=(0,i.useCallback)(()=>{j(!1)},[j]);return(0,o.jsx)(Po,{title:"Copied to clipboard",placement:"left",open:b,onClose:Q,leaveDelay:1e3,children:(0,o.jsx)(_.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:V,children:(0,o.jsx)(Mn,{})})})},Ro=h=>b=>{const j=b.querySelectorAll("pre > code");for(const V of j){var Z;const Q=V.textContent||"",J=document.createElement("div");V==null||(Z=V.parentElement)===null||Z===void 0||Z.prepend(J),un.render((0,o.jsx)(Oo.Z,{theme:h,children:(0,o.jsx)(Ln,{text:Q})}),J)}return b},To=({baseUrl:h,onClick:b})=>j=>(Array.from(j.getElementsByTagName("a")).forEach(Z=>{Z.addEventListener("click",V=>{const J=Z.getAttribute("href");J&&J.startsWith(h)&&!Z.hasAttribute("download")&&(V.preventDefault(),b(V,J))})}),j),jn=({onLoading:h,onLoaded:b})=>j=>(h(),j.addEventListener(A,function Z(){b(),j.removeEventListener(A,Z)}),j);function wo(h,b){const j=new URL(b),Z=`${j.origin}${j.pathname.replace(/\/$/,"")}`,V=h.replace(Z,"").replace(/^\/+/,""),Q=new URL(`http://localhost/${V}`);return`${Q.pathname}${Q.search}${Q.hash}`}function Io(){const h=(0,Nt.s0)(),j=(0,k.h_)(X.D).getOptionalString("app.baseUrl");return(0,i.useCallback)(V=>{let Q=V;if(j)try{Q=wo(V,j)}catch{}h(Q)},[h,j])}const Do="screen and (max-width: 76.1875em)",Mo=h=>{const b=Io(),j=(0,B.Z)(),Z=(0,nt.Z)(Do),V=se(),Q=De(),J=(0,K.z)(),St=(0,k.h_)(Qe.D),wt=(0,k.h_)(dt.q),{state:Lt,path:Bt,content:Vt}=je(),[Pt,ve]=(0,i.useState)(null),ce=C(Pt),Qt=(0,i.useCallback)(()=>{if(!Pt)return;Pt.querySelectorAll(".md-sidebar").forEach(Ut=>{if(Z)Ut.style.top="0px";else{var Jt;const $e=(Jt=document)===null||Jt===void 0?void 0:Jt.querySelector(".techdocs-reader-page");var ue;const he=(ue=$e==null?void 0:$e.getBoundingClientRect().top)!==null&&ue!==void 0?ue:0;var Pe;let Fe=(Pe=Pt.getBoundingClientRect().top)!==null&&Pe!==void 0?Pe:0;const gn=Pt.querySelector(".md-container > .md-tabs");var ae;const Bo=(ae=gn==null?void 0:gn.getBoundingClientRect().height)!==null&&ae!==void 0?ae:0;Fe<he&&(Fe=he),Ut.style.top=`${Math.max(Fe,0)+Bo}px`}Ut.style.setProperty("opacity","1")})},[Pt,Z]);(0,i.useEffect)(()=>(window.addEventListener("resize",Qt),window.addEventListener("scroll",Qt,!0),()=>{window.removeEventListener("resize",Qt),window.removeEventListener("scroll",Qt,!0)}),[Pt,Qt]);const _t=(0,i.useCallback)(()=>{if(!Pt)return;const Wt=Pt.querySelector(".md-footer");Wt&&(Wt.style.width=`${Pt.getBoundingClientRect().width}px`)},[Pt]);(0,i.useEffect)(()=>(window.addEventListener("resize",_t),()=>{window.removeEventListener("resize",_t)}),[Pt,_t]),(0,i.useEffect)(()=>{ce||(_t(),Qt())},[Lt,ce,_t,Qt]);const ne=(0,i.useCallback)((Wt,Ut)=>Xe(Wt,[V,ao({techdocsStorageApi:St,entityId:h,path:Ut}),lo(),uo(),ho(),fo(),yo(wt),Q]),[h,wt,St,V,Q]),te=(0,i.useCallback)(async Wt=>Xe(Wt,[Eo(),xo(),Ro(j),To({baseUrl:window.location.origin,onClick:(Ut,Jt)=>{var ue;const Pe=Ut.ctrlKey||Ut.metaKey,ae=new URL(Jt),$e=((ue=Ut.target)===null||ue===void 0?void 0:ue.innerText)||Jt,he=Jt.replace(window.location.origin,"");if(J.captureEvent("click",$e,{attributes:{to:he}}),ae.hash)if(Pe)window.open(Jt,"_blank");else{var Fe;b(Jt),Wt==null||(Fe=Wt.querySelector(`[id="${ae.hash.slice(1)}"]`))===null||Fe===void 0||Fe.scrollIntoView()}else Pe?window.open(Jt,"_blank"):b(Jt)}}),jn({onLoading:()=>{},onLoaded:()=>{var Ut;(Ut=Wt.querySelector(".md-nav__title"))===null||Ut===void 0||Ut.removeAttribute("for")}}),jn({onLoading:()=>{Array.from(Wt.querySelectorAll(".md-sidebar")).forEach(Jt=>{Jt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[j,b,J]);return(0,i.useEffect)(()=>{if(!Vt)return()=>{};let Wt=!0;return ne(Vt,Bt).then(async Ut=>{if(!(Ut!=null&&Ut.innerHTML)||!Wt)return;window.scroll({top:0});const Jt=await te(Ut);ve(Jt)}),()=>{Wt=!1}},[Vt,Bt,ne,te]),Pt};var hn=t(8560),Lo=t(2296),fn=t(57058);const jo=()=>{const h=(0,Lo.$L)(),{shadowRoot:b}=(0,p.x)(),j=b==null?void 0:b.querySelector('[data-md-component="content"]'),Z=b==null?void 0:b.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let V=Z==null?void 0:Z.querySelector('[data-techdocs-addons-location="primary sidebar"]');V||(V=document.createElement("div"),V.setAttribute("data-techdocs-addons-location","primary sidebar"),Z==null||Z.prepend(V));const Q=b==null?void 0:b.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let J=Q==null?void 0:Q.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return J||(J=document.createElement("div"),J.setAttribute("data-techdocs-addons-location","secondary sidebar"),Q==null||Q.prepend(J)),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(hn.Z,{container:V,children:h.renderComponentsByLocation(fn.o.PrimarySidebar)}),(0,o.jsx)(hn.Z,{container:j,children:h.renderComponentsByLocation(fn.o.Content)}),(0,o.jsx)(hn.Z,{container:J,children:h.renderComponentsByLocation(fn.o.SecondarySidebar)})]})},Bn=(0,d.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),Un=L(h=>{var b;const{withSearch:j=!0,onReady:Z}=h,V=Bn(),{entityMetadata:{value:Q,loading:J},entityRef:St,setShadowRoot:wt}=(0,p.x)(),Lt=Mo(St),Bt=(0,i.useCallback)(Vt=>{wt(Vt),Z instanceof Function&&Z()},[wt,Z]);return J===!1&&!Q?(0,o.jsx)(E.m,{status:"404",statusMessage:"PAGE NOT FOUND"}):Lt?(0,o.jsx)(I.V,{children:(0,o.jsxs)(S.Z,{container:!0,children:[(0,o.jsx)(S.Z,{xs:12,item:!0,children:(0,o.jsx)(D,{})}),j&&(0,o.jsx)(S.Z,{className:V.search,xs:"auto",item:!0,children:(0,o.jsx)(Ft,{entityId:St,entityTitle:Q==null||(b=Q.metadata)===null||b===void 0?void 0:b.title})}),(0,o.jsx)(S.Z,{xs:12,item:!0,children:(0,o.jsx)(x,{element:Lt,onAppend:Bt,children:(0,o.jsx)(jo,{})})})]})}):(0,o.jsx)(I.V,{children:(0,o.jsx)(S.Z,{container:!0,children:(0,o.jsx)(S.Z,{xs:12,item:!0,children:(0,o.jsx)(D,{})})})})}),Mt=null},65386:function(Y,T,t){"use strict";t.d(T,{S:function(){return At}});var o=t(52322),i=t(2784),d=t(18671),S=t(60905),p=t(98069),f=t(60364),l=t(73250),g=t(2296),O=t(68979),A=t(57058),P=t(75435),C=t(41748),x=t(68138),E=t(8709),I=t(79692),R=t(41128),M=t(90436),F=t(98864);const N=(0,I.Z)(xt=>({root:{textAlign:"left"},label:{color:xt.page.fontColor,fontWeight:xt.typography.fontWeightBold,letterSpacing:0,fontSize:xt.typography.fontSize,marginBottom:xt.spacing(1)/2,lineHeight:1},value:{color:(0,R.Fq)(xt.page.fontColor,.8),fontSize:xt.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),v=({value:xt,className:ut})=>(0,o.jsx)(M.Z,{component:typeof xt=="string"?"p":"span",className:ut,children:xt});function k(xt){const{label:ut,value:bt,url:Ct}=xt,Ot=N(),ot=(0,o.jsx)(v,{className:Ot.value,value:bt||"<Unknown>"});return(0,o.jsx)(S.Z,{item:!0,children:(0,o.jsxs)(M.Z,{component:"span",className:Ot.root,children:[(0,o.jsx)(M.Z,{className:Ot.label,children:ut}),Ct?(0,o.jsx)(F.rU,{to:Ct,children:ot}):ot]})})}var rt=t(48037),X=t(44394),H=t(6542),z=t(37321),G=t(76635),tt=t(95573);const st=(0,o.jsx)(p.Z,{animation:"wave",variant:"text",height:40}),At=xt=>{const{palette:{common:{white:ut}}}=(0,f.Z)(),{children:bt}=xt,Ct=(0,g.$L)(),Ot=(0,X.h_)(H.D),{title:ot,setTitle:$,subtitle:_,setSubtitle:et,entityRef:at,metadata:{value:ct,loading:W},entityMetadata:{value:K,loading:pt}}=(0,O.x)();(0,i.useEffect)(()=>{ct&&($(ct.site_name),et(()=>{let{site_description:Zt}=ct;return(!Zt||Zt==="None")&&(Zt=""),Zt}))},[ct,$,et]);const Et=Ot.getOptional("app.title")||"Backstage",ht=[ot,_,Et].filter(Boolean).join(" | "),{locationMetadata:ft,spec:lt}=K||{},Rt=lt==null?void 0:lt.lifecycle,Tt=K?(0,P.h)(K,E.S4):[],It=(0,z.t)(tt._Z)(),Nt=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(k,{label:(0,G.capitalize)((K==null?void 0:K.kind)||"entity"),value:(0,o.jsx)(C.d,{color:"inherit",entityRef:at,title:K==null?void 0:K.metadata.title,defaultKind:"Component"})}),Tt.length>0&&(0,o.jsx)(k,{label:"Owner",value:(0,o.jsx)(x.r,{color:"inherit",entityRefs:Tt,defaultKind:"group"})}),Rt?(0,o.jsx)(k,{label:"Lifecycle",value:Rt}):null,ft&&ft.type!=="dir"&&ft.type!=="file"?(0,o.jsx)(k,{label:"",value:(0,o.jsxs)(S.Z,{container:!0,direction:"column",alignItems:"center",style:{color:ut},children:[(0,o.jsx)(S.Z,{style:{padding:0},item:!0,children:(0,o.jsx)(l.Z,{style:{marginTop:"-25px"}})}),(0,o.jsx)(S.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:ft.target}):null]});return!pt&&K===void 0||!W&&ct===void 0?null:(0,o.jsxs)(rt.h,{type:"Documentation",typeLink:It,title:ot||st,subtitle:_===""?void 0:_||st,children:[(0,o.jsx)(d.Z,{titleTemplate:"%s",children:(0,o.jsx)("title",{children:ht})}),Nt,bt,Ct.renderComponentsByLocation(A.o.Header)]})}},95573:function(Y,T,t){"use strict";t.d(T,{Fw:function(){return d},_Z:function(){return i},pd:function(){return S}});var o=t(30283);const i=(0,o.N)({id:"techdocs:index-page"}),d=(0,o.N)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),S=(0,o.N)({id:"techdocs:catalog-reader-view"})},55511:function(Y,T,t){"use strict";t.r(T),t.d(T,{TechDocsSearchResultListItem:function(){return A}});var o=t(52322),i=t(2784),d=t(79692),S=t(49378),p=t(86136),f=t(90436),l=t(98864),g=t(76079);const O=(0,d.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),A=P=>{const{result:C,highlight:x,lineClamp:E=5,asListItem:I=!0,asLink:R=!0,title:M,icon:F}=P,N=O(),v=({children:X})=>R?(0,o.jsx)(l.rU,{noTrack:!0,to:C.location,children:X}):(0,o.jsx)(o.Fragment,{children:X}),k=()=>{const X=x!=null&&x.fields.title?(0,o.jsx)(g.F,{text:x.fields.title,preTag:x.preTag,postTag:x.postTag}):C.title,H=x!=null&&x.fields.entityTitle?(0,o.jsx)(g.F,{text:x.fields.entityTitle,preTag:x.preTag,postTag:x.postTag}):C.entityTitle,z=x!=null&&x.fields.name?(0,o.jsx)(g.F,{text:x.fields.name,preTag:x.preTag,postTag:x.postTag}):C.name;return C?(0,o.jsx)(S.Z,{className:N.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,o.jsx)(v,{children:M||(0,o.jsxs)(o.Fragment,{children:[X," | ",H!=null?H:z," docs"]})}),secondary:(0,o.jsx)(f.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:E,overflow:"hidden"},color:"textSecondary",variant:"body2",children:x!=null&&x.fields.text?(0,o.jsx)(g.F,{text:x.fields.text,preTag:x.preTag,postTag:x.postTag}):C.text})}):null},rt=({children:X})=>I?(0,o.jsxs)(o.Fragment,{children:[F&&(0,o.jsx)(p.Z,{children:typeof F=="function"?F(C):F}),(0,o.jsx)("div",{className:N.flexContainer,children:X})]}):(0,o.jsx)(o.Fragment,{children:X});return(0,o.jsx)(rt,{children:(0,o.jsx)(k,{})})}},53260:function(){}},function(Y){var T=function(o){return Y(Y.s=o)};Y.O(0,[2370,6202,9284,7012,427,242,5109,6816,1213,5218,4736],function(){return T(81025)});var t=Y.O()}]);})();
486
486
 
487
- //# sourceMappingURL=main.98b9a6c4.js.map
487
+ //# sourceMappingURL=main.27fe9d3c.js.map