@techdocs/cli 0.0.0-nightly-20230616022634 → 0.0.0-nightly-20230617022331
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 +6 -5
- package/dist/cjs/{migrate-0697fdb4.cjs.js → migrate-32510d4d.cjs.js} +2 -2
- package/dist/cjs/migrate-32510d4d.cjs.js.map +1 -0
- package/dist/cjs/{publish-ac098b56.cjs.js → publish-2c1fe164.cjs.js} +2 -2
- package/dist/cjs/publish-2c1fe164.cjs.js.map +1 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.abbffcd5.js → main.39b6f8fc.js} +1 -1
- package/dist/embedded-app/static/{main.abbffcd5.js.map → main.39b6f8fc.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.abbffcd5.js → runtime.39b6f8fc.js} +1 -1
- package/dist/embedded-app/static/{runtime.abbffcd5.js.map → runtime.39b6f8fc.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.abbffcd5.js → vendor.39b6f8fc.js} +1 -1
- package/dist/embedded-app/static/{vendor.abbffcd5.js.map → vendor.39b6f8fc.js.map} +1 -1
- package/dist/index.cjs.js +2 -2
- package/package.json +6 -6
- package/dist/cjs/migrate-0697fdb4.cjs.js.map +0 -1
- package/dist/cjs/publish-ac098b56.cjs.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20230617022331
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- 68a21956ef52: Remove reference to deprecated import
|
|
7
8
|
- Updated dependencies
|
|
8
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
9
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
10
|
-
- @backstage/catalog-model@0.0.0-nightly-
|
|
9
|
+
- @backstage/backend-common@0.0.0-nightly-20230617022331
|
|
10
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20230617022331
|
|
11
|
+
- @backstage/catalog-model@0.0.0-nightly-20230617022331
|
|
11
12
|
- @backstage/cli-common@0.1.12
|
|
12
|
-
- @backstage/config@
|
|
13
|
+
- @backstage/config@0.0.0-nightly-20230617022331
|
|
13
14
|
|
|
14
15
|
## 1.4.3-next.2
|
|
15
16
|
|
|
@@ -12,7 +12,7 @@ require('@backstage/config');
|
|
|
12
12
|
async function migrate(opts) {
|
|
13
13
|
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
14
14
|
const config = PublisherConfig.PublisherConfig.getValidConfig(opts);
|
|
15
|
-
const discovery = backendCommon.
|
|
15
|
+
const discovery = backendCommon.HostDiscovery.fromConfig(config);
|
|
16
16
|
const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery });
|
|
17
17
|
if (!publisher.migrateDocsCase) {
|
|
18
18
|
throw new Error(`Migration not implemented for ${opts.publisherType}`);
|
|
@@ -35,4 +35,4 @@ async function migrate(opts) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
exports["default"] = migrate;
|
|
38
|
-
//# sourceMappingURL=migrate-
|
|
38
|
+
//# sourceMappingURL=migrate-32510d4d.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-32510d4d.cjs.js","sources":["../../src/commands/migrate/migrate.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { HostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function migrate(opts: OptionValues) {\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 if (!publisher.migrateDocsCase) {\n throw new Error(`Migration not implemented for ${opts.publisherType}`);\n }\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n throw new Error('');\n }\n\n // Validate and parse migration arguments.\n const removeOriginal = opts.removeOriginal;\n const numericConcurrency = parseInt(opts.concurrency, 10);\n\n if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {\n throw new Error(\n `Concurrency must be a number greater than 1. ${opts.concurrency} provided.`,\n );\n }\n\n await publisher.migrateDocsCase({\n concurrency: numericConcurrency,\n removeOriginal,\n });\n}\n"],"names":["createLogger","PublisherConfig","HostDiscovery","Publisher"],"mappings":";;;;;;;;;;;AAsBA,eAA8B,QAAQ,IAAoB,EAAA;AACxD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAA,SAAA,GAAYC,2BAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAE1E,EAAI,IAAA,CAAC,UAAU,eAAiB,EAAA;AAC9B,IAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,IAAA,CAAK,aAAe,CAAA,CAAA,CAAA,CAAA;AAAA,GACvE;AAGA,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAM,MAAA,IAAI,MAAM,EAAE,CAAA,CAAA;AAAA,GACpB;AAGA,EAAA,MAAM,iBAAiB,IAAK,CAAA,cAAA,CAAA;AAC5B,EAAA,MAAM,kBAAqB,GAAA,QAAA,CAAS,IAAK,CAAA,WAAA,EAAa,EAAE,CAAA,CAAA;AAExD,EAAA,IAAI,CAAC,MAAO,CAAA,SAAA,CAAU,kBAAkB,CAAA,IAAK,sBAAsB,CAAG,EAAA;AACpE,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,gDAAgD,IAAK,CAAA,WAAA,CAAA,UAAA,CAAA;AAAA,KACvD,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,UAAU,eAAgB,CAAA;AAAA,IAC9B,WAAa,EAAA,kBAAA;AAAA,IACb,cAAA;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
|
@@ -13,7 +13,7 @@ require('@backstage/config');
|
|
|
13
13
|
async function publish(opts) {
|
|
14
14
|
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
15
15
|
const config = PublisherConfig.PublisherConfig.getValidConfig(opts);
|
|
16
|
-
const discovery = backendCommon.
|
|
16
|
+
const discovery = backendCommon.HostDiscovery.fromConfig(config);
|
|
17
17
|
const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery });
|
|
18
18
|
const { isAvailable } = await publisher.getReadiness();
|
|
19
19
|
if (!isAvailable) {
|
|
@@ -33,4 +33,4 @@ async function publish(opts) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
exports["default"] = publish;
|
|
36
|
-
//# sourceMappingURL=publish-
|
|
36
|
+
//# sourceMappingURL=publish-2c1fe164.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-2c1fe164.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-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(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","HostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;;;AAwBA,eAA8B,QAAQ,IAAkC,EAAA;AACtE,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAA,SAAA,GAAYC,2BAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAG1E,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,EAAE,CAAC,CAAA,CAAA;AAAA,GACrC;AAEA,EAAM,MAAA,CAAC,WAAW,IAAM,EAAA,IAAI,IAAI,IAAK,CAAA,MAAA,CAAO,MAAM,GAAG,CAAA,CAAA;AACrD,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,IAAA;AAAA,IACA,QAAU,EAAA;AAAA,MACR,SAAA;AAAA,MACA,IAAA;AAAA,KACF;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,SAAA,GAAYC,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,SAAU,CAAA,OAAA,CAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAE7C,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
|
|
@@ -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.39b6f8fc.js"></script><script defer="defer" src="/static/module-material-ui.09dab505.js"></script><script defer="defer" src="/static/module-lodash.4c9a1319.js"></script><script defer="defer" src="/static/module-date-fns.eeb6d2d2.js"></script><script defer="defer" src="/static/module-yaml.af9b4f42.js"></script><script defer="defer" src="/static/module-ajv.be583887.js"></script><script defer="defer" src="/static/module-material-table.e97c8359.js"></script><script defer="defer" src="/static/module-luxon.a1854eb9.js"></script><script defer="defer" src="/static/module-octokit.a126d1a6.js"></script><script defer="defer" src="/static/module-react-dom.d698fbed.js"></script><script defer="defer" src="/static/module-react-router.a589137b.js"></script><script defer="defer" src="/static/module-react-router-dom.cf49e816.js"></script><script defer="defer" src="/static/module-zod.49079951.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.c3c3faee.js"></script><script defer="defer" src="/static/vendor.39b6f8fc.js"></script><script defer="defer" src="/static/main.39b6f8fc.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -519,4 +519,4 @@ ${M.href}
|
|
|
519
519
|
|
|
520
520
|
Feedback:`),Tt=(ye==null?void 0:ye.type)==="github"?(0,Cn.BT)(ue.href,"blob"):ue.href,Et=on()(Tt),st=`/${Et.organization}/${Et.name}`,Ne=M.cloneNode();switch(ye==null?void 0:ye.type){case"gitlab":Ne.href=`${ue.origin}${st}/issues/new?issue[title]=${ot}&issue[description]=${ht}`;break;case"github":Ne.href=`${ue.origin}${st}/issues/new?title=${ot}&body=${ht}`;break;default:return O}return rn.render(p.createElement(Kt.Z),Ne),Ne.style.paddingLeft="5px",Ne.title="Leave feedback for this page",Ne.id="git-feedback-link",M==null||M.insertAdjacentElement("beforebegin",Ne),O};var Zn=n(44882);const nt=()=>v=>{const O=v.querySelector('.md-header label[for="__drawer"]'),J=v.querySelector("article");if(!O||!J)return v;const M=O.cloneNode();return rn.render(p.createElement(Zn.Z),M),M.id="toggle-sidebar",M.title="Toggle Sidebar",M.classList.add("md-content__button"),M.style.setProperty("padding","0 0 0 5px"),M.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),J==null||J.prepend(M),v},sn=()=>v=>(((J,M)=>{Array.from(J).filter(ue=>ue.hasAttribute(M)).forEach(ue=>{const ye=ue.getAttribute(M);if(ye){ye.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const Me=Yt(window.location.href);ue.setAttribute(M,new URL(ye,Me).toString())}catch{ue.replaceWith(ue.textContent||ye)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Yt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const rt=({baseUrl:v,onClick:O})=>J=>(Array.from(J.getElementsByTagName("a")).forEach(M=>{M.addEventListener("click",ue=>{const Me=M.getAttribute("href");Me&&Me.startsWith(v)&&!M.hasAttribute("download")&&(ue.preventDefault(),O(ue,Me))})}),J);var Pn=n(15459),Jt=n(80030),Ln=n(72379),Un=n(41547),On=n(95074);const Mn=(0,Pn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Jt.ZP),Se=()=>(0,r.jsx)(Ln.Z,{children:(0,r.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"})}),ce=({text:v})=>{const[O,J]=(0,p.useState)(!1),[,M]=(0,On.Z)(),ue=(0,p.useCallback)(()=>{M(v),J(!0)},[v,M]),ye=(0,p.useCallback)(()=>{J(!1)},[J]);return(0,r.jsx)(Mn,{title:"Copied to clipboard",placement:"left",open:O,onClose:ye,leaveDelay:1e3,children:(0,r.jsx)(L.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)(Se,{})})})},Ie=v=>O=>{const J=O.querySelectorAll("pre > code");for(const ue of J){var M;const ye=ue.textContent||"",Me=document.createElement("div");ue==null||(M=ue.parentElement)===null||M===void 0||M.prepend(Me),rn.render((0,r.jsx)(Un.Z,{theme:v,children:(0,r.jsx)(ce,{text:ye})}),Me)}return O},Ue=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Ve=()=>v=>{var O,J;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(J=v.querySelector(".md-footer-copyright"))===null||J===void 0||J.remove(),v},le=({onLoading:v,onLoaded:O})=>J=>(v(),J.addEventListener(z.Ox,function M(){O(),J.removeEventListener(z.Ox,M)}),J),U=()=>v=>(v.addEventListener(z.Ox,function O(){if(window.location.hash){var J;const M=window.location.hash.slice(1);(J=v==null?void 0:v.querySelector(`[id="${M}"]`))===null||J===void 0||J.scrollIntoView()}v.removeEventListener(z.Ox,O)}),v),he=()=>v=>(setTimeout(()=>{const O=v==null?void 0:v.querySelectorAll("li.md-nav__item--active");O.length!==0&&(O.forEach(M=>{const ue=M==null?void 0:M.querySelector("input");ue!=null&&ue.checked||ue==null||ue.click()}),O[O.length-1].scrollIntoView())},200),v),$e=async(v,O)=>{let J;if(typeof v=="string")J=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)J=v;else throw new Error("dom is not a recognized type");for(const M of O)J=await M(J);return J};var Ke=n(73557);function Je(v,O){const J=new URL(O),M=`${J.origin}${J.pathname.replace(/\/$/,"")}`,ue=v.replace(M,"").replace(/^\/+/,""),ye=new URL(`http://localhost/${ue}`);return`${ye.pathname}${ye.search}${ye.hash}`}function Zt(){const v=(0,Ke.s0)(),J=(0,H.h_)(H.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let ye=ue;if(J)try{ye=Je(ue,J)}catch{}v(ye)},[v,J])}const _t="screen and (max-width: 76.1875em)",en=v=>{const O=Zt(),J=(0,je.Z)(),M=(0,Pe.Z)(_t),ue=Ht(),ye=pn(),Me=(0,H.z$)(),ot=(0,H.h_)(z.Dl),ht=(0,H.h_)(N.q3),{state:Tt,path:Et,content:st}=(0,R.DK)(),[Ne,Ut]=(0,p.useState)(null),Xt=(0,z.ux)(Ne),bt=(0,p.useCallback)(()=>{if(!Ne)return;Ne.querySelectorAll(".md-sidebar").forEach(He=>{if(M)He.style.top="0px";else{const sr=document==null?void 0:document.querySelector(".techdocs-reader-page");var Lt;const mr=(Lt=sr==null?void 0:sr.getBoundingClientRect().top)!==null&&Lt!==void 0?Lt:0;var xn;let Hn=(xn=Ne.getBoundingClientRect().top)!==null&&xn!==void 0?xn:0;const cn=Ne.querySelector(".md-container > .md-tabs");var nn;const ir=(nn=cn==null?void 0:cn.getBoundingClientRect().height)!==null&&nn!==void 0?nn:0;Hn<mr&&(Hn=mr),He.style.top=`${Math.max(Hn,0)+ir}px`}He.style.setProperty("opacity","1")})},[Ne,M]);(0,p.useEffect)(()=>(window.addEventListener("resize",bt),window.addEventListener("scroll",bt,!0),()=>{window.removeEventListener("resize",bt),window.removeEventListener("scroll",bt,!0)}),[Ne,bt]);const Ft=(0,p.useCallback)(()=>{if(!Ne)return;const vt=Ne.querySelector(".md-footer");vt&&(vt.style.width=`${Ne.getBoundingClientRect().width}px`)},[Ne]);(0,p.useEffect)(()=>(window.addEventListener("resize",Ft),()=>{window.removeEventListener("resize",Ft)}),[Ne,Ft]),(0,p.useEffect)(()=>{Xt||(Ft(),bt())},[Tt,Xt,Ft,bt]);const gn=(0,p.useCallback)((vt,He)=>$e(vt,[ue,qt({techdocsStorageApi:ot,entityId:v,path:He}),sn(),nt(),Ue(),Ve(),An(ht),ye]),[v,ht,ot,ue,ye]),wn=(0,p.useCallback)(async vt=>$e(vt,[U(),he(),Ie(J),rt({baseUrl:window.location.origin,onClick:(He,Lt)=>{var xn;const nn=He.ctrlKey||He.metaKey,sr=new URL(Lt),mr=((xn=He.target)===null||xn===void 0?void 0:xn.innerText)||Lt,Hn=Lt.replace(window.location.origin,"");if(Me.captureEvent("click",mr,{attributes:{to:Hn}}),sr.hash)if(nn)window.open(Lt,"_blank");else{var cn;O(Lt),(cn=vt==null?void 0:vt.querySelector(`[id="${sr.hash.slice(1)}"]`))===null||cn===void 0||cn.scrollIntoView()}else nn?window.open(Lt,"_blank"):O(Lt)}}),le({onLoading:()=>{},onLoaded:()=>{var He;(He=vt.querySelector(".md-nav__title"))===null||He===void 0||He.removeAttribute("for")}}),le({onLoading:()=>{Array.from(vt.querySelectorAll(".md-sidebar")).forEach(Lt=>{Lt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[J,O,Me]);return(0,p.useEffect)(()=>{if(!st)return()=>{};let vt=!0;return gn(st,Et).then(async He=>{if(!(He!=null&&He.innerHTML)||!vt)return;window.scroll({top:0});const Lt=await wn(He);Ut(Lt)}),()=>{vt=!1}},[st,Et,gn,wn]),Ne};var Qt=n(8560);const tn=()=>{const v=(0,z.$L)(),{shadowRoot:O}=(0,z.x1)(),J=O==null?void 0:O.querySelector('[data-md-component="content"]'),M=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ue=M==null?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');ue||(ue=document.createElement("div"),ue.setAttribute("data-techdocs-addons-location","primary sidebar"),M==null||M.prepend(ue));const ye=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Me=ye==null?void 0:ye.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Me||(Me=document.createElement("div"),Me.setAttribute("data-techdocs-addons-location","secondary sidebar"),ye==null||ye.prepend(Me)),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Qt.Z,{container:ue,children:v.renderComponentsByLocation(z.oZ.PrimarySidebar)}),(0,r.jsx)(Qt.Z,{container:J,children:v.renderComponentsByLocation(z.oZ.Content)}),(0,r.jsx)(Qt.Z,{container:Me,children:v.renderComponentsByLocation(z.oZ.SecondarySidebar)})]})},_=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),X=(0,R.m1)(v=>{var O;const{withSearch:J=!0,onReady:M}=v,ue=_(),{entityMetadata:{value:ye,loading:Me},entityRef:ot,setShadowRoot:ht}=(0,z.x1)(),Tt=en(ot),Et=(0,p.useCallback)(st=>{ht(st),M instanceof Function&&M()},[ht,M]);return Me===!1&&!ye?(0,r.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Tt?(0,r.jsx)(g.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(G,{})}),J&&(0,r.jsx)(f.Z,{className:ue.search,xs:"auto",item:!0,children:(0,r.jsx)(u.S,{entityId:ot,entityTitle:ye==null||(O=ye.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(z.VA,{element:Tt,onAppend:Et,children:(0,r.jsx)(tn,{})})})]})}):(0,r.jsx)(g.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(G,{})})})})}),ee=null},93225:function(St,ke,n){"use strict";n.d(ke,{S:function(){return oe}});var r=n(52322),p=n(2784),W=n(18671),f=n(60905),z=n(98069),g=n(60364),u=n(73250),D=n(61886),ge=n(39709),de=n(25271),V=n(53974),te=n(60871),L=n(76635),A=n(95573);const ae=(0,r.jsx)(z.Z,{animation:"wave",variant:"text",height:40}),oe=se=>{const{palette:{common:{white:q}}}=(0,g.Z)(),{children:H}=se,T=(0,D.$L)(),R=(0,te.h_)(te.Ds),{title:P,setTitle:G,subtitle:je,setSubtitle:Pe,entityRef:N,metadata:{value:_e,loading:at},entityMetadata:{value:It,loading:zt}}=(0,D.x1)();(0,p.useEffect)(()=>{_e&&(G(_e.site_name),Pe(()=>{let{site_description:Ce}=_e;return(!Ce||Ce==="None")&&(Ce=""),Ce}))},[_e,G,Pe]);const xt=R.getOptional("app.title")||"Backstage",Nt=[P,je,xt].filter(Boolean).join(" | "),{locationMetadata:Dt,spec:et}=It||{},lt=et==null?void 0:et.lifecycle,yt=It?(0,ge.hF)(It,de.S4):[],At=(0,te.tg)(A._Z)(),$t=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.i9,{label:(0,L.capitalize)((It==null?void 0:It.kind)||"entity"),value:(0,r.jsx)(ge.dx,{color:"inherit",entityRef:N,title:It==null?void 0:It.metadata.title,defaultKind:"Component"})}),yt.length>0&&(0,r.jsx)(V.i9,{label:"Owner",value:(0,r.jsx)(ge.rI,{color:"inherit",entityRefs:yt,defaultKind:"group"})}),lt?(0,r.jsx)(V.i9,{label:"Lifecycle",value:lt}):null,Dt&&Dt.type!=="dir"&&Dt.type!=="file"?(0,r.jsx)(V.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:q},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Dt.target}):null]});return!zt&&It===void 0||!at&&_e===void 0?null:(0,r.jsxs)(V.h4,{type:"Documentation",typeLink:At,title:P||ae,subtitle:je===""?void 0:je||ae,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:Nt})}),$t,H,T.renderComponentsByLocation(D.oZ.Header)]})}},65124:function(St,ke,n){"use strict";n.d(ke,{b:function(){return te}});var r=n(52322),p=n(2784),W=n(79692),f=n(15223),z=n(95544),g=n(80030),u=n(61837),D=n(48348),ge=n(47603),de=n(61886);const V=(0,W.Z)(L=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:L.spacing(3,3,0),"@media print":{display:"none"}}})),te=L=>{const A=V(),[ae,oe]=(0,p.useState)(null),se=(0,p.useCallback)(je=>{oe(je.currentTarget)},[]),q=(0,p.useCallback)(()=>{oe(null)},[]),{entityMetadata:{value:H,loading:T}}=(0,de.x1)(),R=(0,de.$L)(),P=R.renderComponentsByLocation(de.oZ.Subheader),G=R.renderComponentsByLocation(de.oZ.Settings);return!P&&!G||T===!1&&!H?null:(0,r.jsx)(f.Z,{classes:A,...L.toolbarProps,children:(0,r.jsxs)(z.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,G?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.ZP,{title:"Settings",children:(0,r.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:se,children:(0,r.jsx)(ge.Z,{})})}),(0,r.jsx)(D.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ae,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ae),onClose:q,keepMounted:!0,children:(0,r.jsx)("div",{children:G})})]}):null]})})}},95481:function(St,ke,n){"use strict";n.d(ke,{DK:function(){return te},m1:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(61886),z=n(60871),g=n(64279),u=n(77446);function D({contentLoading:ae,content:oe,activeSyncState:se}){return ae||se==="BUILD_READY_RELOAD"||!oe&&se==="CHECKING"?"CHECKING":!oe&&se==="BUILDING"?"INITIAL_BUILD":oe?se==="BUILDING"?"CONTENT_STALE_REFRESHING":se==="BUILD_READY"?"CONTENT_STALE_READY":se==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ge(ae,oe){const se={...ae};switch(oe.type){case"sync":oe.state==="CHECKING"&&(se.buildLog=[]),se.activeSyncState=oe.state,se.syncError=oe.syncError;break;case"contentLoading":se.contentLoading=!0,se.contentError=void 0;break;case"content":typeof oe.path=="string"&&(se.path=oe.path),se.contentLoading=!1,se.content=oe.content,se.contentError=oe.contentError;break;case"buildLog":se.buildLog=se.buildLog.concat(oe.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(se.activeSyncState)&&["contentLoading","content"].includes(oe.type)&&(se.activeSyncState="UP_TO_DATE",se.buildLog=[]),se}function de(ae,oe,se,q){var H,T;const[R,P]=(0,p.useReducer)(ge,{activeSyncState:"CHECKING",path:q,contentLoading:!0,buildLog:[]}),G=(0,z.h_)(f.Dl),{retry:je}=(0,u.Z)(async()=>{P({type:"contentLoading"});try{const _e=await G.getEntityDocs({kind:ae,namespace:oe,name:se},q);return P({type:"content",content:_e,path:q}),_e}catch(_e){P({type:"content",contentError:_e,path:q})}},[G,ae,oe,se,q]),Pe=(0,p.useRef)({content:void 0,reload:()=>{}});return Pe.current={content:R.content,reload:je},(0,g.default)(async()=>{P({type:"sync",state:"CHECKING"});const _e=setTimeout(()=>{P({type:"sync",state:"BUILDING"})},1e3);try{switch(await G.syncEntityDocs({kind:ae,namespace:oe,name:se},It=>{P({type:"buildLog",log:It})})){case"updated":Pe.current.content?P({type:"sync",state:"BUILD_READY"}):(Pe.current.reload(),P({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":P({type:"sync",state:"UP_TO_DATE"});break;default:P({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(at){P({type:"sync",state:"ERROR",syncError:at})}finally{clearTimeout(_e)}},[ae,se,oe,G,P,Pe]),{state:(0,p.useMemo)(()=>D({activeSyncState:R.activeSyncState,contentLoading:R.contentLoading,content:R.content}),[R.activeSyncState,R.content,R.contentLoading]),contentReload:je,path:R.path,content:R.content,contentErrorMessage:(H=R.contentError)===null||H===void 0?void 0:H.toString(),syncErrorMessage:(T=R.syncError)===null||T===void 0?void 0:T.toString(),buildLog:R.buildLog}}const V=(0,p.createContext)({}),te=()=>(0,p.useContext)(V),L=ae=>{const{children:oe}=ae,{"*":se=""}=(0,W.UO)(),{entityRef:q}=(0,f.x1)(),{kind:H,namespace:T,name:R}=q,P=de(H,T,R,se);return(0,r.jsx)(V.Provider,{value:P,children:oe instanceof Function?oe(P):oe})},A=ae=>oe=>(0,r.jsx)(L,{children:(0,r.jsx)(ae,{...oe})})},95573:function(St,ke,n){"use strict";n.d(ke,{Fw:function(){return W},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),W=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(St,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsSearchResultListItem:function(){return de}});var r=n(52322),p=n(2784),W=n(79692),f=n(49378),z=n(86136),g=n(90436),u=n(53974),D=n(15096);const ge=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),de=V=>{const{result:te,highlight:L,lineClamp:A=5,asListItem:ae=!0,asLink:oe=!0,title:se,icon:q}=V,H=ge(),T=({children:G})=>oe?(0,r.jsx)(u.rU,{noTrack:!0,to:te.location,children:G}):(0,r.jsx)(r.Fragment,{children:G}),R=()=>{const G=L!=null&&L.fields.title?(0,r.jsx)(D.FA,{text:L.fields.title,preTag:L.preTag,postTag:L.postTag}):te.title,je=L!=null&&L.fields.entityTitle?(0,r.jsx)(D.FA,{text:L.fields.entityTitle,preTag:L.preTag,postTag:L.postTag}):te.entityTitle,Pe=L!=null&&L.fields.name?(0,r.jsx)(D.FA,{text:L.fields.name,preTag:L.preTag,postTag:L.postTag}):te.name;return te?(0,r.jsx)(f.Z,{className:H.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(T,{children:se||(0,r.jsxs)(r.Fragment,{children:[G," | ",je!=null?je:Pe," docs"]})}),secondary:(0,r.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:L!=null&&L.fields.text?(0,r.jsx)(D.FA,{text:L.fields.text,preTag:L.preTag,postTag:L.postTag}):te.text})}):null},P=({children:G})=>ae?(0,r.jsxs)(r.Fragment,{children:[q&&(0,r.jsx)(z.Z,{children:typeof q=="function"?q(te):q}),(0,r.jsx)("div",{className:H.flexContainer,children:G})]}):(0,r.jsx)(r.Fragment,{children:G});return(0,r.jsx)(P,{children:(0,r.jsx)(R,{})})}},22478:function(St,ke,n){"use strict";n.d(ke,{S:function(){return D}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),z=n(55511);const g=ge=>ge==null?void 0:ge.document,u=ge=>{const{entityId:de,entityTitle:V,debounceTime:te=150}=ge,[L,A]=(0,W.useState)(!1),ae=(0,f.s0)(),{setFilters:oe,result:{loading:se,value:q}}=(0,p.Rx)(),[H,T]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Pe=!0;if(Pe&&q){const N=q.results.slice(0,10);T(N)}return()=>{Pe=!1}},[se,q]);const{kind:R,name:P,namespace:G}=de;(0,W.useEffect)(()=>{oe(Pe=>({...Pe,kind:R,namespace:G,name:P}))},[R,G,P,oe]);const je=(Pe,N)=>{if(g(N)){const{location:_e}=N.document;ae(_e)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:L,getOptionLabel:()=>"",filterOptions:Pe=>Pe,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:je,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:H,renderOption:({document:Pe,highlight:N})=>(0,r.jsx)(z.TechDocsSearchResultListItem,{result:Pe,lineClamp:3,asListItem:!1,asLink:!1,title:Pe.title,highlight:N}),loading:se,inputDebounceTime:te,inputPlaceholder:`Search ${V||de.name} docs`,freeSolo:!1})},D=ge=>{const de={term:"",types:["techdocs"],pageCursor:"",filters:ge.entityId};return(0,r.jsx)(p.Nd,{initialState:de,children:(0,r.jsx)(u,{...ge})})}},53260:function(){}},function(St){var ke=function(r){return St(St.s=r)};St.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return ke(30966)});var n=St.O()}]);})();
|
|
521
521
|
|
|
522
|
-
//# sourceMappingURL=main.
|
|
522
|
+
//# sourceMappingURL=main.39b6f8fc.js.map
|