fscr 6.2.2 → 6.2.6

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.
Files changed (37) hide show
  1. package/dist/index.js +43 -25
  2. package/dist/lib/git/pub.js +0 -14
  3. package/dist/lib/release/bump.js +9 -6
  4. package/dist/lib/running/runParallel.js +43 -25
  5. package/dist/lib/running/runSequence.js +41 -24
  6. package/dist/lib/taskList.js +69 -61
  7. package/dist/lib/test-files/consoleSample.js +13 -0
  8. package/dist/lib/test-files/inputSample.js +17 -0
  9. package/dist/lib/test-files/testConsole.js +1 -0
  10. package/dist/lib/test-files/testInput.js +2 -0
  11. package/package.json +12 -6
  12. package/dist/lib/codemod/arrow.js +0 -13
  13. package/dist/lib/codemod/arrow2.js +0 -67
  14. package/dist/lib/codemod/funcs.js +0 -25
  15. package/dist/lib/codemod/removeConsole.js +0 -12
  16. package/dist/lib/codemod/test.js +0 -8
  17. package/dist/lib/components/App.js +0 -64
  18. package/dist/lib/components/Selector.js +0 -133
  19. package/dist/lib/components/TabChanger.js +0 -113
  20. package/dist/lib/components/Table.js +0 -177
  21. package/dist/lib/components/Tabs.js +0 -221
  22. package/dist/lib/generateFScripts.js +0 -25
  23. package/dist/lib/generateToc.js +0 -30
  24. package/dist/lib/helpers.js +0 -191
  25. package/dist/lib/parseScriptsMd.js +0 -85
  26. package/dist/lib/parseScriptsPackage.js +0 -9
  27. package/dist/lib/release/index.js +0 -4
  28. package/dist/lib/run/lib.js +0 -454
  29. package/dist/lib/run/main-p.js +0 -59
  30. package/dist/lib/run/main-s.js +0 -56
  31. package/dist/lib/run/parse-cli-args.js +0 -222
  32. package/dist/lib/run/run-p.js +0 -30
  33. package/dist/lib/run/run-s.js +0 -57
  34. package/dist/lib/runCLICommand.js +0 -30
  35. package/dist/lib/runParallel.js +0 -20
  36. package/dist/lib/runSequence.js +0 -38
  37. package/dist/lib/taskListAutoComplete.js +0 -15
package/dist/index.js CHANGED
@@ -92,32 +92,49 @@ const runCmd = async (app, argsList = []) => {
92
92
  script,
93
93
  lang
94
94
  } = taskData;
95
- let pars = script.split(" ");
96
- let type = pars[0];
97
- let env = {};
98
- if (pars[0].includes("=")) {
99
- let envs = type.split("=");
100
- env[envs[0]] = envs[1];
101
- type = pars[1];
102
- pars.shift();
103
- pars.shift();
104
- script = pars.join(" ");
95
+ if (lang === "javascript") {
96
+ // For JavaScript, use the script as-is without parsing
97
+ await runCLICommand({
98
+ task: {
99
+ name: task
100
+ },
101
+ script: {
102
+ lang: lang,
103
+ env: {},
104
+ type: "node",
105
+ full: script,
106
+ rest: []
107
+ }
108
+ });
105
109
  } else {
106
- pars.shift();
107
- script = pars.join(" ");
108
- }
109
- await runCLICommand({
110
- task: {
111
- name: task
112
- },
113
- script: {
114
- lang: lang,
115
- env: env,
116
- type: type,
117
- full: script,
118
- rest: script.split(" ")
110
+ // For bash scripts, parse command and environment variables
111
+ let pars = script.split(" ");
112
+ let type = pars[0];
113
+ let env = {};
114
+ if (pars[0].includes("=")) {
115
+ let envs = type.split("=");
116
+ env[envs[0]] = envs[1];
117
+ type = pars[1];
118
+ pars.shift();
119
+ pars.shift();
120
+ script = pars.join(" ");
121
+ } else {
122
+ pars.shift();
123
+ script = pars.join(" ");
119
124
  }
120
- });
125
+ await runCLICommand({
126
+ task: {
127
+ name: task
128
+ },
129
+ script: {
130
+ lang: lang,
131
+ env: env,
132
+ type: type,
133
+ full: script,
134
+ rest: script.split(" ")
135
+ }
136
+ });
137
+ }
121
138
  }).example(`${taskName("$0 run start:web")}`, `${textDescription("Run task 'start:web'")}`)
