Commit 279977b817399a0e03d152e0fc1944c873480b00

Authored by vben
1 parent a5ed79fc

feat: 逐步抽离部分包到packages

.env.development
... ... @@ -4,10 +4,6 @@ VITE_USE_MOCK = true
4 4 # public path
5 5 VITE_PUBLIC_PATH = /
6 6  
7   -# Cross-domain proxy, you can configure multiple
8   -# Please note that no line breaks
9   -VITE_PROXY = [["/basic-api","http://localhost:3000"],["/upload","http://localhost:3300/upload"]]
10   -
11 7 # Basic interface address SPA
12 8 VITE_GLOB_API_URL=/basic-api
13 9  
... ...
internal/vite-config/package.json
... ... @@ -47,6 +47,7 @@
47 47 "sass": "^1.60.0",
48 48 "unocss": "^0.50.6",
49 49 "vite-plugin-compression": "^0.5.1",
  50 + "vite-plugin-dts": "^2.2.0",
50 51 "vite-plugin-html": "^3.2.0",
51 52 "vite-plugin-mock": "^2.9.6",
52 53 "vite-plugin-purge-icons": "^0.9.2",
... ...
internal/vite-config/src/config/package.ts
1   -function definePackageConfig() {
2   - // TODO:
  1 +import { type UserConfig, defineConfig, mergeConfig } from 'vite';
  2 +import { readPackageJSON } from 'pkg-types';
  3 +import { commonConfig } from './common';
  4 +import dts from 'vite-plugin-dts';
  5 +
  6 +interface DefineOptions {
  7 + overrides?: UserConfig;
  8 + options?: {};
  9 +}
  10 +
  11 +function definePackageConfig(defineOptions: DefineOptions = {}) {
  12 + const { overrides = {} } = defineOptions;
  13 + const root = process.cwd();
  14 + return defineConfig(async () => {
  15 + const { dependencies = {}, peerDependencies = {} } = await readPackageJSON(root);
  16 + const packageConfig: UserConfig = {
  17 + build: {
  18 + lib: {
  19 + entry: 'src/index.ts',
  20 + formats: ['es'],
  21 + fileName: () => 'index.mjs',
  22 + },
  23 + rollupOptions: {
  24 + external: [...Object.keys(dependencies), ...Object.keys(peerDependencies)],
  25 + },
  26 + },
  27 + plugins: [
  28 + dts({
  29 + logLevel: 'error',
  30 + }),
  31 + ],
  32 + };
  33 + const mergedConfig = mergeConfig(commonConfig, packageConfig);
  34 +
  35 + return mergeConfig(mergedConfig, overrides);
  36 + });
3 37 }
4 38  
5 39 export { definePackageConfig };
... ...
internal/vite-config/src/index.ts
1 1 export * from './config/application';
  2 +export * from './config/package';
... ...
package.json
... ... @@ -70,6 +70,7 @@
70 70 "@iconify/iconify": "^3.1.0",
71 71 "@logicflow/core": "^1.2.1",
72 72 "@logicflow/extension": "^1.2.1",
  73 + "@vben/hooks": "workspace:*",
73 74 "@vueuse/core": "^9.13.0",
74 75 "@vueuse/shared": "^9.13.0",
75 76 "@zxcvbn-ts/core": "^2.2.1",
... ...
packages/hooks/.commitlintrc.js 0 → 100644
  1 +const fs = require('fs');
  2 +const path = require('path');
  3 +const { execSync } = require('child_process');
  4 +
  5 +const scopes = fs
  6 + .readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
  7 + .filter((dirent) => dirent.isDirectory())
  8 + .map((dirent) => dirent.name.replace(/s$/, ''));
  9 +
  10 +// precomputed scope
  11 +const scopeComplete = execSync('git status --porcelain || true')
  12 + .toString()
  13 + .trim()
  14 + .split('\n')
  15 + .find((r) => ~r.indexOf('M src'))
  16 + ?.replace(/(\/)/g, '%%')
  17 + ?.match(/src%%((\w|-)*)/)?.[1]
  18 + ?.replace(/s$/, '');
  19 +
  20 +/** @type {import('cz-git').UserConfig} */
  21 +module.exports = {
  22 + ignores: [(commit) => commit.includes('init')],
  23 + extends: ['@commitlint/config-conventional'],
  24 + rules: {
  25 + 'body-leading-blank': [2, 'always'],
  26 + 'footer-leading-blank': [1, 'always'],
  27 + 'header-max-length': [2, 'always', 108],
  28 + 'subject-empty': [2, 'never'],
  29 + 'type-empty': [2, 'never'],
  30 + 'subject-case': [0],
  31 + 'type-enum': [
  32 + 2,
  33 + 'always',
  34 + [
  35 + 'feat',
  36 + 'fix',
  37 + 'perf',
  38 + 'style',
  39 + 'docs',
  40 + 'test',
  41 + 'refactor',
  42 + 'build',
  43 + 'ci',
  44 + 'chore',
  45 + 'revert',
  46 + 'wip',
  47 + 'workflow',
  48 + 'types',
  49 + 'release',
  50 + ],
  51 + ],
  52 + },
  53 + prompt: {
  54 + /** @use `yarn commit :f` */
  55 + alias: {
  56 + f: 'docs: fix typos',
  57 + r: 'docs: update README',
  58 + s: 'style: update code format',
  59 + b: 'build: bump dependencies',
  60 + c: 'chore: update config',
  61 + },
  62 + customScopesAlign: !scopeComplete ? 'top' : 'bottom',
  63 + defaultScope: scopeComplete,
  64 + scopes: [...scopes, 'mock'],
  65 + allowEmptyIssuePrefixs: false,
  66 + allowCustomIssuePrefixs: false,
  67 +
  68 + // English
  69 + typesAppend: [
  70 + { value: 'wip', name: 'wip: work in process' },
  71 + { value: 'workflow', name: 'workflow: workflow improvements' },
  72 + { value: 'types', name: 'types: type definition file changes' },
  73 + ],
  74 +
  75 + // 中英文对照版
  76 + // messages: {
  77 + // type: '选择你要提交的类型 :',
  78 + // scope: '选择一个提交范围 (可选):',
  79 + // customScope: '请输入自定义的提交范围 :',
  80 + // subject: '填写简短精炼的变更描述 :\n',
  81 + // body: '填写更加详细的变更描述 (可选)。使用 "|" 换行 :\n',
  82 + // breaking: '列举非兼容性重大的变更 (可选)。使用 "|" 换行 :\n',
  83 + // footerPrefixsSelect: '选择关联issue前缀 (可选):',
  84 + // customFooterPrefixs: '输入自定义issue前缀 :',
  85 + // footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
  86 + // confirmCommit: '是否提交或修改commit ?',
  87 + // },
  88 + // types: [
  89 + // { value: 'feat', name: 'feat: 新增功能' },
  90 + // { value: 'fix', name: 'fix: 修复缺陷' },
  91 + // { value: 'docs', name: 'docs: 文档变更' },
  92 + // { value: 'style', name: 'style: 代码格式' },
  93 + // { value: 'refactor', name: 'refactor: 代码重构' },
  94 + // { value: 'perf', name: 'perf: 性能优化' },
  95 + // { value: 'test', name: 'test: 添加疏漏测试或已有测试改动' },
  96 + // { value: 'build', name: 'build: 构建流程、外部依赖变更 (如升级 npm 包、修改打包配置等)' },
  97 + // { value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
  98 + // { value: 'revert', name: 'revert: 回滚 commit' },
  99 + // { value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' },
  100 + // { value: 'wip', name: 'wip: 正在开发中' },
  101 + // { value: 'workflow', name: 'workflow: 工作流程改进' },
  102 + // { value: 'types', name: 'types: 类型定义文件修改' },
  103 + // ],
  104 + // emptyScopesAlias: 'empty: 不填写',
  105 + // customScopesAlias: 'custom: 自定义',
  106 + },
  107 +};
... ...
packages/hooks/.eslintignore 0 → 100644
  1 +
  2 +*.sh
  3 +node_modules
  4 +*.md
  5 +*.woff
  6 +*.ttf
  7 +.vscode
  8 +.idea
  9 +dist
  10 +/public
  11 +/docs
  12 +.husky
  13 +.local
  14 +/bin
  15 +Dockerfile
... ...
packages/hooks/.eslintrc.js 0 → 100644
  1 +module.exports = {
  2 + root: true,
  3 + extends: ['@vben'],
  4 +};
... ...
packages/hooks/.prettierignore 0 → 100644
  1 +dist
  2 +.local
  3 +.output.js
  4 +node_modules
  5 +
  6 +**/*.svg
  7 +**/*.sh
  8 +
  9 +public
  10 +.npmrc
... ...
packages/hooks/.prettierrc.js 0 → 100644
  1 +module.exports = {
  2 + printWidth: 100,
  3 + semi: true,
  4 + vueIndentScriptAndStyle: true,
  5 + singleQuote: true,
  6 + trailingComma: 'all',
  7 + proseWrap: 'never',
  8 + htmlWhitespaceSensitivity: 'strict',
  9 + endOfLine: 'auto',
  10 + plugins: ['prettier-plugin-packagejson'],
  11 + overrides: [
  12 + {
  13 + files: '.*rc',
  14 + options: {
  15 + parser: 'json',
  16 + },
  17 + },
  18 + ],
  19 +};
... ...
packages/hooks/.stylelintignore 0 → 100644
  1 +dist
  2 +public
... ...
packages/hooks/.stylelintrc.js 0 → 100644
  1 +module.exports = {
  2 + root: true,
  3 + extends: ['@vben/stylelint-config'],
  4 +};
... ...
packages/hooks/build.config.ts 0 → 100644
  1 +import { defineBuildConfig } from 'unbuild';
  2 +
  3 +export default defineBuildConfig({
  4 + clean: true,
  5 + entries: ['src/index'],
  6 + declaration: true,
  7 + rollup: {
  8 + emitCJS: true,
  9 + },
  10 +});
... ...
packages/hooks/package.json 0 → 100644
  1 +{
  2 + "name": "@vben/hooks",
  3 + "version": "1.0.0",
  4 + "homepage": "https://github.com/vbenjs/vue-vben-admin",
  5 + "bugs": {
  6 + "url": "https://github.com/vbenjs/vue-vben-admin/issues"
  7 + },
  8 + "repository": {
  9 + "type": "git",
  10 + "url": "git+https://github.com/vbenjs/vue-vben-admin.git",
  11 + "directory": "packages/hooks"
  12 + },
  13 + "license": "MIT",
  14 + "sideEffects": false,
  15 + "exports": {
  16 + ".": {
  17 + "default": "./src/index.ts"
  18 + }
  19 + },
  20 + "main": "./src/index.ts",
  21 + "module": "./src/index.ts",
  22 + "files": [
  23 + "dist"
  24 + ],
  25 + "scripts": {
  26 + "//build": "pnpm unbuild",
  27 + "//stub": "pnpm unbuild --stub",
  28 + "clean": "pnpm rimraf .turbo node_modules dist",
  29 + "lint": "pnpm eslint ."
  30 + },
  31 + "dependencies": {
  32 + "@vueuse/core": "^9.13.0",
  33 + "vue": "^3.2.47"
  34 + },
  35 + "devDependencies": {
  36 + "@vben/types": "workspace:*"
  37 + }
  38 +}
... ...
packages/hooks/src/index.ts 0 → 100644
  1 +// life-cycle
  2 +export * from './lifecycle/onMountedOrActivated';
... ...
src/hooks/core/onMountedOrActivated.ts renamed to packages/hooks/src/lifecycle/onMountedOrActivated.ts
  1 +import { type AnyFunction } from '@vben/types';
1 2 import { nextTick, onMounted, onActivated } from 'vue';
2 3  
3   -export function onMountedOrActivated(hook: Fn) {
  4 +/**
  5 + * 在 OnMounted 或者 OnActivated 时触发
  6 + * @param hook 任何函数(包括异步函数)
  7 + */
  8 +function onMountedOrActivated(hook: AnyFunction) {
4 9 let mounted: boolean;
5 10  
6 11 onMounted(() => {
... ... @@ -16,3 +21,5 @@ export function onMountedOrActivated(hook: Fn) {
16 21 }
17 22 });
18 23 }
  24 +
  25 +export { onMountedOrActivated };
... ...
packages/hooks/tsconfig.json 0 → 100644
  1 +{
  2 + "$schema": "https://json.schemastore.org/tsconfig",
  3 + "extends": "@vben/ts-config/vue.json",
  4 + "include": ["src"]
  5 +}
... ...
packages/types/.commitlintrc.js 0 → 100644
  1 +const fs = require('fs');
  2 +const path = require('path');
  3 +const { execSync } = require('child_process');
  4 +
  5 +const scopes = fs
  6 + .readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
  7 + .filter((dirent) => dirent.isDirectory())
  8 + .map((dirent) => dirent.name.replace(/s$/, ''));
  9 +
  10 +// precomputed scope
  11 +const scopeComplete = execSync('git status --porcelain || true')
  12 + .toString()
  13 + .trim()
  14 + .split('\n')
  15 + .find((r) => ~r.indexOf('M src'))
  16 + ?.replace(/(\/)/g, '%%')
  17 + ?.match(/src%%((\w|-)*)/)?.[1]
  18 + ?.replace(/s$/, '');
  19 +
  20 +/** @type {import('cz-git').UserConfig} */
  21 +module.exports = {
  22 + ignores: [(commit) => commit.includes('init')],
  23 + extends: ['@commitlint/config-conventional'],
  24 + rules: {
  25 + 'body-leading-blank': [2, 'always'],
  26 + 'footer-leading-blank': [1, 'always'],
  27 + 'header-max-length': [2, 'always', 108],
  28 + 'subject-empty': [2, 'never'],
  29 + 'type-empty': [2, 'never'],
  30 + 'subject-case': [0],
  31 + 'type-enum': [
  32 + 2,
  33 + 'always',
  34 + [
  35 + 'feat',
  36 + 'fix',
  37 + 'perf',
  38 + 'style',
  39 + 'docs',
  40 + 'test',
  41 + 'refactor',
  42 + 'build',
  43 + 'ci',
  44 + 'chore',
  45 + 'revert',
  46 + 'wip',
  47 + 'workflow',
  48 + 'types',
  49 + 'release',
  50 + ],
  51 + ],
  52 + },
  53 + prompt: {
  54 + /** @use `yarn commit :f` */
  55 + alias: {
  56 + f: 'docs: fix typos',
  57 + r: 'docs: update README',
  58 + s: 'style: update code format',
  59 + b: 'build: bump dependencies',
  60 + c: 'chore: update config',
  61 + },
  62 + customScopesAlign: !scopeComplete ? 'top' : 'bottom',
  63 + defaultScope: scopeComplete,
  64 + scopes: [...scopes, 'mock'],
  65 + allowEmptyIssuePrefixs: false,
  66 + allowCustomIssuePrefixs: false,
  67 +
  68 + // English
  69 + typesAppend: [
  70 + { value: 'wip', name: 'wip: work in process' },
  71 + { value: 'workflow', name: 'workflow: workflow improvements' },
  72 + { value: 'types', name: 'types: type definition file changes' },
  73 + ],
  74 +
  75 + // 中英文对照版
  76 + // messages: {
  77 + // type: '选择你要提交的类型 :',
  78 + // scope: '选择一个提交范围 (可选):',
  79 + // customScope: '请输入自定义的提交范围 :',
  80 + // subject: '填写简短精炼的变更描述 :\n',
  81 + // body: '填写更加详细的变更描述 (可选)。使用 "|" 换行 :\n',
  82 + // breaking: '列举非兼容性重大的变更 (可选)。使用 "|" 换行 :\n',
  83 + // footerPrefixsSelect: '选择关联issue前缀 (可选):',
  84 + // customFooterPrefixs: '输入自定义issue前缀 :',
  85 + // footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
  86 + // confirmCommit: '是否提交或修改commit ?',
  87 + // },
  88 + // types: [
  89 + // { value: 'feat', name: 'feat: 新增功能' },
  90 + // { value: 'fix', name: 'fix: 修复缺陷' },
  91 + // { value: 'docs', name: 'docs: 文档变更' },
  92 + // { value: 'style', name: 'style: 代码格式' },
  93 + // { value: 'refactor', name: 'refactor: 代码重构' },
  94 + // { value: 'perf', name: 'perf: 性能优化' },
  95 + // { value: 'test', name: 'test: 添加疏漏测试或已有测试改动' },
  96 + // { value: 'build', name: 'build: 构建流程、外部依赖变更 (如升级 npm 包、修改打包配置等)' },
  97 + // { value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
  98 + // { value: 'revert', name: 'revert: 回滚 commit' },
  99 + // { value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' },
  100 + // { value: 'wip', name: 'wip: 正在开发中' },
  101 + // { value: 'workflow', name: 'workflow: 工作流程改进' },
  102 + // { value: 'types', name: 'types: 类型定义文件修改' },
  103 + // ],
  104 + // emptyScopesAlias: 'empty: 不填写',
  105 + // customScopesAlias: 'custom: 自定义',
  106 + },
  107 +};
... ...
packages/types/.eslintignore 0 → 100644
  1 +
  2 +*.sh
  3 +node_modules
  4 +*.md
  5 +*.woff
  6 +*.ttf
  7 +.vscode
  8 +.idea
  9 +dist
  10 +/public
  11 +/docs
  12 +.husky
  13 +.local
  14 +/bin
  15 +Dockerfile
... ...
packages/types/.eslintrc.js 0 → 100644
  1 +module.exports = {
  2 + root: true,
  3 + extends: ['@vben'],
  4 +};
... ...
packages/types/.prettierignore 0 → 100644
  1 +dist
  2 +.local
  3 +.output.js
  4 +node_modules
  5 +
  6 +**/*.svg
  7 +**/*.sh
  8 +
  9 +public
  10 +.npmrc
... ...
packages/types/.prettierrc.js 0 → 100644
  1 +module.exports = {
  2 + printWidth: 100,
  3 + semi: true,
  4 + vueIndentScriptAndStyle: true,
  5 + singleQuote: true,
  6 + trailingComma: 'all',
  7 + proseWrap: 'never',
  8 + htmlWhitespaceSensitivity: 'strict',
  9 + endOfLine: 'auto',
  10 + plugins: ['prettier-plugin-packagejson'],
  11 + overrides: [
  12 + {
  13 + files: '.*rc',
  14 + options: {
  15 + parser: 'json',
  16 + },
  17 + },
  18 + ],
  19 +};
... ...
packages/types/.stylelintignore 0 → 100644
  1 +dist
  2 +public
... ...
packages/types/.stylelintrc.js 0 → 100644
  1 +module.exports = {
  2 + root: true,
  3 + extends: ['@vben/stylelint-config'],
  4 +};
... ...
packages/types/build.config.ts 0 → 100644
  1 +import { defineBuildConfig } from 'unbuild';
  2 +
  3 +export default defineBuildConfig({
  4 + clean: true,
  5 + entries: ['src/index'],
  6 + declaration: true,
  7 + rollup: {
  8 + emitCJS: true,
  9 + },
  10 +});
... ...
packages/types/package.json 0 → 100644
  1 +{
  2 + "name": "@vben/types",
  3 + "version": "1.0.0",
  4 + "homepage": "https://github.com/vbenjs/vue-vben-admin",
  5 + "bugs": {
  6 + "url": "https://github.com/vbenjs/vue-vben-admin/issues"
  7 + },
  8 + "repository": {
  9 + "type": "git",
  10 + "url": "git+https://github.com/vbenjs/vue-vben-admin.git",
  11 + "directory": "packages/types"
  12 + },
  13 + "license": "MIT",
  14 + "sideEffects": false,
  15 + "exports": {
  16 + ".": {
  17 + "default": "./src/index.ts"
  18 + }
  19 + },
  20 + "main": "./src/index.ts",
  21 + "module": "./src/index.ts",
  22 + "files": [
  23 + "dist"
  24 + ],
  25 + "scripts": {
  26 + "//build": "pnpm unbuild",
  27 + "//stub": "pnpm unbuild --stub",
  28 + "clean": "pnpm rimraf .turbo node_modules dist",
  29 + "lint": "pnpm eslint ."
  30 + }
  31 +}
... ...
packages/types/src/index.ts 0 → 100644
  1 +export * from './utils';
... ...
packages/types/src/utils.ts 0 → 100644
  1 +/**
  2 + * 任意类型的函数
  3 + */
  4 +type AnyFunction = AnyNormalFunction | AnyPromiseFunction;
  5 +
  6 +/**
  7 + * 任意类型的异步函数
  8 + */
  9 +type AnyPromiseFunction = (...arg: any) => PromiseLike<any>;
  10 +
  11 +/**
  12 + * 任意类型的普通函数
  13 + */
  14 +type AnyNormalFunction = (...arg: any) => any;
  15 +
  16 +export { type AnyFunction, type AnyPromiseFunction, type AnyNormalFunction };
... ...
packages/types/tsconfig.json 0 → 100644
  1 +{
  2 + "$schema": "https://json.schemastore.org/tsconfig",
  3 + "extends": "@vben/ts-config/vue.json",
  4 + "include": ["src"]
  5 +}
... ...
pnpm-lock.yaml
... ... @@ -16,6 +16,9 @@ importers:
16 16 '@logicflow/extension':
17 17 specifier: ^1.2.1
18 18 version: 1.2.1
  19 + '@vben/hooks':
  20 + specifier: workspace:*
  21 + version: link:packages/hooks
19 22 '@vueuse/core':
20 23 specifier: ^9.13.0
21 24 version: 9.13.0(vue@3.2.47)
... ... @@ -415,6 +418,9 @@ importers:
415 418 vite-plugin-compression:
416 419 specifier: ^0.5.1
417 420 version: 0.5.1(vite@4.3.0-beta.1)
  421 + vite-plugin-dts:
  422 + specifier: ^2.2.0
  423 + version: 2.2.0(@types/node@18.15.11)(rollup@2.79.1)(vite@4.3.0-beta.1)
418 424 vite-plugin-html:
419 425 specifier: ^3.2.0
420 426 version: 3.2.0(vite@4.3.0-beta.1)
... ... @@ -428,6 +434,21 @@ importers:
428 434 specifier: ^2.0.1
429 435 version: 2.0.1(vite@4.3.0-beta.1)
430 436  
  437 + packages/hooks:
  438 + dependencies:
  439 + '@vueuse/core':
  440 + specifier: ^9.13.0
  441 + version: 9.13.0(vue@3.2.47)
  442 + vue:
  443 + specifier: ^3.2.47
  444 + version: 3.2.47
  445 + devDependencies:
  446 + '@vben/types':
  447 + specifier: workspace:*
  448 + version: link:../types
  449 +
  450 + packages/types: {}
  451 +
431 452 packages:
432 453  
433 454 /@ampproject/remapping@2.2.0:
... ... @@ -1391,6 +1412,49 @@ packages:
1391 1412 preact: 10.13.2
1392 1413 dev: false
1393 1414  
  1415 + /@microsoft/api-extractor-model@7.26.4(@types/node@18.15.11):
  1416 + resolution: {integrity: sha512-PDCgCzXDo+SLY5bsfl4bS7hxaeEtnXj7XtuzEE+BtALp7B5mK/NrS2kHWU69pohgsRmEALycQdaQPXoyT2i5MQ==}
  1417 + dependencies:
  1418 + '@microsoft/tsdoc': 0.14.2
  1419 + '@microsoft/tsdoc-config': 0.16.2
  1420 + '@rushstack/node-core-library': 3.55.2(@types/node@18.15.11)
  1421 + transitivePeerDependencies:
  1422 + - '@types/node'
  1423 + dev: true
  1424 +
  1425 + /@microsoft/api-extractor@7.34.4(@types/node@18.15.11):
  1426 + resolution: {integrity: sha512-HOdcci2nT40ejhwPC3Xja9G+WSJmWhCUKKryRfQYsmE9cD+pxmBaKBKCbuS9jUcl6bLLb4Gz+h7xEN5r0QiXnQ==}
  1427 + hasBin: true
  1428 + dependencies:
  1429 + '@microsoft/api-extractor-model': 7.26.4(@types/node@18.15.11)
  1430 + '@microsoft/tsdoc': 0.14.2
  1431 + '@microsoft/tsdoc-config': 0.16.2
  1432 + '@rushstack/node-core-library': 3.55.2(@types/node@18.15.11)
  1433 + '@rushstack/rig-package': 0.3.18
  1434 + '@rushstack/ts-command-line': 4.13.2
  1435 + colors: 1.2.5
  1436 + lodash: 4.17.21
  1437 + resolve: 1.22.1
  1438 + semver: 7.3.8
  1439 + source-map: 0.6.1
  1440 + typescript: 4.8.4
  1441 + transitivePeerDependencies:
  1442 + - '@types/node'
  1443 + dev: true
  1444 +
  1445 + /@microsoft/tsdoc-config@0.16.2:
  1446 + resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==}
  1447 + dependencies:
  1448 + '@microsoft/tsdoc': 0.14.2
  1449 + ajv: 6.12.6
  1450 + jju: 1.4.0
  1451 + resolve: 1.19.0
  1452 + dev: true
  1453 +
  1454 + /@microsoft/tsdoc@0.14.2:
  1455 + resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==}
  1456 + dev: true
  1457 +
