@fugood/bricks-cli 2.25.0-beta.61 → 2.25.0-beta.62
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/lib/10.js +1 -1
- package/lib/117.js +1 -1
- package/lib/209.js +112 -0
- package/lib/212.js +1 -0
- package/lib/215.js +1 -1
- package/lib/223.js +4 -4
- package/lib/247.js +1 -0
- package/lib/320.js +2 -2
- package/lib/332.js +13 -0
- package/lib/358.js +1 -0
- package/lib/370.js +1 -0
- package/lib/387.js +35 -0
- package/lib/405.js +1 -0
- package/lib/456.js +2 -2
- package/lib/486.js +1 -0
- package/lib/511.js +1 -1
- package/lib/557.js +1 -1
- package/lib/563.js +1 -1
- package/lib/583.js +22 -0
- package/lib/658.js +2 -0
- package/lib/663.js +1 -1
- package/lib/690.js +1 -0
- package/lib/708.js +8 -6
- package/lib/785.js +1 -0
- package/lib/818.js +1 -0
- package/lib/831.js +1 -0
- package/lib/907.js +872 -0
- package/lib/915.js +3 -2
- package/lib/936.js +1 -0
- package/lib/940.js +19 -1
- package/lib/index.js +98 -1142
- package/package.json +5 -5
- package/lib/3.js +0 -1
- package/lib/412.js +0 -1
package/lib/215.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __rspack_esm_id=215;export const __rspack_esm_ids=[215];export const __webpack_modules__={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),
|
|
1
|
+
export const __rspack_esm_id=215;export const __rspack_esm_ids=[215];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 o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(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),o=r(70604),n=r(78243),s=r(5523);e.exports=function(e){return i(e)||o(e)||n(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 o=r.call(e,t||"default");if("object"!=i(o))return o;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,o=r(23878);e.exports=function(e){var t=o(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),o=r(75720),n="CTOR",s="ctor@bricks.tools",u=`Co-authored-by: ${n} <${s}>`;function l(){return(l=i(function*(e){return!!(yield(0,o.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),o=i?[]:["-c",`user.name=${n}`,"-c",`user.email=${s}`],a=[];for(var p of t)a.push("-m",p);return i&&a.push("-m",u),[...o,"commit",...r,...a]})).apply(this,arguments)}},13376(e,t,r){r.d(t,{a:()=>l,p:()=>s});var i=r(99436),o=r(51455),n=".bricks/.last-pushed-commit";function s(e){return u.apply(this,arguments)}function u(){return(u=i(function*(e){try{return(yield(0,o.readFile)(`${e}/${n}`,"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,o.mkdir)(`${e}/.bricks`,{recursive:!0}),yield(0,o.writeFile)(`${e}/${n}`,t))})).apply(this,arguments)}},69070(e,t,r){r.d(t,{k:()=>s,q:()=>l});var i=r(99436),o=r(26848),n=r(1708);function s(e){return u.apply(this,arguments)}function u(){return(u=i(function*(e){if(!n.stdin.isTTY)return"";var t=(0,o.createInterface)({input:n.stdin,output:n.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,o,n=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&&(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:(o=s(function*(){var e=n(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"],o=this._env?{...process.env,...this._env}:void 0,s=(0,a.spawn)(t,r,{cwd:this._cwd,stdio:i,env:o}),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 o.apply(this,arguments)})}]),f=/\s/;function h(e,...t){var r,i,o,n,s,u=(r=[],i="",o=!1,n=()=>{o&&(r.push(i),i="",o=!1)},s=e=>{i+=e,o=!0},(e.forEach((e,r)=>{for(var i=0;i<e.length;i++){var o=e[i];f.test(o)?n():s(o)}r<t.length&&(e=>{if(null!=e){if(Array.isArray(e))return e.forEach((e,t)=>{t>0&&n(),s(String(e))});s(String(e))}})(t[r])}),n(),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,o,n=r(99436),s=r(51455),u=r(75720),l=r(69995),a=r(42208),p=r(13376),c=r(69070),d=(i=n(function*(e){try{return yield(0,s.access)(e),!0}catch{return!1}}),function(e){return i.apply(this,arguments)}),f=(o=n(function*(e){return JSON.parse((yield(0,s.readFile)(e,"utf8")))}),function(e){return o.apply(this,arguments)});function h(){return y.apply(this,arguments)}function y(){return(y=n(function*(e={}){process.env.BRICKS_RELEASE_SIGN||(process.env.BRICKS_RELEASE_SIGN="CTOR");var t,r=process.cwd(),i=e.changelogs,o=e.changelogsFile,n=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(o){if(!(yield d(o)))throw Error(`Changelogs file not found: ${o}`);k=yield(0,s.readFile)(o,"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(n){var C=`chore: release ${t||"new version"}`,j=k||"[no changelogs]";yield(0,u.sh)`cd ${r} && git add -A`;var A=yield(0,a.RP)(r,[C,j]);yield(0,u.sh)`cd ${r} && git ${A}`}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 N="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",N?"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(`${N?"Module":"App"} deployed: ${F.target?.name||_.name}`)})).apply(this,arguments)}}};
|
package/lib/223.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const __rspack_esm_id=223;export const __rspack_esm_ids=[223];export const __webpack_modules__={63322(e,r,o){o.r(r),o.d(r,{BUILTIN_ISSUE_CODES:()=>l,buildConfigDoctorReport:()=>g,getDoctorExitCode:()=>m,loadConfigForDoctor:()=>h,parseCodesOption:()=>f,renderConfigDoctorReport:()=>y,runConfigDoctor:()=>$});var t,n,
|
|
2
|
-
Valid codes: ${
|
|
3
|
-
${t} (${
|
|
4
|
-
`),
|
|
1
|
+
export const __rspack_esm_id=223;export const __rspack_esm_ids=[223];export const __webpack_modules__={63322(e,r,o){o.r(r),o.d(r,{BUILTIN_ISSUE_CODES:()=>l,buildConfigDoctorReport:()=>g,getDoctorExitCode:()=>m,loadConfigForDoctor:()=>h,parseCodesOption:()=>f,renderConfigDoctorReport:()=>y,runConfigDoctor:()=>$});var t,i,n,s=o(99436),a=o(79896),c=o(38890),p=o(56493),l=["schema-error","ref-error","calc-error","expression-error","deprecated-feature"],u={error:0,warning:1,info:2},f=e=>"string"==typeof e&&e?e.split(",").map(e=>e.trim()).filter(Boolean):null,d=e=>{if(!e)throw Error("The fetched record has no config");return"string"==typeof e?JSON.parse(e):e},h=(t=s(function*(e,r,{composed:o=!1}={}){if(a.existsSync(r))return{config:JSON.parse(a.readFileSync(r,"utf-8")),target:{type:e,source:"file",path:r}};var t=(0,p.requireAuth)();if("app"===e){var i=yield t.application({id:r,composed:o});if(!i)throw Error(`Application not found: ${r}`);return{config:d(i.config),target:{type:e,source:"remote",id:r,composed:o}}}var n=yield t.module({id:r});if(!n)throw Error(`Module not found: ${r}`);return{config:d(n.config),target:{type:e,source:"remote",id:r}}}),function(e,r){return t.apply(this,arguments)}),g=(i=s(function*(e,{type:r="app",only:o=null,ignore:t=null,checkAutomation:i=!1}={}){var n=[...l,...c.lintRuleCodes],s=[...o||[],...t||[]].filter(e=>!n.includes(e));if(s.length>0)throw Error(`Unknown rule code(s): ${s.join(", ")}
|
|
2
|
+
Valid codes: ${n.join(", ")}`);var a=e=>(!o||o.includes(e))&&(!t||!t.includes(e)),p=[],f=(0,c.checkConfig)(e,{checkCalc:!0,checkExpressions:!0,checkAutomation:i}),d=(e,r,o)=>{a(r)&&(e||[]).forEach(e=>p.push({hint:null,...o(e)}))};d(f.schema,"schema-error",e=>({severity:"error",code:"schema-error",path:e.instancePath||e.dataPath||"/",message:e.message,hint:e.params?.pattern?`pattern: ${e.params.pattern}`:null})),d(f.ref,"ref-error",e=>({severity:"error",code:"ref-error",path:e.field,message:e.message})),d(f.calc,"calc-error",e=>({severity:"error",code:"calc-error",path:e.field,message:e.message})),d(f.expression,"expression-error",e=>({severity:"error",code:"expression-error",path:e.field,message:e.message})),a("deprecated-feature")&&(0,c.checkConfigDeprecatedFeatures)(e).forEach(e=>p.push({severity:"warning",code:"deprecated-feature",path:e.id,message:e.data,hint:null}));var h=!f.valid;if(!h){var g=o?o.filter(e=>c.lintRuleCodes.includes(e)):null,m=t?t.filter(e=>c.lintRuleCodes.includes(e)):null;(!g||g.length>0)&&p.push(...(0,c.lintConfig)(e,{configType:r,only:g,ignore:m}))}p.sort((e,r)=>u[e.severity]-u[r.severity]);var v={errors:p.filter(e=>"error"===e.severity).length,warnings:p.filter(e=>"warning"===e.severity).length,infos:p.filter(e=>"info"===e.severity).length};return{ok:0===v.errors,valid:f.valid,lintSkipped:h,summary:v,issues:p}}),function(e){return i.apply(this,arguments)}),m=(e,{strict:r=!1}={})=>e.summary.errors>0||r&&e.summary.warnings>0?1:0,v=[["error","Errors"],["warning","Warnings"],["info","Info"]],y=e=>{var r=[];r.push("\nConfig Doctor Report");var o=e.target;if(o){var t="file"===o.source?`${o.type} config: ${o.path}`:`${o.type}: ${o.id}${o.composed?" (composed)":""}`;r.push(t)}if(r.push("─".repeat(60)),0===e.issues.length)return r.push("✓ No issues found"),r.join("\n");v.forEach(([o,t])=>{var i=e.issues.filter(e=>e.severity===o);0!==i.length&&(r.push(`
|
|
3
|
+
${t} (${i.length})
|
|
4
|
+
`),i.forEach((e,o)=>{r.push(` ${o+1}. [${e.code}] ${e.path||""}`),r.push(` ${e.message}`),e.hint&&r.push(` ↳ ${e.hint}`)}))}),e.lintSkipped&&r.push("\n ⚠ Lint rules skipped — fix schema/reference errors first"),r.push("\n"+"─".repeat(60));var i=e.summary,n=i.errors,s=i.warnings,a=i.infos,c=[];return n>0&&c.push(`✗ ${n} error(s)`),s>0&&c.push(`⚠ ${s} warning(s)`),a>0&&c.push(`ℹ ${a} info`),r.push(c.join(" ")),r.join("\n")},$=(n=s(function*(e,r,o){var t=f(o.only),i=f(o.ignore),n=yield h(e,r,{composed:!!o.composed}),s=n.config,a=n.target,c=yield g(s,{type:e,only:t,ignore:i,checkAutomation:!!o.validateAutomation});return c.target=a,{report:c,exitCode:m(c,{strict:!!o.strict})}}),function(e,r,o){return n.apply(this,arguments)})}};
|