122
139
 
123
140
  /**
@@ -133,7 +150,8 @@ const runCmd = async (app, argsList = []) => {
133
150
  * bump --
134
151
  */.command("bump", "Bump package.json and beautify it!", () => {}, async function (argv) {
135
152
  let type = argv.type;
136
- await bump(type);
153
+ let skipGit = argv.skipGit;
154
+ await bump(type, skipGit === "true");
137
155
  }).example(`${taskName("$0 bump")}`, `${textDescription("BUMPED AND PRETTY!")}`)
138
156
 
139
157
  /**
@@ -1,25 +1,11 @@
1
1
  import inquirer from "inquirer";
2
2
  import chalk from "chalk";
3
- import boxen from "boxen";
4
3
  import path from "path";
5
4
  import { fileURLToPath } from "url";
6
5
  const __filename = fileURLToPath(import.meta.url);
7
6
  const __dirname = path.dirname(__filename);
8
- import runTask from "./taskRunner.js";
9
7
  import { readJson } from "../utils/helpers.js";
10
8
  import simple from "simple-git";
11
- // pub();
12
- const newBranch = async name => {
13
- await simple().checkoutLocalBranch(name);
14
- };
15
- async function pub() {
16
- // runTask("sh " + path.join(__dirname, "publish.sh") + " --")
17
- // .then(async () => {
18
- // })
19
- // .catch(e => {
20
- // console.warn("-- Console ERR", e);
21
- // });
22
- }
23
9
  import validateNotInDev from "./validateNotDev.js";
24
10
  (async () => {
25
11
  await validateNotInDev();
@@ -11,7 +11,7 @@ if (!fs.existsSync(packagePath)) {
11
11
  console.error("Cannot find package.json file in the current directory");
12
12
  process.exit(1);
13
13
  }
14
- const bump = async (typeParam = null) => {
14
+ const bump = async (typeParam = null, skipGit = false) => {
15
15
  let type = "patch";
16
16
  if (!typeParam) {
17
17
  type = await prompt({
@@ -22,11 +22,14 @@ const bump = async (typeParam = null) => {
22
22
  } else {
23
23
  type = typeParam;
24
24
  }
25
- let gitTag = await prompt({
26
- type: "confirm",
27
- message: chalk.green.bold.underline("Add git tag?"),
28
- default: false
29
- });
25
+ let gitTag = false;
26
+ if (!skipGit) {
27
+ gitTag = await prompt({
28
+ type: "confirm",
29
+ message: chalk.green.bold.underline("Add git tag?"),
30
+ default: false
31
+ });
32
+ }
30
33
  await runAsync(`yarn version --${type} ${gitTag ? "--no-git-tag-version" : ""} --no-commit-hooks`);
31
34
  const packageJson = await fs.readFileSync(packagePath);
32
35
  const {
@@ -12,33 +12,51 @@ const runParallel = async (tasks, FcScripts) => {
12
12
  script,
13
13
  lang
14
14
  } = taskData;
15
- let pars = script.split(" ");
16
- let type = pars[0];
17
- let env = {};
18
- if (pars[0].includes("=")) {
19
- let envs = type.split("=");
20
- env[envs[0]] = envs[1];
21
- type = pars[1];
22
- pars.shift();
23
- pars.shift();
24
- script = pars.join(" ");
15
+ if (lang === "javascript") {
16
+ // For JavaScript, use the script as-is without parsing
17
+ await runCLICommand({
18
+ task: {
19
+ name: taskName
20
+ },
21
+ script: {
22
+ lang: lang,
23
+ env: {},
24
+ type: "node",
25
+ full: script,
26
+ rest: []
27
+ }
28
+ });
29
+ resolve();
25
30
  } else {
26
- pars.shift();
27
- script = pars.join(" ");
28
- }
29
- await runCLICommand({
30
- task: {
31
- name: taskName
32
- },
33
- script: {
34
- lang: lang,
35
- env: env,
36
- type: type,
37
- full: script,
38
- rest: script.split(" ")
31
+ // For bash scripts, parse command and environment variables
32
+ let pars = script.split(" ");
33
+ let type = pars[0];
34
+ let env = {};
35
+ if (pars[0].includes("=")) {
36
+ let envs = type.split("=");
37
+ env[envs[0]] = envs[1];
38
+ type = pars[1];
39
+ pars.shift();
40
+ pars.shift();
41
+ script = pars.join(" ");
42
+ } else {
43
+ pars.shift();
44
+ script = pars.join(" ");
39
45
  }
40
- });
41
- resolve();
46
+ await runCLICommand({
47
+ task: {
48
+ name: taskName
49
+ },
50
+ script: {
51
+ lang: lang,
52
+ env: env,
53
+ type: type,
54
+ full: script,
55
+ rest: script.split(" ")
56
+ }
57
+ });
58
+ resolve();
59
+ }
42
60
  }
43
61
  });
44
62
  });
@@ -11,32 +11,49 @@ const runSequence = async (tasks, FcScripts) => {
11
11
  script,
12
12
  lang
13
13
  } = taskData;
14
- let pars = script.split(" ");
15
- let type = pars[0];
16
- let env = {};
17
- if (pars[0].includes("=")) {
18
- let envs = type.split("=");
19
- env[envs[0]] = envs[1];
20
- type = pars[1];
21
- pars.shift();
22
- pars.shift();
23
- script = pars.join(" ");
14
+ if (lang === "javascript") {
15
+ // For JavaScript, use the script as-is without parsing
16
+ await runCLICommand({
17
+ task: {
18
+ name: taskName
19
+ },
20
+ script: {
21
+ lang: lang,
22
+ env: {},
23
+ type: "node",
24
+ full: script,
25
+ rest: []
26
+ }
27
+ });
24
28
  } else {
25
- pars.shift();
26
- script = pars.join(" ");
27
- }
28
- await runCLICommand({
29
- task: {
30
- name: taskName
31
- },
32
- script: {
33
- lang: lang,
34
- env: env,
35
- type: type,
36
- full: script,
37
- rest: script.split(" ")
29
+ // For bash scripts, parse command and environment variables
30
+ let pars = script.split(" ");
31
+ let type = pars[0];
32
+ let env = {};
33
+ if (pars[0].includes("=")) {
34
+ let envs = type.split("=");
35
+ env[envs[0]] = envs[1];
36
+ type = pars[1];
37
+ pars.shift();
38
+ pars.shift();
39
+ script = pars.join(" ");
40
+ } else {
41
+ pars.shift();
42
+ script = pars.join(" ");
38
43
  }
39
- });
44
+ await runCLICommand({
45
+ task: {
46
+ name: taskName
47
+ },
48
+ script: {
49
+ lang: lang,
50
+ env: env,
51
+ type: type,
52
+ full: script,
53
+ rest: script.split(" ")
54
+ }
55
+ });
56
+ }
40
57
  }
41
58
  }
42
59
  };
@@ -2,6 +2,7 @@ import inquirer from "inquirer";
2
2
  const separator = " ~ ";
3
3
  import termSize from "term-size";
4
4
  import chalk from "chalk";
5
+ import { clear } from "./utils/index.js";
5
6
  const convertBold = e => {
6
7
  let reg = /(\*\*|^\*\*)(?=\S)([\s\S]*?\S)\*\*(?![\*\*\S])/g;
7
8
  let boldMatches = e.match(reg);
@@ -26,68 +27,75 @@ const convertBoldArray = arr => {
26
27
  };
27
28
  const taskList = async (FcScripts, recentTasks) => {
28
29
  return new Promise(resolve => {
29
- let choiceCategories = [...recentTasks.map(cat => {
30
- return {
31
- name: `${chalk.bold.underline.green(cat)}`,
32
- value: {
33
- type: "task",
34
- name: cat
35
- }
36
- };
37
- }), {
38
- name: "-------------",
39
- value: null
40
- }, ...FcScripts.categories.map(cat => {
41
- return {
42
- name: `${chalk.bold.underline.green(cat.name)} ${separator} ${convertBold(cat.description)}`,
43
- value: {
44
- type: "category",
45
- name: cat.name
46
- }
47
- };
48
- })];
49
- const {
50
- rows
51
- } = termSize();
52
- //=> {columns: 143, rows: 24}
53
- inquirer.prompt([{
54
- type: "list",
55
- name: "category",
56
- message: "What category do you want to run?",
57
- pageSize: rows - 1,
58
- choices: choiceCategories
59
- }]).then(({
60
- category
61
- }) => {
62
- let sepInd = choiceCategories.indexOf("-------------");
63
- let chosenInd = choiceCategories.indexOf(category);
64
- if (category === null) {
65
- console.log("Can't select divider");
66
- } else if (category.type === "task") {
67
- let taskToRun = category.name.split(separator)[0].trim();
68
- resolve(taskToRun);
69
- } else {
70
- let categoryName = category.name.split(separator)[0];
71
- let catObj = FcScripts.categories.findIndex(e => e.name === category.name);
72
- catObj = FcScripts.categories[catObj];
73
- let taskNames = Object.keys(catObj.tasks).map(taskName => {
74
- let task = catObj.tasks[taskName];
75
- return `${taskName} ${task.description ? separator + task.description.replace(/\n/g, " ").trim() : ""}`;
76
- });
77
- taskNames = convertBoldArray(taskNames);
78
- inquirer.prompt([{
79
- type: "list",
80
- name: "taskToRun",
81
- message: "Which task do you want to run",
82
- choices: taskNames
83
- }]).then(({
84
- taskToRun
85
- }) => {
86
- taskToRun = taskToRun.split(separator)[0].trim();
30
+ const promptUser = () => {
31
+ let choiceCategories = [...recentTasks.map(cat => {
32
+ return {
33
+ name: `${chalk.bold.underline.green(cat)}`,
34
+ value: {
35
+ type: "task",
36
+ name: cat
37
+ }
38
+ };
39
+ }), {
40
+ name: "-------------",
41
+ value: null
42
+ }, ...FcScripts.categories.map(cat => {
43
+ return {
44
+ name: `${chalk.bold.underline.green(cat.name)} ${separator} ${convertBold(cat.description)}`,
45
+ value: {
46
+ type: "category",
47
+ name: cat.name
48
+ }
49
+ };
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();
87
72
  resolve(taskToRun);
88
- });
89
- }
90
- });
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
+
97
+ // Start the prompt
98
+ promptUser();
91
99
  });
92
100
  };
93
101
  export default taskList;
@@ -0,0 +1,13 @@
1
+ import chalk from "chalk";
2
+ import yargs from "yargs";
3
+ const argv = yargs(process.argv.slice(2)).argv;
4
+ (async function () {
5
+ console.log(`${chalk.green("PRE --- TEST 52")} ${process.argv.slice(2)} ${JSON.stringify(argv)}`);
6
+ await new Promise(resolve => {
7
+ setTimeout(() => {
8
+ console.log(`${chalk.green("ATTT --- TEST 52")}`);
9
+ resolve();
10
+ }, 3500);
11
+ });
12
+ console.log(`${chalk.green("POST --- TEST 52")}`);
13
+ })();
@@ -0,0 +1,17 @@
1
+ import chalk from "chalk";
2
+ import inquirer from "inquirer";
3
+ (async function () {
4
+ console.log(`${chalk.green("PRE INPUT")}\n`);
5
+ inquirer.prompt([{
6
+ type: "list",
7
+ name: "category",
8
+ message: "What category do you want to run?",
9
+ choices: [1, 2, 3, 4, 5]
10
+ }]).then(({
11
+ category
12
+ }) => {
13
+ console.log(`${chalk.green("CHOSEN ", category)}`);
14
+ });
15
+ console.log(`${chalk.green("POST INPUT")}`);
16
+ console.log("NODEENV", process.env.INPUT);
17
+ })();
@@ -0,0 +1 @@
1
+ console.log("TEST CONSOLE OUTPUT");
@@ -0,0 +1,2 @@
1
+ const input = process.env.INPUT || 'default';
2
+ console.log(`INPUT: ${input}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fscr",
3
- "version": "6.2.2",
3
+ "version": "6.2.6",
4
4
  "description": "Runs the fscripts.md file",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -10,7 +10,8 @@
10
10
  "build:index": "babel index.js --ignore 'node_modules' --out-file dist/index.js",
11
11
  "build:lib": "babel lib --ignore 'node_modules' --out-dir dist/lib --copy-files",
12
12
  "fsr": "node dist/index.js",
13
- "release": "run-s release:bump release:clean release:build",
13
+ "release": "run-s release:test release:bump release:clean release:build",
14
+ "release:test": "vitest run",
14
15
  "release:build": "run-p build:index build:lib",
15
16
  "release:bump": "yarn fsr bump",
16
17
  "release:clean": "rimraf dist",
@@ -21,6 +22,9 @@
21
22
  "start:build": "babel-node index.js --ignore 'node_modules'",
22
23
  "start:run": "node dist/index.js",
23
24
  "start:watch": "nodemon --watch lib --watch index.js --ext js --exec babel-node index.js --ignore 'node_modules' -I",
25
+ "test": "vitest run",
26
+ "test:watch": "vitest",
27
+ "test:ui": "vitest --ui",
24
28
  "docs": "npx cli-docs-generator --cli=./bin",
25
29
  "test1": "echo 'yolo' && sleep 2 && echo 1",
26
30
  "test2": "echo '2yolo' && sleep 2 && echo 22"
@@ -64,9 +68,8 @@
64
68
  "git-release-notes": "^5.0.0",
65
69
  "git-state": "^4.1.0",
66
70
  "github-basic": "^6.0.0",
67
- "ink": "^6.3.1",
68
- "ink-box": "^2.0.0",
69
- "ink-select-input": "^6.2.0",
71
+ "ink": "^5.2.1",
72
+ "ink-select-input": "^4.2.2",
70
73
  "inquirer": "^12.9.6",
71
74
  "is-builtin-module": "^5.0.0",
72
75
  "json-colorz": "^0.2.7",
@@ -77,7 +80,7 @@
77
80
  "moment-mini": "^2.24.0",
78
81
  "open": "^10.2.0",
79
82
  "pretty-ms": "^9.3.0",
80
- "react": "^19.2.0",
83
+ "react": "^18.3.1",
81
84
  "require-from-string": "^2.0.2",
82
85
  "server-destroy": "^1.0.1",
83
86
  "set-value": "^4.1.0",
@@ -98,6 +101,7 @@
98
101
  "@babel/preset-env": "^7.9.0",
99
102
  "@babel/preset-react": "^7.9.1",
100
103
  "babel-plugin-module-resolver": "^5.0.2",
104
+ "execa": "8.0.1",
101
105
  "fancy-log": "^2.0.0",
102
106
  "fkill-cli": "^8.0.0",
103
107
  "ink-tab": "^5.2.0",
@@ -114,8 +118,10 @@
114
118
  "remarkable": "^2.0.0",
115
119
  "rexrex": "^1.3.0",
116
120
  "rimraf": "^6.0.1",
121
+ "strip-ansi": "^7.1.2",
117
122
  "terminal-tree": "^0.0.3",
118
123
  "underscore.string": "^3.3.5",
124
+ "vitest": "^3.2.4",
119
125
  "yargs": "^18.0.0"
120
126
  },
121
127
  "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
- };
@@ -1,12 +0,0 @@
1
- export default (fileInfo, api) => {
2
- const j = api.jscodeshift;
3
- return j(fileInfo.source).find(j.CallExpression, {
4
- callee: {
5
- type: "MemberExpression",
6
- object: {
7
- type: "Identifier",
8
- name: "console"
9
- }
10
- }
11
- }).remove().toSource();
12
- };