@fugood/bricks-cli 2.25.0-beta.62 → 2.25.0-beta.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/lib/1010.js +1 -0
  2. package/lib/1178.js +1 -0
  3. package/lib/1215.js +1 -0
  4. package/lib/1708.js +9 -0
  5. package/lib/1759.js +1 -0
  6. package/lib/1936.js +1 -0
  7. package/lib/2151.js +1 -0
  8. package/lib/{209.js → 2209.js} +3 -3
  9. package/lib/2247.js +1 -0
  10. package/lib/2486.js +1 -0
  11. package/lib/2557.js +1 -0
  12. package/lib/{223.js → 3223.js} +1 -1
  13. package/lib/3332.js +13 -0
  14. package/lib/3690.js +1 -0
  15. package/lib/3774.js +44 -0
  16. package/lib/3976.js +14 -0
  17. package/lib/4305.js +1 -0
  18. package/lib/4456.js +3 -0
  19. package/lib/{192.js → 4479.js} +4 -4
  20. package/lib/4530.js +22 -0
  21. package/lib/4642.js +9 -0
  22. package/lib/4685.js +1202 -0
  23. package/lib/5212.js +1 -0
  24. package/lib/{658.js → 5658.js} +1 -1
  25. package/lib/5785.js +1 -0
  26. package/lib/6194.js +3 -0
  27. package/lib/6370.js +1 -0
  28. package/lib/6645.js +1 -0
  29. package/lib/6818.js +1 -0
  30. package/lib/7111.js +2 -0
  31. package/lib/7456.js +1 -0
  32. package/lib/7511.js +1 -0
  33. package/lib/7574.js +1 -0
  34. package/lib/7648.js +1 -0
  35. package/lib/8026.js +1 -0
  36. package/lib/{117.js → 8117.js} +2 -2
  37. package/lib/8166.js +1 -0
  38. package/lib/853.js +1 -0
  39. package/lib/915.js +4 -4
  40. package/lib/9320.js +3 -0
  41. package/lib/{387.js → 9387.js} +1 -1
  42. package/lib/9405.js +1 -0
  43. package/lib/9430.js +1 -0
  44. package/lib/{583.js → 9583.js} +1 -1
  45. package/lib/9663.js +1 -0
  46. package/lib/{866.js → 9866.js} +1 -1
  47. package/lib/9940.js +19 -0
  48. package/lib/index.js +17 -17
  49. package/lib/simulator-host-bridge.cjs +1 -0
  50. package/lib/simulator-main.mjs +3 -3
  51. package/package.json +5 -5
  52. package/lib/10.js +0 -1
  53. package/lib/111.js +0 -2
  54. package/lib/166.js +0 -1
  55. package/lib/178.js +0 -1
  56. package/lib/212.js +0 -1
  57. package/lib/215.js +0 -1
  58. package/lib/247.js +0 -1
  59. package/lib/274.js +0 -16
  60. package/lib/305.js +0 -1
  61. package/lib/306.js +0 -1
  62. package/lib/320.js +0 -3
  63. package/lib/332.js +0 -13
  64. package/lib/358.js +0 -1
  65. package/lib/370.js +0 -1
  66. package/lib/405.js +0 -1
  67. package/lib/430.js +0 -1
  68. package/lib/456.js +0 -3
  69. package/lib/479.js +0 -1231
  70. package/lib/486.js +0 -1
  71. package/lib/511.js +0 -1
  72. package/lib/557.js +0 -1
  73. package/lib/574.js +0 -1
  74. package/lib/645.js +0 -1
  75. package/lib/648.js +0 -1
  76. package/lib/663.js +0 -1
  77. package/lib/690.js +0 -1
  78. package/lib/708.js +0 -9
  79. package/lib/75.js +0 -1
  80. package/lib/759.js +0 -1
  81. package/lib/785.js +0 -1
  82. package/lib/818.js +0 -1
  83. package/lib/917.js +0 -1
  84. package/lib/936.js +0 -1
  85. package/lib/940.js +0 -19
