Skip to content

Commit

Permalink
chore: update deps + refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamiell committed Dec 16, 2023
1 parent 8969290 commit 08a3762
Show file tree
Hide file tree
Showing 36 changed files with 1,227 additions and 1,310 deletions.
5 changes: 2 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
const config = {
extends: [
// The linter base is the shared IsaacScript config:
// https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-config-isaacscript/configs/base.js
// https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-config-isaacscript/base.js
"eslint-config-isaacscript/base",
],

// Don't bother linting the compiled output.
// @template-ignore-next-line
// Don't bother linting compiled output.
ignorePatterns: ["**/dist/**", "*.min.js"],

parserOptions: {
Expand Down
41 changes: 13 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,28 @@ name: CI
on: [push, pull_request]

jobs:
build_and_lint:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/workflows/setup
- run: npm run build

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: yarn

- name: Retrieve the cached "node_modules" directory (if present)
uses: actions/cache@v3
id: node-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install dependencies (if the cached directory was not found)
if: steps.node-cache.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Test to see if the project compiles
run: bash build.sh

- name: Perform automated checks
run: bash lint.sh
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/setup
- run: npm run lint

# @template-customization-start
discord:
name: Discord Failure Notification
needs: [build_and_lint]
if: always() # This is needed to always run this job, even if the other jobs fail
needs: [build, lint]
if: always() # This is needed to always run this job, even if the other jobs fail.
runs-on: ubuntu-latest
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: technote-space/workflow-conclusion-action@v3
- if: env.WORKFLOW_CONCLUSION != 'success' && env.WORKFLOW_CONCLUSION != 'cancelled'
uses: sarisia/actions-status-discord@v1
with:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
runs:
using: composite

steps:
# https://github.com/actions/setup-node/issues/899
- name: Enable corepack to work around a setup-node bug
run: corepack enable
shell: bash # Composite jobs must specify the shell.

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn

- name: Install dependencies
run: yarn install --immutable
shell: bash # Composite jobs must specify the shell.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# --------------------------
# GitHub .gitignore for Node
# https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore
# cspell:disable
# --------------------------

# Logs
Expand Down
63 changes: 6 additions & 57 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// Extension settings
// ------------------

// Use Prettier to format "cspell.json".
// Use Prettier to format "cspell.jsonc".
"cSpell.autoFormatConfigFile": true,

// -----------------
Expand All @@ -53,74 +53,23 @@
"javascript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.importModuleSpecifier": "relative",

// By default, VSCode will not add `import type` automatically.
"typescript.preferences.preferTypeOnlyAutoImports": true,

// Show TypeScript errors for files that don't happen to be currently open, which makes TypeScript
// work similar to other compiled languages like Golang or Rust.
"typescript.tsserver.experimental.enableProjectDiagnostics": true,

// Automatically run the formatter when certain files are saved.
"[javascript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[typescript]": {
"[javascript][typescript][javascriptreact][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[javascriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
},
"[postcss]": {
"[css][html][json][jsonc][markdown][postcss][yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
Expand Down
13 changes: 0 additions & 13 deletions cloc.sh

This file was deleted.

34 changes: 20 additions & 14 deletions cspell.json → cspell.jsonc
Original file line number Diff line number Diff line change
@@ -1,49 +1,55 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
// @template-ignore-next-line
"import": ["isaacscript-spell/cspell-isaacscript.json"],
"files": ["**"],
"enableFiletypes": ["*"],
"enableGlobDot": true,
"useGitignore": true,
"ignorePaths": [
"*.anm2",
"*.css",
"*.icns",
"*.min.js",
"*.mp3",
"*.node",
"*.otf",
"*.pyc",
"*.svg",
"*.wav",
".git/**",
".yarn/**",
"dist/**",
"LICENSE",
"node_modules/**",
"package-lock.json",
"pnpm-lock.yaml",
"yarn.lock",
// @template-customization-start
"*.anm2",
"*.css",
"*.icns",
"*.node",
"*.otf",
"*.wav",
"alpha.css",
"alpha-old.css",
"dist/**",
"jquery-lang.js",
"node_modules/**",
"main-vanilla.lua",
"main-combined.lua",
"mod/**/*.anm2",
"mod/main.lua",
"mod/resources/rooms/**",
"package-lock.json",
"pnpm-lock.yaml",
"word-list.txt",
"yarn.lock"
// @template-customization-end
],
"words": [
"asar",
"datetime",
"dofiling",
"dotenv",
"greenworks",
"hkcu",
"HOSTNAMES",
"icns",
"jquery",
"kadda",
"klaw",
"knip",
"linkify",
"linkifyjs",
"loadlib",
Expand Down Expand Up @@ -71,6 +77,6 @@
"unmaximize",
"unshutdown",
"Voss",
"WASAPI"
]
"WASAPI",
],
}
5 changes: 5 additions & 0 deletions knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://unpkg.com/knip@3/schema-jsonc.json",
"ignore": [".eslintrc.cjs", "prettier.config.mjs"],
"ignoreDependencies": ["isaacscript-lint"],
}
51 changes: 0 additions & 51 deletions lint.sh

This file was deleted.

53 changes: 0 additions & 53 deletions nuke.sh

This file was deleted.

Loading

0 comments on commit 08a3762

Please sign in to comment.