morghulis 1.0.38 → 1.0.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "数据库模型",
5
5
  "private": false,
6
6
  "type": "module",
@@ -8,9 +8,7 @@
8
8
  "module": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
10
10
  "files": [
11
- "dist",
12
- "postinstall.cjs",
13
- "postinstall.mjs"
11
+ "dist"
14
12
  ],
15
13
  "scripts": {
16
14
  "dev": "vite",
@@ -20,8 +18,7 @@
20
18
  "type-check": "vue-tsc --build",
21
19
  "prepare": "npm run build",
22
20
  "prepublishOnly": "npm run build",
23
- "generate-types": "node build-typings.js",
24
- "postinstall": "node postinstall.cjs || node postinstall.mjs"
21
+ "generate-types": "node build-typings.js"
25
22
  },
26
23
  "dependencies": {
27
24
  "@fortawesome/fontawesome-svg-core": "^6.7.2",
package/postinstall.cjs DELETED
@@ -1,65 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- 'use strict';
4
-
5
- const { execSync } = require('child_process');
6
- const fs = require('fs');
7
- const path = require('path');
8
-
9
- /**
10
- * 确保element-plus被安装
11
- */
12
- function ensureElementPlusInstalled() {
13
- try {
14
- // 尝试找到最近的package.json
15
- let packagePath = findPackageJson(process.cwd());
16
- if (!packagePath) {
17
- console.log('未找到package.json文件,无法安装element-plus');
18
- return;
19
- }
20
-
21
- // 检查package.json中是否已经有element-plus
22
- const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
23
- const deps = packageJson.dependencies || {};
24
- const devDeps = packageJson.devDependencies || {};
25
-
26
- // 如果已经安装了element-plus,则不需要再安装
27
- if (deps['element-plus'] || devDeps['element-plus']) {
28
- console.log('element-plus已经安装,跳过安装步骤');
29
- return;
30
- }
31
-
32
- console.log('正在安装element-plus...');
33
-
34
- // 使用npm安装element-plus
35
- execSync('npm install element-plus@^2.9.7 --save', {
36
- stdio: 'inherit',
37
- cwd: path.dirname(packagePath)
38
- });
39
-
40
- console.log('element-plus安装成功');
41
- } catch (error) {
42
- console.error('安装element-plus时出错:', error.message);
43
- }
44
- }
45
-
46
- /**
47
- * 递归查找package.json文件
48
- */
49
- function findPackageJson(dir) {
50
- const packagePath = path.join(dir, 'package.json');
51
- if (fs.existsSync(packagePath)) {
52
- return packagePath;
53
- }
54
-
55
- const parentDir = path.dirname(dir);
56
- // 到达根目录,停止查找
57
- if (parentDir === dir) {
58
- return null;
59
- }
60
-
61
- return findPackageJson(parentDir);
62
- }
63
-
64
- // 执行安装
65
- ensureElementPlusInstalled();
package/postinstall.mjs DELETED
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { execSync } from 'child_process';
4
- import { existsSync, readFileSync } from 'fs';
5
- import { join, dirname } from 'path';
6
- import { fileURLToPath } from 'url';
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = dirname(__filename);
10
-
11
- /**
12
- * 确保element-plus被安装
13
- */
14
- async function ensureElementPlusInstalled() {
15
- try {
16
- // 尝试找到最近的package.json
17
- let packagePath = await findPackageJson(process.cwd());
18
- if (!packagePath) {
19
- console.log('未找到package.json文件,无法安装element-plus');
20
- return;
21
- }
22
-
23
- // 检查package.json中是否已经有element-plus
24
- const packageJson = JSON.parse(readFileSync(packagePath, 'utf8'));
25
- const deps = packageJson.dependencies || {};
26
- const devDeps = packageJson.devDependencies || {};
27
-
28
- // 如果已经安装了element-plus,则不需要再安装
29
- if (deps['element-plus'] || devDeps['element-plus']) {
30
- console.log('element-plus已经安装,跳过安装步骤');
31
- return;
32
- }
33
-
34
- console.log('正在安装element-plus...');
35
-
36
- // 使用npm安装element-plus
37
- execSync('npm install element-plus@^2.9.7 --save', {
38
- stdio: 'inherit',
39
- cwd: dirname(packagePath)
40
- });
41
-
42
- console.log('element-plus安装成功');
43
- } catch (error) {
44
- console.error('安装element-plus时出错:', error.message);
45
- }
46
- }
47
-
48
- /**
49
- * 递归查找package.json文件
50
- */
51
- async function findPackageJson(dir) {
52
- const packagePath = join(dir, 'package.json');
53
- if (existsSync(packagePath)) {
54
- return packagePath;
55
- }
56
-
57
- const parentDir = dirname(dir);
58
- // 到达根目录,停止查找
59
- if (parentDir === dir) {
60
- return null;
61
- }
62
-
63
- return findPackageJson(parentDir);
64
- }
65
-
66
- // 执行安装
67
- ensureElementPlusInstalled();