1394 1458 /@nodelib/fs.scandir@2.1.5:
1395 1459 resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
1396 1460 engines: {node: '>= 8'}
... ... @@ -1681,6 +1745,40 @@ packages:
1681 1745 rollup: 3.20.2
1682 1746 dev: true
1683 1747  
  1748 + /@rushstack/node-core-library@3.55.2(@types/node@18.15.11):
  1749 + resolution: {integrity: sha512-SaLe/x/Q/uBVdNFK5V1xXvsVps0y7h1sN7aSJllQyFbugyOaxhNRF25bwEDnicARNEjJw0pk0lYnJQ9Kr6ev0A==}
  1750 + peerDependencies:
  1751 + '@types/node': '*'
  1752 + peerDependenciesMeta:
  1753 + '@types/node':
  1754 + optional: true
  1755 + dependencies:
  1756 + '@types/node': 18.15.11
  1757 + colors: 1.2.5
  1758 + fs-extra: 7.0.1
  1759 + import-lazy: 4.0.0
  1760 + jju: 1.4.0
  1761 + resolve: 1.22.1
  1762 + semver: 7.3.8
  1763 + z-schema: 5.0.5
  1764 + dev: true
  1765 +
  1766 + /@rushstack/rig-package@0.3.18:
  1767 + resolution: {integrity: sha512-SGEwNTwNq9bI3pkdd01yCaH+gAsHqs0uxfGvtw9b0LJXH52qooWXnrFTRRLG1aL9pf+M2CARdrA9HLHJys3jiQ==}
  1768 + dependencies:
  1769 + resolve: 1.22.1
  1770 + strip-json-comments: 3.1.1
  1771 + dev: true
  1772 +
  1773 + /@rushstack/ts-command-line@4.13.2:
  1774 + resolution: {integrity: sha512-bCU8qoL9HyWiciltfzg7GqdfODUeda/JpI0602kbN5YH22rzTxyqYvv7aRLENCM7XCQ1VRs7nMkEqgJUOU8Sag==}
  1775 + dependencies:
  1776 + '@types/argparse': 1.0.38
  1777 + argparse: 1.0.10
  1778 + colors: 1.2.5
  1779 + string-argv: 0.3.1
  1780 + dev: true
  1781 +
