Skip to content

Commit

Permalink
Replace yarn for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanClementsHax committed Aug 3, 2023
1 parent 39079e7 commit d767497
Show file tree
Hide file tree
Showing 12 changed files with 31,945 additions and 15,829 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
node-version: 18
- name: restore dependencies
uses: bahmutov/npm-install@v1
- run: yarn lint:all
- run: npm run lint:all
test:
runs-on: ubuntu-latest
steps:
Expand All @@ -36,7 +36,7 @@ jobs:
node-version: 18
- name: restore dependencies
uses: bahmutov/npm-install@v1
- run: yarn test
- run: npm run test
type_check:
name: type check
runs-on: ubuntu-latest
Expand All @@ -48,7 +48,7 @@ jobs:
node-version: 18
- name: restore dependencies
uses: bahmutov/npm-install@v1
- run: yarn type-check
- run: npm run type-check
lighthouse_desktop:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn scripts:build
yarn lint-staged
npm run scripts:build
npx lint-staged
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn test:all
npm run test:all
15 changes: 6 additions & 9 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
module.exports = {
'*.@(ts|tsx|js|jsx)': [
filenames =>
`yarn lint:js --file ${filenames
.map(file => file.split(process.cwd())[1])
.join(' --file ')}`,
'yarn format'
filenames => `npm run lint:js -- --file ${filenames.join(' --file ')}`,
'npm run format'
],
'posts/**/*.md': ['yarn post:mark-updated', 'yarn format'],
'posts/**/*.md': ['npm run post:mark-updated', 'npm run format'],
'public/posts/**/*.gif': [
filenames => `echo "Do not commit gif files\n\t${filenames.join('\n\t')}"`,
'exit 1'
],
'public/posts/**/banner.@(jpg|png)': ['yarn post:validate-banner'],
'*.json|*.*rc!.browserslistrc': ['yarn format'],
'*.@(css|scss)': ['yarn lint:styles', 'yarn format']
'public/posts/**/banner.@(jpg|png)': ['npm run post:validate-banner'],
'*.json|*.*rc!.browserslistrc': ['npm run format'],
'*.@(css|scss)': ['npm run lint:styles', 'npm run format']
}
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev"
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
Expand All @@ -17,7 +17,7 @@
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
Expand All @@ -31,7 +31,7 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeExecutable": "npm run",
"args": ["test", "--runInBand", "--watchAll=false"]
}
]
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"postcss": "css"
},
"stylelint.validate": ["css", "scss"],
"npm.packageManager": "yarn",
"npm.packageManager": "npm",
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"jest.jestCommandLine": "yarn test",
"jest.jestCommandLine": "npm test",
"jest.autoRun": {
"watch": false,
"onSave": "test-src-file"
Expand Down
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"version": "2.0.0",
"tasks": [
{
"label": "yarn dev",
"command": "yarn",
"args": ["dev"],
"label": "npm dev",
"command": "npm",
"args": ["run dev"],
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
## Setup

1. (Recommended) Use VSCode and install the recommended extensions
2. Run `yarn install` to install all of the dependencies
2. Run `npm run install` to install all of the dependencies
3. Create a `.env.production.local` file and put the following contents in it

```.env
Expand All @@ -27,13 +27,13 @@

## Developing

Run `yarn dev` to start a dev server
Run `npm run dev` to start a dev server

Run `yarn format <files>` to format the files given
Run `npm run format <files>` to format the files given

Run `yarn format:all` to format all of the files
Run `npm run format:all` to format all of the files

Run `yarn print-browser-support` to print out all the browsers this project is configured to support as specified in the `.browserslistrc`
Run `npm run print-browser-support` to print out all the browsers this project is configured to support as specified in the `.browserslistrc`

You can use [feeder.co's Chrome extension RSS Feed Reader](https://chrome.google.com/webstore/detail/rss-feed-reader/pnjaodmkngahhkoihejjehlcdlnohgmp/related?hl=en) when testing the rss feed

Expand All @@ -45,23 +45,23 @@ See the [Next.js docs for how to do this](https://nextjs.org/docs/advanced-featu

## Linting

Run `yarn lint:all` to lint all of the files
Run `npm run lint:all` to lint all of the files

Run `yarn lint:js <files>` to lint the specified files via `eslint`
Run `npm run lint:js <files>` to lint the specified files via `eslint`

Run `yarn lint:js` to lint all of the js/jsx/ts/tsx files
Run `npm run lint:js` to lint all of the js/jsx/ts/tsx files

Run `yarn lint:styles <files>` to lint the specified files fia `stylelint`
Run `npm run lint:styles <files>` to lint the specified files fia `stylelint`

Run `yarn lint:styles:all` to lint all of the css/scss files
Run `npm run lint:styles:all` to lint all of the css/scss files

## Testing

Run `yarn test` to run the jest tests
Run `npm run test` to run the jest tests

Run `yarn type-check` to run type checking
Run `npm run type-check` to run type checking

Run `yarn test:all` to lint all files, type check, and run jest tests
Run `npm run test:all` to lint all files, type check, and run jest tests

### Lighthouse

Expand Down Expand Up @@ -90,7 +90,7 @@ sudo apt update &amp;&amp; sudo apt upgrade
sudo apt install ffmpeg
```

Then run `yarn media:optimize-gifs` to transform them in place to `.mp4` and `.webm` files.
Then run `npm run media:optimize-gifs` to transform them in place to `.mp4` and `.webm` files.

Consult [chrome's developer guide for efficient video formats](https://developer.chrome.com/docs/lighthouse/performance/efficient-animated-content/) for further details.

Expand Down
Loading

0 comments on commit d767497

Please sign in to comment.