@jchat/create-addon 1.0.0-alpha.3 → 1.0.0-alpha.31
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 +193 -0
- package/LICENSE +18 -196
- package/README.md +192 -21
- package/dist/cli.d.mts +12 -5
- package/dist/cli.mjs +71 -31
- package/dist/contracts2.d.mts +45 -0
- package/dist/generator.d.mts +38 -0
- package/dist/generator.mjs +538 -244
- package/dist/index.d.mts +3 -12
- package/dist/index.mjs +1 -2
- package/package.json +29 -23
- package/src/cli.test.ts +0 -30
- package/src/cli.ts +0 -55
- package/src/generator.ts +0 -428
- package/src/index.ts +0 -5
package/dist/cli.mjs
CHANGED
|
@@ -1,32 +1,72 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
import{n as e}from"./contracts2.d.mts";import{a as t,i as n,r}from"./generator.mjs";import*as i from"node:fs";import*as a from"node:path";import{styleText as o}from"node:util";import s,{stdin as c,stdout as l}from"node:process";import*as u from"node:readline";import d from"node:readline";import{ReadStream as f}from"node:tty";var p=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);const m=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),h=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,g=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,_=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,v=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,y=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,b=/\t{1,1000}/y,x=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,S=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,ee=/\p{M}+/gu,te={limit:1/0,ellipsis:``},C=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?C(i,te,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[S,l],[_,0],[v,o],[b,s],[x,c],[y,u]],f=0,p=0,w=e.length,T=0,E=!1,D=w,O=Math.max(0,r-a),k=0,A=0,j=0,M=0;outer:for(;;){if(A>k||p>=w&&p>f){let t=e.slice(k,A)||e.slice(f,p);T=0;for(let e of t.replaceAll(ee,``)){let t=e.codePointAt(0)||0;if(M=h(t)?2:g(t)?u:l,j+M>O&&(D=Math.min(D,Math.max(k,f)+T)),j+M>r){E=!0;break outer}T+=e.length,j+=M}k=A=0}if(p>=w)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(T=n===y?m(e.slice(p,n.lastIndex)):n===x?1:n.lastIndex-p,M=T*i,j+M>O&&(D=Math.min(D,p+Math.floor((O-j)/i))),j+M>r){E=!0;break outer}j+=M,k=f,A=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:E?O:j,index:E?D:w,truncated:E,ellipsed:E&&r>=a}},w={limit:1/0,ellipsis:``,ellipsisWidth:0},T=(e,t={})=>C(e,w,t).width,E=`]8;;`,D=RegExp(`(?:\\[(?<code>\\d+)m|\\${E}(?<uri>.*))`,`y`),O=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},k=e=>`[${e}m`,A=e=>`${E}${e}`,j=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:T(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=T(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(E,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},M=e=>{let t=e.split(` `),n=t.length;for(;n&&!T(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},ne=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=T(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=T(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),j(s,r,t),c=T(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){j(s,r,t),c=T(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){j(s,r,t),c=T(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>M(e)));let l=s.join(`
|
|
3
|
+
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){D.lastIndex=e+1;let t=D.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
4
|
+
`){a&&(r+=A(``));let e=i?O(i):void 0;i&&e&&(r+=k(e))}else t===`
|
|
5
|
+
`&&(i&&O(i)&&(r+=k(i)),a&&(r+=A(a)))}return r},re=/\r?\n/;function N(e,t,n){return String(e).normalize().split(re).map(e=>ne(e,t,n)).join(`
|
|
6
|
+
`)}var P=p(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}}))();function F(e,t,n){if(!n.some(e=>!e.disabled))return e;let r=e+t,i=Math.max(n.length-1,0),a=r<0?i:r>i?0:r;return n[a]?.disabled?F(a,t<0?-1:1,n):a}const I={actions:new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]]),messages:{cancel:`Canceled`,error:`Something went wrong`},withGuide:!0,accessible:void 0,date:{monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],messages:{required:`Please enter a valid date`,invalidMonth:`There are only 12 months in a year`,invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function ie(e){if(e!==void 0)return e;if(I.accessible!==void 0)return I.accessible;let t=process.env.ACCESSIBLE;return t!==void 0&&t!==``&&t!==`0`&&t!==`false`}function L(e,t){if(typeof e==`string`)return I.aliases.get(e)===t;for(let n of e)if(n!==void 0&&L(n,t))return!0;return!1}function ae(e,t){if(e===t)return;let n=e.split(`
|
|
7
|
+
`),r=t.split(`
|
|
8
|
+
`),i=Math.max(n.length,r.length),a=[];for(let e=0;e<i;e++)n[e]!==r[e]&&a.push(e);return{lines:a,numLinesBefore:n.length,numLinesAfter:r.length,numLines:i}}const oe=globalThis.process.platform.startsWith(`win`),R=Symbol(`clack:cancel`);function z(e){return e===R}function B(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function se({input:e=c,output:t=l,overwrite:n=!0,hideCursor:r=!0}={}){let i=u.createInterface({input:e,output:t,prompt:``,tabSize:1});u.emitKeypressEvents(e,i),e instanceof f&&e.isTTY&&e.setRawMode(!0);let a=(i,{name:o,sequence:s})=>{if(L([String(i),o,s],`cancel`)){r&&t.write(P.cursor.show),process.exit(0);return}if(!n)return;let c=o===`return`?0:-1,l=o===`return`?-1:0;u.moveCursor(t,c,l,()=>{u.clearLine(t,1,()=>{e.once(`keypress`,a)})})};return r&&t.write(P.cursor.hide),e.once(`keypress`,a),()=>{e.off(`keypress`,a),r&&t.write(P.cursor.show),e instanceof f&&e.isTTY&&!oe&&e.setRawMode(!1),i.terminal=!1,i.close()}}const V=e=>`columns`in e&&typeof e.columns==`number`?e.columns:80,ce=e=>`rows`in e&&typeof e.rows==`number`?e.rows:20;function H(e,t,n,r=n,i=n,a){return N(t,V(e??l)-n.length,{hard:!0,trim:!1}).split(`
|
|
9
|
+
`).map((e,t,o)=>{let s=a?a(e,t):e;return t===0?`${r}${s}`:t===o.length-1?`${i}${s}`:`${n}${s}`}).join(`
|
|
10
|
+
`)}function le(e,t){if(`~standard`in e){let n=e[`~standard`].validate(t);return n instanceof Promise?n.then(e=>e.issues?.at(0)?.message):n.issues?.at(0)?.message}return e(t)}var U=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame=``;_subscribers=new Map;_cursor=0;state=`initial`;error=``;value;userInput=``;get accessible(){return ie(this.opts.accessible)}constructor(e,t=!0){let{input:n=c,output:r=l,render:i,signal:a,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=a,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(R);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}this.rl=d.createInterface({input:this.input,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on(`keypress`,this.onKeypress),B(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(P.cursor.show),this.output.off(`resize`,this.render),B(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(P.cursor.show),this.output.off(`resize`,this.render),B(this.input,!1),e(R)})})}_isActionKey(e,t){return e===` `}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit(`value`,this.value)}_setUserInput(e,t){this.userInput=e??``,this.emit(`userInput`,this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:`u`}),this._setUserInput(``)}async onKeypress(e,t){if(this.state!==`validating`){if(this._track&&t.name!==`return`&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:`h`}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&I.aliases.has(t.name)&&this.emit(`cursor`,I.aliases.get(t.name)),I.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),this.emit(`key`,e,t),t?.name===`return`&&this._shouldSubmit(e,t)){if(this.opts.validate){let e=le(this.opts.validate,this.value),t;e instanceof Promise?(this.state=`validating`,this.render(),t=await e):t=e,t&&(this.error=t instanceof Error?t.message:t,this.state=`error`,this.rl?.write(this.userInput))}this.state!==`error`&&(this.state=`submit`)}L([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
|
|
11
|
+
`),B(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=N(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
12
|
+
`).length-1;this.output.write(P.cursor.move(-999,e*-1))}render(){let e=N(this._render(this)??``,process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(P.cursor.hide);else{let t=ae(this._prevFrame,e),n=ce(this.output);if(this.restoreCursor(),t){let r=Math.max(0,t.numLinesAfter-n),i=Math.max(0,t.numLinesBefore-n),a=t.lines.find(e=>e>=r);if(a===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(P.cursor.move(0,a-i)),this.output.write(P.erase.lines(1));let t=e.split(`
|
|
13
|
+
`);this.output.write(t[a]),this._prevFrame=e,this.output.write(P.cursor.move(0,t.length-a-1));return}if(t.lines.length>1){if(r<i)a=r;else{let e=a-i;e>0&&this.output.write(P.cursor.move(0,e))}this.output.write(P.erase.down());let t=e.split(`
|
|
14
|
+
`).slice(a);this.output.write(t.join(`
|
|
15
|
+
`)),this._prevFrame=e;return}}this.output.write(P.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},ue=class extends U{options;cursor=0;get _value(){return this.options[this.cursor]?.value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,t=this.value!==void 0&&this.value.length===e.length;this.value=t?[]:e.map(e=>e.value)}toggleInvert(){let e=this.value;if(!e)return;let t=this._enabledOptions.filter(t=>!e.includes(t.value));this.value=t.map(e=>e.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(e=>e!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0);this.cursor=this.options[t]?.disabled?F(t,1,this.options):t,this.on(`key`,(e,t)=>{t.name===`a`&&this.toggleAll(),t.name===`i`&&this.toggleInvert()}),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=F(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=F(this.cursor,1,this.options);break;case`space`:this.toggleValue()}})}};let de=class extends U{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){let e=this._selectedValue;this.value=e===void 0?void 0:e.value}constructor(e){super(e,!1),this.options=e.options;let t=this.options.findIndex(({value:t})=>t===e.initialValue),n=t===-1?0:t;this.cursor=this.options[n]?.disabled?F(n,1,this.options):n,this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=F(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=F(this.cursor,1,this.options)}this.changeValue()})}};var fe=class extends U{get userInputWithCursor(){if(this.state===`submit`)return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let t=e.slice(0,this.cursor),n=e.slice(this.cursor,this.cursor+1),r=e.slice(this.cursor+1);return`${t}${o(`inverse`,n)}${r}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on(`userInput`,e=>{this._setValue(e)}),this.on(`finalize`,()=>{this.value||=e.defaultValue,this.value===void 0&&(this.value=``)})}};function pe(){return s.platform===`win32`?!!s.env.CI||!!s.env.WT_SESSION||!!s.env.TERMINUS_SUBLIME||s.env.ConEmuTask===`{cmd::Cmder}`||s.env.TERM_PROGRAM===`Terminus-Sublime`||s.env.TERM_PROGRAM===`vscode`||s.env.TERM===`xterm-256color`||s.env.TERM===`alacritty`||s.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:s.env.TERM!==`linux`}const W=pe(),me=()=>process.env.CI===`true`,G=(e,t)=>W?e:t,he=G(`◆`,`*`),ge=G(`■`,`x`),_e=G(`▲`,`x`),ve=G(`◇`,`o`),ye=G(`┌`,`T`),K=G(`│`,`|`),q=G(`└`,`—`),be=G(`●`,`>`),xe=G(`○`,` `),Se=G(`◻`,`[•]`),Ce=G(`◼`,`[+]`),we=G(`◻`,`[ ]`),J=e=>{switch(e){case`initial`:case`active`:return o(`cyan`,he);case`cancel`:return o(`red`,ge);case`error`:return o(`yellow`,_e);case`submit`:return o(`green`,ve);case`validating`:return o(`dim`,he)}},Te=e=>{switch(e){case`initial`:case`active`:return o(`cyan`,K);case`cancel`:return o(`red`,K);case`error`:return o(`yellow`,K);case`submit`:return o(`green`,K)}};function Ee(e,t){let n=[`${t?`${o(`cyan`,K)} `:``}${e.join(` • `)}`];return t&&n.push(o(`cyan`,q)),n}const De=(e,t,n,r,i,a=!1)=>{let o=t,s=0;if(a)for(let t=r-1;t>=n;t--){let n=e[t];if(n&&(o-=n.length),s++,o<=i)break}else for(let t=n;t<r;t++){let n=e[t];if(n&&(o-=n.length),s++,o<=i)break}return{lineCount:o,removals:s}},Y=({cursor:e,options:t,style:n,output:r=process.stdout,maxItems:i=1/0,columnPadding:a=0,rowPadding:s=4})=>{let c=V(r)-a,l=ce(r),u=o(`dim`,`...`),d=Math.max(l-s,0),f=Math.max(Math.min(i,d),5),p=0;e>=f-3&&(p=Math.max(Math.min(e-f+3,t.length-f),0));let m=f<t.length&&p>0,h=f<t.length&&p+f<t.length,g=Math.min(p+f,t.length),_=[],v=0;m&&v++,h&&v++;let y=p+ +!!m,b=g-+!!h;for(let r=y;r<b;r++){let i=t[r],a=N(i?n(i,r===e):``,c,{hard:!0,trim:!1}).split(`
|
|
16
|
+
`);_.push(a),v+=a.length}if(v>d){let t=0,n=0,r=v,i=e-y,a=d,o=()=>De(_,r,0,i,a),s=()=>De(_,r,i+1,_.length,a,!0);m?({lineCount:r,removals:t}=o(),r>a&&(h||--a,{lineCount:r,removals:n}=s())):(h||--a,{lineCount:r,removals:n}=s(),r>a&&(--a,{lineCount:r,removals:t}=o())),t>0&&(m=!0,_.splice(0,t)),n>0&&(h=!0,_.splice(_.length-n,n))}let x=[];m&&x.push(u);for(let e of _)for(let t of e)x.push(t);return h&&x.push(u),x},Oe=[`${o(`dim`,`↑/↓`)} to navigate`,`${o(`dim`,`Space:`)} select`,`${o(`dim`,`Enter:`)} confirm`],X=(e,t)=>e.split(`
|
|
17
|
+
`).map(e=>t(e)).join(`
|
|
18
|
+
`),ke=e=>{let t=(e,t)=>{let n=e.label??String(e.value);return t===`disabled`?`${o(`gray`,we)} ${X(n,e=>o([`strikethrough`,`gray`],e))}${e.hint?` ${o(`dim`,`(${e.hint??`disabled`})`)}`:``}`:t===`active`?`${o(`cyan`,Se)} ${n}${e.hint?` ${o(`dim`,`(${e.hint})`)}`:``}`:t===`selected`?`${o(`green`,Ce)} ${X(n,e=>o(`dim`,e))}${e.hint?` ${o(`dim`,`(${e.hint})`)}`:``}`:t===`cancelled`?`${X(n,e=>o([`strikethrough`,`dim`],e))}`:t===`active-selected`?`${o(`green`,Ce)} ${n}${e.hint?` ${o(`dim`,`(${e.hint})`)}`:``}`:t===`submitted`?`${X(n,e=>o(`dim`,e))}`:`${o(`dim`,we)} ${X(n,e=>o(`dim`,e))}`},n=e.required??!0,r=e.showInstructions??!0;return new ue({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:n,cursorAt:e.cursorAt,validate(e){if(n&&(e===void 0||e.length===0))return`Please select at least one option.
|
|
19
|
+
${o(`reset`,o(`dim`,`Press ${o([`gray`,`bgWhite`,`inverse`],` space `)} to select, ${o(`gray`,o(`bgWhite`,o(`inverse`,` enter `)))} to submit`))}`},render(){let n=e.withGuide??I.withGuide,i=H(e.output,e.message,n?`${Te(this.state)} `:``,`${J(this.state)} `),a=`${n?`${o(`gray`,K)}
|
|
20
|
+
`:``}${i}
|
|
21
|
+
`,s=this.value??[],c=(e,n)=>{if(e.disabled)return t(e,`disabled`);let r=s.includes(e.value);return n&&r?t(e,`active-selected`):r?t(e,`selected`):t(e,n?`active`:`inactive`)};switch(this.state){case`submit`:{let r=this.options.filter(({value:e})=>s.includes(e)).map(e=>t(e,`submitted`)).join(o(`dim`,`, `))||o(`dim`,`none`);return`${a}${H(e.output,r,n?`${o(`gray`,K)} `:``)}`}case`cancel`:{let r=this.options.filter(({value:e})=>s.includes(e)).map(e=>t(e,`cancelled`)).join(o(`dim`,`, `));return r.trim()===``?`${a}${o(`gray`,K)}`:`${a}${H(e.output,r,n?`${o(`gray`,K)} `:``)}${n?`
|
|
22
|
+
${o(`gray`,K)}`:``}`}case`error`:{let t=n?`${o(`yellow`,K)} `:``,r=this.error.split(`
|
|
23
|
+
`).map((e,t)=>t===0?`${n?`${o(`yellow`,q)} `:``}${o(`yellow`,e)}`:` ${e}`).join(`
|
|
24
|
+
`),i=a.split(`
|
|
25
|
+
`).length,s=r.split(`
|
|
26
|
+
`).length+1;return`${a}${t}${Y({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:t.length,rowPadding:i+s,style:c}).join(`
|
|
27
|
+
${t}`)}
|
|
28
|
+
${r}
|
|
29
|
+
`}default:{let t=n?`${o(`cyan`,K)} `:``,i=a.split(`
|
|
30
|
+
`).length,s=r?Ee(Oe,n):n?[o(`cyan`,q)]:[],l=s.join(`
|
|
31
|
+
`),u=s.length+1;return`${a}${t}${Y({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:t.length,rowPadding:i+u,style:c}).join(`
|
|
32
|
+
${t}`)}
|
|
33
|
+
${l}
|
|
34
|
+
`}}}}).prompt()},Z=(e=``,t)=>{let n=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${o(`gray`,q)} `:``;n.write(`${r}${o(`red`,e)}
|
|
35
|
+
|
|
36
|
+
`)},Ae=(e=``,t)=>{let n=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${o(`gray`,ye)} `:``;n.write(`${r}${e}
|
|
37
|
+
`)},je=(e=``,t)=>{let n=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${o(`gray`,K)}
|
|
38
|
+
${o(`gray`,q)} `:``;n.write(`${r}${e}
|
|
39
|
+
|
|
40
|
+
`)},Me=e=>o(`magenta`,e),Ne=({indicator:e=`dots`,onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:a=W?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],delay:s=W?80:120,signal:c,...l}={})=>{let u=me(),d,f,p=!1,m=!1,h=``,g,_=performance.now(),v=V(n),y=l?.styleFrame??Me,b=e=>{let n=e>1?i??I.messages.error:r??I.messages.cancel;m=e===1,p&&(O(n,e),m&&typeof t==`function`&&t())},x=()=>b(2),S=()=>b(1),ee=()=>{process.on(`uncaughtExceptionMonitor`,x),process.on(`unhandledRejection`,x),process.on(`SIGINT`,S),process.on(`SIGTERM`,S),process.on(`exit`,b),c&&c.addEventListener(`abort`,S)},te=()=>{process.removeListener(`uncaughtExceptionMonitor`,x),process.removeListener(`unhandledRejection`,x),process.removeListener(`SIGINT`,S),process.removeListener(`SIGTERM`,S),process.removeListener(`exit`,b),c&&c.removeEventListener(`abort`,S)},C=()=>{if(g===void 0)return;u&&n.write(`
|
|
41
|
+
`);let e=N(g,v,{hard:!0,trim:!1}).split(`
|
|
42
|
+
`);e.length>1&&n.write(P.cursor.up(e.length-1)),n.write(P.cursor.to(0)),n.write(P.erase.down())},w=e=>e.replace(/\.+$/,``),T=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},E=l.withGuide??I.withGuide,D=(t=``)=>{p=!0,d=se({output:n}),h=w(t),_=performance.now(),E&&n.write(`${o(`gray`,K)}
|
|
43
|
+
`);let r=0,i=0;ee(),f=setInterval(()=>{if(u&&h===g)return;C(),g=h;let t=y(a[r]),o;if(u)o=`${t} ${h}...`;else if(e===`timer`)o=`${t} ${h} ${T(_)}`;else{let e=`.`.repeat(Math.floor(i)).slice(0,3);o=`${t} ${h}${e}`}let s=N(o,v,{hard:!0,trim:!1});n.write(s),r=r+1<a.length?r+1:0,i=i<4?i+.125:0},s)},O=(t=``,r=0,i=!1)=>{if(!p)return;p=!1,clearInterval(f),C();let a=r===0?o(`green`,ve):r===1?o(`red`,ge):o(`red`,_e);h=t??h,i||(e===`timer`?n.write(`${a} ${h} ${T(_)}
|
|
44
|
+
`):n.write(`${a} ${h}
|
|
45
|
+
`)),te(),d()};return{start:D,stop:(e=``)=>O(e,0),message:(e=``)=>{h=w(e??h)},cancel:(e=``)=>O(e,1),error:(e=``)=>O(e,2),clear:()=>O(``,0,!0),get isCancelled(){return m}}},Pe=[`${o(`dim`,`↑/↓`)} to navigate`,`${o(`dim`,`Enter:`)} confirm`],Q=(e,t)=>e.includes(`
|
|
46
|
+
`)?e.split(`
|
|
47
|
+
`).map(e=>t(e)).join(`
|
|
48
|
+
`):t(e),Fe=e=>{let t=(e,t)=>{if(e===void 0)return``;let n=e.label??String(e.value);switch(t){case`disabled`:return`${o(`gray`,xe)} ${Q(n,e=>o(`gray`,e))}${e.hint?` ${o(`dim`,`(${e.hint??`disabled`})`)}`:``}`;case`selected`:return`${Q(n,e=>o(`dim`,e))}`;case`active`:return`${o(`green`,be)} ${n}${e.hint?` ${o(`dim`,`(${e.hint})`)}`:``}`;case`cancelled`:return`${Q(n,e=>o([`strikethrough`,`dim`],e))}`;default:return`${o(`dim`,xe)} ${Q(n,e=>o(`dim`,e))}`}},n=e.showInstructions??!0;return new de({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let r=e.withGuide??I.withGuide,i=`${J(this.state)} `,a=`${Te(this.state)} `,s=H(e.output,e.message,a,i),c=`${r?`${o(`gray`,K)}
|
|
49
|
+
`:``}${s}
|
|
50
|
+
`;switch(this.state){case`submit`:{let n=r?`${o(`gray`,K)} `:``;return`${c}${H(e.output,t(this.options[this.cursor],`selected`),n)}`}case`cancel`:{let n=r?`${o(`gray`,K)} `:``;return`${c}${H(e.output,t(this.options[this.cursor],`cancelled`),n)}${r?`
|
|
51
|
+
${o(`gray`,K)}`:``}`}default:{let i=r?`${o(`cyan`,K)} `:``,a=c.split(`
|
|
52
|
+
`).length,s=n?Ee(Pe,r):r?[o(`cyan`,q)]:[],l=s.join(`
|
|
53
|
+
`),u=s.length+1;return`${c}${i}${Y({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:i.length,rowPadding:a+u,style:(e,n)=>t(e,e.disabled?`disabled`:n?`active`:`inactive`)}).join(`
|
|
54
|
+
${i}`)}
|
|
55
|
+
${l}
|
|
56
|
+
`}}}}).prompt()};`${o(`gray`,K)}`;const $=e=>new fe({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,n=`${`${t?`${o(`gray`,K)}
|
|
57
|
+
`:``}${J(this.state)} `}${e.message}
|
|
58
|
+
`,r=e.placeholder&&e.placeholder.length>0?o(`inverse`,e.placeholder[0])+o(`dim`,e.placeholder.slice(1)):o([`inverse`,`hidden`],`_`),i=this.userInput?this.userInputWithCursor:r,a=this.value??``;switch(this.state){case`validating`:{let e=t?`${o(`cyan`,K)} `:``,r=t?o(`cyan`,q):``;return`${n}${e}${o(`dim`,i)}
|
|
59
|
+
${r} ${o(`dim`,`Validating...`)}
|
|
60
|
+
`}case`error`:{let e=this.error?` ${o(`yellow`,this.error)}`:``,r=t?`${o(`yellow`,K)} `:``,a=t?o(`yellow`,q):``;return`${n.trim()}
|
|
61
|
+
${r}${i}
|
|
62
|
+
${a}${e}
|
|
63
|
+
`}case`submit`:{let e=a?`${t?` `:``}${o(`dim`,a)}`:``;return`${n}${t?o(`gray`,K):``}${e}`}case`cancel`:{let e=a?` ${o([`strikethrough`,`dim`],a)}`:``,r=t?o(`gray`,K):``;return`${n}${r}${e}${a.trim()?`
|
|
64
|
+
${r}`:``}`}default:return`${n}${t?`${o(`cyan`,K)} `:``}${i}
|
|
65
|
+
${t?o(`cyan`,q):``}
|
|
66
|
+
`}}}).prompt();function Ie(e){let t=e.find(e=>!e.startsWith(`--`));if(t===void 0||t.startsWith(`-`))throw Error(`Usage: bunx @jchat/create-addon <addon-id> [--target=<directory>] [--image=<image>] [--workspace] [--template=ui|fullstack] [--mount-points=p1,p2] [--name=<displayName>]`);let n=e.find(e=>e.startsWith(`--target=`)),r=e.find(e=>e.startsWith(`--image=`)),i=e.find(e=>e.startsWith(`--template=`)),o=e.find(e=>e.startsWith(`--mount-points=`)||e.startsWith(`--mountPoints=`)),s=e.find(e=>e.startsWith(`--name=`)),c=e.includes(`--workspace`),l=c?a.join(`addons`,t):t,u=i?i.split(`=`)[1]:void 0,d=o?o.split(`=`)[1]?.split(`,`).filter(Boolean):void 0,f=s?s.slice(7):void 0;return{addonId:t,targetDir:n?.slice(9)||l,sandboxImage:r?.slice(8)||void 0,workspace:c,...u===void 0?{}:{template:u},...d===void 0?{}:{mountPoints:d},...f===void 0?{}:{displayName:f}}}function Le(){try{let e=process.cwd();for(let t=0;t<6;t++){let t=a.join(e,`package.json`);if(i.existsSync(t)){let e=i.readFileSync(t,`utf8`),n=JSON.parse(e);if(n.name===`jchat`&&Array.isArray(n.workspaces))return!0}let n=a.dirname(e);if(n===e)break;e=n}}catch{}return!1}async function Re(t){Ae(`@jchat/create-addon`);let n=t?.trim();if(!n||!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)){let e=await $({message:`What is your addon ID?`,placeholder:`my-custom-addon`,initialValue:t,validate(e){if(!e||e.trim().length===0)return`Addon ID is required`;if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e.trim()))return`Addon ID must contain lowercase letters, numbers, and hyphens (e.g. my-custom-addon)`}});z(e)&&(Z(`Scaffolding cancelled.`),process.exit(0)),n=String(e).trim()}let i=await $({message:`What is the display name?`,initialValue:r(n),validate(e){if(!e||e.trim().length===0)return`Display name is required`}});z(i)&&(Z(`Scaffolding cancelled.`),process.exit(0));let o=await Fe({message:`Choose an addon template:`,options:[{value:`fullstack`,label:`Full-Stack (UI + Backend API + Database)`,hint:`Recommended - includes Elysia routes, Kysely DB, migrations, permissions`},{value:`ui`,label:`Frontend Only (UI Component + Locales)`,hint:`Lightweight client-only extension`}],initialValue:`fullstack`});z(o)&&(Z(`Scaffolding cancelled.`),process.exit(0));let s=await ke({message:`Where should the addon be mounted?`,options:[{value:e.CHAT_TOOLBAR,label:`Chat Toolbar`,hint:`Top header/toolbar in chat`},{value:e.CHAT_PLUS_MENU,label:`Plus Menu (+)`,hint:`Message composer action menu`},{value:e.CHAT_SIDEBAR,label:`Chat Sidebar`,hint:`Right-hand sidebar widget`},{value:e.ADDON_SETTINGS,label:`Addon Settings`,hint:`Site admin dashboard panel`},{value:e.OWNER_SETTINGS,label:`Owner Settings`,hint:`Owner dashboard panel`},{value:e.EMOJI_PICKER_GIF_TAB,label:`GIF Tab`,hint:`Emoji/GIF picker panel tab`},{value:e.EMOJI_PICKER_STICKER_TAB,label:`Sticker Tab`,hint:`Emoji/Sticker picker panel tab`}],initialValues:[e.CHAT_TOOLBAR,e.CHAT_PLUS_MENU],required:!0});z(s)&&(Z(`Scaffolding cancelled.`),process.exit(0));let c=Le(),l=await Fe({message:`Target environment:`,options:c?[{value:`workspace`,label:`JChat Monorepo Workspace (addons/<id>)`,hint:`Detected JChat root`},{value:`standalone`,label:`Standalone DevKit (Docker Sandbox)`,hint:`Independent repository`}]:[{value:`standalone`,label:`Standalone DevKit (Docker Sandbox)`,hint:`Independent repository`},{value:`workspace`,label:`Monorepo Workspace (addons/<id>)`,hint:`Inside existing monorepo`}],initialValue:c?`workspace`:`standalone`});z(l)&&(Z(`Scaffolding cancelled.`),process.exit(0));let u=l===`workspace`,d=u?a.join(`addons`,n):n,f=await $({message:`Target directory:`,initialValue:d,validate(e){if(!e||e.trim().length===0)return`Target directory is required`}});return z(f)&&(Z(`Scaffolding cancelled.`),process.exit(0)),{addonId:n,targetDir:String(f).trim(),displayName:String(i).trim(),template:o,mountPoints:s,workspace:u}}async function ze(e){let r=await Bun.file(new URL(`../package.json`,import.meta.url)).json();if(e.includes(`--help`)||e.includes(`-h`))return console.log(`Usage: bunx @jchat/create-addon [addon-id] [--target=<directory>] [--image=<image>] [--workspace] [--template=ui|fullstack] [--mount-points=p1,p2] [--name=<displayName>]`),``;let i=!e.some(e=>e.startsWith(`-`))&&!(!process.stdin.isTTY||Bun.env.CI),o=e.find(e=>!e.startsWith(`-`)),s=i?await Re(o):Ie(e),c=i?Ne():void 0;c?.start(`Scaffolding ${s.displayName??s.addonId}...`);let l=``;return s.workspace?(await n({addonId:s.addonId,targetDir:s.targetDir,isMonorepoWorkspace:!0,jchatVersion:r.version,addonSdkVersion:r.version,template:s.template,mountPoints:s.mountPoints,displayName:s.displayName}),l=a.resolve(s.targetDir),c?.stop(`Addon created successfully at ${l}`),i&&je(`Next steps:
|
|
67
|
+
cd ${s.targetDir}
|
|
68
|
+
bun run dev`)):(await t({...s,jchatVersion:r.version,addonSdkVersion:r.version,sandboxImage:s.sandboxImage??`${r.jchat?.sandboxImage??`ghcr.io/jchatcloud/jchat-sandbox`}:${r.version.replaceAll(`+`,`-`)}`,template:s.template,mountPoints:s.mountPoints,displayName:s.displayName}),l=a.resolve(s.targetDir),c?.stop(`Standalone DevKit created successfully at ${l}`),i&&je(`Next steps:
|
|
69
|
+
cd ${s.targetDir}
|
|
70
|
+
cp .env.example .env
|
|
71
|
+
bun install
|
|
72
|
+
bun sandbox`)),i||console.log(`Created addon at ${l}`),l}if(import.meta.main)try{await ze(process.argv.slice(2))}catch(e){console.error(e),process.exit(1)}export{Le as isInsideJChatMonorepo,Ie as parseCreatorArguments,Re as promptInteractiveOptions,ze as runCreator};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region ../addon-sdk/dist/contracts2.d.mts
|
|
2
|
+
/** Valid locations where an addon can be rendered within the Jchat layout. */
|
|
3
|
+
declare const MOUNT_POINTS: {
|
|
4
|
+
/** Top of the main chat column */
|
|
5
|
+
readonly CHAT_HEADER: "chat-header";
|
|
6
|
+
/** Below the main chat header, above messages */
|
|
7
|
+
readonly CHAT_TOOLBAR: "chat-toolbar";
|
|
8
|
+
/** The persistent right-side sidebar */
|
|
9
|
+
readonly CHAT_SIDEBAR: "chat-sidebar";
|
|
10
|
+
/** Top of the left sidebar (room list) */
|
|
11
|
+
readonly SIDEBAR_TOP: "sidebar-top";
|
|
12
|
+
/** Bottom of the left sidebar */
|
|
13
|
+
readonly SIDEBAR_BOTTOM: "sidebar-bottom";
|
|
14
|
+
/** Action list shown when clicking a user's avatar */
|
|
15
|
+
readonly USER_POPOVER_ACTIONS: "user-popover-actions";
|
|
16
|
+
/** Menu shown when right-clicking a message */
|
|
17
|
+
readonly MESSAGE_CONTEXT_MENU: "message-context-menu";
|
|
18
|
+
/** Floating overlay rendered on top of the message stream */
|
|
19
|
+
readonly MESSAGE_FEED_OVERLAY: "message-feed-overlay";
|
|
20
|
+
/** Main admin dashboard area */
|
|
21
|
+
readonly ADMIN_PANEL: "admin-panel";
|
|
22
|
+
/** User or site settings dashboard area */
|
|
23
|
+
readonly SETTINGS_PANEL: "settings-panel";
|
|
24
|
+
/** The 'plus' (+) menu in the message composer */
|
|
25
|
+
readonly CHAT_PLUS_MENU: "chat-plus-menu";
|
|
26
|
+
/** Custom tab in the emoji/gif selection panel */
|
|
27
|
+
readonly EMOJI_PICKER_GIF_TAB: "emoji-picker-gif-tab";
|
|
28
|
+
/** Custom tab in the emoji/sticker selection panel */
|
|
29
|
+
readonly EMOJI_PICKER_STICKER_TAB: "emoji-picker-sticker-tab";
|
|
30
|
+
/** Dedicated settings panel rendered in the Owner Dashboard */
|
|
31
|
+
readonly OWNER_SETTINGS: "owner-settings";
|
|
32
|
+
/** Dedicated settings panel rendered in the Site Admin Dashboard */
|
|
33
|
+
readonly ADDON_SETTINGS: "addon-settings";
|
|
34
|
+
/** Custom interactive card rendered inside an enriched chat message */
|
|
35
|
+
readonly CHAT_MESSAGE_CARD: "chat-message-card";
|
|
36
|
+
/** Custom badge, audio equalizer, or particle aura rendered on a chat bubble */
|
|
37
|
+
readonly CHAT_MESSAGE_FLAIR: "chat-message-flair";
|
|
38
|
+
/** Custom interactive preview card rendered in the message composer */
|
|
39
|
+
readonly CHAT_COMPOSER_PREVIEW: "chat-composer-preview";
|
|
40
|
+
};
|
|
41
|
+
/** Union type of all valid addon mount points. */
|
|
42
|
+
type MountPoint = (typeof MOUNT_POINTS)[keyof typeof MOUNT_POINTS];
|
|
43
|
+
declare const HOST_LOCALES: readonly ["ar", "bg", "hr", "de", "el", "en", "es", "fr", "he", "hi", "kn", "ml", "nl", "pt", "ro", "ru", "ta", "te", "tr", "ur"];
|
|
44
|
+
//#endregion
|
|
45
|
+
export { MOUNT_POINTS as n, MountPoint as r, HOST_LOCALES as t };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { r as MountPoint } from "./contracts2.mjs";
|
|
2
|
+
//#region src/generator.d.ts
|
|
3
|
+
type AddonTemplateType = "ui" | "fullstack";
|
|
4
|
+
interface StandaloneDevkitOptions {
|
|
5
|
+
addonId: string;
|
|
6
|
+
targetDir: string;
|
|
7
|
+
jchatVersion: string;
|
|
8
|
+
addonSdkVersion: string;
|
|
9
|
+
sandboxImage?: string;
|
|
10
|
+
template?: AddonTemplateType;
|
|
11
|
+
mountPoints?: MountPoint[];
|
|
12
|
+
displayName?: string;
|
|
13
|
+
}
|
|
14
|
+
interface AddonWorkspaceOptions {
|
|
15
|
+
addonId: string;
|
|
16
|
+
targetDir: string;
|
|
17
|
+
isMonorepoWorkspace?: boolean;
|
|
18
|
+
jchatVersion: string;
|
|
19
|
+
addonSdkVersion: string;
|
|
20
|
+
template?: AddonTemplateType;
|
|
21
|
+
mountPoints?: MountPoint[];
|
|
22
|
+
displayName?: string;
|
|
23
|
+
}
|
|
24
|
+
declare function toDisplayName(addonId: string): string;
|
|
25
|
+
declare function createAddonFiles(options: {
|
|
26
|
+
addonId: string;
|
|
27
|
+
isMonorepoWorkspace?: boolean;
|
|
28
|
+
jchatVersion: string;
|
|
29
|
+
addonSdkVersion: string;
|
|
30
|
+
template?: AddonTemplateType;
|
|
31
|
+
mountPoints?: MountPoint[];
|
|
32
|
+
displayName?: string;
|
|
33
|
+
}): Readonly<Record<string, string>>;
|
|
34
|
+
declare function writeAddonWorkspace(options: AddonWorkspaceOptions): Promise<void>;
|
|
35
|
+
declare function createStandaloneDevkitFiles(options: StandaloneDevkitOptions): Readonly<Record<string, string>>;
|
|
36
|
+
declare function writeStandaloneDevkit(options: StandaloneDevkitOptions): Promise<void>;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { createStandaloneDevkitFiles as a, writeStandaloneDevkit as c, createAddonFiles as i, AddonWorkspaceOptions as n, toDisplayName as o, StandaloneDevkitOptions as r, writeAddonWorkspace as s, AddonTemplateType as t };
|