1684 1782 /@simonwep/pickr@1.8.2:
1685 1783 resolution: {integrity: sha512-/l5w8BIkrpP6n1xsetx9MWPWlU6OblN5YgZZphxan0Tq4BByTCETL6lyIeY8lagalS2Nbt4F2W034KHLIiunKA==}
1686 1784 dependencies:
... ... @@ -1697,6 +1795,15 @@ packages:
1697 1795 engines: {node: '>=10.13.0'}
1698 1796 dev: true
1699 1797  
  1798 + /@ts-morph/common@0.18.1:
  1799 + resolution: {integrity: sha512-RVE+zSRICWRsfrkAw5qCAK+4ZH9kwEFv5h0+/YeHTLieWP7F4wWq4JsKFuNWG+fYh/KF+8rAtgdj5zb2mm+DVA==}
  1800 + dependencies:
  1801 + fast-glob: 3.2.12
  1802 + minimatch: 5.1.6
  1803 + mkdirp: 1.0.4
  1804 + path-browserify: 1.0.1
  1805 + dev: true
  1806 +
1700 1807 /@tsconfig/node10@1.0.9:
1701 1808 resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
1702 1809 dev: true
... ... @@ -1718,6 +1825,10 @@ packages:
1718 1825 dependencies:
1719 1826 '@types/node': 18.15.11
1720 1827  
  1828 + /@types/argparse@1.0.38:
  1829 + resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==}
  1830 + dev: true
  1831 +
