diff --git a/.vscode/launch.json b/.vscode/launch.json index ad44b4feb3276b..743eeae1d54bdd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -128,7 +128,7 @@ "protocol": "inspector", "cwd": "${workspaceRoot}", "args": [ - "${workspaceRoot}/scripts/updateReleaseNotes/index.ts", + "${workspaceRoot}/scripts/update-release-notes/index.ts", "--token", // For local testing, generate a personal access token (https://github.com/settings/tokens) // and replace "your token here" with the token. DO NOT COMMIT YOUR TOKEN! diff --git a/azure-pipelines.release-vnext.yml b/azure-pipelines.release-vnext.yml index 84bdc8c8c32675..acec40f871da39 100644 --- a/azure-pipelines.release-vnext.yml +++ b/azure-pipelines.release-vnext.yml @@ -93,7 +93,7 @@ jobs: # TODO update release notes script for v9 # - script: | - # node -r ./scripts/ts-node-register ./scripts/updateReleaseNotes/index.ts --token=$(githubPAT) --apply --debug + # node -r ./scripts/ts-node-register ./scripts/update-release-notes/index.ts --token=$(githubPAT) --apply --debug # displayName: 'Update github release notes' # This would usually be run automatically (via a pipeline decorator from an extension), but the diff --git a/azure-pipelines.release.yml b/azure-pipelines.release.yml index b02a6c92c2c291..47f50182d20d71 100644 --- a/azure-pipelines.release.yml +++ b/azure-pipelines.release.yml @@ -172,7 +172,7 @@ jobs: # Run this near the end because it's more likely to fail than the artifact upload tasks, and its # failure doesn't need to block anything else - script: | - node -r ./scripts/ts-node-register ./scripts/updateReleaseNotes/index.ts --token=$(githubPAT) --apply --debug + node -r ./scripts/ts-node-register ./scripts/update-release-notes/index.ts --token=$(githubPAT) --apply --debug displayName: 'Update github release notes' - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 diff --git a/change/@fluentui-eslint-plugin-87bb04a5-8ec8-438b-9013-7159e0d6b0e6.json b/change/@fluentui-eslint-plugin-87bb04a5-8ec8-438b-9013-7159e0d6b0e6.json new file mode 100644 index 00000000000000..e202006dacfc2a --- /dev/null +++ b/change/@fluentui-eslint-plugin-87bb04a5-8ec8-438b-9013-7159e0d6b0e6.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix(eslint-plugin): properly resolve single-version policy dep issues in react-northstar packages", + "packageName": "@fluentui/eslint-plugin", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/package.json b/package.json index b6972d0ae7772b..b4795ed48b2355 100644 --- a/package.json +++ b/package.json @@ -121,6 +121,8 @@ "@testing-library/user-event": "13.5.0", "@tsconfig/node14": "1.0.3", "@types/babel__helper-plugin-utils": "7.10.0", + "@types/chrome-remote-interface": "0.30.0", + "@types/circular-dependency-plugin": "5.0.5", "@types/copy-webpack-plugin": "6.4.0", "@types/dedent": "0.7.0", "@types/doctrine": "0.0.5", @@ -130,23 +132,33 @@ "@types/express": "4.17.2", "@types/fs-extra": "8.0.1", "@types/glob": "7.1.1", + "@types/gulp": "4.0.9", + "@types/gulp-babel": "6.1.30", + "@types/gulp-cache": "0.4.5", + "@types/gulp-remember": "0.0.31", + "@types/gulp-sourcemaps": "0.0.35", + "@types/gulp-util": "3.0.36", "@types/jest": "26.0.24", "@types/jest-axe": "3.5.3", "@types/jju": "1.4.1", "@types/json-schema": "^7.0.8", "@types/loader-utils": "2.0.3", + "@types/markdown-table": "2.0.0", "@types/node": "10.17.55", "@types/node-fetch": "2.5.7", "@types/prettier": "2.2.3", + "@types/progress": "2.0.5", "@types/react": "17.0.44", "@types/react-dom": "17.0.15", "@types/react-is": "17.0.3", "@types/react-test-renderer": "17.0.2", + "@types/request-promise-native": "1.0.18", "@types/scheduler": "0.16.2", "@types/semver": "^6.2.0", "@types/tmp": "0.2.0", "@types/webpack-dev-middleware": "4.1.0", "@types/webpack-env": "1.16.0", + "@types/webpack-hot-middleware": "2.25.6", "@types/yargs": "13.0.11", "@types/yargs-unparser": "2.0.1", "@typescript-eslint/eslint-plugin": "4.22.0", @@ -161,8 +173,10 @@ "babel-plugin-tester": "10.1.0", "beachball": "2.18.0", "chalk": "4.1.0", + "chrome-remote-interface": "0.28.2", "chromedriver": "104.0.0", "ci-info": "3.2.0", + "circular-dependency-plugin": "5.2.2", "clean-webpack-plugin": "4.0.0", "cli-table3": "0.6.1", "copy-webpack-plugin": "8.1.0", @@ -193,12 +207,18 @@ "eslint-plugin-react": "7.26.0", "eslint-plugin-react-hooks": "4.2.0", "express": "4.17.1", + "extract-comments": "1.1.0", "file-loader": "6.2.0", "fork-ts-checker-webpack-plugin": "6.1.0", "fs-extra": "8.1.0", "geckodriver": "3.0.2", "glob": "7.2.0", - "gulp": "^4.0.2", + "gulp": "4.0.2", + "gulp-babel": "8.0.0", + "gulp-cache": "1.1.3", + "gulp-remember": "1.0.1", + "gulp-sourcemaps": "2.6.5", + "gulp-util": "3.0.8", "gzip-size": "6.0.0", "html-webpack-plugin": "5.1.0", "ignore-not-found-export-webpack-plugin": "1.0.2", @@ -212,11 +232,13 @@ "jest-watch-typeahead": "0.6.5", "jju": "1.4.0", "json-schema": "0.4.0", + "json-stable-stringify-without-jsonify": "1.0.1", "just-scripts": "1.8.2", "lage": "1.7.4", "lerna": "^3.21.0", "lint-staged": "10.2.10", "loader-utils": "2.0.0", + "markdown-table": "2.0.0", "memfs": "3.2.2", "mini-css-extract-plugin": "2.6.1", "node-fetch": "2.6.7", @@ -227,6 +249,7 @@ "postcss-modules": "4.1.3", "prettier": "2.2.1", "pretty-bytes": "5.6.0", + "progress": "2.0.3", "puppeteer": "14.4.0", "raw-loader": "4.0.2", "react": "17.0.2", @@ -234,6 +257,7 @@ "react-dom": "17.0.2", "react-is": "17.0.2", "react-test-renderer": "17.0.2", + "request-promise-native": "1.0.9", "sass": "1.49.11", "sass-loader": "12.4.0", "satisfied": "^1.1.1", @@ -250,6 +274,7 @@ "tachometer": "0.7.0", "terser": "5.14.2", "terser-webpack-plugin": "5.3.1", + "through2": "4.0.2", "tmp": "0.2.1", "ts-jest": "26.5.6", "ts-loader": "9.3.1", diff --git a/packages/eslint-plugin/src/configs/react-northstar.js b/packages/eslint-plugin/src/configs/react-northstar.js index 49802b7d27cb76..d6ace7298ef293 100644 --- a/packages/eslint-plugin/src/configs/react-northstar.js +++ b/packages/eslint-plugin/src/configs/react-northstar.js @@ -1,3 +1,7 @@ +const { findGitRoot } = require('../utils/configHelpers'); + +const workspaceRoot = findGitRoot(); + module.exports = { extends: [ 'airbnb', @@ -23,7 +27,10 @@ module.exports = { 'import/no-default-export': 'error', 'import/no-extraneous-dependencies': [ 'error', - { devDependencies: ['**/*-test.ts*', '**/*.test.ts*', '*.config.js', 'gulpfile.ts', 'just.config.ts'] }, + { + packageDir: ['.', workspaceRoot], + devDependencies: ['**/*-test.ts*', '**/*.test.ts*', '*.config.js', 'gulpfile.ts', 'just.config.ts'], + }, ], // False positive on arg types: diff --git a/packages/fluentui/accessibility/package.json b/packages/fluentui/accessibility/package.json index f884f3de706d2a..d2c16bbaa16836 100644 --- a/packages/fluentui/accessibility/package.json +++ b/packages/fluentui/accessibility/package.json @@ -11,8 +11,6 @@ "devDependencies": { "@fluentui/eslint-plugin": "*", "@fluentui/scripts": "^1.0.0", - "@types/gulp": "^4.0.6", - "gulp": "^4.0.2", "lerna-alias": "^3.0.3-0" }, "files": [ diff --git a/packages/fluentui/circulars-test/package.json b/packages/fluentui/circulars-test/package.json index e3df22f892d65b..42ebf13503f75d 100644 --- a/packages/fluentui/circulars-test/package.json +++ b/packages/fluentui/circulars-test/package.json @@ -7,8 +7,7 @@ "@fluentui/react-northstar": "^0.64.0" }, "devDependencies": { - "@fluentui/scripts": "^1.0.0", - "gulp": "^4.0.2" + "@fluentui/scripts": "^1.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/fluentui/docs-components/package.json b/packages/fluentui/docs-components/package.json index deb219bbb76b3a..85a2e0dedceab5 100644 --- a/packages/fluentui/docs-components/package.json +++ b/packages/fluentui/docs-components/package.json @@ -17,9 +17,7 @@ }, "devDependencies": { "@fluentui/eslint-plugin": "*", - "@fluentui/scripts": "^1.0.0", - "@types/gulp": "^4.0.6", - "gulp": "^4.0.2" + "@fluentui/scripts": "^1.0.0" }, "files": [ "dist" diff --git a/packages/fluentui/docs/package.json b/packages/fluentui/docs/package.json index 07ff8b89c2d183..86439cfdcdee90 100644 --- a/packages/fluentui/docs/package.json +++ b/packages/fluentui/docs/package.json @@ -55,12 +55,10 @@ "@types/classnames": "^2.2.9", "@types/color": "^3.0.0", "@types/faker": "^4.1.3", - "@types/gulp": "^4.0.6", "@types/react-custom-scrollbars": "^4.0.5", "@types/react-router-dom": "^5.1.5", "@types/react-virtualized": "^9.21.8", - "@types/react-window": "^1.8.2", - "gulp": "^4.0.2" + "@types/react-window": "^1.8.2" }, "publishConfig": { "access": "public" diff --git a/packages/fluentui/e2e/package.json b/packages/fluentui/e2e/package.json index 279209aba3d8ea..2183a6b841ac77 100644 --- a/packages/fluentui/e2e/package.json +++ b/packages/fluentui/e2e/package.json @@ -16,8 +16,7 @@ }, "devDependencies": { "@fluentui/eslint-plugin": "*", - "@fluentui/scripts": "^1.0.0", - "gulp": "^4.0.2" + "@fluentui/scripts": "^1.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/fluentui/react-northstar-prototypes/package.json b/packages/fluentui/react-northstar-prototypes/package.json index b33b135a09bf8d..69559e0794fc71 100644 --- a/packages/fluentui/react-northstar-prototypes/package.json +++ b/packages/fluentui/react-northstar-prototypes/package.json @@ -36,8 +36,7 @@ "@types/faker": "^4.1.3", "@types/react-custom-scrollbars": "^4.0.5", "@types/react-virtualized": "^9.21.8", - "@types/react-window": "^1.8.2", - "gulp": "^4.0.2" + "@types/react-window": "^1.8.2" }, "files": [ "dist" diff --git a/packages/fluentui/react-northstar/package.json b/packages/fluentui/react-northstar/package.json index 4076dc064c5369..af8e64c1303835 100644 --- a/packages/fluentui/react-northstar/package.json +++ b/packages/fluentui/react-northstar/package.json @@ -35,12 +35,10 @@ "@fluentui/scripts": "^1.0.0", "@types/classnames": "^2.2.9", "@types/faker": "^4.1.3", - "@types/gulp": "^4.0.6", "@types/simulant": "^0.2.0", "csstype": "^3.0.2", "faker": "^4.1.0", "fela-tools": "^10.6.1", - "gulp": "^4.0.2", "lerna-alias": "^3.0.3-0", "qs": "^6.8.0", "simulant": "^0.2.2" diff --git a/scripts/dangerjs/checkChangelog.ts b/scripts/dangerjs/checkChangelog.ts index 148ed611aeece1..5f69d1cb5b3d56 100644 --- a/scripts/dangerjs/checkChangelog.ts +++ b/scripts/dangerjs/checkChangelog.ts @@ -1,7 +1,8 @@ +import type { AddChange } from 'parse-diff'; import * as fs from 'fs'; import config from '../config'; -import { DangerJS, StructuredDiff } from './types'; +import { DangerJS } from './types'; import { DangerDSLType } from 'danger'; const CHANGELOG_FILE = 'packages/fluentui/CHANGELOG.md'; @@ -29,11 +30,11 @@ const getMalformedChangelogEntries = async (danger: DangerDSLType): Promise line.content).filter(content => content.startsWith('+-') && !validEntry.test(content)); }; -const getAddedLinesFromChangelog = async (danger: DangerDSLType): Promise<{ content: string; ln: number }[]> => { - return danger.git.structuredDiffForFile(CHANGELOG_FILE).then((changelogDiff: StructuredDiff) => { +const getAddedLinesFromChangelog = async (danger: DangerDSLType): Promise<[] | AddChange[]> => { + return danger.git.structuredDiffForFile(CHANGELOG_FILE).then(changelogDiff => { if (changelogDiff) { - return changelogDiff.chunks.reduce((acc, chunk) => { - const filteredLines = chunk.changes.filter(change => change.type === 'add'); + return changelogDiff.chunks.reduce((acc, chunk) => { + const filteredLines = chunk.changes.filter(change => change.type === 'add') as AddChange[]; return acc.concat(filteredLines); }, []); } diff --git a/scripts/dangerjs/checkStorybookVersions.ts b/scripts/dangerjs/checkStorybookVersions.ts index 6fea7239aed39a..d7e5204436ce6e 100644 --- a/scripts/dangerjs/checkStorybookVersions.ts +++ b/scripts/dangerjs/checkStorybookVersions.ts @@ -40,10 +40,10 @@ export async function checkStorybookVersions({ danger, fail }: DangerJS) { const rootPackageJson: PackageJson = fs.readJSONSync(config.paths.base(packageJsonFilename)); const webComponentsPackageJson: PackageJson = fs.readJSONSync(config.paths.base(webComponentsPackageJsonFilename)); - const storybookReactVersion = rootPackageJson.devDependencies['@storybook/react']; - const storybookHtmlVersion = webComponentsPackageJson.devDependencies['@storybook/html']; + const storybookReactVersion = rootPackageJson.devDependencies?.['@storybook/react']; + const storybookHtmlVersion = webComponentsPackageJson.devDependencies?.['@storybook/html']; - if (!storybookHtmlVersion || rootPackageJson.devDependencies['@storybook/html']) { + if (!storybookHtmlVersion || rootPackageJson.devDependencies?.['@storybook/html']) { // PLEASE READ THE FUNCTION COMMENT BEFORE MODIFYING OR REMOVING THIS CHECK!!! fail( `\`@storybook/html\` dependency must be specified in ONLY in \`${webComponentsPackageJsonFilename}\`, ` + diff --git a/scripts/dangerjs/detectNonApprovedDependencies/utils/getRuntimeDependencies.ts b/scripts/dangerjs/detectNonApprovedDependencies/utils/getRuntimeDependencies.ts index 313c1843722887..fac7dbe21173b7 100644 --- a/scripts/dangerjs/detectNonApprovedDependencies/utils/getRuntimeDependencies.ts +++ b/scripts/dangerjs/detectNonApprovedDependencies/utils/getRuntimeDependencies.ts @@ -26,11 +26,10 @@ const getRuntimeDependencies = (packageName: string) => { throw new Error(error); } - return output + return (output .split('\n') .map(line => line.match(dependencyRegex)) - .filter(Boolean) - .map(match => match[1]); + .filter(Boolean) as RegExpMatchArray[]).map(match => match[1]); }; export default getRuntimeDependencies; diff --git a/scripts/dangerjs/tsconfig.json b/scripts/dangerjs/tsconfig.json new file mode 100644 index 00000000000000..5bfe3e6eb1b7cc --- /dev/null +++ b/scripts/dangerjs/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.scripts.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["**/*.ts"] +} diff --git a/scripts/fluentui-publish/index.ts b/scripts/fluentui-publish/index.ts index b37be53d2fba44..2aa20f54b73a90 100644 --- a/scripts/fluentui-publish/index.ts +++ b/scripts/fluentui-publish/index.ts @@ -3,9 +3,9 @@ import * as path from 'path'; import * as fs from 'fs'; import { argv } from 'yargs'; -import { findGitRoot } from '../monorepo/index'; +import { findGitRoot, PackageJson } from '../monorepo'; -export function fluentuiLernaPublish(bumpType, skipConfirm = false, npmTagForCanary = 'beta') { +function fluentuiLernaPublish(bumpType: 'patch' | 'minor' | 'canary', skipConfirm = false, npmTagForCanary = 'beta') { const gitRoot = findGitRoot(); const fluentRoot = path.resolve(gitRoot, 'packages', 'fluentui'); @@ -91,7 +91,7 @@ const execCommandSync = (cwd: string, command: string, args: string[]) => { return result.stdout; }; -export function fluentuiPostPublishValidation() { +function fluentuiPostPublishValidation() { const gitRoot = findGitRoot(); const branch = execCommandSync(gitRoot, 'git', ['branch', '--show-current']); @@ -112,19 +112,19 @@ export function fluentuiPostPublishValidation() { } // pack all public fluent ui packages, used by ci to store nightly built artifacts -export function packFluentTarballs() { +function packFluentTarballs() { const gitRoot = findGitRoot(); const fluentRoot = path.resolve(findGitRoot(), 'packages', 'fluentui'); const TODAY = new Date().toISOString().split('T')[0]; // yyyy-mm-dd - const fluentPackages = JSON.parse( + const fluentPackages: Array<{ name: string; private?: boolean; location: string }> = JSON.parse( execCommandSync(fluentRoot, '../../node_modules/.bin/lerna', ['ls', '--json']).toString(), ); const fluentPackagesNames = fluentPackages.map(pkg => pkg.name); - const replaceDepVersionWithNightlyUrl = packageLocation => { - const packageJson = require(`${packageLocation}/package.json`); + const replaceDepVersionWithNightlyUrl = (packageLocation: string) => { + const packageJson: PackageJson = require(`${packageLocation}/package.json`); packageJson.version = `0.0.0-nightly+${TODAY}`; const dependencies = packageJson.dependencies || {}; @@ -161,6 +161,9 @@ export function packFluentTarballs() { execCommandSync(gitRoot, 'git', ['checkout', '-f']); } +/** + * publish CLI for @fluentui/react-northstar + */ function run() { const task = argv._[0]; const skipConfirm = !!argv['yes']; diff --git a/scripts/fluentui-publish/tsconfig.json b/scripts/fluentui-publish/tsconfig.json new file mode 100644 index 00000000000000..5bfe3e6eb1b7cc --- /dev/null +++ b/scripts/fluentui-publish/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.scripts.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["**/*.ts"] +} diff --git a/scripts/github/constants.ts b/scripts/github/constants.ts index 103544c1d91cd0..c02da384509cc6 100644 --- a/scripts/github/constants.ts +++ b/scripts/github/constants.ts @@ -1,4 +1,4 @@ -import { IRepoDetails } from './types'; +import type { IRepoDetails } from './types'; export const fluentRepoDetails: IRepoDetails = { owner: 'microsoft', diff --git a/scripts/github/pullRequests.ts b/scripts/github/pullRequests.ts index e8d301441bf472..5080cf4a40541a 100644 --- a/scripts/github/pullRequests.ts +++ b/scripts/github/pullRequests.ts @@ -1,5 +1,5 @@ -import { Octokit } from '@octokit/rest'; -import { IPullRequest, IRepoDetails } from './types'; +import type { Octokit } from '@octokit/rest'; +import type { IPullRequest, IRepoDetails } from './types'; export interface IGetPullRequestFromCommitParams { github: Octokit; diff --git a/scripts/github/tsconfig.json b/scripts/github/tsconfig.json new file mode 100644 index 00000000000000..5bfe3e6eb1b7cc --- /dev/null +++ b/scripts/github/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.scripts.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["**/*.ts"] +} diff --git a/scripts/gulp/plugins/gulp-component-menu-behaviors.ts b/scripts/gulp/plugins/gulp-component-menu-behaviors.ts index 6e0dcef06f0053..c00e4dbcee381d 100644 --- a/scripts/gulp/plugins/gulp-component-menu-behaviors.ts +++ b/scripts/gulp/plugins/gulp-component-menu-behaviors.ts @@ -1,6 +1,6 @@ import gutil from 'gulp-util'; import path from 'path'; -import through2 from 'through2'; +import through2, { TransformFunction } from 'through2'; import Vinyl from 'vinyl'; import _ from 'lodash'; import fs from 'fs'; @@ -11,7 +11,16 @@ import config from '../../config'; const { paths } = config; const pluginName = 'gulp-component-menu-behaviors'; -const extract = require('extract-comments'); +const extract: ( + value: string, + options?: Record, +) => Array<{ + type: string; + raw: string; + value: string; + loc: Record; + code: Record; +}> = require('extract-comments'); type BehaviorMenuItem = { displayName: string; @@ -23,14 +32,14 @@ type BehaviorMenuItem = { }; }; -const getTextFromCommentToken = (commentTokens, tokenTitle): string => { +const getTextFromCommentToken = (commentTokens: doctrine.Tag[], tokenTitle: string): string => { const resultToken = commentTokens.find(token => token.title === tokenTitle); - return resultToken ? resultToken.description : ''; + return resultToken?.description ?? ''; }; export default () => { const result: BehaviorMenuItem[] = []; - function bufferContents(this: Transform, file, enc, cb) { + const bufferContents: TransformFunction = function (file, enc, cb) { if (file.isNull()) { cb(null, file); return; @@ -72,7 +81,7 @@ export default () => { ); // delete require cache only works for absolute file path. This is required to get latest changes in behaviors for watch process delete require.cache[absPathToBehaviorDefinition]; - let definition; + let definition: any[] | undefined; try { // behavior definition file may not exist for components that haven't migrate to using a11y-testing definition = require(absPathToBehaviorDefinition)?.[definitionName]; @@ -115,7 +124,7 @@ export default () => { ].join('\n\n'); this.emit('error', pluginError); } - } + }; function getParsedResults() { return _.chain(result) @@ -128,7 +137,7 @@ export default () => { .value(); } - function endStream(this: Transform, cb) { + function endStream(this: Transform, cb: () => void) { const file = new Vinyl({ path: './behaviorMenu.json', contents: Buffer.from(JSON.stringify(getParsedResults(), null, 2)), diff --git a/scripts/gulp/plugins/gulp-cypress.ts b/scripts/gulp/plugins/gulp-cypress.ts index 5c1d1f844d5763..3ec2b136d1ffc9 100644 --- a/scripts/gulp/plugins/gulp-cypress.ts +++ b/scripts/gulp/plugins/gulp-cypress.ts @@ -6,7 +6,7 @@ export type CypressPluginConfig = { testNamePattern?: string; }; -const cypress = (config: CypressPluginConfig) => cb => { +const cypress = (config: CypressPluginConfig) => (cb: () => void) => { process.env.NODE_ENV = 'test'; process.env.CI = process.env.TF_BUILD ? 'true' : undefined; diff --git a/scripts/gulp/plugins/gulp-example-menu.ts b/scripts/gulp/plugins/gulp-example-menu.ts index fa9bbe78a98af4..0d725362da2640 100644 --- a/scripts/gulp/plugins/gulp-example-menu.ts +++ b/scripts/gulp/plugins/gulp-example-menu.ts @@ -2,7 +2,7 @@ import gutil from 'gulp-util'; import _ from 'lodash'; import path from 'path'; import { Transform } from 'stream'; -import through2 from 'through2'; +import through2, { FlushCallback, TransformFunction } from 'through2'; import Vinyl from 'vinyl'; import { parseDocSection } from './util'; @@ -19,7 +19,7 @@ const SECTION_ORDER = { Performance: 11, }; -const getSectionOrder = sectionName => +const getSectionOrder = (sectionName: string) => _.find(SECTION_ORDER, (val, key) => _.includes(sectionName, key)) || SECTION_ORDER.DEFAULT_ORDER; const pluginName = 'gulp-example-menu'; @@ -37,7 +37,7 @@ export default () => { > > = {}; - function bufferContents(this: Transform, file, enc, cb) { + const bufferContents: TransformFunction = function (file, enc, cb) { if (file.isNull()) { cb(null, file); return; @@ -75,9 +75,9 @@ export default () => { ].join('\n\n'); this.emit('error', pluginError); } - } + }; - function endStream(this: Transform, cb) { + const endStream: FlushCallback = function (cb) { _.forEach(exampleFilesByDisplayName, (contents, displayName) => { const sortedContents = _.sortBy(contents, ['order', 'sectionName']).map(({ sectionName, examples }) => ({ sectionName, @@ -93,7 +93,7 @@ export default () => { }); cb(); - } + }; return through2.obj(bufferContents, endStream); }; diff --git a/scripts/gulp/plugins/gulp-example-source.ts b/scripts/gulp/plugins/gulp-example-source.ts index d27b93d669a900..2e4660d5251118 100644 --- a/scripts/gulp/plugins/gulp-example-source.ts +++ b/scripts/gulp/plugins/gulp-example-source.ts @@ -17,7 +17,7 @@ const ESLint = new CLIEngine({ const pluginName = 'gulp-example-source'; const createExampleSourceCode = (file: Vinyl): ExampleSource => { - const tsSource = file.contents.toString(); + const tsSource = file.contents?.toString() ?? ''; const babelResult = Babel.transform(tsSource, { // This plugin transforms TS files for docs, we want to apply exactly this config. @@ -26,7 +26,7 @@ const createExampleSourceCode = (file: Vinyl): ExampleSource => { presets: [['@babel/preset-typescript', { allExtensions: true, isTSX: true }]], sourceType: 'module', }); - const prettierResult = prettier.format(babelResult.code, { + const prettierResult = prettier.format(babelResult?.code ?? '', { ...prettierConfig, trailingComma: 'all', printWidth: 100, diff --git a/scripts/gulp/plugins/gulp-jest.ts b/scripts/gulp/plugins/gulp-jest.ts index 84c3eb1fb91850..5f8eaf72c3acde 100644 --- a/scripts/gulp/plugins/gulp-jest.ts +++ b/scripts/gulp/plugins/gulp-jest.ts @@ -13,7 +13,7 @@ export type JestPluginConfig = { watchAll?: boolean; }; -const jest = (config: JestPluginConfig) => cb => { +const jest = (config: JestPluginConfig) => () => { process.env.NODE_ENV = 'test'; // Alias env variables as Azure Pipelines do not set it process.env.CI = process.env.TF_BUILD ? 'true' : undefined; diff --git a/scripts/gulp/plugins/gulp-webpack.ts b/scripts/gulp/plugins/gulp-webpack.ts index 42058854dff024..6f02fb0baad0b2 100644 --- a/scripts/gulp/plugins/gulp-webpack.ts +++ b/scripts/gulp/plugins/gulp-webpack.ts @@ -6,12 +6,12 @@ const { __DEV__, __SKIP_ERRORS__ } = config.compiler_globals; const DEV_SKIP_ERRORS = __DEV__ && __SKIP_ERRORS__; -const webpackPlugin = (webpackConfig, cb, onComplete = (err: any, stats: any) => {}) => { +const webpackPlugin = (webpackConfig: any, cb: (errror?: any) => void, onComplete = (err: any, stats: any) => {}) => { webpack(webpackConfig).run((err, stats) => { - const { errors, warnings } = stats.toJson(); + const { errors = [], warnings = [] } = stats?.toJson() ?? {}; onComplete(err, stats); - log(stats.toString(config.compiler_stats)); + log(stats?.toString(config.compiler_stats)); if (err) { log('Webpack compiler encountered a fatal error.'); diff --git a/scripts/gulp/plugins/util/docgen.ts b/scripts/gulp/plugins/util/docgen.ts index 0e4c0f08b1036a..2ffee27791734b 100644 --- a/scripts/gulp/plugins/util/docgen.ts +++ b/scripts/gulp/plugins/util/docgen.ts @@ -200,7 +200,7 @@ const defaultJSDoc: JSDoc = { tags: {}, }; -const defaultPropFilter = (prop, component) => { +const defaultPropFilter: PropFilter = (prop, component) => { // skip children property in case it has no custom documentation if (prop.name === 'children' && prop.description.length === 0) { return false; @@ -208,7 +208,7 @@ const defaultPropFilter = (prop, component) => { return true; }; -const getComponentSymbolOfType = (type: MaybeIntersectType) => { +const getComponentSymbolOfType = (type: MaybeIntersectType): ts.Symbol | undefined => { if (type.symbol) { const symbolName = type.symbol.getName(); if (reactComponentSymbolNames.indexOf(symbolName) !== -1) { @@ -357,7 +357,8 @@ export class Parser { return type.type === 'StringLiteral' || type.type === 'NumberLiteral' || type.type === 'BooleanLiteral'; } - private customResolveTypeOverride(typeNode, name): ResolvedType | undefined { + private customResolveTypeOverride(typeNode: ts.Type, name: string): ResolvedType | undefined { + // @ts-expect-error ts.Type has no parent property ? ts definition BUG ? if (typeNode?.symbol?.parent?.getEscapedName?.() === 'React') { const symbolName = typeNode.symbol.getEscapedName?.(); if (symbolName === 'ReactElement') { @@ -397,7 +398,7 @@ export class Parser { return undefined; } - private resolveType(typeNode, depth = 0): ResolvedType { + private resolveType(typeNode: ts.Type, depth = 0): ResolvedType { const name = this.checker.typeToString(typeNode); const customType = this.customResolveTypeOverride(typeNode, name); @@ -447,13 +448,21 @@ export class Parser { [TypeFlags.Number]: () => ({ type: 'number', name }), [TypeFlags.Boolean]: () => ({ type: 'boolean', name }), [TypeFlags.Enum]: () => ({ type: 'enum', name }), // FIXME - [TypeFlags.StringLiteral]: () => ({ type: 'StringLiteral', name, value: typeNode.value }), - [TypeFlags.NumberLiteral]: () => ({ type: 'NumberLiteral', name, value: typeNode.value }), + [TypeFlags.StringLiteral]: () => ({ + type: 'StringLiteral', + name, + value: (typeNode as ts.StringLiteralType).value, + }), + [TypeFlags.NumberLiteral]: () => ({ + type: 'NumberLiteral', + name, + value: (typeNode as ts.NumberLiteralType).value, + }), [TypeFlags.BooleanLiteral]: () => ({ type: 'BooleanLiteral', name, value: name === 'true' }), }; - if (typeMap[typeNode.flags]) { - return typeMap[typeNode.flags](); + if (typeMap[typeNode.flags as keyof typeof typeMap]) { + return typeMap[typeNode.flags as keyof typeof typeMap](); } else if (typeNode.isIntersection()) { return { type: 'intersection', @@ -461,12 +470,12 @@ export class Parser { name, } as RTIntersection; } else if (typeNode.isUnion()) { - const subTypes: any[] = typeNode.types.map(childTypeNode => this.resolveType(childTypeNode, depth + 1)); + const subTypes = typeNode.types.map(childTypeNode => this.resolveType(childTypeNode, depth + 1)); const allSubTypesAreLiterals = subTypes.filter(Parser.isLiteral).length === subTypes.length; // Convert union to enum if (allSubTypesAreLiterals) { - return subTypes.map(st => ({ name: 'literal', value: st.value, label: st.name })) as any; + return (subTypes as RTLiteral[]).map(st => ({ name: 'literal', value: st.value, label: st.name })) as any; } // Merge boolean literals to boolean type @@ -514,7 +523,7 @@ export class Parser { const jsDocComment = this.findDocComment(prop); - let defaultValue: any = null; + let defaultValue = null; if (defaultProps[propName] !== undefined) { defaultValue = { value: defaultProps[propName] }; diff --git a/scripts/gulp/plugins/util/docs-types.ts b/scripts/gulp/plugins/util/docs-types.ts index 13344e1af00631..816874a5cfeb3d 100644 --- a/scripts/gulp/plugins/util/docs-types.ts +++ b/scripts/gulp/plugins/util/docs-types.ts @@ -1,4 +1,4 @@ -import { Type } from 'doctrine'; +import { Tag } from 'doctrine'; // Temporary copy from packages/fluentui/docs/src/types.ts // TODO: move types to shared location @@ -31,7 +31,7 @@ export type ComponentInfo = { filenameWithoutExt: string; docblock: { description: string; - tags: { description: string; title: string }[]; + tags: Tag[]; }; apiPath: string; isChild: boolean; @@ -48,12 +48,7 @@ export type ComponentProp = { defaultValue: any; description: string; name: string; - tags: { - title: string; - description: string; - type?: Type | null; - name?: string; - }[]; + tags: Tag[]; types: ComponentPropType[]; required: boolean; resolvedType?: any; diff --git a/scripts/gulp/plugins/util/getComponentInfo.ts b/scripts/gulp/plugins/util/getComponentInfo.ts index 9b66bce42d016d..87b7f89563ac56 100644 --- a/scripts/gulp/plugins/util/getComponentInfo.ts +++ b/scripts/gulp/plugins/util/getComponentInfo.ts @@ -11,6 +11,7 @@ import parseDocblock from './parseDocblock'; import parseType from './parseType'; import getShorthandInfo from './getShorthandInfo'; import { getProgram, loadFiles } from './tsLanguageService'; +import { Program } from 'typescript'; export type GetComponentInfoOptions = { /** Path to the file containing a single component. */ @@ -55,7 +56,7 @@ export default function getComponentInfo(options: GetComponentInfoOptions): Comp loadFiles([filePath]); - const components = docgen.parseWithProgramProvider(absPath, {}, {}, () => getProgram(tsconfigPath)); + const components = docgen.parseWithProgramProvider(absPath, {}, {}, () => getProgram(tsconfigPath) as Program); if (!components.length) { throw new Error(`Could not find a component definition in "${filePath}".`); diff --git a/scripts/gulp/plugins/util/getShorthandInfo.ts b/scripts/gulp/plugins/util/getShorthandInfo.ts index fc3cdae21c8f98..4990447290a6da 100644 --- a/scripts/gulp/plugins/util/getShorthandInfo.ts +++ b/scripts/gulp/plugins/util/getShorthandInfo.ts @@ -50,7 +50,7 @@ const isShorthandExpression = (componentName: string, path: NodePath): path is NodePath { +function isCompose(path: NodePath): path is NodePath { if (path.isCallExpression()) { if (path.get('callee').isIdentifier({ name: 'compose' })) { return true; diff --git a/scripts/gulp/plugins/util/parseBuffer.ts b/scripts/gulp/plugins/util/parseBuffer.ts index 5fc78358b947b6..dbb646f13f06b4 100644 --- a/scripts/gulp/plugins/util/parseBuffer.ts +++ b/scripts/gulp/plugins/util/parseBuffer.ts @@ -1,6 +1,6 @@ import { parse } from '@babel/parser'; -const parseBuffer = buffer => +const parseBuffer = (buffer: Buffer) => parse(buffer.toString(), { plugins: ['classProperties', 'jsx'], sourceType: 'module', diff --git a/scripts/gulp/plugins/util/parseDocSection.ts b/scripts/gulp/plugins/util/parseDocSection.ts index ee19b70c0494af..997c5057d8ba07 100644 --- a/scripts/gulp/plugins/util/parseDocSection.ts +++ b/scripts/gulp/plugins/util/parseDocSection.ts @@ -1,15 +1,17 @@ import * as _ from 'lodash'; -import traverse from '@babel/traverse'; +import traverse, { NodePath } from '@babel/traverse'; import parseBuffer from './parseBuffer'; +import { JSXOpeningElement } from '@babel/types'; -const getJSXAttributes = jsxPath => +const getJSXAttributes = (jsxPath: NodePath) => _.map(_.get(jsxPath, 'node.attributes'), attr => ({ name: _.get(attr, 'name.name'), value: _.get(attr, 'value.value'), })); -const getAttributeValue = (attributes, name) => _.get(_.find(attributes, { name }), 'value'); +const getAttributeValue = (attributes: ReturnType, name: string) => + _.get(_.find(attributes, { name }), 'value'); type Example = { title: string; @@ -21,7 +23,7 @@ type Example = { * * @param buffer - The content of a view */ -const parseDocSection = (buffer: any): { examples: Example[]; sectionName: string } => { +const parseDocSection = (buffer: Buffer): { examples: Example[]; sectionName: string } => { const ast = parseBuffer(buffer); const examples: Example[] = []; let sectionName: string; @@ -45,7 +47,7 @@ const parseDocSection = (buffer: any): { examples: Example[]; sectionName: strin }, }); - return { examples, sectionName }; + return { examples, sectionName: sectionName! }; }; export default parseDocSection; diff --git a/scripts/gulp/plugins/util/tsLanguageService.ts b/scripts/gulp/plugins/util/tsLanguageService.ts index c729f02afc5797..a5f2c1d558cce6 100644 --- a/scripts/gulp/plugins/util/tsLanguageService.ts +++ b/scripts/gulp/plugins/util/tsLanguageService.ts @@ -64,7 +64,7 @@ export function getProgram(tsconfigPath: string) { services.set(tsconfigPath, ts.createLanguageService(servicesHost, ts.createDocumentRegistry())); } - return services.get(tsconfigPath).getProgram(); + return services.get(tsconfigPath)?.getProgram(); } export function loadFiles(filesToLoad: string[]): void { diff --git a/scripts/gulp/tasks/browserAdapters.ts b/scripts/gulp/tasks/browserAdapters.ts index d1376ed1302d22..b9390bd4d6d21a 100644 --- a/scripts/gulp/tasks/browserAdapters.ts +++ b/scripts/gulp/tasks/browserAdapters.ts @@ -18,7 +18,7 @@ export type Browser = { export async function createChrome(): Promise { const options = safeLaunchOptions(); - let browser: puppeteer.Browser; + let browser: puppeteer.Browser | undefined; let attempt = 1; while (!browser) { try { @@ -38,7 +38,7 @@ export async function createChrome(): Promise { return { openPage: async url => { - const page = await browser.newPage(); + const page = await (browser as puppeteer.Browser).newPage(); await page.goto(url); @@ -49,11 +49,11 @@ export async function createChrome(): Promise { close: async () => page.close(), }; }, - close: async () => browser.close(), + close: async () => (browser as puppeteer.Browser).close(), }; } -async function checkDevtoolsAvailability(host, port, timeout): Promise { +async function checkDevtoolsAvailability(host: string, port: number, timeout: number): Promise { const promise = new Promise((resolve, reject) => { const socket = new net.Socket(); @@ -108,7 +108,7 @@ export async function createElectron(electronPath: string): Promise { return { openPage: async url => { const electronProcess = spawn(electronPath, [`--remote-debugging-port=${devtoolsPort}`]); - let cdp; + let cdp: CDP.Client; try { await waitUntilDevtoolsAvailable('localhost', devtoolsPort); @@ -118,6 +118,7 @@ export async function createElectron(electronPath: string): Promise { await cdp.Runtime.enable(); await cdp.Page.navigate({ url }); + // @ts-expect-error - we use 0.30.0 types with 0.28.2 package version so the API might have changed ? await cdp.Page.loadEventFired(); } catch (e) { electronProcess.kill('SIGKILL'); diff --git a/scripts/gulp/tasks/component-info.ts b/scripts/gulp/tasks/component-info.ts index 95b936a6bcf3fa..f6e3ac2fd3895f 100644 --- a/scripts/gulp/tasks/component-info.ts +++ b/scripts/gulp/tasks/component-info.ts @@ -20,24 +20,24 @@ const cacheNonCi: (...args: Parameters) => NodeJS.ReadWriteStream async function detectPaths() { const info = await readPkgUp(); - const componentsSrc = info.packageJson.gulp.componentInfo; + const componentsSrc = info?.packageJson.gulp.componentInfo; if (!componentsSrc) { throw new Error( - `There is no "gulp.componentInfo" section in "${info.path}". Please add it before running this task`, + `There is no "gulp.componentInfo" section in "${info?.path}". Please add it before running this task`, ); } return { componentsSrc, - outputPath: path.resolve(path.dirname(info.path), 'componentInfo'), + outputPath: path.resolve(path.dirname(info?.path ?? ''), 'componentInfo'), tsconfigPath: config.paths.docs('tsconfig.json'), }; } gulp.task('clean:component-info', async () => { const info = await readPkgUp(); - const outputPath = path.resolve(path.dirname(info.path), 'componentInfo'); + const outputPath = path.resolve(path.dirname(info?.path ?? ''), 'componentInfo'); return del([outputPath], { force: true }); }); diff --git a/scripts/gulp/tasks/docs.ts b/scripts/gulp/tasks/docs.ts index fe6c559d23072a..2c43f4f8d014ab 100644 --- a/scripts/gulp/tasks/docs.ts +++ b/scripts/gulp/tasks/docs.ts @@ -136,7 +136,7 @@ task('build:docs:assets:component:info', cb => { }); if (result.status) { - throw new Error(result.error.toString() || `lerna run failed with status ${result.status}`); + throw new Error(result.error?.toString() || `lerna run failed with status ${result.status}`); } cb(); @@ -205,7 +205,7 @@ task('serve:docs:hot', async () => { ); if (process.env.NODE_ENV !== 'production') { - app.use(WebpackHotMiddleware(compiler)); + app.use(WebpackHotMiddleware(compiler as any)); } return app; diff --git a/scripts/gulp/tasks/perf.ts b/scripts/gulp/tasks/perf.ts index c8acc23302f122..8bb4f933b1a5fc 100644 --- a/scripts/gulp/tasks/perf.ts +++ b/scripts/gulp/tasks/perf.ts @@ -1,5 +1,6 @@ import express from 'express'; import fs from 'fs'; +import type { Server } from 'http'; import { series, task } from 'gulp'; import { colors, log } from 'gulp-util'; import _ from 'lodash'; @@ -23,7 +24,7 @@ import { Browser, createChrome, createElectron } from './browserAdapters'; const { paths } = config; const DEFAULT_RUN_TIMES = 10; -let server; +let server: Server; const floor = (value: number) => _.floor(value, 2); @@ -72,7 +73,7 @@ const sumByExample = (measures: ProfilerMeasureCycle[]): PerExamplePerfMeasures return result; }, - {}, + {} as Record, ); return _.mapValues(perExampleMeasures, (profilerMeasures: ProfilerMeasure[]) => ({ diff --git a/scripts/gulp/tasks/stats.ts b/scripts/gulp/tasks/stats.ts index d83e150efa6d5b..22af7bd4e06c1a 100644 --- a/scripts/gulp/tasks/stats.ts +++ b/scripts/gulp/tasks/stats.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import { task, series } from 'gulp'; import { log, PluginError } from 'gulp-util'; import _ from 'lodash'; -import webpack from 'webpack'; +import webpack, { Configuration } from 'webpack'; import stableStringify from 'json-stable-stringify-without-jsonify'; import { argv } from 'yargs'; import requestHttp from 'request-promise-native'; @@ -14,7 +14,7 @@ const { paths } = config; const UNRELEASED_VERSION_STRING = 'Unreleased'; const SEMVER_MATCHER = /(\d+)\.(\d+)\.(\d+)/; -const semverCmp = (a, b) => { +const semverCmp = (a: { key: string }, b: { key: string }) => { const left = a.key; const right = b.key; @@ -45,12 +45,12 @@ const semverCmp = (a, b) => { return 0; }; -function webpackAsync(webpackConfig): Promise { +function webpackAsync(webpackConfig: Configuration): Promise { return new Promise((resolve, reject) => { const compiler = webpack(webpackConfig); compiler.run((err, stats) => { - const statsJson = stats.toJson(); - const { errors, warnings } = statsJson; + const statsJson = stats?.toJson(); + const { errors = [], warnings = [] } = statsJson || {}; if (err) { log('Webpack compiler encountered a fatal error.'); @@ -70,8 +70,8 @@ function webpackAsync(webpackConfig): Promise { }); } -async function compileOneByOne(allConfigs) { - let assets = []; +async function compileOneByOne(allConfigs: any[]) { + let assets: any[] = []; for (const webpackConfig of allConfigs) { log('Compiling', webpackConfig.output.filename); try { @@ -151,7 +151,7 @@ function readFlamegrillStats() { // -> use camelCase name (docsite perf examples convention) // -> and merge yarn perf (summaryPerf) and yarn perf:test (flamegrill) data // 3. the others are perf-test only examples -> store -function mergePerfStats(summaryPerfStats, perfTestStats) { +function mergePerfStats(summaryPerfStats: any, perfTestStats: any[]) { return _.transform( perfTestStats, (result, value, key: string) => { @@ -166,7 +166,7 @@ function mergePerfStats(summaryPerfStats, perfTestStats) { result[key.replace(/\./g, '_')] = { flamegrill }; // mongodb does not allow dots in keys } }, - {}, + {} as Record, ); } @@ -205,11 +205,14 @@ task('stats:save', async () => { }; // payload sanity check - _.forEach(['sha', 'branch', 'build', 'bundleSize', 'performance'], fieldName => { - if (statsPayload[fieldName] === undefined) { - throw `Required field '${fieldName}' not set in stats payload`; - } - }); + _.forEach( + ['sha', 'branch', 'build', 'bundleSize', 'performance'], + (fieldName: 'sha' | 'branch' | 'build' | 'bundleSize' | 'performance') => { + if (statsPayload[fieldName] === undefined) { + throw `Required field '${fieldName}' not set in stats payload`; + } + }, + ); const options = { method: 'POST', diff --git a/scripts/gulp/tasks/test-circulars/utils.ts b/scripts/gulp/tasks/test-circulars/utils.ts index 7f31a1ef3c36f4..765836badd1b50 100644 --- a/scripts/gulp/tasks/test-circulars/utils.ts +++ b/scripts/gulp/tasks/test-circulars/utils.ts @@ -3,7 +3,7 @@ import CircularDependencyPlugin from 'circular-dependency-plugin'; import config from '../../../config'; -export const isCycleToSkip = (proposedCycle, benignCycles) => { +export const isCycleToSkip = (proposedCycle: string[], benignCycles: string[][]) => { return benignCycles.some(benignCycle => { const fullBenignCycle = [...benignCycle, ...benignCycle]; return fullBenignCycle.join(',').indexOf(proposedCycle.join(',')) >= 0; diff --git a/scripts/gulp/tasks/test-dependencies/utils.ts b/scripts/gulp/tasks/test-dependencies/utils.ts index 2488c2acf807c7..1309eb5e765240 100644 --- a/scripts/gulp/tasks/test-dependencies/utils.ts +++ b/scripts/gulp/tasks/test-dependencies/utils.ts @@ -10,7 +10,7 @@ const { paths } = config; type WebpackOptions = { packageName: string; outputFilePath: string; - onDependencyPackage: (packageName: string, packageVersion) => void; + onDependencyPackage: (packageName: string, packageVersion: string) => void; }; export const prepareWebpackConfig = (options: WebpackOptions) => { diff --git a/scripts/gulp/tasks/vr-test.ts b/scripts/gulp/tasks/vr-test.ts index 9e99e85fda6182..5db5228f3d0d39 100644 --- a/scripts/gulp/tasks/vr-test.ts +++ b/scripts/gulp/tasks/vr-test.ts @@ -23,7 +23,7 @@ task('screener:runner', cb => { } // kill the server when done - const handlePromiseExit = promise => + const handlePromiseExit = (promise: Promise) => promise .then(() => { cb(); @@ -34,10 +34,12 @@ task('screener:runner', cb => { process.exit(1); }); + const envVariables = getEnvVariables('SCREENER_API_KEY', 'BUILD_SOURCEBRANCHNAME', 'DEPLOYURL'); + const screenerConfig = getConfig({ - screenerApiKey: process.env.SCREENER_API_KEY, - sourceBranchName: process.env.BUILD_SOURCEBRANCHNAME, - deployUrl: process.env.DEPLOYURL, + screenerApiKey: envVariables.SCREENER_API_KEY, + sourceBranchName: envVariables.BUILD_SOURCEBRANCHNAME, + deployUrl: envVariables.DEPLOYURL, }); const screenerStates = require(paths.docsDist('screenerStates.json')); @@ -45,3 +47,16 @@ task('screener:runner', cb => { handlePromiseExit(screenerRunner(screenerConfig)); }); + +function getEnvVariables(...values: T) { + return values.reduce((acc, value) => { + const envVarValue = process.env[value]; + if (!envVarValue) { + throw new Error(`Env variable: ${value} is not defined`); + } + + acc[value as T[number]] = envVarValue; + + return acc; + }, {} as Record); +} diff --git a/scripts/gulp/tsconfig.json b/scripts/gulp/tsconfig.json new file mode 100644 index 00000000000000..fea26284aff0ec --- /dev/null +++ b/scripts/gulp/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.scripts.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["**/*.ts"], + "files": ["../../typings/json-stable-stringify-without-jsonify/index.d.ts"] +} diff --git a/scripts/lernaAliasNorthstar.js b/scripts/lernaAliasNorthstar.js index 29cfb33ee22a79..79eba860f0dc1b 100644 --- a/scripts/lernaAliasNorthstar.js +++ b/scripts/lernaAliasNorthstar.js @@ -3,7 +3,10 @@ const lernaAlias = require('lerna-alias'); // northstar packages should pull these from npm, not the repo const excludedPackages = ['@fluentui/date-time-utilities', '@fluentui/dom-utilities']; -module.exports = { +/** + * @type {typeof lernaAlias} + */ +const api = { jest: options => { const aliases = lernaAlias.jest(options); for (const pkg of excludedPackages) { @@ -26,3 +29,5 @@ module.exports = { return aliases; }, }; + +module.exports = api; diff --git a/scripts/monorepo/index.d.ts b/scripts/monorepo/index.d.ts index 04ff833a6fe6fc..018f9adba14b6c 100644 --- a/scripts/monorepo/index.d.ts +++ b/scripts/monorepo/index.d.ts @@ -1,6 +1,7 @@ export interface PackageJson { name: string; version: string; + private?: boolean; main: string; types?: string; module?: string; diff --git a/scripts/package.json b/scripts/package.json index 55451c0c07859f..ceaf5899221780 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -16,11 +16,6 @@ "@microsoft/loader-load-themed-styles": "^1.7.205", "@octokit/rest": "^16.28.2", "@types/babel__traverse": "^7.0.4", - "@types/gulp": "^4.0.6", - "@types/gulp-babel": "6.1.29", - "@types/gulp-cache": "^0.4.4", - "@types/gulp-remember": "^0.0.31", - "@types/gulp-util": "^3.0.34", "@types/inquirer": "^6.5.0", "@types/lerna-alias": "^3.0.0", "@types/lodash": "^4.14.149", @@ -29,42 +24,28 @@ "babel-plugin-annotate-pure-imports": "^1.0.0-1", "babel-plugin-iife-wrap-react-components": "^1.0.0-5", "babel-plugin-lodash": "^3.3.4", - "chrome-remote-interface": "^0.28.2", - "circular-dependency-plugin": "^5.0.2", "clean-css": "^4.2.3", "connect-history-api-fallback": "^1.3.0", "doctoc": "^2.0.1", "doctrine": "^3.0.0", "dotparser": "^1.0.0", - "extract-comments": "^1.0.0", "find-free-port": "~2.0.0", "graphviz": "^0.0.9", - "gulp": "^4.0.2", - "gulp-babel": "^8.0.0", - "gulp-cache": "^1.0.2", - "gulp-remember": "^1.0.1", - "gulp-sourcemaps": "^2.6.5", - "gulp-util": "^3.0.8", "inquirer": "^7.3.3", - "json-stable-stringify-without-jsonify": "^1.0.1", "lerna-alias": "^3.0.3-0", "lerna-dependency-graph": "^1.0.2", "license-webpack-plugin": "^2.3.10", - "markdown-table": "^2.0.0", "node-plop": "^0.25.0", "node-polyfill-webpack-plugin": "^1.0.2", "p-queue": "^6.0.2", "path-browserify": "^1.0.1", "plop": "^2.6.0", - "progress": "^2.0.3", "prompts": "^2.3.0", "react-hot-loader": "^4.13.0", "react-vis": "^1.11.6", "read-pkg-up": "^7.0.1", "replace-in-file": "^6.1.0", - "request-promise-native": "^1.0.5", "resolve": "^1.7.1", - "riceburn": "^1.3.1", - "through2": "^2.0.3" + "riceburn": "^1.3.1" } } diff --git a/scripts/prettier/prettier-helpers.js b/scripts/prettier/prettier-helpers.js index 44c75b95df0f40..f957a23d94e69e 100644 --- a/scripts/prettier/prettier-helpers.js +++ b/scripts/prettier/prettier-helpers.js @@ -1,4 +1,3 @@ -// @ts-check const path = require('path'); const fs = require('fs'); const { spawn, spawnSync } = require('child_process'); diff --git a/scripts/prettier/tsconfig.json b/scripts/prettier/tsconfig.json new file mode 100644 index 00000000000000..1401d82c3b0855 --- /dev/null +++ b/scripts/prettier/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.scripts.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["**/*.js"] +} diff --git a/scripts/projects-test/performBrowserTest.ts b/scripts/projects-test/performBrowserTest.ts index 0b19cd98208986..f430609af9a831 100644 --- a/scripts/projects-test/performBrowserTest.ts +++ b/scripts/projects-test/performBrowserTest.ts @@ -30,7 +30,7 @@ export async function performBrowserTest(publicDirectory: string) { console.log('Started server. Launching Puppeteer...'); const options = safeLaunchOptions(); - let browser: puppeteer.Browser; + let browser: puppeteer.Browser | undefined; let attempt = 1; while (!browser) { try { diff --git a/scripts/projects-test/tsconfig.json b/scripts/projects-test/tsconfig.json new file mode 100644 index 00000000000000..5bfe3e6eb1b7cc --- /dev/null +++ b/scripts/projects-test/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.scripts.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["**/*.ts"] +} diff --git a/scripts/puppeteer/puppeteer.config.ts b/scripts/puppeteer/puppeteer.config.ts index b922dabd69ea53..51fbec818ad113 100644 --- a/scripts/puppeteer/puppeteer.config.ts +++ b/scripts/puppeteer/puppeteer.config.ts @@ -1,12 +1,12 @@ import { launch } from 'puppeteer'; -type LaunchOptions = Parameters[0]; +type LaunchOptions = NonNullable[0]>; /** Common set of args to be passed to Chromium. */ -const chromiumArgs: LaunchOptions['args'] = [ +const chromiumArgs = [ // Workaround for newPage hang in CircleCI: https://github.com/GoogleChrome/puppeteer/issues/1409#issuecomment-453845568 process.env.TF_BUILD && '--single-process', -].filter(Boolean); +].filter(Boolean) as NonNullable; export const safeLaunchOptions = (launchOptions?: LaunchOptions): LaunchOptions => { const mergedChromiumArgs = [...((launchOptions && launchOptions.args) || []), ...chromiumArgs]; diff --git a/scripts/puppeteer/tsconfig.json b/scripts/puppeteer/tsconfig.json new file mode 100644 index 00000000000000..0c85a908fa4a5a --- /dev/null +++ b/scripts/puppeteer/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.scripts.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["*"] +} diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 9c7f59481d9ee4..c3e2c670dc5749 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -10,5 +10,19 @@ "types": ["node", "jest"] }, "include": ["."], - "exclude": ["node_modules", "./cypress/**", "./storybook/**", "./monorepo/**", "./beachball/**"] + "exclude": [ + "node_modules", + "./cypress/**", + "./storybook/**", + "./monorepo/**", + "./beachball/**", + "./dangerjs/**", + "./github/**", + "./gulp/**", + "./projects-test/**", + "./update-release-notes/**", + "./prettier/**", + "./fluentui-publish/**", + "./puppeteer/**" + ] } diff --git a/scripts/tsconfig.scripts.json b/scripts/tsconfig.scripts.json index 94d5b73b751389..4472551b4a6ebd 100644 --- a/scripts/tsconfig.scripts.json +++ b/scripts/tsconfig.scripts.json @@ -1,6 +1,7 @@ { "extends": "@tsconfig/node14/tsconfig.json", "compilerOptions": { + "pretty": true, "noEmit": true, "allowJs": true, "checkJs": true, @@ -25,6 +26,30 @@ { "path": "./screener/tsconfig.json" }, + { + "path": "./github/tsconfig.json" + }, + { + "path": "./puppeteer/tsconfig.json" + }, + { + "path": "./gulp/tsconfig.json" + }, + { + "path": "./dangerjs/tsconfig.json" + }, + { + "path": "./projects-test/tsconfig.json" + }, + { + "path": "./update-release-notes/tsconfig.json" + }, + { + "path": "./prettier/tsconfig.json" + }, + { + "path": "./fluentui-publish/tsconfig.json" + }, { "path": "./tsconfig.json" } diff --git a/scripts/updateReleaseNotes/changelogsAndTags.ts b/scripts/update-release-notes/changelogsAndTags.ts similarity index 100% rename from scripts/updateReleaseNotes/changelogsAndTags.ts rename to scripts/update-release-notes/changelogsAndTags.ts diff --git a/scripts/updateReleaseNotes/index.ts b/scripts/update-release-notes/index.ts similarity index 100% rename from scripts/updateReleaseNotes/index.ts rename to scripts/update-release-notes/index.ts diff --git a/scripts/updateReleaseNotes/init.ts b/scripts/update-release-notes/init.ts similarity index 97% rename from scripts/updateReleaseNotes/init.ts rename to scripts/update-release-notes/init.ts index 28e14ad8499638..0866b18b2dcee1 100644 --- a/scripts/updateReleaseNotes/init.ts +++ b/scripts/update-release-notes/init.ts @@ -1,6 +1,6 @@ import { Octokit } from '@octokit/rest'; import * as yargs from 'yargs'; -import { fluentRepoDetails } from '../github/index'; +import { fluentRepoDetails } from '../github'; const tokenMsg = '\nA GitHub personal access token is required even for dry runs due to the potential high rate of requests.\n' + diff --git a/scripts/updateReleaseNotes/markdown.ts b/scripts/update-release-notes/markdown.ts similarity index 100% rename from scripts/updateReleaseNotes/markdown.ts rename to scripts/update-release-notes/markdown.ts diff --git a/scripts/updateReleaseNotes/pullRequests.ts b/scripts/update-release-notes/pullRequests.ts similarity index 99% rename from scripts/updateReleaseNotes/pullRequests.ts rename to scripts/update-release-notes/pullRequests.ts index 58bc543d7c49af..0bf6e834559474 100644 --- a/scripts/updateReleaseNotes/pullRequests.ts +++ b/scripts/update-release-notes/pullRequests.ts @@ -1,6 +1,6 @@ import { Octokit } from '@octokit/rest'; import { ChangelogEntry } from 'beachball'; -import { IPullRequest, processPullRequestApiResponse, getPullRequestForCommit } from '../github/index'; +import { IPullRequest, processPullRequestApiResponse, getPullRequestForCommit } from '../github'; import { repoDetails, github } from './init'; import { IExtendedPullRequest } from './types'; diff --git a/scripts/updateReleaseNotes/releases.ts b/scripts/update-release-notes/releases.ts similarity index 100% rename from scripts/updateReleaseNotes/releases.ts rename to scripts/update-release-notes/releases.ts diff --git a/scripts/update-release-notes/tsconfig.json b/scripts/update-release-notes/tsconfig.json new file mode 100644 index 00000000000000..5bfe3e6eb1b7cc --- /dev/null +++ b/scripts/update-release-notes/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.scripts.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["**/*.ts"] +} diff --git a/scripts/updateReleaseNotes/types.ts b/scripts/update-release-notes/types.ts similarity index 100% rename from scripts/updateReleaseNotes/types.ts rename to scripts/update-release-notes/types.ts diff --git a/typings/ignore-not-found-export-webpack-plugin/index.d.ts b/typings/ignore-not-found-export-webpack-plugin/index.d.ts index 8ee7a6977e3ae9..626480503286e4 100644 --- a/typings/ignore-not-found-export-webpack-plugin/index.d.ts +++ b/typings/ignore-not-found-export-webpack-plugin/index.d.ts @@ -1,10 +1,12 @@ -// Type definitions extension for ignore-not-found-export-webpack-plugin 1.0.3 +// Type definitions for ignore-not-found-export-webpack-plugin 1.0.2 + declare module 'ignore-not-found-export-webpack-plugin' { - export interface Options { + import type { Compiler } from 'webpack'; + interface Options { include: RegExp | RegExp[]; } - declare class IgnoreNotFoundExportWebpackPlugin { + class IgnoreNotFoundExportWebpackPlugin { constructor(options?: Options); apply(compiler: Compiler): void; } diff --git a/typings/ignore-not-found-export-webpack-plugin/tsconfig.json b/typings/ignore-not-found-export-webpack-plugin/tsconfig.json index c6f8b0a935c4c2..286df647b99ff9 100644 --- a/typings/ignore-not-found-export-webpack-plugin/tsconfig.json +++ b/typings/ignore-not-found-export-webpack-plugin/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "../tsconfig.json", - "compilerOptions": {}, + "compilerOptions": { + "types": ["node"] + }, "include": ["*.d.ts"] } diff --git a/typings/json-stable-stringify-without-jsonify/index.d.ts b/typings/json-stable-stringify-without-jsonify/index.d.ts new file mode 100644 index 00000000000000..2541e43c77a223 --- /dev/null +++ b/typings/json-stable-stringify-without-jsonify/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for json-stable-stringify-without-jsonify 1.0.1 + +declare module 'json-stable-stringify-without-jsonify' { + function stringify(value: Record, options?: Partial): Record; + + interface Options { + cmp: (a: any, b: any) => any; + space: number; + replacer: (key: string, value: any) => any; + } + export = stringify; +} diff --git a/typings/json-stable-stringify-without-jsonify/tsconfig.json b/typings/json-stable-stringify-without-jsonify/tsconfig.json new file mode 100644 index 00000000000000..c6f8b0a935c4c2 --- /dev/null +++ b/typings/json-stable-stringify-without-jsonify/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": {}, + "include": ["*.d.ts"] +} diff --git a/typings/tsconfig.json b/typings/tsconfig.json index 5daeb2dd6ff6c3..7187a8f9e2b2ac 100644 --- a/typings/tsconfig.json +++ b/typings/tsconfig.json @@ -24,6 +24,9 @@ }, { "path": "./custom-global/tsconfig.json" + }, + { + "path": "./json-stable-stringify-without-jsonify/tsconfig.json" } ] } diff --git a/yarn.lock b/yarn.lock index df23a510368cab..a97976b4aea09a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5192,6 +5192,11 @@ "@types/node" "*" "@types/responselike" "*" +"@types/caseless@*": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8" + integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w== + "@types/chai-spies@^1.0.1": version "1.0.3" resolved "https://registry.yarnpkg.com/@types/chai-spies/-/chai-spies-1.0.3.tgz#a52dc61af3853ec9b80965040811d15dfd401542" @@ -5216,6 +5221,21 @@ dependencies: "@types/node" "*" +"@types/chrome-remote-interface@0.30.0": + version "0.30.0" + resolved "https://registry.yarnpkg.com/@types/chrome-remote-interface/-/chrome-remote-interface-0.30.0.tgz#ce24b626e7a807a71ca71cb37b330660a6c71083" + integrity sha512-j7LCipaiuft35hJqocb15a+zzL2/h3AaOnWlQin/SbVVj0i+I/dhgpJJmRsJFV6XtlkMyySI3WFOBvpYC7xhpg== + dependencies: + devtools-protocol "0.0.894172" + +"@types/circular-dependency-plugin@5.0.5": + version "5.0.5" + resolved "https://registry.yarnpkg.com/@types/circular-dependency-plugin/-/circular-dependency-plugin-5.0.5.tgz#431979052a11bdb192c2961cc4ae8b47ca24a38c" + integrity sha512-JU1sYQWNbUluWHseLUfokakx18+BXRA9Bxji56hdY5NW0nvrJSJd4SNAl0Btpm5ima9BnUkoGEcW/2PH1QuWQA== + dependencies: + "@types/node" "*" + webpack "^5.1.0" + "@types/classnames@^2.2.9": version "2.2.9" resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.9.tgz#d868b6febb02666330410fe7f58f3c4b8258be7b" @@ -5540,30 +5560,38 @@ dependencies: "@types/node" "*" -"@types/gulp-babel@6.1.29": - version "6.1.29" - resolved "https://registry.yarnpkg.com/@types/gulp-babel/-/gulp-babel-6.1.29.tgz#0e52ba5203da6ebf9b390220c0fc0c83c569873f" - integrity sha1-DlK6UgPabr+bOQIgwPwMg8Vphz8= +"@types/gulp-babel@6.1.30": + version "6.1.30" + resolved "https://registry.yarnpkg.com/@types/gulp-babel/-/gulp-babel-6.1.30.tgz#72220a2e72517bd2cf461fc6250849035ad58798" + integrity sha512-tMs5xeU3iZy0eXwMudKtLonhMrvZLj804lL68Sv+IofA9bReGWFukPYXxWVGWlw7vXdVloP10Fycs5ecrx+eMA== dependencies: "@types/node" "*" -"@types/gulp-cache@^0.4.4": - version "0.4.4" - resolved "https://registry.yarnpkg.com/@types/gulp-cache/-/gulp-cache-0.4.4.tgz#70a7b3a1baab3843083b5b25961c9a03c22f8e51" - integrity sha512-t6+AInr12rgL8S3wJjAcki85HnjCclUiGKW6kKxbIfOCIyYH5ygYYJutUsFfOIXMqjKkoW8xjxqy1tJ+J1YyYQ== +"@types/gulp-cache@0.4.5": + version "0.4.5" + resolved "https://registry.yarnpkg.com/@types/gulp-cache/-/gulp-cache-0.4.5.tgz#b9061b592cd96c7b46d4eeb0bc17a2618d8aeea4" + integrity sha512-VUG4CILSTCrL6VV+6ZD7jxZN4kWkmd74h+fAw1gq9+t8gtBEMUHMBICOmmkMAOM+itsQDOlZC3AzUeUAcLw07w== dependencies: "@types/gulp-util" "*" "@types/node" "*" "@types/vinyl" "*" -"@types/gulp-remember@^0.0.31": +"@types/gulp-remember@0.0.31": version "0.0.31" resolved "https://registry.yarnpkg.com/@types/gulp-remember/-/gulp-remember-0.0.31.tgz#9c610169409d132d75a73a6cb2dbbfd227a9152e" integrity sha512-pULOyv3Nr3TCIqbrr0ecTkFn5iIPRoQIkvljYMJUIdfwN8JPbEdMemzt2XOlvqJ6xj5cxCVgFqv5zkWjQ3AVZw== dependencies: "@types/node" "*" -"@types/gulp-util@*", "@types/gulp-util@^3.0.34": +"@types/gulp-sourcemaps@0.0.35": + version "0.0.35" + resolved "https://registry.yarnpkg.com/@types/gulp-sourcemaps/-/gulp-sourcemaps-0.0.35.tgz#0e3790b44fabe8f8fcd2bf29845aa1d2699940ef" + integrity sha512-vUBuizwA4CAV3Mke0DJYHQxyN4YOB1aAql284qAO7Et7fe0hmnPi/R9Fhu2UhxMuSxAwFktsJUOQk5dJHOU1eA== + dependencies: + "@types/node" "*" + "@types/vinyl" "*" + +"@types/gulp-util@*": version "3.0.34" resolved "https://registry.yarnpkg.com/@types/gulp-util/-/gulp-util-3.0.34.tgz#d1291ebf706d93f46eb8df11344bbfd96247697e" integrity sha512-E06WN1OfqL5UsMwJ1T7ClgnaXgaPipb7Ee8euMc3KRHLNqxdvWrDir9KA6uevgzBgT7XbjgmzZA2pkzDqBBX7A== @@ -5573,14 +5601,24 @@ "@types/vinyl" "*" chalk "^2.2.0" -"@types/gulp@^4.0.6": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@types/gulp/-/gulp-4.0.6.tgz#68fe0e1f0ff3657cfca46fb564806b744a1bf899" - integrity sha512-0E8/iV/7FKWyQWSmi7jnUvgXXgaw+pfAzEB06Xu+l0iXVJppLbpOye5z7E2klw5akXd+8kPtYuk65YBcZPM4ow== +"@types/gulp-util@3.0.36": + version "3.0.36" + resolved "https://registry.yarnpkg.com/@types/gulp-util/-/gulp-util-3.0.36.tgz#4645e967d375635a57bce1a495059b25a4080de7" + integrity sha512-hR3troWx2qr8Hx2xXSn0SijTG83WRPNgWS5/h0OtN4Eyqxi3KW1ptLp+zxnO8Z7DCZj0Ij5SSgYBHACMES4VCg== + dependencies: + "@types/node" "*" + "@types/through2" "*" + "@types/vinyl" "*" + chalk "^2.2.0" + +"@types/gulp@4.0.9": + version "4.0.9" + resolved "https://registry.yarnpkg.com/@types/gulp/-/gulp-4.0.9.tgz#a2f9667bcc26bc72b4899dd16216d6584a12346c" + integrity sha512-zzT+wfQ8uwoXjDhRK9Zkmmk09/fbLLmN/yDHFizJiEKIve85qutOnXcP/TM2sKPBTU+Jc16vfPbOMkORMUBN7Q== dependencies: "@types/undertaker" "*" "@types/vinyl-fs" "*" - chokidar "^2.1.2" + chokidar "^3.3.1" "@types/handlebars@^4.1.0": version "4.1.0" @@ -5740,6 +5778,11 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== +"@types/markdown-table@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/markdown-table/-/markdown-table-2.0.0.tgz#d2a3458c61ee71c8ee2b40b76c199b85b8dbd70c" + integrity sha512-fVZN/DRjZvjuk+lo7ovlI/ZycS51gpYU5vw5EcFeqkcX6lucQ+UWgEOH2O4KJHkSck4DHAY7D7CkVLD0wzc5qw== + "@types/mdast@^3.0.0": version "3.0.7" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.7.tgz#cba63d0cc11eb1605cea5c0ad76e02684394166b" @@ -5863,6 +5906,13 @@ resolved "https://registry.yarnpkg.com/@types/pretty-hrtime/-/pretty-hrtime-1.0.1.tgz#72a26101dc567b0d68fd956cf42314556e42d601" integrity sha512-VjID5MJb1eGKthz2qUerWT8+R4b9N+CHvGCzg9fn4kWZgaF9AhdYikQio3R7wV8YY1NsQKPaCwKz1Yff+aHNUQ== +"@types/progress@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@types/progress/-/progress-2.0.5.tgz#6e0febf3a82cc0ffdc1cebb4e56d6949fd108775" + integrity sha512-ZYYVc/kSMkhH9W/4dNK/sLNra3cnkfT2nJyOAIDY+C2u6w72wa0s1aXAezVtbTsnN8HID1uhXCrLwDE2ZXpplg== + dependencies: + "@types/node" "*" + "@types/prop-types@*", "@types/prop-types@15.7.1": version "15.7.1" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6" @@ -6028,6 +6078,23 @@ dependencies: read-pkg-up "*" +"@types/request-promise-native@1.0.18": + version "1.0.18" + resolved "https://registry.yarnpkg.com/@types/request-promise-native/-/request-promise-native-1.0.18.tgz#437ee2d0b772e01c9691a983b558084b4b3efc2c" + integrity sha512-tPnODeISFc/c1LjWyLuZUY+Z0uLB3+IMfNoQyDEi395+j6kTFTTRAqjENjoPJUid4vHRGEozoTrcTrfZM+AcbA== + dependencies: + "@types/request" "*" + +"@types/request@*": + version "2.48.8" + resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.8.tgz#0b90fde3b655ab50976cb8c5ac00faca22f5a82c" + integrity sha512-whjk1EDJPcAR2kYHRbFl/lKeeKYTi05A15K9bnLInCVroNDCtXce57xKdI0/rQaA3K+6q0eFyUBPmqfSndUZdQ== + dependencies: + "@types/caseless" "*" + "@types/node" "*" + "@types/tough-cookie" "*" + form-data "^2.5.0" + "@types/resolve@0.0.8": version "0.0.8" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" @@ -6145,6 +6212,11 @@ resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.0.tgz#e3f52b4d7397eaa9193592ef3fdd44dc0af4298c" integrity sha512-flgpHJjntpBAdJD43ShRosQvNC0ME97DCfGvZEDlAThQmnerRXrLbX6YgzRBQCZTthET9eAWFAMaYP0m0Y4HzQ== +"@types/tough-cookie@*": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397" + integrity sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw== + "@types/tunnel@^0.0.1": version "0.0.1" resolved "https://registry.yarnpkg.com/@types/tunnel/-/tunnel-0.0.1.tgz#0d72774768b73df26f25df9184273a42da72b19c" @@ -6206,6 +6278,15 @@ resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.16.0.tgz#8c0a9435dfa7b3b1be76562f3070efb3f92637b4" integrity sha512-Fx+NpfOO0CpeYX2g9bkvX8O5qh9wrU1sOF4g8sft4Mu7z+qfe387YlyY8w8daDyDsKY5vUxM0yxkAYnbkRbZEw== +"@types/webpack-hot-middleware@2.25.6": + version "2.25.6" + resolved "https://registry.yarnpkg.com/@types/webpack-hot-middleware/-/webpack-hot-middleware-2.25.6.tgz#4336abd668dc73284a777907cfd00147e794354a" + integrity sha512-1Q9ClNvZR30HIsEAHYQL3bXJK1K7IsrqjGMTfIureFjphsGOZ3TkbeoCupbCmi26pSLjVTPHp+pFrJNpOkBSVg== + dependencies: + "@types/connect" "*" + tapable "^2.2.0" + webpack "^5" + "@types/webpack-sources@*": version "1.4.0" resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-1.4.0.tgz#e58f1f05f87d39a5c64cf85705bdbdbb94d4d57e" @@ -6851,10 +6932,10 @@ acorn@^7.1.1, acorn@^7.4.0, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0: - version "8.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" - integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== +acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== add-px-to-style@1.0.0: version "1.0.0" @@ -9238,7 +9319,7 @@ chokidar@3.3.0: optionalDependencies: fsevents "~2.1.1" -"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.3: +"chokidar@>=3.0.0 <4.0.0", chokidar@^3.3.1, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -9253,7 +9334,7 @@ chokidar@3.3.0: optionalDependencies: fsevents "~2.3.2" -chokidar@^2.0.0, chokidar@^2.1.2, chokidar@^2.1.8: +chokidar@^2.0.0, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== @@ -9297,7 +9378,7 @@ chownr@^2.0.0: resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== -chrome-remote-interface@^0.28.2: +chrome-remote-interface@0.28.2: version "0.28.2" resolved "https://registry.yarnpkg.com/chrome-remote-interface/-/chrome-remote-interface-0.28.2.tgz#6be3554d2c227ff07eb74baa7e5d4911da12a5a6" integrity sha512-F7mjof7rWvRNsJqhVXuiFU/HWySCxTA9tzpLxUJxVfdLkljwFJ1aMp08AnwXRmmP7r12/doTDOMwaNhFCJsacw== @@ -9348,6 +9429,11 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +circular-dependency-plugin@5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/circular-dependency-plugin/-/circular-dependency-plugin-5.2.2.tgz#39e836079db1d3cf2f988dc48c5188a44058b600" + integrity sha512-g38K9Cm5WRwlaH6g03B9OEz/0qRizI+2I7n+Gz+L5DxXJAPAiWQvwlYNm1V1jkdpUv95bOe/ASm2vfi/G560jQ== + circular-dependency-plugin@^5.0.2: version "5.2.0" resolved "https://registry.yarnpkg.com/circular-dependency-plugin/-/circular-dependency-plugin-5.2.0.tgz#e09dbc2dd3e2928442403e2d45b41cea06bc0a93" @@ -11365,6 +11451,11 @@ devtools-protocol@0.0.1001819: resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1001819.tgz#0a98f44cefdb02cc684f3d5e6bd898a1690231d9" integrity sha512-G6OsIFnv/rDyxSqBa2lDLR6thp9oJioLsb2Gl+LbQlyoA9/OBAkrTU9jiCcQ8Pnh7z4d6slDiLaogR5hzgJLmQ== +devtools-protocol@0.0.894172: + version "0.0.894172" + resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.894172.tgz#d3b64bd2db0ab0a4d3b9157bcda1743f22b07636" + integrity sha512-tL9V5hs9s8TBkSX/d0qy8PbHQ6rW9myDILIbDdCboJxenSwqgoVx+C/+qEmI1OZH/zQ7OREv6ic336wJ82cOXg== + dezalgo@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" @@ -11918,6 +12009,14 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.7.0, enhanced-resolve@^5.8.0, enhan graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.10.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" + integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enhanced-resolve@^5.9.3: version "5.9.3" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.3.tgz#44a342c012cbc473254af5cc6ae20ebd0aae5d88" @@ -13050,7 +13149,7 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-comments@^1.0.0: +extract-comments@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/extract-comments/-/extract-comments-1.1.0.tgz#b90bca033a056bd69b8ba1c6b6b120fc2ee95c18" integrity sha512-dzbZV2AdSSVW/4E7Ti5hZdHWbA+Z80RJsJhr5uiL10oyjl/gy7/o+HI1HwK4/WSZhlq4SNKU3oUzXlM13Qx02Q== @@ -14741,7 +14840,7 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -gulp-babel@^8.0.0: +gulp-babel@8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-8.0.0.tgz#e0da96f4f2ec4a88dd3a3030f476e38ab2126d87" integrity sha512-oomaIqDXxFkg7lbpBou/gnUkX51/Y/M2ZfSjL2hdqXTAlSWZcgZtd2o0cOH0r/eE8LWD0+Q/PsLsr2DKOoqToQ== @@ -14751,7 +14850,7 @@ gulp-babel@^8.0.0: through2 "^2.0.0" vinyl-sourcemaps-apply "^0.2.0" -gulp-cache@^1.0.2: +gulp-cache@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/gulp-cache/-/gulp-cache-1.1.3.tgz#7c427670aad4d25364c3cc9c53e492b348190d27" integrity sha512-NE814LdX1NWQn2sMzn+Rf673o4mqlgg7OyLf92oQ4KEl6DdPfduEGLNH+HexLVcFZXH93DBuxFOvpv4/Js5VaA== @@ -14788,16 +14887,16 @@ gulp-cli@^2.2.0: v8flags "^3.0.1" yargs "^7.1.0" -gulp-remember@^1.0.1: +gulp-remember@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/gulp-remember/-/gulp-remember-1.0.1.tgz#cc3aab2a04a623614375571ca464d13e87502bfe" - integrity sha1-zDqrKgSmI2FDdVccpGTRPodQK/4= + integrity sha512-6OMSOzGeW05rl2TSFiBgXp6bV5r16n1CbZAT4t98vt1osQQ0UL76Y2M91xJTtMwppTo3Aj25Rle85jCP1eL9rQ== dependencies: fancy-log "^1.3.2" plugin-error "^0.1.2" through2 "^0.5.0" -gulp-sourcemaps@^2.6.5: +gulp-sourcemaps@2.6.5: version "2.6.5" resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-2.6.5.tgz#a3f002d87346d2c0f3aec36af7eb873f23de8ae6" integrity sha512-SYLBRzPTew8T5Suh2U8jCSDKY+4NARua4aqjj8HOysBh2tSgT9u4jc1FYirAdPx1akUxxDeK++fqw6Jg0LkQRg== @@ -14814,10 +14913,10 @@ gulp-sourcemaps@^2.6.5: strip-bom-string "1.X" through2 "2.X" -gulp-util@^3.0.8: +gulp-util@3.0.8: version "3.0.8" resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" - integrity sha1-AFTh50RQLifATBh8PsxQXdVLu08= + integrity sha512-q5oWPc12lwSFS9h/4VIjG+1NuNDlJ48ywV2JKItY4Ycc/n1fXJeYPVQsfu5ZrhQi7FGSDBalwUCLar/GyHXKGw== dependencies: array-differ "^1.0.0" array-uniq "^1.0.2" @@ -14838,7 +14937,7 @@ gulp-util@^3.0.8: through2 "^2.0.0" vinyl "^0.5.0" -gulp@^4.0.2: +gulp@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== @@ -17865,7 +17964,7 @@ json-schema@0.4.0: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== -json-stable-stringify-without-jsonify@^1.0.1: +json-stable-stringify-without-jsonify@1.0.1, json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= @@ -19347,7 +19446,7 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== -markdown-table@^2.0.0: +markdown-table@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b" integrity sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A== @@ -23636,7 +23735,7 @@ request-promise-core@1.1.4: dependencies: lodash "^4.17.19" -request-promise-native@^1.0.5: +request-promise-native@1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== @@ -26123,6 +26222,13 @@ through2@3.0.1, through2@^3.0.0: dependencies: readable-stream "2 || 3" +through2@4.0.2, through2@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" + integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== + dependencies: + readable-stream "3" + through2@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/through2/-/through2-0.5.1.tgz#dfdd012eb9c700e2323fd334f38ac622ab372da7" @@ -26131,13 +26237,6 @@ through2@^0.5.0: readable-stream "~1.0.17" xtend "~3.0.0" -through2@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" - integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== - dependencies: - readable-stream "3" - through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -27586,6 +27685,14 @@ watchpack@^2.3.1: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" +watchpack@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + wbuf@^1.1.0, wbuf@^1.7.3: version "1.7.3" resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" @@ -27894,6 +28001,36 @@ webpack@5.44.0: watchpack "^2.3.1" webpack-sources "^3.2.3" +webpack@^5, webpack@^5.1.0: + version "5.74.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" + integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^0.0.51" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.7.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.10.0" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.9" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.4.0" + webpack-sources "^3.2.3" + websocket-driver@>=0.5.1: version "0.7.3" resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.3.tgz#a2d4e0d4f4f116f1e6297eba58b05d430100e9f9"