@umijs/utils 4.0.59 → 4.0.60

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/dist/index.d.ts CHANGED
@@ -51,5 +51,4 @@ export * from './setNoDeprecation';
51
51
  export * from './tryPaths';
52
52
  export * from './winPath';
53
53
  export * from './zod/isZodSchema';
54
- export * from './zod/zod2string';
55
54
  export { address, axios, chalk, cheerio, chokidar, crossSpawn, debug, deepmerge, execa, fsExtra, glob, Generator, BaseGenerator, generateFile, installDeps, lodash, logger, Mustache, pkgUp, portfinder, prompts, resolve, rimraf, semver, stripAnsi, updatePackageJSON, yParser, getGitInfo, printHelp, filesize, gzipSize, fastestLevenshtein, clackPrompts, MagicString, remapping, tsconfigPaths, z as zod, };
package/dist/index.js CHANGED
@@ -125,7 +125,6 @@ __reExport(src_exports, require("./setNoDeprecation"), module.exports);
125
125
  __reExport(src_exports, require("./tryPaths"), module.exports);
126
126
  __reExport(src_exports, require("./winPath"), module.exports);
127
127
  __reExport(src_exports, require("./zod/isZodSchema"), module.exports);
128
- __reExport(src_exports, require("./zod/zod2string"), module.exports);
129
128
  // Annotate the CommonJS export names for ESM import in node:
130
129
  0 && (module.exports = {
131
130
  BaseGenerator,
package/dist/printHelp.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -30,6 +34,7 @@ __export(printHelp_exports, {
30
34
  });
31
35
  module.exports = __toCommonJS(printHelp_exports);
32
36
  var logger = __toESM(require("./logger"));
37
+ var FEEDBACK_MESSAGE = "如果你需要进交流群,请访问 https://fb.umijs.org 。";
33
38
  function exit() {
34
39
  const loggerPath = logger.getLatestLogFilePath();
35
40
  if (loggerPath) {
@@ -39,6 +44,15 @@ function exit() {
39
44
  logger.fatal(
40
45
  "Consider reporting a GitHub issue on https://github.com/umijs/umi/issues"
41
46
  );
47
+ const binFile = process.argv[1];
48
+ const isUmi = binFile.endsWith("bin/umi.js");
49
+ const isMax = binFile.endsWith("bin/max.js");
50
+ if (process.env.FATAL_GUIDE_MESSAGE !== "none" && (isUmi || isMax)) {
51
+ logger.fatal(FEEDBACK_MESSAGE);
52
+ }
53
+ if (process.env.FATAL_GUIDE_MESSAGE && process.env.FATAL_GUIDE_MESSAGE !== "none") {
54
+ logger.fatal(process.env.FATAL_GUIDE_MESSAGE);
55
+ }
42
56
  }
43
57
  function runtime(e) {
44
58
  logger.error(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/utils",
3
- "version": "4.0.59",
3
+ "version": "4.0.60",
4
4
  "homepage": "https://github.com/umijs/umi/tree/master/packages/utils#readme",
5
5
  "bugs": "https://github.com/umijs/umi/issues",
6
6
  "repository": {
@@ -1,2 +0,0 @@
1
- import { z } from '../../compiled/zod';
2
- export declare function zod2string<T extends z.ZodType<any>>(schema: T): string;
@@ -1,49 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/zod/zod2string.ts
20
- var zod2string_exports = {};
21
- __export(zod2string_exports, {
22
- zod2string: () => zod2string
23
- });
24
- module.exports = __toCommonJS(zod2string_exports);
25
- var import_zod = require("../../compiled/zod");
26
- function zod2string(schema) {
27
- if (schema instanceof import_zod.z.ZodObject) {
28
- const keys = Object.keys(schema.shape);
29
- const properties = keys.map((key) => `${key}: ${zod2string(schema.shape[key])}`).join(", ");
30
- return `z.object({${properties}})`;
31
- } else if (schema instanceof import_zod.z.ZodArray) {
32
- return `z.array(${zod2string(schema._def.type)})`;
33
- } else if (schema instanceof import_zod.z.ZodOptional) {
34
- return `z.optional(${zod2string(schema._def.innerType)})`;
35
- } else {
36
- const { typeName, checks } = schema._def;
37
- let str = `z.${typeName.replace("Zod", "").toLowerCase()}()`;
38
- if (checks && checks.length > 0) {
39
- checks.forEach((i) => {
40
- str += `.${i.kind}(${(i == null ? void 0 : i.value) || ""})`;
41
- });
42
- }
43
- return str;
44
- }
45
- }
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
48
- zod2string
49
- });