@epxing/cli 0.3.0 → 0.4.0
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 +33 -28
- package/dist/THIRD_PARTY_NOTICES.txt +25 -0
- package/dist/cli.mjs +29 -22
- package/dist/lazy-lib.mjs +5 -5
- package/dist/lib-build.mjs +1 -1
- package/dist/lib-vite-config.mjs +4 -2
- package/dist/project.mjs +6 -6
- package/dist/skills/epxing-frontend-vue3-migrate/SKILL.md +17 -2
- package/dist/skills/epxing-frontend-vue3-migrate/pitfalls.md +498 -381
- package/dist/tools/chunks/AMQWUBTZ.mjs +2 -0
- package/dist/tools/chunks/H4POBCHI.mjs +1 -0
- package/dist/tools/chunks/PP5RD4RH.mjs +4 -0
- package/dist/tools/chunks/SH6LMMHZ.mjs +32 -0
- package/dist/tools/epx-create/scaffold.mjs +2 -0
- package/dist/tools/epx-migrate/detect-vue3-risks.mjs +1 -1
- package/dist/tools/epx-migrate/fix-date-formats.mjs +2 -0
- package/dist/tools/epx-migrate/fix-theme-styles.mjs +2 -0
- package/dist/tools/epx-migrate/migrate.mjs +58 -65
- package/dist/tools/epx-migrate/verify-components.mjs +5 -5
- package/package.json +30 -29
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import{a as u}from"../chunks/AMQWUBTZ.mjs";import{b as x}from"../chunks/PP5RD4RH.mjs";import"../chunks/SH6LMMHZ.mjs";import{a as m}from"../chunks/H4POBCHI.mjs";import n from"node:fs";import c from"node:path";var r=process.argv.slice(2).find(e=>!e.startsWith("--"));(!r||!n.existsSync(r))&&(console.error("\u7528\u6CD5\uFF1Anode tools/epx-migrate/detect-vue3-risks.mjs <\u9879\u76EE\u76EE\u5F55>"),process.exit(1));var f=[],h=m(e=>{for(let s of n.readdirSync(e,{withFileTypes:!0})){let i=c.join(e,s.name);s.isDirectory()&&!/node_modules|\.git|^lib$|^dist$/.test(s.name)?h(i):/\.(?:vue|[cm]?js|jsx|ts|tsx)$/.test(s.name)&&f.push(i)}},"walk"),l=c.join(r,"src");n.existsSync(l)&&h(l);var o=[];for(let e of f){let s=n.readFileSync(e,"utf8"),i=c.relative(r,e),a=u(s,{filename:e});for(let t of a.fixes)o.push({file:`${i}:${t.line}`,rule:"R2-date-format",detail:`${t.before} \u2192 ${t.after}\uFF1B\u6267\u884C\u65E5\u671F\u683C\u5F0F\u4FEE\u590D\u5668 --apply\uFF1B\u539F\u751FVue3\u5305\u4E0D\u8D70\u65E7render\u57AB\u7247\uFF08F21\uFF09`});for(let t of a.warnings)o.push({file:i,rule:"R2-date-format\u5F85\u8FFD\u8E2A",detail:t});let $=/<template[>\s]/.test(s),p=/\bextends:\s*(\w+)/.exec(s),d=(/<style[^>]*\bscoped\b[^>]*>([\s\S]*?)<\/style>/.exec(s)||[])[1]||"";if(d&&p&&!$){let t=d.match(/^[ \t]*\.[\w-][^{}\n]*\{/gm)||[];t.length&&o.push({file:i,rule:"R1-scoped\u5F85\u590D\u6838",detail:`extends ${p[1]} + <style scoped> + \u65E0 <template>\uFF0C\u4E14 scoped \u5757\u542B ${t.length} \u4E2A\u88F8\u7C7B\u9009\u62E9\u5668\uFF08\u5982 ${t[0].trim()}\uFF09\u3002\u4EC5\u63D0\u793A\u5F85\u590D\u6838\uFF0C\u4E0D\u8BC1\u660E\u6837\u5F0F\u5931\u6548\uFF1B\u5148\u4FDD\u7559 scoped\uFF0C\u7528\u6700\u7EC8\u4EA7\u7269\u9A8C\u8BC1 DOM \u4E0E CSS \u5339\u914D\u3002\u82E5\u786E\u9700\u53BB scoped\uFF0C\u987B\u540C\u65F6\u5B8C\u6210\u552F\u4E00\u547D\u540D\u7A7A\u95F4\u9694\u79BB\uFF0C\u5E76\u590D\u6D4B\u7EC4\u4EF6\u5916\u540C\u540D\u5143\u7D20\u548C\u5176\u4ED6\u9875\u9762\uFF1B\u4E0D\u8981\u4E3A\u6D88\u9664\u544A\u8B66\u6279\u91CF\u6539\u6837\u5F0F`})}}if(n.existsSync(l))for(let e of x(r)){for(let s of e.fixes)o.push({file:`${e.file}:${s.line}`,rule:"R3-theme",detail:`${s.before} \u2192 ${s.after}\uFF1B\u6267\u884C epxing theme <\u76EE\u5F55> --apply\uFF0C\u6216\u5728\u8FC1\u79FB\u65F6\u81EA\u52A8\u9002\u914D\uFF08E2\uFF09`});for(let s of e.warnings)o.push({file:e.file,rule:"R3-theme\u5F85\u590D\u6838",detail:s})}console.log(`[detect-vue3-risks] \u626B\u63CF ${f.length} \u4E2A\u7EC4\u4EF6/\u811A\u672C\u6587\u4EF6\u53CA src \u6837\u5F0F\u6587\u4EF6`);o.length===0&&(console.log(" \u2713 \u672A\u53D1\u73B0\u5DF2\u77E5\u9759\u6001\u98CE\u9669\u6A21\u5F0F"),process.exit(0));console.log(` \u26A0 \u53D1\u73B0 ${o.length} \u5904\u5F85\u590D\u6838\u98CE\u9669\u6A21\u5F0F\uFF08\u9759\u6001\u547D\u4E2D\u4E0D\u4EE3\u8868\u8FD0\u884C\u65F6\u5DF2\u5931\u6548\uFF09\uFF1A`);for(let e of o)console.log(` [${e.rule}] ${e.file}
|
|
3
3
|
${e.detail}`);process.exit(2);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{b as t}from"../chunks/AMQWUBTZ.mjs";import"../chunks/SH6LMMHZ.mjs";import"../chunks/H4POBCHI.mjs";import l from"node:fs";import i from"node:path";var c=process.argv.slice(2),n=c.find(s=>!s.startsWith("--"));if(!n||!l.existsSync(i.join(n,"src")))console.error("\u7528\u6CD5\uFF1Anode tools/epx-migrate/fix-date-formats.mjs <\u4EA7\u54C1\u6216\u9879\u76EE\u76EE\u5F55> [--apply]"),process.exitCode=1;else{let s=c.includes("--apply"),r=t(i.resolve(n),{apply:s});console.log(`[\u65E5\u671F\u683C\u5F0F ${s?"apply":"dry-run"}] ${r.reduce((o,e)=>o+e.count,0)} \u5904\u81EA\u52A8\u4FEE\u590D\uFF1B${r.reduce((o,e)=>o+e.warnings.length,0)} \u9879\u52A8\u6001/\u89E3\u6790\u590D\u6838`);for(let o of r){console.log(o.file);for(let e of o.fixes)console.log(` L${e.line}: ${e.before} \u2192 ${e.after}`);for(let e of o.warnings)console.log(" \u5F85\u8FFD\u8E2A\uFF1A"+e)}r.some(o=>o.warnings.length)&&(process.exitCode=2)}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{b as l}from"../chunks/PP5RD4RH.mjs";import"../chunks/SH6LMMHZ.mjs";import"../chunks/H4POBCHI.mjs";import i from"node:fs";import t from"node:path";var c=process.argv.slice(2),n=c.find(s=>!s.startsWith("--"));if(!n||!i.existsSync(t.join(n,"src")))console.error("\u7528\u6CD5\uFF1Aepxing theme <\u4EA7\u54C1\u6216\u9879\u76EE\u76EE\u5F55> [--apply]"),process.exitCode=1;else{let s=c.includes("--apply"),r=l(t.resolve(n),{apply:s});console.log(`[\u4E3B\u9898\u9002\u914D ${s?"apply":"dry-run"}] ${r.reduce((o,e)=>o+e.count,0)} \u5904\u81EA\u52A8\u4FEE\u590D\uFF1B${r.reduce((o,e)=>o+e.warnings.length,0)} \u9879\u5F85\u590D\u6838`);for(let o of r){console.log(o.file);for(let e of o.fixes)console.log(` L${e.line}: ${e.before} \u2192 ${e.after}`);for(let e of o.warnings)console.log(" \u5F85\u590D\u6838\uFF1A"+e)}console.log("\u4FDD\u7559 scoped\uFF1B\u4E0D\u6CE8\u5165\u5168\u5C40\u4E3B\u9898\u3002\u53D1\u5E03\u524D\u7528\u6700\u7EC8\u4EA7\u7269\u5207\u6362\u5E73\u53F0\u5B57\u53F7\u3001\u5706\u89D2\u3001\u660E\u6697\u4E3B\u9898\uFF0C\u5E76\u68C0\u67E5\u7EC4\u4EF6\u5916\u5143\u7D20\u3002"),r.some(o=>o.warnings.length)&&(process.exitCode=2)}
|