create-bc-app 1.1.6 → 1.1.7
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 +12 -9
- package/dist/index.mjs +1 -1
- package/package.json +40 -39
- package/template-monorepo/.changeset/README.md +8 -0
- package/template-monorepo/.changeset/config.json +11 -0
- package/template-monorepo/.husky/pre-commit +1 -0
- package/template-monorepo/node_modules/.pnpm/@esbuild+win32-x64@0.21.5/node_modules/@esbuild/win32-x64/esbuild.exe +0 -0
- package/template-monorepo/package.json +46 -39
- package/template-monorepo/packages/a/package.json +15 -0
- package/template-monorepo/packages/b/package.json +15 -0
- package/template-monorepo/pnpm-lock.yaml +4522 -0
- package/template-monorepo/pnpm-workspace.yaml +2 -0
- package/template-monorepo/vite.config.ts +10 -22
- package/template-mvvm/package.json +39 -0
- package/template-mvvm/sdk/model/index.ts +0 -0
- package/template-mvvm/src/utils/index.ts +0 -0
- package/template-mvvm/vite.config.ts +27 -0
- /package/template-monorepo/{sdk/data-server → packages/a}/index.ts +0 -0
- /package/template-monorepo/{sdk/model → packages/b}/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/.eslintignore +0 -0
- /package/{template-monorepo → template-mvvm}/.eslintrc.cjs +0 -0
- /package/{template-monorepo → template-mvvm}/.gitlab-ci.yml +0 -0
- /package/{template-monorepo → template-mvvm}/README.md +0 -0
- /package/{template-monorepo → template-mvvm}/build_entry/extract.js +0 -0
- /package/{template-monorepo → template-mvvm}/index.html +0 -0
- /package/{template-monorepo → template-mvvm}/packages/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/public/group.svg +0 -0
- /package/{template-monorepo → template-mvvm}/sdk/data-server/api/index.ts +0 -0
- /package/{template-monorepo/src/utils → template-mvvm/sdk/data-server}/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/App.vue +0 -0
- /package/{template-monorepo → template-mvvm}/src/assets/bochui.svg +0 -0
- /package/{template-monorepo → template-mvvm}/src/assets/css/common.less +0 -0
- /package/{template-monorepo → template-mvvm}/src/assets/css/style.css +0 -0
- /package/{template-monorepo → template-mvvm}/src/assets/group.svg +0 -0
- /package/{template-monorepo → template-mvvm}/src/configData/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/configData/mainToolsBar.json +0 -0
- /package/{template-monorepo → template-mvvm}/src/constants/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/hooks/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/i18n/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/i18n/langs/page.js +0 -0
- /package/{template-monorepo → template-mvvm}/src/i18n/langs/zh_Hans.json +0 -0
- /package/{template-monorepo → template-mvvm}/src/main.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/stores/appState.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/stores/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/types/index.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/utils/filter.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/utils/message.ts +0 -0
- /package/{template-monorepo → template-mvvm}/src/views/Home.vue +0 -0
- /package/{template-monorepo → template-mvvm}/src/vite-env.d.ts +0 -0
- /package/{template-monorepo → template-mvvm}/tsconfig.json +0 -0
- /package/{template-monorepo → template-mvvm}/tsconfig.node.json +0 -0
- /package/{template-monorepo → template-mvvm}/window.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
# 内部项目脚手架
|
|
2
2
|
|
|
3
3
|
## 用法:
|
|
4
|
+
|
|
4
5
|
```js
|
|
5
6
|
npm create bc-app
|
|
6
7
|
```
|
|
7
8
|
|
|
8
9
|
## 用途:
|
|
10
|
+
|
|
9
11
|
当你需要快速搭建一个
|
|
10
|
-
npm库、vue+ts、vue+js、vuepress、vitepress项目时可以使用它
|
|
12
|
+
npm 库、vue+ts、vue+js、vuepress、vitepress 项目时可以使用它
|
|
11
13
|
|
|
12
14
|
## 包含:
|
|
13
|
-
- vue3 + ts + Vite
|
|
14
|
-
- vue3 + js + Vite
|
|
15
|
-
- protocut
|
|
16
|
-
- laserlib
|
|
17
|
-
- vuepress
|
|
18
|
-
- vitepress
|
|
19
|
-
- 单元测试
|
|
20
|
-
- eslint代码检查
|
|
21
15
|
|
|
16
|
+
- vue3 + ts + Vite
|
|
17
|
+
- vue3 + js + Vite
|
|
18
|
+
- protocut
|
|
19
|
+
- laserlib
|
|
20
|
+
- vuepress
|
|
21
|
+
- vitepress
|
|
22
|
+
- monorepo
|
|
23
|
+
- 单元测试
|
|
24
|
+
- eslint 代码检查
|
package/dist/index.mjs
CHANGED
|
@@ -67,5 +67,5 @@ Expecting `+I.join(", ")+", got '"+(this.terminals_[w]||w)+"'":ie="Parse error o
|
|
|
67
67
|
return undefined
|
|
68
68
|
}
|
|
69
69
|
`.trim()},blockValue:function(a){var n=this.aliasable("container.hooks.blockHelperMissing"),m=[this.contextName(0)];this.setupHelperArgs(a,0,m);var v=this.popStack();m.splice(1,0,v),this.push(this.source.functionCall(n,"call",m))},ambiguousBlockValue:function(){var a=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs("",0,n,!0),this.flushInline();var m=this.topStack();n.splice(1,0,m),this.pushSource(["if (!",this.lastHelper,") { ",m," = ",this.source.functionCall(a,"call",n),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(n){return[" != null ? ",n,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,n,m,v){var S=0;!v&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(a[S++])):this.pushContext(),this.resolvePath("context",a,S,n,m)},lookupBlockParam:function(a,n){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",n,1)},lookupData:function(a,n,m){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",n,0,!0,m)},resolvePath:function(a,n,m,v,S){var _=this;if(this.options.strict||this.options.assumeObjects){this.push(d(this.options.strict&&S,this,n,m,a));return}for(var w=n.length;m<w;m++)this.replaceStack(function(g){var y=_.nameLookup(g,n[m],a);return v?[" && ",y]:[" != null ? ",y," : ",g]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,n){this.pushContext(),this.pushString(n),n!=="SubExpression"&&(typeof a=="string"?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){a!=null?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,n){var m=this.nameLookup("decorators",n,"decorator"),v=this.setupHelperArgs(n,a);this.decorators.push(["fn = ",this.decorators.functionCall(m,"",["fn","props","container",v])," || fn;"])},invokeHelper:function(a,n,m){var v=this.popStack(),S=this.setupHelper(a,n),_=[];m&&_.push(S.name),_.push(v),this.options.strict||_.push(this.aliasable("container.hooks.helperMissing"));var w=["(",this.itemsSeparatedBy(_,"||"),")"],g=this.source.functionCall(w,"call",S.callParams);this.push(g)},itemsSeparatedBy:function(a,n){var m=[];m.push(a[0]);for(var v=1;v<a.length;v++)m.push(n,a[v]);return m},invokeKnownHelper:function(a,n){var m=this.setupHelper(a,n);this.push(this.source.functionCall(m.name,"call",m.callParams))},invokeAmbiguous:function(a,n){this.useRegister("helper");var m=this.popStack();this.emptyHash();var v=this.setupHelper(0,a,n),S=this.lastHelper=this.nameLookup("helpers",a,"helper"),_=["(","(helper = ",S," || ",m,")"];this.options.strict||(_[0]="(helper = ",_.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",_,v.paramsInit?["),(",v.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",v.callParams)," : helper))"])},invokePartial:function(a,n,m){var v=[],S=this.setupParams(n,1,v);a&&(n=this.popStack(),delete S.name),m&&(S.indent=JSON.stringify(m)),S.helpers="helpers",S.partials="partials",S.decorators="container.decorators",a?v.unshift(n):v.unshift(this.nameLookup("partials",n,"partial")),this.options.compat&&(S.depths="depths"),S=this.objectLiteral(S),v.push(S),this.push(this.source.functionCall("container.invokePartial","",v))},assignToHash:function(a){var n=this.popStack(),m=void 0,v=void 0,S=void 0;this.trackIds&&(S=this.popStack()),this.stringParams&&(v=this.popStack(),m=this.popStack());var _=this.hash;m&&(_.contexts[a]=m),v&&(_.types[a]=v),S&&(_.ids[a]=S),_.values[a]=n},pushId:function(a,n,m){a==="BlockParam"?this.pushStackLiteral("blockParams["+n[0]+"].path["+n[1]+"]"+(m?" + "+JSON.stringify("."+m):"")):a==="PathExpression"?this.pushString(n):a==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:u,compileChildren:function(a,n){for(var m=a.children,v=void 0,S=void 0,_=0,w=m.length;_<w;_++){v=m[_],S=new this.compiler;var g=this.matchExistingProgram(v);if(g==null){this.context.programs.push("");var y=this.context.programs.length;v.index=y,v.name="program"+y,this.context.programs[y]=S.compile(v,n,this.context,!this.precompile),this.context.decorators[y]=S.decorators,this.context.environments[y]=v,this.useDepths=this.useDepths||S.useDepths,this.useBlockParams=this.useBlockParams||S.useBlockParams,v.useDepths=this.useDepths,v.useBlockParams=this.useBlockParams}else v.index=g.index,v.name="program"+g.index,this.useDepths=this.useDepths||g.useDepths,this.useBlockParams=this.useBlockParams||g.useBlockParams}},matchExistingProgram:function(a){for(var n=0,m=this.context.environments.length;n<m;n++){var v=this.context.environments[n];if(v&&v.equals(a))return v}},programExpression:function(a){var n=this.environment.children[a],m=[n.index,"data",n.blockParams];return(this.useBlockParams||this.useDepths)&&m.push("blockParams"),this.useDepths&&m.push("depths"),"container.program("+m.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof c||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var n=["("],m=void 0,v=void 0,S=void 0;if(!this.isInline())throw new f.default("replaceStack on non-inline");var _=this.popStack(!0);if(_ instanceof c)m=[_.value],n=["(",m],S=!0;else{v=!0;var w=this.incrStack();n=["((",this.push(w)," = ",_,")"],m=this.topStack()}var g=a.call(this,m);S||this.popStack(),v&&this.stackSlot--,this.push(n.concat(g,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var n=0,m=a.length;n<m;n++){var v=a[n];if(v instanceof c)this.compileStack.push(v);else{var S=this.incrStack();this.pushSource([S," = ",v,";"]),this.compileStack.push(S)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var n=this.isInline(),m=(n?this.inlineStack:this.compileStack).pop();if(!a&&m instanceof c)return m.value;if(!n){if(!this.stackSlot)throw new f.default("Invalid stack pop");this.stackSlot--}return m},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,n=a[a.length-1];return n instanceof c?n.value:n},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var n=this.aliases[a];return n?(n.referenceCount++,n):(n=this.aliases[a]=this.source.wrap(a),n.aliasable=!0,n.referenceCount=1,n)},setupHelper:function(a,n,m){var v=[],S=this.setupHelperArgs(n,a,v,m),_=this.nameLookup("helpers",n,"helper"),w=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:v,paramsInit:S,name:_,callParams:[w].concat(v)}},setupParams:function(a,n,m){var v={},S=[],_=[],w=[],g=!m,y=void 0;g&&(m=[]),v.name=this.quotedString(a),v.hash=this.popStack(),this.trackIds&&(v.hashIds=this.popStack()),this.stringParams&&(v.hashTypes=this.popStack(),v.hashContexts=this.popStack());var P=this.popStack(),b=this.popStack();(b||P)&&(v.fn=b||"container.noop",v.inverse=P||"container.noop");for(var C=n;C--;)y=this.popStack(),m[C]=y,this.trackIds&&(w[C]=this.popStack()),this.stringParams&&(_[C]=this.popStack(),S[C]=this.popStack());return g&&(v.args=this.source.generateArray(m)),this.trackIds&&(v.ids=this.source.generateArray(w)),this.stringParams&&(v.types=this.source.generateArray(_),v.contexts=this.source.generateArray(S)),this.options.data&&(v.data="data"),this.useBlockParams&&(v.blockParams="blockParams"),v},setupHelperArgs:function(a,n,m,v){var S=this.setupParams(a,n,m);return S.loc=JSON.stringify(this.source.currentLocation),S=this.objectLiteral(S),v?(this.useRegister("options"),m.push("options"),["options=",S]):m?(m.push(S),""):S}},function(){for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),a=u.RESERVED_WORDS={},n=0,m=i.length;n<m;n++)a[i[n]]=!0}(),u.isValidJavaScriptVariableName=function(i){return!u.RESERVED_WORDS[i]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(i)};function d(i,a,n,m,v){var S=a.popStack(),_=n.length;for(i&&_--;m<_;m++)S=a.nameLookup(S,n[m],v);return i?[a.aliasable("container.strict"),"(",S,", ",a.quotedString(n[m]),", ",JSON.stringify(a.source.currentLocation)," )"]:S}e.default=u,t.exports=e.default})(Mt,Mt.exports);var La=Mt.exports;(function(t,e){e.__esModule=!0;function r(_){return _&&_.__esModule?_:{default:_}}var s=jo,p=r(s),f=Ar,l=r(f),h=ge,o=me,c=La,u=r(c),d=Pt,i=r(d),a=Or,n=r(a),m=p.default.create;function v(){var _=m();return _.compile=function(w,g){return o.compile(w,g,_)},_.precompile=function(w,g){return o.precompile(w,g,_)},_.AST=l.default,_.Compiler=o.Compiler,_.JavaScriptCompiler=u.default,_.Parser=h.parser,_.parse=h.parse,_.parseWithoutProcessing=h.parseWithoutProcessing,_}var S=v();S.create=v,n.default(S),S.Visitor=i.default,S.default=S,e.default=S,t.exports=e.default})(Qe,Qe.exports);var Oa=Qe.exports,De={};De.__esModule=!0,De.print=Na,De.PrintVisitor=A;function Aa(t){return t&&t.__esModule?t:{default:t}}var Ia=Pt,Ra=Aa(Ia);function Na(t){return new A().accept(t)}function A(){this.padding=0}A.prototype=new Ra.default,A.prototype.pad=function(t){for(var e="",r=0,s=this.padding;r<s;r++)e+=" ";return e+=t+`
|
|
70
|
-
`,e},A.prototype.Program=function(t){var e="",r=t.body,s=void 0,p=void 0;if(t.blockParams){var f="BLOCK PARAMS: [";for(s=0,p=t.blockParams.length;s<p;s++)f+=" "+t.blockParams[s];f+=" ]",e+=this.pad(f)}for(s=0,p=r.length;s<p;s++)e+=this.accept(r[s]);return this.padding--,e},A.prototype.MustacheStatement=function(t){return this.pad("{{ "+this.SubExpression(t)+" }}")},A.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.SubExpression(t)+" }}")},A.prototype.BlockStatement=A.prototype.DecoratorBlock=function(t){var e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e},A.prototype.PartialStatement=function(t){var e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")},A.prototype.PartialBlockStatement=function(t){var e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")},A.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")},A.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")},A.prototype.SubExpression=function(t){for(var e=t.params,r=[],s=void 0,p=0,f=e.length;p<f;p++)r.push(this.accept(e[p]));return e="["+r.join(", ")+"]",s=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+" "+e+s},A.prototype.PathExpression=function(t){var e=t.parts.join("/");return(t.data?"@":"")+"PATH:"+e},A.prototype.StringLiteral=function(t){return'"'+t.value+'"'},A.prototype.NumberLiteral=function(t){return"NUMBER{"+t.value+"}"},A.prototype.BooleanLiteral=function(t){return"BOOLEAN{"+t.value+"}"},A.prototype.UndefinedLiteral=function(){return"UNDEFINED"},A.prototype.NullLiteral=function(){return"NULL"},A.prototype.Hash=function(t){for(var e=t.pairs,r=[],s=0,p=e.length;s<p;s++)r.push(this.accept(e[s]));return"HASH{"+r.join(", ")+"}"},A.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)};var Te=Oa.default,Qr=De;Te.PrintVisitor=Qr.PrintVisitor,Te.print=Qr.print;var Da=Te;function Zr(t,e){var r=R,s=r.readFileSync(e,"utf8");t.exports=Te.compile(s)}typeof Me<"u"&&Me.extensions&&(Me.extensions[".handlebars"]=Zr,Me.extensions[".hbs"]=Zr);const Xr=He(Da),Ta={protocut:"template-protocut",laserlib:"template-laserlib",monorepo:"template-monorepo"},Bt=process.cwd(),ei=Mn(process.argv.slice(2),{default:{help:!1},alias:{h:"help",t:"template"},string:["_"]}),ti={_gitignore:".gitignore"},ri={"protocut-2d":{"@fsdev/cadui-2d":"^0.0.2","@fsdev/cutui-2d":"^0.0.2","@fsdev/webcad-js":"1.1.0"},"protocut-3d":{"@fsdev/cutui-3d":"^0.0.2","@fsdev/webcad-platform":"1.1.0"}},ii="fsapp-project",Ba=ni(ei._[0]);let Z=Ba||ii;const Be=()=>Z==="."?N.basename(N.resolve()):Z;async function Ha(){return fr.override({overwrite:ei.overwrite}),await fr([{type:"text",name:"projectName",message:_r("Project Name:"),onState:t=>{Z=ni(t.value)||ii}},{type:()=>!R.existsSync(Z)||qa(Z)?null:"select",name:"overwrite",message:()=>Z==="."?"Current directory":`Target directory ${Z}is not empty. Please choose how to proceed:`,initial:0,choices:[{title:"Remove existing files and continue",value:"yes"},{title:"Cancel operation",value:"no"},{title:"Ignore files and continue",value:"ignore"}]},{type:(t,{overwrite:e})=>{if(e==="no")throw new Error(yr("\u2716")+"Operation cancelled");return null},name:"overwriteChecker"},{type:oi(Be())?null:"text",name:"packageName",message:_r("Package name:"),initial:()=>$a(Be()),validate:t=>oi(t)||"Invalid package.json name"},{type:"select",name:"template",message:"Select a template",choices:[{title:"Vue",value:"vue"},{title:"Docs",value:"docs"},{title:"ProtoCut",value:"protocut"},{title:"Lib",value:"laserlib"},{title:"Monorepo",value:"monorepo"}]},{type:(t,{template:e})=>["laserlib","monorepo"].includes(e)?null:"select",name:"variant",message:"Select a templateUse arrow-keys. Return to submit",choices:t=>t==="vue"?[{title:"TypeScript",value:"ts"},{title:"JavaScript",value:"js"}]:t==="docs"?[{title:"VitePress",value:"vitepress"},{title:"VuePress",value:"vuepress"}]:t==="protocut"?[{title:"2D",value:"2d"},{title:"3D",value:"3d"}]:[]}],{onCancel:()=>{throw new Error(yr("\u2716")+" Operation cancelled")}})}async function Fa(){const{overwrite:t,template:e,packageName:r,variant:s}=await Ha(),p=N.join(Bt,Z);t==="yes"?Ga(p):R.existsSync(p)||R.mkdirSync(p,{recursive:!0});const f=N.resolve(ai(import.meta.url),"../..",Ta[e]||`template-${e}-${s}`),l=R.readdirSync(f);function h(d,i){const a=N.join(p,ti[d]??d);i?R.writeFileSync(a,i):si(N.join(f,d),a)}function o(d){const i=N.join(p,ti[d]??d);return new Promise((a,n)=>{R.readFile(i,"utf-8",(m,v)=>{m&&(console.error("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25",m),n(m)),a(v)})})}for(const d of l.filter(i=>i!=="package.json"&&!i.includes("template")))h(d);const c=JSON.parse(R.readFileSync(N.join(f,"package.json"),"utf-8"));if(c.name=r||Be(),ri[`${e}-${s}`]&&Object.assign(c.dependencies,ri[`${e}-${s}`]),h("package.json",JSON.stringify(c,null,2)+`
|
|
70
|
+
`,e},A.prototype.Program=function(t){var e="",r=t.body,s=void 0,p=void 0;if(t.blockParams){var f="BLOCK PARAMS: [";for(s=0,p=t.blockParams.length;s<p;s++)f+=" "+t.blockParams[s];f+=" ]",e+=this.pad(f)}for(s=0,p=r.length;s<p;s++)e+=this.accept(r[s]);return this.padding--,e},A.prototype.MustacheStatement=function(t){return this.pad("{{ "+this.SubExpression(t)+" }}")},A.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.SubExpression(t)+" }}")},A.prototype.BlockStatement=A.prototype.DecoratorBlock=function(t){var e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e},A.prototype.PartialStatement=function(t){var e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")},A.prototype.PartialBlockStatement=function(t){var e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")},A.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")},A.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")},A.prototype.SubExpression=function(t){for(var e=t.params,r=[],s=void 0,p=0,f=e.length;p<f;p++)r.push(this.accept(e[p]));return e="["+r.join(", ")+"]",s=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+" "+e+s},A.prototype.PathExpression=function(t){var e=t.parts.join("/");return(t.data?"@":"")+"PATH:"+e},A.prototype.StringLiteral=function(t){return'"'+t.value+'"'},A.prototype.NumberLiteral=function(t){return"NUMBER{"+t.value+"}"},A.prototype.BooleanLiteral=function(t){return"BOOLEAN{"+t.value+"}"},A.prototype.UndefinedLiteral=function(){return"UNDEFINED"},A.prototype.NullLiteral=function(){return"NULL"},A.prototype.Hash=function(t){for(var e=t.pairs,r=[],s=0,p=e.length;s<p;s++)r.push(this.accept(e[s]));return"HASH{"+r.join(", ")+"}"},A.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)};var Te=Oa.default,Qr=De;Te.PrintVisitor=Qr.PrintVisitor,Te.print=Qr.print;var Da=Te;function Zr(t,e){var r=R,s=r.readFileSync(e,"utf8");t.exports=Te.compile(s)}typeof Me<"u"&&Me.extensions&&(Me.extensions[".handlebars"]=Zr,Me.extensions[".hbs"]=Zr);const Xr=He(Da),Ta={protocut:"template-protocut",laserlib:"template-laserlib",mvvm:"template-mvvm",monorepo:"template-monorepo"},Bt=process.cwd(),ei=Mn(process.argv.slice(2),{default:{help:!1},alias:{h:"help",t:"template"},string:["_"]}),ti={_gitignore:".gitignore"},ri={"protocut-2d":{"@fsdev/cadui-2d":"^0.0.2","@fsdev/cutui-2d":"^0.0.2","@fsdev/webcad-js":"1.1.0"},"protocut-3d":{"@fsdev/cutui-3d":"^0.0.2","@fsdev/webcad-platform":"1.1.0"}},ii="fsapp-project",Ba=ni(ei._[0]);let Z=Ba||ii;const Be=()=>Z==="."?N.basename(N.resolve()):Z;async function Ha(){return fr.override({overwrite:ei.overwrite}),await fr([{type:"text",name:"projectName",message:_r("Project Name:"),onState:t=>{Z=ni(t.value)||ii}},{type:()=>!R.existsSync(Z)||qa(Z)?null:"select",name:"overwrite",message:()=>Z==="."?"Current directory":`Target directory ${Z}is not empty. Please choose how to proceed:`,initial:0,choices:[{title:"Remove existing files and continue",value:"yes"},{title:"Cancel operation",value:"no"},{title:"Ignore files and continue",value:"ignore"}]},{type:(t,{overwrite:e})=>{if(e==="no")throw new Error(yr("\u2716")+"Operation cancelled");return null},name:"overwriteChecker"},{type:oi(Be())?null:"text",name:"packageName",message:_r("Package name:"),initial:()=>$a(Be()),validate:t=>oi(t)||"Invalid package.json name"},{type:"select",name:"template",message:"Select a template",choices:[{title:"Vue",value:"vue"},{title:"Docs",value:"docs"},{title:"ProtoCut",value:"protocut"},{title:"Lib",value:"laserlib"},{title:"Monorepo",value:"monorepo"},{title:"Mvvm",value:"mvvm"}]},{type:(t,{template:e})=>["laserlib","monorepo","mvvm"].includes(e)?null:"select",name:"variant",message:"Select a templateUse arrow-keys. Return to submit",choices:t=>t==="vue"?[{title:"TypeScript",value:"ts"},{title:"JavaScript",value:"js"}]:t==="docs"?[{title:"VitePress",value:"vitepress"},{title:"VuePress",value:"vuepress"}]:t==="protocut"?[{title:"2D",value:"2d"},{title:"3D",value:"3d"}]:[]}],{onCancel:()=>{throw new Error(yr("\u2716")+" Operation cancelled")}})}async function Fa(){const{overwrite:t,template:e,packageName:r,variant:s}=await Ha(),p=N.join(Bt,Z);t==="yes"?Ga(p):R.existsSync(p)||R.mkdirSync(p,{recursive:!0});const f=N.resolve(ai(import.meta.url),"../..",Ta[e]||`template-${e}-${s}`),l=R.readdirSync(f);function h(d,i){const a=N.join(p,ti[d]??d);i?R.writeFileSync(a,i):si(N.join(f,d),a)}function o(d){const i=N.join(p,ti[d]??d);return new Promise((a,n)=>{R.readFile(i,"utf-8",(m,v)=>{m&&(console.error("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25",m),n(m)),a(v)})})}for(const d of l.filter(i=>i!=="package.json"&&!i.includes("template")))h(d);const c=JSON.parse(R.readFileSync(N.join(f,"package.json"),"utf-8"));if(c.name=r||Be(),ri[`${e}-${s}`]&&Object.assign(c.dependencies,ri[`${e}-${s}`]),h("package.json",JSON.stringify(c,null,2)+`
|
|
71
71
|
`),e==="protocut"){const d=s==="2d";let i=R.readFileSync(N.join(f,"template/Home.handlebars"),"utf-8"),a=Xr.compile(i)({is2D:d});h("src/views/Home.vue",a),i=R.readFileSync(N.join(f,"template/main.handlebars"),"utf-8"),a=Xr.compile(i)({is2D:d}),h("src/main.ts",a)}if(e==="laserlib"){const d=await o("/data/message/process.ts");if(d){const i=d.replace(/project-name-/g,Be());h("data/message/process.ts",i)}}const u=N.relative(Bt,p);console.log("Done. Now run:"),p!==Bt&&console.log(`cd ${u.includes(" ")?`"${u}"`:u}`),e==="docs"?(console.log(" npm install"),console.log(" npm run docs:dev")):(console.log(" npm install"),console.log(" npm run dev"))}function si(t,e){R.statSync(t).isDirectory()?Va(t,e):R.copyFileSync(t,e)}function Va(t,e){R.mkdirSync(e,{recursive:!0});for(const r of R.readdirSync(t)){const s=N.resolve(t,r),p=N.resolve(e,r);si(s,p)}}function qa(t){const e=R.readdirSync(t);return e.length===0||e.length===1&&e[0]===".git"}function ni(t){return t?.trim().replace(/\/+$/g,"")}function oi(t){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(t)}function $a(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ga(t){if(R.existsSync(t))for(const e of R.readdirSync(t))e!==".git"&&R.rmSync(N.resolve(t,e),{recursive:!0,force:!0})}Fa().catch(console.error);
|
package/package.json
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "create-bc-app",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"bin": "index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "unbuild"
|
|
9
|
-
},
|
|
10
|
-
"author": "wbb",
|
|
11
|
-
"license": "ISC",
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@types/minimist": "^1.2.5",
|
|
14
|
-
"@types/prompts": "^2.4.9",
|
|
15
|
-
"cross-spawn": "^7.0.3",
|
|
16
|
-
"handlebars": "^4.7.8",
|
|
17
|
-
"kolorist": "^1.8.0",
|
|
18
|
-
"minimist": "^1.2.8",
|
|
19
|
-
"prompts": "^2.4.2",
|
|
20
|
-
"typescript": "^5.5.4",
|
|
21
|
-
"unbuild": "^2.0.0"
|
|
22
|
-
},
|
|
23
|
-
"publishConfig": {
|
|
24
|
-
"registry": "https://registry.npmjs.org"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"template-docs-vitepress",
|
|
28
|
-
"template-docs-vuepress",
|
|
29
|
-
"template-laserlib",
|
|
30
|
-
"template-protocut",
|
|
31
|
-
"template-vue-js",
|
|
32
|
-
"template-vue-ts",
|
|
33
|
-
"template-monorepo",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "create-bc-app",
|
|
3
|
+
"version": "1.1.7",
|
|
4
|
+
"description": "",
|
|
5
|
+
"bin": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rimraf dist && unbuild"
|
|
9
|
+
},
|
|
10
|
+
"author": "wbb",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@types/minimist": "^1.2.5",
|
|
14
|
+
"@types/prompts": "^2.4.9",
|
|
15
|
+
"cross-spawn": "^7.0.3",
|
|
16
|
+
"handlebars": "^4.7.8",
|
|
17
|
+
"kolorist": "^1.8.0",
|
|
18
|
+
"minimist": "^1.2.8",
|
|
19
|
+
"prompts": "^2.4.2",
|
|
20
|
+
"typescript": "^5.5.4",
|
|
21
|
+
"unbuild": "^2.0.0"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"registry": "https://registry.npmjs.org"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"template-docs-vitepress",
|
|
28
|
+
"template-docs-vuepress",
|
|
29
|
+
"template-laserlib",
|
|
30
|
+
"template-protocut",
|
|
31
|
+
"template-vue-js",
|
|
32
|
+
"template-vue-ts",
|
|
33
|
+
"template-monorepo",
|
|
34
|
+
"template-mvvm",
|
|
35
|
+
"index.js",
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": "^18.0.0"
|
|
40
|
+
}
|
|
40
41
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
|
4
|
+
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
|
5
|
+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
|
6
|
+
|
|
7
|
+
We have a quick list of common questions to get you started engaging with this project in
|
|
8
|
+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@3.0.4/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"fixed": [],
|
|
6
|
+
"linked": [],
|
|
7
|
+
"access": "restricted",
|
|
8
|
+
"baseBranch": "main",
|
|
9
|
+
"updateInternalDependencies": "patch",
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pnpm test
|
|
Binary file
|
|
@@ -1,39 +1,46 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "monorepo",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build:test": "vue-tsc && vite build --mode test",
|
|
9
|
+
"build:prod": "vue-tsc && vite build --mode prod",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.cjs,.mjs --ignore-path .gitignore",
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"check-changeset": "git show --name-only --oneline HEAD | findstr /R \\.changeset/ || (echo 'Error: No changeset detected!' && exit 1)",
|
|
14
|
+
"test:ui": "vitest --ui",
|
|
15
|
+
"commit": "git-cz",
|
|
16
|
+
"prepare": "husky"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"vue": "^3.5.12"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
23
|
+
"@changesets/cli": "^2.27.9",
|
|
24
|
+
"@rushstack/eslint-patch": "^1.10.4",
|
|
25
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
26
|
+
"@vitejs/plugin-vue": "^5.1.4",
|
|
27
|
+
"@vitest/ui": "^1.6.0",
|
|
28
|
+
"@vue/test-utils": "^2.4.6",
|
|
29
|
+
"commitizen": "^4.3.1",
|
|
30
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
31
|
+
"eslint": "^9.14.0",
|
|
32
|
+
"eslint-plugin-vue": "^9.30.0",
|
|
33
|
+
"happy-dom": "^14.12.3",
|
|
34
|
+
"husky": "^9.1.6",
|
|
35
|
+
"less": "^4.2.0",
|
|
36
|
+
"typescript": "^5.6.3",
|
|
37
|
+
"vite": "^5.4.10",
|
|
38
|
+
"vitest": "^1.6.0",
|
|
39
|
+
"vue-tsc": "^2.1.10"
|
|
40
|
+
},
|
|
41
|
+
"config": {
|
|
42
|
+
"commitizen": {
|
|
43
|
+
"path": "cz-conventional-changelog"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fsdev/a",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build:test": "vue-tsc && vite build --mode test",
|
|
8
|
+
"build:prod": "vue-tsc && vite build --mode prod"
|
|
9
|
+
},
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "http://nexus.fscut.com/repository/npm-dev/"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fsdev/b",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build:test": "vue-tsc && vite build --mode test",
|
|
8
|
+
"build:prod": "vue-tsc && vite build --mode prod"
|
|
9
|
+
},
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "http://nexus.fscut.com/repository/npm-dev/"
|
|
14
|
+
}
|
|
15
|
+
}
|