Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 724b2f9

Browse files
authored
Rename lib to utils (#2153)
* Rename all lib folders to utils * better changelog warning format
1 parent b3e9e1b commit 724b2f9

File tree

286 files changed

+340
-348
lines changed

Some content is hidden

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

286 files changed

+340
-348
lines changed

.eslintignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
coverage/
22
dist/
3+
lib/
34
node_modules/
4-
5-
# packages that have lib as the output
6-
packages/digest/lib
7-
packages/perf-test/lib
8-
packages/playground/lib
9-
packages/react-theming/lib
10-

.github/CONTRIBUTING.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
CONTRIBUTING
2-
============
1+
# CONTRIBUTING
32

43
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
54
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
65

7-
86
- [Getting started](#getting-started)
97
- [Useful Commands](#useful-commands)
108
- [Workflow](#workflow)
@@ -31,7 +29,7 @@ You can contribute to Stardust by being an official [contributor](setup-local-de
3129

3230
### Useful Commands
3331

34-
>This list contains the most useful commands. You should run `yarn run` to see all scripts.
32+
> This list contains the most useful commands. You should run `yarn run` to see all scripts.
3533
3634
```sh
3735
yarn start // run doc site
@@ -66,7 +64,7 @@ These guides will walk your through various activities for contributing:
6664

6765
## Accessibility
6866

69-
Stardust implements accessibility using accessibility behaviors. The behaviors add attributes to the DOM elements (mainly role and aria-* properties) as well as handle keyboard interaction and focus. Every accessible component has a default behavior, which can be overriden using the `accessibility` prop. You can choose a behavior from the ones provided by Stardust or you can implement a new behavior.
67+
Stardust implements accessibility using accessibility behaviors. The behaviors add attributes to the DOM elements (mainly role and aria-\* properties) as well as handle keyboard interaction and focus. Every accessible component has a default behavior, which can be overriden using the `accessibility` prop. You can choose a behavior from the ones provided by Stardust or you can implement a new behavior.
7068

7169
Behaviors apply properties, focus handling and keyboard handlers to the component slots. When developing a component, the properties and keyboard handlers need to be spread to the corresponding slots.
7270

@@ -83,13 +81,15 @@ ARIA [roles][3] and [attributes][4] provide necessary semantics for assistive te
8381
In addition to behaviors, ARIA [landmarks][5] and [naming props][6] need to be added to the components/elements to form the page structure and provide textual information.
8482

8583
For example, to make an icon-only Button accessible, `aria-label` prop needs to be used:
84+
8685
```html
87-
<Button icon="star" iconOnly aria-label='Favorites' primary />
86+
<button icon="star" iconOnly aria-label="Favorites" primary />
8887
```
8988

9089
### Focus
9190

9291
An application should always have an element with [focus][7] when in use. The user can change the focused element by:
92+
9393
- pressing TAB/shift+TAB keys to navigate through the components
9494
- pressing arrow keys to navigate through children (for example menu items in menu)
9595
- using the screen reader with or without virtual cursor
@@ -98,7 +98,7 @@ Stardust uses Office UI Fabric [FocusZone][8] for basic TAB and arrow key focus
9898

9999
Focused component needs to be clearly visible. This is handled in Stardust by focus indicator functionality. Focus indicator will be displayed only if the application is in keyboard mode. Application switches to keyboard mode when a key relevant to navigation is pressed. It disables keyboard mode on mouse click events.
100100

101-
To style the focused component, you can use the `isFromKeyboard` utility and prop. See [Button component][10] and [Button style][11] for reference.
101+
To style the focused component, you can use the `isFromKeyboard` utility and prop. See [Button component][10] and [Button style][11] for reference.
102102

103103
### Keyboard handling
104104

@@ -111,7 +111,7 @@ We are using [Lerna][14] to manage our packages and [Yarn Workspaces][15] to lin
111111
### Add a new package
112112

113113
#### Run `lerna create`
114-
114+
115115
You should to run `lerna create` command to create a new package
116116

117117
- we are using `@fluentui` namespace on NPM to publish our packages
@@ -126,6 +126,7 @@ lerna create @fluentui/react-proptypes react-proptypes
126126
```
127127

128128
##### Example input
129+
129130
```
130131
lerna notice cli v3.11.1
131132
package name: (@fluentui/react-proptypes)
@@ -179,10 +180,7 @@ If your package uses TypeScript, please also create a new `tsconfig.json` and pl
179180
```json
180181
{
181182
"extends": "../../build/tsconfig.common",
182-
"include": [
183-
"src",
184-
"test"
185-
]
183+
"include": ["src", "test"]
186184
}
187185
```
188186

@@ -225,10 +223,10 @@ lerna add @fluentui/react-proptypes packages/react
225223
[6]: https://www.w3.org/TR/wai-aria-1.1/#namecalculation
226224
[7]: https://www.w3.org/TR/wai-aria-1.1/#managingfocus
227225
[8]: https://developer.microsoft.com/en-us/fabric#/components/focuszone
228-
[9]: https://github.com/stardust-ui/react/blob/master/src/lib/accessibility/Behaviors/Menu/MenuBehavior.ts
226+
[9]: https://github.com/stardust-ui/react/blob/master/packages/react/src/utils/accessibility/Behaviors/Menu/MenuBehavior.ts
229227
[10]: https://github.com/stardust-ui/react/blob/master/src/components/Button/Button.tsx
230228
[11]: https://github.com/stardust-ui/react/blob/master/src/themes/teams/components/Button/buttonStyles.ts
231-
[12]: https://github.com/stardust-ui/react/blob/master/src/lib/accessibility/Behaviors/Menu/MenuItemBehavior.ts
229+
[12]: https://github.com/stardust-ui/react/blob/master/packages/react/src/utils/accessibility/Behaviors/Menu/MenuItemBehavior.ts
232230
[13]: https://github.com/stardust-ui/react/blob/master/src/components/Menu/MenuItem.tsx
233231
[14]: https://lernajs.io/
234232
[15]: https://yarnpkg.com/en/docs/workspaces

.github/add-a-feature.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
44
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
55

6-
76
- [Propose feature](#propose-feature)
87
- [Prototype](#prototype)
98
- [Spec out the API](#spec-out-the-api)
@@ -68,7 +67,7 @@ const Button: React.FunctionalComponent = props => {
6867
Stateful components should be classes:
6968

7069
```tsx
71-
import { AutoControlledComponent as Component } from '../../lib'
70+
import { AutoControlledComponent as Component } from '../../utils'
7271

7372
class Dropdown extends AutoControlledComponent {
7473
// ...
@@ -101,7 +100,7 @@ import {
101100
ContentComponentProps,
102101
UIComponentProps,
103102
commonPropTypes,
104-
} from '../../lib'
103+
} from '../../utils'
105104

106105
export interface DividerProps
107106
extends UIComponentProps,
@@ -193,7 +192,7 @@ After iterating on the feature with the maintainers, you will add full test cove
193192

194193
[1]: https://github.com/stardust-ui/react/issues
195194
[2]: https://github.com/stardust-ui/react/pull/73
196-
[3]: https://github.com/stardust-ui/react/blob/master/src/lib/AutoControlledComponent.tsx
195+
[3]: https://github.com/stardust-ui/react/blob/master/packages/react/src/utils/AutoControlledComponent.tsx
197196
[4]: https://facebook.github.io/react/docs/forms.html#controlled-components
198197
[5]: https://facebook.github.io/react/docs/forms.html#uncontrolled-components
199198
[6]: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ docs/src/currentBundleStats.json
1515
docs/src/exampleMenus
1616
docs/src/exampleSources
1717
docs/dist/
18+
# lib/
1819
node_modules/
1920
report.*.json
2021
stats/

.nowignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ docs/src/currentBundleStats.json
99
docs/src/exampleMenus
1010
docs/src/exampleSources
1111
e2e
12+
lib/
1213
node_modules
1314
packages/**/dist
1415
packages/**/test
1516
perf/dist
1617

17-
packages/digest/lib
18-
packages/perf-test/lib
19-
packages/playground/lib
20-
packages/react-theming/lib
21-
2218
.editorconfig
2319
.gitignore
2420
.prettierignore

.prettierignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@
22
.idea/
33
.vscode/
44

5-
65
coverage/
76
dist/
7+
lib/
88
stats/
99

10-
# packages that have lib as the output
11-
packages/digest/lib
12-
packages/perf-test/lib
13-
packages/playground/lib
14-
packages/react-theming/lib
15-
1610
package.json
1711

1812
packages/ability-attributes/src/schema.ts

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
2020
### Fixes
2121
- Prevent text highlight on icon consecutive clicks in `Checkbox` @silviuavram ([#2154](https://github.com/microsoft/fluent-ui-react/pull/2154))
2222
- Always handle provided onKeyDown event be propagated in inner zone @kolaps33 ([#2140](https://github.com/microsoft/fluent-ui-react/pull/2140))
23+
- Rename `lib` directories to `utils` @ecraig12345 ([#2153](https://github.com/microsoft/fluent-ui-react/pull/2153))
2324

2425
### Features
2526
- Add a new experimental @fluentui/react-theming package that includes a `compose()` @kenotron ([#2152](https://github.com/microsoft/fluent-ui-react/pull/2152))

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,42 +29,42 @@
2929
</a>
3030
</p>
3131

32-
>Hey, we're in development:
32+
> Hey, we're in development:
3333
>
34-
>1. **MINOR** versions represent **breaking changes**
35-
>1. **PATCH** versions represent **fixes _and_ features**
36-
>1. There are **no deprecation warnings** between releases
37-
>1. Consult the [**CHANGELOG**][4] and related issues/PRs for more information
34+
> 1. **MINOR** versions represent **breaking changes**
35+
> 1. **PATCH** versions represent **fixes _and_ features**
36+
> 1. There are **no deprecation warnings** between releases
37+
> 1. Consult the [**CHANGELOG**][4] and related issues/PRs for more information
3838
39-
***
39+
---
4040

4141
Fluent UI React represents a set of specifications and tools for building UI libraries.
4242

4343
## How Can I Help?
4444

4545
### [Voice Your Opinion][101]
4646

47-
Help shape this library by weighing in on our [RFC (request for comments)][101] issues.
47+
Help shape this library by weighing in on our [RFC (request for comments)][101] issues.
4848

4949
### [Contribute][3]
5050

5151
Our [CONTRIBUTING.md][3] is a step-by-step setup and development guide.
5252

5353
### [Good First Issue][103]
5454

55-
Issues labeled [`good first issue`][103] are a great way to ease into development on this project.
55+
Issues labeled [`good first issue`][103] are a great way to ease into development on this project.
5656

5757
### [New Components][102]
5858

59-
There is an issue for every new component labeled [`new component`][102]. Just comment on the issue you'd like to take.
59+
There is an issue for every new component labeled [`new component`][102]. Just comment on the issue you'd like to take.
6060

6161
### [Help Wanted Label][100]
6262

6363
Any other issue labeled [`help wanted`][100] is also ready for a PR.
6464

6565
## Why?
6666

67-
There are a number of packages that a UI library needs to create great UI components. Take a look at SUIR's [`/src/lib`][201] as an example. This core library enables the SUIR features we love today such as shorthand props, event stack handling, auto controlled state, controlling the rendered component, and more.
67+
There are a number of packages that a UI library needs to create great UI components. Take a look at SUIR's [`/src/utils`][201] as an example. This core library enables the SUIR features we love today such as shorthand props, event stack handling, auto controlled state, controlling the rendered component, and more.
6868

6969
Other libraries in the wild have some of these features and some of their own. It is our desire that the community share the best UI component practices in a core library to the greater benefit of the web.
7070

@@ -95,22 +95,26 @@ You can find Stardust usage examples by accessing the [doc site][5]
9595
See the [MANIFESTO.md][1] for details. SUIR v2 will be built on the specifications and tools from Stardust.
9696

9797
<!-- REPO -->
98+
9899
[1]: https://github.com/microsoft/fluent-ui-react/blob/master/MANIFESTO.md
99100
[2]: https://github.com/microsoft/fluent-ui-react/issues/new/choose
100101
[3]: https://github.com/microsoft/fluent-ui-react/blob/master/.github/CONTRIBUTING.md
101102
[4]: https://github.com/microsoft/fluent-ui-react/blob/master/CHANGELOG.md
102103
[5]: https://microsoft.github.io/fluent-ui-react
103104

104105
<!-- ISSUE LABELS -->
106+
105107
[100]: https://github.com/microsoft/fluent-ui-react/labels/help%20wanted
106108
[101]: https://github.com/microsoft/fluent-ui-react/issues?q=is%3Aopen+RFC+label%3ARFC
107109
[102]: https://github.com/microsoft/fluent-ui-react/issues?q=is%3Aissue+is%3Aopen+label%3A%22new+component%22
108110
[103]: https://github.com/microsoft/fluent-ui-react/labels/good%20first%20issue
109111

110112
<!-- SUIR -->
113+
111114
[200]: https://github.com/Semantic-Org/Semantic-UI-React
112-
[201]: https://github.com/Semantic-Org/Semantic-UI-React/tree/master/src/lib
115+
[201]: https://github.com/Semantic-Org/Semantic-UI-React/tree/master/packages/react/src/utils
113116

114117
<!-- EXTERNAL -->
118+
115119
[300]: https://developer.microsoft.com/en-us/fabric
116120
[301]: https://products.office.com/en-US/microsoft-teams/group-chat-software

build/dangerjs/checkChangelog.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const hasAddedLinesAfterVersionInChangelog = async (danger): Promise<boolean> =>
2020
}
2121

2222
const getMalformedChangelogEntries = async (danger): Promise<string[]> => {
23-
// +- description @githubname ([#DDDD](https://github.com/stardust-ui/react/pull/DDDD))
24-
const validEntry = /^\+- .*@\S+ \(\[#(\d+)]\(https:\/\/github\.com\/(?:stardust-ui\/react|microsoft\/fluent-ui-react)\/pull\/\1\)\)$/
23+
// +- description @githubname ([#DDDD](https://github.com/microsoft/fluent-ui-react/pull/DDDD))
24+
const validEntry = /^\+- .*@\S+ \(\[#(\d+)]\(https:\/\/github\.com\/microsoft\/fluent-ui-react\/pull\/\1\)\)$/
2525

2626
const addedLines = await getAddedLinesFromChangelog(danger)
2727

@@ -50,7 +50,9 @@ export default async ({ danger, fail, warn }: DangerJS) => {
5050
} else {
5151
const malformedChangelogEntries = await getMalformedChangelogEntries(danger)
5252
malformedChangelogEntries.forEach(entry => {
53-
fail(`Invalid entry format in ${CHANGELOG_FILE}: >${entry}<`)
53+
fail(`Invalid entry format in ${CHANGELOG_FILE}: >${entry}<
54+
55+
The correct format is: \`- description @githubname ([#DDDD](https://github.com/microsoft/fluent-ui-react/pull/DDDD)\``)
5456
})
5557

5658
const hasLine = await hasAddedLinesAfterVersionInChangelog(danger)

docs/src/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react'
22
import { hot } from 'react-hot-loader/root'
33
import { Provider, Debug, themes } from '@fluentui/react'
44

5-
import { mergeThemes } from 'src/lib'
5+
import { mergeThemes } from '@fluentui/react/src/utils'
66
import { ThemeContext, ThemeContextData, themeContextDefaults } from './context/ThemeContext'
77
import Routes from './routes'
88
import { PerfDataProvider } from './components/ComponentDoc/PerfChart'

0 commit comments

Comments
 (0)