@modern-js/generator-utils 3.0.0-beta.2 → 3.0.0-beta.4

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.
@@ -1,264 +1,212 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- getPackageVersion: true,
8
- getModernVersion: true,
9
- getModernPluginVersion: true,
10
- getPackageManagerText: true,
11
- isTsProject: true,
12
- getPackageObj: true,
13
- getAllPackages: true,
14
- validatePackageName: true,
15
- validatePackagePath: true,
16
- getModuleProjectPath: true,
17
- getMWAProjectPath: true,
18
- ora: true,
19
- fs: true,
20
- semver: true,
21
- execa: true,
22
- readTsConfigByFile: true,
23
- getPackageManager: true,
24
- canUseNpm: true,
25
- canUsePnpm: true,
26
- canUseYarn: true,
27
- isReact18: true,
28
- i18n: true
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 });
29
10
  };
30
- Object.defineProperty(exports, "canUseNpm", {
31
- enumerable: true,
32
- get: function () {
33
- return _utils.canUseNpm;
34
- }
35
- });
36
- Object.defineProperty(exports, "canUsePnpm", {
37
- enumerable: true,
38
- get: function () {
39
- return _utils.canUsePnpm;
40
- }
41
- });
42
- Object.defineProperty(exports, "canUseYarn", {
43
- enumerable: true,
44
- get: function () {
45
- return _utils.canUseYarn;
46
- }
47
- });
48
- Object.defineProperty(exports, "execa", {
49
- enumerable: true,
50
- get: function () {
51
- return _utils.execa;
52
- }
53
- });
54
- Object.defineProperty(exports, "fs", {
55
- enumerable: true,
56
- get: function () {
57
- return _utils.fs;
58
- }
59
- });
60
- exports.getAllPackages = getAllPackages;
61
- exports.getMWAProjectPath = getMWAProjectPath;
62
- exports.getModernPluginVersion = getModernPluginVersion;
63
- exports.getModernVersion = getModernVersion;
64
- exports.getModuleProjectPath = getModuleProjectPath;
65
- Object.defineProperty(exports, "getPackageManager", {
66
- enumerable: true,
67
- get: function () {
68
- return _utils.getPackageManager;
69
- }
70
- });
71
- exports.getPackageManagerText = getPackageManagerText;
72
- exports.getPackageObj = getPackageObj;
73
- exports.getPackageVersion = getPackageVersion;
74
- Object.defineProperty(exports, "i18n", {
75
- enumerable: true,
76
- get: function () {
77
- return _locale.i18n;
78
- }
79
- });
80
- Object.defineProperty(exports, "isReact18", {
81
- enumerable: true,
82
- get: function () {
83
- return _utils.isReact18;
84
- }
85
- });
86
- exports.isTsProject = isTsProject;
87
- Object.defineProperty(exports, "ora", {
88
- enumerable: true,
89
- get: function () {
90
- return _utils.ora;
91
- }
92
- });
93
- Object.defineProperty(exports, "readTsConfigByFile", {
94
- enumerable: true,
95
- get: function () {
96
- return _utils.readTsConfigByFile;
97
- }
98
- });
99
- Object.defineProperty(exports, "semver", {
100
- enumerable: true,
101
- get: function () {
102
- return _utils.semver;
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 });
103
16
  }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var stdin_exports = {};