1721 1832 /@types/body-parser@1.19.2:
1722 1833 resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==}
1723 1834 dependencies:
... ... @@ -3206,6 +3317,10 @@ packages:
3206 3317 engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
3207 3318 dev: false
3208 3319  
  3320 + /code-block-writer@11.0.3:
  3321 + resolution: {integrity: sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==}
  3322 + dev: true
  3323 +
3209 3324 /codemirror@5.65.12:
3210 3325 resolution: {integrity: sha512-z2jlHBocElRnPYysN2HAuhXbO3DNB0bcSKmNz3hcWR2Js2Dkhc1bEOxG93Z3DeUrnm+qx56XOY5wQmbP5KY0sw==}
3211 3326 dev: false
... ... @@ -3250,6 +3365,11 @@ packages:
3250 3365 resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==}
3251 3366 dev: true
3252 3367  
  3368 + /colors@1.2.5:
  3369 + resolution: {integrity: sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==}
  3370 + engines: {node: '>=0.1.90'}
  3371 + dev: true
  3372 +
3253 3373 /combined-stream@1.0.8:
3254 3374 resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
3255 3375 engines: {node: '>= 0.8'}
... ... @@ -3287,7 +3407,6 @@ packages:
3287 3407 /commander@9.5.0:
3288 3408 resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
3289 3409 engines: {node: ^12.20.0 || >=14}
3290   - dev: false
3291 3410  
3292 3411 /commondir@1.0.1:
3293 3412 resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
... ... @@ -4543,6 +4662,15 @@ packages:
4543 4662 jsonfile: 6.1.0
4544 4663 universalify: 2.0.0
4545 4664  
  4665 + /fs-extra@7.0.1:
  4666 + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
  4667 + engines: {node: '>=6 <7 || >=8'}
  4668 + dependencies:
  4669 + graceful-fs: 4.2.11
  4670 + jsonfile: 4.0.0
  4671 + universalify: 0.1.2
  4672 + dev: true
  4673 +
