Skip to content

Commit

Permalink
Migrate to pnpm (#6356)
Browse files Browse the repository at this point in the history
* chore: initial spike

* fix: deps cycle

* fix: stories

* fix: types

* refactor: anatomy

* chore: update tooling

* chore: update package scripts

* chore: setup entrypoints

* chore: get tooling build working

* chore: cleanup repo and deps

* chore: get storybook working

* ci: update github actions and scripts

* fix: babel plugin dep

* ci: run props docs in parallel

* refactor: build script

* chore: update csb config

* chore: add missing deps

* chore: update

* chore: update tests

* chore: update

* chore: update deps

* fix: dependency issues

* fix: ts issues

* fix: circular import

* fix: circular dependencies

* chore: remove unused

* fix: tests

* fix: dependencies

* fix: storybook

* chore: use tsup

* refactor: style context usage

* fix: build

* chore: update

* chore: cmon

* chore: cmon

* fix: theme scripts

* chore: update
  • Loading branch information
segunadebayo committed Jul 24, 2022
1 parent 88e812c commit 1839e22
Show file tree
Hide file tree
Showing 348 changed files with 31,996 additions and 28,520 deletions.
67 changes: 67 additions & 0 deletions .changeset/stale-baboons-trade.md
@@ -0,0 +1,67 @@
---
"@chakra-ui/accordion": patch
"@chakra-ui/alert": patch
"@chakra-ui/anatomy": patch
"@chakra-ui/avatar": patch
"@chakra-ui/breadcrumb": patch
"@chakra-ui/button": patch
"@chakra-ui/checkbox": patch
"@chakra-ui/clickable": patch
"@chakra-ui/close-button": patch
"@chakra-ui/color-mode": patch
"@chakra-ui/control-box": patch
"@chakra-ui/counter": patch
"@chakra-ui/css-reset": patch
"@chakra-ui/descendant": patch
"@chakra-ui/editable": patch
"@chakra-ui/react-env": patch
"@chakra-ui/focus-lock": patch
"@chakra-ui/form-control": patch
"@chakra-ui/hooks": patch
"@chakra-ui/icon": patch
"@chakra-ui/icons": patch
"@chakra-ui/image": patch
"@chakra-ui/input": patch
"@chakra-ui/layout": patch
"@chakra-ui/live-region": patch
"@chakra-ui/media-query": patch
"@chakra-ui/menu": patch
"@chakra-ui/modal": patch
"@chakra-ui/number-input": patch
"@chakra-ui/pin-input": patch
"@chakra-ui/popover": patch
"@chakra-ui/popper": patch
"@chakra-ui/portal": patch
"@chakra-ui/progress": patch
"@chakra-ui/provider": patch
"@chakra-ui/radio": patch
"@chakra-ui/react": patch
"@chakra-ui/react-utils": patch
"@chakra-ui/select": patch
"@chakra-ui/skeleton": patch
"@chakra-ui/skip-nav": patch
"@chakra-ui/slider": patch
"@chakra-ui/spinner": patch
"@chakra-ui/stat": patch
"@chakra-ui/styled-system": patch
"@chakra-ui/switch": patch
"@chakra-ui/system": patch
"@chakra-ui/table": patch
"@chakra-ui/tabs": patch
"@chakra-ui/tag": patch
"@chakra-ui/textarea": patch
"@chakra-ui/theme": patch
"@chakra-ui/theme-tools": patch
"@chakra-ui/toast": patch
"@chakra-ui/tooltip": patch
"@chakra-ui/transition": patch
"@chakra-ui/utils": patch
"@chakra-ui/visually-hidden": patch
"@chakra-ui/babel-plugin": patch
"@chakra-ui/cli": patch
"@chakra-ui/gatsby-plugin": patch
"@chakra-ui/props-docs": patch
"@chakra-ui/storybook-addon": patch
---

Force release due to change in build configuration
8 changes: 2 additions & 6 deletions .codesandbox/ci.json
@@ -1,10 +1,6 @@
{
"node": "14",
"installCommand": "csb:install",
"buildCommand": "build",
"sandboxes": [
"/examples/create-react-app"
],
"sandboxes": ["/examples/create-react-app"],
"packages": [
"packages/accordion",
"packages/alert",
Expand Down Expand Up @@ -65,4 +61,4 @@
"packages/utils",
"packages/visually-hidden"
]
}
}
28 changes: 28 additions & 0 deletions .github/composite-actions/install/action.yml
@@ -0,0 +1,28 @@
name: "Install"
description: "Sets up Node.js and runs install"

runs:
using: composite
steps:
- uses: pnpm/action-setup@v2.2.2
with:
version: 7

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

- name: Setup Git User
shell: bash
run: |
git config --global user.email "joseshegs@gmail.com"
git config --global user.name "Segun Adebayo"
- name: Install dependencies
shell: bash
run: pnpm install
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
44 changes: 9 additions & 35 deletions .github/workflows/changelog.yml
Expand Up @@ -6,53 +6,27 @@ on:
- ".changeset/**"
branches:
- main
# - next

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
daily:
if: ${{ 'chakra-ui/chakra-ui' == github.repository }}
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.10.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Get Yarn cache path
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Checkout
uses: actions/checkout@master
with:
ref: main
uses: actions/checkout@v3

- name: Enable node
uses: actions/setup-node@master
with:
node-version: 14.x

- name: Load Yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile && yarn bootstrap

- name: Setup Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Install
uses: ./.github/composite-actions/install

- name: Generate the new changelog
run: yarn changelog:gen
run: pnpm changelog:gen

- name: Generate Twitter Post
run: yarn twitter:gen
run: pnpm twitter:gen

- name: Commit changelog
run: |
Expand Down
62 changes: 16 additions & 46 deletions .github/workflows/next.yml
@@ -1,4 +1,4 @@
name: Next Workflow
name: Release (Next)

on:
push:
Expand All @@ -9,81 +9,51 @@ on:
branches:
- next

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Get Yarn cache path
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Checkout branch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.SAGE_PAT }}

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Load Yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines
env:
CI: true

- name: Setup git user (for changelog step)
run: |
git config --global user.email "joseshegs@gmail.com"
git config --global user.name "Segun Adebayo"
- name: Configure npm
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install
uses: ./.github/composite-actions/install

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

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

- name: Create release Pull Request or publish to NPM
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
publish: pnpm release
commit: "ci(changesets): version packages"
title: "ci(changesets): version packages"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release to @next-dev tag
if: steps.changesets.outputs.published != 'true'
run: |
git checkout main
yarn changeset version --snapshot next-dev
yarn changeset publish --tag next-dev
pnpm changeset version --snapshot next-dev
pnpm changeset publish --tag next-dev
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update changelog
if: steps.changesets.outputs.published == 'true'
run: |
yarn changelog:write
yarn changelog:commit
pnpm changelog:write
pnpm changelog:commit

1 comment on commit 1839e22

@vercel
Copy link

@vercel vercel bot commented on 1839e22 Jul 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.