refactor: migrate yarn -> npm and update ci to node 20 (#141)

* migrate yarn -> npm and update ci to node 20

* add eslint-plugin-flowtype to dev deps

* fix coverage, add jest and ts-jest explicitly to dev deps

still need to fix tests on CI
This commit is contained in:
Nikhil Narayana
2025-05-13 18:48:16 -07:00
committed by GitHub
parent eb82ce6d9a
commit 8c190fd23d
11 changed files with 13418 additions and 6240 deletions

View File

@@ -34,7 +34,6 @@ module.exports = {
"import/no-named-as-default-member": "off",
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
// "strict-booleans/no-nullable-numbers": "error",
"no-undef": "off",
"new-cap": "error",
curly: "error",

View File

@@ -13,20 +13,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x]
node-version: [20.x, 22.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v1
uses: actions/cache@v4
id: cache
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.OS }}-build-${{ hashFiles('**/package.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
@@ -34,11 +34,11 @@ jobs:
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
yarn install
npm install
- name: Build
run: |
yarn run build
npm run build
- name: Lint
if: matrix.os == 'ubuntu-latest'
run: |
yarn run lint
npm run lint

View File

@@ -13,17 +13,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x
registry-url: https://registry.npmjs.org/
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v1
uses: actions/cache@v4
id: cache
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.OS }}-build-${{ hashFiles('**/package.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
@@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
yarn install
npm install
- name: Publish to NPM
run: |
npm publish

View File

@@ -13,20 +13,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x]
node-version: [20.x, 22.x]
os: [ubuntu-latest]
steps:
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v1
uses: actions/cache@v4
id: cache
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.OS }}-build-${{ hashFiles('**/package.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
@@ -34,10 +34,10 @@ jobs:
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
yarn install
npm install
- name: Run tests
run: |
yarn run test:ci
npm run test:ci
- name: Coveralls
uses: coverallsapp/github-action@1.1.3
with:

3
.gitignore vendored
View File

@@ -64,4 +64,5 @@ typings/
dist/
# Mac
.DS_Store
.DS_Store
.tool-versions

View File

@@ -7,7 +7,7 @@
"editor.detectIndentation": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": false,
"[javascript]": {

View File

@@ -70,7 +70,7 @@ To use the example script:
1. Open a terminal prompt in root project folder
2. Run `cd examples`
3. Run `yarn install` to fetch the dependencies
3. Run `npm install` to fetch the dependencies
4. Run `node realtimeFileReads.js "C:\mirror\output\path"` replacing the path argument with where your connected console outputs replay files to
At this point, you should see an output as you play games on the connected console.
@@ -82,19 +82,19 @@ At this point, you should see an output as you play games on the connected conso
```bash
git clone https://github.com/project-slippi/slippi-js
cd slippi-js
yarn install
npm install
```
### Build
```bash
yarn run build
npm run build
```
You can also run `yarn run watch` to continuously build whenever changes are detected.
You can also run `npm run watch` to continuously build whenever changes are detected.
### Test
```bash
yarn run test
npm run test
```

View File

@@ -1,8 +1,12 @@
module.exports = {
testTimeout: 300000, // 5 minutes in milliseconds
globals: {
"ts-jest": {
diagnostics: false,
},
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
//the content originally placed at "global"
diagnostics: false,
},
],
},
};

13370
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -27,21 +27,21 @@
},
"scripts": {
"clean": "rimraf dist",
"prebuild": "yarn run clean",
"prebuild": "npm run clean",
"start": "dts watch --target node",
"build:check": "tsc --noEmit",
"build": "tsc --noEmit && dts build --target node",
"coverage": "yarn run test --coverage",
"coverage": "npm run test -- --coverage",
"postcoverage": "open-cli coverage/lcov-report/index.html",
"test": "dts test --runInBand --verbose",
"test:watch": "yarn run test --watchAll --coverage",
"test:ci": "yarn run test --ci --coverage",
"test:watch": "npm run test -- --watchAll --coverage",
"test:ci": "npm run test -- --ci --coverage",
"lint": "dts lint src",
"lint:fix": "dts lint src --fix",
"patch": "npm version patch && npm publish",
"minor": "npm version minor && npm publish",
"major": "npm version major && npm publish",
"prepublishOnly": "yarn run lint && yarn run test && yarn run build"
"prepublishOnly": "npm run lint && npm run test && npm run build"
},
"keywords": [
"slp-parser-js",
@@ -61,29 +61,32 @@
"semver": "^7.3.2"
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/lodash": "^4.14.178",
"@types/node": "^17.0.9",
"@types/reconnect-core": "^1.3.1",
"@types/semver": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
"dts-cli": "^1.1.6",
"dts-cli": "^2.0.5",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.2.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-strict-booleans": "^1.0.0",
"husky": "^4.2.5",
"jest": "^29.7.0",
"open-cli": "^7.0.1",
"prettier": "^2.0.5",
"pretty-quick": "^2.0.1",
"rimraf": "^3.0.0",
"ts-jest": "^29.3.2",
"tslib": "^2.3.1",
"typescript": "^4.4.4"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged",
"pre-push": "yarn lint --quiet"
"pre-push": "npm run lint --quiet"
}
}
}

6199
yarn.lock

File diff suppressed because it is too large Load Diff