Skip to content

Commit

Permalink
Merge pull request #235 from ghiscoding/chore/eslint-prettier-write-fix
Browse files Browse the repository at this point in the history
chore: execute prettier format on the entire project
  • Loading branch information
ghiscoding committed Jun 30, 2022
2 parents 1d82559 + b35dbf5 commit 9f1ad41
Show file tree
Hide file tree
Showing 209 changed files with 3,401 additions and 3,484 deletions.
5 changes: 1 addition & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint"
]
"recommendations": ["editorconfig.editorconfig", "dbaeumer.vscode-eslint"]
}
83 changes: 14 additions & 69 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
"request": "launch",
"name": "Jest Current Spec File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--runInBand",
"${fileBasename}",
"--config",
"${workspaceFolder}/jest/jest.config.js"
],
"args": ["--runInBand", "${fileBasename}", "--config", "${workspaceFolder}/jest/jest.config.js"],
"console": "internalConsole",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
Expand All @@ -27,98 +22,48 @@
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": [
"--nolazy",
"-r",
"tsm"
],
"args": [
"packages/cli/src/cli.ts",
"version",
"--git-dry-run"
],
"runtimeArgs": ["--nolazy", "-r", "tsm"],
"args": ["packages/cli/src/cli.ts", "version", "--git-dry-run"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**",
"node_modules/**"
]
"skipFiles": ["<node_internals>/**", "node_modules/**"]
},
{
"name": "Publish command debugger",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": [
"--nolazy",
"-r",
"tsm"
],
"args": [
"packages/cli/src/cli.ts",
"publish",
"from-package",
"--git-dry-run"
],
"runtimeArgs": ["--nolazy", "-r", "tsm"],
"args": ["packages/cli/src/cli.ts", "publish", "from-package", "--git-dry-run"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**",
"node_modules/**"
]
"skipFiles": ["<node_internals>/**", "node_modules/**"]
},
{
"name": "Exec command debugger",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": [
"--nolazy",
"-r",
"tsm"
],
"args": [
"packages/cli/src/cli.ts",
"exec",
"--scope",
" @lerna-lite/core",
"echo",
"hello"
],
"runtimeArgs": ["--nolazy", "-r", "tsm"],
"args": ["packages/cli/src/cli.ts", "exec", "--scope", " @lerna-lite/core", "echo", "hello"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**",
"node_modules/**"
]
"skipFiles": ["<node_internals>/**", "node_modules/**"]
},
{
"name": "Run command debugger",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": [
"--nolazy",
"-r",
"tsm"
],
"args": [
"packages/cli/src/cli.ts",
"run",
"pack-tarball",
"--stream",
"--no-bail"
],
"runtimeArgs": ["--nolazy", "-r", "tsm"],
"args": ["packages/cli/src/cli.ts", "run", "pack-tarball", "--stream", "--no-bail"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**",
"node_modules/**"
]
"skipFiles": ["<node_internals>/**", "node_modules/**"]
}
]
}
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
"problemMatcher": []
}
]
}
}
10 changes: 5 additions & 5 deletions __fixtures__/pack-directory/packages/a/prepare.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";
'use strict';

const fs = require("fs");
const path = require("path");
const fs = require('fs');
const path = require('path');

const sourceIndex = path.resolve("./src/index.js");
const targetIndex = path.resolve("./dist/index.js");
const sourceIndex = path.resolve('./src/index.js');
const targetIndex = path.resolve('./dist/index.js');

fs.mkdirSync(path.dirname(targetIndex));

Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/pack-directory/packages/a/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use strict";
'use strict';

module.exports = "A";
module.exports = 'A';
18 changes: 9 additions & 9 deletions __fixtures__/pack-directory/packages/b/prepack.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"use strict";
'use strict';

const fs = require("fs");
const path = require("path");
const fs = require('fs');
const path = require('path');

const distDir = path.resolve("dist");
const pkg = JSON.parse(fs.readFileSync(path.resolve("package.json"), "utf8"));
const distDir = path.resolve('dist');
const pkg = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8'));

delete pkg.private;
delete pkg.scripts;
delete pkg.publishConfig;

pkg.description = "big important things to do";
pkg.main = "prepacked.js";
pkg.description = 'big important things to do';
pkg.main = 'prepacked.js';

fs.mkdirSync(distDir);
fs.writeFileSync(path.join(distDir, "package.json"), JSON.stringify(pkg, null, 2));
fs.writeFileSync(path.join(distDir, "prepacked.js"), "module.exports = 'B';");
fs.writeFileSync(path.join(distDir, 'package.json'), JSON.stringify(pkg, null, 2));
fs.writeFileSync(path.join(distDir, 'prepacked.js'), "module.exports = 'B';");
8 changes: 4 additions & 4 deletions __fixtures__/pack-directory/packages/c/prepublishOnly.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
'use strict';

const fs = require("fs");
const path = require("path");
const fs = require('fs');
const path = require('path');

fs.writeFileSync(path.resolve("index.js"), "module.exports = 'C';");
fs.writeFileSync(path.resolve('index.js'), "module.exports = 'C';");
4 changes: 2 additions & 2 deletions __fixtures__/pack-directory/packages/d/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use strict";
'use strict';

module.exports = "D";
module.exports = 'D';
4 changes: 2 additions & 2 deletions __fixtures__/pack-directory/packages/d/postpack.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use strict";
'use strict';

console.log("postpack");
console.log('postpack');
2 changes: 1 addition & 1 deletion global.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module '*';
declare module '*';
18 changes: 9 additions & 9 deletions helpers/clone-fixture/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";
'use strict';