4546 4674 /fs-extra@8.1.0:
4547 4675 resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
4548 4676 engines: {node: '>=6 <7 || >=8'}
... ... @@ -5350,6 +5478,10 @@ packages:
5350 5478 hasBin: true
5351 5479 dev: true
5352 5480  
  5481 + /jju@1.4.0:
  5482 + resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==}
  5483 + dev: true
  5484 +
5353 5485 /joycon@3.1.1:
5354 5486 resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
5355 5487 engines: {node: '>=10'}
... ... @@ -5791,6 +5923,10 @@ packages:
5791 5923 resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==}
5792 5924 dev: false
5793 5925  
  5926 + /lodash.get@4.4.2:
  5927 + resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==}
  5928 + dev: true
  5929 +
5794 5930 /lodash.groupby@4.6.0:
5795 5931 resolution: {integrity: sha512-5dcWxm23+VAoz+awKmBaiBvzox8+RqMgFhi7UvX9DHZr2HdxHXM/Wrf8cfKpsW37RNrvtPn6hSwNqurSILbmJw==}
5796 5932 dev: false
... ... @@ -5801,7 +5937,6 @@ packages:
5801 5937  
5802 5938 /lodash.isequal@4.5.0:
5803 5939 resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
5804   - dev: false
5805 5940  
5806 5941 /lodash.isfunction@3.0.9:
5807 5942 resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==}
... ... @@ -5923,6 +6058,13 @@ packages:
5923 6058 '@jridgewell/sourcemap-codec': 1.4.14
5924 6059 dev: true
5925 6060  
  6061 + /magic-string@0.29.0:
  6062 + resolution: {integrity: sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q==}
  6063 + engines: {node: '>=12'}
  6064 + dependencies:
  6065 + '@jridgewell/sourcemap-codec': 1.4.14
  6066 + dev: true
  6067 +
