create-bc-app 1.1.6 → 1.1.8
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 +42 -40
- package/template-monorepo/.eslintrc.cjs +1 -11
- package/template-monorepo/.vscode/settings.json +23 -0
- package/template-monorepo/README.md +68 -31
- package/template-monorepo/apps/App-A/index.html +13 -0
- package/template-monorepo/apps/App-A/package.json +19 -0
- package/template-monorepo/apps/App-A/src/App.vue +8 -0
- package/template-monorepo/apps/App-A/src/main.ts +12 -0
- package/template-monorepo/apps/App-A/tsconfig.json +22 -0
- package/template-monorepo/apps/App-A/tsconfig.node.json +11 -0
- package/template-monorepo/apps/App-A/vite.config.ts +48 -0
- package/template-monorepo/config/build.config.ts +22 -0
- package/template-monorepo/config/resolve.config.ts +12 -0
- package/template-monorepo/index.html +11 -14
- package/template-monorepo/package.json +25 -16
- package/template-monorepo/packages/PKG-A/index.ts +3 -0
- package/template-monorepo/packages/PKG-A/package.json +22 -0
- package/template-monorepo/packages/PKG-A/src/test.ts +1 -0
- package/template-monorepo/packages/PKG-A/tsconfig.json +15 -0
- package/template-monorepo/packages/PKG-A/vite.config.ts +22 -0
- package/template-monorepo/packages/PKG-B/index.ts +4 -0
- package/template-monorepo/packages/PKG-B/package.json +25 -0
- package/template-monorepo/packages/PKG-B/src/test.ts +1 -0
- package/template-monorepo/packages/PKG-B/tsconfig.json +15 -0
- package/template-monorepo/packages/PKG-B/vite.config.ts +22 -0
- package/template-monorepo/pnpm-workspace.yaml +5 -0
- package/template-monorepo/tsconfig.json +16 -38
- package/template-monorepo/vite-env.d.ts +6 -0
- package/template-monorepo/vite.config.ts +1 -27
- package/template-mvvm/.eslintrc.cjs +211 -0
- package/template-mvvm/README.md +35 -0
- package/template-mvvm/index.html +16 -0
- package/template-mvvm/package.json +39 -0
- package/template-mvvm/src/assets/group.svg +3 -0
- package/template-mvvm/src/utils/index.ts +0 -0
- package/template-mvvm/tsconfig.json +69 -0
- package/template-mvvm/tsconfig.node.json +11 -0
- package/template-mvvm/vite.config.ts +27 -0
- /package/template-monorepo/{public → apps/App-A/public}/group.svg +0 -0
- /package/template-monorepo/{sdk/data-server/index.ts → apps/App-A/src/style.css} +0 -0
- /package/{template-monorepo → template-mvvm}/.eslintignore +0 -0
- /package/{template-monorepo → template-mvvm}/.gitlab-ci.yml +0 -0
- /package/{template-monorepo → template-mvvm}/build_entry/extract.js +0 -0
- /package/{template-monorepo → template-mvvm}/packages/index.ts +0 -0
- /package/{template-monorepo/src/assets → template-mvvm/public}/group.svg +0 -0
- /package/{template-monorepo → template-mvvm}/sdk/data-server/api/index.ts +0 -0
- /package/{template-monorepo/sdk/model → template-mvvm/sdk/data-server}/index.ts +0 -0
- /package/{template-monorepo/src/utils → template-mvvm/sdk/model}/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/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}/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,42 @@
|
|
|
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
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"template-docs-
|
|
29
|
-
"template-
|
|
30
|
-
"template-
|
|
31
|
-
"template-
|
|
32
|
-
"template-vue-
|
|
33
|
-
"template-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "create-bc-app",
|
|
3
|
+
"version": "1.1.8",
|
|
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
|
+
"rimraf": "^5.0.10",
|
|
21
|
+
"typescript": "^5.5.4",
|
|
22
|
+
"unbuild": "^2.0.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"registry": "https://registry.npmjs.org"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"template-docs-vitepress",
|
|
29
|
+
"template-docs-vuepress",
|
|
30
|
+
"template-laserlib",
|
|
31
|
+
"template-protocut",
|
|
32
|
+
"template-vue-js",
|
|
33
|
+
"template-vue-ts",
|
|
34
|
+
"template-monorepo",
|
|
35
|
+
"template-mvvm",
|
|
36
|
+
"index.js",
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": "^18.0.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -10,7 +10,6 @@ module.exports = {
|
|
|
10
10
|
'plugin:@typescript-eslint/recommended',
|
|
11
11
|
'eslint:recommended'
|
|
12
12
|
],
|
|
13
|
-
ignorePatterns: ['sdk/'],
|
|
14
13
|
globals: {
|
|
15
14
|
'process': true
|
|
16
15
|
},
|
|
@@ -23,13 +22,6 @@ module.exports = {
|
|
|
23
22
|
'@typescript-eslint/no-unused-vars': 'error',
|
|
24
23
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
25
24
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
26
|
-
'@typescript-eslint/type-annotation-spacing': [
|
|
27
|
-
'error',
|
|
28
|
-
{
|
|
29
|
-
before: false,
|
|
30
|
-
after: true
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
25
|
'vue/multi-word-component-names': ['off'],
|
|
34
26
|
'vue/no-v-for-template-key': 'off',
|
|
35
27
|
'vue/no-multiple-template-root': 'off',
|
|
@@ -192,9 +184,7 @@ module.exports = {
|
|
|
192
184
|
'words': true,
|
|
193
185
|
'nonwords': false
|
|
194
186
|
}],
|
|
195
|
-
'spaced-comment': [
|
|
196
|
-
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
|
197
|
-
}],
|
|
187
|
+
'spaced-comment': ['error', 'always', { 'markers': ['/'] }],
|
|
198
188
|
'template-curly-spacing': [2, 'never'],
|
|
199
189
|
'use-isnan': 2,
|
|
200
190
|
'valid-typeof': 2,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.codeActionsOnSave": {
|
|
3
|
+
"source.fixAll.eslint": "always"
|
|
4
|
+
},
|
|
5
|
+
"i18n-ally.localesPaths": [],
|
|
6
|
+
"typescript.tsdk": "node_modules\\typescript\\lib",
|
|
7
|
+
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
|
|
8
|
+
"typescript.tsserver.maxTsServerMemory": 8192,
|
|
9
|
+
"javascript.suggestionActions.enabled": false,
|
|
10
|
+
"files.watcherExclude": {
|
|
11
|
+
"**/.git/objects/**": true,
|
|
12
|
+
"**/.git/subtree-cache/**": true,
|
|
13
|
+
"**/.hg/store/**": true,
|
|
14
|
+
"**/dist/**": true,
|
|
15
|
+
"**/lib/**": true,
|
|
16
|
+
"**/node_modules/**": true
|
|
17
|
+
},
|
|
18
|
+
"cSpell.words": [
|
|
19
|
+
"bochui",
|
|
20
|
+
"cadview",
|
|
21
|
+
"webcad"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -1,35 +1,72 @@
|
|
|
1
|
+
# MONOREPO Template
|
|
2
|
+
|
|
3
|
+
monorepo库项目通用配置模板
|
|
4
|
+
|
|
1
5
|
## 项目结构
|
|
2
6
|
|
|
7
|
+
- APP层分包:独立的项目
|
|
8
|
+
- App-A
|
|
9
|
+
- App-B
|
|
10
|
+
- PKG层分包:通用模块
|
|
11
|
+
- PKG-A
|
|
12
|
+
- PKG-B
|
|
13
|
+
|
|
14
|
+
## 构建模式
|
|
15
|
+
|
|
16
|
+
- 开发环境:development,可以包含sourcemap
|
|
17
|
+
- 测试环境:test,项目主线
|
|
18
|
+
- 生产环境:prod,发布版
|
|
19
|
+
|
|
20
|
+
## 打包构建
|
|
21
|
+
|
|
22
|
+
### 依赖管理
|
|
23
|
+
|
|
24
|
+
该项目使用pnpm管理依赖,需要提前全局安装pnpm
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install pnpm -g
|
|
3
28
|
```
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|—— type.ts // 模块类型定义
|
|
16
|
-
|—— data-server // 数据层
|
|
17
|
-
|—— api // API定义
|
|
18
|
-
|—— {{ module }} // 具体模块
|
|
19
|
-
|—— adapterImpl.ts // 数据处理
|
|
20
|
-
|—— dataServerImpl.ts // 数据请求+message处理
|
|
21
|
-
|—— index.ts // 模块入口
|
|
22
|
-
|—— type.ts // 模块类型定义
|
|
23
|
-
|—— src // 项目的源代码包
|
|
24
|
-
|—— assets // 静态资源文件,如图片、css等
|
|
25
|
-
|—— configData // 各类json配置数据
|
|
26
|
-
|—— constants // 存放常量
|
|
27
|
-
|—— hooks // 通用的钩子函数
|
|
28
|
-
|—— i18n // 国际化相关
|
|
29
|
-
|—— stores // pinia状态管理器;编写状态管理modules、向外暴露一个store实例
|
|
30
|
-
|—— types // 类型定义
|
|
31
|
-
|—— utils // 工具函数
|
|
32
|
-
|—— views // 存放开发的页面组件
|
|
33
|
-
|—— App.vue // 项目的根组件
|
|
34
|
-
|—— main.ts // 项目的入口文件
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# 初始化项目时,使用pnpm递归安装各个子包依赖
|
|
32
|
+
pnpm install -r
|
|
33
|
+
|
|
34
|
+
# 使用-w参数安装一个全局依赖到工作区目录,确保各个子包不需要再次安装就能引用
|
|
35
|
+
pnpm install pkgName -w
|
|
36
|
+
|
|
37
|
+
# 进入到对应子包,为子包单独安装依赖
|
|
38
|
+
cd ./packages/pkgName
|
|
39
|
+
pnpm install
|
|
35
40
|
```
|
|
41
|
+
|
|
42
|
+
### 构建指定子包
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# 以构建apps/reverse-modeling子包为例,目录名后跟的命令为所在包的package.json配置的scripts。
|
|
46
|
+
|
|
47
|
+
## 开发环境调试
|
|
48
|
+
pnpm --filter ./apps/App-A dev
|
|
49
|
+
## 测试环境构建
|
|
50
|
+
pnpm --filter ./apps/App-A build:test
|
|
51
|
+
## 生产环境构建
|
|
52
|
+
pnpm --filter ./apps/App-A build:prod
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 项目使用
|
|
56
|
+
|
|
57
|
+
项目使用需要修改包名,修改包名后需要同步修改以下配置
|
|
58
|
+
|
|
59
|
+
### 修改pkg配置
|
|
60
|
+
|
|
61
|
+
1. 进入./packages/{{ pkgName }}目录,修改其下的package.json内的`name`字段
|
|
62
|
+
2. 进入引用该子包的packages.json文件,修改其包名
|
|
63
|
+
3. 进入vite.config.ts文件,确定包名的别名(resolve.alias)(可选)
|
|
64
|
+
4. 若修改了包的别名,需要同步修改tsconfig.json里的别名(paths)
|
|
65
|
+
|
|
66
|
+
### 修改ts配置
|
|
67
|
+
|
|
68
|
+
打开项目根目录`tsconfig.json`,修改其中的`references`字段,确保**包含packages和apps目录下的各个带package.json的子项目**都被包含在内,否则可能会出现VSCode的语言服务器频繁崩溃问题!!!
|
|
69
|
+
|
|
70
|
+
### 依赖缓存问题
|
|
71
|
+
|
|
72
|
+
在dev模式运行时,可能会出现子包里的内容修改了但是vite的dev服务器并没有触发热更新情况,此时需要修改vite.config.ts里的`optimizeDeps`字段,加入对应的包名以告知vite优化依赖关系
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/group.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>示例工程</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "app-a",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite --host",
|
|
8
|
+
"build:test": "vite build --mode test --emptyOutDir",
|
|
9
|
+
"build:prod": "vite build --mode prod --emptyOutDir",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.cjs,.mjs --ignore-path .gitignore",
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"test:ui": "vitest --ui"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@fsdev/pkg-a": "workspace:^",
|
|
17
|
+
"@fsdev/pkg-b": "workspace:^"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import App from './App.vue'
|
|
3
|
+
import ElementPlus from '@fs/element-plus'
|
|
4
|
+
import '@fs/element-plus/dist/index.css'
|
|
5
|
+
import BochUI from '@fs/bochui'
|
|
6
|
+
import '@fs/bochui/lib/style.css'
|
|
7
|
+
import './style.css'
|
|
8
|
+
|
|
9
|
+
createApp(App)
|
|
10
|
+
.use(ElementPlus)
|
|
11
|
+
.use(BochUI)
|
|
12
|
+
.mount('#app')
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["../../tsconfig.json"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"composite": true,
|
|
5
|
+
"noEmit": false,
|
|
6
|
+
"emitDeclarationOnly": true,
|
|
7
|
+
"baseUrl": ".",
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"rootDir": "../../",
|
|
10
|
+
"paths": {
|
|
11
|
+
"@/*":["src/*"],
|
|
12
|
+
"@fs/utils": ["../../node_modules/@fscut/fs-utils"],
|
|
13
|
+
"@fs/bochui": ["../../node_modules/@fscut/bochui"],
|
|
14
|
+
"@fs/element-plus": ["../../node_modules/@fscut/element-plus"]
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
"include": ["src", "src/i18n/locales/**.json"],
|
|
19
|
+
"references": [
|
|
20
|
+
{ "path": "./tsconfig.node.json" }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
import { defineConfig } from 'vite'
|
|
3
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
4
|
+
import vue from '@vitejs/plugin-vue'
|
|
5
|
+
|
|
6
|
+
// https://vitejs.dev/config/
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
export default defineConfig(({ mode }) => {
|
|
9
|
+
console.log('Build Mode:', mode)
|
|
10
|
+
return {
|
|
11
|
+
plugins: [
|
|
12
|
+
vue()
|
|
13
|
+
],
|
|
14
|
+
optimizeDeps: {
|
|
15
|
+
include: ['@fsdev/pkg-a', '@fsdev/pkg-b']
|
|
16
|
+
},
|
|
17
|
+
css: {
|
|
18
|
+
preprocessorOptions: {
|
|
19
|
+
less: {
|
|
20
|
+
charset: false,
|
|
21
|
+
additionalData: '@import "./src/assets/style/index.less";'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
build: {
|
|
26
|
+
rollupOptions: {
|
|
27
|
+
output: {
|
|
28
|
+
chunkFileNames: 'chunk/[name].js',
|
|
29
|
+
entryFileNames: 'entry/[name].js'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
sourcemap: mode === 'development' ? 'inline' : false,
|
|
33
|
+
outDir: 'dist'
|
|
34
|
+
},
|
|
35
|
+
esbuild: {
|
|
36
|
+
drop: mode === 'production' ? ['console', 'debugger'] : []
|
|
37
|
+
},
|
|
38
|
+
resolve: {
|
|
39
|
+
alias: {
|
|
40
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
41
|
+
'@fs/element-plus': fileURLToPath(new URL('../../node_modules/@fscut/element-plus', import.meta.url)),
|
|
42
|
+
'@fs/bochui': fileURLToPath(new URL('../../node_modules/@fscut/bochui', import.meta.url)),
|
|
43
|
+
'@fs/utils': fileURLToPath(new URL('../../node_modules/@fscut/fs-utils', import.meta.url))
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
rollupOptions: {
|
|
3
|
+
// 确保外部化处理那些你不想打包进库的依赖
|
|
4
|
+
external: [
|
|
5
|
+
'@fs/utils',
|
|
6
|
+
'@fs/fscadweb',
|
|
7
|
+
'@fs/sandbox',
|
|
8
|
+
'@fs/bochui',
|
|
9
|
+
'@fs/sandbox/assets',
|
|
10
|
+
'@fs/webcad-platform',
|
|
11
|
+
'@fs/element-plus',
|
|
12
|
+
'@fscut/crepes-base',
|
|
13
|
+
'vue',
|
|
14
|
+
'vue-i18n',
|
|
15
|
+
'uuid'
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
sourcemap: false,
|
|
19
|
+
minify: 'esbuild',
|
|
20
|
+
outDir: 'lib',
|
|
21
|
+
reportCompressedSize: false
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
|
|
3
|
+
export default (pkg: string) => {
|
|
4
|
+
console.log(pkg)
|
|
5
|
+
return {
|
|
6
|
+
alias: {
|
|
7
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
8
|
+
'@fs/element-plus': fileURLToPath(new URL('node_modules/@fscut/element-plus', import.meta.url)),
|
|
9
|
+
'@fs/bochui': fileURLToPath(new URL('node_modules/@fscut/bochui', import.meta.url))
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</body>
|
|
15
|
-
|
|
16
|
-
</html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + TS</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "template-monorepo",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"build:prod": "vue-tsc && vite build --mode prod",
|
|
10
|
-
"preview": "vite preview",
|
|
11
|
-
"i": "node ./build_entry/extract.js",
|
|
12
|
-
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
|
7
|
+
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.cjs,.mjs --ignore-path .gitignore --fix",
|
|
8
|
+
"test": "vitest"
|
|
13
9
|
},
|
|
14
10
|
"dependencies": {
|
|
15
|
-
"@fscut/bochui": "^0.
|
|
11
|
+
"@fscut/bochui": "^0.2.4",
|
|
12
|
+
"@fscut/crepes-base": "^1.1.16",
|
|
13
|
+
"@fscut/crepes-model": "^1.1.5",
|
|
16
14
|
"@fscut/element-plus": "^2.7.3",
|
|
17
|
-
"@fscut/fs-utils": "^1.
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"vue": "^3.4.29"
|
|
15
|
+
"@fscut/fs-utils": "^1.2.5",
|
|
16
|
+
"vue": "3.4.29",
|
|
17
|
+
"vue-i18n": "10.0.4"
|
|
21
18
|
},
|
|
22
19
|
"devDependencies": {
|
|
23
20
|
"@babel/preset-typescript": "^7.24.7",
|
|
24
21
|
"@rushstack/eslint-patch": "^1.5.1",
|
|
25
|
-
"@types/node": "^22.
|
|
22
|
+
"@types/node": "^22.13.4",
|
|
26
23
|
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
27
24
|
"@typescript-eslint/parser": "^7.15.0",
|
|
28
25
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
26
|
+
"@vitest/ui": "^1.6.0",
|
|
29
27
|
"@vue/test-utils": "^2.4.6",
|
|
30
28
|
"eslint": "^8.57.0",
|
|
31
29
|
"eslint-plugin-vue": "^9.26.0",
|
|
30
|
+
"happy-dom": "^14.12.3",
|
|
32
31
|
"less": "^4.2.0",
|
|
33
|
-
"
|
|
34
|
-
"typescript": "
|
|
32
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
33
|
+
"typescript": "^5.8.2",
|
|
35
34
|
"vite": "^5.3.1",
|
|
36
|
-
"
|
|
35
|
+
"vite-plugin-dts": "^3.6.3",
|
|
36
|
+
"vite-plugin-static-copy": "^2.2.0",
|
|
37
|
+
"vitest": "^1.6.0",
|
|
37
38
|
"vue-tsc": "^2.0.21"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"lib",
|
|
42
|
+
"types",
|
|
43
|
+
"README.md"
|
|
44
|
+
],
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"registry": "http://nexus.fscut.com/repository/npm-dev/"
|
|
38
47
|
}
|
|
39
48
|
}
|