const execa = require("execa");
const fileUrl = require("file-url");
const tempy = require("tempy");
const initFactory = require("../init-fixture");
const execa = require('execa');
const fileUrl = require('file-url');
const tempy = require('tempy');
const initFactory = require('../init-fixture');

module.exports = cloneFixture;

Expand All @@ -15,10 +15,10 @@ function cloneFixture(startDir) {
const repoDir = tempy.directory();
const repoUrl = fileUrl(repoDir, { resolve: false });

return execa("git", ["init", "--bare"], { cwd: repoDir })
.then(() => execa("git", ["checkout", "-B", "main"], { cwd }))
.then(() => execa("git", ["remote", "add", "origin", repoUrl], { cwd }))
.then(() => execa("git", ["push", "-u", "origin", "main"], { cwd }))
return execa('git', ['init', '--bare'], { cwd: repoDir })
.then(() => execa('git', ['checkout', '-B', 'main'], { cwd }))
.then(() => execa('git', ['remote', 'add', 'origin', repoUrl], { cwd }))
.then(() => execa('git', ['push', '-u', 'origin', 'main'], { cwd }))
.then(() => ({
cwd,
repository: repoUrl,
Expand Down
16 changes: 8 additions & 8 deletions helpers/command-runner/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
'use strict';

const path = require("path");
const lernaCLI = require("../../packages/cli/src/lerna-cli");
const path = require('path');
const lernaCLI = require('../../packages/cli/src/lerna-cli');

module.exports = commandRunner;

Expand All @@ -14,10 +14,10 @@ module.exports = commandRunner;
*/
function commandRunner(commandModule) {
/* eslint-disable import/no-dynamic-require, global-require */
const cmd = commandModule.command.split(" ")[0];
const cmd = commandModule.command.split(' ')[0];

// prime the pump so slow-as-molasses CI doesn't fail with delayed require()
require(path.resolve(require.main.filename, "../.."));
require(path.resolve(require.main.filename, '../..'));

return (cwd) => {
// create a _new_ yargs instance every time cwd changes to avoid singleton pollution
Expand All @@ -34,8 +34,8 @@ function commandRunner(commandModule) {

const context = {
cwd,
lernaVersion: "__TEST_VERSION__",
loglevel: "silent",
lernaVersion: '__TEST_VERSION__',
loglevel: 'silent',
progress: false,
onResolved: (result) => {
// success resolves the result, if any, returned from execute()
Expand All @@ -60,7 +60,7 @@ function commandRunner(commandModule) {
// _and_ yargs validation exceptions when using async command handlers
const actual = err || new Error(msg);
// backfill exitCode for test convenience
yargsMeta.exitCode = "exitCode" in actual ? actual.exitCode : 1;
yargsMeta.exitCode = 'exitCode' in actual ? actual.exitCode : 1;
context.onRejected(actual);
})
.parse([cmd, ...args], context, parseFn);
Expand Down
14 changes: 7 additions & 7 deletions helpers/commit-change-to-package/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use strict";
'use strict';

const path = require("path");
const loadJsonFile = require("load-json-file");
const writeJsonFile = require("write-json-file");
const { gitAdd } = require("../git-add");
const { gitCommit } = require("../git-commit");
const path = require('path');
const loadJsonFile = require('load-json-file');
const writeJsonFile = require('write-json-file');
const { gitAdd } = require('../git-add');
const { gitCommit } = require('../git-commit');

module.exports.commitChangeToPackage = commitChangeToPackage;

function commitChangeToPackage(cwd, packageName, commitMsg, data) {
const packageJSONPath = path.join(cwd, "packages", packageName, "package.json");
const packageJSONPath = path.join(cwd, 'packages', packageName, 'package.json');

// QQ no async/await yet...
let chain = Promise.resolve();
Expand Down
8 changes: 4 additions & 4 deletions helpers/get-commit-message/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";
'use strict';

const execa = require("execa");
const execa = require('execa');

module.exports.getCommitMessage = getCommitMessage;

function getCommitMessage(cwd, format = "%B") {
return execa("git", ["log", "-1", `--pretty=format:${format}`], { cwd }).then((result) => result.stdout);
function getCommitMessage(cwd, format = '%B') {
return execa('git', ['log', '-1', `--pretty=format:${format}`], { cwd }).then((result) => result.stdout);
}
6 changes: 3 additions & 3 deletions helpers/git-checkout/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";
'use strict';

const execa = require("execa");
const execa = require('execa');

module.exports.gitCheckout = gitCheckout;

function gitCheckout(cwd, args) {
return execa("git", ["checkout", ...args], { cwd });
return execa('git', ['checkout', ...args], { cwd });
}
6 changes: 3 additions & 3 deletions helpers/git-merge/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";
'use strict';

const execa = require("execa");
const execa = require('execa');

module.exports.gitMerge = gitMerge;

function gitMerge(cwd, args) {
return execa("git", ["merge", ...args], { cwd });
return execa('git', ['merge', ...args], { cwd });
}
6 changes: 3 additions & 3 deletions helpers/git-status/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";
'use strict';

const cp = require("child_process");
const cp = require('child_process');

module.exports.gitStatus = gitStatus;

function gitStatus(cwd) {
return cp.spawnSync("git", ["status", "--porcelain"], { cwd, encoding: "utf8" });
return cp.spawnSync('git', ['status', '--porcelain'], { cwd, encoding: 'utf8' });
}
6 changes: 3 additions & 3 deletions helpers/git-tag/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";
'use strict';

const execa = require("execa");
const execa = require('execa');

module.exports.gitTag = gitTag;

function gitTag(cwd, tagName) {
return execa("git", ["tag", tagName, "-m", tagName], { cwd });
return execa('git', ['tag', tagName, '-m', tagName], { cwd });
}

0 comments on commit 9f1ad41

Please sign in to comment.