fscr 6.2.6 → 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 -186
- 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 -17
- 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 +50 -45
- 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 +97 -90
- 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 +13 -9
- package/dist/lib/test-files/inputSample.js +17 -14
- package/dist/lib/test-files/testConsole.js +1 -1
- package/dist/lib/test-files/testInput.js +1 -1
- 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 +11 -29
package/dist/lib/startScripts.js
CHANGED
|
@@ -7,128 +7,143 @@ import parseScriptFile from "./parsers/parseScriptsMd.js";
|
|
|
7
7
|
import parsePackageFile from "./parsers/parseScriptsPackage.js";
|
|
8
8
|
import runCLICommand from "./running/runCLICommand.js";
|
|
9
9
|
import enquirerPkg from "enquirer";
|
|
10
|
-
const {
|
|
11
|
-
prompt
|
|
12
|
-
} = enquirerPkg;
|
|
10
|
+
const { prompt } = enquirerPkg;
|
|
13
11
|
import path from "path";
|
|
14
12
|
import fs from "fs";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
|
|
14
|
+
// Lazily read package.json / create the Conf store so importing this module never
|
|
15
|
+
// performs file IO (a dir without package.json must not crash `fsr` at startup).
|
|
16
|
+
let _config;
|
|
17
|
+
const getConfig = () => {
|
|
18
|
+
if (!_config) {
|
|
19
|
+
const packagePath = path.resolve(process.cwd(), "package.json");
|
|
20
|
+
const packageJson = JSON.parse(fs.readFileSync(packagePath));
|
|
21
|
+
_config = new Conf({ projectName: packageJson.name });
|
|
22
|
+
}
|
|
23
|
+
return _config;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const taskListAutoComplete = async (tasks) => {
|
|
27
|
+
try {
|
|
28
|
+
let { answer } = await prompt({
|
|
29
|
+
type: "autocomplete",
|
|
30
|
+
message: `${chalk.green.bold.underline("Choose task to run")}`,
|
|
31
|
+
choices: tasks,
|
|
32
|
+
name: `answer`
|
|
33
|
+
});
|
|
34
|
+
return answer.split(separator)[0].trim();
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
34
38
|
};
|
|
39
|
+
|
|
35
40
|
const startScripts = async (categories = true) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
let {
|
|
74
|
-
script,
|
|
75
|
-
lang
|
|
76
|
-
} = taskData;
|
|
77
|
-
let pars = script.split(" ");
|
|
78
|
-
let type = pars[0];
|
|
79
|
-
let env = {};
|
|
80
|
-
if (pars[0].includes("=")) {
|
|
81
|
-
let envs = type.split("=");
|
|
82
|
-
env[envs[0]] = envs[1];
|
|
83
|
-
type = pars[1];
|
|
84
|
-
pars.shift();
|
|
85
|
-
pars.shift();
|
|
86
|
-
script = pars.join(" ");
|
|
87
|
-
} else {
|
|
88
|
-
pars.shift();
|
|
89
|
-
script = pars.join(" ");
|
|
90
|
-
}
|
|
91
|
-
await runCLICommand({
|
|
92
|
-
task: {
|
|
93
|
-
name: taskToRun
|
|
94
|
-
},
|
|
95
|
-
script: {
|
|
96
|
-
lang: lang,
|
|
97
|
-
type: type,
|
|
98
|
-
env: env,
|
|
99
|
-
full: script,
|
|
100
|
-
rest: script.split(" ")
|
|
41
|
+
const FcScripts = await parseScriptFile();
|
|
42
|
+
if (FcScripts === false) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const config = getConfig();
|
|
46
|
+
let recentTasks = config.get("recentTasks", {});
|
|
47
|
+
let recentTaskArr = Object.keys(recentTasks)
|
|
48
|
+
.map((taskName) => {
|
|
49
|
+
let task = recentTasks[taskName];
|
|
50
|
+
return { name: taskName, lastExecuted: task.lastExecuted };
|
|
51
|
+
})
|
|
52
|
+
.sort((a, b) =>
|
|
53
|
+
a.lastExecuted > b.lastExecuted ? 1 : b.lastExecuted > a.lastExecuted ? -1 : 0
|
|
54
|
+
)
|
|
55
|
+
.reverse()
|
|
56
|
+
.slice(0, 3);
|
|
57
|
+
let recentTaskOptions = recentTaskArr.map((task) => {
|
|
58
|
+
return task.name + separator + moment(task.lastExecuted).calendar();
|
|
59
|
+
});
|
|
60
|
+
let taskToRun;
|
|
61
|
+
if (categories) {
|
|
62
|
+
taskToRun = await taskList(FcScripts, recentTaskOptions);
|
|
63
|
+
} else {
|
|
64
|
+
let tasks = FcScripts.allTasks;
|
|
65
|
+
|
|
66
|
+
taskToRun = await taskListAutoComplete(
|
|
67
|
+
tasks.map((task) => {
|
|
68
|
+
return `${task.name}${separator}${task.description}`;
|
|
69
|
+
})
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (recentTasks[taskToRun] === undefined) {
|
|
74
|
+
recentTasks[taskToRun] = { lastExecuted: Date.now() };
|
|
75
|
+
} else {
|
|
76
|
+
recentTasks[taskToRun].lastExecuted = Date.now();
|
|
101
77
|
}
|
|
102
|
-
|
|
78
|
+
config.set("recentTasks", recentTasks);
|
|
79
|
+
|
|
80
|
+
const taskData = FcScripts.allTasks.find((t) => t.name === taskToRun);
|
|
81
|
+
if (!taskData) {
|
|
82
|
+
console.error(`${chalk.bold.underline.red("Task not found")}`);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let { script, lang } = taskData;
|
|
87
|
+
let pars = script.split(" ");
|
|
88
|
+
let type = pars[0];
|
|
89
|
+
let env = {};
|
|
90
|
+
if (pars[0].includes("=")) {
|
|
91
|
+
let envs = type.split("=");
|
|
92
|
+
env[envs[0]] = envs[1];
|
|
93
|
+
type = pars[1];
|
|
94
|
+
pars.shift();
|
|
95
|
+
pars.shift();
|
|
96
|
+
script = pars.join(" ");
|
|
97
|
+
} else {
|
|
98
|
+
pars.shift();
|
|
99
|
+
script = pars.join(" ");
|
|
100
|
+
}
|
|
101
|
+
await runCLICommand({
|
|
102
|
+
task: { name: taskToRun },
|
|
103
|
+
script: {
|
|
104
|
+
lang: lang,
|
|
105
|
+
type: type,
|
|
106
|
+
env: env,
|
|
107
|
+
full: script,
|
|
108
|
+
rest: script.split(" ")
|
|
109
|
+
}
|
|
110
|
+
});
|
|
103
111
|
};
|
|
112
|
+
|
|
104
113
|
const startPackageScripts = async () => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
task: {
|
|
121
|
-
name: taskToRun
|
|
122
|
-
},
|
|
123
|
-
script: {
|
|
124
|
-
lang: taskToRun.lang,
|
|
125
|
-
type: "yarn",
|
|
126
|
-
full: taskToRun.script,
|
|
127
|
-
rest: taskToRun.script.split(" ").slice(1)
|
|
114
|
+
const packageScripts = await parsePackageFile();
|
|
115
|
+
|
|
116
|
+
let tasks = Object.keys(packageScripts).map((e) => {
|
|
117
|
+
return { name: e, script: packageScripts[e] };
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
let taskToRun = await taskListAutoComplete(
|
|
121
|
+
tasks.map((task) => {
|
|
122
|
+
return `${task.name}${separator}${task.script}`;
|
|
123
|
+
})
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
if (taskToRun === false) {
|
|
127
|
+
console.log(chalk.green.bold("See you soon!"));
|
|
128
|
+
return false;
|
|
128
129
|
}
|
|
129
|
-
|
|
130
|
+
await runCLICommand({
|
|
131
|
+
task: { name: taskToRun },
|
|
132
|
+
script: {
|
|
133
|
+
lang: taskToRun.lang,
|
|
134
|
+
type: "yarn",
|
|
135
|
+
full: taskToRun.script,
|
|
136
|
+
rest: taskToRun.script.split(" ").slice(1)
|
|
137
|
+
}
|
|
138
|
+
});
|
|
130
139
|
};
|
|
140
|
+
|
|
131
141
|
const clearRecent = async () => {
|
|
132
|
-
|
|
142
|
+
getConfig().set("recentTasks", {});
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
startScripts,
|
|
146
|
+
taskListAutoComplete,
|
|
147
|
+
clearRecent,
|
|
148
|
+
startPackageScripts
|
|
133
149
|
};
|
|
134
|
-
export { startScripts, taskListAutoComplete, clearRecent, startPackageScripts };
|
package/dist/lib/taskList.js
CHANGED
|
@@ -3,99 +3,106 @@ const separator = " ~ ";
|
|
|
3
3
|
import termSize from "term-size";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import { clear } from "./utils/index.js";
|
|
6
|
-
const convertBold = e => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
const convertBold = (e) => {
|
|
7
|
+
let reg = /(\*\*|^\*\*)(?=\S)([\s\S]*?\S)\*\*(?![\*\*\S])/g;
|
|
8
|
+
let boldMatches = e.match(reg);
|
|
9
|
+
if (boldMatches !== null) {
|
|
10
|
+
boldMatches.forEach((m) => {
|
|
11
|
+
e = e.replace(m, chalk.bold.redBright(m.replace(/\*\*/g, ""))); //.underline.bgBlack.whiteBright
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
let regunderline = /(_|^_)(?=\S)([\s\S]*?\S)_(?![_\S])/g;
|
|
15
|
+
let underlineMatches = e.match(regunderline);
|
|
16
|
+
if (underlineMatches !== null) {
|
|
17
|
+
underlineMatches.forEach((m) => {
|
|
18
|
+
e = e.replace(m, chalk.underline.greenBright(m.replace(/\_\_/g, ""))); //.underline.bgBlack.whiteBright
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return e;
|
|
22
22
|
};
|
|
23
|
-
const convertBoldArray = arr => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const convertBoldArray = (arr) => {
|
|
24
|
+
return arr.map((e) => {
|
|
25
|
+
return convertBold(e);
|
|
26
|
+
});
|
|
27
27
|
};
|
|
28
28
|
const taskList = async (FcScripts, recentTasks) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
return new Promise((resolve) => {
|
|
30
|
+
const promptUser = () => {
|
|
31
|
+
let choiceCategories = [
|
|
32
|
+
...recentTasks.map((cat) => {
|
|
33
|
+
return {
|
|
34
|
+
name: `${chalk.bold.underline.green(cat)}`,
|
|
35
|
+
value: { type: "task", name: cat }
|
|
36
|
+
};
|
|
37
|
+
}),
|
|
38
|
+
{ name: "-------------", value: null },
|
|
39
|
+
...FcScripts.categories.map((cat) => {
|
|
40
|
+
return {
|
|
41
|
+
name: `${chalk.bold.underline.green(cat.name)} ${separator} ${convertBold(
|
|
42
|
+
cat.description
|
|
43
|
+
)}`,
|
|
44
|
+
value: { type: "category", name: cat.name }
|
|
45
|
+
};
|
|
46
|
+
})
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const { rows } = termSize();
|
|
50
|
+
//=> {columns: 143, rows: 24}
|
|
51
|
+
inquirer
|
|
52
|
+
.prompt([
|
|
53
|
+
{
|
|
54
|
+
type: "list",
|
|
55
|
+
name: "category",
|
|
56
|
+
message: "What category do you want to run?",
|
|
57
|
+
pageSize: rows - 1,
|
|
58
|
+
choices: choiceCategories
|
|
59
|
+
}
|
|
60
|
+
])
|
|
61
|
+
.then(({ category }) => {
|
|
62
|
+
let sepInd = choiceCategories.indexOf("-------------");
|
|
63
|
+
let chosenInd = choiceCategories.indexOf(category);
|
|
64
|
+
if (category === null) {
|
|
65
|
+
// Ignore divider selection and prompt again
|
|
66
|
+
clear();
|
|
67
|
+
promptUser();
|
|
68
|
+
} else if (category.type === "task") {
|
|
69
|
+
let taskToRun = category.name.split(separator)[0].trim();
|
|
70
|
+
resolve(taskToRun);
|
|
71
|
+
} else {
|
|
72
|
+
let categoryName = category.name.split(separator)[0];
|
|
73
|
+
let catObj = FcScripts.categories.findIndex(
|
|
74
|
+
(e) => e.name === category.name
|
|
75
|
+
);
|
|
76
|
+
catObj = FcScripts.categories[catObj];
|
|
77
|
+
let taskNames = Object.keys(catObj.tasks).map((taskName) => {
|
|
78
|
+
let task = catObj.tasks[taskName];
|
|
79
|
+
return `${taskName} ${
|
|
80
|
+
task.description
|
|
81
|
+
? separator + task.description.replace(/\n/g, " ").trim()
|
|
82
|
+
: ""
|
|
83
|
+
}`;
|
|
84
|
+
});
|
|
85
|
+
taskNames = convertBoldArray(taskNames);
|
|
86
|
+
inquirer
|
|
87
|
+
.prompt([
|
|
88
|
+
{
|
|
89
|
+
type: "list",
|
|
90
|
+
name: "taskToRun",
|
|
91
|
+
message: "Which task do you want to run",
|
|
92
|
+
choices: taskNames
|
|
93
|
+
}
|
|
94
|
+
])
|
|
95
|
+
.then(({ taskToRun }) => {
|
|
96
|
+
taskToRun = taskToRun.split(separator)[0].trim();
|
|
97
|
+
resolve(taskToRun);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
49
101
|
};
|
|
50
|
-
})];
|
|
51
|
-
const {
|
|
52
|
-
rows
|
|
53
|
-
} = termSize();
|
|
54
|
-
//=> {columns: 143, rows: 24}
|
|
55
|
-
inquirer.prompt([{
|
|
56
|
-
type: "list",
|
|
57
|
-
name: "category",
|
|
58
|
-
message: "What category do you want to run?",
|
|
59
|
-
pageSize: rows - 1,
|
|
60
|
-
choices: choiceCategories
|
|
61
|
-
}]).then(({
|
|
62
|
-
category
|
|
63
|
-
}) => {
|
|
64
|
-
let sepInd = choiceCategories.indexOf("-------------");
|
|
65
|
-
let chosenInd = choiceCategories.indexOf(category);
|
|
66
|
-
if (category === null) {
|
|
67
|
-
// Ignore divider selection and prompt again
|
|
68
|
-
clear();
|
|
69
|
-
promptUser();
|
|
70
|
-
} else if (category.type === "task") {
|
|
71
|
-
let taskToRun = category.name.split(separator)[0].trim();
|
|
72
|
-
resolve(taskToRun);
|
|
73
|
-
} else {
|
|
74
|
-
let categoryName = category.name.split(separator)[0];
|
|
75
|
-
let catObj = FcScripts.categories.findIndex(e => e.name === category.name);
|
|
76
|
-
catObj = FcScripts.categories[catObj];
|
|
77
|
-
let taskNames = Object.keys(catObj.tasks).map(taskName => {
|
|
78
|
-
let task = catObj.tasks[taskName];
|
|
79
|
-
return `${taskName} ${task.description ? separator + task.description.replace(/\n/g, " ").trim() : ""}`;
|
|
80
|
-
});
|
|
81
|
-
taskNames = convertBoldArray(taskNames);
|
|
82
|
-
inquirer.prompt([{
|
|
83
|
-
type: "list",
|
|
84
|
-
name: "taskToRun",
|
|
85
|
-
message: "Which task do you want to run",
|
|
86
|
-
choices: taskNames
|
|
87
|
-
}]).then(({
|
|
88
|
-
taskToRun
|
|
89
|
-
}) => {
|
|
90
|
-
taskToRun = taskToRun.split(separator)[0].trim();
|
|
91
|
-
resolve(taskToRun);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
102
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
// Start the prompt
|
|
104
|
+
promptUser();
|
|
105
|
+
});
|
|
100
106
|
};
|
|
101
|
-
|
|
107
|
+
|
|
108
|
+
export default taskList;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<!-- toc -->
|
|
2
|
+
|
|
3
|
+
- [Build](#build)
|
|
4
|
+
* [v:publish-](#vpublish-)
|
|
5
|
+
* [script:js](#scriptjs)
|
|
6
|
+
- [Groups2](#groups2)
|
|
7
|
+
* [console:js](#consolejs)
|
|
8
|
+
* [input:js-](#inputjs-)
|
|
9
|
+
* [log:much:js](#logmuchjs)
|
|
10
|
+
|
|
11
|
+
<!-- tocstop -->
|
|
12
|
+
|
|
13
|
+
# Build
|
|
14
|
+
|
|
15
|
+
Build group description
|
|
16
|
+
|
|
17
|
+
## v:publish-
|
|
18
|
+
|
|
19
|
+
Update v and push
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
node src/utils/release/publish.js
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## add:command
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
oclif command
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## script:js
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
const chalk = require("chalk");
|
|
35
|
+
console.log(`${chalk.underline.bold("RUNS JS\n\nt")}`);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
# Groups2
|
|
39
|
+
|
|
40
|
+
That darn second group!!!!!
|
|
41
|
+
|
|
42
|
+
## console:js
|
|
43
|
+
|
|
44
|
+
Only one script here with bash
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node src/sampleScripts/exampleLogTimeout.js
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## input:js-
|
|
51
|
+
|
|
52
|
+
Get some input from user
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
node src/sampleScripts/exampleInput.js
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## log:much:js
|
|
59
|
+
|
|
60
|
+
Basically logs till yo momma says stop!
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
const chalk = require("chalk");
|
|
64
|
+
const sample = arr => arr[Math.floor(Math.random() * arr.length)];
|
|
65
|
+
const quotes = [
|
|
66
|
+
"The trickster's functiowhat they reslly s function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they res function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they rewant, some sort of freedom. - Tom Robbins",
|
|
67
|
+
'"Disbelief in magic can really s function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they res function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they rewant, some sort of freedom. - Tom Robbins",\n' +
|
|
68
|
+
' "Disbelief in magic can force a poor soul into believing in government and business. - Tom Robbins',
|
|
69
|
+
'The trouble with the fasforce a poor soul into believing in government and business. - Tom Robbins",\n' +
|
|
70
|
+
' "The trouble with the fasforce a poor soul into believing in government and business. - Tom Robbins",\n' +
|
|
71
|
+
' "The trouble with the fast lane is that all the movement is horizontal. And I like to go vertical sometimes. - Tom Robbins',
|
|
72
|
+
"Our world isn't made of earth, air and water or even molecules and atoms; our world is made of language. - Tom Robbimade of earth, air and water or even molecules and atoms; our world is made of language. - Tom Robbins",
|
|
73
|
+
"I'm not infatuated with frivoith frivoith frivoith frivoith frivoith frivoith frivoith frivolousness. We're just good friends. - Tom Robbins",
|
|
74
|
+
"In fiction, when you paint yourself into a corner, you can write a pair of suction cups onto the bottoms of your shoes and walk up the wall and out the skylight and see the sun breaking through the clouds. In nonfiction, you don't have that luxury. - Tom Robbins"
|
|
75
|
+
];
|
|
76
|
+
let sxy;
|
|
77
|
+
const getOption = st => {
|
|
78
|
+
// if (Math.random() > 0.5) {
|
|
79
|
+
// st = st + sample(quotes) + sample(quotes) + sample(quotes);
|
|
80
|
+
// }
|
|
81
|
+
let options = [
|
|
82
|
+
chalk.blue(st),
|
|
83
|
+
chalk.underline.green(st),
|
|
84
|
+
chalk.green.bgRed.bold(st),
|
|
85
|
+
chalk.blue(st, st, st, st),
|
|
86
|
+
chalk.red(st, chalk.underline.bgBlue(st) + st)
|
|
87
|
+
];
|
|
88
|
+
return sample(options);
|
|
89
|
+
};
|
|
90
|
+
let isMil = 0;
|
|
91
|
+
const theRun = async () => {
|
|
92
|
+
return new Promise(resolve => {
|
|
93
|
+
sxy = setInterval(() => {
|
|
94
|
+
const qt = sample(quotes);
|
|
95
|
+
console.log(new Date() + " ------- ----- ---- \n");
|
|
96
|
+
console.log(getOption(qt));
|
|
97
|
+
console.log(new Date() + " ------- ----- ---- \n");
|
|
98
|
+
console.log("----- ---- \n");
|
|
99
|
+
console.log("----- ---- \n");
|
|
100
|
+
console.log("----- ---- \n");
|
|
101
|
+
if (isMil === 30) {
|
|
102
|
+
clearInterval(sxy);
|
|
103
|
+
console.log("DONE DONE DONE");
|
|
104
|
+
resolve();
|
|
105
|
+
} else {
|
|
106
|
+
isMil += 10;
|
|
107
|
+
}
|
|
108
|
+
}, 1000);
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
theRun();
|
|
113
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<!-- toc -->
|
|
2
|
+
|
|
3
|
+
- [Group1](#group1)
|
|
4
|
+
* [parcel:script](#parcelscript)
|
|
5
|
+
* [script:js](#scriptjs)
|
|
6
|
+
- [Groups2](#groups2)
|
|
7
|
+
* [console:js](#consolejs)
|
|
8
|
+
* [input:js-](#inputjs-)
|
|
9
|
+
* [crazy:javascript](#crazyjavascript)
|
|
10
|
+
|
|
11
|
+
<!-- tocstop -->
|
|
12
|
+
|
|
13
|
+
# Group1
|
|
14
|
+
|
|
15
|
+
Explained G 1
|
|
16
|
+
|
|
17
|
+
## parcel:script
|
|
18
|
+
|
|
19
|
+
Described script 1
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
parcel ./index.html --no-cache
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## script:js
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
const chalk = require("chalk");
|
|
29
|
+
console.log(`${chalk.underline.bold("RUNS JS\n\nTEST")}`);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
# Groups2
|
|
33
|
+
|
|
34
|
+
## console:js
|
|
35
|
+
|
|
36
|
+
Only one script here with bash
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
node src/sampleScripts/exampleLogTimeout.js
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## input:js-
|
|
43
|
+
|
|
44
|
+
Get some input from user
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node src/sampleScripts/exampleInput.js
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## crazy:javascript
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
const chalk = require("chalk");
|
|
54
|
+
const sample = arr => arr[Math.floor(Math.random() * arr.length)];
|
|
55
|
+
const quotes = [
|
|
56
|
+
"The trickster's functiowhat they reslly s function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they res function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they rewant, some sort of freedom. - Tom Robbins",
|
|
57
|
+
'"Disbelief in magic can really s function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they res function is to break taboos, create mischief, stir things up. In the end, the trickster gives people what they rewant, some sort of freedom. - Tom Robbins",\n' +
|
|
58
|
+
' "Disbelief in magic can force a poor soul into believing in government and business. - Tom Robbins',
|
|
59
|
+
'The trouble with the fasforce a poor soul into believing in government and business. - Tom Robbins",\n' +
|
|
60
|
+
' "The trouble with the fasforce a poor soul into believing in government and business. - Tom Robbins",\n' +
|
|
61
|
+
' "The trouble with the fast lane is that all the movement is horizontal. And I like to go vertical sometimes. - Tom Robbins',
|
|
62
|
+
"Our world isn't made of earth, air and water or even molecules and atoms; our world is made of language. - Tom Robbimade of earth, air and water or even molecules and atoms; our world is made of language. - Tom Robbins",
|
|
63
|
+
"I'm not infatuated with frivoith frivoith frivoith frivoith frivoith frivoith frivoith frivolousness. We're just good friends. - Tom Robbins",
|
|
64
|
+
"In fiction, when you paint yourself into a corner, you can write a pair of suction cups onto the bottoms of your shoes and walk up the wall and out the skylight and see the sun breaking through the clouds. In nonfiction, you don't have that luxury. - Tom Robbins"
|
|
65
|
+
];
|
|
66
|
+
let sxy;
|
|
67
|
+
const getOption = st => {
|
|
68
|
+
// if (Math.random() > 0.5) {
|
|
69
|
+
// st = st + sample(quotes) + sample(quotes) + sample(quotes);
|
|
70
|
+
// }
|
|
71
|
+
let options = [
|
|
72
|
+
chalk.blue(st),
|
|
73
|
+
chalk.underline.green(st),
|
|
74
|
+
chalk.green.bgRed.bold(st),
|
|
75
|
+
chalk.blue(st, st, st, st),
|
|
76
|
+
chalk.red(st, chalk.underline.bgBlue(st) + st)
|
|
77
|
+
];
|
|
78
|
+
return sample(options);
|
|
79
|
+
};
|
|
80
|
+
let isMil = 0;
|
|
81
|
+
const theRun = async () => {
|
|
82
|
+
return new Promise(resolve => {
|
|
83
|
+
sxy = setInterval(() => {
|
|
84
|
+
const qt = sample(quotes);
|
|
85
|
+
console.log(new Date() + " ------- ----- ---- \n");
|
|
86
|
+
console.log(getOption(qt));
|
|
87
|
+
console.log(new Date() + " ------- ----- ---- \n");
|
|
88
|
+
console.log("----- ---- \n");
|
|
89
|
+
console.log("----- ---- \n");
|
|
90
|
+
console.log("----- ---- \n");
|
|
91
|
+
if (isMil === 30) {
|
|
92
|
+
clearInterval(sxy);
|
|
93
|
+
console.log("DONE DONE DONE");
|
|
94
|
+
resolve();
|
|
95
|
+
} else {
|
|
96
|
+
isMil += 10;
|
|
97
|
+
}
|
|
98
|
+
}, 1000);
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
theRun();
|
|
103
|
+
```
|