Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors #6

Merged
merged 4 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
'newline-before-expect-assertion': 'error',
'test-names-avoid-should': 'error',
'jest/no-deprecated-functions': 'off',
'no-async-promise-executor': 'off',
'no-restricted-syntax': [
'error',
...baseRestrictedSyntax,
Expand Down
5 changes: 5 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

import { run } from './library.js';

run();
8 changes: 2 additions & 6 deletions index.js → library.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env node

import fs from 'node:fs';
import https from 'node:https';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

let originalManifestIndentation = 2;
Expand Down Expand Up @@ -185,7 +183,7 @@ function getManifestWithUpdatedVoltaObject () {
});
}

async function run () {
export async function run () {
try {
const manifestPath = await getManifestPath();

Expand All @@ -199,5 +197,3 @@ async function run () {
console.error(error);
}
}

run();
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"license": "MIT",
"description": "Updates Volta config in package.json so Node match's what your NW.js version uses",
"scripts": {
"lint": "eslint --rulesdir=./node_modules/eslint-config-tjw-jest/custom-eslint-rules --ext .js --config=.eslintrc.cjs .eslintrc.cjs",
"fix": "eslint --fix --rulesdir=./node_modules/eslint-config-tjw-jest/custom-eslint-rules --ext .js --config=.eslintrc.cjs .eslintrc.cjs"
"lint": "eslint --rulesdir=./node_modules/eslint-config-tjw-jest/custom-eslint-rules --ext .js --config=.eslintrc.cjs .eslintrc.cjs index.mjs library.js",
"fix": "eslint --fix --rulesdir=./node_modules/eslint-config-tjw-jest/custom-eslint-rules --ext .js --config=.eslintrc.cjs .eslintrc.cjs index.mjs library.js"
},
"devDependencies": {
"@babel/eslint-parser": "^7.23.3",
Expand Down
Loading