meshjs 1.7.30 → 1.7.32
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.cjs +12 -30
- package/dist/index.js +12 -30
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -34,29 +34,11 @@ var import_tar = require("tar");
|
|
|
34
34
|
var import_util = require("util");
|
|
35
35
|
var import_stream = require("stream");
|
|
36
36
|
var import_fs2 = require("fs");
|
|
37
|
-
var
|
|
37
|
+
var import_child_process2 = require("child_process");
|
|
38
38
|
|
|
39
39
|
// src/helpers/resolvePkgManager.ts
|
|
40
|
-
var import_child_process = require("child_process");
|
|
41
40
|
var resolvePkgManager = () => {
|
|
42
|
-
|
|
43
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
44
|
-
if (userAgent?.startsWith("yarn")) {
|
|
45
|
-
return "yarn";
|
|
46
|
-
}
|
|
47
|
-
if (userAgent?.startsWith("pnpm")) {
|
|
48
|
-
return "pnpm";
|
|
49
|
-
}
|
|
50
|
-
try {
|
|
51
|
-
(0, import_child_process.execSync)("yarn --version", { stdio: "ignore" });
|
|
52
|
-
return "yarn";
|
|
53
|
-
} catch (_) {
|
|
54
|
-
(0, import_child_process.execSync)("pnpm --version", { stdio: "ignore" });
|
|
55
|
-
return "pnpm";
|
|
56
|
-
}
|
|
57
|
-
} catch (_) {
|
|
58
|
-
return "npm";
|
|
59
|
-
}
|
|
41
|
+
return "npm";
|
|
60
42
|
};
|
|
61
43
|
|
|
62
44
|
// src/helpers/setProjectName.ts
|
|
@@ -74,17 +56,17 @@ var setProjectName = (path, name) => {
|
|
|
74
56
|
};
|
|
75
57
|
|
|
76
58
|
// src/helpers/tryGitInit.ts
|
|
77
|
-
var
|
|
59
|
+
var import_child_process = require("child_process");
|
|
78
60
|
var tryGitInit = () => {
|
|
79
61
|
try {
|
|
80
|
-
(0,
|
|
62
|
+
(0, import_child_process.execSync)("git --version", { stdio: "ignore" });
|
|
81
63
|
if (isInGitRepository() || isInMercurialRepository()) {
|
|
82
64
|
return false;
|
|
83
65
|
}
|
|
84
|
-
(0,
|
|
85
|
-
(0,
|
|
86
|
-
(0,
|
|
87
|
-
(0,
|
|
66
|
+
(0, import_child_process.execSync)("git init", { stdio: "ignore" });
|
|
67
|
+
(0, import_child_process.execSync)("git checkout -b main", { stdio: "ignore" });
|
|
68
|
+
(0, import_child_process.execSync)("git add -A", { stdio: "ignore" });
|
|
69
|
+
(0, import_child_process.execSync)('git commit -m "Initial commit from npx mesh-create-dapp"', {
|
|
88
70
|
stdio: "ignore"
|
|
89
71
|
});
|
|
90
72
|
return true;
|
|
@@ -94,7 +76,7 @@ var tryGitInit = () => {
|
|
|
94
76
|
};
|
|
95
77
|
var isInGitRepository = () => {
|
|
96
78
|
try {
|
|
97
|
-
(0,
|
|
79
|
+
(0, import_child_process.execSync)("git rev-parse --is-inside-work-tree", { stdio: "ignore" });
|
|
98
80
|
return true;
|
|
99
81
|
} catch (_) {
|
|
100
82
|
}
|
|
@@ -102,7 +84,7 @@ var isInGitRepository = () => {
|
|
|
102
84
|
};
|
|
103
85
|
var isInMercurialRepository = () => {
|
|
104
86
|
try {
|
|
105
|
-
(0,
|
|
87
|
+
(0, import_child_process.execSync)("hg --cwd . root", { stdio: "ignore" });
|
|
106
88
|
return true;
|
|
107
89
|
} catch (_) {
|
|
108
90
|
}
|
|
@@ -131,7 +113,7 @@ var create = async (name, options) => {
|
|
|
131
113
|
console.log("\n");
|
|
132
114
|
try {
|
|
133
115
|
createDirectory(name);
|
|
134
|
-
logInfo("\u{1F4E1} - Downloading files
|
|
116
|
+
logInfo("\u{1F4E1} - Downloading files...");
|
|
135
117
|
await fetchRepository(template);
|
|
136
118
|
logInfo("\u{1F3E0} - Starting a new git repository...");
|
|
137
119
|
setNameAndCommitChanges(name);
|
|
@@ -186,7 +168,7 @@ var setNameAndCommitChanges = (name) => {
|
|
|
186
168
|
var installDependencies = () => {
|
|
187
169
|
try {
|
|
188
170
|
const pkgManager = resolvePkgManager();
|
|
189
|
-
(0,
|
|
171
|
+
(0, import_child_process2.execSync)(`${pkgManager} install`, { stdio: [0, 1, 2] });
|
|
190
172
|
} catch (_) {
|
|
191
173
|
logError("\u{1F6AB} Failed to install project dependencies, continuing...");
|
|
192
174
|
}
|
package/dist/index.js
CHANGED
|
@@ -15,29 +15,11 @@ import { extract } from "tar";
|
|
|
15
15
|
import { promisify } from "util";
|
|
16
16
|
import { pipeline } from "stream";
|
|
17
17
|
import { existsSync, mkdirSync } from "fs";
|
|
18
|
-
import { execSync as
|
|
18
|
+
import { execSync as execSync2 } from "child_process";
|
|
19
19
|
|
|
20
20
|
// src/helpers/resolvePkgManager.ts
|
|
21
|
-
import { execSync } from "child_process";
|
|
22
21
|
var resolvePkgManager = () => {
|
|
23
|
-
|
|
24
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
25
|
-
if (userAgent?.startsWith("yarn")) {
|
|
26
|
-
return "yarn";
|
|
27
|
-
}
|
|
28
|
-
if (userAgent?.startsWith("pnpm")) {
|
|
29
|
-
return "pnpm";
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
execSync("yarn --version", { stdio: "ignore" });
|
|
33
|
-
return "yarn";
|
|
34
|
-
} catch (_) {
|
|
35
|
-
execSync("pnpm --version", { stdio: "ignore" });
|
|
36
|
-
return "pnpm";
|
|
37
|
-
}
|
|
38
|
-
} catch (_) {
|
|
39
|
-
return "npm";
|
|
40
|
-
}
|
|
22
|
+
return "npm";
|
|
41
23
|
};
|
|
42
24
|
|
|
43
25
|
// src/helpers/setProjectName.ts
|
|
@@ -55,17 +37,17 @@ var setProjectName = (path, name) => {
|
|
|
55
37
|
};
|
|
56
38
|
|
|
57
39
|
// src/helpers/tryGitInit.ts
|
|
58
|
-
import { execSync
|
|
40
|
+
import { execSync } from "child_process";
|
|
59
41
|
var tryGitInit = () => {
|
|
60
42
|
try {
|
|
61
|
-
|
|
43
|
+
execSync("git --version", { stdio: "ignore" });
|
|
62
44
|
if (isInGitRepository() || isInMercurialRepository()) {
|
|
63
45
|
return false;
|
|
64
46
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
47
|
+
execSync("git init", { stdio: "ignore" });
|
|
48
|
+
execSync("git checkout -b main", { stdio: "ignore" });
|
|
49
|
+
execSync("git add -A", { stdio: "ignore" });
|
|
50
|
+
execSync('git commit -m "Initial commit from npx mesh-create-dapp"', {
|
|
69
51
|
stdio: "ignore"
|
|
70
52
|
});
|
|
71
53
|
return true;
|
|
@@ -75,7 +57,7 @@ var tryGitInit = () => {
|
|
|
75
57
|
};
|
|
76
58
|
var isInGitRepository = () => {
|
|
77
59
|
try {
|
|
78
|
-
|
|
60
|
+
execSync("git rev-parse --is-inside-work-tree", { stdio: "ignore" });
|
|
79
61
|
return true;
|
|
80
62
|
} catch (_) {
|
|
81
63
|
}
|
|
@@ -83,7 +65,7 @@ var isInGitRepository = () => {
|
|
|
83
65
|
};
|
|
84
66
|
var isInMercurialRepository = () => {
|
|
85
67
|
try {
|
|
86
|
-
|
|
68
|
+
execSync("hg --cwd . root", { stdio: "ignore" });
|
|
87
69
|
return true;
|
|
88
70
|
} catch (_) {
|
|
89
71
|
}
|
|
@@ -112,7 +94,7 @@ var create = async (name, options) => {
|
|
|
112
94
|
console.log("\n");
|
|
113
95
|
try {
|
|
114
96
|
createDirectory(name);
|
|
115
|
-
logInfo("\u{1F4E1} - Downloading files
|
|
97
|
+
logInfo("\u{1F4E1} - Downloading files...");
|
|
116
98
|
await fetchRepository(template);
|
|
117
99
|
logInfo("\u{1F3E0} - Starting a new git repository...");
|
|
118
100
|
setNameAndCommitChanges(name);
|
|
@@ -167,7 +149,7 @@ var setNameAndCommitChanges = (name) => {
|
|
|
167
149
|
var installDependencies = () => {
|
|
168
150
|
try {
|
|
169
151
|
const pkgManager = resolvePkgManager();
|
|
170
|
-
|
|
152
|
+
execSync2(`${pkgManager} install`, { stdio: [0, 1, 2] });
|
|
171
153
|
} catch (_) {
|
|
172
154
|
logError("\u{1F6AB} Failed to install project dependencies, continuing...");
|
|
173
155
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "A quick and easy way to bootstrap your dApps on Cardano using Mesh.",
|
|
4
4
|
"homepage": "https://meshjs.dev",
|
|
5
5
|
"author": "MeshJS",
|
|
6
|
-
"version": "1.7.
|
|
6
|
+
"version": "1.7.32",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.cjs",
|