@modern-js/utils 2.5.1-alpha.0 → 2.5.1-alpha.2

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.
@@ -0,0 +1 @@
1
+ export declare const getTargetDir: (from: string, baseDir: string, targetBaseDir: string) => string;
@@ -0,0 +1,37 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
+ mod
22
+ ));
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var getTargetDir_exports = {};
25
+ __export(getTargetDir_exports, {
26
+ getTargetDir: () => getTargetDir
27
+ });
28
+ module.exports = __toCommonJS(getTargetDir_exports);
29
+ var path = __toESM(require("path"));
30
+ const getTargetDir = (from, baseDir, targetBaseDir) => {
31
+ const relativePath = path.relative(baseDir, from);
32
+ return path.resolve(targetBaseDir, relativePath);
33
+ };
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ getTargetDir
37
+ });
package/dist/index.d.ts CHANGED
@@ -41,4 +41,5 @@ export * from './plugin';
41
41
  export * from './routes';
42
42
  export * from './test-utils';
43
43
  export * from './getCoreJsVersion';
44
- export * from './react';
44
+ export * from './react';
45
+ export * from './getTargetDir';
package/dist/index.js CHANGED
@@ -58,3 +58,4 @@ __reExport(src_exports, require("./routes"), module.exports);
58
58
  __reExport(src_exports, require("./test-utils"), module.exports);
59
59
  __reExport(src_exports, require("./getCoreJsVersion"), module.exports);
60
60
  __reExport(src_exports, require("./react"), module.exports);
61
+ __reExport(src_exports, require("./getTargetDir"), module.exports);
@@ -40,13 +40,6 @@ export declare const isUseSSRBundle: (config: any) => boolean;
40
40
 
41
41
  export declare const isServiceWorker: (config: any) => boolean;
42
42
  export declare const isFastRefresh: () => boolean;
43
- export declare const isRouterV5: (config: {
44
- runtime?: {
45
- router?: {
46
- mode?: string;
47
- } | boolean;
48
- };
49
- }) => boolean;
50
43
  export * from './node-env';
51
44
  export * from './platform';
52
45
  export * from './type';
package/dist/is/index.js CHANGED
@@ -27,7 +27,6 @@ __export(is_exports, {
27
27
  isDepExists: () => isDepExists,
28
28
  isEmpty: () => isEmpty,
29
29
  isFastRefresh: () => isFastRefresh,
30
- isRouterV5: () => isRouterV5,
31
30
  isSSR: () => isSSR,
32
31
  isServiceWorker: () => isServiceWorker,
33
32
  isTypescript: () => isTypescript,
@@ -83,16 +82,11 @@ const isServiceWorker = (config) => {
83
82
  return false;
84
83
  };
85
84
  const isFastRefresh = () => (0, import_node_env.isDev)() && process.env.FAST_REFRESH !== "false";
86
- const isRouterV5 = (config) => {
87
- var _a, _b, _c;
88
- return typeof ((_a = config.runtime) == null ? void 0 : _a.router) !== "boolean" && ((_c = (_b = config == null ? void 0 : config.runtime) == null ? void 0 : _b.router) == null ? void 0 : _c.mode) === "react-router-5";
89
- };
90
85
  // Annotate the CommonJS export names for ESM import in node:
91
86
  0 && (module.exports = {
92
87
  isDepExists,
93
88
  isEmpty,
94
89
  isFastRefresh,
95
- isRouterV5,
96
90
  isSSR,
97
91
  isServiceWorker,
98
92
  isTypescript,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.5.1-alpha.0",
14
+ "version": "2.5.1-alpha.2",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/index.d.ts",
17
17
  "main": "./dist/index.js",
@@ -128,7 +128,7 @@
128
128
  "lodash": "^4.17.21"
129
129
  },
130
130
  "devDependencies": {
131
- "@modern-js/types": "2.5.0",
131
+ "@modern-js/types": "2.5.1-alpha.0",
132
132
  "@scripts/build": "2.5.0",
133
133
  "@scripts/jest-config": "2.5.0",
134
134
  "@types/jest": "^27",