Skip to content

Commit fbaa1ae

Browse files
authored
Merge pull request #1071 from tailwindlabs/develop
Next release
2 parents cae976a + 947bf7a commit fbaa1ae

File tree

184 files changed

+21729
-6025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+21729
-6025
lines changed

.github/CONTRIBUTING.md

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Thanks for your interest in contributing to Headless UI! Please take a moment to review this document **before submitting a pull request**.
44

5+
- [Pull requests](#pull-requests)
6+
- [Monorepo](#monorepo)
7+
- [Installation](#installation)
8+
- [Coding standards](#coding-standards)
9+
- [Running tests](#running-tests)
10+
- [Running playgrounds](#running-playgrounds)
11+
- [Scripts summary](#scripts-summary)
12+
513
## Pull requests
614

715
**Please ask first before starting work on any significant new features.**
@@ -11,22 +19,28 @@ Also make sure that you are making changes to both the `React` and `Vue` version
1119

1220
## Monorepo
1321

14-
The Headless UI repo is a monorepo using `yarn` workspaces. Note that we are using `yarn` version 1.
22+
The Headless UI repo is a monorepo using `yarn` workspaces. Note that we are using `yarn` **version 1**.
1523

16-
## Coding standards
24+
## Installation
1725

18-
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:
26+
You only require a `yarn install` in the root directory to install everything you need.
1927

2028
```sh
21-
yarn lint
29+
yarn install
2230
```
2331

32+
## Coding standards
33+
34+
We use `prettier` for making sure that the codebase is formatted consistently.
2435
To automatically fix any style violations in your code, you can run:
2536

2637
```sh
27-
yarn lint --fix
38+
yarn lint
2839
```
2940

41+
**Note**: Whenever you commit, the lint check will run on all staged files.
42+
**Note**: In CI, we will only check your code, and not write with the formatted files. If you want to just check, then you can either run `yarn lint-check` or `CI=true yarn lint`
43+
3044
## Running tests
3145

3246
You can run the test suite using the following commands:
@@ -47,3 +61,61 @@ yarn vue test
4761

4862
Please ensure that the tests are passing when submitting a pull request. If you're adding new features to Headless UI, please include tests.
4963

64+
## Running playgrounds
65+
66+
Currently the `React` playground (located in `packages/playground-react`) is a Next.js app that contains some examples which you can find in the `pages` directory. The `Vue` playground (located in `packages/playground-vue`) is a Vite app that contains some examples which you can find in the `src/components` directory.
67+
68+
You can launch them by running:
69+
70+
```sh
71+
yarn react playground
72+
73+
# or
74+
75+
yarn vue playground
76+
```
77+
78+
This will also start the necessary watchers so that you don't have to care about them.
79+
80+
## Scripts summary
81+
82+
Global scripts, and some aliases:
83+
84+
- `yarn install`: install all dependencies for all packages
85+
- `yarn clean`: this will call all `yarn {package} clean` commands
86+
- `yarn build`: this will call all `yarn {package} build` commands
87+
- `yarn lint`: this will `lint` all packages
88+
- `yarn test`: this will `test` all packages
89+
- `yarn test`: run all jest tests
90+
- `yarn test --watch`: run all jest tests in interactive mode
91+
- `yarn test tabs`: run all jest tests filtered by `tabs`
92+
- `yarn test tabs --watch`: run all jest tests in interactive mode filtered by `tabs`
93+
94+
Scripts per package:
95+
96+
- `yarn react`: Prefix to run anything in the `@headlessui/react` package
97+
- `yarn react test`: run all jest tests
98+
- `yarn react test --watch`: run all jest tests in interactive mode
99+
- `yarn react test tabs`: run all jest tests filtered by `tabs`
100+
- `yarn react test tabs --watch`: run all jest tests in interactive mode filtered by `tabs`
101+
- `yarn react build`: build the final artefacts
102+
- `yarn react lint`: validate and fix the react codebase using prettier
103+
- `yarn react watch`: start a watcher for the react esm build
104+
- **Note**: this will be executed for you when using the `yarn react playground`
105+
- **Note**: this is not required for jest. You will probably never need this
106+
- `yarn react playground`: (alias) start a development server in the `playground-react` package
107+
- **Note**: this will also run `yarn react watch` for you, which means that you only need to execute `yarn react playground`
108+
- `yarn react clean`: this will remove `dist` files
109+
- `yarn vue`: Prefix to run anything in the `@headlessui/vue` package
110+
- `yarn vue test`: run all jest tests
111+
- `yarn vue test --watch`: run all jest tests in interactive mode
112+
- `yarn vue test tabs`: run all jest tests filtered by `tabs`
113+
- `yarn vue test tabs --watch`: run all jest tests in interactive mode filtered by `tabs`
114+
- `yarn vue build`: build the final artefacts
115+
- `yarn vue lint`: validate and fix the vue codebase using prettier
116+
- `yarn vue watch`: start a watcher for the vue esm build
117+
- **Note**: this will be executed for you when using the `yarn vue playground`
118+
- **Note**: this is not required for jest. You will probably never need this
119+
- `yarn vue playground`: (alias) start a development server in the `playground-vue` package
120+
- **Note**: this will also run `yarn vue watch` for you, which means that you only need to execute `yarn react playground`
121+
- `yarn vue clean`: this will remove `dist` files

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ contact_links:
1212
- name: Documentation Issue
1313
url: https://github.com/tailwindlabs/headlessui/issues/new?title=%5BDOCS%5D:%20
1414
about: 'For documentation issues, suggest changes on our documentation repository.'
15-

.github/workflows/release-insiders.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ jobs:
4444
id: vars
4545
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
4646

47-
- name: "Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}"
47+
- name: 'Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}'
4848
run: npm version -w packages 0.0.0-insiders.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version
4949

5050
- name: Publish
5151
run: npm publish -w packages --tag insiders
5252
env:
5353
CI: true
5454
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55-

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
node_modules/
3+
coverage/
4+
.next/

.swcrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"minify": false,
3+
"jsc": {
4+
"parser": {
5+
"syntax": "typescript",
6+
"tsx": true,
7+
"decorators": false,
8+
"dynamicImport": false
9+
}
10+
}
11+
}

CHANGELOG.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Ensure correct order when conditionally rendering `Menu.Item`, `Listbox.Option` and `RadioGroup.Option` ([#1045](https://github.com/tailwindlabs/headlessui/pull/1045))
1313
- Improve controlled Tabs behaviour ([#1050](https://github.com/tailwindlabs/headlessui/pull/1050))
1414
- Improve typeahead search logic ([#1051](https://github.com/tailwindlabs/headlessui/pull/1051))
15+
- Improve overal codebase, use modern tech like `esbuild` and TypeScript 4! ([#1055](https://github.com/tailwindlabs/headlessui/pull/1055))
16+
17+
### Added
18+
19+
- Add `Combobox` component ([#1047](https://github.com/tailwindlabs/headlessui/pull/1047))
1520

1621
## [Unreleased - @headlessui/vue]
1722

1823
### Fixed
1924

2025
- Ensure correct order when conditionally rendering `MenuItem`, `ListboxOption` and `RadioGroupOption` ([#1045](https://github.com/tailwindlabs/headlessui/pull/1045))
2126
- Improve typeahead search logic ([#1051](https://github.com/tailwindlabs/headlessui/pull/1051))
27+
- Improve overal codebase, use modern tech like `esbuild` and TypeScript 4! ([#1055](https://github.com/tailwindlabs/headlessui/pull/1055))
28+
29+
### Added
30+
31+
- Add `Combobox` component ([#1047](https://github.com/tailwindlabs/headlessui/pull/1047))
2232

2333
## [@headlessui/react@v1.4.3] - 2022-01-14
2434

@@ -88,7 +98,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8898
- Add `aria-orientation` to `Listbox`, which swaps Up/Down with Left/Right keys ([#683](https://github.com/tailwindlabs/headlessui/pull/683))
8999
- Expose `close` function from the render prop for `Disclosure`, `Disclosure.Panel`, `Popover` and `Popover.Panel` ([#697](https://github.com/tailwindlabs/headlessui/pull/697))
90100

91-
92101
## [@headlessui/vue@v1.4.0] - 2021-07-29
93102

94103
### Added
@@ -100,7 +109,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
100109

101110
## [@headlessui/react@v1.3.0] - 2021-06-21
102111

103-
### Added
112+
### Added
104113

105114
- Ensure that you can use `Transition.Child` when using implicit Transitions ([#503](https://github.com/tailwindlabs/headlessui/pull/503))
106115
- Add new `entered` prop for `Transition` and `Transition.Child` components ([#504](https://github.com/tailwindlabs/headlessui/pull/504))
@@ -120,7 +129,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
120129

121130
## [@headlessui/vue@v1.3.0] - 2021-06-21
122131

123-
### Added
132+
### Added
124133

125134
- Ensure that you can use `TransitionChild` when using implicit Transitions ([#503](https://github.com/tailwindlabs/headlessui/pull/503))
126135
- Add new `entered` prop for `Transition` and `TransitionChild` components ([#504](https://github.com/tailwindlabs/headlessui/pull/504))
@@ -134,7 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
134143

135144
## [@headlessui/react@v1.2.0] - 2021-05-10
136145

137-
### Added
146+
### Added
138147

139148
- Introduce Open/Closed state, to simplify component communication ([#466](https://github.com/tailwindlabs/headlessui/pull/466))
140149

@@ -146,7 +155,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
146155

147156
## [@headlessui/vue@v1.2.0] - 2021-05-10
148157

149-
### Added
158+
### Added
150159

151160
- Introduce Open/Closed state, to simplify component communication ([#466](https://github.com/tailwindlabs/headlessui/pull/466))
152161

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ For casual chit-chat with others using the library:
4949
## Contributing
5050

5151
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**.
52-

jest/create-jest-config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
const { createJestConfig: create } = require('tsdx/dist/createJestConfig')
2-
31
module.exports = function createJestConfig(root, options) {
42
return Object.assign(
5-
{},
6-
create(undefined, root),
73
{
84
rootDir: root,
95
setupFilesAfterEnv: ['<rootDir>../../jest/custom-matchers.ts'],
10-
globals: {
11-
'ts-jest': {
12-
isolatedModules: true,
13-
tsConfig: '<rootDir>/tsconfig.tsdx.json',
14-
},
6+
transform: {
7+
'^.+\\.(t|j)sx?$': '@swc/jest',
158
},
169
},
1710
options

package.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,24 @@
1111
],
1212
"scripts": {
1313
"react": "yarn workspace @headlessui/react",
14+
"react-playground": "yarn workspace playground-react dev",
15+
"playground-react": "yarn workspace playground-react dev",
1416
"vue": "yarn workspace @headlessui/vue",
15-
"shared": "yarn workspace @headlessui/shared",
16-
"build": "yarn workspaces run build",
17+
"playground-vue": "yarn workspace playground-vue dev",
18+
"vue-playground": "yarn workspace playground-vue dev",
19+
"clean": "yarn workspaces run clean",
20+
"build": "npm-run-all -p 'react build' 'vue build'",
1721
"test": "./scripts/test.sh",
18-
"lint": "./scripts/lint.sh"
22+
"lint": "./scripts/lint.sh",
23+
"lint-check": "CI=true ./scripts/lint.sh"
1924
},
2025
"husky": {
2126
"hooks": {
2227
"pre-commit": "lint-staged"
2328
}
2429
},
2530
"lint-staged": {
26-
"*.{js,jsx,ts,tsx}": "tsdx lint"
31+
"*": "yarn lint-check"
2732
},
2833
"prettier": {
2934
"printWidth": 100,
@@ -32,12 +37,19 @@
3237
"trailingComma": "es5"
3338
},
3439
"devDependencies": {
40+
"@swc/core": "^1.2.131",
41+
"@swc/jest": "^0.2.17",
3542
"@testing-library/jest-dom": "^5.11.9",
3643
"@types/node": "^14.14.22",
44+
"esbuild": "^0.14.11",
3745
"husky": "^4.3.8",
46+
"jest": "26",
3847
"lint-staged": "^12.2.1",
39-
"tsdx": "^0.14.1",
40-
"tslib": "^2.1.0",
41-
"typescript": "^3.9.7"
48+
"npm-run-all": "^4.1.5",
49+
"prettier": "^2.5.1",
50+
"prettier-plugin-tailwindcss": "^0.1.4",
51+
"rimraf": "^3.0.2",
52+
"tslib": "^2.3.1",
53+
"typescript": "^4.5.4"
4254
}
4355
}

packages/@headlessui-react/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ For help, discussion about best practices, or any other conversation that would
3636
For casual chit-chat with others using the library:
3737

3838
[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe)
39-

0 commit comments

Comments
 (0)