@techdocs/cli 0.0.0-nightly-20220927025940 → 0.0.0-nightly-20220928030111
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 +36 -5
- package/dist/cjs/{generate-b897bd89.cjs.js → generate-103520bb.cjs.js} +6 -3
- package/dist/cjs/generate-103520bb.cjs.js.map +1 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.8146a23c.js → main.e4032bfd.js} +1 -1
- package/dist/embedded-app/static/main.e4032bfd.js.map +1 -0
- package/dist/embedded-app/static/{runtime.8146a23c.js → runtime.e4032bfd.js} +1 -1
- package/dist/embedded-app/static/{runtime.8146a23c.js.map → runtime.e4032bfd.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.8146a23c.js → vendor.e4032bfd.js} +1 -1
- package/dist/embedded-app/static/{vendor.8146a23c.js.map → vendor.e4032bfd.js.map} +1 -1
- package/dist/index.cjs.js +2 -2
- package/package.json +6 -6
- package/dist/cjs/generate-b897bd89.cjs.js.map +0 -1
- package/dist/embedded-app/static/main.8146a23c.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,46 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20220928030111
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- 0b2a30dead: fixing techdocs-cli Docker client creation
|
|
8
|
+
|
|
9
|
+
Docker client does not need to be created when --no-docker
|
|
10
|
+
option is provided.
|
|
11
|
+
|
|
12
|
+
If you had DOCKER_CERT_PATH environment variable defined
|
|
13
|
+
the Docker client was looking for certificates
|
|
14
|
+
and breaking techdocs-cli generate command even with --no-docker
|
|
15
|
+
option.
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @backstage/catalog-model@0.0.0-nightly-20220928030111
|
|
19
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20220928030111
|
|
20
|
+
- @backstage/backend-common@0.0.0-nightly-20220928030111
|
|
21
|
+
- @backstage/cli-common@0.1.10
|
|
22
|
+
- @backstage/config@0.0.0-nightly-20220928030111
|
|
23
|
+
|
|
24
|
+
## 1.2.2-next.0
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 0b2a30dead: fixing techdocs-cli Docker client creation
|
|
29
|
+
|
|
30
|
+
Docker client does not need to be created when --no-docker
|
|
31
|
+
option is provided.
|
|
32
|
+
|
|
33
|
+
If you had DOCKER_CERT_PATH environment variable defined
|
|
34
|
+
the Docker client was looking for certificates
|
|
35
|
+
and breaking techdocs-cli generate command even with --no-docker
|
|
36
|
+
option.
|
|
37
|
+
|
|
7
38
|
- Updated dependencies
|
|
8
|
-
- @backstage/catalog-model@
|
|
9
|
-
- @backstage/plugin-techdocs-node@
|
|
10
|
-
- @backstage/backend-common@0.
|
|
39
|
+
- @backstage/catalog-model@1.1.2-next.0
|
|
40
|
+
- @backstage/plugin-techdocs-node@1.4.1-next.0
|
|
41
|
+
- @backstage/backend-common@0.15.2-next.0
|
|
11
42
|
- @backstage/cli-common@0.1.10
|
|
12
|
-
- @backstage/config@
|
|
43
|
+
- @backstage/config@1.0.3-next.0
|
|
13
44
|
|
|
14
45
|
## 1.2.1
|
|
15
46
|
|
|
@@ -40,8 +40,11 @@ async function generate(opts) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
let containerRunner;
|
|
44
|
+
if (opts.docker) {
|
|
45
|
+
const dockerClient = new Docker__default["default"]();
|
|
46
|
+
containerRunner = new backendCommon.DockerContainerRunner({ dockerClient });
|
|
47
|
+
}
|
|
45
48
|
let parsedLocationAnnotation = {};
|
|
46
49
|
if (opts.techdocsRef) {
|
|
47
50
|
try {
|
|
@@ -71,4 +74,4 @@ async function generate(opts) {
|
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
exports["default"] = generate;
|
|
74
|
-
//# sourceMappingURL=generate-
|
|
77
|
+
//# sourceMappingURL=generate-103520bb.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-103520bb.cjs.js","sources":["../../src/commands/generate/generate.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport fs from 'fs-extra';\nimport Docker from 'dockerode';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport {\n ContainerRunner,\n DockerContainerRunner,\n} from '@backstage/backend-common';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n} from '../../lib/utility';\nimport { stdout } from 'process';\n\nexport default async function generate(opts: OptionValues) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: opts.verbose });\n\n const sourceDir = resolve(opts.sourceDir);\n const outputDir = resolve(opts.outputDir);\n const omitTechdocsCorePlugin = opts.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = opts.dockerImage;\n const pullImage = opts.pull;\n const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: opts.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n legacyCopyReadmeMdToIndexMd,\n omitTechdocsCorePlugin,\n },\n },\n },\n });\n\n // Docker client (conditionally) used by the generators, based on techdocs.generators config.\n let containerRunner: ContainerRunner | undefined;\n\n if (opts.docker) {\n const dockerClient = new Docker();\n containerRunner = new DockerContainerRunner({ dockerClient });\n }\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (opts.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n opts.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n containerRunner,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(opts.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: opts.etag,\n ...(process.env.LOG_LEVEL === 'debug' ? { logStream: stdout } : {}),\n });\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","config","ConfigReader","Docker","DockerContainerRunner","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","stdout"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,eAA8B,SAAS,IAAoB,EAAA;AAKzD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,SAAA,GAAYC,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAM,MAAA,SAAA,GAAYA,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,yBAAyB,IAAK,CAAA,4BAAA,CAAA;AACpC,EAAA,MAAM,cAAc,IAAK,CAAA,WAAA,CAAA;AACzB,EAAA,MAAM,YAAY,IAAK,CAAA,IAAA,CAAA;AACvB,EAAA,MAAM,8BAA8B,IAAK,CAAA,2BAAA,CAAA;AAEzC,EAAO,MAAA,CAAA,IAAA,CAAK,oBAAoB,SAAW,CAAA,CAAA,CAAA,CAAA;AAC3C,EAAO,MAAA,CAAA,IAAA,CAAK,kCAAkC,SAAW,CAAA,CAAA,CAAA,CAAA;AAEzD,EAAA,MAAA,CAAO,QAAQ,iDAAiD,CAAA,CAAA;AAEhE,EAAM,MAAAC,sBAAA,CAAG,UAAU,SAAS,CAAA,CAAA;AAE5B,EAAM,MAAAC,QAAA,GAAS,IAAIC,mBAAa,CAAA;AAAA,IAC9B,QAAU,EAAA;AAAA,MACR,SAAW,EAAA;AAAA,QACT,KAAA,EAAO,IAAK,CAAA,MAAA,GAAS,QAAW,GAAA,OAAA;AAAA,QAChC,WAAA;AAAA,QACA,SAAA;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,2BAAA;AAAA,UACA,sBAAA;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AAGD,EAAI,IAAA,eAAA,CAAA;AAEJ,EAAA,IAAI,KAAK,MAAQ,EAAA;AACf,IAAM,MAAA,YAAA,GAAe,IAAIC,0BAAO,EAAA,CAAA;AAChC,IAAA,eAAA,GAAkB,IAAIC,mCAAA,CAAsB,EAAE,YAAA,EAAc,CAAA,CAAA;AAAA,GAC9D;AAEA,EAAA,IAAI,2BAA2B,EAAC,CAAA;AAChC,EAAA,IAAI,KAAK,WAAa,EAAA;AACpB,IAAI,IAAA;AACF,MAA2B,wBAAA,GAAAC,8CAAA;AAAA,QACzB,IAAK,CAAA,WAAA;AAAA,OACP,CAAA;AAAA,aACO,GAAP,EAAA;AACA,MAAO,MAAA,CAAA,KAAA,CAAM,IAAI,OAAO,CAAA,CAAA;AAAA,KAC1B;AAAA,GACF;AAGA,EAAA,MAAM,iBAAoB,GAAA,MAAMC,oCAAkB,CAAA,UAAA,CAAWL,QAAQ,EAAA;AAAA,IACnE,MAAA;AAAA,IACA,eAAA;AAAA,GACD,CAAA,CAAA;AAED,EAAA,MAAA,CAAO,KAAK,6BAA6B,CAAA,CAAA;AAEzC,EAAA,MAAM,kBAAkB,GAAI,CAAA;AAAA,IAC1B,QAAU,EAAA,SAAA;AAAA,IACV,SAAA;AAAA,IACA,GAAI,KAAK,WACL,GAAA;AAAA,MACE,wBAAA;AAAA,QAEF,EAAC;AAAA,IACL,MAAA;AAAA,IACA,MAAM,IAAK,CAAA,IAAA;AAAA,IACX,GAAI,QAAQ,GAAI,CAAA,SAAA,KAAc,UAAU,EAAE,SAAA,EAAWM,gBAAO,EAAA,GAAI,EAAC;AAAA,GAClE,CAAA,CAAA;AAED,EAAA,MAAA,CAAO,KAAK,OAAO,CAAA,CAAA;AACrB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.e4032bfd.js"></script><script defer="defer" src="/static/module-material-ui.3f40a11a.js"></script><script defer="defer" src="/static/module-lodash.0cada415.js"></script><script defer="defer" src="/static/module-date-fns.d70f4cc3.js"></script><script defer="defer" src="/static/module-yaml.b5c4d531.js"></script><script defer="defer" src="/static/module-ajv.fca02de5.js"></script><script defer="defer" src="/static/module-material-table.5d56e1cb.js"></script><script defer="defer" src="/static/module-luxon.b057ddad.js"></script><script defer="defer" src="/static/module-octokit.47a26b3b.js"></script><script defer="defer" src="/static/module-react-dom.5abdac04.js"></script><script defer="defer" src="/static/module-zod.49ffd80f.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.97cccd01.js"></script><script defer="defer" src="/static/vendor.e4032bfd.js"></script><script defer="defer" src="/static/main.e4032bfd.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -489,4 +489,4 @@ ${de.href}
|
|
|
489
489
|
|
|
490
490
|
Feedback:`),dt=(Se==null?void 0:Se.type)==="github"?(0,un.Pb)(je.href,"blob"):je.href,Dt=Mt()(dt),It=`/${Dt.organization}/${Dt.name}`,Wt=de.cloneNode();switch(Se==null?void 0:Se.type){case"gitlab":Wt.href=`${je.origin}${It}/issues/new?issue[title]=${pt}&issue[description]=${Xe}`;break;case"github":Wt.href=`${je.origin}${It}/issues/new?title=${pt}&body=${Xe}`;break;default:return U}return sn.render(n.createElement(kn.Z),Wt),Wt.style.paddingLeft="5px",Wt.title="Leave feedback for this page",Wt.id="git-feedback-link",de==null||de.insertAdjacentElement("beforebegin",Wt),U};var Cn=t(44882);const on=()=>j=>{const U=j.querySelector('.md-header label[for="__drawer"]'),ne=j.querySelector("article");if(!U||!ne)return j;const de=U.cloneNode();return sn.render(n.createElement(Cn.Z),de),de.id="toggle-sidebar",de.title="Toggle Sidebar",de.classList.add("md-content__button"),de.style.setProperty("padding","0 0 0 5px"),de.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ne==null||ne.prepend(de),j},an=()=>j=>(((ne,de)=>{Array.from(ne).filter(je=>je.hasAttribute(de)).forEach(je=>{const Se=je.getAttribute(de);if(Se){Se.match(/^https?:\/\//i)&&je.setAttribute("target","_blank");try{const Qe=tn(window.location.href);je.setAttribute(de,new URL(Se,Qe).toString())}catch{je.replaceWith(je.textContent||Se)}}})})(Array.from(j.getElementsByTagName("a")),"href"),j);function tn(j){const U=new URL(j);return!U.pathname.endsWith("/")&&!U.pathname.endsWith(".html")&&(U.pathname+="/"),U.toString()}const ln=({baseUrl:j,onClick:U})=>ne=>(Array.from(ne.getElementsByTagName("a")).forEach(de=>{de.addEventListener("click",je=>{const Qe=de.getAttribute("href");!Qe||Qe.startsWith(j)&&!de.hasAttribute("download")&&(je.preventDefault(),U(je,Qe))})}),ne);var fn=t(15459),nn=t(80030),he=t(72379),te=t(41547);const Te=(0,fn.Z)(j=>({tooltip:{fontSize:"inherit",color:j.palette.text.primary,margin:0,padding:j.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(nn.ZP),ke=()=>(0,h.jsx)(he.Z,{children:(0,h.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"})}),Je=({text:j})=>{const[U,ne]=(0,n.useState)(!1),de=(0,n.useCallback)(()=>{navigator.clipboard.writeText(j),ne(!0)},[j]),je=(0,n.useCallback)(()=>{ne(!1)},[ne]);return(0,h.jsx)(Te,{title:"Copied to clipboard",placement:"left",open:U,onClose:je,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:de,children:(0,h.jsx)(ke,{})})})},J=j=>U=>{const ne=U.querySelectorAll("pre > code");for(const je of ne){var de;const Se=je.textContent||"",Qe=document.createElement("div");je==null||(de=je.parentElement)===null||de===void 0||de.prepend(Qe),sn.render((0,h.jsx)(te.Z,{theme:j,children:(0,h.jsx)(Je,{text:Se})}),Qe)}return U},y=()=>j=>{var U;return(U=j.querySelector(".md-header"))===null||U===void 0||U.remove(),j},g=()=>j=>{var U,ne;return(U=j.querySelector(".md-footer .md-copyright"))===null||U===void 0||U.remove(),(ne=j.querySelector(".md-footer-copyright"))===null||ne===void 0||ne.remove(),j},k=({onLoading:j,onLoaded:U})=>ne=>(j(),ne.addEventListener(W.Ox,function de(){U(),ne.removeEventListener(W.Ox,de)}),ne),G=()=>j=>(setTimeout(()=>{if(window.location.hash){var U;const ne=window.location.hash.slice(1);(U=j==null?void 0:j.querySelector(`[id="${ne}"]`))===null||U===void 0||U.scrollIntoView()}},200),j),ce=()=>j=>(setTimeout(()=>{const U=j==null?void 0:j.querySelectorAll("li.md-nav__item--active");U.length!==0&&(U.forEach(de=>{const je=de==null?void 0:de.querySelector("input");je!=null&&je.checked||je==null||je.click()}),U[U.length-1].scrollIntoView())},200),j),ge=async(j,U)=>{let ne;if(typeof j=="string")ne=new DOMParser().parseFromString(j,"text/html").documentElement;else if(j instanceof Element)ne=j;else throw new Error("dom is not a recognized type");for(const de of U)ne=await de(ne);return ne},Fe="screen and (max-width: 76.1875em)",st=j=>{const U=(0,Ke.s0)(),ne=(0,Ye.Z)(),de=(0,He.Z)(Fe),je=Ce(),Se=en(),Qe=(0,D.h_)(W.Dl),pt=(0,D.h_)(We.q3),{state:Xe,path:dt,content:Dt}=(0,T.DK)(),[It,Wt]=(0,n.useState)(null),Gn=(0,W.ux)(It),jn=(0,n.useCallback)(()=>{if(!It)return;It.querySelectorAll(".md-sidebar").forEach(w=>{if(de)w.style.top="0px";else{const K=document==null?void 0:document.querySelector(".techdocs-reader-page");var u;const me=(u=K==null?void 0:K.getBoundingClientRect().top)!==null&&u!==void 0?u:0;var b;let ye=(b=It.getBoundingClientRect().top)!==null&&b!==void 0?b:0;const Re=It.querySelector(".md-container > .md-tabs");var A;const et=(A=Re==null?void 0:Re.getBoundingClientRect().height)!==null&&A!==void 0?A:0;ye<me&&(ye=me),w.style.top=`${Math.max(ye,0)+et}px`}w.style.setProperty("opacity","1")})},[It,de]);(0,n.useEffect)(()=>(window.addEventListener("resize",jn),window.addEventListener("scroll",jn,!0),()=>{window.removeEventListener("resize",jn),window.removeEventListener("scroll",jn,!0)}),[It,jn]);const On=(0,n.useCallback)(()=>{if(!It)return;const Nt=It.querySelector(".md-footer");Nt&&(Nt.style.width=`${It.getBoundingClientRect().width}px`)},[It]);(0,n.useEffect)(()=>(window.addEventListener("resize",On),()=>{window.removeEventListener("resize",On)}),[It,On]),(0,n.useEffect)(()=>{Gn||(On(),jn())},[Xe,Gn,On,jn]);const $n=(0,n.useCallback)((Nt,w)=>ge(Nt,[je,wn({techdocsStorageApi:Qe,entityId:j,path:w}),an(),on(),y(),g(),Rn(pt),Se]),[j,pt,Qe,je,Se]),qn=(0,n.useCallback)(async Nt=>ge(Nt,[G(),ce(),J(ne),ln({baseUrl:window.location.origin,onClick:(w,u)=>{const b=w.ctrlKey||w.metaKey,A=new URL(u);if(A.hash)if(b)window.open(`${A.pathname}${A.hash}`,"_blank");else{var K;U(`${A.pathname}${A.hash}`),(K=Nt==null?void 0:Nt.querySelector(`[id="${A.hash.slice(1)}"]`))===null||K===void 0||K.scrollIntoView()}else b?window.open(A.pathname,"_blank"):U(A.pathname)}}),k({onLoading:()=>{},onLoaded:()=>{var w;(w=Nt.querySelector(".md-nav__title"))===null||w===void 0||w.removeAttribute("for")}}),k({onLoading:()=>{Array.from(Nt.querySelectorAll(".md-sidebar")).forEach(u=>{u.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ne,U]);return(0,n.useEffect)(()=>{if(!Dt)return()=>{};let Nt=!0;return $n(Dt,dt).then(async w=>{if(!(w!=null&&w.innerHTML)||!Nt)return;window.scroll({top:0});const u=await qn(w);Wt(u)}),()=>{Nt=!1}},[Dt,dt,$n,qn]),It};var _e=t(8560);const vt=()=>{const j=(0,W.$L)(),{shadowRoot:U}=(0,W.x1)(),ne=U==null?void 0:U.querySelector('[data-md-component="content"]'),de=U==null?void 0:U.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let je=de==null?void 0:de.querySelector('[data-techdocs-addons-location="primary sidebar"]');je||(je=document.createElement("div"),je.setAttribute("data-techdocs-addons-location","primary sidebar"),de==null||de.prepend(je));const Se=U==null?void 0:U.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Qe=Se==null?void 0:Se.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Qe||(Qe=document.createElement("div"),Qe.setAttribute("data-techdocs-addons-location","secondary sidebar"),Se==null||Se.prepend(Qe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_e.Z,{container:je,children:j.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,h.jsx)(_e.Z,{container:ne,children:j.renderComponentsByLocation(W.oZ.Content)}),(0,h.jsx)(_e.Z,{container:Qe,children:j.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},ft=(0,v.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),ht=(0,T.m1)(j=>{var U;const{withSearch:ne=!0,onReady:de}=j,je=ft(),{entityMetadata:{value:Se,loading:Qe},entityRef:pt,setShadowRoot:Xe}=(0,W.x1)(),dt=st(pt),Dt=(0,n.useCallback)(It=>{Xe(It),de instanceof Function&&de()},[Xe,de]);return Qe===!1&&!Se?(0,h.jsx)(S.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):dt?(0,h.jsx)(S.VY,{children:(0,h.jsxs)(I.Z,{container:!0,children:[(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(xe,{})}),ne&&(0,h.jsx)(I.Z,{className:je.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:pt,entityTitle:Se==null||(U=Se.metadata)===null||U===void 0?void 0:U.title})}),(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(W.VA,{element:dt,onAppend:Dt,children:(0,h.jsx)(vt,{})})})]})}):(0,h.jsx)(S.VY,{children:(0,h.jsx)(I.Z,{container:!0,children:(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(xe,{})})})})}),Et=null},93225:function(bt,Oe,t){"use strict";t.d(Oe,{S:function(){return Q}});var h=t(52322),n=t(2784),v=t(18671),I=t(98069),W=t(73250),S=t(61886),l=t(46285),B=t(25271),se=t(71399),X=t(25248),q=t(95573);const F=(0,h.jsx)(I.Z,{animation:"wave",variant:"text",height:40}),Q=Y=>{const{children:ue}=Y,le=(0,S.$L)(),P=(0,X.h_)(X.Ds),{title:R,setTitle:D,subtitle:L,setSubtitle:T,entityRef:re,metadata:{value:xe,loading:Ke},entityMetadata:{value:Ye,loading:He}}=(0,S.x1)();(0,n.useEffect)(()=>{!xe||(D(xe.site_name),T(()=>{let{site_description:mt}=xe;return(!mt||mt==="None")&&(mt="Home"),mt}))},[xe,D,T]);const We=P.getOptional("app.title")||"Backstage",Ge=[R,L,We].filter(Boolean).join(" | "),{locationMetadata:Ne,spec:Me}=Ye||{},qe=Me==null?void 0:Me.lifecycle,ct=Ye?(0,l.hF)(Ye,B.S4):[],it=(0,X.tg)(q._Z)(),rt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(se.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:re,title:Ye==null?void 0:Ye.metadata.title,defaultKind:"Component"})}),ct.length>0&&(0,h.jsx)(se.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:ct,defaultKind:"group"})}),qe?(0,h.jsx)(se.i9,{label:"Lifecycle",value:qe}):null,Ne&&Ne.type!=="dir"&&Ne.type!=="file"?(0,h.jsx)(se.i9,{label:"",value:(0,h.jsx)("a",{href:Ne.target,target:"_blank",rel:"noopener noreferrer",children:(0,h.jsx)(W.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!He&&Ye===void 0||!Ke&&xe===void 0?null:(0,h.jsxs)(se.h4,{type:"Documentation",typeLink:it,title:R||F,subtitle:L||F,children:[(0,h.jsx)(v.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ge})}),rt,ue,le.renderComponentsByLocation(S.oZ.Header)]})}},65124:function(bt,Oe,t){"use strict";t.d(Oe,{b:function(){return F}});var h=t(52322),n=t(2784),v=t(79692),I=t(15223),W=t(95544),S=t(80030),l=t(61837),B=t(48348),se=t(47603),X=t(61886);const q=(0,v.Z)(Q=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:Q.spacing(3,3,0)}})),F=Q=>{const Y=q(),[ue,le]=(0,n.useState)(null),P=(0,n.useCallback)(Ke=>{le(Ke.currentTarget)},[]),R=(0,n.useCallback)(()=>{le(null)},[]),{entityMetadata:{value:D,loading:L}}=(0,X.x1)(),T=(0,X.$L)(),re=T.renderComponentsByLocation(X.oZ.Subheader),xe=T.renderComponentsByLocation(X.oZ.Settings);return!re&&!xe||L===!1&&!D?null:(0,h.jsx)(I.Z,{classes:Y,...Q.toolbarProps,children:(0,h.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[re,xe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(S.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:P,children:(0,h.jsx)(se.Z,{})})}),(0,h.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ue,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ue),onClose:R,keepMounted:!0,children:xe})]}):null]})})}},95481:function(bt,Oe,t){"use strict";t.d(Oe,{DK:function(){return F},m1:function(){return Y}});var h=t(52322),n=t(2784),v=t(10289),I=t(61886),W=t(25248),S=t(64279),l=t(77446);function B({contentLoading:ue,content:le,activeSyncState:P}){return ue||P==="BUILD_READY_RELOAD"||!le&&P==="CHECKING"?"CHECKING":!le&&P==="BUILDING"?"INITIAL_BUILD":le?P==="BUILDING"?"CONTENT_STALE_REFRESHING":P==="BUILD_READY"?"CONTENT_STALE_READY":P==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function se(ue,le){const P={...ue};switch(le.type){case"sync":le.state==="CHECKING"&&(P.buildLog=[]),P.activeSyncState=le.state,P.syncError=le.syncError;break;case"contentLoading":P.contentLoading=!0,P.contentError=void 0;break;case"content":typeof le.path=="string"&&(P.path=le.path),P.contentLoading=!1,P.content=le.content,P.contentError=le.contentError;break;case"buildLog":P.buildLog=P.buildLog.concat(le.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(P.activeSyncState)&&["contentLoading","content"].includes(le.type)&&(P.activeSyncState="UP_TO_DATE",P.buildLog=[]),P}function X(ue,le,P,R){var D,L;const[T,re]=(0,n.useReducer)(se,{activeSyncState:"CHECKING",path:R,contentLoading:!0,buildLog:[]}),xe=(0,W.h_)(I.Dl),{retry:Ke}=(0,l.Z)(async()=>{re({type:"contentLoading"});try{const We=await xe.getEntityDocs({kind:ue,namespace:le,name:P},R);return re({type:"content",content:We,path:R}),We}catch(We){re({type:"content",contentError:We,path:R})}},[xe,ue,le,P,R]),Ye=(0,n.useRef)({content:void 0,reload:()=>{}});return Ye.current={content:T.content,reload:Ke},(0,S.default)(async()=>{re({type:"sync",state:"CHECKING"});const We=setTimeout(()=>{re({type:"sync",state:"BUILDING"})},1e3);try{switch(await xe.syncEntityDocs({kind:ue,namespace:le,name:P},Ne=>{re({type:"buildLog",log:Ne})})){case"updated":Ye.current.content?re({type:"sync",state:"BUILD_READY"}):(Ye.current.reload(),re({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":re({type:"sync",state:"UP_TO_DATE"});break;default:re({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(Ge){re({type:"sync",state:"ERROR",syncError:Ge})}finally{clearTimeout(We)}},[ue,P,le,xe,re,Ye]),{state:(0,n.useMemo)(()=>B({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Ke,path:T.path,content:T.content,contentErrorMessage:(D=T.contentError)===null||D===void 0?void 0:D.toString(),syncErrorMessage:(L=T.syncError)===null||L===void 0?void 0:L.toString(),buildLog:T.buildLog}}const q=(0,n.createContext)({}),F=()=>(0,n.useContext)(q),Q=({children:ue})=>{const{"*":le=""}=(0,v.UO)(),{entityRef:P}=(0,I.x1)(),{kind:R,namespace:D,name:L}=P,T=X(R,D,L,le);return(0,h.jsx)(q.Provider,{value:T,children:ue instanceof Function?ue(T):ue})},Y=ue=>le=>(0,h.jsx)(Q,{children:(0,h.jsx)(ue,{...le})})},95573:function(bt,Oe,t){"use strict";t.d(Oe,{Fw:function(){return v},_Z:function(){return n},pd:function(){return I}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),v=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),I=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(bt,Oe,t){"use strict";t.d(Oe,{S:function(){return R}});var h=t(52322),n=t(2784),v=t(79692),I=t(49378),W=t(38402),S=t(86136),l=t(85256),B=t(71399),se=t(25248),X=t(60712);const q=(0,v.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),F=D=>{const{result:L,highlight:T,rank:re,lineClamp:xe=5,asListItem:Ke=!0,asLink:Ye=!0,title:He,icon:We}=D,Ge=q(),Ne=(0,se.z$)(),Me=()=>{Ne.captureEvent("discover",L.title,{attributes:{to:L.location},value:re})},qe=()=>{const rt=T!=null&&T.fields.title?(0,h.jsx)(X.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):L.title,Ae=T!=null&&T.fields.entityTitle?(0,h.jsx)(X.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):L.entityTitle,tt=T!=null&&T.fields.name?(0,h.jsx)(X.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):L.name;return(0,h.jsx)(I.Z,{className:Ge.itemText,primaryTypographyProps:{variant:"h6"},primary:He||(0,h.jsxs)(h.Fragment,{children:[rt," | ",Ae!=null?Ae:tt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:xe,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(X.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):L.text})})},ct=({children:rt})=>Ye?(0,h.jsx)(B.rU,{noTrack:!0,to:L.location,onClick:Me,children:rt}):(0,h.jsx)(h.Fragment,{children:rt}),it=({children:rt})=>Ke?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(W.Z,{alignItems:"flex-start",children:[We&&(0,h.jsx)(S.Z,{children:We}),(0,h.jsx)("div",{className:Ge.flexContainer,children:rt})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:rt});return(0,h.jsx)(ct,{children:(0,h.jsx)(it,{children:(0,h.jsx)(qe,{})})})};var Q=t(27556),Y=t(10289);const ue=(0,v.Z)(D=>({root:{width:"100%"},bar:{padding:D.spacing(1)}})),le=D=>D==null?void 0:D.document,P=D=>{const{entityId:L,entityTitle:T,debounceTime:re=150}=D,[xe,Ke]=(0,n.useState)(!1),Ye=(0,Y.s0)(),{setFilters:He,result:{loading:We,value:Ge}}=(0,X.Rx)(),Ne=ue(),[Me,qe]=(0,n.useState)([]);(0,n.useEffect)(()=>{let tt=!0;if(tt&&Ge){const mt=Ge.results.slice(0,10);qe(mt)}return()=>{tt=!1}},[We,Ge]);const{kind:ct,name:it,namespace:rt}=L;(0,n.useEffect)(()=>{He(tt=>({...tt,kind:ct,namespace:rt,name:it}))},[ct,rt,it,He]);const Ae=(tt,mt)=>{if(le(mt)){const{location:Le}=mt.document;Ye(Le)}};return(0,h.jsx)(Q.Z,{className:Ne.bar,variant:"outlined",children:(0,h.jsx)(X.qO,{classes:{root:Ne.root},"data-testid":"techdocs-search-bar",size:"small",open:xe,getOptionLabel:()=>"",filterOptions:tt=>tt,onClose:()=>{Ke(!1)},onFocus:()=>{Ke(!0)},onChange:Ae,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Me,renderOption:({document:tt,highlight:mt})=>(0,h.jsx)(F,{result:tt,lineClamp:3,asListItem:!1,asLink:!1,title:tt.title,highlight:mt}),loading:We,inputDebounceTime:re,inputPlaceholder:`Search ${T||L.name} docs`,freeSolo:!1})})},R=D=>{const L={term:"",types:["techdocs"],pageCursor:"",filters:D.entityId};return(0,h.jsx)(X.Nd,{initialState:L,children:(0,h.jsx)(P,{...D})})}},53260:function(){}},function(bt){var Oe=function(h){return bt(bt.s=h)};bt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Oe(96215)});var t=bt.O()}]);})();
|
|
491
491
|
|
|
492
|
-
//# sourceMappingURL=main.
|
|
492
|
+
//# sourceMappingURL=main.e4032bfd.js.map
|