@beforesemicolon/builder 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/build-browser.js +1 -0
- package/dist/cjs/build-modules.js +1 -0
- package/dist/cjs/docs/renderer/code.js +11 -0
- package/dist/cjs/docs/renderer/heading.js +1 -0
- package/dist/cjs/docs/renderer/index.js +1 -0
- package/dist/cjs/docs/renderer/link.js +1 -0
- package/dist/cjs/docs/run.js +1 -0
- package/dist/cjs/docs/templates/default.template.js +17 -0
- package/dist/cjs/docs/types.js +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/esm/build-browser.js +1 -0
- package/dist/esm/build-modules.js +1 -0
- package/dist/esm/docs/renderer/code.js +11 -0
- package/dist/esm/docs/renderer/heading.js +1 -0
- package/dist/esm/docs/renderer/index.js +1 -0
- package/dist/esm/docs/renderer/link.js +1 -0
- package/dist/esm/docs/run.js +1 -0
- package/dist/esm/docs/templates/default.template.js +17 -0
- package/dist/esm/docs/types.js +0 -0
- package/dist/esm/index.js +1 -0
- package/dist/{docs/templates/default.d.ts → types/docs/templates/default.template.d.ts} +1 -1
- package/dist/types/index.d.ts +3 -0
- package/package.json +3 -2
- package/dist/build-browser.js +0 -32
- package/dist/build-browser.js.map +0 -1
- package/dist/build-modules.js +0 -46
- package/dist/build-modules.js.map +0 -1
- package/dist/docs/renderer/code.js +0 -14
- package/dist/docs/renderer/code.js.map +0 -1
- package/dist/docs/renderer/heading.js +0 -10
- package/dist/docs/renderer/heading.js.map +0 -1
- package/dist/docs/renderer/index.js +0 -9
- package/dist/docs/renderer/index.js.map +0 -1
- package/dist/docs/renderer/link.js +0 -6
- package/dist/docs/renderer/link.js.map +0 -1
- package/dist/docs/run.js +0 -158
- package/dist/docs/run.js.map +0 -1
- package/dist/docs/templates/default.js +0 -18
- package/dist/docs/templates/default.js.map +0 -1
- package/dist/docs/types.js +0 -2
- package/dist/docs/types.js.map +0 -1
- /package/dist/{build-browser.d.ts → types/build-browser.d.ts} +0 -0
- /package/dist/{build-modules.d.ts → types/build-modules.d.ts} +0 -0
- /package/dist/{docs → types/docs}/renderer/code.d.ts +0 -0
- /package/dist/{docs → types/docs}/renderer/heading.d.ts +0 -0
- /package/dist/{docs → types/docs}/renderer/index.d.ts +0 -0
- /package/dist/{docs → types/docs}/renderer/link.d.ts +0 -0
- /package/dist/{docs → types/docs}/run.d.ts +0 -0
- /package/dist/{docs → types/docs}/types.d.ts +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var l=Object.create;var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var d=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of a(t))!f.call(e,o)&&o!==r&&s(e,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return e};var c=(e,t,r)=>(r=e!=null?l(u(e)):{},d(t||!e||!e.__esModule?s(r,"default",{value:e,enumerable:!0}):r,e));var i=c(require("path"),1),p=c(require("esbuild"),1);const y={name:"empty-parser-Doc-plugin",setup(e){e.onResolve({filter:/Doc$/},t=>{if(t.importer.includes("@beforesemicolon/html-parser"))return{path:t.path,namespace:"empty-Doc"}}),e.onLoad({filter:/.*/,namespace:"empty-Doc"},()=>({contents:""}))}};p.default.build({entryPoints:[i.default.resolve(process.cwd(),"src/client")],outfile:"dist/client",bundle:!0,keepNames:!0,sourcemap:!0,target:"esnext",minify:!0,plugins:[y]}).catch(console.error);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var y=Object.create;var o=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var n=(t,e)=>o(t,"name",{value:e,configurable:!0});var P=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of h(e))!x.call(t,r)&&r!==s&&o(t,r,{get:()=>e[r],enumerable:!(i=g(e,r))||i.enumerable});return t};var c=(t,e,s)=>(s=t!=null?y(j(t)):{},P(e||!t||!t.__esModule?o(s,"default",{value:t,enumerable:!0}):s,t));var l=c(require("esbuild"),1),m=c(require("path"),1),p=c(require("fs"),1),u=require("@gjsify/esbuild-plugin-transform-ext");function b(t){const e=[];function s(i){const r=p.default.readdirSync(i,{withFileTypes:!0});for(const f of r){const a=m.default.join(i,f.name);f.isDirectory()?s(a):e.push(a)}}return n(s,"readDirectory"),s(t),e}n(b,"readFilesRecursively");const E=m.default.join(process.cwd(),"src"),d=b(E).filter(t=>!t.endsWith(".spec.ts")&&!t.endsWith("/client.ts"));Promise.all([l.default.build({entryPoints:d,outdir:"dist/esm",target:"esnext",minify:!0,format:"esm",platform:"node",keepNames:!0,plugins:[(0,u.transformExtPlugin)({outExtension:{".ts":".js"}})]}),l.default.build({entryPoints:d,outdir:"dist/cjs",target:"esnext",minify:!0,format:"cjs",platform:"node",keepNames:!0,plugins:[(0,u.transformExtPlugin)({outExtension:{".ts":".js"}})]})]).catch(console.error);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var i=(e,o)=>c(e,"name",{value:o,configurable:!0});var r=(e,o)=>{for(var s in o)c(e,s,{get:o[s],enumerable:!0})},v=(e,o,s,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of l(o))!p.call(e,t)&&t!==s&&c(e,t,{get:()=>o[t],enumerable:!(d=a(o,t))||d.enumerable});return e};var u=e=>v(c({},"__esModule",{value:!0}),e);var b={};r(b,{default:()=>n});module.exports=u(b);function n({lang:e,text:o}){return`<div class="code-snippet">
|
2
|
+
${e?`<div class="label ${e.toLowerCase()}">${e}</div>`:""}
|
3
|
+
<div class="content">
|
4
|
+
<pre>
|
5
|
+
<code class="hljs language-javascript">${o}</code>
|
6
|
+
</pre>
|
7
|
+
</div>
|
8
|
+
<button type="button" class="code-copy-btn" style="visibility: hidden">
|
9
|
+
copy
|
10
|
+
</button>
|
11
|
+
</div>`}i(n,"code");
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var o=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var s=(r,e)=>o(r,"name",{value:e,configurable:!0});var d=(r,e)=>{for(var t in e)o(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of p(e))!$.call(r,n)&&n!==t&&o(r,n,{get:()=>e[n],enumerable:!(a=c(e,n))||a.enumerable});return r};var g=r=>f(o({},"__esModule",{value:!0}),r);var h={};d(h,{default:()=>i});module.exports=g(h);function i({tokens:r,depth:e}){const t=this.parser.parseInline(r),a=t.toLowerCase().replace(/[^\w]+/g," ").trim().replace(/\s/g,"-");return`<h${e} id="${a}"><a href="#${a}">${t}</a></h${e}>`}s(i,"heading");
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var c=Object.create;var t=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var s=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},d=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of j(e))!l.call(r,m)&&m!==o&&t(r,m,{get:()=>e[m],enumerable:!(i=b(e,m))||i.enumerable});return r};var n=(r,e,o)=>(o=r!=null?c(k(r)):{},d(e||!r||!r.__esModule?t(o,"default",{value:r,enumerable:!0}):o,r)),u=r=>d(t({},"__esModule",{value:!0}),r);var R={};s(R,{default:()=>O});module.exports=u(R);var f=n(require("./heading.js"),1),p=n(require("./code.js"),1),a=n(require("./link.js"),1),O={heading:f.default,code:p.default,link:a.default};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var a=(n,e)=>l(n,"name",{value:e,configurable:!0});var p=(n,e)=>{for(var t in e)l(n,t,{get:e[t],enumerable:!0})},c=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!k.call(n,r)&&r!==t&&l(n,r,{get:()=>e[r],enumerable:!(o=m(e,r))||o.enumerable});return n};var d=n=>c(l({},"__esModule",{value:!0}),n);var h={};p(h,{default:()=>i});module.exports=d(h);function i({href:n,text:e}){return`<a href="${n.replace(/\.md/,".html").replace(/index\.html/,"")}">${e}</a>`}a(i,"link");
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var L=Object.create;var w=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var P=(e,r)=>w(e,"name",{value:r,configurable:!0});var z=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of T(r))!$.call(e,a)&&a!==t&&w(e,a,{get:()=>r[a],enumerable:!(s=N(r,a))||s.enumerable});return e};var p=(e,r,t)=>(t=e!=null?L(_(e)):{},z(r||!e||!e.__esModule?w(t,"default",{value:e,enumerable:!0}):t,e));var k=require("marked"),i=require("fs/promises"),o=p(require("path"),1),x=p(require("front-matter"),1),C=p(require("isomorphic-dompurify"),1),F=require("marked-highlight"),v=p(require("highlight.js"),1),W=p(require("./templates/default.template.js"),1),A=p(require("./renderer/index.js"),1);const g=new Map;g.set("default",W.default);let y;const M=new k.Marked((0,F.markedHighlight)({langPrefix:"hljs language-",highlight(e,r){const t=v.default.getLanguage(r)?r:"plaintext";return v.default.highlight(e,{language:t}).value}}));M.use({renderer:A.default});const l=o.default.resolve(process.cwd(),"docs"),m=o.default.resolve(process.cwd(),"website"),B=o.default.resolve(process.cwd(),"docs/_layouts"),S=o.default.resolve(process.cwd(),"docs/assets"),O=o.default.resolve(process.cwd(),"docs/stylesheets"),j=o.default.resolve(process.cwd(),"docs/scripts"),b=P(async e=>{const r=await(0,i.readdir)(e),t=[];for(const s of r){const a=o.default.extname(s);/^[._]/.test(s)||(a?t.push(o.default.join(e,s)):/(stylesheets|assets|scripts)/.test(s)||t.push(...await b(o.default.join(e,s))))}return t},"traverseDirectory");M.use({hooks:{postprocess(e){const{layout:r="default",...t}=y.attributes;e=C.default.sanitize(e);const s=[...e.matchAll(/<h([0-6])\sid="[^"]+".*?>.*?<a\s+href="([^"]+)".*?>([^<]+)<\/a>/gm)].map(a=>({path:a[2],label:a[3],level:a[1]}));return g.get(r)?.({...t,content:e,siteMap:y.siteMap,tableOfContent:s})||e}}}),(async()=>{await(0,i.mkdir)(m,{recursive:!0});try{await(0,i.cp)(S,S.replace(l,m),{recursive:!0})}catch(t){console.warn(t)}try{await(0,i.cp)(O,O.replace(l,m),{recursive:!0})}catch(t){console.warn(t)}try{await(0,i.cp)(j,j.replace(l,m),{recursive:!0})}catch(t){console.warn(t)}try{const t=await b(B);for(const s of t)if(/\.(j|t)s$/.test(s)){const a=o.default.basename(s).replace(o.default.extname(s),""),c=await import(s);g.set(a,c.default)}}catch(t){console.error("Template import failed",t)}const e=await b(l),r=new Map;(await Promise.all(e.filter(t=>t.endsWith(".md")).map(async t=>{const s=await(0,i.readFile)(t,"utf-8");return{filePath:t,...(0,x.default)(s)}}))).sort((t,s)=>t.attributes.order-s.attributes.order).map(({attributes:t,body:s,filePath:a})=>{const c=a.replace(l,"").replace(/\.md/,".html"),u=a.replace(l,m).replace(".md",".html"),f=u.replace(o.default.basename(u),""),d=o.default.basename(c)||"/",E=c.replace(d,"").replace(/\/$/,"");let n=r;E.split("/").filter(Boolean).forEach(h=>{n.has(h)||n.set(h,new Map),n=n.get(h)});const D={...t,path:c};return n.has(d)||n.set(d,D),{attributes:D,fileWebsitePath:u,fileDirWebsitePath:f,body:s,siteMap:r}}).forEach(async({attributes:t,body:s,fileDirWebsitePath:a,fileWebsitePath:c,siteMap:u})=>{y={attributes:t,siteMap:u};const f=await M.parse(s);await(0,i.mkdir)(a,{recursive:!0}),await(0,i.writeFile)(c,f)})})();
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";var o=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var m=(e,t)=>o(e,"name",{value:t,configurable:!0});var r=(e,t)=>{for(var a in t)o(e,a,{get:t[a],enumerable:!0})},c=(e,t,a,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!h.call(e,i)&&i!==a&&o(e,i,{get:()=>t[i],enumerable:!(d=n(t,i))||d.enumerable});return e};var p=e=>c(o({},"__esModule",{value:!0}),e);var P={};r(P,{default:()=>s});module.exports=p(P);var s=m(({title:e,description:t,content:a})=>`
|
2
|
+
<!doctype html>
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8" />
|
6
|
+
<meta
|
7
|
+
name="viewport"
|
8
|
+
content="width=device-width, initial-scale=1.0"
|
9
|
+
/>
|
10
|
+
<meta name="description" content="${t}" />
|
11
|
+
<title>${e}</title>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
${a}
|
15
|
+
</body>
|
16
|
+
</html>
|
17
|
+
`,"default");
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var r=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var g=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of a(t))!o.call(e,n)&&n!==s&&r(e,n,{get:()=>t[n],enumerable:!(i=p(t,n))||i.enumerable});return e};var c=e=>g(r({},"__esModule",{value:!0}),e);var l={};module.exports=c(l);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,r,p,x)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of c(r))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>r[m],enumerable:!(x=b(r,m))||x.enumerable});return f},e=(f,r,p)=>(t(f,r,"default"),p&&t(p,r,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);e(o,require("./build-modules.js"),module.exports);e(o,require("./build-browser.js"),module.exports);e(o,require("./docs/run.js"),module.exports);0&&(module.exports={...require("./build-modules.js"),...require("./build-browser.js"),...require("./docs/run.js")});
|
@@ -0,0 +1 @@
|
|
1
|
+
import r from"path";import o from"esbuild";const n={name:"empty-parser-Doc-plugin",setup(e){e.onResolve({filter:/Doc$/},t=>{if(t.importer.includes("@beforesemicolon/html-parser"))return{path:t.path,namespace:"empty-Doc"}}),e.onLoad({filter:/.*/,namespace:"empty-Doc"},()=>({contents:""}))}};o.build({entryPoints:[r.resolve(process.cwd(),"src/client")],outfile:"dist/client",bundle:!0,keepNames:!0,sourcemap:!0,target:"esnext",minify:!0,plugins:[n]}).catch(console.error);
|
@@ -0,0 +1 @@
|
|
1
|
+
var a=Object.defineProperty;var s=(t,e)=>a(t,"name",{value:e,configurable:!0});import c from"esbuild";import l from"path";import d from"fs";import{transformExtPlugin as m}from"@gjsify/esbuild-plugin-transform-ext";function p(t){const e=[];function r(i){const f=d.readdirSync(i,{withFileTypes:!0});for(const o of f){const n=l.join(i,o.name);o.isDirectory()?r(n):e.push(n)}}return s(r,"readDirectory"),r(t),e}s(p,"readFilesRecursively");const y=l.join(process.cwd(),"src"),u=p(y).filter(t=>!t.endsWith(".spec.ts")&&!t.endsWith("/client.ts"));Promise.all([c.build({entryPoints:u,outdir:"dist/esm",target:"esnext",minify:!0,format:"esm",platform:"node",keepNames:!0,plugins:[m({outExtension:{".ts":".js"}})]}),c.build({entryPoints:u,outdir:"dist/cjs",target:"esnext",minify:!0,format:"cjs",platform:"node",keepNames:!0,plugins:[m({outExtension:{".ts":".js"}})]})]).catch(console.error);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
var s=Object.defineProperty;var t=(e,o)=>s(e,"name",{value:o,configurable:!0});function c({lang:e,text:o}){return`<div class="code-snippet">
|
2
|
+
${e?`<div class="label ${e.toLowerCase()}">${e}</div>`:""}
|
3
|
+
<div class="content">
|
4
|
+
<pre>
|
5
|
+
<code class="hljs language-javascript">${o}</code>
|
6
|
+
</pre>
|
7
|
+
</div>
|
8
|
+
<button type="button" class="code-copy-btn" style="visibility: hidden">
|
9
|
+
copy
|
10
|
+
</button>
|
11
|
+
</div>`}t(c,"code");export{c as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
var o=Object.defineProperty;var n=(r,e)=>o(r,"name",{value:e,configurable:!0});function s({tokens:r,depth:e}){const t=this.parser.parseInline(r),a=t.toLowerCase().replace(/[^\w]+/g," ").trim().replace(/\s/g,"-");return`<h${e} id="${a}"><a href="#${a}">${t}</a></h${e}>`}n(s,"heading");export{s as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import r from"./heading.js";import e from"./code.js";import o from"./link.js";var f={heading:r,code:e,link:o};export{f as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
var t=Object.defineProperty;var r=(e,n)=>t(e,"name",{value:n,configurable:!0});function l({href:e,text:n}){return`<a href="${e.replace(/\.md/,".html").replace(/index\.html/,"")}">${n}</a>`}r(l,"link");export{l as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
var k=Object.defineProperty;var b=(s,o)=>k(s,"name",{value:o,configurable:!0});import{Marked as x}from"marked";import{cp as d,mkdir as v,readdir as C,readFile as F,writeFile as W}from"fs/promises";import r from"path";import A from"front-matter";import E from"isomorphic-dompurify";import{markedHighlight as L}from"marked-highlight";import D from"highlight.js";import N from"./templates/default.template.js";import T from"./renderer/index.js";const h=new Map;h.set("default",N);let w;const g=new x(L({langPrefix:"hljs language-",highlight(s,o){const t=D.getLanguage(o)?o:"plaintext";return D.highlight(s,{language:t}).value}}));g.use({renderer:T});const n=r.resolve(process.cwd(),"docs"),l=r.resolve(process.cwd(),"website"),_=r.resolve(process.cwd(),"docs/_layouts"),P=r.resolve(process.cwd(),"docs/assets"),S=r.resolve(process.cwd(),"docs/stylesheets"),O=r.resolve(process.cwd(),"docs/scripts"),y=b(async s=>{const o=await C(s),t=[];for(const e of o){const a=r.extname(e);/^[._]/.test(e)||(a?t.push(r.join(s,e)):/(stylesheets|assets|scripts)/.test(e)||t.push(...await y(r.join(s,e))))}return t},"traverseDirectory");g.use({hooks:{postprocess(s){const{layout:o="default",...t}=w.attributes;s=E.sanitize(s);const e=[...s.matchAll(/<h([0-6])\sid="[^"]+".*?>.*?<a\s+href="([^"]+)".*?>([^<]+)<\/a>/gm)].map(a=>({path:a[2],label:a[3],level:a[1]}));return h.get(o)?.({...t,content:s,siteMap:w.siteMap,tableOfContent:e})||s}}}),(async()=>{await v(l,{recursive:!0});try{await d(P,P.replace(n,l),{recursive:!0})}catch(t){console.warn(t)}try{await d(S,S.replace(n,l),{recursive:!0})}catch(t){console.warn(t)}try{await d(O,O.replace(n,l),{recursive:!0})}catch(t){console.warn(t)}try{const t=await y(_);for(const e of t)if(/\.(j|t)s$/.test(e)){const a=r.basename(e).replace(r.extname(e),""),i=await import(e);h.set(a,i.default)}}catch(t){console.error("Template import failed",t)}const s=await y(n),o=new Map;(await Promise.all(s.filter(t=>t.endsWith(".md")).map(async t=>{const e=await F(t,"utf-8");return{filePath:t,...A(e)}}))).sort((t,e)=>t.attributes.order-e.attributes.order).map(({attributes:t,body:e,filePath:a})=>{const i=a.replace(n,"").replace(/\.md/,".html"),p=a.replace(n,l).replace(".md",".html"),u=p.replace(r.basename(p),""),m=r.basename(i)||"/",j=i.replace(m,"").replace(/\/$/,"");let c=o;j.split("/").filter(Boolean).forEach(f=>{c.has(f)||c.set(f,new Map),c=c.get(f)});const M={...t,path:i};return c.has(m)||c.set(m,M),{attributes:M,fileWebsitePath:p,fileDirWebsitePath:u,body:e,siteMap:o}}).forEach(async({attributes:t,body:e,fileDirWebsitePath:a,fileWebsitePath:i,siteMap:p})=>{w={attributes:t,siteMap:p};const u=await g.parse(e);await v(a,{recursive:!0}),await W(i,u)})})();
|
@@ -0,0 +1,17 @@
|
|
1
|
+
var o=Object.defineProperty;var a=(t,e)=>o(t,"name",{value:e,configurable:!0});var l=a(({title:t,description:e,content:i})=>`
|
2
|
+
<!doctype html>
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8" />
|
6
|
+
<meta
|
7
|
+
name="viewport"
|
8
|
+
content="width=device-width, initial-scale=1.0"
|
9
|
+
/>
|
10
|
+
<meta name="description" content="${e}" />
|
11
|
+
<title>${t}</title>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
${i}
|
15
|
+
</body>
|
16
|
+
</html>
|
17
|
+
`,"default");export{l as default};
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
export*from"./build-modules.js";export*from"./build-browser.js";export*from"./docs/run.js";
|
package/package.json
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "@beforesemicolon/builder",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.2",
|
4
4
|
"description": "Utilities to build npm packages and documentation website",
|
5
5
|
"engines": {
|
6
6
|
"node": ">=18.16.0"
|
7
7
|
},
|
8
8
|
"type": "module",
|
9
|
+
"types": "./dist/types/index.d.ts",
|
9
10
|
"scripts": {
|
10
|
-
"build": "rm -rf dist &&
|
11
|
+
"build": "rm -rf dist && tsc --emitDeclarationOnly && tsx src/build-modules.ts",
|
11
12
|
"lint": "eslint ./src && prettier --check .",
|
12
13
|
"format": "eslint ./src --fix && prettier --write ."
|
13
14
|
},
|
package/dist/build-browser.js
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
import esbuild from 'esbuild';
|
2
|
-
const emptyParserDoc = {
|
3
|
-
name: 'empty-parser-Doc-plugin',
|
4
|
-
setup(build) {
|
5
|
-
build.onResolve({ filter: /Doc$/ }, (args) => {
|
6
|
-
if (args.importer.includes('@beforesemicolon/html-parser')) {
|
7
|
-
return {
|
8
|
-
path: args.path,
|
9
|
-
namespace: 'empty-Doc',
|
10
|
-
};
|
11
|
-
}
|
12
|
-
});
|
13
|
-
build.onLoad({ filter: /.*/, namespace: 'empty-Doc' }, () => {
|
14
|
-
return {
|
15
|
-
contents: '',
|
16
|
-
};
|
17
|
-
});
|
18
|
-
},
|
19
|
-
};
|
20
|
-
esbuild
|
21
|
-
.build({
|
22
|
-
entryPoints: ['src/client.ts'],
|
23
|
-
outfile: 'dist/client.js',
|
24
|
-
bundle: true,
|
25
|
-
keepNames: true,
|
26
|
-
sourcemap: true,
|
27
|
-
target: 'esnext',
|
28
|
-
minify: true,
|
29
|
-
plugins: [emptyParserDoc],
|
30
|
-
})
|
31
|
-
.catch(console.error);
|
32
|
-
//# sourceMappingURL=build-browser.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"build-browser.js","sourceRoot":"","sources":["../src/build-browser.ts"],"names":[],"mappings":"AAAA,OAAO,OAAmB,MAAM,SAAS,CAAA;AAIzC,MAAM,cAAc,GAAG;IACnB,IAAI,EAAE,yBAAyB;IAC/B,KAAK,CAAC,KAAK;QACP,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACzC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,8BAA8B,CAAC,EAAE,CAAC;gBACzD,OAAO;oBACH,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,SAAS,EAAE,WAAW;iBACzB,CAAA;YACL,CAAC;QACL,CAAC,CAAC,CAAA;QACF,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE;YACxD,OAAO;gBACH,QAAQ,EAAE,EAAE;aACf,CAAA;QACL,CAAC,CAAC,CAAA;IACN,CAAC;CACM,CAAA;AAEX,OAAO;KACF,KAAK,CAAC;IACH,WAAW,EAAE,CAAC,eAAe,CAAC;IAC9B,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,CAAC,cAAc,CAAC;CAC5B,CAAC;KACD,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA"}
|
package/dist/build-modules.js
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
import esbuild from 'esbuild';
|
2
|
-
import path from 'path';
|
3
|
-
import fs from 'fs';
|
4
|
-
import { transformExtPlugin } from '@gjsify/esbuild-plugin-transform-ext';
|
5
|
-
function readFilesRecursively(directoryPath) {
|
6
|
-
const files = [];
|
7
|
-
function readDirectory(currentPath) {
|
8
|
-
const entries = fs.readdirSync(currentPath, { withFileTypes: true });
|
9
|
-
for (const entry of entries) {
|
10
|
-
const fullPath = path.join(currentPath, entry.name);
|
11
|
-
if (entry.isDirectory()) {
|
12
|
-
readDirectory(fullPath);
|
13
|
-
}
|
14
|
-
else {
|
15
|
-
files.push(fullPath);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
}
|
19
|
-
readDirectory(directoryPath);
|
20
|
-
return files;
|
21
|
-
}
|
22
|
-
const directoryPath = path.join(process.cwd(), 'src');
|
23
|
-
const allFiles = readFilesRecursively(directoryPath).filter((file) => !file.endsWith('.spec.ts') && !file.endsWith('/client.ts'));
|
24
|
-
Promise.all([
|
25
|
-
esbuild.build({
|
26
|
-
entryPoints: allFiles,
|
27
|
-
outdir: 'dist/esm',
|
28
|
-
target: 'esnext',
|
29
|
-
minify: true,
|
30
|
-
format: 'esm',
|
31
|
-
platform: 'node',
|
32
|
-
keepNames: true,
|
33
|
-
plugins: [transformExtPlugin({ outExtension: { '.ts': '.js' } })],
|
34
|
-
}),
|
35
|
-
esbuild.build({
|
36
|
-
entryPoints: allFiles,
|
37
|
-
outdir: 'dist/cjs',
|
38
|
-
target: 'esnext',
|
39
|
-
minify: true,
|
40
|
-
format: 'cjs',
|
41
|
-
platform: 'node',
|
42
|
-
keepNames: true,
|
43
|
-
plugins: [transformExtPlugin({ outExtension: { '.ts': '.js' } })],
|
44
|
-
}),
|
45
|
-
]).catch(console.error);
|
46
|
-
//# sourceMappingURL=build-modules.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"build-modules.js","sourceRoot":"","sources":["../src/build-modules.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AAEzE,SAAS,oBAAoB,CAAC,aAAqB;IAC/C,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,SAAS,aAAa,CAAC,WAAmB;QACtC,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;QAEpE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;YAEnD,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACtB,aAAa,CAAC,QAAQ,CAAC,CAAA;YAC3B,CAAC;iBAAM,CAAC;gBACJ,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YACxB,CAAC;QACL,CAAC;IACL,CAAC;IAED,aAAa,CAAC,aAAa,CAAC,CAAA;IAC5B,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAA;AACrD,MAAM,QAAQ,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAAC,MAAM,CACvD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CACvE,CAAA;AAED,OAAO,CAAC,GAAG,CAAC;IACR,OAAO,CAAC,KAAK,CAAC;QACV,WAAW,EAAE,QAAQ;QACrB,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;KACpE,CAAC;IACF,OAAO,CAAC,KAAK,CAAC;QACV,WAAW,EAAE,QAAQ;QACrB,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;KACpE,CAAC;CACL,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA"}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
export default function code({ lang, text }) {
|
2
|
-
return `<div class="code-snippet">
|
3
|
-
${lang ? `<div class="label ${lang.toLowerCase()}">${lang}</div>` : ''}
|
4
|
-
<div class="content">
|
5
|
-
<pre>
|
6
|
-
<code class="hljs language-javascript">${text}</code>
|
7
|
-
</pre>
|
8
|
-
</div>
|
9
|
-
<button type="button" class="code-copy-btn" style="visibility: hidden">
|
10
|
-
copy
|
11
|
-
</button>
|
12
|
-
</div>`;
|
13
|
-
}
|
14
|
-
//# sourceMappingURL=code.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../src/docs/renderer/code.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAe;IACpD,OAAO;UACD,IAAI,CAAC,CAAC,CAAC,qBAAqB,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;;;yDAGrB,IAAI;;;;;;WAMlD,CAAA;AACX,CAAC"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
export default function heading({ tokens, depth }) {
|
2
|
-
const text = this.parser.parseInline(tokens);
|
3
|
-
const escapedText = text
|
4
|
-
.toLowerCase()
|
5
|
-
.replace(/[^\w]+/g, ' ')
|
6
|
-
.trim()
|
7
|
-
.replace(/\s/g, '-');
|
8
|
-
return `<h${depth} id="${escapedText}"><a href="#${escapedText}">${text}</a></h${depth}>`;
|
9
|
-
}
|
10
|
-
//# sourceMappingURL=heading.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../src/docs/renderer/heading.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAkB;IAE7D,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,WAAW,GAAG,IAAI;SACnB,WAAW,EAAE;SACb,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,IAAI,EAAE;SACN,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAExB,OAAO,KAAK,KAAK,QAAQ,WAAW,eAAe,WAAW,KAAK,IAAI,UAAU,KAAK,GAAG,CAAA;AAC7F,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/docs/renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,IAAI,MAAM,WAAW,CAAA;AAG5B,eAAe;IACX,OAAO;IACP,IAAI;IACJ,IAAI;CACsB,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/docs/renderer/link.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAe;IACpD,OAAO,YAAY,IAAI;SAClB,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC;SACxB,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,KAAK,IAAI,MAAM,CAAA;AAClD,CAAC"}
|
package/dist/docs/run.js
DELETED
@@ -1,158 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
11
|
-
var t = {};
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
13
|
-
t[p] = s[p];
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
17
|
-
t[p[i]] = s[p[i]];
|
18
|
-
}
|
19
|
-
return t;
|
20
|
-
};
|
21
|
-
import { Marked } from 'marked';
|
22
|
-
import { cp, mkdir, readdir, readFile, writeFile } from 'fs/promises';
|
23
|
-
import path from 'path';
|
24
|
-
import fm from 'front-matter';
|
25
|
-
import DOMPurify from 'isomorphic-dompurify';
|
26
|
-
import { markedHighlight } from 'marked-highlight';
|
27
|
-
import hljs from 'highlight.js';
|
28
|
-
import defaultTemp from './templates/default.js';
|
29
|
-
import renderer from './renderer/index.js';
|
30
|
-
const layouts = new Map();
|
31
|
-
layouts.set('default', defaultTemp);
|
32
|
-
let currentFileMeta;
|
33
|
-
const marked = new Marked(markedHighlight({
|
34
|
-
langPrefix: 'hljs language-',
|
35
|
-
highlight(code, lang) {
|
36
|
-
const language = hljs.getLanguage(lang) ? lang : 'plaintext';
|
37
|
-
return hljs.highlight(code, { language }).value;
|
38
|
-
},
|
39
|
-
}));
|
40
|
-
marked.use({ renderer });
|
41
|
-
const docsDir = path.resolve(process.cwd(), 'docs');
|
42
|
-
const docsSiteDir = path.resolve(process.cwd(), 'website');
|
43
|
-
const docsLayoutsDir = path.resolve(process.cwd(), 'docs/_layouts');
|
44
|
-
const docsAssetsDir = path.resolve(process.cwd(), 'docs/assets');
|
45
|
-
const docsStylesheetsDir = path.resolve(process.cwd(), 'docs/stylesheets');
|
46
|
-
const docsScriptsDir = path.resolve(process.cwd(), 'docs/scripts');
|
47
|
-
const traverseDirectory = (dir) => __awaiter(void 0, void 0, void 0, function* () {
|
48
|
-
const items = yield readdir(dir);
|
49
|
-
const files = [];
|
50
|
-
for (const item of items) {
|
51
|
-
const ext = path.extname(item);
|
52
|
-
if (/^[._]/.test(item))
|
53
|
-
continue;
|
54
|
-
if (ext) {
|
55
|
-
files.push(path.join(dir, item));
|
56
|
-
}
|
57
|
-
else if (!/(stylesheets|assets|scripts)/.test(item)) {
|
58
|
-
files.push(...(yield traverseDirectory(path.join(dir, item))));
|
59
|
-
}
|
60
|
-
}
|
61
|
-
return files;
|
62
|
-
});
|
63
|
-
marked.use({
|
64
|
-
hooks: {
|
65
|
-
postprocess(html) {
|
66
|
-
var _a;
|
67
|
-
const _b = currentFileMeta.attributes, { layout = 'default' } = _b, options = __rest(_b, ["layout"]);
|
68
|
-
html = DOMPurify.sanitize(html);
|
69
|
-
const tableOfContent = [
|
70
|
-
...html.matchAll(/<h([0-6])\sid="[^"]+".*?>.*?<a\s+href="([^"]+)".*?>([^<]+)<\/a>/gm),
|
71
|
-
].map((m) => ({ path: m[2], label: m[3], level: m[1] }));
|
72
|
-
return (((_a = layouts.get(layout)) === null || _a === void 0 ? void 0 : _a(Object.assign(Object.assign({}, options), { content: html, siteMap: currentFileMeta.siteMap, tableOfContent }))) || html);
|
73
|
-
},
|
74
|
-
},
|
75
|
-
});
|
76
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
77
|
-
yield mkdir(docsSiteDir, { recursive: true });
|
78
|
-
try {
|
79
|
-
yield cp(docsAssetsDir, docsAssetsDir.replace(docsDir, docsSiteDir), {
|
80
|
-
recursive: true,
|
81
|
-
});
|
82
|
-
}
|
83
|
-
catch (e) {
|
84
|
-
}
|
85
|
-
try {
|
86
|
-
yield cp(docsStylesheetsDir, docsStylesheetsDir.replace(docsDir, docsSiteDir), { recursive: true });
|
87
|
-
}
|
88
|
-
catch (e) {
|
89
|
-
}
|
90
|
-
try {
|
91
|
-
yield cp(docsScriptsDir, docsScriptsDir.replace(docsDir, docsSiteDir), {
|
92
|
-
recursive: true,
|
93
|
-
});
|
94
|
-
}
|
95
|
-
catch (e) {
|
96
|
-
}
|
97
|
-
try {
|
98
|
-
const layoutPaths = yield traverseDirectory(docsLayoutsDir);
|
99
|
-
for (const layoutPath of layoutPaths) {
|
100
|
-
if (/\.(j|t)s$/.test(layoutPath)) {
|
101
|
-
const fileName = path
|
102
|
-
.basename(layoutPath)
|
103
|
-
.replace(path.extname(layoutPath), '');
|
104
|
-
const handler = yield import(layoutPath);
|
105
|
-
layouts.set(fileName, handler.default);
|
106
|
-
}
|
107
|
-
}
|
108
|
-
}
|
109
|
-
catch (e) {
|
110
|
-
}
|
111
|
-
const filePaths = yield traverseDirectory(docsDir);
|
112
|
-
const siteMap = new Map();
|
113
|
-
(yield Promise.all(filePaths
|
114
|
-
.filter((filePath) => filePath.endsWith('.md'))
|
115
|
-
.map((filePath) => __awaiter(void 0, void 0, void 0, function* () {
|
116
|
-
const content = yield readFile(filePath, 'utf-8');
|
117
|
-
return Object.assign({ filePath }, fm(content));
|
118
|
-
}))))
|
119
|
-
.sort((a, b) => a.attributes.order - b.attributes.order)
|
120
|
-
.map(({ attributes, body, filePath }) => {
|
121
|
-
const pathname = filePath
|
122
|
-
.replace(docsDir, '')
|
123
|
-
.replace(/\.md/, '.html');
|
124
|
-
const fileWebsitePath = filePath
|
125
|
-
.replace(docsDir, docsSiteDir)
|
126
|
-
.replace('.md', '.html');
|
127
|
-
const fileDirWebsitePath = fileWebsitePath.replace(path.basename(fileWebsitePath), '');
|
128
|
-
const fileName = path.basename(pathname) || '/';
|
129
|
-
const dir = pathname.replace(fileName, '').replace(/\/$/, '');
|
130
|
-
let currentDir = siteMap;
|
131
|
-
dir.split('/')
|
132
|
-
.filter(Boolean)
|
133
|
-
.forEach((d) => {
|
134
|
-
if (!currentDir.has(d)) {
|
135
|
-
currentDir.set(d, new Map());
|
136
|
-
}
|
137
|
-
currentDir = currentDir.get(d);
|
138
|
-
});
|
139
|
-
const attrs = Object.assign(Object.assign({}, attributes), { path: pathname });
|
140
|
-
if (!currentDir.has(fileName)) {
|
141
|
-
currentDir.set(fileName, attrs);
|
142
|
-
}
|
143
|
-
return {
|
144
|
-
attributes: attrs,
|
145
|
-
fileWebsitePath,
|
146
|
-
fileDirWebsitePath,
|
147
|
-
body,
|
148
|
-
siteMap,
|
149
|
-
};
|
150
|
-
})
|
151
|
-
.forEach((_a) => __awaiter(void 0, [_a], void 0, function* ({ attributes, body, fileDirWebsitePath, fileWebsitePath, siteMap, }) {
|
152
|
-
currentFileMeta = { attributes, siteMap };
|
153
|
-
const contentMd = yield marked.parse(body);
|
154
|
-
yield mkdir(fileDirWebsitePath, { recursive: true });
|
155
|
-
yield writeFile(fileWebsitePath, contentMd);
|
156
|
-
}));
|
157
|
-
}))();
|
158
|
-
//# sourceMappingURL=run.js.map
|
package/dist/docs/run.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/docs/run.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7B,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,WAAW,MAAM,wBAAwB,CAAA;AAEhD,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAE1C,MAAM,OAAO,GAA8C,IAAI,GAAG,EAAE,CAAA;AAEpE,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;AAEnC,IAAI,eAGH,CAAA;AAED,MAAM,MAAM,GAAG,IAAI,MAAM,CACrB,eAAe,CAAC;IACZ,UAAU,EAAE,gBAAgB;IAC5B,SAAS,CAAC,IAAI,EAAE,IAAI;QAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAA;QAC5D,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAA;I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A;YAChC,CAAC;YAED,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAY,CAAA;QAC7C,CAAC,CAAC,CAAA;QAEN,MAAM,KAAK,GAAG,gCACP,UAAU,KACb,IAAI,EAAE,QAAQ,GACA,CAAA;QAElB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;QACnC,CAAC;QAED,OAAO;YACH,UAAU,EAAE,KAAK;YACjB,eAAe;YACf,kBAAkB;YAClB,IAAI;YACJ,OAAO;SACV,CAAA;IACL,CAAC,CAAC;SACD,OAAO,CACJ,KAMG,EAAE,4CANE,EACH,UAAU,EACV,IAAI,EACJ,kBAAkB,EAClB,eAAe,EACf,OAAO,GACV;QACG,eAAe,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAA;QACzC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC1C,MAAM,KAAK,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACpD,MAAM,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,CAAA;IAC/C,CAAC,CAAA,CACJ,CAAA;AACT,CAAC,CAAA,CAAC,EAAE,CAAA"}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
export default ({ title, description, content }) => `
|
2
|
-
<!doctype html>
|
3
|
-
<html lang="en">
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8" />
|
6
|
-
<meta
|
7
|
-
name="viewport"
|
8
|
-
content="width=device-width, initial-scale=1.0"
|
9
|
-
/>
|
10
|
-
<meta name="description" content="${description}" />
|
11
|
-
<title>${title}</title>
|
12
|
-
</head>
|
13
|
-
<body>
|
14
|
-
${content}
|
15
|
-
</body>
|
16
|
-
</html>
|
17
|
-
`;
|
18
|
-
//# sourceMappingURL=default.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/docs/templates/default.ts"],"names":[],"mappings":"AAEA,eAAe,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAa,EAAE,EAAE,CAAC;;;;;;;;;4CASnB,WAAW;iBACtC,KAAK;;;UAGZ,OAAO;;;CAGhB,CAAA"}
|
package/dist/docs/types.js
DELETED
package/dist/docs/types.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/docs/types.ts"],"names":[],"mappings":""}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|