Skip to content

Commit

Permalink
Migrate into PNPM (#240)
Browse files Browse the repository at this point in the history
* feat: migrate into pnpm, temp remove eslint

Eslint should be upgraded (eslint-kit?)

* chore: add pnpm lock files for website

* test: add lock files for integration tests

* chore: update jest. Updated snapshot format

@sergeysova manually checked each snapshot change

* docs: first of all setup pnpm

* test: before use node install pnpm

* docs: forgot to install deps inside correct directory

* docs: speedup by set correct caching

* test: use exact ubuntu version for integration

* test: use ubuntu 22.04 for integration

* test: fix ubuntu version used

* test: use correct version of ubuntu for another steps of integration
  • Loading branch information
sergeysova authored Sep 2, 2022
1 parent 31f1f25 commit eb7198f
Show file tree
Hide file tree
Showing 74 changed files with 28,741 additions and 41,664 deletions.
10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,33 @@ on:
push:
branches:
- main
- migration
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3

- name: 🐧 Use Node.js v16.x
- name: 📦 Setup pnpm
uses: pnpm/action-setup@v2

- name: 🐧 Use Node.js v18.x
uses: actions/setup-node@v3
with:
node-version: v16.x
cache: 'yarn'
node-version: v18.x
cache: 'pnpm'
cache-dependency-path: website/pnpm-lock.yaml

- name: 🔍 Installation
run: yarn install
run: pnpm install
working-directory: ./website

- name: 🔧 Build
run: yarn build
run: pnpm build
working-directory: ./website

- name: 🚀 Deploy
Expand Down
51 changes: 30 additions & 21 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@ on: [push]

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js v16.x
- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js v18.x
uses: actions/setup-node@v3
with:
node-version: v16.x
node-version: v18.x
registry-url: 'https://npm.pkg.github.com'
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build package
run: yarn build
run: pnpm build
env:
LIBRARY_NAME: '@effector/patronum'

Expand Down Expand Up @@ -79,60 +82,66 @@ jobs:

custom:
needs: build
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'

- name: Install integration dependencies
run: yarn
run: pnpm install
working-directory: ./integration/custom
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install patronum@${{ needs.build.outputs.version }} to integration package
run: yarn add @effector/patronum@${{ needs.build.outputs.version }}
run: pnpm add @effector/patronum@${{ needs.build.outputs.version }}
working-directory: ./integration/custom
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run integration tests
run: yarn test
run: pnpm test
working-directory: ./integration/custom

cra:
needs: build
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'

- name: Install integration dependencies
run: yarn
run: pnpm install
working-directory: ./integration/cra
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install patronum@${{ needs.build.outputs.version }} to integration package
run: yarn add @effector/patronum@${{ needs.build.outputs.version }}
run: pnpm add @effector/patronum@${{ needs.build.outputs.version }}
working-directory: ./integration/cra
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run integration tests
run: yarn test
run: pnpm test
working-directory: ./integration/cra
17 changes: 10 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,34 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [16.x, 18.x]

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Build
run: yarn build
run: pnpm build

- name: Test code
run: yarn test:code --detectOpenHandles
run: pnpm test:code --detectOpenHandles
env:
CI: true

- name: Test types
run: yarn test:types
run: pnpm test:types
17 changes: 10 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,25 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js 16.x
- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
node-version: 18.x
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Build package
run: yarn build
run: pnpm build

- name: Run tests
run: yarn test
run: pnpm test
env:
CI: true

Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

lint-staged
6 changes: 0 additions & 6 deletions .huskyrc

This file was deleted.

5 changes: 2 additions & 3 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"*.{ts,tsx,js,jsx,mjs}": ["eslint --fix", "prettier --write", "git add"],
"*.{ts,tsx,js,jsx,mjs}": ["prettier --write"],
"{*.json,.huskyrc,.prettierrc,.lintstagedrc,.eslintrc}": [
"prettier --write --parser json",
"git add"
"prettier --write --parser json"
]
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependencies=false
9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-engines.cjs

This file was deleted.

Loading

0 comments on commit eb7198f

Please sign in to comment.