Skip to content

Commit

Permalink
feat: upgrade all deps (#15)
Browse files Browse the repository at this point in the history
* feat: upgrade all deps

* feat: use pnpm as package manager
  • Loading branch information
tim-richter committed Jul 6, 2022
1 parent fb4d6be commit c230413
Show file tree
Hide file tree
Showing 11 changed files with 17,406 additions and 15,431 deletions.
9 changes: 8 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": ["cypress.config.ts"],
"rules": {
"no-param-reassign": "off"
}
}
],
"rules": {
Expand Down Expand Up @@ -75,7 +81,8 @@
"**/*.stories.{js,jsx,ts,tsx}",
"test/**/*",
"cypress/**/*",
"plopfile.mjs"
"plopfile.mjs",
"cypress.config.ts"
]
}],
"react/function-component-definition": ["error", {
Expand Down
134 changes: 67 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,92 +17,98 @@ jobs:
name: 📄 Cache Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache yarn dependencies and cypress
uses: actions/cache@v2
id: yarn-cache
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
id: pnpm-install
with:
path: |
~/.cache/Cypress
node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-v1
- name: Install dependencies if cache invalid
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

lint:
name: 🔎 Lint
runs-on: ubuntu-latest
needs:
- cache-dependencies
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node env
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v3
with:
node-version: 16
- name: Restore yarn dependencies
uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
~/.cache/Cypress
node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-v1
${{ runner.os }}-pnpm-store-
- name: Run lint
run: yarn lint
run: pnpm lint

test:
name: 🧪 Unit Tests
runs-on: ubuntu-latest
needs:
- lint
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node env
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v3
with:
node-version: 16
- name: Restore yarn dependencies
uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
~/.cache/Cypress
node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-v1
${{ runner.os }}-pnpm-store-
- name: Run tests
run: yarn test
run: pnpm test

build:
name: 📦 Build Next.js
runs-on: ubuntu-latest
needs:
- lint
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node env
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v3
with:
node-version: 16
- name: Restore yarn dependencies
uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
~/.cache/Cypress
node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-v1
${{ runner.os }}-pnpm-store-
- name: Build Next.js
run: yarn build
run: pnpm build
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
Expand All @@ -115,28 +121,25 @@ jobs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node env
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v3
with:
node-version: 16
- name: Restore yarn dependencies
uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
~/.cache/Cypress
node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-v1
${{ runner.os }}-pnpm-store-
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: next-build
path: .next
- name: Run e2e test
run: yarn e2e:test
run: pnpm e2e:test

release:
name: 🚀 Release
Expand All @@ -145,22 +148,19 @@ jobs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node env
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v3
with:
node-version: 16
- name: Restore yarn dependencies
uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
~/.cache/Cypress
node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-v1
${{ runner.os }}-pnpm-store-
- name: Release
run: yarn release
run: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
After cloning the project first time, run following command to install all dependencies:

```sh
yarn
pnpm
```

### Starting Dev Server
Expand All @@ -58,7 +58,7 @@ read more about the dev server in the
[documentation](https://nextjs.org/docs/api-reference/cli#development).

```sh
yarn dev
pnpm dev
```

### Setup Sentry
Expand All @@ -73,7 +73,7 @@ conforms to predefined standards.
To run plop and get prompts for creating a new page run:

```javascript
yarn plop
pnpm plop
```

## Nice to Know
Expand Down Expand Up @@ -113,7 +113,7 @@ the main workflow which runs all the tests of the repository and then creates a
with semantic-release. When it comes to deployment and vercel you might like to
use [vercel-action](https://github.com/marketplace/actions/vercel-action) to run
all these scripts before the deployment to vercel or just run all scripts
in one build command on vercel (ready to use: yarn ci:test-build)
in one build command on vercel (ready to use: pnpm ci:test-build)

#### .storybook

Expand Down
11 changes: 11 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
config.baseUrl = 'http://localhost:3000';

return config;
},
},
});
3 changes: 0 additions & 3 deletions cypress.json

This file was deleted.

File renamed without changes.
21 changes: 21 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';
import 'cypress-axe';

// Alternatively you can use CommonJS syntax:
// require('./commands')
2 changes: 1 addition & 1 deletion cypress/support/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/// <reference types="cypress" />

import './commands';
import 'cypress-axe';

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
getBySel(value: string): Chainable;
getBySelLike(value: string): Chainable;
}
}
}
Loading

0 comments on commit c230413

Please sign in to comment.