Compare commits

..

3 Commits

Author SHA1 Message Date
1442765766
184eed5d14
Merge e144835ed7 into de2869bb8a 2024-04-27 16:37:36 +08:00
神仙都没用
de2869bb8a 优化 2024-04-26 21:48:44 +08:00
神仙都没用
e391548a43 更新 eps 构建方式 2024-04-26 21:28:51 +08:00
37 changed files with 2476 additions and 1680 deletions

2158
build/cool/eps.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

1
build/cool/eps.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,7 @@
"xlsx": "^0.18.5"
},
"devDependencies": {
"@cool-vue/vite-plugin": "^7.0.1",
"@cool-vue/vite-plugin": "^7.1.1",
"@types/file-saver": "^2.0.7",
"@types/lodash-es": "^4.17.8",
"@types/mockjs": "^1.0.7",

2
packages/vite-plugin/dist/config.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import type { Config } from "../types";
export declare const config: Config.Data;

View File

@ -1,2 +1,2 @@
import type { Ctx } from "../types";
import type { Ctx } from "../../types";
export declare function createCtx(): Promise<Ctx.Data>;

View File

@ -1,4 +1,4 @@
import type { Eps } from "../types";
import type { Eps } from "../../types";
export declare function createEps(query?: {
list: any[];
}): Promise<{

2
packages/vite-plugin/dist/index.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import type { Config } from "../types";
export declare function cool(options: Config.Options): (import("vite").Plugin<any> | Promise<import("vite").Plugin<any>>)[];

View File

@ -5,8 +5,41 @@
})(this, (function (exports, fs, path, axios, lodash, prettier, compilerSfc, magicString, glob) { 'use strict';
const config = {
type: "",
type: "admin",
reqUrl: "",
demo: false,
eps: {
dist: "./build/cool",
mapping: [
{
// 自定义匹配
custom: ({ propertyName, type }) => {
// 如果没有返回null或者不返回则继续遍历其他匹配规则
return null;
},
},
{
type: "string",
test: ["varchar", "text", "simple-json"],
},
{
type: "string[]",
test: ["simple-array"],
},
{
type: "Date",
test: ["datetime", "date"],
},
{
type: "number",
test: ["tinyint", "int", "decimal"],
},
{
type: "BigInt",
test: ["bigint"],
},
],
},
};
// 根目录
@ -31,9 +64,12 @@
});
}
// 创建目录
function createDir(path) {
function createDir(path, recursive) {
try {
if (!fs.existsSync(path))
fs.mkdirSync(path);
fs.mkdirSync(path, { recursive });
}
catch (err) { }
}
// 读取文件
function readFile(path, json) {
@ -69,73 +105,17 @@
});
});
}
// 深度创建目录
function mkdirs(path$1) {
const arr = path$1.split("/");
let p = "";
arr.forEach((e) => {
const t = path.join(p, e);
try {
fs.statSync(t);
}
catch (err) {
try {
fs.mkdirSync(t);
}
catch (error) {
console.error(error);
}
}
p = t;
});
return p;
}
function error(message) {
console.log("\x1B[31m%s\x1B[0m", message);
}
// 打包目录
const DistDir = path.join(__dirname, "../");
// 实体描述
const Entity = {
mapping: [
// {
// // 自定义匹配
// custom: ({ propertyName, type }) => {
// // 如果没有返回null或者不返回则继续遍历其他匹配规则
// return null;
// },
// },
{
type: "string",
test: ["varchar", "text", "simple-json"],
},
{
type: "string[]",
test: ["simple-array"],
},
{
type: "Date",
test: ["datetime", "date"],
},
{
type: "number",
test: ["tinyint", "int", "decimal"],
},
{
type: "BigInt",
test: ["bigint"],
},
],
};
// eps 数据文件路径
const epsJsonPath = path.join(DistDir, "eps.json");
// eps 描述文件路径
const epsDtsPath = path.join(DistDir, "eps.d.ts");
let service = {};
let list = [];
let customList = [];
// 获取路径
function getEpsPath(filename) {
return path.join(config.type == "admin" ? config.eps.dist : rootDir(config.eps.dist), filename || "");
}
// 获取方法名
function getNames(v) {
return Object.keys(v).filter((e) => !["namespace", "permission"].includes(e));
@ -152,11 +132,12 @@
});
}
// 本地文件
const epsPath = getEpsPath("eps.json");
try {
list = readFile(epsJsonPath, true) || [];
list = readFile(epsPath, true) || [];
}
catch (err) {
error(`[cool-eps] ${epsJsonPath} 文件异常, ${err.message}`);
error(`[cool-eps] ${epsPath} 文件异常, ${err.message}`);
}
// 请求地址
let url = config.reqUrl;
@ -224,7 +205,7 @@
}),
};
});
fs.createWriteStream(epsJsonPath, {
fs.createWriteStream(getEpsPath("eps.json"), {
flags: "w",
}).write(JSON.stringify(d));
}
@ -232,11 +213,12 @@
async function createDescribe({ list, service }) {
// 获取类型
function getType({ propertyName, type }) {
for (const map of Entity.mapping) {
// if (map.custom) {
// const resType = map.custom({ propertyName, type });
// if (resType) return resType;
// }
for (const map of config.eps.mapping) {
if (map.custom) {
const resType = map.custom({ propertyName, type });
if (resType)
return resType;
}
if (map.test) {
if (map.test.includes(type))
return map.type;
@ -430,7 +412,7 @@
trailingComma: "none",
});
// 创建 eps 描述文件
fs.createWriteStream(epsDtsPath, {
fs.createWriteStream(getEpsPath("eps.d.ts"), {
flags: "w",
}).write(content);
}
@ -488,8 +470,8 @@
await getData(query?.list || []);
// 创建 service
createService();
// 创建临时目录
createDir(DistDir);
// 创建目录
createDir(getEpsPath(), true);
// 创建 json 文件
createJson();
// 创建描述文件
@ -587,10 +569,12 @@
const dir = (options.viewPath || "").split("/");
// 文件名
const fname = dir.pop();
// 源码路径
const srcPath = `./src/${dir.join("/")}`;
// 创建目录
const path$1 = mkdirs(rootDir(`./src/${dir.join("/")}`));
createDir(srcPath, true);
// 创建文件
fs.createWriteStream(path.join(path$1, fname || "demo"), {
fs.createWriteStream(path.join(srcPath, fname || "demo"), {
flags: "w",
}).write(content);
}
@ -746,7 +730,7 @@
name: "vite-cool-virtual",
enforce: "pre",
handleHotUpdate({ file, server }) {
if (!["pages.json", "dist"].some((e) => file.includes(e))) {
if (!["pages.json", "dist", "build/cool"].some((e) => file.includes(e))) {
createCtx();
createEps().then((data) => {
// 通知客户端刷新
@ -779,8 +763,20 @@
}
function cool(options) {
// 应用类型admin | app
config.type = options.type;
// 请求地址
config.reqUrl = options.proxy["/dev/"].target;
// Eps
if (options.eps) {
const { dist, mapping } = options.eps;
if (dist) {
config.eps.dist = dist;
}
if (mapping) {
config.eps.mapping.unshift(...mapping);
}
}
return [base(), virtual(), demo(options.demo)];
}

View File

@ -1,5 +0,0 @@
import type { Type } from "./types";
export declare const config: {
type: Type;
reqUrl: string;
};

View File

@ -1,7 +0,0 @@
export declare const DistDir: string;
export declare const Entity: {
mapping: {
type: string;
test: string[];
}[];
};

View File

@ -1,6 +0,0 @@
import type { Type } from "./types";
export declare function cool(options: {
type: Type;
proxy: any;
demo?: boolean;
}): (import("vite").Plugin<any> | Promise<import("vite").Plugin<any>>)[];

View File

@ -1,10 +1,9 @@
export declare function rootDir(path: string): string;
export declare function firstUpperCase(value: string): string;
export declare function toCamel(str: string): string;
export declare function createDir(path: string): void;
export declare function createDir(path: string, recursive?: boolean): void;
export declare function readFile(path: string, json?: boolean): any;
export declare function writeFile(path: string, data: any): void | "";
export declare function parseJson(req: any): Promise<any>;
export declare function mkdirs(path: string): string;
export declare function error(message: string): void;
export declare function success(message: string): void;

View File

@ -1 +0,0 @@
/// <reference types="./src/dist/eps" />

View File

@ -1,6 +1,6 @@
{
"name": "@cool-vue/vite-plugin",
"version": "7.0.1",
"version": "7.1.1",
"description": "cool-admin/cool-uni builder",
"main": "/dist/index.js",
"scripts": {
@ -9,7 +9,12 @@
"keywords": [],
"author": "cool",
"license": "ISC",
"types": "./dist/types/src/index.d.ts",
"files": [
"dist/*",
"types/*",
"package.json"
],
"types": "./dist/index.d.ts",
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.6",
"@types/lodash": "^4.17.0",

View File

@ -1,6 +1,39 @@
import type { Type } from "./types";
import type { Config } from "../types";
export const config = {
type: "" as Type,
export const config: Config.Data = {
type: "admin",
reqUrl: "",
demo: false,
eps: {
dist: "./build/cool",
mapping: [
{
// 自定义匹配
custom: ({ propertyName, type }) => {
// 如果没有返回null或者不返回则继续遍历其他匹配规则
return null;
},
},
{
type: "string",
test: ["varchar", "text", "simple-json"],
},
{
type: "string[]",
test: ["simple-array"],
},
{
type: "Date",
test: ["datetime", "date"],
},
{
type: "number",
test: ["tinyint", "int", "decimal"],
},
{
type: "BigInt",
test: ["bigint"],
},
],
},
};

View File

@ -2,7 +2,7 @@ import { join } from "path";
import { readFile, rootDir, writeFile } from "../utils";
import { glob } from "glob";
import { assign, cloneDeep, isEqual } from "lodash";
import type { Ctx } from "../types";
import type { Ctx } from "../../types";
import { config } from "../config";
import fs from "fs";

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,37 +0,0 @@
import { join } from "path";
// 打包目录
export const DistDir = join(__dirname, "../");
// 实体描述
export const Entity = {
mapping: [
// {
// // 自定义匹配
// custom: ({ propertyName, type }) => {
// // 如果没有返回null或者不返回则继续遍历其他匹配规则
// return null;
// },
// },
{
type: "string",
test: ["varchar", "text", "simple-json"],
},
{
type: "string[]",
test: ["simple-array"],
},
{
type: "Date",
test: ["datetime", "date"],
},
{
type: "number",
test: ["tinyint", "int", "decimal"],
},
{
type: "BigInt",
test: ["bigint"],
},
],
};

View File

@ -1,23 +1,24 @@
import { createDir, error, firstUpperCase, readFile, toCamel } from "../utils";
import { createDir, error, firstUpperCase, readFile, rootDir, toCamel } from "../utils";
import { join } from "path";
import { Entity, DistDir } from "./config";
import axios from "axios";
import { isArray, isEmpty, last, merge } from "lodash";
import { createWriteStream } from "fs";
import prettier from "prettier";
import { config } from "../config";
import type { Eps } from "../types";
// eps 数据文件路径
const epsJsonPath = join(DistDir, "eps.json");
// eps 描述文件路径
const epsDtsPath = join(DistDir, "eps.d.ts");
import type { Eps } from "../../types";
let service = {};
let list: Eps.Entity[] = [];
let customList: Eps.Entity[] = [];
// 获取路径
function getEpsPath(filename?: string) {
return join(
config.type == "admin" ? config.eps.dist : rootDir(config.eps.dist),
filename || "",
);
}
// 获取方法名
function getNames(v: any) {
return Object.keys(v).filter((e) => !["namespace", "permission"].includes(e));
@ -36,10 +37,12 @@ async function getData(data?: Eps.Entity[]) {
}
// 本地文件
const epsPath = getEpsPath("eps.json");
try {
list = readFile(epsJsonPath, true) || [];
list = readFile(epsPath, true) || [];
} catch (err: any) {
error(`[cool-eps] ${epsJsonPath} 文件异常, ${err.message}`);
error(`[cool-eps] ${epsPath} 文件异常, ${err.message}`);
}
// 请求地址
@ -116,7 +119,7 @@ function createJson() {
};
});
createWriteStream(epsJsonPath, {
createWriteStream(getEpsPath("eps.json"), {
flags: "w",
}).write(JSON.stringify(d));
}
@ -125,11 +128,11 @@ function createJson() {
async function createDescribe({ list, service }: { list: Eps.Entity[]; service: any }) {
// 获取类型
function getType({ propertyName, type }: any) {
for (const map of Entity.mapping) {
// if (map.custom) {
// const resType = map.custom({ propertyName, type });
// if (resType) return resType;
// }
for (const map of config.eps.mapping) {
if (map.custom) {
const resType = map.custom({ propertyName, type });
if (resType) return resType;
}
if (map.test) {
if (map.test.includes(type)) return map.type;
}
@ -370,7 +373,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service:
});
// 创建 eps 描述文件
createWriteStream(epsDtsPath, {
createWriteStream(getEpsPath("eps.d.ts"), {
flags: "w",
}).write(content);
}
@ -441,8 +444,8 @@ export async function createEps(query?: { list: any[] }) {
// 创建 service
createService();
// 创建临时目录
createDir(DistDir);
// 创建目录
createDir(getEpsPath(), true);
// 创建 json 文件
createJson();

View File

@ -1,12 +1,28 @@
import { base } from "./base";
import { config } from "./config";
import { demo } from "./demo";
import type { Type } from "./types";
import { virtual } from "./virtual";
import type { Config } from "../types";
export function cool(options: { type: Type; proxy: any; demo?: boolean }) {
export function cool(options: Config.Options) {
// 应用类型admin | app
config.type = options.type;
// 请求地址
config.reqUrl = options.proxy["/dev/"].target;
// Eps
if (options.eps) {
const { dist, mapping } = options.eps;
if (dist) {
config.eps.dist = dist;
}
if (mapping) {
config.eps.mapping.unshift(...mapping);
}
}
return [base(), virtual(), demo(options.demo)];
}

View File

@ -1,7 +1,7 @@
import { createWriteStream } from "fs";
import prettier from "prettier";
import { join } from "path";
import { mkdirs, rootDir } from "../utils";
import { createDir } from "../utils";
// 创建文件
export async function createMenu(options: { viewPath: string; code: string }) {
@ -24,11 +24,14 @@ export async function createMenu(options: { viewPath: string; code: string }) {
// 文件名
const fname = dir.pop();
// 源码路径
const srcPath = `./src/${dir.join("/")}`;
// 创建目录
const path = mkdirs(rootDir(`./src/${dir.join("/")}`));
createDir(srcPath, true);
// 创建文件
createWriteStream(join(path, fname || "demo"), {
createWriteStream(join(srcPath, fname || "demo"), {
flags: "w",
}).write(content);
}

View File

@ -28,8 +28,10 @@ export function toCamel(str: string): string {
}
// 创建目录
export function createDir(path: string) {
if (!fs.existsSync(path)) fs.mkdirSync(path);
export function createDir(path: string, recursive?: boolean) {
try {
if (!fs.existsSync(path)) fs.mkdirSync(path, { recursive });
} catch (err) {}
}
// 读取文件
@ -68,29 +70,6 @@ export function parseJson(req: any): Promise<any> {
});
}
// 深度创建目录
export function mkdirs(path: string) {
const arr = path.split("/");
let p = "";
arr.forEach((e) => {
const t = join(p, e);
try {
fs.statSync(t);
} catch (err) {
try {
fs.mkdirSync(t);
} catch (error) {
console.error(error);
}
}
p = t;
});
return p;
}
export function error(message: string) {
console.log("\x1B[31m%s\x1B[0m", message);
}

View File

@ -12,7 +12,7 @@ export async function virtual(): Promise<Plugin> {
name: "vite-cool-virtual",
enforce: "pre",
handleHotUpdate({ file, server }) {
if (!["pages.json", "dist"].some((e) => file.includes(e))) {
if (!["pages.json", "dist", "build/cool"].some((e) => file.includes(e))) {
createCtx();
createEps().then((data) => {

View File

@ -1,17 +1,16 @@
{
"compilerOptions": {
"rootDir": "./",
"rootDir": "./src",
"types": ["node"],
"target": "ESNext",
"module": "CommonJS",
"declaration": true,
"outDir": "types",
"outDir": "dist",
"strict": true,
"esModuleInterop": true,
"pretty": true,
"resolveJsonModule": true,
"typeRoots": ["./node_modules/@types/", "./src/types/"]
"resolveJsonModule": true
},
"include": ["src", "types.d.ts"],
"include": ["src"],
"exclude": ["dist"]
}

View File

@ -45,15 +45,43 @@ export namespace Ctx {
type SubPackages = {
root?: string;
pages?: Pages;
pages?: Ctx.Pages;
[key: string]: any;
}[];
interface Data {
appid?: string;
pages?: Pages;
subPackages?: SubPackages;
pages?: Ctx.Pages;
subPackages?: Ctx.SubPackages;
modules?: string[];
[key: string]: any;
}
}
export namespace Config {
type Type = "app" | "admin";
interface Eps {
dist: string;
mapping: {
type?: string;
test?: string[];
custom?(data: { propertyName: string; type: string }): any;
}[];
}
interface Options {
type: Config.Type;
proxy: any;
eps?: {
dist?: string;
mapping?: Config.Eps["mapping"];
};
demo?: boolean;
}
interface Data {
type: Config.Type;
reqUrl: string;
eps: Config.Eps;
demo: boolean;
[key: string]: any;
}
}

View File

@ -86,8 +86,8 @@ dependencies:
devDependencies:
'@cool-vue/vite-plugin':
specifier: ^7.0.1
version: 7.0.1
specifier: ^7.1.1
version: 7.1.1
'@types/file-saver':
specifier: ^2.0.7
version: 2.0.7
@ -473,7 +473,7 @@ packages:
dependencies:
array.prototype.flat: 1.3.2
core-js: 3.32.1
element-plus: 2.7.1(vue@3.4.15)
element-plus: 2.7.2(vue@3.4.15)
lodash-es: 4.17.21
mitt: 3.0.1
vue: 3.4.15(typescript@5.2.2)
@ -482,10 +482,10 @@ packages:
- typescript
dev: false
/@cool-vue/vite-plugin@7.0.1:
resolution: {integrity: sha512-IXZ58qT2ERXYZzSwnw1Bl0NgrKOhhED1f7HqbgSCUUbyIZQTUR9JX1qcIPEavmhQbrUl5d9MZZvKjD2Qz+ppjQ==}
/@cool-vue/vite-plugin@7.1.1:
resolution: {integrity: sha512-bCf0+ICwjYWYdS3DOrgr74YulvQLVjzNKPiTeL32pTyTecmFSOqbiQ+PbVYxIPHtZjnNjupWOz5vYm1kmBscWQ==}
dependencies:
'@vue/compiler-sfc': 3.4.24
'@vue/compiler-sfc': 3.4.25
axios: 1.6.8
glob: 10.3.12
lodash: 4.17.21
@ -977,136 +977,136 @@ packages:
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
dev: true
/@rollup/rollup-android-arm-eabi@4.16.3:
resolution: {integrity: sha512-1ACInKIT0pXmTYuPoJAL8sOT0lV3PEACFSVxnD03hGIojJ1CmbzZmLJyk2xew+yxqTlmx7xydkiJcBzdp0V+AQ==}
/@rollup/rollup-android-arm-eabi@4.16.4:
resolution: {integrity: sha512-GkhjAaQ8oUTOKE4g4gsZ0u8K/IHU1+2WQSgS1TwTcYvL+sjbaQjNHFXbOJ6kgqGHIO1DfUhI/Sphi9GkRT9K+Q==}
cpu: [arm]
os: [android]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-android-arm64@4.16.3:
resolution: {integrity: sha512-vGl+Bny8cawCM7ExugzqEB8ke3t7Pm9/mo+ciA9kJh6pMuNyM+31qhewMwHwseDZ/LtdW0SCocW1CsMxcq1Lsg==}
/@rollup/rollup-android-arm64@4.16.4:
resolution: {integrity: sha512-Bvm6D+NPbGMQOcxvS1zUl8H7DWlywSXsphAeOnVeiZLQ+0J6Is8T7SrjGTH29KtYkiY9vld8ZnpV3G2EPbom+w==}
cpu: [arm64]
os: [android]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-darwin-arm64@4.16.3:
resolution: {integrity: sha512-Lj8J9WzQRvfWO4GfI+bBkIThUFV1PtI+es/YH/3cwUQ+edXu8Mre0JRJfRrAeRjPiHDPFFZaX51zfgHHEhgRAg==}
/@rollup/rollup-darwin-arm64@4.16.4:
resolution: {integrity: sha512-i5d64MlnYBO9EkCOGe5vPR/EeDwjnKOGGdd7zKFhU5y8haKhQZTN2DgVtpODDMxUr4t2K90wTUJg7ilgND6bXw==}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-darwin-x64@4.16.3:
resolution: {integrity: sha512-NPPOXMTIWJk50lgZmRReEYJFvLG5rgMDzaVauWNB2MgFQYm9HuNXQdVVg3iEZ3A5StIzxhMlPjVyS5fsv4PJmg==}
/@rollup/rollup-darwin-x64@4.16.4:
resolution: {integrity: sha512-WZupV1+CdUYehaZqjaFTClJI72fjJEgTXdf4NbW69I9XyvdmztUExBtcI2yIIU6hJtYvtwS6pkTkHJz+k08mAQ==}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-arm-gnueabihf@4.16.3:
resolution: {integrity: sha512-ij4tv1XtWcDScaTgoMnvDEYZ2Wjl2ZhDFEyftjBKu6sNNLHIkKuXBol/bVSh+md5zSJ6em9hUXyPO3cVPCsl4Q==}
/@rollup/rollup-linux-arm-gnueabihf@4.16.4:
resolution: {integrity: sha512-ADm/xt86JUnmAfA9mBqFcRp//RVRt1ohGOYF6yL+IFCYqOBNwy5lbEK05xTsEoJq+/tJzg8ICUtS82WinJRuIw==}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-arm-musleabihf@4.16.3:
resolution: {integrity: sha512-MTMAl30dzcfYB+smHe1sJuS2P1/hB8pqylkCe0/8/Lo8CADjy/eM8x43nBoR5eqcYgpOtCh7IgHpvqSMAE38xw==}
/@rollup/rollup-linux-arm-musleabihf@4.16.4:
resolution: {integrity: sha512-tJfJaXPiFAG+Jn3cutp7mCs1ePltuAgRqdDZrzb1aeE3TktWWJ+g7xK9SNlaSUFw6IU4QgOxAY4rA+wZUT5Wfg==}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-arm64-gnu@4.16.3:
resolution: {integrity: sha512-vY3fAg6JLDoNh781HHHMPvt8K6RWG3OmEj3xI9BOFSQTD5PNaGKvCB815MyGlDnFYUw7lH+WvvQqoBwLtRDR1A==}
/@rollup/rollup-linux-arm64-gnu@4.16.4:
resolution: {integrity: sha512-7dy1BzQkgYlUTapDTvK997cgi0Orh5Iu7JlZVBy1MBURk7/HSbHkzRnXZa19ozy+wwD8/SlpJnOOckuNZtJR9w==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-arm64-musl@4.16.3:
resolution: {integrity: sha512-61SpQGBSb8QkfV/hUYWezlEig4ro55t8NcE5wWmy1bqRsRVHCEDkF534d+Lln/YeLUoSWtJHvvG3bx9lH/S6uA==}
/@rollup/rollup-linux-arm64-musl@4.16.4:
resolution: {integrity: sha512-zsFwdUw5XLD1gQe0aoU2HVceI6NEW7q7m05wA46eUAyrkeNYExObfRFQcvA6zw8lfRc5BHtan3tBpo+kqEOxmg==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-powerpc64le-gnu@4.16.3:
resolution: {integrity: sha512-4XGexJthsNhEEgv/zK4/NnAOjYKoeCsIoT+GkqTY2u3rse0lbJ8ft1bpDCdlkvifsLDL2uwe4fn8PLR4IMTKQQ==}
/@rollup/rollup-linux-powerpc64le-gnu@4.16.4:
resolution: {integrity: sha512-p8C3NnxXooRdNrdv6dBmRTddEapfESEUflpICDNKXpHvTjRRq1J82CbU5G3XfebIZyI3B0s074JHMWD36qOW6w==}
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-riscv64-gnu@4.16.3:
resolution: {integrity: sha512-/pArXjqnEdhbQ1qe4CTTlJ6/GjWGdWNRucKAp4fqKnKf7QC0BES3QEV34ACumHHQ4uEGt4GctF2ISCMRhkli0A==}
/@rollup/rollup-linux-riscv64-gnu@4.16.4:
resolution: {integrity: sha512-Lh/8ckoar4s4Id2foY7jNgitTOUQczwMWNYi+Mjt0eQ9LKhr6sK477REqQkmy8YHY3Ca3A2JJVdXnfb3Rrwkng==}
cpu: [riscv64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-s390x-gnu@4.16.3:
resolution: {integrity: sha512-vu4f3Y8iwjtRfSZdmtP8nC1jmRx1IrRVo2cLQlQfpFZ0e2AE9YbPgfIzpuK+i3C4zFETaLLNGezbBns2NuS/uA==}
/@rollup/rollup-linux-s390x-gnu@4.16.4:
resolution: {integrity: sha512-1xwwn9ZCQYuqGmulGsTZoKrrn0z2fAur2ujE60QgyDpHmBbXbxLaQiEvzJWDrscRq43c8DnuHx3QorhMTZgisQ==}
cpu: [s390x]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-x64-gnu@4.16.3:
resolution: {integrity: sha512-n4HEgIJulNSmAKT3SYF/1wuzf9od14woSBseNkzur7a+KJIbh2Jb+J9KIsdGt3jJnsLW0BT1Sj6MiwL4Zzku6Q==}
/@rollup/rollup-linux-x64-gnu@4.16.4:
resolution: {integrity: sha512-LuOGGKAJ7dfRtxVnO1i3qWc6N9sh0Em/8aZ3CezixSTM+E9Oq3OvTsvC4sm6wWjzpsIlOCnZjdluINKESflJLA==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-x64-musl@4.16.3:
resolution: {integrity: sha512-guO/4N1884ig2AzTKPc6qA7OTnFMUEg/X2wiesywRO1eRD7FzHiaiTQQOLFmnUXWj2pgQXIT1g5g3e2RpezXcQ==}
/@rollup/rollup-linux-x64-musl@4.16.4:
resolution: {integrity: sha512-ch86i7KkJKkLybDP2AtySFTRi5fM3KXp0PnHocHuJMdZwu7BuyIKi35BE9guMlmTpwwBTB3ljHj9IQXnTCD0vA==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-win32-arm64-msvc@4.16.3:
resolution: {integrity: sha512-+rxD3memdkhGz0NhNqbYHXBoA33MoHBK4uubZjF1IeQv1Psi6tqgsCcC6vwQjxBM1qoCqOQQBy0cgNbbZKnGUg==}
/@rollup/rollup-win32-arm64-msvc@4.16.4:
resolution: {integrity: sha512-Ma4PwyLfOWZWayfEsNQzTDBVW8PZ6TUUN1uFTBQbF2Chv/+sjenE86lpiEwj2FiviSmSZ4Ap4MaAfl1ciF4aSA==}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-win32-ia32-msvc@4.16.3:
resolution: {integrity: sha512-0NxVbLhBXmwANWWbgZY/RdSkeuHEgF+u8Dc0qBowUVBYsR2y2vwVGjKgUcj1wtu3jpjs057io5g9HAPr3Icqjg==}
/@rollup/rollup-win32-ia32-msvc@4.16.4:
resolution: {integrity: sha512-9m/ZDrQsdo/c06uOlP3W9G2ENRVzgzbSXmXHT4hwVaDQhYcRpi9bgBT0FTG9OhESxwK0WjQxYOSfv40cU+T69w==}
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-win32-x64-msvc@4.16.3:
resolution: {integrity: sha512-hutnZavtOx/G4uVdgoZz5279By9NVbgmxOmGGgnzUjZYuwp2+NzGq6KXQmHXBWz7W/vottXn38QmKYAdQLa/vQ==}
/@rollup/rollup-win32-x64-msvc@4.16.4:
resolution: {integrity: sha512-YunpoOAyGLDseanENHmbFvQSfVL5BxW3k7hhy0eN4rb3gS/ct75dVD0EXOWIqFT/nE8XYW6LP6vz6ctKRi0k9A==}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@socket.io/component-emitter@3.1.1:
resolution: {integrity: sha512-dzJtaDAAoXx4GCOJpbB2eG/Qj8VDpdwkLsWGzGm+0L7E8/434RyMbAHmk9ubXWVAb9nXmc44jUf8GKqVDiKezg==}
/@socket.io/component-emitter@3.1.2:
resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==}
dev: false
/@sxzz/popperjs-es@2.11.7:
@ -1478,11 +1478,11 @@ packages:
estree-walker: 2.0.2
source-map-js: 1.2.0
/@vue/compiler-core@3.4.24:
resolution: {integrity: sha512-vbW/tgbwJYj62N/Ww99x0zhFTkZDTcGh3uwJEuadZ/nF9/xuFMC4693P9r+3sxGXISABpDKvffY5ApH9pmdd1A==}
/@vue/compiler-core@3.4.25:
resolution: {integrity: sha512-Y2pLLopaElgWnMNolgG8w3C5nNUVev80L7hdQ5iIKPtMJvhVpG0zhnBG/g3UajJmZdvW0fktyZTotEHD1Srhbg==}
dependencies:
'@babel/parser': 7.24.4
'@vue/shared': 3.4.24
'@vue/shared': 3.4.25
entities: 4.5.0
estree-walker: 2.0.2
source-map-js: 1.2.0
@ -1494,11 +1494,11 @@ packages:
'@vue/compiler-core': 3.4.15
'@vue/shared': 3.4.15
/@vue/compiler-dom@3.4.24:
resolution: {integrity: sha512-4XgABML/4cNndVsQndG6BbGN7+EoisDwi3oXNovqL/4jdNhwvP8/rfRMTb6FxkxIxUUtg6AI1/qZvwfSjxJiWA==}
/@vue/compiler-dom@3.4.25:
resolution: {integrity: sha512-Ugz5DusW57+HjllAugLci19NsDK+VyjGvmbB2TXaTcSlQxwL++2PETHx/+Qv6qFwNLzSt7HKepPe4DcTE3pBWg==}
dependencies:
'@vue/compiler-core': 3.4.24
'@vue/shared': 3.4.24
'@vue/compiler-core': 3.4.25
'@vue/shared': 3.4.25
dev: true
/@vue/compiler-sfc@3.4.15:
@ -1514,14 +1514,14 @@ packages:
postcss: 8.4.38
source-map-js: 1.2.0
/@vue/compiler-sfc@3.4.24:
resolution: {integrity: sha512-nRAlJUK02FTWfA2nuvNBAqsDZuERGFgxZ8sGH62XgFSvMxO2URblzulExsmj4gFZ8e+VAyDooU9oAoXfEDNxTA==}
/@vue/compiler-sfc@3.4.25:
resolution: {integrity: sha512-m7rryuqzIoQpOBZ18wKyq05IwL6qEpZxFZfRxlNYuIPDqywrXQxgUwLXIvoU72gs6cRdY6wHD0WVZIFE4OEaAQ==}
dependencies:
'@babel/parser': 7.24.4
'@vue/compiler-core': 3.4.24
'@vue/compiler-dom': 3.4.24
'@vue/compiler-ssr': 3.4.24
'@vue/shared': 3.4.24
'@vue/compiler-core': 3.4.25
'@vue/compiler-dom': 3.4.25
'@vue/compiler-ssr': 3.4.25
'@vue/shared': 3.4.25
estree-walker: 2.0.2
magic-string: 0.30.10
postcss: 8.4.38
@ -1534,11 +1534,11 @@ packages:
'@vue/compiler-dom': 3.4.15
'@vue/shared': 3.4.15
/@vue/compiler-ssr@3.4.24:
resolution: {integrity: sha512-ZsAtr4fhaUFnVcDqwW3bYCSDwq+9Gk69q2r/7dAHDrOMw41kylaMgOP4zRnn6GIEJkQznKgrMOGPMFnLB52RbQ==}
/@vue/compiler-ssr@3.4.25:
resolution: {integrity: sha512-H2ohvM/Pf6LelGxDBnfbbXFPyM4NE3hrw0e/EpwuSiYu8c819wx+SVGdJ65p/sFrYDd6OnSDxN1MB2mN07hRSQ==}
dependencies:
'@vue/compiler-dom': 3.4.24
'@vue/shared': 3.4.24
'@vue/compiler-dom': 3.4.25
'@vue/shared': 3.4.25
dev: true
/@vue/devtools-api@6.6.1:
@ -1575,8 +1575,8 @@ packages:
/@vue/shared@3.4.15:
resolution: {integrity: sha512-KzfPTxVaWfB+eGcGdbSf4CWdaXcGDqckoeXUh7SB3fZdEtzPCK2Vq9B/lRRL3yutax/LWITz+SwvgyOxz5V75g==}
/@vue/shared@3.4.24:
resolution: {integrity: sha512-BW4tajrJBM9AGAknnyEw5tO2xTmnqgup0VTnDAMcxYmqOX0RG0b9aSUGAbEKolD91tdwpA6oCwbltoJoNzpItw==}
/@vue/shared@3.4.25:
resolution: {integrity: sha512-k0yappJ77g2+KNrIaF0FFnzwLvUBLUYr8VOwz+/6vLsmItFp51AcxLL7Ey3iPd7BIRyWPOcqUjMnm7OkahXllA==}
dev: true
/@vueuse/core@10.4.0(vue@3.4.15):
@ -1996,7 +1996,7 @@ packages:
hasBin: true
dependencies:
caniuse-lite: 1.0.30001612
electron-to-chromium: 1.4.746
electron-to-chromium: 1.4.749
node-releases: 2.0.14
update-browserslist-db: 1.0.13(browserslist@4.23.0)
dev: true
@ -2285,8 +2285,8 @@ packages:
zrender: 5.4.4
dev: false
/electron-to-chromium@1.4.746:
resolution: {integrity: sha512-jeWaIta2rIG2FzHaYIhSuVWqC6KJYo7oSBX4Jv7g+aVujKztfvdpf+n6MGwZdC5hQXbax4nntykLH2juIQrfPg==}
/electron-to-chromium@1.4.749:
resolution: {integrity: sha512-LRMMrM9ITOvue0PoBrvNIraVmuDbJV5QC9ierz/z5VilMdPOVMjOtpICNld3PuXuTZ3CHH/UPxX9gHhAPwi+0Q==}
dev: true
/element-plus@2.5.6(vue@3.4.15):
@ -2314,8 +2314,8 @@ packages:
- '@vue/composition-api'
dev: false
/element-plus@2.7.1(vue@3.4.15):
resolution: {integrity: sha512-yk/vXFwJp0flMrd2kfcR0XlumhwtPjB19HJvwcf0n3DvRE7UK8LeSK14LVghSzk0TzPsFFElweMnZEEv7+MYuQ==}
/element-plus@2.7.2(vue@3.4.15):
resolution: {integrity: sha512-AdEzBU/A68iUleio0MkQ46JeU5SeQvFFd915GJFScJmUEo5AmYg3OQ4pVjcu+p3b3Nupg9MC5Wa4xjAiC51kUg==}
peerDependencies:
vue: ^3.2.0
dependencies:
@ -2350,7 +2350,7 @@ packages:
/engine.io-client@6.5.3:
resolution: {integrity: sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==}
dependencies:
'@socket.io/component-emitter': 3.1.1
'@socket.io/component-emitter': 3.1.2
debug: 4.3.4
engine.io-parser: 5.2.2
ws: 8.11.0
@ -2904,7 +2904,7 @@ packages:
dependencies:
foreground-child: 3.1.1
jackspeak: 2.3.6
minimatch: 9.0.3
minimatch: 9.0.4
minipass: 7.0.4
path-scurry: 1.10.2
dev: true
@ -3365,8 +3365,8 @@ packages:
/lodash@4.17.21:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
/lru-cache@10.2.0:
resolution: {integrity: sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==}
/lru-cache@10.2.1:
resolution: {integrity: sha512-tS24spDe/zXhWbNPErCHs/AGOzbKGHT+ybSBqmdLm8WZ1xXLWvH8Qn71QPAlqVhd0qUTWjy+Kl9JmISgDdEjsA==}
engines: {node: 14 || >=16.14}
dev: true
@ -3446,6 +3446,13 @@ packages:
brace-expansion: 2.0.1
dev: true
/minimatch@9.0.4:
resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==}
engines: {node: '>=16 || 14 >=14.17'}
dependencies:
brace-expansion: 2.0.1
dev: true
/minipass@7.0.4:
resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==}
engines: {node: '>=16 || 14 >=14.17'}
@ -3616,7 +3623,7 @@ packages:
resolution: {integrity: sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==}
engines: {node: '>=16 || 14 >=14.17'}
dependencies:
lru-cache: 10.2.0
lru-cache: 10.2.1
minipass: 7.0.4
dev: true
@ -3810,29 +3817,29 @@ packages:
yargs: 17.7.2
dev: true
/rollup@4.16.3:
resolution: {integrity: sha512-Ygm4fFO4usWcAG3Ud36Lmif5nudoi0X6QPLC+kRgrRjulAbmFkaTawP7fTIkRDnCNSf/4IAQzXM1T8e691kRtw==}
/rollup@4.16.4:
resolution: {integrity: sha512-kuaTJSUbz+Wsb2ATGvEknkI12XV40vIiHmLuFlejoo7HtDok/O5eDDD0UpCVY5bBX5U5RYo8wWP83H7ZsqVEnA==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
dependencies:
'@types/estree': 1.0.5
optionalDependencies:
'@rollup/rollup-android-arm-eabi': 4.16.3
'@rollup/rollup-android-arm64': 4.16.3
'@rollup/rollup-darwin-arm64': 4.16.3
'@rollup/rollup-darwin-x64': 4.16.3
'@rollup/rollup-linux-arm-gnueabihf': 4.16.3
'@rollup/rollup-linux-arm-musleabihf': 4.16.3
'@rollup/rollup-linux-arm64-gnu': 4.16.3
'@rollup/rollup-linux-arm64-musl': 4.16.3
'@rollup/rollup-linux-powerpc64le-gnu': 4.16.3
'@rollup/rollup-linux-riscv64-gnu': 4.16.3
'@rollup/rollup-linux-s390x-gnu': 4.16.3
'@rollup/rollup-linux-x64-gnu': 4.16.3
'@rollup/rollup-linux-x64-musl': 4.16.3
'@rollup/rollup-win32-arm64-msvc': 4.16.3
'@rollup/rollup-win32-ia32-msvc': 4.16.3
'@rollup/rollup-win32-x64-msvc': 4.16.3
'@rollup/rollup-android-arm-eabi': 4.16.4
'@rollup/rollup-android-arm64': 4.16.4
'@rollup/rollup-darwin-arm64': 4.16.4
'@rollup/rollup-darwin-x64': 4.16.4
'@rollup/rollup-linux-arm-gnueabihf': 4.16.4
'@rollup/rollup-linux-arm-musleabihf': 4.16.4
'@rollup/rollup-linux-arm64-gnu': 4.16.4
'@rollup/rollup-linux-arm64-musl': 4.16.4
'@rollup/rollup-linux-powerpc64le-gnu': 4.16.4
'@rollup/rollup-linux-riscv64-gnu': 4.16.4
'@rollup/rollup-linux-s390x-gnu': 4.16.4
'@rollup/rollup-linux-x64-gnu': 4.16.4
'@rollup/rollup-linux-x64-musl': 4.16.4
'@rollup/rollup-win32-arm64-msvc': 4.16.4
'@rollup/rollup-win32-ia32-msvc': 4.16.4
'@rollup/rollup-win32-x64-msvc': 4.16.4
fsevents: 2.3.3
dev: true
@ -3980,7 +3987,7 @@ packages:
resolution: {integrity: sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==}
engines: {node: '>=10.0.0'}
dependencies:
'@socket.io/component-emitter': 3.1.1
'@socket.io/component-emitter': 3.1.2
debug: 4.3.4
engine.io-client: 6.5.3
socket.io-parser: 4.2.4
@ -3994,7 +4001,7 @@ packages:
resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==}
engines: {node: '>=10.0.0'}
dependencies:
'@socket.io/component-emitter': 3.1.1
'@socket.io/component-emitter': 3.1.2
debug: 4.3.4
transitivePeerDependencies:
- supports-color
@ -4334,7 +4341,7 @@ packages:
'@types/node': 20.5.6
esbuild: 0.19.12
postcss: 8.4.38
rollup: 4.16.3
rollup: 4.16.4
sass: 1.66.1
terser: 5.27.0
optionalDependencies:

View File

@ -7,4 +7,7 @@
<script lang="ts" setup>
import { ElConfigProvider } from "element-plus";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { useCool } from "/@/cool";
const { service } = useCool();
</script>

2
src/env.d.ts vendored
View File

@ -1,5 +1,5 @@
/// <reference types="@cool-vue/crud/index.d.ts" />
/// <reference types="@cool-vue/vite-plugin/eps.d.ts" />
/// <reference types="../build/cool/eps.d.ts" />
interface ImportMetaEnv {
readonly VITE_NAME: string;

View File

@ -24,8 +24,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
vueJsx(),
cool({
type: "admin",
proxy,
demo: false // 是否测试模式
proxy
}),
visualizer({
open: false,