diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..ddc20f2 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Contributing + +Thanks for your interest in contributing to Headless UI! Please take a moment to review this document **before submitting a pull request**. + +## Pull requests + +**Please ask first before starting work on any significant new features.** + +It's never a fun experience to have your pull request declined after investing a lot of time and effort into a new feature. To avoid this from happening, we request that contributors create [an issue](https://github.com/tailwindlabs/headlessui/issues) to first discuss any significant new features. This includes things like adding new components, exposing internal information, etc. +Also make sure that you are making changes to both the `React` and `Vue` versions so that we can ensure feature parity. + +## Monorepo + +The Headless UI repo is a monorepo using `yarn` workspaces. Note that we are using `yarn` version 1. + +## Coding standards + +Our code formatting rules are defined by TSDX, which uses `eslint` and we also use `prettier`. You can check your code against these standards by running: + +```sh +yarn lint +``` + +To automatically fix any style violations in your code, you can run: + +```sh +yarn lint --fix +``` + +## Running tests + +You can run the test suite using the following commands: + +```sh +yarn test +``` + +You can also run them for React of Vue individually: + +```sh +yarn react test + +# or + +yarn vue test +``` + +Please ensure that the tests are passing when submitting a pull request. If you're adding new features to Headless UI, please include tests. + diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml deleted file mode 100644 index 7885ed3..0000000 --- a/.github/workflows/release-dev.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Release Dev - -on: - push: - branches: [develop] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16] - - steps: - - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - registry-url: 'https://registry.npmjs.org' - - - name: Use cached node_modules - id: cache - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - nodeModules- - - - name: Install dependencies - run: yarn install --frozen-lockfile - env: - CI: true - - - name: Test - run: npm test - env: - CI: true - - - name: Resolve version - id: vars - run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - - name: "Version based on commit: 0.0.0-dev.${{ steps.vars.outputs.sha_short }}" - run: npm version -w packages 0.0.0-dev.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version - - - name: Publish - run: npm publish -w packages --tag dev - env: - CI: true - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-next.yml b/.github/workflows/release-insiders.yml similarity index 79% rename from .github/workflows/release-next.yml rename to .github/workflows/release-insiders.yml index 5c2446b..b7bbc85 100644 --- a/.github/workflows/release-next.yml +++ b/.github/workflows/release-insiders.yml @@ -1,4 +1,4 @@ -name: Release Next +name: Release Insiders on: push: @@ -44,11 +44,11 @@ jobs: id: vars run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: "Version based on commit: 0.0.0-next.${{ steps.vars.outputs.sha_short }}" - run: npm version -w packages 0.0.0-next.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version + - name: "Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}" + run: npm version -w packages 0.0.0-insiders.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version - name: Publish - run: npm publish -w packages --tag next + run: npm publish -w packages --tag insiders env: CI: true NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 133a519..30a518b 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,22 @@ For full documentation, visit [headlessui.dev](https://headlessui.dev). +### Installing the latest version + +You can install the latest version by using: + +- `npm install @headlessui/react@latest` or `yarn add @headlessui/react@latest`. +- `npm install @headlessui/vue@latest` or `yarn add @headlessui/vue@latest`. + +### Installing the insiders version + +You can install the insiders version (which points to whatever the latest commit on the `main` branch is) by using: + +- `npm install @headlessui/react@insiders` or `yarn add @headlessui/react@insiders`. +- `npm install @headlessui/vue@insiders` or `yarn add @headlessui/vue@insiders`. + +**Note:** The insiders build doesn't follow semver and therefore doesn't guarantee that the APIs will be the same once they are released. + ## Packages | Name | Version | Downloads | @@ -29,3 +45,8 @@ For help, discussion about best practices, or any other conversation that would For casual chit-chat with others using the library: [Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe) + +## Contributing + +If you're interested in contributing to Headless UI, please read our [contributing docs](https://github.com/tailwindlabs/headlessui/blob/main/.github/CONTRIBUTING.md) **before submitting a pull request**. + diff --git a/packages/@headlessui-react/src/components/disclosure/disclosure.tsx b/packages/@headlessui-react/src/components/disclosure/disclosure.tsx index 8b73c5a..587df36 100644 --- a/packages/@headlessui-react/src/components/disclosure/disclosure.tsx +++ b/packages/@headlessui-react/src/components/disclosure/disclosure.tsx @@ -259,7 +259,7 @@ let Button = forwardRefWithAs(function Button) => { diff --git a/packages/@headlessui-react/src/components/popover/popover.test.tsx b/packages/@headlessui-react/src/components/popover/popover.test.tsx index ef1b208..c39fc8a 100644 --- a/packages/@headlessui-react/src/components/popover/popover.test.tsx +++ b/packages/@headlessui-react/src/components/popover/popover.test.tsx @@ -1,5 +1,5 @@ import React, { createElement, useEffect, useRef } from 'react' -import { render, screen } from '@testing-library/react' +import { render } from '@testing-library/react' import { Popover } from './popover' import { suppressConsoleLogs } from '../../test-utils/suppress-console-logs'