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

Update Node.js version, editor settings, jest, and linting configurations #567

Merged
merged 4 commits into from
Feb 5, 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
16 changes: 0 additions & 16 deletions .eslintrc.yaml

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ jobs:
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
version: 20.x
node-version: 20.x
cache: yarn
- name: Install Dependencies
run: yarn install
run: yarn install --frozen-lockfile
- if: matrix.os != 'windows-latest'
name: Lint
run: yarn lint
Expand Down
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"editor.formatOnPaste": false,
"editor.formatOnType": false,
"editor.codeActionsOnSave": {
"source.fixAll.tslint": true
"source.fixAll.tslint": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib"
}
29 changes: 29 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"include": ["src/**/*"]
},
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
9 changes: 0 additions & 9 deletions jest.config.ts

This file was deleted.

21 changes: 6 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,19 @@
"setup"
],
"scripts": {
"lint": "eslint src && prettier --check src/**/*.ts",
"format": "prettier --write src/**/*.ts",
"lint": "biome check src",
"format": "biome check --apply src",
"build": "tsc",
"test": "jest"
"test": "vitest"
},
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@types/jest": "^28.1.7",
"@biomejs/biome": "^1.5.3",
"@types/node": "^20.11.13",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.8.3",
"jest": "^28.1.3",
"prettier": "^2.7.1",
"ts-jest": "^28.0.8",
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
"typescript": "^5.3.2",
"vitest": "^1.2.2"
}
}
53 changes: 26 additions & 27 deletions src/GraphvizInstaller.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { getBooleanInput, getInput } from '@actions/core';
import { exec } from '@actions/exec';
import { getBooleanInput, getInput } from "@actions/core";
import { exec } from "@actions/exec";

export class GraphvizInstaller {
public async get() {
await this.install();
}
private async install() {
switch (process.platform) {
case 'darwin':
case "darwin":
await this.brewInstall();
break;
case 'linux':
case "linux":
await this.getAptInstall();
break;
case 'win32':
case "win32":
await this.chocoInstall();
break;
default:
Expand All @@ -22,40 +22,39 @@ export class GraphvizInstaller {
}

private async brewInstall() {
const skipBrewUpdate = getBooleanInput('macos-skip-brew-update');
const skipBrewUpdate = getBooleanInput("macos-skip-brew-update");
if (skipBrewUpdate === false) {
await exec('brew', ['update']);
await exec("brew", ["update"]);
}
await exec('brew', [
'install',
'graphviz',
]);
await exec("brew", ["install", "graphviz"]);
}

private async getAptInstall() {
const skipAptUpdate = getBooleanInput('ubuntu-skip-apt-update');
const graphvizVersion = getInput('ubuntu-graphviz-version');
const libgraphvizdevVersion = getInput('ubuntu-libgraphvizdev-version');
const skipAptUpdate = getBooleanInput("ubuntu-skip-apt-update");
const graphvizVersion = getInput("ubuntu-graphviz-version");
const libgraphvizdevVersion = getInput("ubuntu-libgraphvizdev-version");
if (skipAptUpdate === false) {
await exec('sudo', ['apt-get', 'update']);
await exec("sudo", ["apt-get", "update"]);
}
await exec('sudo', [
'apt-get',
'install',
'-y',
graphvizVersion ? `graphviz=${graphvizVersion}` : 'graphviz',
await exec("sudo", [
"apt-get",
"install",
"-y",
graphvizVersion ? `graphviz=${graphvizVersion}` : "graphviz",
// https://github.com/pygraphviz/pygraphviz/issues/163#issuecomment-570770201
libgraphvizdevVersion ? `libgraphviz-dev=${libgraphvizdevVersion}` : 'libgraphviz-dev',
'pkg-config',
libgraphvizdevVersion
? `libgraphviz-dev=${libgraphvizdevVersion}`
: "libgraphviz-dev",
"pkg-config",
]);
}

private async chocoInstall() {
const graphvizVersion = getInput('windows-graphviz-version');
await exec('choco', [
'install',
'graphviz',
...(graphvizVersion ? [`--version=${graphvizVersion}`]: [])
const graphvizVersion = getInput("windows-graphviz-version");
await exec("choco", [
"install",
"graphviz",
...(graphvizVersion ? [`--version=${graphvizVersion}`] : []),
]);
}
}
Loading