@modern-js/generator-utils 3.3.10 → 3.3.12

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,50 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var getGeneratorPath_exports = {};
30
+ __export(getGeneratorPath_exports, {
31
+ getGeneratorPath: () => getGeneratorPath
32
+ });
33
+ module.exports = __toCommonJS(getGeneratorPath_exports);
34
+ var import_path = __toESM(require("path"));
35
+ const getGeneratorPath = (generator, distTag, paths) => {
36
+ if (process.env.CODESMITH_ENV === "development") {
37
+ return import_path.default.dirname(require.resolve(generator, {
38
+ paths: paths !== null && paths !== void 0 ? paths : [
39
+ process.cwd()
40
+ ]
41
+ }));
42
+ } else if (distTag) {
43
+ return `${generator}@${distTag}`;
44
+ }
45
+ return generator;
46
+ };
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ getGeneratorPath
50
+ });
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -14,11 +18,16 @@ var __copyProps = (to, from, except, desc) => {
14
18
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
20
  var utils_exports = {};
21
+ __export(utils_exports, {
22
+ getGeneratorPath: () => import_getGeneratorPath.getGeneratorPath
23
+ });
17
24
  module.exports = __toCommonJS(utils_exports);
18
25
  __reExport(utils_exports, require("./stripAnsi"), module.exports);
19
26
  __reExport(utils_exports, require("./package"), module.exports);
27
+ var import_getGeneratorPath = require("./getGeneratorPath");
20
28
  // Annotate the CommonJS export names for ESM import in node:
21
29
  0 && (module.exports = {
30
+ getGeneratorPath,
22
31
  ...require("./stripAnsi"),
23
32
  ...require("./package")
24
33
  });
@@ -0,0 +1,16 @@
1
+ import path from "path";
2
+ const getGeneratorPath = (generator, distTag, paths) => {
3
+ if (process.env.CODESMITH_ENV === "development") {
4
+ return path.dirname(require.resolve(generator, {
5
+ paths: paths !== null && paths !== void 0 ? paths : [
6
+ process.cwd()
7
+ ]
8
+ }));
9
+ } else if (distTag) {
10
+ return `${generator}@${distTag}`;
11
+ }
12
+ return generator;
13
+ };
14
+ export {
15
+ getGeneratorPath
16
+ };
@@ -1,2 +1,6 @@
1
1
  export * from "./stripAnsi";
2
2
  export * from "./package";
3
+ import { getGeneratorPath } from "./getGeneratorPath";
4
+ export {
5
+ getGeneratorPath
6
+ };
@@ -0,0 +1 @@
1
+ export declare const getGeneratorPath: (generator: string, distTag: string, paths?: string[]) => string;
@@ -1,2 +1,3 @@
1
1
  export * from './stripAnsi';
2
2
  export * from './package';
3
+ export { getGeneratorPath } from './getGeneratorPath';
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.3.10",
18
+ "version": "3.3.12",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@swc/helpers": "0.5.3",
34
- "@modern-js/plugin-i18n": "2.47.1",
35
- "@modern-js/utils": "2.47.1",
36
- "@modern-js/generator-common": "3.3.10"
34
+ "@modern-js/plugin-i18n": "2.48.1",
35
+ "@modern-js/utils": "2.48.1",
36
+ "@modern-js/generator-common": "3.3.12"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@modern-js/codesmith": "2.3.5",
@@ -41,8 +41,8 @@
41
41
  "@types/node": "^14",
42
42
  "jest": "^29",
43
43
  "typescript": "^5",
44
- "@scripts/build": "2.47.1",
45
- "@scripts/jest-config": "2.47.1"
44
+ "@scripts/jest-config": "2.48.1",
45
+ "@scripts/build": "2.48.1"
46
46
  },
47
47
  "sideEffects": false,
48
48
  "publishConfig": {