@vue3-oop/preset-vue 2.4.14
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 +61 -0
- package/compiled/@vue/babel-plugin-jsx/index.js +33114 -0
- package/compiled/@vue/babel-plugin-jsx/package.json +7 -0
- package/dist/atomParser/index.d.ts +14 -0
- package/dist/atomParser/index.js +115 -0
- package/dist/common.d.ts +3 -0
- package/dist/common.js +57 -0
- package/dist/compiler/browser.d.ts +3 -0
- package/dist/compiler/browser.js +78 -0
- package/dist/compiler/index.d.ts +34 -0
- package/dist/compiler/index.js +208 -0
- package/dist/compiler/node.d.ts +11 -0
- package/dist/compiler/node.js +75 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +59 -0
- package/dist/requireHook.d.ts +2 -0
- package/dist/requireHook.js +67 -0
- package/dist/shared.d.ts +11 -0
- package/dist/shared.js +64 -0
- package/dist/vue/checkVersion.d.ts +2 -0
- package/dist/vue/checkVersion.js +52 -0
- package/dist/vue/index.d.ts +3 -0
- package/dist/vue/index.js +56 -0
- package/dist/vue/techStack/index.d.ts +2 -0
- package/dist/vue/techStack/index.js +95 -0
- package/dist/vue/techStack/jsx.d.ts +2 -0
- package/dist/vue/techStack/jsx.js +81 -0
- package/dist/vue/techStack/sfc.d.ts +2 -0
- package/dist/vue/techStack/sfc.js +80 -0
- package/dist/vue/webpack/config.d.ts +3 -0
- package/dist/vue/webpack/config.js +85 -0
- package/dist/vue/webpack/index.d.ts +2 -0
- package/dist/vue/webpack/index.js +48 -0
- package/lib/compiler.mjs +73 -0
- package/lib/preflight.mjs +5 -0
- package/lib/renderer.mjs +5 -0
- package/lib/runtimePlugin.mjs +60 -0
- package/package.json +58 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createApp, h, nextTick } from 'vue';
|
|
2
|
+
|
|
3
|
+
function u(d){return new Promise((i,t)=>{let n=document.createElement("div");n.style.display="none",n.style.overflow="hidden",document.body.appendChild(n);let e;function r(){nextTick(()=>{e.config.errorHandler=void 0,e.unmount(),n.remove();});}e=createApp({mounted(){i(),r();},render(){return h(d)}}),e.config.warnHandler=o=>{r(),t(new Error(o));},e.config.errorHandler=o=>{r(),t(o);},e.mount(n);})}
|
|
4
|
+
|
|
5
|
+
export { u as default };
|
package/lib/renderer.mjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createApp } from 'vue';
|
|
2
|
+
|
|
3
|
+
var _=async function(s,e){e.__css__&&setTimeout(()=>{document.querySelectorAll(`style[css-${e.__id__}]`).forEach(r=>r.remove()),document.head.insertAdjacentHTML("beforeend",`<style css-${e.__id__}>${e.__css__}</style>`);},1);let t=createApp(e);return t.config.errorHandler=function(r){throw r},t.mount(s),()=>{t.unmount();}},o=_;
|
|
4
|
+
|
|
5
|
+
export { o as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var v="vue demo",B="An auto-generated vue demo by dumi",d=()=>!!window.ts,R=(e,t,n)=>`
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<meta name="description" content="${t}" />
|
|
8
|
+
<title>${e}</title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="app"></div>
|
|
12
|
+
<script type="module" src="${n}"><\/script>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
15
|
+
`,O=(e,t)=>{let n=d();return `
|
|
16
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
17
|
+
|
|
18
|
+
import { defineConfig } from 'vite';
|
|
19
|
+
import vue from '@vitejs/plugin-vue';
|
|
20
|
+
${e?`import vueJsx from ${n?"'@vue3-oop/plugin-vue-jsx'":"'@vitejs/plugin-vue-jsx'"};`:""}
|
|
21
|
+
|
|
22
|
+
// https://vitejs.dev/config/
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
plugins: [
|
|
25
|
+
vue(),${e?"vueJsx()":""}
|
|
26
|
+
],
|
|
27
|
+
resolve: {
|
|
28
|
+
alias: {
|
|
29
|
+
'@': fileURLToPath(new URL('./${t}', import.meta.url))
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});`},P=e=>`
|
|
33
|
+
${d()?"import '@abraham/reflection'":""}
|
|
34
|
+
import { createApp } from 'vue';
|
|
35
|
+
import App from './${e}';
|
|
36
|
+
|
|
37
|
+
const app = createApp(App);
|
|
38
|
+
app.config.errorHandler = (err) => console.error(err);
|
|
39
|
+
app.mount('#app');
|
|
40
|
+
`,C=()=>`
|
|
41
|
+
{
|
|
42
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
43
|
+
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
44
|
+
"exclude": ["src/**/__tests__/*"],
|
|
45
|
+
"compilerOptions": {
|
|
46
|
+
${d()?`"isolatedModules": true,
|
|
47
|
+
"experimentalDecorators": true,
|
|
48
|
+
"emitDecoratorMetadata": true,
|
|
49
|
+
"useDefineForClassFields": false,
|
|
50
|
+
"verbatimModuleSyntax": true,`:""}
|
|
51
|
+
"allowImportingTsExtensions": true,
|
|
52
|
+
"composite": true,
|
|
53
|
+
"baseUrl": ".",
|
|
54
|
+
"paths": {
|
|
55
|
+
"@/*": ["./src/*"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}`,E={less:["less","^4.2.0"],scss:["sass","^1.68.0"],sass:["sass","^1.68.0"],styl:["stylus","^0.60.0"]};function w(e){let t=/(.+)\.(\w+)$/i.exec(e);if(!t)return t;let[,n,i]=t;return {name:n,ext:i}}function F(e){return e.entry?e.entry:e.dependencies["index.vue"]?"index.vue":"index.tsx"}function g({asset:e,title:t=v,description:n=B}){let i=F(e),c=w(i);if(!c)return {};let{name:l,ext:r}=c,s=r==="vue"||r==="tsx",y=d(),p="src/",o={[`vite.config.${s?"ts":"js"}`]:{content:O(s,p),isBinary:!1}};s&&(o["tsconfig.json"]={content:C(),isBinary:!1});let a={},f={"@vitejs/plugin-vue":"~5.2.1",vite:"~6.0.3"},j=l==="index"?`App.${r}`:i;Object.entries(e.dependencies).forEach(([u,{type:D,value:b}])=>{D==="NPM"?a[u]=b:o[u===i?`${p}${j}`:`${p}${u}`]={content:b,isBinary:!1};let $=w(u);if(!$)return;let h=E[$.ext];if(!h)return;let[M,A]=h;f[M]=A;}),a.vue??="^3.3",a["vue-router"]??="^4.2",y&&(a["@abraham/reflection"]="^0.12.0",a["injection-js"]="^2.4.0");let m=s?`${p}index.ts`:`${p}index.js`;return s&&Object.assign(f,{"@tsconfig/node18":"~18.2.2","@types/node":"~18.17.17","@vue/tsconfig":"~0.4.0",typescript:"~5.2.0","vue-tsc":"~1.8.11"},y?{"@vue3-oop/plugin-vue-jsx":"~1.4.6"}:{"@vitejs/plugin-vue-jsx":"~4.0.0"}),o["package.json"]={content:JSON.stringify({description:n,main:m,dependencies:a,scripts:{dev:"vite",build:"vite build",preview:"vite preview"},browserslist:["> 0.2%","not dead"],devDependencies:f},null,2),isBinary:!1},o["index.html"]={content:R(t,n,m),isBinary:!1},o[m]={content:P(j),isBinary:!1},o}function N(e,t){let{title:n,description:i}=t,c={title:n||v,description:i,template:"node",files:{},dependencies:{}},l=g(t);return c.files=Object.entries(l).reduce((r,[x,s])=>(r[x]=s.content,r),{}),Object.assign(e,c),e}function V(e,t){return Object.assign(e,{files:g(t)}),e}
|
|
59
|
+
|
|
60
|
+
export { V as modifyCodeSandboxData, N as modifyStackBlitzData };
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vue3-oop/preset-vue",
|
|
3
|
+
"version": "2.4.14",
|
|
4
|
+
"description": "Vue support plugins for dumi",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dumi",
|
|
7
|
+
"plugin",
|
|
8
|
+
"preset",
|
|
9
|
+
"vue"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"lib",
|
|
16
|
+
"dist",
|
|
17
|
+
"compiled"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "father build",
|
|
21
|
+
"build:deps": "father prebundle",
|
|
22
|
+
"build:lib": "tsup --minify",
|
|
23
|
+
"dev": "father dev",
|
|
24
|
+
"test": "vitest"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@dumijs/vue-meta": "latest",
|
|
28
|
+
"@types/hash-sum": "^1.0.0",
|
|
29
|
+
"@umijs/bundler-webpack": "^4.0.81",
|
|
30
|
+
"codesandbox-import-utils": "^2.2.3",
|
|
31
|
+
"compare-versions": "^6.1.0",
|
|
32
|
+
"hash-sum": "^2.0.0",
|
|
33
|
+
"ts-loader": "^9.5.1",
|
|
34
|
+
"vue": "^3.3.4",
|
|
35
|
+
"vue-loader": "^17.0.1"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/babel__core": "^7.20.5",
|
|
39
|
+
"@types/babel__standalone": "^7.1.7",
|
|
40
|
+
"@vue/babel-plugin-jsx": "^1.1.6",
|
|
41
|
+
"dumi": "latest",
|
|
42
|
+
"father": "^4.1.9",
|
|
43
|
+
"tsup": "^8.0.1",
|
|
44
|
+
"typescript": "^5.7.2"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"dumi": "^2.0.0",
|
|
48
|
+
"vue": "^3.0.0",
|
|
49
|
+
"typescript": "^5"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"registry": "https://registry.npmjs.org",
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"authors": [
|
|
56
|
+
"jeffwcx <jeffwcx@icloud.com>"
|
|
57
|
+
]
|
|
58
|
+
}
|