@fugood/bricks-cli 2.26.0-beta.0 → 2.26.0-beta.2
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/README.md +3 -0
- package/lib/{3593.js → 1143.js} +1 -1
- package/lib/1215.js +1 -1
- package/lib/1708.js +6 -6
- package/lib/1826.js +2 -2
- package/lib/1936.js +1 -1
- package/lib/2486.js +1 -1
- package/lib/2557.js +1 -1
- package/lib/3774.js +2 -2
- package/lib/3781.js +78 -0
- package/lib/3976.js +3 -3
- package/lib/{4642.js → 5188.js} +2 -2
- package/lib/6194.js +2 -2
- package/lib/6818.js +1 -1
- package/lib/6954.js +19 -0
- package/lib/7109.js +1 -0
- package/lib/7233.js +231 -231
- package/lib/7294.js +3 -3
- package/lib/7494.js +19 -2
- package/lib/7896.js +13 -0
- package/lib/907.js +5 -4
- package/lib/{6842.js → 9206.js} +1 -1
- package/lib/9320.js +2 -2
- package/lib/9387.js +4 -4
- package/lib/9590.js +1 -1
- package/lib/9663.js +1 -1
- package/lib/index.js +69 -69
- package/lib/lib.js +107 -89
- package/package.json +6 -8
- package/lib/3332.js +0 -13
- package/lib/4479.js +0 -36
- package/lib/6042.js +0 -1
- package/lib/9583.js +0 -19
package/lib/9320.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const __rspack_esm_id=9320;export const __rspack_esm_ids=[9320];export const __webpack_modules__={65650(e,t,r){e.exports=r(78942).Symbol},87379(e,t,r){var o=r(65650),n=r(8870),
|
|
1
|
+
export const __rspack_esm_id=9320;export const __rspack_esm_ids=[9320];export const __webpack_modules__={65650(e,t,r){e.exports=r(78942).Symbol},87379(e,t,r){var o=r(65650),n=r(8870),s=r(29005),i=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?n(e):s(e)}},86403(e,t,r){var o=r(62945),n=/^\s+/;e.exports=function(e){return e?e.slice(0,o(e)+1).replace(n,""):e}},74967(e){e.exports="object"==typeof global&&global&&global.Object===Object&&global},8870(e,t,r){var o=r(65650),n=Object.prototype,s=n.hasOwnProperty,i=n.toString,a=o?o.toStringTag:void 0;e.exports=function(e){var t=s.call(e,a),r=e[a];try{e[a]=void 0;var o=!0}catch(e){}var n=i.call(e);return o&&(t?e[a]=r:delete e[a]),n}},29005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},78942(e,t,r){var o=r(74967),n="object"==typeof self&&self&&self.Object===Object&&self;e.exports=o||n||Function("return this")()},62945(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},12784(e,t,r){var o=r(41580),n=r(94495),s=r(6131),i=Math.max,a=Math.min;e.exports=function(e,t,r){var c,u,l,p,h,d,f=0,v=!1,m=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function g(t){var r=c,o=u;return c=u=void 0,f=t,p=e.apply(o,r)}function b(e){var r=e-d,o=e-f;return void 0===d||r>=t||r<0||m&&o>=l}function _(){var e,r,o,s=n();if(b(s))return x(s);h=setTimeout(_,(e=s-d,r=s-f,o=t-e,m?a(o,l-r):o))}function x(e){return(h=void 0,y&&c)?g(e):(c=u=void 0,p)}function w(){var e,r=n(),o=b(r);if(c=arguments,u=this,d=r,o){if(void 0===h)return f=e=d,h=setTimeout(_,t),v?g(e):p;if(m)return clearTimeout(h),h=setTimeout(_,t),g(d)}return void 0===h&&(h=setTimeout(_,t)),p}return t=s(t)||0,o(r)&&(v=!!r.leading,l=(m="maxWait"in r)?i(s(r.maxWait)||0,t):l,y="trailing"in r?!!r.trailing:y),w.cancel=function(){void 0!==h&&clearTimeout(h),f=0,c=d=u=h=void 0},w.flush=function(){return void 0===h?p:x(n())},w}},41580(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},80547(e){e.exports=function(e){return null!=e&&"object"==typeof e}},51187(e,t,r){var o=r(87379),n=r(80547);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==o(e)}},94495(e,t,r){var o=r(78942);e.exports=function(){return o.Date.now()}},6131(e,t,r){var o=r(86403),n=r(41580),s=r(51187),i=0/0,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(s(e))return i;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=o(e);var r=c.test(e);return r||u.test(e)?l(e.slice(2),r?2:8):a.test(e)?i:+e}},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 o=r(3634),n=r(70604),s=r(78243),i=r(5523);e.exports=function(e){return o(e)||n(e)||s(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},75720(e,t,r){r.d(t,{p:()=>a,sh:()=>l});var o=r(90250),n=r(99436),s=r(31421),i=r(73024),a=()=>{var e=process.argv[1];return e&&!(e.includes("$bunfs")||e.includes("~BUN"))&&(0,i.existsSync)(e)?[process.execPath,e]:[process.execPath]};class c{_cwd=void 0;_mode="default";_throw=!0;_env=void 0;_promise=null;constructor(e){this.args=e}cwd(e){return this._cwd=e,this}quiet(){return this._mode="quiet",this}nothrow(){return this._throw=!1,this}env(e){return this._env={...this._env,...e},this}text(){var e=this;return n(function*(){return"default"===e._mode&&(e._mode="text"),(yield e.run()).stdout.toString("utf8")})()}then(e,t){return this.run().then(e,t)}run(){return this._promise||(this._promise=this.exec()),this._promise}exec(){var e=this;return n(function*(){var t=o(e.args),r=t[0],n=(function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o})(t).slice(1);if(!r)throw Error("sh: empty command");var i="default"===e._mode?["inherit","pipe","pipe"]:"quiet"===e._mode?["ignore","pipe","pipe"]:["inherit","pipe","pipe"],a=e._env?{...process.env,...e._env}:void 0,c=(0,s.spawn)(r,n,{cwd:e._cwd,stdio:i,env:a}),u=[],l=[];c.stdout?.on("data",t=>{u.push(t),"default"===e._mode&&process.stdout.write(t)}),c.stderr?.on("data",t=>{l.push(t),"default"===e._mode&&process.stderr.write(t)});var p=yield new Promise((e,t)=>{c.on("error",t),c.on("close",t=>e(t??0))}),h=Buffer.concat(u),d=Buffer.concat(l);if(0!==p&&e._throw){var f=Error(`sh: command failed with exit ${p}: ${e.args.join(" ")}`);throw f.exitCode=p,f.stdout=h,f.stderr=d,f}return{exitCode:p,stdout:h,stderr:d}})()}}var u=/\s/;function l(e,...t){var r,o,n,s,i,a=(r=[],o="",n=!1,s=()=>{n&&(r.push(o),o="",n=!1)},i=e=>{o+=e,n=!0},(e.forEach((e,r)=>{for(var o=0;o<e.length;o++){var n=e[o];u.test(n)?s():i(n)}r<t.length&&(e=>{if(null!=e){if(Array.isArray(e))return e.forEach((e,t)=>{t>0&&s(),i(String(e))});i(String(e))}})(t[r])}),s(),r.length>=3&&"cd"===r[0]&&"&&"===r[2])?{tokens:r.slice(3),initialCwd:r[1]}:{tokens:r}),p=a.tokens,h=a.initialCwd,d=new c(p);return h&&d.cwd(h),d}},16749(e,t,r){r.d(t,{W:()=>i});var o=r(73024),n=r(76760),s=r(73136);function i(e){var t=(0,n.dirname)((0,s.fileURLToPath)(e)),r=[(0,n.join)(t,"simulator-main.mjs"),(0,n.join)(t,"..","simulator-main.mjs"),(0,n.join)((0,n.dirname)(process.execPath),"simulator-main.mjs")];for(var i of r)if((0,o.existsSync)(i))return i;throw Error(`Unable to locate the simulator entry (simulator-main.mjs). Probed paths:
|
|
2
2
|
${r.map(e=>` - ${e}`).join("\n")}
|
|
3
|
-
If you installed the standalone bricks binary, re-run the installer to restore the simulator assets.`)}},7931(e,t,r){r.r(t),r.d(t,{simulator:()=>
|
|
3
|
+
If you installed the standalone bricks binary, re-run the installer to restore the simulator assets.`)}},7931(e,t,r){r.r(t),r.d(t,{simulator:()=>h});var o=r(99436),n=r(31421),s=r(51455),i=r(73024),a=r(80481),c=r(57975),u=r(12784),l=r(75720),p=r(16749);function h(){return d.apply(this,arguments)}function d(){return(d=o(function*(e=[]){var t,r=(0,c.parseArgs)({args:e,options:{"skip-typecheck":{type:"boolean"},"clear-cache":{type:"boolean"},screenshot:{type:"boolean"},"screenshot-delay":{type:"string"},"screenshot-width":{type:"string"},"screenshot-height":{type:"string"},"screenshot-path":{type:"string"},"screenshot-no-headless":{type:"boolean"},"show-menu":{type:"boolean"},"test-id":{type:"string"},"test-title-like":{type:"string"},"no-keep-open":{type:"boolean"},"cdp-port":{type:"string"},"no-cdp":{type:"boolean"},"capture-plan":{type:"string"}},strict:!0,allowPositionals:!0}).values,h=process.cwd(),d=JSON.parse((yield(0,s.readFile)(`${h}/application.json`,"utf8"))),f=[];r["clear-cache"]&&f.push("--clear-cache");var v=!0;if(r.screenshot&&(f.push("--take-screenshot"),f.push(JSON.stringify({delay:Number(r["screenshot-delay"])||1e3,width:Number(r["screenshot-width"])||600,height:Number(r["screenshot-height"])||480,path:r["screenshot-path"]||`${h}/screenshot.jpg`,noHeadless:r["screenshot-no-headless"]??!1})),v=!r["no-keep-open"]),r["capture-plan"]&&(f.push("--capture-plan",r["capture-plan"]),v=!1),r["show-menu"]&&f.push("--show-menu"),r["test-id"]&&f.push("--test-id",r["test-id"]),r["test-title-like"]&&f.push("--test-title-like",r["test-title-like"]),r["no-keep-open"]&&f.push("--no-keep-open"),!r["no-cdp"]){var m=parseInt(r["cdp-port"]||"",10)||19852;f.push("--cdp-port",String(m))}var y=!r["skip-typecheck"],g=(t=o(function*(){yield(0,l.sh)`${(0,l.p)()} ctor compile ${y?[]:["--no-check"]}`}),function(){return t.apply(this,arguments)});yield g();var b=null;if(v){var _=u(g,500);b=(0,i.watch)(`${h}/subspaces`,{recursive:!0},(e,t)=>{console.log(`Detected ${e} in ${t}`),_()})}var x=`${h}/.bricks/devtools.json`,w=()=>{try{(0,i.unlinkSync)(x)}catch{}};try{var j=JSON.parse((yield(0,s.readFile)(x,"utf8")));if(j.pid){try{process.kill(j.pid)}catch{}w()}}catch{}var S=(0,p.W)("file:///Users/jhen/workspace/mybigday-bricks/packages/bricks-cli/src/ctor/tools/simulator.js"),k=(0,n.spawn)("bunx",["--bun","electron",S,...f],{env:{...process.env,BRICKS_STAGE:d.stage||"production"},stdio:["inherit","pipe","inherit"]});(0,a.createInterface)({input:k.stdout}).on("line",e=>{if(e.startsWith("[TEST_RESULT_TOON]"))return void console.log(e.replace("[TEST_RESULT_TOON]",""));if(e){var t=e.match(/^CDP server: ws:\/\/localhost:(\d+)/);if(t){var r={port:parseInt(t[1],10),pid:k.pid,address:"localhost",name:`${d.name||"Unnamed"} (CTOR Simulator)`,startedAt:new Date().toISOString()};(0,s.writeFile)(x,JSON.stringify(r,null,2))}console.log(e)}}),yield new Promise(e=>{k.on("close",()=>e())}),w(),b&&b.close()})).apply(this,arguments)}}};
|
package/lib/9387.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export const __webpack_modules__={75149(t,r,e){e.d(r,{P:()=>i});var
|
|
1
|
+
export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export const __webpack_modules__={75149(t,r,e){e.d(r,{P:()=>i});var a=e(79657),o=e(64007);function i(t){var r=process.env.HTTPS_PROXY||process.env.https_proxy;if(!r||!t.startsWith("https://"))return a.Ay;var e=new o(r);return(t,r={})=>(0,a.Ay)(t,{...r,agent:e})}},30182(t,r,e){e.r(r),e.d(r,{BANK_PROPERTY_META_VALUES:()=>i.YC,createBankClient:()=>c,resolveBankEndpoint:()=>n,validateBankPropertyMeta:()=>i.jR});var a=e(99436),o=e(75149),i=e(31596),p={"https://display.bricks.tools":"https://bank.bricks.tools","https://display-beta.bricks.tools":"https://bank-beta.bricks.tools"},n=t=>{if(process.env.BRICKS_BANK_ENDPOINT)return process.env.BRICKS_BANK_ENDPOINT;var r=p[t];if(r)return r;try{var e=new URL(t).hostname;if("localhost"===e||"127.0.0.1"===e)return"http://localhost:8080"}catch{}throw Error(`Cannot derive the Data Bank endpoint from ${t}; set BRICKS_BANK_ENDPOINT to override`)},s=`
|
|
2
2
|
propertyId
|
|
3
3
|
meta
|
|
4
4
|
definition
|
|
@@ -9,7 +9,7 @@ export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export co
|
|
|
9
9
|
lastUpdateKey
|
|
10
10
|
createAt
|
|
11
11
|
updateAt
|
|
12
|
-
`,l=({endpoint:t,spacename:r,spacekey:e})=>{var p,n=`${t}/api/graphql`,
|
|
12
|
+
`,l={InSubspace:"IN_SUBSPACE",Global:"GLOBAL"},d={IN_SUBSPACE:"InSubspace",GLOBAL:"Global"},u=t=>void 0===t?void 0:JSON.stringify(t),y=t=>t&&d[t.meta]?{...t,meta:d[t.meta]}:t,c=({endpoint:t,spacename:r,spacekey:e})=>{var p,n=`${t}/api/graphql`,d=(0,o.P)(t),c=(p=a(function*(t,a){var o,i=yield d(n,{method:"POST",headers:{"content-type":"application/json",SPACENAME:r,SPACEKEY:e},body:JSON.stringify({query:t,variables:a})}),p=yield i.text();try{o=JSON.parse(p)}catch{o=null}if(o?.errors?.length)throw Error(o.errors.map(({message:t})=>t).join("\n"));if(!i.ok){var s=Error(`Data Bank API error (${i.status}): ${p.trim()}`);throw 403===i.status&&(s.isBankAuthError=!0),s}return o?.data||{}}),function(t,r){return p.apply(this,arguments)});return{listProperties(){return a(function*({keyword:t,meta:r,ids:e}={}){return(0,i.jR)(r),((yield c(`#graphql
|
|
13
13
|
query(
|
|
14
14
|
$filterUpdateHashes: [PropertyFilterUpdateHash!]
|
|
15
15
|
$filterMeta: String
|
|
@@ -21,11 +21,11 @@ export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export co
|
|
|
21
21
|
filterKeyword: $filterKeyword
|
|
22
22
|
) { ${s} }
|
|
23
23
|
}
|
|
24
|
-
`,{filterUpdateHashes:e?.map(t=>({propertyId:t,value:""})),filterMeta:r,filterKeyword:t})).properties||[]}).apply(this,arguments)},getProperty(t){var r=this;return
|
|
24
|
+
`,{filterUpdateHashes:e?.map(t=>({propertyId:t,value:""})),filterMeta:r,filterKeyword:t})).properties||[]).map(y)}).apply(this,arguments)},getProperty(t){var r=this;return a(function*(){return(yield r.listProperties({ids:[t]})).find(r=>r.propertyId===t)||null})()},updateProperties:(t,r)=>a(function*(){if(!t?.length)throw Error("No properties to update.");var e=t.map(t=>{var r=t.meta||"InSubspace";return(0,i.jR)(r),{propertyId:t.propertyId,meta:l[r],definition:u(t.definition),newDefinitionFallback:u(t.newDefinitionFallback),value:u(t.value),updateNote:t.updateNote||"Updated via bricks-cli",upsert:!1!==t.upsert,tags:t.tags}});return((yield c(`#graphql
|
|
25
25
|
mutation($properties: [PropertyInput!]!, $dontNotify: Boolean) {
|
|
26
26
|
updateProperty(properties: $properties, dontNotify: $dontNotify) { ${s} }
|
|
27
27
|
}
|
|
28
|
-
`,{properties:e,dontNotify:r})).updateProperty||[]})(),removeProperty:t=>
|
|
28
|
+
`,{properties:e,dontNotify:r})).updateProperty||[]).map(y)})(),removeProperty:t=>a(function*(){return(yield c(`#graphql
|
|
29
29
|
mutation($propertyId: String!) {
|
|
30
30
|
removeProperty(propertyId: $propertyId)
|
|
31
31
|
}
|