26
+ __export(stdin_exports, {
27
+ canUseNpm: () => import_utils2.canUseNpm,
28
+ canUsePnpm: () => import_utils2.canUsePnpm,
29
+ canUseYarn: () => import_utils2.canUseYarn,
30
+ execa: () => import_utils2.execa,
31
+ fs: () => import_utils2.fs,
32
+ getAllPackages: () => getAllPackages,
33
+ getMWAProjectPath: () => getMWAProjectPath,
34
+ getModernPluginVersion: () => getModernPluginVersion,
35
+ getModernVersion: () => getModernVersion,
36
+ getModuleProjectPath: () => getModuleProjectPath,
37
+ getPackageManager: () => import_utils2.getPackageManager,
38
+ getPackageManagerText: () => getPackageManagerText,
39
+ getPackageObj: () => getPackageObj,
40
+ getPackageVersion: () => getPackageVersion,
41
+ i18n: () => import_locale2.i18n,
42
+ isReact18: () => import_utils2.isReact18,
43
+ isTsProject: () => isTsProject,
44
+ ora: () => import_utils2.ora,
45
+ readTsConfigByFile: () => import_utils2.readTsConfigByFile,
46
+ semver: () => import_utils2.semver,
47
+ validatePackageName: () => validatePackageName,
48
+ validatePackagePath: () => validatePackagePath
104
49
  });
