Skip to content

Commit 0460bec

Browse files
committed
Merge branch 'users/machi/focusgroup' of github.com:marchbox/fluentui into users/machi/focusgroup
2 parents cb14520 + 4bfbbed commit 0460bec

15 files changed

Lines changed: 417 additions & 43 deletions

File tree

.storybook/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import './docs-root.css';
1+
import '../packages/react-components/react-storybook-addon/src/styles.css';
22
import '../packages/react-components/react-storybook-addon-export-to-sandbox/src/styles.css';
33
import { withLinks } from '@storybook/addon-links';
44

apps/public-docsite-v9/.storybook/docs-root-v9.css

Lines changed: 0 additions & 24 deletions
This file was deleted.

apps/public-docsite-v9/.storybook/preview.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import * as rootPreview from '../../../.storybook/preview';
22

3-
import './docs-root-v9.css';
4-
53
/** @type {NonNullable<import('@storybook/react').Decorator[]>} */
64
export const decorators = rootPreview.decorators;
75

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
pr: none
2+
trigger: none
3+
4+
parameters:
5+
- name: dryRun
6+
displayName: Dry Run Mode
7+
type: boolean
8+
default: true
9+
10+
# Customize build number to include tools experimental prefix
11+
# Example: tools_experimental_20201022.1
12+
name: 'tools_experimental_$(Date:yyyyMMdd)$(Rev:.r)'
13+
14+
variables:
15+
- group: 'Github and NPM secrets'
16+
- template: .devops/templates/variables.yml
17+
parameters:
18+
skipComponentGovernanceDetection: false
19+
- name: tags
20+
value: production,externalfacing
21+
22+
resources:
23+
repositories:
24+
- repository: 1esPipelines
25+
type: git
26+
name: 1ESPipelineTemplates/1ESPipelineTemplates
27+
ref: refs/tags/release
28+
29+
extends:
30+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
31+
parameters:
32+
pool:
33+
name: Azure-Pipelines-1ESPT-ExDShared
34+
image: windows-latest
35+
os: windows # We need windows because compliance task only run on windows.
36+
stages:
37+
- stage: main
38+
jobs:
39+
- job: Release
40+
pool:
41+
name: '1ES-Host-Ubuntu'
42+
image: '1ES-PT-Ubuntu-20.04'
43+
os: linux
44+
timeoutInMinutes: 90
45+
workspace:
46+
clean: all
47+
templateContext:
48+
outputParentDirectory: $(System.DefaultWorkingDirectory)
49+
outputs:
50+
- output: pipelineArtifact
51+
targetPath: $(System.DefaultWorkingDirectory)
52+
artifactName: output
53+
steps:
54+
- template: .devops/templates/tools.yml@self
55+
parameters:
56+
dryRun: ${{ parameters.dryRun }}
57+
58+
- script: |
59+
git config user.name "Fluent UI Build"
60+
git config user.email "fluentui-internal@service.microsoft.com"
61+
displayName: Configure git user (used by beachball)
62+
63+
- task: Bash@3
64+
name: validation
65+
inputs:
66+
targetType: 'inline'
67+
script: |
68+
BRANCH="$(Build.SourceBranch)"
69+
if [[ ! $BRANCH =~ refs/heads/experimental/ ]]; then
70+
echo "##vso[task.logissue type=error]Branch '$BRANCH' must start with 'refs/heads/experimental/'"
71+
exit 1
72+
fi
73+
BRANCH_PATH=${BRANCH#refs/heads/}
74+
FEATURE_NAME=${BRANCH#refs/heads/experimental/}
75+
echo "##vso[task.setvariable variable=branchPath;isOutput=true]$BRANCH_PATH"
76+
echo "##vso[task.setvariable variable=featureName;isOutput=true]$FEATURE_NAME"
77+
echo "Branch path: $BRANCH_PATH"
78+
echo "Feature name: $FEATURE_NAME"
79+
displayName: Validate branch and extract feature name
80+
81+
- script: |
82+
yarn install --frozen-lockfile
83+
displayName: Install dependencies
84+
85+
# Deletes all existing changefiles so that only bump that happens is for experimental
86+
- script: |
87+
rm -f change/*
88+
displayName: 'Delete existing changefiles'
89+
90+
# Bumps all tools packages to x.x.x-experimental.<feature>.<date>-<hash> version
91+
# x.x.x is each package's own current version
92+
- script: |
93+
FEATURE_NAME=$(validation.featureName)
94+
DATE=$(date +"%Y%m%d")
95+
HASH=$(git rev-parse --short HEAD)
96+
VERSION_SUFFIX="experimental.${FEATURE_NAME}.${DATE}-${HASH}"
97+
98+
echo "Version suffix: ${VERSION_SUFFIX}"
99+
100+
yarn nx g @fluentui/workspace-plugin:version-bump --all --scope tools --versionSuffix "${VERSION_SUFFIX}"
101+
git add .
102+
git commit -m "bump tools experimental versions with suffix ${VERSION_SUFFIX}"
103+
yarn change --type prerelease --message "Release experimental tools ${VERSION_SUFFIX}" --dependent-change-type "prerelease"
104+
displayName: 'Bump and commit experimental versions'
105+
106+
- script: |
107+
FLUENT_PROD_BUILD=true yarn nx run-many -t build -p 'tag:tools,!tag:npm:private,!tag:v8' --exclude 'apps/**' --nxBail
108+
displayName: build
109+
110+
- script: |
111+
FLUENT_PROD_BUILD=true yarn nx run-many -t lint -p 'tag:tools,!tag:npm:private,!tag:v8' --exclude 'apps/**' --nxBail
112+
displayName: lint
113+
114+
- script: |
115+
FLUENT_PROD_BUILD=true yarn nx run-many -t test -p 'tag:tools,!tag:npm:private,!tag:v8' --exclude 'apps/**' --nxBail
116+
displayName: test
117+
118+
- script: |
119+
yarn beachball publish -b origin/$(validation.branchPath) --access public -y -n $(npmToken) --no-push --tag experimental --config scripts/beachball/src/release-tools.config.js
120+
git reset --hard origin/$(validation.branchPath)
121+
displayName: Publish changes and bump versions
122+
condition: and(succeeded(), not(${{ parameters.dryRun }}))
123+
124+
- template: .devops/templates/cleanup.yml@self
125+
parameters:
126+
checkForModifiedFiles: false
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "feat: add shared SB preview styles",
4+
"packageName": "@fluentui/react-storybook-addon",
5+
"email": "dmytrokirpa@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-components/react-storybook-addon/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ export const ThemePicker: React.FC<{ context: FluentStoryContext }> = ({ context
3838
};
3939
```
4040

41+
### Shared Storybook Preview Styles
42+
43+
The package ships a `styles.css` file with shared Storybook preview styles (docs layout, table formatting, theme-aware backgrounds, etc.). Import it once in your Storybook `preview.js`/`preview.ts`:
44+
45+
```js
46+
// .storybook/preview.js
47+
import '@fluentui/react-storybook-addon/styles.css';
48+
```
49+
4150
### Augmented Docs Blocks
4251

4352
This presets uses [custom docs container and page](https://storybook.js.org/docs/7/writing-docs/autodocs#customize-the-docs-container) for unified FluentUI experience including:

packages/react-components/react-storybook-addon/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"main": "lib-commonjs/index.js",
66
"module": "lib/index.js",
77
"typings": "./dist/index.d.ts",
8-
"sideEffects": false,
98
"repository": {
109
"type": "git",
1110
"url": "https://github.com/microsoft/fluentui"
@@ -53,11 +52,16 @@
5352
"require": "./lib-commonjs/index.js"
5453
},
5554
"./preset": "./preset.js",
55+
"./styles.css": "./dist/styles.css",
5656
"./package.json": "./package.json"
5757
},
58+
"sideEffects": [
59+
"./dist/styles.css"
60+
],
5861
"files": [
5962
"*.md",
6063
"dist/*.d.ts",
64+
"dist/styles.css",
6165
"lib",
6266
"lib-commonjs",
6367
"preset.js"

packages/react-components/react-storybook-addon/project.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@
2626
],
2727
"target": "build"
2828
}
29-
]
29+
],
30+
"options": {
31+
"assets": [
32+
{
33+
"input": "{projectRoot}/src",
34+
"output": "dist",
35+
"glob": "styles.css"
36+
}
37+
]
38+
}
3039
}
3140
}
3241
}

.storybook/docs-root.css renamed to packages/react-components/react-storybook-addon/src/styles.css

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
padding: 0;
199199
border-collapse: collapse;
200200
}
201+
201202
#storybook-docs table:not(.docblock-argstable, .sbdocs-preview table) tr {
202203
border-top: 1px solid rgba(0, 0, 0, 0.1);
203204
}
@@ -428,9 +429,11 @@ h1.fluent {
428429

429430
h1.fluent .fluent-version {
430431
display: block;
431-
font-size: 24px; /* --font-size-base-600 */
432+
font-size: 24px;
433+
/* --font-size-base-600 */
432434
line-height: 32px;
433-
color: #707070; /* --color-neutral-foreground-3 */
435+
color: #707070;
436+
/* --color-neutral-foreground-3 */
434437
}
435438

436439
h2.fluent {
@@ -440,3 +443,28 @@ h2.fluent {
440443
line-height: 36px;
441444
letter-spacing: -0.16px;
442445
}
446+
447+
/* remove the docs wrapper bg to let page bg show through */
448+
/* remove unnecessary padding now that theme switcher is not taking up space */
449+
#storybook-docs .sbdocs-wrapper {
450+
background: transparent !important;
451+
padding: 0 48px;
452+
}
453+
454+
/* sb-show-main is missing during page transitions causing a page shift */
455+
/* todo: cleanup once we no longer inherit docs-root */
456+
.sb-show-main.sb-main-fullscreen,
457+
.sb-main-fullscreen {
458+
margin: 0;
459+
padding: 0;
460+
display: block;
461+
}
462+
463+
/* remove loading overlay */
464+
.sb-preparing-story,
465+
.sb-preparing-docs,
466+
.sb-nopreview,
467+
.sb-errordisplay,
468+
.sidebar-container .search-field + div {
469+
display: none !important;
470+
}

tools/workspace-plugin/src/generators/version-bump/README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ The generator also bumps the versions in any dependent packages.
2626
- [`exclude`](#exclude)
2727
- [`bumpType`](#bumpType)
2828
- [`prereleaseTag`](#prereleaseTag)
29+
- [`scope`](#scope)
30+
- [`versionSuffix`](#versionsuffix)
2931

3032
<!-- tocstop -->
3133

3234
## NOTES
3335

34-
- Can bump single package or all convered packages
36+
- Can bump single package or all packages in a given scope
3537
- Bumps the package version in all dependent packages
3638
- Converged packages are currently only identified as having version `9.x`
3739

@@ -73,6 +75,12 @@ Bump all vNext packages for a nightly release (0.0.0-nightly).
7375
yarn nx g @fluentui/workspace-plugin:version-bump --all --bumpType nightly --prereleaseTag nightly
7476
```
7577

78+
Bump all tools packages for an experimental release, preserving each package's base version:
79+
80+
```sh
81+
yarn nx g @fluentui/workspace-plugin:version-bump --all --scope tools --versionSuffix "experimental.my-feature.20260408-abc1234"
82+
```
83+
7684
## Options
7785

7886
#### `name`
@@ -87,7 +95,7 @@ Project name (without @npmScope prefix - e.g. `<project-name>`)
8795

8896
Type: `boolean`
8997

90-
Run batch migration on all vNext packages with the tag `platform:web` in `nx.json`
98+
Run batch migration on all packages in the specified scope (see [`scope`](#scope)).
9199

92100
#### `exclude`
93101

@@ -114,3 +122,23 @@ Bump type that can be any allowed in the official NPM [semver](https://github.co
114122
Type: `string`
115123

116124
For example `alpha` or `beta` Only used when bumping prerelease versions.
125+
126+
### `scope`
127+
128+
Type: `string` (enum: `vNext`, `tools`)
129+
Default: `vNext`
130+
131+
Which package scope `--all` targets:
132+
133+
- `vNext` — all converged/vNext packages (default, backward compatible)
134+
- `tools` — all public tools packages (tagged `tools`, non-private, non-v8)
135+
136+
### `versionSuffix`
137+
138+
Type: `string`
139+
140+
A suffix to append to each package's current version. The resulting version will be `{currentVersion}-{versionSuffix}`.
141+
142+
- Mutually exclusive with `--bumpType` and `--explicitVersion`
143+
- Requires `--all`
144+
- Useful for experimental releases where each package keeps its own base version

0 commit comments

Comments
 (0)