migrate component foundation to OpenVue 1.1.1
This commit is contained in:
1 parent
651c36367f
commit
21692898b3
135 files changed
+780
-749
No files matched your search
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { createRequire } from "node:module";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { parse as parseJavaScript } from "@babel/parser";
|
||||
import {
|
||||
parse as parseVue,
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
} from "@vue/compiler-sfc";
|
||||
|
||||
const root = path.resolve(import.meta.dirname, "..");
|
||||
const require = createRequire(import.meta.url);
|
||||
const failures = [];
|
||||
const files = [];
|
||||
function walk(directory) {
|
||||
@@ -53,7 +52,13 @@ function checkImport(source, owner) {
|
||||
if (!dependencies.has(name))
|
||||
failures.push(`${owner}: undeclared dependency ${name}`);
|
||||
try {
|
||||
require.resolve(source);
|
||||
// 应用使用 ESM import;按 import 条件解析,不能用 require 条件拒绝 ESM-only 包。
|
||||
const resolved = import.meta.resolve(source);
|
||||
if (
|
||||
resolved.startsWith("file:") &&
|
||||
!fs.existsSync(fileURLToPath(resolved))
|
||||
)
|
||||
throw Error(`Resolved module does not exist: ${resolved}`);
|
||||
} catch (error) {
|
||||
failures.push(`${owner}: cannot resolve ${source}: ${error.message}`);
|
||||
}
|
||||
|
||||
@@ -222,8 +222,8 @@ replace("BLvPXbVl.js", "_", "pinia", "createPinia");
|
||||
replace("BLvPXbVl.js", "v", "pinia", "setActivePinia");
|
||||
replace("BLvPXbVl.js", "y", "pinia", "shouldHydrate");
|
||||
replace("BLvPXbVl.js", "s", "~/utils/crypto.js", "getCrypto");
|
||||
replace("BSkUL2SB.js", "n", "primevue/usetoast", "useToast");
|
||||
replace("iGbquyGC.js", "t", "primevue/tooltip", "default");
|
||||
replace("BSkUL2SB.js", "n", "openvue/usetoast", "useToast");
|
||||
replace("iGbquyGC.js", "t", "openvue/tooltip", "default");
|
||||
replace("DEP0rg1v.js", "t", "~/utils/brand.js", "logoUrl");
|
||||
replace("ecKN0m8a.js", "r", "#internal/nuxt/paths", "publicAssetsURL");
|
||||
|
||||
|
||||
Reference in new issue
Block a user