package/lib/1178.js ADDED
@@ -0,0 +1 @@
1
+ export const __rspack_esm_id=1178;export const __rspack_esm_ids=[1178];export const __webpack_modules__={28193(e,o,r){r.a(e,async function(e,t){try{r.r(o),r.d(o,{createCdpClient:()=>u});var n,s=r(99436),a=r(84361),c=e([a]);a=(c.then?(await c)():c)[0];var i=15e3,l=({address:e,port:o,method:r,phase:t="request",closeCode:n,closeReason:s,local:a=!1})=>{var c=s?Buffer.isBuffer(s)?s.toString("utf8"):String(s):"",i="connect"===t?"before the CDP session opened":r?`while waiting for ${r}`:"during the CDP session",l=`${e}:${o}`,d=[];null!=n&&d.push(`code ${n}`),c&&d.push(`reason: ${c}`);var u=[a?`CDP client closed the connection to ${l} ${i}.`:`CDP connection to ${l} closed ${i}.`,d.length>0?`WebSocket close ${d.join(", ")}.`:null,a?null:"The DevTools server currently accepts one CDP client at a time. Another DevTools window or CLI command may have replaced this session. Retry the command, close the other inspector, or avoid running DevTools commands in parallel."].filter(Boolean).join("\n"),f=Error(u);return f.code="CDP_CONNECTION_CLOSED",f.method=r,f.phase=t,f.closeCode=n,f.closeReason=c,f},d=(n=s(function*(e,o,r){var t,n=r?"string"==typeof r?{passcode:r}:r:{},s=n.passcode,a=n.accessToken;if(a)return`ws://${e}:${o}/ws?access_token=${encodeURIComponent(a)}`;if(!s)try{var c=new AbortController;t=setTimeout(()=>c.abort(),3e3);var i=yield fetch(`http://${e}:${o}/json/list`,{signal:c.signal});if(i.ok){var l=yield i.json(),d=l?.[0]?.webSocketDebuggerUrl;if(d){var u=d.match(/\/ws(?:\/.*)?$/);if(u)return`ws://${e}:${o}${u[0]}`}}}catch{}finally{void 0!==t&&clearTimeout(t)}return s?`ws://${e}:${o}/ws/${encodeURIComponent(s)}`:`ws://${e}:${o}/ws`}),function(e,o,r){return n.apply(this,arguments)}),u=(e,o,r)=>{var t,n,c=0,u=new Map,f=new Map,h=null,m=e=>{for(var o of u.values()){var r=o.reject,t=o.timer,n=o.method;clearTimeout(t),r(e(n))}u.clear()};return{connect:(t=s(function*(){var t=yield d(e,o,r);return new Promise((r,s)=>{n=new a.WebSocket(t);var c=!1;n.once("open",()=>{c=!0,h=null,r()}),n.once("error",r=>{c||s(Error(r.message||`Cannot connect to ${e}:${o}`))}),n.on("message",e=>{try{var o=JSON.parse(e.toString());if(null!=o.id&&u.has(o.id)){var r=u.get(o.id),t=r.resolve,n=r.reject,s=r.timer;clearTimeout(s),u.delete(o.id),o.error?n(Error(o.error.message)):t(o.result);return}if(o.method){var a=f.get(o.method);if(a)for(var c of a)c(o.params)}}catch{}}),n.on("close",(r,t)=>{h={closeCode:r,closeReason:t},c||s(l({address:e,port:o,phase:"connect",closeCode:r,closeReason:t})),m(n=>l({address:e,port:o,method:n,closeCode:r,closeReason:t}))})})}),function(){return t.apply(this,arguments)}),send:(r,t={},s=i)=>new Promise((a,i)=>{if(!n||n.readyState!==n.OPEN)return h?void i(l({address:e,port:o,method:r,closeCode:h.closeCode,closeReason:h.closeReason})):void i(Error(`Not connected to CDP at ${e}:${o} while sending ${r}`));var d=++c,f=setTimeout(()=>{u.delete(d),i(Error(`Timeout: ${r}`))},s);u.set(d,{resolve:a,reject:i,timer:f,method:r}),n.send(JSON.stringify({id:d,method:r,params:t}))}),on:(e,o)=>{f.has(e)||f.set(e,[]),f.get(e).push(o)},off:(e,o)=>{var r=f.get(e);if(r){var t=r.indexOf(o);t>=0&&r.splice(t,1)}},close:()=>{m(r=>l({address:e,port:o,method:r,local:!0})),n&&(n.terminate(),n=null)}}};t()}catch(e){t(e)}})}};
package/lib/1215.js ADDED
@@ -0,0 +1 @@
1
+ export const __rspack_esm_id=1215;export const __rspack_esm_ids=[1215];export const __webpack_modules__={5018(e){e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},44668(e,t,r){var i=r(56347);function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},70604(e){e.exports=function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},90250(e,t,r){var i=r(3634),n=r(70604),o=r(78243),s=r(5523);e.exports=function(e){return i(e)||n(e)||o(e)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},23878(e,t,r){var i=r(14319).default;e.exports=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},56347(e,t,r){var i=r(14319).default,n=r(23878);e.exports=function(e){var t=n(e,"string");return"symbol"==i(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},14319(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},69995(e,t,r){r.d(t,{H:()=>i});function i(e,t){try{var r=JSON.parse(e).error,i=r?.message??r;if("string"==typeof i&&i)return i}catch{}return e||t}},42208(e,t,r){r.d(t,{RP:()=>a});var i=r(99436),n=r(75720),o="CTOR",s="ctor@bricks.tools",u=`Co-authored-by: ${o} <${s}>`;function l(){return(l=i(function*(e){return!!(yield(0,n.sh)`cd ${e} && git config user.email`.quiet().nothrow().text()).trim()})).apply(this,arguments)}function a(e,t){return p.apply(this,arguments)}function p(){return(p=i(function*(e,t,r=[]){var i=yield function(e){return l.apply(this,arguments)}(e),n=i?[]:["-c",`user.name=${o}`,"-c",`user.email=${s}`],a=[];for(var p of t)a.push("-m",p);return i&&a.push("-m",u),[...n,"commit",...r,...a]})).apply(this,arguments)}},13376(e,t,r){r.d(t,{a:()=>l,p:()=>s});var i=r(99436),n=r(51455),o=".bricks/.last-pushed-commit";function s(e){return u.apply(this,arguments)}function u(){return(u=i(function*(e){try{return(yield(0,n.readFile)(`${e}/${o}`,"utf8")).trim()||null}catch{return null}})).apply(this,arguments)}function l(e,t){return a.apply(this,arguments)}function a(){return(a=i(function*(e,t){t&&(yield(0,n.mkdir)(`${e}/.bricks`,{recursive:!0}),yield(0,n.writeFile)(`${e}/${o}`,t))})).apply(this,arguments)}},69070(e,t,r){r.d(t,{k:()=>s,q:()=>l});var i=r(99436),n=r(26848),o=r(1708);function s(e){return u.apply(this,arguments)}function u(){return(u=i(function*(e){if(!o.stdin.isTTY)return"";var t=(0,n.createInterface)({input:o.stdin,output:o.stdout});try{return(yield t.question(`${e} `)).trim()}finally{t.close()}})).apply(this,arguments)}function l(e){return a.apply(this,arguments)}function a(){return(a=i(function*(e){return(yield s(e))==="y"})).apply(this,arguments)}},75720(e,t,r){r.d(t,{p:()=>c,sh:()=>h});var i,n,o=r(90250),s=r(99436),u=r(5018),l=r(44668),a=r(31421),p=r(73024),c=()=>{var e=process.argv[1];return e&&!(e.includes("$bunfs")||e.includes("~BUN"))&&(0,p.existsSync)(e)?[process.execPath,e]:[process.execPath]},d=l(function e(t){u(this,e),this._cwd=void 0,this._mode="default",this._throw=!0,this._env=void 0,this._promise=null,this.args=t},[{key:"cwd",value:function(e){return this._cwd=e,this}},{key:"quiet",value:function(){return this._mode="quiet",this}},{key:"nothrow",value:function(){return this._throw=!1,this}},{key:"env",value:function(e){return this._env={...this._env,...e},this}},{key:"text",value:(i=s(function*(){return"default"===this._mode&&(this._mode="text"),(yield this.run()).stdout.toString("utf8")}),function(){return i.apply(this,arguments)})},{key:"then",value:function(e,t){return this.run().then(e,t)}},{key:"run",value:function(){return this._promise||(this._promise=this.exec()),this._promise}},{key:"exec",value:(n=s(function*(){var e=o(this.args),t=e[0],r=(function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i})(e).slice(1);if(!t)throw Error("sh: empty command");var i="default"===this._mode?["inherit","pipe","pipe"]:"quiet"===this._mode?["ignore","pipe","pipe"]:["inherit","pipe","pipe"],n=this._env?{...process.env,...this._env}:void 0,s=(0,a.spawn)(t,r,{cwd:this._cwd,stdio:i,env:n}),u=[],l=[];s.stdout?.on("data",e=>{u.push(e),"default"===this._mode&&process.stdout.write(e)}),s.stderr?.on("data",e=>{l.push(e),"default"===this._mode&&process.stderr.write(e)});var p=yield new Promise((e,t)=>{s.on("error",t),s.on("close",t=>e(t??0))}),c=Buffer.concat(u),d=Buffer.concat(l);if(0!==p&&this._throw){var f=Error(`sh: command failed with exit ${p}: ${this.args.join(" ")}`);throw f.exitCode=p,f.stdout=c,f.stderr=d,f}return{exitCode:p,stdout:c,stderr:d}}),function(){return n.apply(this,arguments)})}]),f=/\s/;function h(e,...t){var r,i,n,o,s,u=(r=[],i="",n=!1,o=()=>{n&&(r.push(i),i="",n=!1)},s=e=>{i+=e,n=!0},(e.forEach((e,r)=>{for(var i=0;i<e.length;i++){var n=e[i];f.test(n)?o():s(n)}r<t.length&&(e=>{if(null!=e){if(Array.isArray(e))return e.forEach((e,t)=>{t>0&&o(),s(String(e))});s(String(e))}})(t[r])}),o(),r.length>=3&&"cd"===r[0]&&"&&"===r[2])?{tokens:r.slice(3),initialCwd:r[1]}:{tokens:r}),l=u.tokens,a=u.initialCwd,p=new d(l);return a&&p.cwd(a),p}},42914(e,t,r){r.r(t),r.d(t,{deploy:()=>h});var i,n,o=r(99436),s=r(51455),u=r(75720),l=r(69995),a=r(42208),p=r(13376),c=r(69070),d=(i=o(function*(e){try{return yield(0,s.access)(e),!0}catch{return!1}}),function(e){return i.apply(this,arguments)}),f=(n=o(function*(e){return JSON.parse((yield(0,s.readFile)(e,"utf8")))}),function(e){return n.apply(this,arguments)});function h(){return y.apply(this,arguments)}function y(){return(y=o(function*(e={}){process.env.BRICKS_RELEASE_SIGN||(process.env.BRICKS_RELEASE_SIGN="CTOR");var t,r=process.cwd(),i=e.changelogs,n=e.changelogsFile,o=e.autoCommit,h=e.autoVersion,y=e.version,v=e.yes,m=0===(yield(0,u.sh)`cd ${r} && git status`.quiet().nothrow()).exitCode;if(!m&&!v&&!(yield(0,c.q)("No git repository found, continue? (y/n)")))throw Error("Deployment cancelled");var _=yield f(`${r}/application.json`),g=yield f(`${r}/.bricks/build/application-config.json`),x=`${r}/package.json`,w=yield d(x);if(y){if(t=y,w){var b=yield f(x);b.version=t,yield(0,s.writeFile)(x,JSON.stringify(b,null,2)+"\n")}}else if(h&&w){var S=yield f(x),$=(S.version||"0.0.0").split(".");$[2]=String(Number($[2]||0)+1),S.version=t=$.join("."),yield(0,s.writeFile)(x,JSON.stringify(S,null,2)+"\n")}else t=w?(yield f(x)).version:void 0;var k="";if(i)k=i;else if(n){if(!(yield d(n)))throw Error(`Changelogs file not found: ${n}`);k=yield(0,s.readFile)(n,"utf8")}else v||(k=(yield(0,c.k)("Enter changelogs (optional, press Enter to skip):"))||"");var E="";if(m){if(yield(0,u.sh)`cd ${r} && git diff --name-only --diff-filter=ACMR`.text())if(o){var C=`chore: release ${t||"new version"}`,j=k||"[no changelogs]";yield(0,u.sh)`cd ${r} && git add -A`;var N=yield(0,a.RP)(r,[C,j]);yield(0,u.sh)`cd ${r} && git ${N}`}else throw Error("Unstaged changes found, please commit or stash your changes before deploying");E=(yield(0,u.sh)`cd ${r} && git rev-parse HEAD`.text()).trim()}if(!v&&!(yield(0,c.q)("Are you sure you want to deploy? (y/n)")))throw Error("Deployment cancelled");var A="module"===_.type,q={...g,title:t||g.title,bricks_project_last_commit_id:E||void 0},M=`${r}/.bricks/build/release-config.json`;yield(0,s.writeFile)(M,JSON.stringify(q));var O=["bricks",A?"module":"app","release",_.id,"-c",M,"--json"];_.name&&O.push("--name",_.name),t&&O.push("--version",t),k&&O.push("--changelogs",k);var R=yield(0,u.sh)`${O}`.quiet().nothrow();if(0!==R.exitCode){var P=R.stderr.toString()||R.stdout.toString();throw Error((0,l.H)(P,"Release failed"))}var F=JSON.parse(R.stdout.toString());E&&(yield(0,p.a)(r,E)),console.log(`${A?"Module":"App"} deployed: ${F.target?.name||_.name}`)})).apply(this,arguments)}}};