nsgm-cli 2.1.43 → 2.1.45

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.
@@ -11,7 +11,7 @@ import {
11
11
  StyledContent,
12
12
  } from "@/styled/layout";
13
13
  import { useRouter } from "next/router";
14
- import _ from "lodash";
14
+ import * as _ from "lodash";
15
15
  import menuConfig, { getMenuConfig } from "@/utils/menu";
16
16
  import { LogoutOutlined } from "@ant-design/icons";
17
17
  import LanguageSwitcher from "@/components/LanguageSwitcher";
@@ -1,5 +1,5 @@
1
1
  import * as types from "./types";
2
- import _ from "lodash";
2
+ import * as _ from "lodash";
3
3
 
4
4
  const initialState = {
5
5
  firstLoadFlag: true,
@@ -1,5 +1,5 @@
1
1
  import { getLocalGraphql } from "@/utils/fetch";
2
- import _ from "lodash";
2
+ import * as _ from "lodash";
3
3
 
4
4
  export const getTemplateService = (page = 0, pageSize = 10) => {
5
5
  const getTemplateQuery = `query ($page: Int, $pageSize: Int) { template(page: $page, pageSize: $pageSize) {
@@ -1,4 +1,4 @@
1
- import _ from "lodash";
1
+ import * as _ from "lodash";
2
2
 
3
3
  export const getLocalEnv = () => {
4
4
  // 安全地访问 process.env,避免在浏览器中直接访问 process 对象
@@ -1,4 +1,4 @@
1
- import _ from "lodash";
1
+ import * as _ from "lodash";
2
2
 
3
3
  export const setCookie = (name: string, value: string, cookieExpire: any) => {
4
4
  const currentDate = new Date();
@@ -1,7 +1,7 @@
1
1
  import axios from "axios";
2
2
  import { setCookie, getCookie, delCookie } from "./cookie";
3
3
  import { getUrlParamByKey, getLocalApiPrefix, getLocalEnv, handleXSS } from "./common";
4
- import _ from "lodash";
4
+ import * as _ from "lodash";
5
5
 
6
6
  // 延迟初始化 cookie 名称,避免在模块加载时访问 process
7
7
  const getLoginCookieId = () => `${getLocalEnv()}_cas_nsgm`;
@@ -15,29 +15,29 @@
15
15
 
16
16
  ### 开发命令
17
17
 
18
- | 命令 | 说明 |
19
- | ---------------- | ------------ |
20
- | `pnpm run dev` | 开发模式 |
21
- | `pnpm run start` | 生产模式 |
22
- | `pnpm run build` | 编译项目 |
23
- | `pnpm run export` | 导出静态页面 |
18
+ | 命令 | 说明 |
19
+ | --------------- | ------------ |
20
+ | `npm run dev` | 开发模式 |
21
+ | `npm run start` | 生产模式 |
22
+ | `npm run build` | 编译项目 |
23
+ | `npm run export` | 导出静态页面 |
24
24
 
25
25
  ### 测试命令
26
26
 
27
- | 命令 | 说明 |
28
- | ----------------------- | ---------------- |
29
- | `pnpm test` | 运行所有测试 |
30
- | `pnpm run test:watch` | 监视模式运行测试 |
31
- | `pnpm run test:coverage` | 生成覆盖率报告 |
27
+ | 命令 | 说明 |
28
+ | ---------------------- | ---------------- |
29
+ | `npm test` | 运行所有测试 |
30
+ | `npm run test:watch` | 监视模式运行测试 |
31
+ | `npm run test:coverage` | 生成覆盖率报告 |
32
32
 
33
33
  ### 代码生成命令
34
34
 
35
- | 命令 | 说明 |
36
- | ----------------------- | --------------------- |
37
- | `pnpm run create` | 创建模板页面 |
38
- | `pnpm run delete` | 删除模板页面 |
39
- | `pnpm run create-config` | 从配置文件批量创建模块 |
40
- | `pnpm run delete-config` | 从配置文件批量删除模块 |
35
+ | 命令 | 说明 |
36
+ | ---------------------- | --------------------- |
37
+ | `npm run create` | 创建模板页面 |
38
+ | `npm run delete` | 删除模板页面 |
39
+ | `npm run create-config` | 从配置文件批量创建模块 |
40
+ | `npm run delete-config` | 从配置文件批量删除模块 |
41
41
 
42
42
  ### 项目维护命令
43
43
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nsgm-cli-project",
3
3
  "version": "1.0.0",
4
- "packageManager": "pnpm@10.28.0",
4
+ "packageManager": "npm@11.9.0",
5
5
  "description": "",
6
6
  "main": "app.js",
7
7
  "scripts": {
@@ -41,7 +41,7 @@
41
41
  "@testing-library/jest-dom": "^6.6.3",
42
42
  "@testing-library/react": "^16.3.0",
43
43
  "@testing-library/user-event": "^14.6.1",
44
- "@types/jest": "^30.0.5",
44
+ "@types/jest": "^30.0.0",
45
45
  "@typescript-eslint/eslint-plugin": "^8.38.0",
46
46
  "@typescript-eslint/parser": "^8.38.0",
47
47
  "eslint": "^9.31.0",
package/lib/args.js CHANGED
@@ -1,10 +1,40 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
5
35
  Object.defineProperty(exports, "__esModule", { value: true });
6
36
  exports.getProcessArgvs = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
37
+ const _ = __importStar(require("lodash"));
8
38
  const getProcessArgvs = (removeItems = 2) => {
9
39
  const args = process.argv.slice(removeItems);
10
40
  const result = {
@@ -13,7 +43,7 @@ const getProcessArgvs = (removeItems = 2) => {
13
43
  controller: "",
14
44
  action: "", // create/delete controller=${controller} action=${action}
15
45
  };
16
- lodash_1.default.each(args, (item, index) => {
46
+ _.each(args, (item, index) => {
17
47
  if (item.indexOf("=") !== -1) {
18
48
  const itemArr = item.split("=");
19
49
  const key = itemArr[0].toLowerCase();
package/lib/generate.js CHANGED
@@ -13,7 +13,7 @@ const generate_init_1 = require("./generate_init");
13
13
  const generate_create_1 = require("./generate_create");
14
14
  const generate_delete_1 = require("./generate_delete");
15
15
  // 常量提取
16
- const PNPM_INSTALL_FLAGS = "--legacy-peer-deps";
16
+ const PNPM_INSTALL_FLAGS = "--strict-peer-dependencies false";
17
17
  // 辅助函数
18
18
  const normalizeDirectory = (dictionary) => {
19
19
  // 禁止绝对路径,强制所有生成目录都在 cwd 下
package/lib/index.js CHANGED
File without changes
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
@@ -6,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
39
  const express_1 = require("graphql-http/lib/use/express");
7
40
  const graphql_1 = require("graphql");
8
41
  const fs_1 = __importDefault(require("fs"));
9
- const lodash_1 = __importDefault(require("lodash"));
42
+ const _ = __importStar(require("lodash"));
10
43
  const path_1 = require("path");
11
44
  const date_1 = __importDefault(require("./plugins/date"));
12
45
  const dataloaders_1 = require("./dataloaders");
@@ -62,9 +95,9 @@ function generateTypeDefsAndResolvers() {
62
95
  ...date_1.default,
63
96
  ...handleOutPlugins(),
64
97
  };
65
- const scalars = lodash_1.default.keys(resolvers);
98
+ const scalars = _.keys(resolvers);
66
99
  let scalarStr = "";
67
- lodash_1.default.each(scalars, (item) => {
100
+ _.each(scalars, (item) => {
68
101
  scalarStr += `scalar ${item}\n `;
69
102
  });
70
103
  const _generateAllComponentRecursive = (path = defaultPath) => {