105
- exports.validatePackageName = validatePackageName;
106
- exports.validatePackagePath = validatePackagePath;
107
- var _path = _interopRequireDefault(require("path"));
108
- var _utils = require("@modern-js/utils");
109
- var _generatorCommon = require("@modern-js/generator-common");
110
- var _stripAnsi = require("./utils/strip-ansi");
111
- var _locale = require("./locale");
112
- var _package = require("./utils/package");
113
- var _utils2 = require("./utils");
114
- Object.keys(_utils2).forEach(function (key) {
115
- if (key === "default" || key === "__esModule") return;
116
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
117
- if (key in exports && exports[key] === _utils2[key]) return;
118
- Object.defineProperty(exports, key, {
119
- enumerable: true,
120
- get: function () {
121
- return _utils2[key];
122
- }
50
+ module.exports = __toCommonJS(stdin_exports);
51
+ var import_path = __toESM(require("path"));
52
+ var import_utils = require("@modern-js/utils");
53
+ var import_generator_common = require("@modern-js/generator-common");
54
+ var import_strip_ansi = require("./utils/strip-ansi");
55
+ var import_locale = require("./locale");
56
+ var import_package = require("./utils/package");
57
+ __reExport(stdin_exports, require("./utils"), module.exports);
58
+ var import_utils2 = require("@modern-js/utils");
59
+ var import_locale2 = require("./locale");
60
+ var __async = (__this, __arguments, generator) => {
61
+ return new Promise((resolve, reject) => {
62
+ var fulfilled = (value) => {
63
+ try {
64
+ step(generator.next(value));
65
+ } catch (e) {
66
+ reject(e);
67
+ }
68
+ };
69
+ var rejected = (value) => {
70
+ try {
71
+ step(generator.throw(value));
72
+ } catch (e) {
73
+ reject(e);
74
+ }
75
+ };
76
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
77
+ step((generator = generator.apply(__this, __arguments)).next());
123
78
  });
124
- });
125
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
126
- async function getPackageVersion(packageName, registry) {
127
- const spinner = (0, _utils.ora)({
128
- text: 'Load Generator...',
129
- spinner: 'runner'
130
- }).start();
131
- if (await (0, _utils.canUsePnpm)()) {
132
- const args = ['info', packageName, 'version'];
133
- if (registry) {
134
- args.push(`--registry=${registry}`);
79
+ };
80
+ function getPackageVersion(packageName, registry) {
81
+ return __async(this, null, function* () {
82
+ const spinner = (0, import_utils.ora)({
83
+ text: "Load Generator...",
84
+ spinner: "runner"
85
+ }).start();
86
+ if (yield (0, import_utils.canUsePnpm)()) {
87
+ const args = ["info", packageName, "version"];
88
+ if (registry) {
89
+ args.push(`--registry=${registry}`);
90
+ }
91
+ const result = yield (0, import_utils.execa)("pnpm", args);
92
+ spinner.stop();
93
+ return (0, import_strip_ansi.stripAnsi)(result.stdout);
135
94
  }
136
- const result = await (0, _utils.execa)('pnpm', args);
137
- spinner.stop();
138
- return (0, _stripAnsi.stripAnsi)(result.stdout);
139
- }
140
- if (await (0, _utils.canUseYarn)()) {
141
- const args = ['info', packageName, 'version', '--silent'];
142
- if (registry) {
143
- args.push(`--registry=${registry}`);
95
+ if (yield (0, import_utils.canUseYarn)()) {
96
+ const args = ["info", packageName, "version", "--silent"];
97
+ if (registry) {
98
+ args.push(`--registry=${registry}`);
99
+ }
100
+ const result = yield (0, import_utils.execa)("yarn", args);
101
+ spinner.stop();
102
+ return (0, import_strip_ansi.stripAnsi)(result.stdout);
144
103
  }
145
- const result = await (0, _utils.execa)('yarn', args);
146
- spinner.stop();
147
- return (0, _stripAnsi.stripAnsi)(result.stdout);
148
- }
149
- if (await (0, _utils.canUseNpm)()) {
150
- const args = ['view', packageName, 'version'];
151
- if (registry) {
152
- args.push(`--registry=${registry}`);
104
+ if (yield (0, import_utils.canUseNpm)()) {
105
+ const args = ["view", packageName, "version"];
106
+ if (registry) {
107
+ args.push(`--registry=${registry}`);
108
+ }
109
+ const result = yield (0, import_utils.execa)("npm", args);
110
+ spinner.stop();
111
+ return (0, import_strip_ansi.stripAnsi)(result.stdout);
153
112
  }
154
- const result = await (0, _utils.execa)('npm', args);
155
113
  spinner.stop();
156
- return (0, _stripAnsi.stripAnsi)(result.stdout);
157
- }
158
- spinner.stop();
159
- throw new Error('not found npm, please install npm before');
114
+ throw new Error("not found npm, please install npm before");
115
+ });
160
116
  }
161
- async function getModernVersion(solution, registry, distTag = 'latest') {
162
- const dep = _generatorCommon.SolutionToolsMap[solution];
163
- const modernVersion = await getPackageVersion(`${dep}@${distTag}`, registry);
164
- return modernVersion;
117
+ function getModernVersion(solution, registry, distTag = "latest") {
118
+ return __async(this, null, function* () {
119
+ const dep = import_generator_common.SolutionToolsMap[solution];
120
+ const modernVersion = yield getPackageVersion(`${dep}@${distTag}`, registry);
121
+ return modernVersion;
122
+ });
165
123
  }
166
- async function getModernPluginVersion(solution, packageName, options = {
167
- distTag: 'latest'
168
- }) {
169
- const {
170
- cwd = process.cwd(),
171
- registry,
172
- distTag
173
- } = options;
174
- const getLatetPluginVersion = async tag => {
175
- const version = await getPackageVersion(`${packageName}@${tag || distTag || 'latest'}`, registry);
176
- return version;
177
- };
178
- if (!packageName.startsWith('@modern-js') || packageName.includes('electron') || packageName.includes('codesmith') || packageName.includes('easy-form') || packageName.startsWith('@modern-js-reduck')) {
179
- return getLatetPluginVersion('latest');
180
- }
181
- // get project solution version
182
- const pkgPath = _path.default.join(require.resolve(_generatorCommon.SolutionToolsMap[solution], {
183
- paths: [cwd]
184
- }), '../../../../', 'package.json');
185
- if (_utils.fs.existsSync(pkgPath)) {
186
- const pkgInfo = _utils.fs.readJSONSync(pkgPath);
187
- const modernVersion = pkgInfo.version;
188
- if (typeof modernVersion !== 'string') {
189
- return getLatetPluginVersion();
124
+ function getModernPluginVersion(_0, _1) {
125
+ return __async(this, arguments, function* (solution, packageName, options = {
126
+ distTag: "latest"
127
+ }) {
128
+ const { cwd = process.cwd(), registry, distTag } = options;
129
+ const getLatetPluginVersion = (tag) => __async(this, null, function* () {
130
+ const version = yield getPackageVersion(
131
+ `${packageName}@${tag || distTag || "latest"}`,
132
+ registry
133
+ );
134
+ return version;
135
+ });
136
+ if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
137
+ return getLatetPluginVersion("latest");
190
138
  }
191
- return (0, _package.getAvailableVersion)(packageName, modernVersion, registry);
192
- }
193
- return getLatetPluginVersion();
139
+ const pkgPath = import_path.default.join(
140
+ require.resolve(import_generator_common.SolutionToolsMap[solution], { paths: [cwd] }),
141
+ "../../../../",
142
+ "package.json"
143
+ );
144
+ if (import_utils.fs.existsSync(pkgPath)) {
145
+ const pkgInfo = import_utils.fs.readJSONSync(pkgPath);
146
+ const modernVersion = pkgInfo.version;
147
+ if (typeof modernVersion !== "string") {
148
+ return getLatetPluginVersion();
149
+ }
150
+ return (0, import_package.getAvailableVersion)(packageName, modernVersion, registry);
151
+ }
152
+ return getLatetPluginVersion();
153
+ });
194
154
  }
195
155
  function getPackageManagerText(packageManager) {
196
- return packageManager === 'yarn' ? 'yarn' : `${packageManager} run`;
156
+ return packageManager === "yarn" ? "yarn" : `${packageManager} run`;
197
157
  }
198
158
  function isTsProject(appDir) {
199
- return _utils.fs.existsSync(_path.default.join(appDir, 'tsconfig.json'));
159
+ return import_utils.fs.existsSync(import_path.default.join(appDir, "tsconfig.json"));
200
160
  }
201
- async function getPackageObj(context) {
202
- const pkgStr = (await context.materials.default.get(`package.json`).value()).content;
203
- return JSON.parse(pkgStr);
161
+ function getPackageObj(context) {
162
+ return __async(this, null, function* () {
163
+ const pkgStr = (yield context.materials.default.get(`package.json`).value()).content;
164
+ return JSON.parse(pkgStr);
165
+ });
204
166
  }
205
167
  function getAllPackages(appDir) {
206
- const packages = (0, _utils.getMonorepoPackages)(appDir);
207
- return packages.map(pkg => pkg.name);
168
+ const packages = (0, import_utils.getMonorepoPackages)(appDir);
169
+ return packages.map((pkg) => pkg.name);
208
170
  }
209
171
  function validatePackageName(value, packages, options) {
210
- const {
211
- isMonorepoSubProject
212
- } = options;
172
+ const { isMonorepoSubProject } = options;
213
173
  if (isMonorepoSubProject && packages.includes(value)) {
214
174
  return {
215
175
  success: false,
216
- error: _locale.i18n.t(_locale.localeKeys.packageName.exit, {
217
- value
218
- })
176
+ error: import_locale.i18n.t(import_locale.localeKeys.packageName.exit, { value })
219
177
  };
220
178
  }
221
- return {
222
- success: true
223
- };
179
+ return { success: true };
224
180
  }
225
181
  function validatePackagePath(value, projectDir, options) {
226
- const {
227
- isMwa,
228
- isPublic,
229
- isTest
230
- } = options || {};
231
- let dir = 'apps';
182
+ const { isMwa, isPublic, isTest } = options || {};
183
+ let dir = "apps";
232
184
  if (isMwa && isTest) {
233
- dir = 'examples';
185
+ dir = "examples";
234
186
  } else {
235
- dir = isPublic ? 'packages' : 'features';
187
+ dir = isPublic ? "packages" : "features";
236
188
  }
237
- const packageDir = _path.default.resolve(projectDir || '', dir, value);
238
- if (_utils.fs.existsSync(packageDir)) {
189
+ const packageDir = import_path.default.resolve(projectDir || "", dir, value);
190
+ if (import_utils.fs.existsSync(packageDir)) {
239
191
  return {
240
192
  success: false,
241
- error: _locale.i18n.t(_locale.localeKeys.packagePath.exit, {
242
- value
243
- })
193
+ error: import_locale.i18n.t(import_locale.localeKeys.packagePath.exit, { value })
244
194
  };
245
195
  }
246
- return {
247
- success: true
248
- };
196
+ return { success: true };
249
197
  }
250
198
  function getModuleProjectPath(packagePath, isMonorepoSubProject, isPublic, isLocalPackages) {
251
199
  if (isLocalPackages && packagePath) {
252
200
  return `${packagePath}/`;
253
201
  }
254
202
  if (isMonorepoSubProject && packagePath) {
255
- return `${isPublic ? 'packages' : 'features'}/${packagePath}/`;
203
+ return `${isPublic ? "packages" : "features"}/${packagePath}/`;
256
204
  }
257
- return '';
205
+ return "";
258
206
  }
259
207
  function getMWAProjectPath(packagePath, isMonorepoSubProject, isTest = false) {
260
208
  if (isMonorepoSubProject && packagePath) {
261
- return `${isTest ? 'examples' : 'apps'}/${packagePath}/`;
209
+ return `${isTest ? "examples" : "apps"}/${packagePath}/`;
262
210
  }
263
- return '';
264
- }
211
+ return "";
212
+ }
@@ -1,15 +1,26 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ EN_LOCALE: () => EN_LOCALE
5
21
  });
6
- exports.EN_LOCALE = void 0;
22
+ module.exports = __toCommonJS(stdin_exports);
7
23
  const EN_LOCALE = {
8
- packageName: {
9
- exit: 'package name `{value}` is already exists'
10
- },
11
- packagePath: {
12
- exit: 'package path {value} is already exists'
13
- }
24
+ packageName: { exit: "package name `{value}` is already exists" },
25
+ packagePath: { exit: "package path {value} is already exists" }
14
26
  };
15
- exports.EN_LOCALE = EN_LOCALE;
@@ -1,16 +1,28 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ i18n: () => i18n,
21
+ localeKeys: () => localeKeys
5
22
  });
6
- exports.localeKeys = exports.i18n = void 0;
7
- var _pluginI18n = require("@modern-js/plugin-i18n");
8
- var _zh = require("./zh");
9
- var _en = require("./en");
10
- const i18n = new _pluginI18n.I18n();
11
- exports.i18n = i18n;
12
- const localeKeys = i18n.init('zh', {
13
- zh: _zh.ZH_LOCALE,
14
- en: _en.EN_LOCALE
15
- });
16
- exports.localeKeys = localeKeys;
23
+ module.exports = __toCommonJS(stdin_exports);
24
+ var import_plugin_i18n = require("@modern-js/plugin-i18n");
25
+ var import_zh = require("./zh");
26
+ var import_en = require("./en");
27
+ const i18n = new import_plugin_i18n.I18n();
28
+ const localeKeys = i18n.init("zh", { zh: import_zh.ZH_LOCALE, en: import_en.EN_LOCALE });
@@ -1,15 +1,26 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ ZH_LOCALE: () => ZH_LOCALE
5
21
  });
6
- exports.ZH_LOCALE = void 0;
22
+ module.exports = __toCommonJS(stdin_exports);
7
23
  const ZH_LOCALE = {
8
- packageName: {
9
- exit: '项目名称 {value} 已存在'
10
- },
11
- packagePath: {
12
- exit: '目录 {value} 已存在'
13
- }
24
+ packageName: { exit: "项目名称 {value} 已存在" },
25
+ packagePath: { exit: "目录 {value} 已存在" }
14
26
  };
15
- exports.ZH_LOCALE = ZH_LOCALE;
@@ -1,27 +1,18 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _stripAnsi = require("./strip-ansi");
7
- Object.keys(_stripAnsi).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _stripAnsi[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _stripAnsi[key];
14
- }
15
- });
16
- });
17
- var _package = require("./package");
18
- Object.keys(_package).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _package[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _package[key];
25
- }
26
- });
27
- });
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var stdin_exports = {};
16
+ module.exports = __toCommonJS(stdin_exports);
17
+ __reExport(stdin_exports, require("./strip-ansi"), module.exports);
18
+ __reExport(stdin_exports, require("./package"), module.exports);