fscr 6.2.3 → 7.3.0
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/README.md +48 -30
- package/dist/index.js +502 -185
- package/dist/lib/auth/auth-conf.js +49 -45
- package/dist/lib/cache/README.md +341 -0
- package/dist/lib/cache/cli.js +152 -0
- package/dist/lib/cache/file-watcher.js +193 -0
- package/dist/lib/cache/index.js +422 -0
- package/dist/lib/cache/monitor.js +224 -0
- package/dist/lib/commands/doctor.js +225 -0
- package/dist/lib/completions/completion.js +342 -0
- package/dist/lib/completions/generator.js +152 -0
- package/dist/lib/completions/scripts/bash.sh +108 -0
- package/dist/lib/completions/scripts/fish.sh +105 -0
- package/dist/lib/completions/scripts/powershell.ps1 +168 -0
- package/dist/lib/completions/scripts/zsh.sh +124 -0
- package/dist/lib/diagnostics/cache.js +121 -0
- package/dist/lib/diagnostics/fileSystem.js +236 -0
- package/dist/lib/diagnostics/gitCheck.js +41 -0
- package/dist/lib/diagnostics/nodeVersion.js +68 -0
- package/dist/lib/diagnostics/packageManager.js +64 -0
- package/dist/lib/diagnostics/performance.js +141 -0
- package/dist/lib/encryption/decryptConfig.js +3 -2
- package/dist/lib/encryption/encryption.js +153 -113
- package/dist/lib/generators/generateFScripts.js +16 -13
- package/dist/lib/generators/generateToc.js +23 -14
- package/dist/lib/generators/index.js +1 -1
- package/dist/lib/git/pub.js +27 -31
- package/dist/lib/git/taskRunner.js +79 -69
- package/dist/lib/git/validateNotDev.js +65 -54
- package/dist/lib/optionList.js +69 -57
- package/dist/lib/parsers/parseScriptsMd.cached.js +208 -0
- package/dist/lib/parsers/parseScriptsMd.js +88 -79
- package/dist/lib/parsers/parseScriptsPackage.js +4 -3
- package/dist/lib/performance/cache.js +199 -0
- package/dist/lib/performance/lazy-loader.js +189 -0
- package/dist/lib/performance/monitor.js +303 -0
- package/dist/lib/plugins/deployment/index.js +113 -0
- package/dist/lib/plugins/hooks.js +17 -0
- package/dist/lib/plugins/loader.js +91 -0
- package/dist/lib/plugins/task-notifier/index.js +72 -0
- package/dist/lib/release/bump.js +51 -43
- package/dist/lib/release/commitWithMessage.js +80 -52
- package/dist/lib/release/publish.js +19 -14
- package/dist/lib/release/pushToGit.js +40 -31
- package/dist/lib/release/releasenotes.js +116 -97
- package/dist/lib/release/seeChangedFiles.js +68 -60
- package/dist/lib/release/sort.js +200 -116
- package/dist/lib/release/tree.js +161 -147
- package/dist/lib/release/validateNotDev.js +52 -44
- package/dist/lib/running/index.js +1 -1
- package/dist/lib/running/runCLICommand.js +41 -31
- package/dist/lib/running/runParallel.js +61 -59
- package/dist/lib/running/runSequence.js +55 -53
- package/dist/lib/startScripts.js +129 -114
- package/dist/lib/taskList.js +99 -84
- package/dist/lib/test-files/.fscripts.md +113 -0
- package/dist/lib/test-files/.fscripts.test.md +103 -0
- package/dist/lib/test-files/.fscriptsb.md +107 -0
- package/dist/lib/test-files/.mdtest.md +40 -0
- package/dist/lib/test-files/consoleSample.js +17 -0
- package/dist/lib/test-files/inputSample.js +20 -0
- package/dist/lib/test-files/testConsole.js +1 -0
- package/dist/lib/test-files/testInput.js +2 -0
- package/dist/lib/upgradePackages.js +56 -46
- package/dist/lib/utils/clear.js +16 -13
- package/dist/lib/utils/console.js +27 -21
- package/dist/lib/utils/encryption.js +55 -13
- package/dist/lib/utils/hash.js +128 -0
- package/dist/lib/utils/helpers.js +153 -142
- package/dist/lib/utils/index.js +1 -1
- package/dist/lib/utils/prompt.js +24 -29
- package/package.json +20 -32
- package/dist/lib/codemod/arrow.js +0 -13
- package/dist/lib/codemod/arrow2.js +0 -67
- package/dist/lib/codemod/funcs.js +0 -25
- package/dist/lib/codemod/removeConsole.js +0 -12
- package/dist/lib/codemod/test.js +0 -8
- package/dist/lib/components/App.js +0 -64
- package/dist/lib/components/Selector.js +0 -133
- package/dist/lib/components/TabChanger.js +0 -113
- package/dist/lib/components/Table.js +0 -177
- package/dist/lib/components/Tabs.js +0 -221
- package/dist/lib/generateFScripts.js +0 -25
- package/dist/lib/generateToc.js +0 -30
- package/dist/lib/helpers.js +0 -191
- package/dist/lib/parseScriptsMd.js +0 -85
- package/dist/lib/parseScriptsPackage.js +0 -9
- package/dist/lib/release/index.js +0 -4
- package/dist/lib/run/lib.js +0 -454
- package/dist/lib/run/main-p.js +0 -59
- package/dist/lib/run/main-s.js +0 -56
- package/dist/lib/run/parse-cli-args.js +0 -222
- package/dist/lib/run/run-p.js +0 -30
- package/dist/lib/run/run-s.js +0 -57
- package/dist/lib/runCLICommand.js +0 -30
- package/dist/lib/runParallel.js +0 -20
- package/dist/lib/runSequence.js +0 -38
- package/dist/lib/taskListAutoComplete.js +0 -15
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import fsOg from "fs";
|
|
1
2
|
import fs from "fs-extra";
|
|
2
3
|
import chalk from "chalk";
|
|
3
4
|
import boxen from "boxen";
|
|
5
|
+
|
|
4
6
|
const ONE_SIXTH = 1 / 6;
|
|
5
7
|
const ONE_THIRD = 1 / 3;
|
|
6
8
|
const TWO_THIRDS = 2 / 3;
|
|
@@ -15,30 +17,24 @@ const utils = {};
|
|
|
15
17
|
removeFile(file);
|
|
16
18
|
*/
|
|
17
19
|
utils.emptyDir = async f => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
try {
|
|
21
|
+
await fs.emptyDir(f);
|
|
22
|
+
// console.log(`${chalk.green.underline("Directory")} ${chalk.bold(f)} emptied!`);
|
|
23
|
+
} catch (err) {
|
|
24
|
+
console.error(err);
|
|
25
|
+
}
|
|
24
26
|
};
|
|
27
|
+
|
|
25
28
|
const desiredMode = 0o2775;
|
|
26
29
|
const defaultOptions = {
|
|
27
|
-
|
|
30
|
+
mode: desiredMode
|
|
28
31
|
};
|
|
29
32
|
utils.ensureDir = async (directory, options = defaultOptions) => {
|
|
30
|
-
|
|
31
|
-
await fs.ensureDir(directory, options);
|
|
32
|
-
} catch (err) {
|
|
33
|
-
console.error(err);
|
|
34
|
-
}
|
|
33
|
+
return await fsOg.existsSync(directory);
|
|
35
34
|
};
|
|
35
|
+
|
|
36
36
|
utils.ensureFile = async f => {
|
|
37
|
-
|
|
38
|
-
await fs.ensureFile(f);
|
|
39
|
-
} catch (err) {
|
|
40
|
-
console.error(err);
|
|
41
|
-
}
|
|
37
|
+
return await fsOg.existsSync(f);
|
|
42
38
|
};
|
|
43
39
|
|
|
44
40
|
/**
|
|
@@ -50,8 +46,7 @@ utils.ensureFile = async f => {
|
|
|
50
46
|
pathExists(file);
|
|
51
47
|
*/
|
|
52
48
|
utils.pathExists = async f => {
|
|
53
|
-
|
|
54
|
-
return exists;
|
|
49
|
+
return await fsOs.existsSync(f);
|
|
55
50
|
};
|
|
56
51
|
|
|
57
52
|
/**
|
|
@@ -63,32 +58,34 @@ utils.pathExists = async f => {
|
|
|
63
58
|
outputJson(file);
|
|
64
59
|
*/
|
|
65
60
|
utils.readJson = async f => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
try {
|
|
62
|
+
const packageObj = await fs.readJson(f);
|
|
63
|
+
// console.log(`${chalk.green.underline("File")} ${chalk.bold(f)} read!`);
|
|
64
|
+
return packageObj;
|
|
65
|
+
} catch (err) {
|
|
66
|
+
console.error(err);
|
|
67
|
+
return {};
|
|
68
|
+
}
|
|
74
69
|
};
|
|
70
|
+
|
|
75
71
|
utils.readFile = async f => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
try {
|
|
73
|
+
let fl = await fs.readFileSync(f, "utf8");
|
|
74
|
+
return fl;
|
|
75
|
+
} catch (err) {
|
|
76
|
+
console.error(err);
|
|
77
|
+
return {};
|
|
78
|
+
}
|
|
83
79
|
};
|
|
80
|
+
|
|
84
81
|
utils.removeFile = async f => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
try {
|
|
83
|
+
// console.log(`${chalk.green.underline("File")} ${chalk.bold(f)} removed!`);
|
|
84
|
+
return await fs.remove(f);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
console.error(`File ${f} NOT REMOVED! ${err}`);
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
92
89
|
};
|
|
93
90
|
|
|
94
91
|
/**
|
|
@@ -101,90 +98,104 @@ utils.removeFile = async f => {
|
|
|
101
98
|
writeFile(file);
|
|
102
99
|
*/
|
|
103
100
|
utils.writeFile = async (f, contents = "") => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
try {
|
|
102
|
+
return fs.writeFileSync(f, contents, "utf-8");
|
|
103
|
+
// console.log(`${chalk.green.underline("File")} ${chalk.bold(f)} written!`);
|
|
104
|
+
} catch (err) {
|
|
105
|
+
console.error(err);
|
|
106
|
+
}
|
|
110
107
|
};
|
|
108
|
+
|
|
111
109
|
utils.writeJson = async (f, json = {}) => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
try {
|
|
111
|
+
await fs.writeJson(f, json);
|
|
112
|
+
// console.log(`${chalk.green.underline("File")} ${chalk.bold(f)} written!`);
|
|
113
|
+
} catch (err) {
|
|
114
|
+
console.error(err);
|
|
115
|
+
}
|
|
118
116
|
};
|
|
117
|
+
|
|
119
118
|
utils.chainAsync = fns => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
let curr = 0;
|
|
120
|
+
const last = fns[fns.length - 1];
|
|
121
|
+
const next = () => {
|
|
122
|
+
const fn = fns[curr++];
|
|
123
|
+
fn === last ? fn() : fn(next);
|
|
124
|
+
};
|
|
125
|
+
next();
|
|
127
126
|
};
|
|
127
|
+
|
|
128
128
|
utils.appendToFile = async (f, contents = "") => {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
};
|
|
135
|
-
utils.boxInform = async (msg, secondary = "", padding = 0, margin = {
|
|
136
|
-
left: 2,
|
|
137
|
-
top: 0,
|
|
138
|
-
bottom: 0,
|
|
139
|
-
right: 0
|
|
140
|
-
}) => {
|
|
141
|
-
console.log(boxen(chalk.hex("#717877")(msg) + "\n" + chalk.bold.underline.hex("#438b34")(secondary) + chalk.hex("#717877")(" "), {
|
|
142
|
-
padding,
|
|
143
|
-
margin,
|
|
144
|
-
borderStyle: {
|
|
145
|
-
topLeft: chalk.hex("#5a596d")("╔"),
|
|
146
|
-
topRight: chalk.hex("#5a596d")("╗"),
|
|
147
|
-
bottomLeft: chalk.hex("#5a596d")("╚"),
|
|
148
|
-
bottomRight: chalk.hex("#5a596d")("╝"),
|
|
149
|
-
horizontal: chalk.hex("#5a596d")("═"),
|
|
150
|
-
vertical: chalk.hex("#5a596d")("║")
|
|
151
|
-
},
|
|
152
|
-
//"round",
|
|
153
|
-
align: "center" //,
|
|
154
|
-
}));
|
|
129
|
+
try {
|
|
130
|
+
await fs.appendFileSync(f, contents);
|
|
131
|
+
} catch (err) {
|
|
132
|
+
console.error(err);
|
|
133
|
+
}
|
|
155
134
|
};
|
|
135
|
+
|
|
136
|
+
utils.boxInform = async (
|
|
137
|
+
msg,
|
|
138
|
+
secondary = "",
|
|
139
|
+
padding = 0,
|
|
140
|
+
margin = {left: 2, top: 0, bottom: 0, right: 0}
|
|
141
|
+
) => {
|
|
142
|
+
console.log(
|
|
143
|
+
boxen(
|
|
144
|
+
chalk.hex("#717877")(msg) +
|
|
145
|
+
"\n" +
|
|
146
|
+
chalk.bold.underline.hex("#438b34")(secondary) +
|
|
147
|
+
chalk.hex("#717877")(" "),
|
|
148
|
+
{
|
|
149
|
+
padding,
|
|
150
|
+
margin,
|
|
151
|
+
borderStyle: {
|
|
152
|
+
topLeft: chalk.hex("#5a596d")("╔"),
|
|
153
|
+
topRight: chalk.hex("#5a596d")("╗"),
|
|
154
|
+
bottomLeft: chalk.hex("#5a596d")("╚"),
|
|
155
|
+
bottomRight: chalk.hex("#5a596d")("╝"),
|
|
156
|
+
horizontal: chalk.hex("#5a596d")("═"),
|
|
157
|
+
vertical: chalk.hex("#5a596d")("║")
|
|
158
|
+
}, //"round",
|
|
159
|
+
align: "center" //,
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
156
165
|
const hue2rgb = (p, q, t) => {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
166
|
+
if (t < 0) {
|
|
167
|
+
t += 1;
|
|
168
|
+
}
|
|
169
|
+
if (t > 1) {
|
|
170
|
+
t -= 1;
|
|
171
|
+
}
|
|
172
|
+
if (t < ONE_SIXTH) {
|
|
173
|
+
return p + (q - p) * 6 * t;
|
|
174
|
+
}
|
|
175
|
+
if (t < 0.5) {
|
|
176
|
+
return q;
|
|
177
|
+
}
|
|
178
|
+
if (t < TWO_THIRDS) {
|
|
179
|
+
return p + (q - p) * (TWO_THIRDS - t) * 6;
|
|
180
|
+
}
|
|
181
|
+
return p;
|
|
173
182
|
};
|
|
183
|
+
|
|
174
184
|
const hsl2rgb = (h, s, l) => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
185
|
+
if (s === 0) {
|
|
186
|
+
return new Array(3).fill(l);
|
|
187
|
+
}
|
|
188
|
+
const q = l < 0.5 ? l * s + l : l + s - l * s;
|
|
189
|
+
const p = 2 * l - q;
|
|
190
|
+
return [hue2rgb(p, q, h + ONE_THIRD), hue2rgb(p, q, h), hue2rgb(p, q, h - ONE_THIRD)];
|
|
181
191
|
};
|
|
192
|
+
|
|
182
193
|
utils.rainbowGradient = (len, saturation = 1, lightness = 0.5) => {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
194
|
+
const gradient = [];
|
|
195
|
+
for (let x = 0; x < len; x++) {
|
|
196
|
+
gradient.push(hsl2rgb(x / len, saturation, lightness).map(c => Math.round(c * 255)));
|
|
197
|
+
}
|
|
198
|
+
return gradient;
|
|
188
199
|
};
|
|
189
200
|
|
|
190
201
|
/**
|
|
@@ -192,37 +203,37 @@ utils.rainbowGradient = (len, saturation = 1, lightness = 0.5) => {
|
|
|
192
203
|
* @type {Date}
|
|
193
204
|
*/
|
|
194
205
|
utils.timestamp = () => {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
// Create a date object with the current time
|
|
207
|
+
let now = new Date();
|
|
208
|
+
|
|
209
|
+
// Create an array with the current hour, minute and second
|
|
210
|
+
let time = [now.getHours(), now.getMinutes(), now.getSeconds()];
|
|
211
|
+
time = time.map(e => {
|
|
212
|
+
if (e < 10) {
|
|
213
|
+
return (e + "").padStart(2, "0");
|
|
214
|
+
} else {
|
|
215
|
+
return e;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
// Return the formatted string
|
|
219
|
+
return time.join(":");
|
|
209
220
|
};
|
|
210
221
|
|
|
211
222
|
// utils.emptyDir = async () => {};
|
|
212
223
|
export default utils;
|
|
213
224
|
export const {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
} = utils;
|
|
225
|
+
emptyDir,
|
|
226
|
+
ensureDir,
|
|
227
|
+
ensureFile,
|
|
228
|
+
pathExists,
|
|
229
|
+
readJson,
|
|
230
|
+
readFile,
|
|
231
|
+
removeFile,
|
|
232
|
+
writeFile,
|
|
233
|
+
writeJson,
|
|
234
|
+
chainAsync,
|
|
235
|
+
appendToFile,
|
|
236
|
+
boxInform,
|
|
237
|
+
rainbowGradient,
|
|
238
|
+
timestamp
|
|
239
|
+
} = utils;
|
package/dist/lib/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./helpers.js";
|
|
2
|
-
export { default as clear } from "./clear.js";
|
|
2
|
+
export { default as clear } from "./clear.js";
|
package/dist/lib/utils/prompt.js
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import enquirerPkg from "enquirer";
|
|
2
|
-
const {
|
|
3
|
-
prompt
|
|
4
|
-
} = enquirerPkg;
|
|
2
|
+
const { prompt } = enquirerPkg;
|
|
5
3
|
import chalk from "chalk";
|
|
4
|
+
|
|
6
5
|
const promptQuestion = async (extended = {}, message = `name it:`) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
if (extended.type === "list") {
|
|
7
|
+
extended.type = "select";
|
|
8
|
+
}
|
|
9
|
+
if (extended.message) {
|
|
10
|
+
message = extended.message;
|
|
11
|
+
}
|
|
12
|
+
if (extended.choices && extended.choices[0].value) {
|
|
13
|
+
extended.choices = extended.choices.map(e => {
|
|
14
|
+
return { message: e.name, value: e.value };
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (extended.pageSize) {
|
|
18
|
+
extended.limit = extended.pageSize;
|
|
19
|
+
}
|
|
20
|
+
const { answer } = await prompt({
|
|
21
|
+
type: "input",
|
|
22
|
+
message: `${chalk.green.bold.underline(message)}`,
|
|
23
|
+
name: `answer`,
|
|
24
|
+
...extended
|
|
19
25
|
});
|
|
20
|
-
|
|
21
|
-
if (extended.pageSize) {
|
|
22
|
-
extended.limit = extended.pageSize;
|
|
23
|
-
}
|
|
24
|
-
const {
|
|
25
|
-
answer
|
|
26
|
-
} = await prompt({
|
|
27
|
-
type: "input",
|
|
28
|
-
message: `${chalk.green.bold.underline(message)}`,
|
|
29
|
-
name: `answer`,
|
|
30
|
-
...extended
|
|
31
|
-
});
|
|
32
|
-
return answer;
|
|
26
|
+
return answer;
|
|
33
27
|
};
|
|
34
|
-
|
|
28
|
+
|
|
29
|
+
export default promptQuestion;
|
package/package.json
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fscr",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Runs the fscripts.md file",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
9
|
-
"build": "run-p build:index build:lib",
|
|
10
|
-
"build:index": "babel index.js --ignore 'node_modules' --out-file dist/index.js",
|
|
11
|
-
"build:lib": "babel lib --ignore 'node_modules' --out-dir dist/lib --copy-files",
|
|
8
|
+
"build": "rimraf dist && mkdir -p dist/lib && cp -r lib/. dist/lib && cp index.js dist/index.js",
|
|
12
9
|
"fsr": "node dist/index.js",
|
|
13
|
-
"release": "
|
|
14
|
-
"release:build": "run-p build:index build:lib",
|
|
15
|
-
"release:bump": "yarn fsr bump",
|
|
16
|
-
"release:clean": "rimraf dist",
|
|
17
|
-
"release:combined": "np --any-branch",
|
|
10
|
+
"release": "yarn fsr bump && yarn build",
|
|
18
11
|
"release:publish": "node lib/release/publish.js",
|
|
19
12
|
"start": "run-s build start:run",
|
|
20
|
-
"start:basic": "babel-node index.js",
|
|
21
|
-
"start:build": "babel-node index.js --ignore 'node_modules'",
|
|
22
13
|
"start:run": "node dist/index.js",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
14
|
+
"watch": "nodemon --watch lib --watch index.js --ext js --exec \"mkdir -p dist/lib && cp -r lib/. dist/lib && cp index.js dist/index.js\" --ignore 'node_modules' -I",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"test:watch": "vitest",
|
|
17
|
+
"test:ui": "vitest --ui",
|
|
18
|
+
"test:coverage": "vitest run --coverage",
|
|
19
|
+
"test:unit": "vitest run tests/unit",
|
|
20
|
+
"test:integration": "vitest run tests/integration",
|
|
21
|
+
"test:e2e": "vitest run tests/e2e",
|
|
22
|
+
"test:performance": "vitest run tests/performance"
|
|
27
23
|
},
|
|
28
24
|
"fscripts": {
|
|
29
25
|
"encryptedFiles": [
|
|
@@ -47,11 +43,9 @@
|
|
|
47
43
|
"bin"
|
|
48
44
|
],
|
|
49
45
|
"bin": {
|
|
50
|
-
"fscr": "./bin",
|
|
51
46
|
"fsr": "./bin"
|
|
52
47
|
},
|
|
53
48
|
"dependencies": {
|
|
54
|
-
"@babel/runtime": "^7.9.2",
|
|
55
49
|
"better-md-2-json": "^1.0.6",
|
|
56
50
|
"boxen": "^8.0.1",
|
|
57
51
|
"chalk": "^4.1.2",
|
|
@@ -64,9 +58,8 @@
|
|
|
64
58
|
"git-release-notes": "^5.0.0",
|
|
65
59
|
"git-state": "^4.1.0",
|
|
66
60
|
"github-basic": "^6.0.0",
|
|
67
|
-
"ink": "^
|
|
68
|
-
"ink-
|
|
69
|
-
"ink-select-input": "^6.2.0",
|
|
61
|
+
"ink": "^5.2.1",
|
|
62
|
+
"ink-select-input": "^4.2.2",
|
|
70
63
|
"inquirer": "^12.9.6",
|
|
71
64
|
"is-builtin-module": "^5.0.0",
|
|
72
65
|
"json-colorz": "^0.2.7",
|
|
@@ -77,7 +70,7 @@
|
|
|
77
70
|
"moment-mini": "^2.24.0",
|
|
78
71
|
"open": "^10.2.0",
|
|
79
72
|
"pretty-ms": "^9.3.0",
|
|
80
|
-
"react": "^
|
|
73
|
+
"react": "^18.3.1",
|
|
81
74
|
"require-from-string": "^2.0.2",
|
|
82
75
|
"server-destroy": "^1.0.1",
|
|
83
76
|
"set-value": "^4.1.0",
|
|
@@ -88,17 +81,10 @@
|
|
|
88
81
|
"term-size": "^4.0.0"
|
|
89
82
|
},
|
|
90
83
|
"devDependencies": {
|
|
91
|
-
"@
|
|
92
|
-
"
|
|
93
|
-
"@babel/node": "^7.8.7",
|
|
94
|
-
"@babel/plugin-proposal-decorators": "^7.8.3",
|
|
95
|
-
"@babel/plugin-proposal-export-default-from": "^7.8.3",
|
|
96
|
-
"@babel/plugin-syntax-class-properties": "^7.8.3",
|
|
97
|
-
"@babel/plugin-transform-runtime": "^7.9.0",
|
|
98
|
-
"@babel/preset-env": "^7.9.0",
|
|
99
|
-
"@babel/preset-react": "^7.9.1",
|
|
100
|
-
"babel-plugin-module-resolver": "^5.0.2",
|
|
84
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
85
|
+
"execa": "8.0.1",
|
|
101
86
|
"fancy-log": "^2.0.0",
|
|
87
|
+
"fc-filepick": "^1.3.0",
|
|
102
88
|
"fkill-cli": "^8.0.0",
|
|
103
89
|
"ink-tab": "^5.2.0",
|
|
104
90
|
"ink-table": "^3.1.0",
|
|
@@ -114,8 +100,10 @@
|
|
|
114
100
|
"remarkable": "^2.0.0",
|
|
115
101
|
"rexrex": "^1.3.0",
|
|
116
102
|
"rimraf": "^6.0.1",
|
|
103
|
+
"strip-ansi": "^7.1.2",
|
|
117
104
|
"terminal-tree": "^0.0.3",
|
|
118
105
|
"underscore.string": "^3.3.5",
|
|
106
|
+
"vitest": "^3.2.4",
|
|
119
107
|
"yargs": "^18.0.0"
|
|
120
108
|
},
|
|
121
109
|
"peerDependencies": {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
let bbt = $("<div id='btt'>DOWNLOAD LINKS</div>");
|
|
2
|
-
$("body").append(`<style>#btt { position:fixed; z-index:8999999; bottom:0;left:0; background:rgba(0,0,0,0.6); padding:10px; color:white;}</style>`);
|
|
3
|
-
bbt.on("click", function () {
|
|
4
|
-
let linkszz = $(".c-dl-links a");
|
|
5
|
-
let dwlinks = [];
|
|
6
|
-
linkszz.each(function () {
|
|
7
|
-
if ($(this).attr("href").startsWith("https://rapidga")) {
|
|
8
|
-
dwlinks.push($(this).attr("href"));
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
window.navigator.clipboard.writeText(JSON.stringify(dwlinks));
|
|
12
|
-
});
|
|
13
|
-
$("body").append(bbt);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
module.exports = (file, api, options) => {
|
|
2
|
-
const j = api.jscodeshift;
|
|
3
|
-
const printOptions = options.printOptions || {
|
|
4
|
-
quote: 'single'
|
|
5
|
-
};
|
|
6
|
-
const root = j(file.source);
|
|
7
|
-
const ARGUMENTS = 'arguments';
|
|
8
|
-
const ARGS = 'args';
|
|
9
|
-
const createArrowFunctionExpression = (fn, args) => j.arrowFunctionExpression((fn.params || []).concat(j.restElement(args)), fn.body, fn.generator);
|
|
10
|
-
const filterMemberExpressions = path => path.parent.value.type !== "MemberExpression";
|
|
11
|
-
const filterArrowFunctions = path => {
|
|
12
|
-
while (path.parent) {
|
|
13
|
-
switch (path.value.type) {
|
|
14
|
-
case 'ArrowFunctionExpression':
|
|
15
|
-
if (j(path).find(j.Identifier, {
|
|
16
|
-
name: ARGS
|
|
17
|
-
}).size()) {
|
|
18
|
-
console.error(file.path + ': arrow function uses "' + ARGS + '" already. ' + 'Please rename this identifier first.');
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
case 'FunctionExpression':
|
|
23
|
-
case 'MethodDeclaration':
|
|
24
|
-
case 'Function':
|
|
25
|
-
case 'FunctionDeclaration':
|
|
26
|
-
return false;
|
|
27
|
-
default:
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
path = path.parent;
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
};
|
|
34
|
-
const updateArgumentsCalls = path => {
|
|
35
|
-
var afPath = path;
|
|
36
|
-
while (afPath.parent) {
|
|
37
|
-
if (afPath.value.type == 'ArrowFunctionExpression') {
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
afPath = afPath.parent;
|
|
41
|
-
}
|
|
42
|
-
const {
|
|
43
|
-
value: fn
|
|
44
|
-
} = afPath;
|
|
45
|
-
const {
|
|
46
|
-
params
|
|
47
|
-
} = fn;
|
|
48
|
-
const param = params[params.length - 1];
|
|
49
|
-
var args;
|
|
50
|
-
if (param && param.type == 'RestElement') {
|
|
51
|
-
params.pop();
|
|
52
|
-
args = param.argument;
|
|
53
|
-
} else {
|
|
54
|
-
args = j.identifier(ARGS);
|
|
55
|
-
}
|
|
56
|
-
j(afPath).replaceWith(createArrowFunctionExpression(fn, args));
|
|
57
|
-
if (params.length) {
|
|
58
|
-
j(path).replaceWith(j.arrayExpression(params.concat(j.spreadElement(args))));
|
|
59
|
-
} else {
|
|
60
|
-
j(path).replaceWith(args);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const didTransform = root.find(j.Identifier, {
|
|
64
|
-
name: ARGUMENTS
|
|
65
|
-
}).filter(filterMemberExpressions).filter(filterArrowFunctions).forEach(updateArgumentsCalls).size() > 0;
|
|
66
|
-
return didTransform ? root.toSource(printOptions) : null;
|
|
67
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export default (fileInfo, api) => {
|
|
2
|
-
const j = api.jscodeshift;
|
|
3
|
-
return j(fileInfo.source).find(j.FunctionExpression).forEach(path => {
|
|
4
|
-
console.warn("-- Console oa", path.value);
|
|
5
|
-
}).toSource();
|
|
6
|
-
// return j(fileInfo.source)
|
|
7
|
-
// .find(j.CallExpression, {
|
|
8
|
-
// callee: {
|
|
9
|
-
// type: "MemberExpression",
|
|
10
|
-
// object: { type: "Identifier", name: "function" }
|
|
11
|
-
// }
|
|
12
|
-
// })
|
|
13
|
-
// .remove()
|
|
14
|
-
// .toSource();
|
|
15
|
-
// return api
|
|
16
|
-
// .jscodeshift(fileInfo.source)
|
|
17
|
-
// .find(j.CallExpression, {
|
|
18
|
-
// callee: {
|
|
19
|
-
// type: "MemberExpression",
|
|
20
|
-
// object: { type: "Identifier", name: "function" }
|
|
21
|
-
// }
|
|
22
|
-
// })
|
|
23
|
-
// .renameTo("zebra")
|
|
24
|
-
// .toSource();
|
|
25
|
-
};
|