5926 6068 /magic-string@0.30.0:
5927 6069 resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==}
5928 6070 engines: {node: '>=12'}
... ... @@ -6661,6 +6803,10 @@ packages:
6661 6803 engines: {node: '>=0.10.0'}
6662 6804 dev: true
6663 6805  
  6806 + /path-browserify@1.0.1:
  6807 + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==}
  6808 + dev: true
  6809 +
6664 6810 /path-exists@4.0.0:
6665 6811 resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
6666 6812 engines: {node: '>=8'}
... ... @@ -7330,6 +7476,13 @@ packages:
7330 7476 deprecated: https://github.com/lydell/resolve-url#deprecated
7331 7477 dev: true
7332 7478  
  7479 + /resolve@1.19.0:
  7480 + resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==}
  7481 + dependencies:
  7482 + is-core-module: 2.11.0
  7483 + path-parse: 1.0.7
  7484 + dev: true
  7485 +
7333 7486 /resolve@1.22.1:
7334 7487 resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==}
7335 7488 hasBin: true
... ... @@ -8397,6 +8550,13 @@ packages:
8397 8550 resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
8398 8551 dev: true
8399 8552  
  8553 + /ts-morph@17.0.1:
  8554 + resolution: {integrity: sha512-10PkHyXmrtsTvZSL+cqtJLTgFXkU43Gd0JCc0Rw6GchWbqKe0Rwgt1v3ouobTZwQzF1mGhDeAlWYBMGRV7y+3g==}
  8555 + dependencies:
  8556 + '@ts-morph/common': 0.18.1
  8557 + code-block-writer: 11.0.3
  8558 + dev: true
  8559 +
8400 8560 /ts-node@10.9.1(@types/node@18.15.11)(typescript@5.0.3):
8401 8561 resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
8402 8562 hasBin: true
... ... @@ -8623,6 +8783,12 @@ packages:
8623 8783 mime-types: 2.1.35
8624 8784 dev: false
8625 8785  
  8786 + /typescript@4.8.4:
  8787 + resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==}
  8788 + engines: {node: '>=4.2.0'}
  8789 + hasBin: true
  8790 + dev: true
  8791 +
