Skip to content
Closed
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
8 changes: 8 additions & 0 deletions .changeset/large-panthers-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'leva': patch
'@leva-ui/plugin-bezier': patch
'@leva-ui/plugin-spring': patch
'@leva-ui/plugin-plot': patch
---

chore: migrate to pnpm
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
dist/
node_modules/
.yarn/
51 changes: 27 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ name: CI
on:
push:
paths:
- '.github/**'
- '.github/workflows/main.yml'
- 'packages/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '!demo/**'
- '!docs/**'
- '!**.md'
- '!.changeset/**'
env:
CI: true
jobs:
build:
name: Build, lint, and test
Expand All @@ -21,38 +23,39 @@ jobs:
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Install pnpm
run: npm i pnpm@latest -g

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-

- name: Install dependencies
run: yarn --silent
- uses: pnpm/[email protected]
with:
version: 6.9.1
run_install: true

- name: Check types
run: yarn tsc
run: pnpm tsc

- uses: actions/cache@v2
name: Setup Yarn build cache
id: yarn-build-cache
- name: Setup build cache
uses: actions/cache@v2
id: build-cache
with:
path: packages/**/dist
key: ${{ runner.os }}-yarn-build-${{ hashFiles('packages/') }}
key: ${{ runner.os }}-build-${{ hashFiles('packages/') }}
restore-keys: |
${{ runner.os }}-yarn-build-
${{ runner.os }}-build-

- name: Yarn build without cache
if: steps.yarn-build-cache.outputs.cache-hit != 'true'
run: yarn build
- name: Build without cache
if: steps.build-cache.outputs.cache-hit != 'true'
run: pnpm build

- name: Cypress run
run: yarn ci:test
- name: Run tests
run: pnpm test
57 changes: 32 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,59 @@
name: Release

on:
push:
branches:
- master
- main
paths:
- '**/package.json'
- '.changeset/**'

- '.github/workflows/release.yml'
env:
HUSKY: 0 # Bypass husky commit hook for CI
jobs:
release:
name: Release
version:
timeout-minutes: 8
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
- name: checkout code repository
uses: actions/checkout@v2
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Use Node
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
node-version: '16'

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-

- name: Install dependencies
run: yarn install --silent
- uses: pnpm/[email protected]
with:
version: 6.9.1
run_install: true

- name: Create Release Pull Request or Publish to npm
- name: Set up NPM credentials
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create versions PR & prepare publish
id: changesets
uses: changesets/action@master
# if: github.ref == 'refs/heads/master'
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
commit: 'chore(release): update monorepo packages versions'
title: 'Upcoming Release Changes'
version: pnpm ci:version
publish: pnpm ci:publish
# Messages
commit: 'chore(deploy): Release'
title: 'chore(deploy): Release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# npm publish token required for publishing. Set this in secrets
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# automatically available in actions
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 7 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules/
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

# testing
/coverage

# production
build/
dist/
.cache/
.parcel-cache/

# misc
*.log
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
node_modules
.cache
.rts2_cache_cjs
.rts2_cache_esm
.rts2_cache_umd
dist

storybook-static/
.idea
Expand Down
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
pnpm lint
18 changes: 18 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// https://github.com/pnpm/pnpm/issues/827
function readPackage(pkg) {
if (pkg.name.indexOf('@leva-ui') > -1) {
pkg.dependencies = {
...pkg.peerDependencies,
...pkg.dependencies,
}
pkg.peerDependencies = {}
}

return pkg
}

module.exports = {
hooks: {
readPackage,
},
}
77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

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

This file was deleted.

615 changes: 0 additions & 615 deletions .yarn/releases/yarn-sources.cjs

This file was deleted.

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

This file was deleted.

5 changes: 5 additions & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
"serve": "vite preview"
},
"dependencies": {
"@leva-ui/plugin-bezier": "*",
"@leva-ui/plugin-plot": "*",
"@leva-ui/plugin-spring": "*",
"@radix-ui/react-icons": "^1.0.3",
"@react-three/drei": "^7.22.4",
"@react-three/fiber": "^7.0.19",
"@stitches/react": "1.2.5",
"@use-gesture/react": "^10.1.6",
"leva": "*",
"noisejs": "^2.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropzone": "^11.4.2",
"react-use": "^17.3.1",
"three": "^0.134.0",
"wouter": "^2.7.5"
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
"build": "preconstruct build",
"watch": "preconstruct watch",
"dev": "preconstruct dev",
"lint": "pretty-quick --staged",
"lint:full": "eslint packages/*/src",
"release": "yarn build && yarn changeset publish",
"lint": "pretty-quick --staged",
"validate": "preconstruct validate",
"tsc": "tsc --noEmit",
"size": "yarn size-limit",
"size": "pnpm size-limit",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook --quiet",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"demo:dev": "yarn workspace demo dev",
"demo:build": "yarn workspace demo build",
"demo:serve": "yarn workspace demo serve",
"ci:test": "yarn demo:build && start-server-and-test demo:serve http-get://localhost:5000 cypress:run",
"demo:dev": "pnpm run dev --filter demo",
"demo:build": "pnpm run build --filter demo",
"demo:serve": "pnpm run serve --filter demo",
"ci:test": "pnpm demo:build && start-server-and-test demo:serve http-get://localhost:5000 cypress:run",
"prepare": "husky install"
},
"size-limit": [
Expand Down Expand Up @@ -86,6 +85,7 @@
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^7.0.4",
"patch-package": "^6.4.7",
"pnpm": "^6.22.2",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.4.1",
"pretty-quick": "^3.1.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/leva/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"bugs": "https://github.com/pmndrs/leva/issues",
"preconstruct": {
"entrypoints": [
"index.ts",
"plugin/index.ts"
"./index.ts",
"./plugin/index.ts"
]
},
"peerDependencies": {
Expand All @@ -25,7 +25,7 @@
"@radix-ui/react-portal": "^0.1.1",
"@radix-ui/react-tooltip": "0.1.1",
"@stitches/react": "1.2.5",
"@use-gesture/react": "^10.1.5",
"@use-gesture/react": "^10.1.6",
"@welldone-software/why-did-you-render": "^6.2.3",
"colord": "^2.9.1",
"dequal": "^2.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/leva/src/types/internal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StoreApi, UseBoundStore } from 'zustand'
import type { UseBoundStore } from 'zustand'
import { StoreApiWithSubscribeWithSelector } from 'zustand/middleware'
import type { SpecialInput, RenderFn, FolderSettings, Plugin, OnChangeHandler } from './public'

Expand Down
1 change: 1 addition & 0 deletions packages/plugin-bezier/src/BezierSvg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export function BezierSvg({
)

return (
// @ts-ignore
<Svg ref={mergeRefs([svgRef, ref])} {...bind()} withPreview={withPreview}>
<line x1={sx} y1={sy} x2={ex} y2={ey} />
<path fill="none" d={`M${sx},${sy} C${cx1},${cy1} ${cx2},${cy2} ${ex},${ey}`} strokeLinecap="round" />
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-spring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"bugs": "https://github.com/pmndrs/leva/issues",
"peerDependencies": {
"leva": ">=1.0.0",
"leva": ">=0.9.14",
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
},
Expand Down
Loading