Skip to content

Commit

Permalink
chore(pnpm): initial
Browse files Browse the repository at this point in the history
  • Loading branch information
kark committed Jul 12, 2023
1 parent e5744bb commit 211819e
Show file tree
Hide file tree
Showing 336 changed files with 30,745 additions and 15,988 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.yarn/** linguist-vendored
.yarn/** linguist-generated=true
.linkcheck/releases/** linguist-vendored
.linkcheck/releases/** linguist-generated=true
30 changes: 30 additions & 0 deletions .github/actions/ci/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

description: Shared action with basic setup for each job

runs:
using: composite

steps:
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
with:
run_install: false

- name: Setup Node (uses version in .nvmrc)
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: pnpm

- name: Install dependencies
run: pnpm install
env:
# https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L14-L18
# https://github.com/marketplace/actions/cypress-io#custom-install
CYPRESS_INSTALL_BINARY: '0'
shell: bash

- name: Building packages
run: pnpm build
shell: bash
37 changes: 7 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,51 +18,28 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

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

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', 'patches/*.patch') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable

- name: Check for unmet constraints (fix w/ "yarn constraints --fix")
run: yarn constraints

- name: Building packages
run: yarn build
- name: Installing dependencies and building packages
uses: ./.github/actions/ci

- name: Running static type checking
run: yarn typecheck
run: pnpm typecheck

- name: Running linters and tests
run: yarn run jest --projects jest.{eslint,test,ts-test,bundle}.config.js --reporters github-actions
run: pnpm jest --projects jest.{eslint,test,ts-test,bundle}.config.js --reporters github-actions
env:
CI: true

- name: Building Visual Regression Tests application for UI components
run: yarn visual-testing-app:build
run: pnpm visual-testing-app:build

- name: Running Visual Regression Tests for UI components
run: yarn vrt:components
run: pnpm vrt:components
timeout-minutes: 20
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}


- name: Checking bundle size of visual testing app
run: yarn bundlesize
run: pnpm bundlesize
# env:
# NOTE: it seems that currently bundlesize server is having problems
# resulting in status code 500. Because of that, the bundlesize script
Expand Down
35 changes: 7 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,8 @@ jobs:
# https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/8
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}

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

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', 'patches/*.patch') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
env:
SKIP_INSTALL_STORYBOOK: true
- name: Installing dependencies and building packages
uses: ./.github/actions/ci

- name: Creating .npmrc
run: |
Expand All @@ -49,11 +31,8 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Building packages
run: yarn build

- name: Building package READMEs
run: yarn generate-readmes
run: pnpm generate-readmes
env:
CI: true

Expand All @@ -62,8 +41,8 @@ jobs:
uses: changesets/action@v1.4.4
with:
commit: 'ci(changesets): version packages'
publish: yarn changeset publish
version: yarn changeset:version-and-format
publish: pnpm changeset publish
version: pnpm changeset:version-and-format
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
SKIP_POSTINSTALL_DEV_SETUP: true
Expand All @@ -73,7 +52,7 @@ jobs:
if: steps.changesets.outputs.published != 'true'
run: |
git checkout main
yarn changeset version --snapshot canary
yarn changeset publish --tag canary
pnpm changeset version --snapshot canary
pnpm changeset publish --tag canary
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ typings/
.yarn-integrity

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
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 generate-package-json --all-workspace-packages && yarn lint-staged
pnpm generate-package-json --all-workspace-packages && pnpm lint-staged
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ dist
vendors
.yarn
.changeset
pnpm-lock.yaml
pnpm-workspace.yaml
52 changes: 0 additions & 52 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

This file was deleted.

541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-postinstall.cjs

This file was deleted.

873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.5.1.cjs

This file was deleted.

13 changes: 0 additions & 13 deletions .yarnrc.yml

This file was deleted.

29 changes: 0 additions & 29 deletions constraints.pro

This file was deleted.

7 changes: 5 additions & 2 deletions design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"files": ["dist", "materials"],
"scripts": {
"build:tokens": "node ./scripts/generate-design-tokens.js",
"build:tokens:watch": "nodemon -e yaml --quiet --watch materials/internals --exec 'yarn build:tokens'"
"build:tokens:watch": "nodemon -e yaml --quiet --watch materials/internals --exec 'pnpm build:tokens'"
},
"dependencies": {
"@babel/runtime": "^7.20.13",
Expand All @@ -29,9 +29,12 @@
"@emotion/react": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react": "17.0.2"
"react": "17.0.2",
"yaml": "2.2.2"
},
"devDependencies": {
"@types/lodash": "4.14.194",
"@types/react": "17.0.59",
"nodemon": "^2.0.20"
}
}
6 changes: 2 additions & 4 deletions design-system/src/theme-provider.visualroute.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTheme, designTokens } from '@commercetools-uikit/design-system';
import { Switch, Route } from 'react-router';
import { Switch, Route } from 'react-router-dom';
import kebabCase from 'lodash/kebabCase';
import PropTypes from 'prop-types';
import {
Expand All @@ -15,9 +15,7 @@ const parentSelector = (id) => () => document.getElementById(id);

const DummyComponent = (props) => {
const { theme } = useTheme(
props.parentId
? parentSelector(props.parentId)
: undefined
props.parentId ? parentSelector(props.parentId) : undefined
);

return (
Expand Down
4 changes: 2 additions & 2 deletions docs/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.yarn/** linguist-vendored
.yarn/** linguist-generated=true
.linkcheck/releases/** linguist-vendored
.linkcheck/releases/** linguist-generated=true
5 changes: 0 additions & 5 deletions docs/.yarnrc.yml

This file was deleted.

11 changes: 7 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@storybook/addon-options": "5.3.21",
"@storybook/addon-storysource": "5.3.21",
"@storybook/react": "5.3.21",
"@storybook/source-loader": "7.0.26",
"@storybook/theming": "5.3.21",
"babel-loader": "8.3.0",
"css-loader": "5.2.7",
Expand All @@ -44,11 +45,13 @@
"peerDependencies": {
"prismjs": "1.29.0"
},
"resolutions": {
"@types/react": "17.0.59",
"@types/react-dom": "17.0.20"
},
"engines": {
"node": ">=16 <17"
},
"pnpm": {
"overrides": {
"@types/react": "17.0.59",
"@types/react-dom": "17.0.20"
}
}
}
Loading

0 comments on commit 211819e

Please sign in to comment.