@fugood/bricks-cli 2.26.0-beta.3 → 2.26.0-beta.30
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 +77 -6
- package/lib/1010.js +1 -1
- package/lib/1178.js +1 -1
- package/lib/1215.js +1 -1
- package/lib/1374.js +4 -0
- package/lib/1708.js +8 -8
- package/lib/1936.js +1 -1
- package/lib/2486.js +1 -1
- package/lib/2517.js +8 -0
- package/lib/2557.js +1 -1
- package/lib/3223.js +1 -1
- package/lib/3690.js +1 -1
- package/lib/3774.js +2 -2
- package/lib/{6842.js → 39.js} +1 -1
- package/lib/4456.js +2 -2
- package/lib/4485.js +1 -0
- package/lib/4530.js +10 -10
- package/lib/5698.js +1 -0
- package/lib/6194.js +2 -2
- package/lib/6818.js +1 -1
- package/lib/7294.js +2 -2
- package/lib/7494.js +12 -3
- package/lib/7511.js +3 -1
- package/lib/831.js +1 -1
- package/lib/8937.js +1 -0
- package/lib/907.js +403 -86
- package/lib/9320.js +23 -2
- package/lib/9387.js +5 -5
- package/lib/9439.js +2668 -0
- package/lib/9663.js +1 -1
- package/lib/devtools.js +1 -0
- package/lib/index.js +123 -106
- package/lib/lib.js +423 -97
- package/lib/simulator-host-bridge.cjs +1 -1
- package/lib/simulator-main.mjs +6 -6
- package/package.json +7 -6
- package/lib/3593.js +0 -1
- package/lib/563.js +0 -4
- package/lib/6042.js +0 -1
- package/lib/6645.js +0 -1
- package/lib/7233.js +0 -2546
- package/lib/7574.js +0 -1
- package/lib/7648.js +0 -1
- package/lib/9590.js +0 -7
package/lib/9320.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
export const __rspack_esm_id=9320;export const __rspack_esm_ids=[9320];export const __webpack_modules__={
|
|
1
|
+
export const __rspack_esm_id=9320;export const __rspack_esm_ids=[9320];export const __webpack_modules__={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}},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 u,c,p,l,h,d,f=0,v=!1,m=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function w(t){var r=u,o=c;return u=c=void 0,f=t,l=e.apply(o,r)}function g(e){var r=e-d,o=e-f;return void 0===d||r>=t||r<0||m&&o>=p}function x(){var e,r,o,s=n();if(g(s))return _(s);h=setTimeout(x,(e=s-d,r=s-f,o=t-e,m?a(o,p-r):o))}function _(e){return(h=void 0,y&&u)?w(e):(u=c=void 0,l)}function b(){var e,r=n(),o=g(r);if(u=arguments,c=this,d=r,o){if(void 0===h)return f=e=d,h=setTimeout(x,t),v?w(e):l;if(m)return clearTimeout(h),h=setTimeout(x,t),w(d)}return void 0===h&&(h=setTimeout(x,t)),l}return t=s(t)||0,o(r)&&(v=!!r.leading,p=(m="maxWait"in r)?i(s(r.maxWait)||0,t):p,y="trailing"in r?!!r.trailing:y),b.cancel=function(){void 0!==h&&clearTimeout(h),f=0,u=d=c=h=void 0},b.flush=function(){return void 0===h?l:_(n())},b}},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,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,p=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=u.test(e);return r||c.test(e)?p(e.slice(2),r?2:8):a.test(e)?i:+e}},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 o=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,o(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},23878(e,t,r){var o=r(14319).default;e.exports=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=o(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 o=r(14319).default,n=r(23878);e.exports=function(e){var t=n(e,"string");return"symbol"==o(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},75720(e,t,r){r.d(t,{p:()=>l,sh:()=>f});var o,n,s=r(90250),i=r(99436),a=r(5018),u=r(44668),c=r(31421),p=r(73024),l=()=>{var e=process.argv[1];return e&&!(e.includes("$bunfs")||e.includes("~BUN"))&&(0,p.existsSync)(e)?[process.execPath,e]:[process.execPath]},h=u(function e(t){a(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:(o=i(function*(){return"default"===this._mode&&(this._mode="text"),(yield this.run()).stdout.toString("utf8")}),function(){return o.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=i(function*(){var e=s(this.args),t=e[0],r=(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})(e).slice(1);if(!t)throw Error("sh: empty command");var o="default"===this._mode?["inherit","pipe","pipe"]:"quiet"===this._mode?["ignore","pipe","pipe"]:["inherit","pipe","pipe"],n=this._env?{...process.env,...this._env}:void 0,i=(0,c.spawn)(t,r,{cwd:this._cwd,stdio:o,env:n}),a=[],u=[];i.stdout?.on("data",e=>{a.push(e),"default"===this._mode&&process.stdout.write(e)}),i.stderr?.on("data",e=>{u.push(e),"default"===this._mode&&process.stderr.write(e)});var p=yield new Promise((e,t)=>{i.on("error",t),i.on("close",(t,r)=>e({code:t,signal:r}))}),l=p.code,h=p.signal,d=l??1,f=Buffer.concat(a),v=Buffer.concat(u);if(0!==d&&this._throw){var m=h?`signal ${h}`:`exit ${d}`,y=Error(`sh: command failed with ${m}: ${this.args.join(" ")}`);throw y.exitCode=d,y.stdout=f,y.stderr=v,y}return{exitCode:d,stdout:f,stderr:v}}),function(){return n.apply(this,arguments)})}]),d=/\s/;function f(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];d.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}),u=a.tokens,c=a.initialCwd,p=new h(u);return c&&p.cwd(c),p}},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:()=>d});var o=r(99436),n=r(31421),s=r(51455),i=r(73024),a=r(80481),u=r(57975),c=r(12784),p=r(75720),l=r(16749),h=`Usage: bricks ctor simulator [options]
|
|
4
|
+
|
|
5
|
+
Compile the project and run it in the web-preview Simulator. Without
|
|
6
|
+
--no-keep-open the Simulator stays open and reloads on source changes.
|
|
7
|
+
|
|
8
|
+
Options:
|
|
9
|
+
--test-id <id> Run the Automation test with this id
|
|
10
|
+
--test-title-like <text> Run the Automation test whose title contains the text
|
|
11
|
+
--screenshot Take a screenshot (see the --screenshot-* options)
|
|
12
|
+
--screenshot-path <file> Screenshot file (default: ./screenshot.jpg)
|
|
13
|
+
--screenshot-delay <ms> Wait before the screenshot (default: 1000)
|
|
14
|
+
--screenshot-width <px> Screenshot width (default: 600)
|
|
15
|
+
--screenshot-height <px> Screenshot height (default: 480)
|
|
16
|
+
--screenshot-no-headless Show the window during the screenshot
|
|
17
|
+
--no-keep-open Exit after the test / screenshot
|
|
18
|
+
--cdp-port <port> DevTools (CDP) port (default: 19852)
|
|
19
|
+
--no-cdp Do not start the DevTools (CDP) server
|
|
20
|
+
--skip-typecheck Compile without the type check
|
|
21
|
+
--clear-cache Clear the preview cache at start
|
|
22
|
+
--show-menu Show the preview menu
|
|
23
|
+
-h, --help Show this help
|
|
24
|
+
`;function d(){return f.apply(this,arguments)}function f(){return(f=o(function*(e=[]){var t,r=(0,u.parseArgs)({args:e,options:{help:{type:"boolean",short:"h"},"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;if(r.help)return void process.stdout.write(h);var d=process.cwd(),f=JSON.parse((yield(0,s.readFile)(`${d}/application.json`,"utf8"))),v=[];r["clear-cache"]&&v.push("--clear-cache");var m=!0;if(r.screenshot&&(v.push("--take-screenshot"),v.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"]||`${d}/screenshot.jpg`,noHeadless:r["screenshot-no-headless"]??!1})),m=!r["no-keep-open"]),r["capture-plan"]&&(v.push("--capture-plan",r["capture-plan"]),m=!1),r["show-menu"]&&v.push("--show-menu"),r["test-id"]&&v.push("--test-id",r["test-id"]),r["test-title-like"]&&v.push("--test-title-like",r["test-title-like"]),r["no-keep-open"]&&v.push("--no-keep-open"),!r["no-cdp"]){var y=parseInt(r["cdp-port"]||"",10)||19852;v.push("--cdp-port",String(y))}var w=!r["skip-typecheck"],g=(t=o(function*(){yield(0,p.sh)`${(0,p.p)()} ctor compile ${w?[]:["--no-check"]}`}),function(){return t.apply(this,arguments)});yield g();var x=c(o(function*(){try{yield g()}catch(e){console.error(`Recompile failed: ${e.message}`)}}),500),_=null;m&&(_=(0,i.watch)(`${d}/subspaces`,{recursive:!0},(e,t)=>{console.log(`Detected ${e} in ${t}`),x()}));var b=`${d}/.bricks/devtools.json`,k=()=>{try{(0,i.unlinkSync)(b)}catch{}};try{var S=JSON.parse((yield(0,s.readFile)(b,"utf8")));if(S.pid){try{process.kill(S.pid)}catch{}k()}}catch{}var T=(0,l.W)(import.meta.url),$=(0,n.spawn)("bunx",["--bun","electron",T,...v],{env:{...process.env,BRICKS_STAGE:f.stage||"production"},stdio:["inherit","pipe","inherit"]});(0,a.createInterface)({input:$.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:$.pid,address:"localhost",name:`${f.name||"Unnamed"} (CTOR Simulator)`,startedAt:new Date().toISOString()};(0,s.writeFile)(b,JSON.stringify(r,null,2))}console.log(e)}});try{var j=yield new Promise((e,t)=>{$.on("error",t),$.on("close",(t,r)=>e({code:t,signal:r}))}),E=j.code,O=j.signal;if(0!==E)throw Error(`Simulator exited with ${O?`signal ${O}`:`code ${E}`}`)}finally{x.cancel(),k(),_&&_.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,
|
|
1
|
+
export const __rspack_esm_id=9387;export const __rspack_esm_ids=[9387];export const __webpack_modules__={75149(r,t,e){e.d(t,{P:()=>p});var a=e(79657),o=e(64007);function p(r){var t=process.env.HTTPS_PROXY||process.env.https_proxy;if(!t||!r.startsWith("https://"))return a.Ay;var e=new o(t);return(r,t={})=>(0,a.Ay)(r,{...t,agent:e})}},30182(r,t,e){e.r(t),e.d(t,{BANK_PROPERTY_META_VALUES:()=>p.YC,createBankClient:()=>f,resolveBankEndpoint:()=>n,validateBankPropertyMeta:()=>p.jR});var a=e(99436),o=e(75149),p=e(31596),i={"https://display.bricks.tools":"https://bank.bricks.tools","https://display-beta.bricks.tools":"https://bank-beta.bricks.tools"},n=r=>{if(process.env.BRICKS_BANK_ENDPOINT)return process.env.BRICKS_BANK_ENDPOINT;var t=i[r];if(t)return t;try{var e=new URL(r).hostname;if("localhost"===e||"127.0.0.1"===e)return"http://localhost:8080"}catch{}throw Error(`Cannot derive the Data Bank endpoint from ${r}; 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={InSubspace:"IN_SUBSPACE",Global:"GLOBAL"},d={IN_SUBSPACE:"InSubspace",GLOBAL:"Global"},
|
|
12
|
+
`,l={InSubspace:"IN_SUBSPACE",Global:"GLOBAL"},d={IN_SUBSPACE:"InSubspace",GLOBAL:"Global"},y=r=>void 0===r?void 0:JSON.stringify(r),u=r=>r&&d[r.meta]?{...r,meta:d[r.meta]}:r,c=(r,t)=>{var e=r[t];if(null!==e&&!Array.isArray(e))throw Error(`Invalid Data Bank API response: expected ${t} to be an array or null`);return(e||[]).map(u)},f=({endpoint:r,spacename:t,spacekey:e})=>{var i,n=`${r}/api/graphql`,d=(0,o.P)(r),u=(i=a(function*(r,a){var o,p=yield d(n,{method:"POST",headers:{"content-type":"application/json",SPACENAME:t,SPACEKEY:e},body:JSON.stringify({query:r,variables:a})}),i=yield p.text();try{o=JSON.parse(i)}catch{if(p.ok)throw Error(`Invalid Data Bank API response (${p.status}): expected JSON`)}if(o?.errors?.length)throw Error(o.errors.map(({message:r})=>r).join("\n"));if(!p.ok){var s=Error(`Data Bank API error (${p.status}): ${i.trim()}`);throw 403===p.status&&(s.isBankAuthError=!0),s}if(!o?.data||"object"!=typeof o.data||Array.isArray(o.data))throw Error("Invalid Data Bank API response: expected a data object");return o.data}),function(r,t){return i.apply(this,arguments)});return{listProperties(){return a(function*({keyword:r,meta:t,ids:e}={}){return(0,p.jR)(t),c((yield u(`#graphql
|
|
13
13
|
query(
|
|
14
14
|
$filterUpdateHashes: [PropertyFilterUpdateHash!]
|
|
15
15
|
$filterMeta: String
|
|
@@ -21,12 +21,12 @@ 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(
|
|
24
|
+
`,{filterUpdateHashes:e?.map(r=>({propertyId:r,value:""})),filterMeta:t,filterKeyword:r})),"properties")}).apply(this,arguments)},getProperty(r){var t=this;return a(function*(){return(yield t.listProperties({ids:[r]})).find(t=>t.propertyId===r)||null})()},updateProperties:(r,t)=>a(function*(){if(!r?.length)throw Error("No properties to update.");var e=r.map(r=>{var t=r.meta||"InSubspace";return(0,p.jR)(t),{propertyId:r.propertyId,meta:l[t],definition:y(r.definition),newDefinitionFallback:y(r.newDefinitionFallback),value:y(r.value),updateNote:r.updateNote||"Updated via bricks-cli",upsert:!1!==r.upsert,tags:r.tags}});return c((yield u(`#graphql
|
|
25
25
|
mutation($properties: [PropertyInput!]!, $dontNotify: Boolean) {
|
|
26
26
|
updateProperty(properties: $properties, dontNotify: $dontNotify) { ${s} }
|
|
27
27
|
}
|
|
28
|
-
`,{properties:e,dontNotify:
|
|
28
|
+
`,{properties:e,dontNotify:t})),"updateProperty")})(),removeProperty:r=>a(function*(){var t=yield u(`#graphql
|
|
29
29
|
mutation($propertyId: String!) {
|
|
30
30
|
removeProperty(propertyId: $propertyId)
|
|
31
31
|
}
|
|
32
|
-
`,{propertyId:
|
|
32
|
+
`,{propertyId:r});if(null!==t.removeProperty&&"boolean"!=typeof t.removeProperty)throw Error("Invalid Data Bank API response: expected removeProperty to be a boolean or null");return t.removeProperty??!1})()}}}};
|