8626 8792 /typescript@5.0.3:
8627 8793 resolution: {integrity: sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==}
8628 8794 engines: {node: '>=12.20'}
... ... @@ -8834,6 +9000,11 @@ packages:
8834 9000 spdx-expression-parse: 3.0.1
8835 9001 dev: true
8836 9002  
  9003 + /validator@13.9.0:
  9004 + resolution: {integrity: sha512-B+dGG8U3fdtM0/aNK4/X8CXq/EcxU2WPrPEkJGslb47qyHsxmbggTWK0yEA4qnYVNF+nxNlN88o14hIcPmSIEA==}
  9005 + engines: {node: '>= 0.10'}
  9006 + dev: true
  9007 +
8837 9008 /vary@1.1.2:
8838 9009 resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
8839 9010 engines: {node: '>= 0.8'}
... ... @@ -8857,6 +9028,29 @@ packages:
8857 9028 - supports-color
8858 9029 dev: true
8859 9030  
  9031 + /vite-plugin-dts@2.2.0(@types/node@18.15.11)(rollup@2.79.1)(vite@4.3.0-beta.1):
  9032 + resolution: {integrity: sha512-XmZtv02I7eGWm3DrZbLo1AdJK5gCisk9GqJBpY4N63pDYR6AVUnlyjFP5FCBvSBUfgE0Ppl90bKgtJU9k3AzFw==}
  9033 + engines: {node: ^14.18.0 || >=16.0.0}
  9034 + peerDependencies:
  9035 + vite: '>=2.9.0'
  9036 + dependencies:
  9037 + '@babel/parser': 7.21.4
  9038 + '@microsoft/api-extractor': 7.34.4(@types/node@18.15.11)
  9039 + '@rollup/pluginutils': 5.0.2(rollup@2.79.1)
  9040 + '@rushstack/node-core-library': 3.55.2(@types/node@18.15.11)
  9041 + debug: 4.3.4
  9042 + fast-glob: 3.2.12
  9043 + fs-extra: 10.1.0
  9044 + kolorist: 1.7.0
  9045 + magic-string: 0.29.0
  9046 + ts-morph: 17.0.1
  9047 + vite: 4.3.0-beta.1(@types/node@18.15.11)(less@4.1.3)(sass@1.60.0)
  9048 + transitivePeerDependencies:
  9049 + - '@types/node'
  9050 + - rollup
  9051 + - supports-color
  9052 + dev: true
  9053 +
8860 9054 /vite-plugin-html@3.2.0(vite@4.3.0-beta.1):
8861 9055 resolution: {integrity: sha512-2VLCeDiHmV/BqqNn5h2V+4280KRgQzCFN47cst3WiNK848klESPQnzuC3okH5XHtgwHH/6s1Ho/YV6yIO0pgoQ==}
8862 9056 peerDependencies:
... ... @@ -9389,6 +9583,18 @@ packages:
9389 9583 engines: {node: '>=10'}
9390 9584 dev: true
9391 9585  
  9586 + /z-schema@5.0.5:
  9587 + resolution: {integrity: sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==}
  9588 + engines: {node: '>=8.0.0'}
  9589 + hasBin: true
  9590 + dependencies:
  9591 + lodash.get: 4.4.2
  9592 + lodash.isequal: 4.5.0
  9593 + validator: 13.9.0
  9594 + optionalDependencies:
  9595 + commander: 9.5.0
  9596 + dev: true
  9597 +
9392 9598 /zip-stream@4.1.0:
9393 9599 resolution: {integrity: sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A==}
9394 9600 engines: {node: '>= 10'}
... ...
src/components/Markdown/src/Markdown.vue
... ... @@ -18,7 +18,7 @@
18 18 import { useLocale } from '/@/locales/useLocale';
19 19 import { useModalContext } from '../../Modal';
20 20 import { useRootSetting } from '/@/hooks/setting/useRootSetting';
21   - import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
  21 + import { onMountedOrActivated } from '@vben/hooks';
