Skip to content

Commit

Permalink
chore: use pnpm, update eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
billyjacoby committed Dec 21, 2024
1 parent aa1422e commit 31a625b
Show file tree
Hide file tree
Showing 62 changed files with 8,893 additions and 10,179 deletions.
37 changes: 7 additions & 30 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,21 @@
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended"
"@billyjacoby/eslint-config",
"prettier"
],
"env": {
"browser": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "unused-imports", "react", "react-hooks"],
"rules": {
"no-duplicate-imports": "error",
"no-template-curly-in-string": "error",
"react-hooks/exhaustive-deps": "warn",
"react/no-unescaped-entities": "warn",
"react-hooks/rules-of-hooks": "error",
"eqeqeq": "error",
"no-console": [
"warn",
{
"allow": ["error", "warn"]
}
],
"prefer-const": "warn",
"no-await-in-loop": "warn"
},
"overrides": [
{
"files": "*",
"files": ["*.ts", "*.tsx"],
"rules": {
"@next/next/no-img-element": "off",
"quotes": ["warn", "single", "avoid-escape"],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
]
"no-console": "warn"
}
}
],
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/typescript_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ jobs: # each workflow consists of 1+ jobs; by default, all jobs run in parallel
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'

- name: Enable corepack
run: corepack enable

- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: Run lint
run: yarn lint
run: pnpm lint

typescript-check: # job name
runs-on: ubuntu-latest # host's operating system
Expand All @@ -34,15 +37,18 @@ jobs: # each workflow consists of 1+ jobs; by default, all jobs run in parallel
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'

- name: Enable corepack
run: corepack enable

- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: Run tsc --noEmit
run: yarn type-check
run: pnpm type-check
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.1.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion bin/apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ profile_dev="src-tauri/entitlements/dev/embedded.provisionprofile";
cp_dir="src-tauri/target/release/bundle/macOS/Browsernaut.app/Contents/";
cp_dir_dev="src-tauri/target/release/bundle/macOS/Browsernaut-dev.app/Contents/";

yarn run build:release;
pnpm run build:release;
cp -r "${app_path}" "${app_path_dev}"
cp "${profile}" "${cp_dir}";
cp "${profile_dev}" "${cp_dir_dev}";
Expand Down
2 changes: 1 addition & 1 deletion bin/commit-homebrew-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#? The intention with this file is to eventually automate the update of the Homebrew tap
#? but this can't happen until app builds are able to be completed in a GH action

VERSION=$(yarn app:version)
VERSION=$(pnpm app:version)
echo "$VERSION"

export SHA_SUM=($(shasum -a 256 ./src-tauri/target/universal-apple-darwin/release/bundle/dmg/Browsernaut_${VERSION}_universal.dmg))
Expand Down
2 changes: 1 addition & 1 deletion bin/post-bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
##? updates.json file with the tar.gz.sig provided. Have to figure out how to target the previous version number here though

echo "Building release..."
yarn build:release
pnpm build:release

export UPDATE_SIG_FILE="./src-tauri/target/universal-apple-darwin/release/bundle/macos/Browsernaut.app.tar.gz.sig"
export UPDATE_SIG=$(cat $UPDATE_SIG_FILE)
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"app:version": "echo $npm_package_version",
"dev": "vite",
"build": "tsc && vite build",
"build:debug": "dotenv -- yarn tauri build --debug --target universal-apple-darwin",
"build:release": "dotenv -- yarn tauri build --target universal-apple-darwin",
"build:debug": "dotenv -- pnpm tauri build --debug --target universal-apple-darwin",
"build:release": "dotenv -- pnpm tauri build --target universal-apple-darwin",
"sign": "dotenv ./bin/apple.sh",
"preview": "vite preview",
"tauri": "tauri",
Expand Down Expand Up @@ -40,6 +40,7 @@
"zustand": "^5.0.2"
},
"devDependencies": {
"@billyjacoby/eslint-config": "^8.57.1",
"@tauri-apps/cli": "^1.6.3",
"@types/node": "^22.10.2",
"@types/react": "19.0.2",
Expand All @@ -52,6 +53,7 @@
"dotenv": "^16.4.7",
"dotenv-cli": "^7.4.4",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-unused-imports": "^4.1.4",
Expand All @@ -63,12 +65,12 @@
},
"release-it": {
"hooks": {
"after:bump": "yarn auto-changelog -p && VERSION=${version} LATEST_VERSION=${latestVersion} ./bin/post-bump.sh"
"after:bump": "pnpm auto-changelog -p && VERSION=${version} LATEST_VERSION=${latestVersion} ./bin/post-bump.sh"
},
"git": {
"pushBranch": "release-v${version}",
"commitMessage": "chore: release v${version}",
"changelog": "yarn auto-changelog -p && git add CHANGELOG.md",
"changelog": "pnpm auto-changelog -p && git add CHANGELOG.md",
"tagName": "v${version}"
},
"github": {
Expand All @@ -82,6 +84,5 @@
"./src-tauri/target/universal-apple-darwin/release/bundle/macos/Browsernaut.app.tar.gz"
]
}
},
"packageManager": "[email protected]"
}
}
Loading

0 comments on commit 31a625b

Please sign in to comment.