Skip to content

Commit

Permalink
Merge branch 'master' into add-mhtml-extension-to-filetypeiconmap
Browse files Browse the repository at this point in the history
  • Loading branch information
tomi-msft authored Jun 16, 2023
2 parents 0c497d0 + 4ccaa77 commit f65ae22
Show file tree
Hide file tree
Showing 308 changed files with 4,089 additions and 771 deletions.
2 changes: 1 addition & 1 deletion apps/perf-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@fluentui/scripts-perf-test-flamegrill": "*",
"@fluentui/example-data": "^8.4.11",
"@fluentui/react": "^8.110.2",
"@fluentui/react": "^8.110.3",
"@microsoft/load-themed-styles": "^1.10.26",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
10 changes: 5 additions & 5 deletions apps/public-docsite-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
"@fluentui/scripts-webpack": "*"
},
"dependencies": {
"@fluentui/react": "^8.110.2",
"@fluentui/react": "^8.110.3",
"@fluentui/react-examples": "^8.34.4",
"@microsoft/load-themed-styles": "^1.10.26",
"@fluentui/azure-themes": "^8.6.16",
"@fluentui/react-docsite-components": "^8.12.21",
"@fluentui/azure-themes": "^8.6.17",
"@fluentui/react-docsite-components": "^8.12.22",
"@fluentui/font-icons-mdl2": "^8.5.21",
"@fluentui/set-version": "^8.2.11",
"@fluentui/theme-samples": "^8.7.95",
"@fluentui/react-monaco-editor": "^1.7.98",
"@fluentui/theme-samples": "^8.7.96",
"@fluentui/react-monaco-editor": "^1.7.99",
"office-ui-fabric-core": "^11.0.0",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/public-docsite-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@fluentui/react-datepicker-compat": "^0.1.5",
"@fluentui/react-migration-v8-v9": "^9.2.16",
"@fluentui/react-migration-v0-v9": "^9.0.2",
"@fluentui/react": "^8.110.2",
"@fluentui/react": "^8.110.3",
"@fluentui/react-northstar": "^0.66.4",
"@fluentui/react-icons-northstar": "^0.66.4",
"@fluentui/react-components": "^9.21.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ export const alias = {
colorCompoundBrandForeground1Pressed: 'brand[60]',
colorBrandForeground1: 'brand[80]',
colorBrandForeground2: 'brand[70]',
colorBrandForeground2Hover: 'brand[60]',
colorBrandForeground2Pressed: 'brand[30]',
colorNeutralForeground1Static: 'grey[14]',
colorNeutralForegroundInverted: 'white',
colorNeutralForegroundInvertedHover: 'white',
Expand Down Expand Up @@ -204,6 +206,8 @@ export const alias = {
colorCompoundBrandBackgroundPressed: 'brand[60]',
colorBrandBackgroundStatic: 'brand[80]',
colorBrandBackground2: 'brand[160]',
colorBrandBackground2Hover: 'brand[150]',
colorBrandBackground2Pressed: 'brand[130]',
colorBrandBackgroundInverted: 'white',
colorBrandBackgroundInvertedHover: 'brand[160]',
colorBrandBackgroundInvertedPressed: 'brand[140]',
Expand All @@ -218,13 +222,16 @@ export const alias = {
colorNeutralStroke1Selected: 'grey[74]',
colorNeutralStroke2: 'grey[88]',
colorNeutralStroke3: 'grey[94]',
colorNeutralStrokeSubtle: 'grey[88]',
colorNeutralStrokeOnBrand: 'white',
colorNeutralStrokeOnBrand2: 'white',
colorNeutralStrokeOnBrand2Hover: 'white',
colorNeutralStrokeOnBrand2Pressed: 'white',
colorNeutralStrokeOnBrand2Selected: 'white',
colorBrandStroke1: 'brand[80]',
colorBrandStroke2: 'brand[140]',
colorBrandStroke2Hover: 'brand[120]',
colorBrandStroke2Pressed: 'brand[80]',
colorCompoundBrandStroke: 'brand[80]',
colorCompoundBrandStrokeHover: 'brand[70]',
colorCompoundBrandStrokePressed: 'brand[60]',
Expand Down
7 changes: 7 additions & 0 deletions apps/public-docsite-v9/src/shims/ThemeShim/v9ThemeShim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const mapAliasColors = (palette: IPalette, inverted: boolean): ColorTokens => {
colorCompoundBrandForeground1Pressed: palette.themeDark,
colorBrandForeground1: palette.themePrimary,
colorBrandForeground2: palette.themeDarkAlt,
colorBrandForeground2Hover: palette.themeDarkAlt,
colorBrandForeground2Pressed: palette.themeDarkAlt,
colorNeutralForeground1Static: palette.neutralPrimary,
colorNeutralForegroundInverted: palette.white,
colorNeutralForegroundInvertedHover: palette.white,
Expand Down Expand Up @@ -123,6 +125,8 @@ const mapAliasColors = (palette: IPalette, inverted: boolean): ColorTokens => {
colorCompoundBrandBackgroundPressed: palette.themeDark,
colorBrandBackgroundStatic: palette.themePrimary,
colorBrandBackground2: palette.themeLighterAlt,
colorBrandBackground2Hover: palette.themeLighterAlt,
colorBrandBackground2Pressed: palette.themeLighterAlt,
colorBrandBackgroundInverted: palette.white,
colorBrandBackgroundInvertedHover: palette.themeLighterAlt,
colorBrandBackgroundInvertedPressed: palette.themeLight,
Expand All @@ -137,13 +141,16 @@ const mapAliasColors = (palette: IPalette, inverted: boolean): ColorTokens => {
colorNeutralStroke1Selected: palette.neutralTertiaryAlt,
colorNeutralStroke2: palette.neutralQuaternaryAlt,
colorNeutralStroke3: palette.neutralLighter,
colorNeutralStrokeSubtle: palette.neutralQuaternaryAlt,
colorNeutralStrokeOnBrand: palette.white,
colorNeutralStrokeOnBrand2: palette.white,
colorNeutralStrokeOnBrand2Hover: palette.white,
colorNeutralStrokeOnBrand2Pressed: palette.white,
colorNeutralStrokeOnBrand2Selected: palette.white,
colorBrandStroke1: palette.themePrimary,
colorBrandStroke2: palette.themeLight,
colorBrandStroke2Hover: palette.themeLight,
colorBrandStroke2Pressed: palette.themeLight,
colorCompoundBrandStroke: palette.themePrimary,
colorCompoundBrandStrokeHover: palette.themeDarkAlt,
colorCompoundBrandStrokePressed: palette.themeDark,
Expand Down
14 changes: 7 additions & 7 deletions apps/public-docsite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"devDependencies": {
"@fluentui/common-styles": "^1.2.30",
"@fluentui/eslint-plugin": "*",
"@fluentui/react-monaco-editor": "^1.7.98",
"@fluentui/react-monaco-editor": "^1.7.99",
"write-file-webpack-plugin": "^4.1.0",
"@fluentui/scripts-tasks": "*",
"@fluentui/scripts-webpack": "*"
Expand All @@ -34,17 +34,17 @@
"@fluentui/font-icons-mdl2": "^8.5.21",
"@fluentui/public-docsite-resources": "^8.1.41",
"@fluentui/public-docsite-setup": "^0.3.21",
"@fluentui/react": "^8.110.2",
"@fluentui/react-docsite-components": "^8.12.21",
"@fluentui/react": "^8.110.3",
"@fluentui/react-docsite-components": "^8.12.22",
"@fluentui/react-examples": "^8.34.4",
"@fluentui/react-experiments": "^8.14.90",
"@fluentui/fluent2-theme": "^8.107.21",
"@fluentui/react-file-type-icons": "^8.8.21",
"@fluentui/react-experiments": "^8.14.91",
"@fluentui/fluent2-theme": "^8.107.22",
"@fluentui/react-file-type-icons": "^8.9.0",
"@fluentui/react-icons-mdl2": "^1.3.45",
"@fluentui/react-icons-mdl2-branded": "^1.2.46",
"@fluentui/set-version": "^8.2.11",
"@fluentui/theme": "^2.6.32",
"@fluentui/theme-samples": "^8.7.95",
"@fluentui/theme-samples": "^8.7.96",
"@fluentui/utilities": "^8.13.16",
"@microsoft/load-themed-styles": "^1.10.26",
"office-ui-fabric-core": "^11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/react-18-tests-v8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@fluentui/scripts-webpack": "*"
},
"dependencies": {
"@fluentui/react": "^8.110.2",
"@fluentui/react": "^8.110.3",
"@fluentui/react-hooks": "^8.6.27",
"@types/react": "18.0.14",
"@types/react-dom": "18.0.6",
Expand Down
2 changes: 1 addition & 1 deletion apps/recipes-react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@fluentui/react-components": "^9.21.0",
"@fluentui/react-icons": "^2.0.196",
"@fluentui/react-icons": "^2.0.203",
"@fluentui/react-theme": "^9.1.8",
"@fluentui/react-provider": "^9.7.2",
"@fluentui/react-storybook-addon": "9.0.0-rc.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/ssr-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"license": "MIT",
"devDependencies": {
"@fluentui/react": "^8.110.2",
"@fluentui/react": "^8.110.3",
"@microsoft/load-themed-styles": "^1.10.26",
"@types/mocha": "7.0.2",
"@fluentui/public-docsite-resources": "^8.1.41",
Expand Down
4 changes: 2 additions & 2 deletions apps/stress-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"type-check": "tsc -b tsconfig.type.json"
},
"dependencies": {
"@fluentui/react": "^8.110.2",
"@fluentui/react": "^8.110.3",
"@fluentui/react-components": "^9.21.0",
"@fluentui/react-icons": "^2.0.196",
"@fluentui/react-icons": "^2.0.203",
"@fluentui/web-components": "^2.5.15",
"@microsoft/fast-element": "^1.11.1",
"afterframe": "1.0.2",
Expand Down
25 changes: 23 additions & 2 deletions apps/test-bundles/just.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
import { preset, task, resolveCwd } from '@fluentui/scripts-tasks';
import * as path from 'path';
import { preset, task, series } from '@fluentui/scripts-tasks';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - parallel-webpack has no types
import { run } from 'parallel-webpack';

import { bundleSizeCollect } from './scripts/bundle-size-collect';
import { mergeBundleSizes } from './scripts/merge-bundlesizes';

preset();

// This pacakge doesn't currently have any files that are included in the eslint task
// (it only runs on src, not config files)
task('code-style', 'prettier');

task('bundle-size-collect', () => {
const packageName = process.env.PACKAGE ?? '';
bundleSizeCollect({ packageName });
});

task('bundle', done => {
run(resolveCwd('webpack.config.js'), {}, done);
const configPath = path.join(__dirname, 'webpack.config.js');
const options = {};
run(configPath, options, done);
});

task('bundle-size-merge', () => {
const root = path.join(__dirname, 'dist');
mergeBundleSizes(
[path.join(root, 'react/bundlesize.json'), path.join(root, 'react-northstar/bundlesize.json')],
path.join(root, 'bundlesizes.json'),
);
});

task('bundle-size', series('bundle', 'bundle-size-collect'));
3 changes: 1 addition & 2 deletions apps/test-bundles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"private": true,
"license": "MIT",
"scripts": {
"bundle:size": "just-scripts bundle",
"bundle-size-auditor": "just-scripts bundle-size",
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
"just": "just-scripts"
},
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"parallel-webpack": "^2.6.0",
"@fluentui/scripts-tasks": "*",
"@fluentui/scripts-webpack": "*"
}
Expand Down
40 changes: 40 additions & 0 deletions apps/test-bundles/scripts/bundle-size-collect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import * as fs from 'fs';
import * as path from 'path';

/**
*
* collates bundle size information from minified files in apps/test-bundles/dist/<packageName> and writes to apps/test-bundles/dist/<packageName>/bundlesizes.json.
*
* It is uploaded as an artifact by the build definition in Azure Dev Ops and used to compare baseline and PR file size information which gets reported by Size Auditor
*/
export function bundleSizeCollect(config: { packageName: string; filename?: string }) {
const { packageName, filename: outputFilename = 'bundlesize.json' } = config;

if (!packageName) {
throw new Error('🚨 No packageName provided! Set it via env variable name "PACKAGE"');
}

const distRoot = path.join(__dirname, '../dist', packageName.replace('@fluentui/', ''));

const sizes: Record<string, number> = {};

const items = fs.readdirSync(distRoot);
items.forEach(item => {
const file = path.join(distRoot, item);

const isMinifiedJavascriptFile = item.match(/.min.js$/);
if (isMinifiedJavascriptFile) {
sizes[getComponentName(item)] = getFilesizeInBytes(file);
}
});

fs.writeFileSync(path.join(distRoot, outputFilename), JSON.stringify({ sizes }));

function getFilesizeInBytes(fileName: string) {
return fs.statSync(fileName).size;
}

function getComponentName(fileName: string) {
return path.basename(fileName, '.min.js');
}
}
14 changes: 14 additions & 0 deletions apps/test-bundles/scripts/merge-bundlesizes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as fs from 'fs';

export function mergeBundleSizes(configPaths: string[], mergeConfigPath: string) {
const result: { sizes: { [entryName: string]: number } } = {
sizes: {},
};

configPaths.forEach(configPath => {
const json = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
Object.assign(result.sizes, json.sizes);
});

fs.writeFileSync(mergeConfigPath, JSON.stringify(result));
}
45 changes: 32 additions & 13 deletions apps/test-bundles/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-shadow */

// @ts-check
const {
buildEntries,
Expand All @@ -8,21 +10,38 @@ const {
createEntry,
} = require('./webpackUtils');

const packageName = process.env.PACKAGE;
/**
*
* @param {string} packageName
* @returns
*/
function getEntries(packageName) {
if (packageName === '@fluentui/react-northstar') {
createFluentNorthstarFixtures();
const entries = buildEntries('@fluentui/react-northstar');
return entries;
}

if (packageName === '@fluentui/react') {
createFluentReactFixtures();
createEntry('@fluentui/keyboard-key');

const entries = buildEntries('@fluentui/react');
entries['keyboard-key'] = buildEntry('@fluentui/keyboard-key');
return entries;
}

console.error('🚨 packageName needs to be one of `@fluentui/react` or `@fluentui/react-northstar`!');
process.exit(1);
}

let entries;
if (packageName === '@fluentui/react-northstar') {
createFluentNorthstarFixtures();
entries = buildEntries('@fluentui/react-northstar');
} else if (packageName === '@fluentui/react') {
createFluentReactFixtures();
createEntry('@fluentui/keyboard-key');
const packageName = process.env.PACKAGE ?? '';

entries = buildEntries('@fluentui/react');
entries['keyboard-key'] = buildEntry('@fluentui/keyboard-key');
} else {
console.error('🚨 No packageName provided!');
if (!packageName) {
console.error('🚨 No packageName provided! Set it via env variable name "PACKAGE"');
process.exit(1);
}
const entries = getEntries(packageName);
const config = createWebpackConfig(entries, packageName);

module.exports = createWebpackConfig(entries, packageName);
module.exports = config;
Loading

0 comments on commit f65ae22

Please sign in to comment.