22 22 import { getTheme } from './getTheme';
23 23  
24 24 type Lang = 'zh_CN' | 'en_US' | 'ja_JP' | 'ko_KR' | undefined;
... ... @@ -31,8 +31,8 @@
31 31 },
32 32 emits: ['change', 'get', 'update:value'],
33 33 setup(props, { attrs, emit }) {
34   - const wrapRef = ref<ElRef>(null);
35   - const vditorRef = ref(null) as Ref<Nullable<Vditor>>;
  34 + const wrapRef = ref(null);
  35 + const vditorRef = ref(null) as Ref<Vditor | null>;
36 36 const initedRef = ref(false);
37 37  
38 38 const modalFn = useModalContext();
... ... @@ -85,7 +85,7 @@
85 85 return lang;
86 86 });
87 87 function init() {
88   - const wrapEl = unref(wrapRef) as HTMLElement;
  88 + const wrapEl = unref(wrapRef);
89 89 if (!wrapEl) return;
90 90 const bindValue = { ...attrs, ...props };
91 91 const insEditor = new Vditor(wrapEl, {
... ... @@ -140,7 +140,9 @@
140 140 if (!vditorInstance) return;
141 141 try {
142 142 vditorInstance?.destroy?.();
143   - } catch (error) {}
  143 + } catch (error) {
  144 + //
  145 + }
144 146 vditorRef.value = null;
145 147 initedRef.value = false;
146 148 }
... ...
src/components/Markdown/src/MarkdownViewer.vue
... ... @@ -5,19 +5,19 @@
5 5 <script lang="ts" setup>
6 6 import { defineProps, onBeforeUnmount, onDeactivated, Ref, ref, unref, watch } from 'vue';
7 7 import VditorPreview from 'vditor/dist/method.min';
8   - import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
  8 + import { onMountedOrActivated } from '@vben/hooks';
9 9 import { useRootSetting } from '/@/hooks/setting/useRootSetting';
10 10 import { getTheme } from './getTheme';
11 11 const props = defineProps({
12 12 value: { type: String },
13 13 class: { type: String },
14 14 });
15   - const viewerRef = ref<ElRef>(null);
16   - const vditorPreviewRef = ref(null) as Ref<Nullable<VditorPreview>>;
  15 + const viewerRef = ref(null);
  16 + const vditorPreviewRef = ref(null) as Ref<VditorPreview | null>;
17 17 const { getDarkMode } = useRootSetting();
18 18  
19 19 function init() {
20   - const viewerEl = unref(viewerRef) as HTMLElement;
  20 + const viewerEl = unref(viewerRef);
21 21 vditorPreviewRef.value = VditorPreview.preview(viewerEl, props.value, {
22 22 mode: getTheme(getDarkMode.value, 'content'),
23 23 theme: {
... ... @@ -51,7 +51,9 @@
51 51 if (!vditorInstance) return;
52 52 try {
53 53 vditorInstance?.destroy?.();
54   - } catch (error) {}
  54 + } catch (error) {
  55 + //
  56 + }
55 57 vditorPreviewRef.value = null;
56 58 }
57 59  
... ...
src/components/Table/src/hooks/useTableScroll.ts
... ... @@ -5,7 +5,7 @@ import { getViewportOffset } from &#39;/@/utils/domUtils&#39;;
5 5 import { isBoolean } from '/@/utils/is';
6 6 import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
7 7 import { useModalContext } from '/@/components/Modal';
8   -import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
  8 +import { onMountedOrActivated } from '@vben/hooks';
9 9 import { useDebounceFn } from '@vueuse/core';
10 10  
11 11 export function useTableScroll(
... ...
src/components/Tinymce/src/Editor.vue
... ... @@ -68,7 +68,7 @@
68 68 import { toolbar, plugins } from './tinymce';
69 69 import { buildShortUUID } from '/@/utils/uuid';
70 70 import { bindHandlers } from './helper';
71   - import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
  71 + import { onMountedOrActivated } from '@vben/hooks';
72 72 import { useDesign } from '/@/hooks/web/useDesign';
73 73 import { isNumber } from '/@/utils/is';
74 74 import { useLocale } from '/@/locales/useLocale';
... ...
src/directives/ripple/index.less
... ... @@ -15,7 +15,7 @@
15 15 height: 1px;
16 16 margin-top: 0;
17 17 margin-left: 0;
18   - pointer-events: none;
19   - border-radius: 50%;
20 18 transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  19 + border-radius: 50%;
  20 + pointer-events: none;
21 21 }
... ...
src/enums/sizeEnum.ts
... ... @@ -3,17 +3,3 @@ export enum SizeEnum {
3 3 SMALL = 'small',
4 4 LARGE = 'large',
5 5 }
6   -
7   -export enum SizeNumberEnum {
8   - DEFAULT = 48,
9   - SMALL = 16,
10   - LARGE = 64,
11   -}
12   -
13   -export const sizeMap: Map<SizeEnum, SizeNumberEnum> = (() => {
14   - const map = new Map<SizeEnum, SizeNumberEnum>();
15   - map.set(SizeEnum.DEFAULT, SizeNumberEnum.DEFAULT);
16   - map.set(SizeEnum.SMALL, SizeNumberEnum.SMALL);
17   - map.set(SizeEnum.LARGE, SizeNumberEnum.LARGE);
18   - return map;
19   -})();
... ...
src/hooks/component/useFormItem.ts
1 1 import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue';
2   -import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, toRaw, nextTick } from 'vue';
  2 +import {
  3 + reactive,
  4 + readonly,
  5 + computed,
  6 + getCurrentInstance,
  7 + watchEffect,
  8 + unref,
  9 + toRaw,
  10 + nextTick,
  11 +} from 'vue';
3 12  
4 13 import { isEqual } from 'lodash-es';
5 14  
... ... @@ -41,9 +50,9 @@ export function useRuleFormItem&lt;T extends Recordable&gt;(
41 50 if (isEqual(value, defaultState.value)) return;
42 51  
43 52 innerState.value = value as T[keyof T];
44   - nextTick(()=>{
  53 + nextTick(() => {
45 54 emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || []));
46   - })
  55 + });
47 56 },
48 57 });
49 58  
... ...
src/hooks/core/useLockFn.ts deleted 100644 → 0
1   -import { ref, unref } from 'vue';
2   -
3   -export function useLockFn<P extends any[] = any[], V = any>(fn: (...args: P) => Promise<V>) {
4   - const lockRef = ref(false);
5   - return async function (...args: P) {
6   - if (unref(lockRef)) return;
7   - lockRef.value = true;
8   - try {
9   - const ret = await fn(...args);
10   - lockRef.value = false;
11   - return ret;
12   - } catch (e) {
13   - lockRef.value = false;
14   - throw e;
15   - }
16   - };
17   -}
src/hooks/web/useContentHeight.ts
1 1 import { ComputedRef, isRef, nextTick, Ref, ref, unref, watch } from 'vue';
2   -import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
  2 +import { onMountedOrActivated } from '@vben/hooks';
3 3 import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
4 4 import { useLayoutHeight } from '/@/layouts/default/content/useContentViewHeight';
5 5 import { getViewportOffset } from '/@/utils/domUtils';
... ...
src/utils/env.ts
1 1 import type { GlobEnvConfig } from '/#/config';
2   -
3 2 import pkg from '../../package.json';
4 3  
5 4 const getVariableName = (title: string) => {
... ...
types/global.d.ts
... ... @@ -59,7 +59,6 @@ declare global {
59 59 declare interface ViteEnv {
60 60 VITE_USE_MOCK: boolean;
61 61 VITE_PUBLIC_PATH: string;
62   - VITE_PROXY: [string, string][];
63 62 VITE_GLOB_APP_TITLE: string;
64 63 VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
65 64 }
... ...