Skip to content

ci: migrate from yarn to pnpm #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/few-poems-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': patch
---

@react-stately/selection added as a direct dependency
50 changes: 19 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,25 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
cache: 'pnpm'

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

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
publish: pnpm release
commit: 'chore: release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -58,15 +54,10 @@ jobs:
with:
fetch-depth: 0

- uses: actions/cache@v2
id: yarn-cache
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
version: 7

- uses: actions/cache@v2
name: Download storybook cache
Expand All @@ -80,9 +71,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

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

- name: Publish to Chromatic
id: publish_chromatic
Expand All @@ -107,15 +99,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
id: yarn-cache
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
version: 7

- uses: actions/cache@v2
name: Download storybook cache
Expand All @@ -129,12 +116,13 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

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

- name: Build Docs
run: yarn build-docs --quiet
run: pnpm build-docs --quiet

- name: Deploy docs to Netlify
uses: South-Paw/action-netlify-deploy@v1.2.1
Expand Down
65 changes: 24 additions & 41 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,18 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/cache@v2
name: Download yarn cache
id: yarn-cache
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
version: 7

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

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

- name: Set env
run: echo "SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
Expand All @@ -44,7 +39,7 @@ jobs:
run: npm version 0.0.0-canary-$SHORT_SHA --no-git-tag-version

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

- name: Publish canary
id: publish
Expand Down Expand Up @@ -78,15 +73,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
id: yarn-cache
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
version: 7

- uses: actions/cache@v2
name: Download eslint cache
Expand All @@ -98,15 +88,16 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

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

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

- name: Run the tests
run: yarn test --no-cache
run: pnpm test -- --no-cache

deploy-chromatic:
name: 'Prepare Storybook for review & tests'
Expand All @@ -122,15 +113,10 @@ jobs:
with:
fetch-depth: 0

- uses: actions/cache@v2
id: yarn-cache
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
version: 7

- uses: actions/cache@v2
name: Download storybook cache
Expand All @@ -144,9 +130,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

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

- name: Publish to Chromatic
id: publish_chromatic
Expand Down Expand Up @@ -187,15 +174,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
id: yarn-cache
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
version: 7

- uses: actions/cache@v2
name: Download storybook cache
Expand All @@ -209,12 +191,13 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

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

- name: Build Docs
run: yarn build-docs --quiet
run: pnpm build-docs --quiet

- name: Deploy docs to Netlify
id: publish_docs
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,21 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/cache@v2
name: Download yarn cache
id: yarn-cache
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
version: 7

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

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

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

- name: Download baseline stats
uses: dawidd6/action-download-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

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

yarn lint-staged
pnpm lint-staged
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"*.(js|ts|tsx|jsx)": ["yarn prettier --write", "yarn eslint --cache --fix", "yarn test --bail --findRelatedTests"],
"*.(js|ts|tsx|jsx)": ["prettier --write", "eslint --cache --fix", "pnpm test -- --bail --findRelatedTests"]
}
2 changes: 0 additions & 2 deletions .yarnclean

This file was deleted.

8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ https://www.conventionalcommits.org/ or check out the
commit type. `scope` is just a short id that describes the scope of work.
2. Make and commit your changes following the
[commit convention](https://github.com/cube-js/cube-ui-kit/blob/main/CONTRIBUTING.md#commit-convention).
As you develop, you can run `yarn build` and
`yarn test` to make sure everything works as expected.
3. Run `yarn changeset` to create a detailed description of your changes. This
As you develop, you can run `pnpm build` and
`pnpm test` to make sure everything works as expected.
3. Run `pnpm changeset` to create a detailed description of your changes. This
will be used to generate a changelog when we publish an update.
[Learn more about Changeset](https://github.com/atlassian/changesets/tree/master/packages/cli).
> You can make it earlier after you have created a PR.
Expand All @@ -58,7 +58,7 @@ https://www.conventionalcommits.org/ or check out the
` ```jsx live=false`

> If you made minor changes like CI config, prettier, etc, you can run
> `yarn changeset add --empty` to generate an empty changeset file to document
> `pnpm changeset add --empty` to generate an empty changeset file to document
> your changes.

### Tests
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

## Available Scripts

### yarn start
### pnpm start

Runs the test page in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### yarn storybook
### pnpm storybook

Run storybook with all the components of UI Kit.

Deployed version of the Storybook from the `main` branch is here: https://cube-uikit-storybook.netlify.app/

### yarn build
### pnpm build

Builds a static copy of UIKit to the `dist/` folder.
Your app is ready to be deployed!

### yarn test
### pnpm test

Not yet implemented
Loading