From b0f7f8e27c93f972ade307714e7d08e9cf9c8682 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Wed, 11 Dec 2019 15:15:14 -0800 Subject: [PATCH 1/5] type updates which weren't actually needed --- build/gulp/tasks/bundle.ts | 2 +- build/gulp/tasks/docs.ts | 10 ++-- config.ts | 41 ++++++++------ package.json | 6 ++ yarn.lock | 112 ++++++++++++++++++++++++++++++++++++- 5 files changed, 147 insertions(+), 24 deletions(-) diff --git a/build/gulp/tasks/bundle.ts b/build/gulp/tasks/bundle.ts index 1b09c2596f..99b8cb68ea 100644 --- a/build/gulp/tasks/bundle.ts +++ b/build/gulp/tasks/bundle.ts @@ -51,7 +51,7 @@ task('bundle:package:commonjs', () => task('bundle:package:es', () => src(componentsSrc) - .pipe(babel({ caller: { useESModules: true } })) + .pipe(babel({ caller: { useESModules: true } } as any)) .pipe(dest(paths.packageDist(packageName, 'es'))), ) diff --git a/build/gulp/tasks/docs.ts b/build/gulp/tasks/docs.ts index 4e2017b9be..d920ca6c59 100644 --- a/build/gulp/tasks/docs.ts +++ b/build/gulp/tasks/docs.ts @@ -28,11 +28,11 @@ const g = require('gulp-load-plugins')() const { log } = g.util -const logWatchAdd = filePath => log('Created', chalk.blue(path.basename(filePath))) -const logWatchChange = filePath => log('Changed', chalk.magenta(path.basename(filePath))) -const logWatchUnlink = filePath => log('Deleted', chalk.red(path.basename(filePath))) +const logWatchAdd = (filePath: string) => log('Created', chalk.blue(path.basename(filePath))) +const logWatchChange = (filePath: string) => log('Changed', chalk.magenta(path.basename(filePath))) +const logWatchUnlink = (filePath: string) => log('Deleted', chalk.red(path.basename(filePath))) -const handleWatchUnlink = (group, filePath) => { +const handleWatchUnlink = (group: any, filePath: string) => { logWatchUnlink(filePath) remember.forget(group, filePath) } @@ -220,7 +220,7 @@ task('serve:docs:hot', async () => { noInfo: true, // must be quite for hot middleware to show overlay lazy: false, stats: config.compiler_stats, - }), + } as WebpackDevMiddleware.Options), ) .use(WebpackHotMiddleware(compiler)), ) diff --git a/config.ts b/config.ts index d4493f6fdb..7238e8a6fc 100644 --- a/config.ts +++ b/config.ts @@ -36,30 +36,37 @@ const envConfig = { // ------------------------------------ // Paths // ------------------------------------ -const base = (...args) => path.resolve(...[envConfig.path_base, ...args]) +const base = (...paths: string[]) => path.resolve(envConfig.path_base, ...paths) +const fromBase = (...paths: string[]) => (...subPaths: string[]) => base(...paths, ...subPaths) -const paths = { - base, - build: base.bind(null, envConfig.dir_build), - docsDist: base.bind(null, envConfig.dir_docs_dist), - docsSrc: base.bind(null, envConfig.dir_docs_src), - e2e: base.bind(null, envConfig.dir_e2e), - e2eSrc: base.bind(null, envConfig.dir_e2e_src), - e2eDist: base.bind(null, envConfig.dir_e2e_dist), +const tempPaths = { + build: fromBase(envConfig.dir_build), + docsDist: fromBase(envConfig.dir_docs_dist), + docsSrc: fromBase(envConfig.dir_docs_src), + e2e: fromBase(envConfig.dir_e2e), + e2eSrc: fromBase(envConfig.dir_e2e_src), + e2eDist: fromBase(envConfig.dir_e2e_dist), packageDist: (packageName: string, ...paths: string[]) => base(envConfig.dir_packages, packageName, 'dist', ...paths), packageSrc: (packageName: string, ...paths: string[]) => base(envConfig.dir_packages, packageName, 'src', ...paths), - packages: base.bind(null, envConfig.dir_packages), - perfDist: base.bind(null, envConfig.dir_perf_dist), - perfSrc: base.bind(null, envConfig.dir_perf_src), - umdDist: base.bind(null, envConfig.dir_umd_dist), - ciArtifacts: base.bind(null, envConfig.dir_ci_artifacts), - withRootAt: (root, ...subpaths) => (...args) => path.resolve(root, ...subpaths, ...args), - posix: undefined, // all the sibling values, but with forward slashes regardless the OS + packages: fromBase(envConfig.dir_packages), + perfDist: fromBase(envConfig.dir_perf_dist), + perfSrc: fromBase(envConfig.dir_perf_src), + umdDist: fromBase(envConfig.dir_umd_dist), + ciArtifacts: fromBase(envConfig.dir_ci_artifacts), + withRootAt: (root: string, ...subpaths: string[]) => (...args: string[]) => + path.resolve(root, ...subpaths, ...args), } -paths.posix = _.mapValues(paths, func => (...args) => func(...args).replace(/\\/g, '/')) +const paths = { + base, + ...tempPaths, + // all the sibling values, but with forward slashes regardless the OS + posix: _.mapValues(tempPaths, (func: (...args: string[]) => string) => (...args: string[]) => + func(...args).replace(/\\/g, '/'), + ), +} const config = { ...envConfig, diff --git a/package.json b/package.json index ae7168bb13..901ec29ff6 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,11 @@ "@types/enzyme": "^3.9.3", "@types/express": "^4.16.1", "@types/faker": "^4.1.3", + "@types/gulp": "^4.0.6", + "@types/gulp-babel": "6.1.29", + "@types/gulp-cache": "^0.4.4", "@types/gulp-load-plugins": "^0.0.31", + "@types/gulp-remember": "^0.0.31", "@types/lodash": "^4.14.118", "@types/node": "^10.3.2", "@types/prop-types": "^15.7.1", @@ -75,6 +79,8 @@ "@types/react-is": "^16.7.1", "@types/react-router-dom": "^4.3.4", "@types/rimraf": "^2.0.2", + "@types/webpack-dev-middleware": "^2.0.1", + "@types/webpack-hot-middleware": "^2.16.3", "babel-loader": "^8.0.6", "circular-dependency-plugin": "^5.0.2", "clean-webpack-plugin": "^0.1.19", diff --git a/yarn.lock b/yarn.lock index c9fc282a3b..cf50933a8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4245,6 +4245,14 @@ dependencies: "@types/node" "*" +"@types/glob-stream@*": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@types/glob-stream/-/glob-stream-6.1.0.tgz#7ede8a33e59140534f8d8adfb8ac9edfb31897bc" + integrity sha512-RHv6ZQjcTncXo3thYZrsbAVwoy4vSKosSWhuhuQxLOTv74OJuFQxXkmUuZCr3q9uNBEVCvIzmZL/FeRNbHZGUg== + dependencies: + "@types/glob" "*" + "@types/node" "*" + "@types/glob@*", "@types/glob@^7.1.1": version "7.1.1" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" @@ -4254,6 +4262,22 @@ "@types/minimatch" "*" "@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= + 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== + dependencies: + "@types/gulp-util" "*" + "@types/node" "*" + "@types/vinyl" "*" + "@types/gulp-load-plugins@^0.0.31": version "0.0.31" resolved "https://registry.yarnpkg.com/@types/gulp-load-plugins/-/gulp-load-plugins-0.0.31.tgz#e25c9d626b2c0947944cf8369b9ecdd2dbf2e57a" @@ -4261,6 +4285,13 @@ dependencies: "@types/node" "*" +"@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@*": version "3.0.34" resolved "https://registry.yarnpkg.com/@types/gulp-util/-/gulp-util-3.0.34.tgz#d1291ebf706d93f46eb8df11344bbfd96247697e" @@ -4271,6 +4302,15 @@ "@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== + dependencies: + "@types/undertaker" "*" + "@types/vinyl-fs" "*" + chokidar "^2.1.2" + "@types/history@*": version "4.7.2" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.2.tgz#0e670ea254d559241b6eeb3894f8754991e73220" @@ -4362,6 +4402,13 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.118.tgz#247bab39bfcc6d910d4927c6e06cbc70ec376f27" integrity sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw== +"@types/memory-fs@*": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@types/memory-fs/-/memory-fs-0.3.2.tgz#5d4753f9b390cb077c8c8af97bc96463399ceccd" + integrity sha512-j5AcZo7dbMxHoOimcHEIh0JZe5e1b8q8AqGSpZJrYc7xOgCIP79cIjTdx5jSDLtySnQDwkDTqwlC7Xw7uXw7qg== + dependencies: + "@types/node" "*" + "@types/mime@*": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" @@ -4568,6 +4615,18 @@ dependencies: source-map "^0.6.1" +"@types/undertaker-registry@*": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/undertaker-registry/-/undertaker-registry-1.0.1.tgz#4306d4a03d7acedb974b66530832b90729e1d1da" + integrity sha512-Z4TYuEKn9+RbNVk1Ll2SS4x1JeLHecolIbM/a8gveaHsW0Hr+RQMraZACwTO2VD7JvepgA6UO1A1VrbktQrIbQ== + +"@types/undertaker@*": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@types/undertaker/-/undertaker-1.2.2.tgz#927da24d0d3279830af96386862b035e040ead74" + integrity sha512-j4iepCSuY2JGW/hShVtUBagic0klYNFIXP7VweavnYnNC2EjiKxJFeaS9uaJmAT0ty9sQSqTS1aagWMZMV0HyA== + dependencies: + "@types/undertaker-registry" "*" + "@types/unist@*", "@types/unist@^2.0.0": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" @@ -4590,6 +4649,15 @@ "@types/unist" "*" "@types/vfile-message" "*" +"@types/vinyl-fs@*": + version "2.4.11" + resolved "https://registry.yarnpkg.com/@types/vinyl-fs/-/vinyl-fs-2.4.11.tgz#b98119b8bb2494141eaf649b09fbfeb311161206" + integrity sha512-2OzQSfIr9CqqWMGqmcERE6Hnd2KY3eBVtFaulVo3sJghplUcaeMdL9ZjEiljcQQeHjheWY9RlNmumjIAvsBNaA== + dependencies: + "@types/glob-stream" "*" + "@types/node" "*" + "@types/vinyl" "*" + "@types/vinyl@*": version "2.0.2" resolved "https://registry.yarnpkg.com/@types/vinyl/-/vinyl-2.0.2.tgz#4f3b8dae8f5828d3800ef709b0cff488ee852de3" @@ -4597,11 +4665,29 @@ dependencies: "@types/node" "*" +"@types/webpack-dev-middleware@^2.0.1": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/webpack-dev-middleware/-/webpack-dev-middleware-2.0.3.tgz#aefb145281b3326a052325d583d2339debbf1be3" + integrity sha512-DzNJJ6ah/6t1n8sfAgQyEbZ/OMmFcF9j9P3aesnm7G6/iBFR/qiGin8K89J0RmaWIBzhTMdDg3I5PmKmSv7N9w== + dependencies: + "@types/connect" "*" + "@types/memory-fs" "*" + "@types/webpack" "*" + loglevel "^1.6.2" + "@types/webpack-env@*", "@types/webpack-env@^1.13.7": version "1.14.1" resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.14.1.tgz#0d8a53f308f017c53a5ddc3d07f4d6fa76b790d7" integrity sha512-0Ki9jAAhKDSuLDXOIMADg54Hu60SuBTEsWaJGGy5cV+SSUQ63J2a+RrYYGrErzz39fXzTibhKrAQJAb8M7PNcA== +"@types/webpack-hot-middleware@^2.16.3": + version "2.25.0" + resolved "https://registry.yarnpkg.com/@types/webpack-hot-middleware/-/webpack-hot-middleware-2.25.0.tgz#ceb1e0fb43cbb9ec79c4a856c2060f161e12bf30" + integrity sha512-J+Zk7c99pMnPcxWpPY7CEdc4jhPFX1SVPrqXTzinoF8ea+OmIiHa+oOdVI7leMQFGZ6G9e9Yo1uNPhLVr/R8Uw== + dependencies: + "@types/connect" "*" + "@types/webpack" "*" + "@types/webpack-sources@*", "@types/webpack-sources@^0.1.5": version "0.1.5" resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.5.tgz#be47c10f783d3d6efe1471ff7f042611bd464a92" @@ -4611,7 +4697,7 @@ "@types/source-list-map" "*" source-map "^0.6.1" -"@types/webpack@^4.1.4": +"@types/webpack@*", "@types/webpack@^4.1.4": version "4.41.0" resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.0.tgz#b813a044d8b0dec7dfcd7622fdbe327bde06eb9a" integrity sha512-tWkdf9nO0zFgAY/EumUKwrDUhraHKDqCPhwfFR/R8l0qnPdgb9le0Gzhvb7uzVpouuDGBgiE//ZdY+5jcZy2TA== @@ -6872,6 +6958,25 @@ chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.4: optionalDependencies: fsevents "^1.2.7" +chokidar@^2.1.2: + version "2.1.8" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" + integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + chownr@^1.0.1, chownr@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" @@ -14063,6 +14168,11 @@ log-update@^1.0.2: ansi-escapes "^1.0.0" cli-cursor "^1.0.2" +loglevel@^1.6.2: + version "1.6.6" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.6.tgz#0ee6300cc058db6b3551fa1c4bf73b83bb771312" + integrity sha512-Sgr5lbboAUBo3eXCSPL4/KoVz3ROKquOjcctxmHIt+vol2DrqTQe3SwkKKuYhEiWB5kYa13YyopJ69deJ1irzQ== + loglevelnext@^1.0.1: version "1.0.5" resolved "https://registry.npmjs.org/loglevelnext/-/loglevelnext-1.0.5.tgz#36fc4f5996d6640f539ff203ba819641680d75a2" From 0e9fb42af2ef2547d20d9b290bb949fbc19fe2f3 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Fri, 10 Jan 2020 13:00:06 -0800 Subject: [PATCH 2/5] Run tests per-package --- .circleci/config.yml | 2 +- .github/CONTRIBUTING.md | 5 +- .gulp.js | 6 + .gulp.json | 5 - azure-pipelines.yml | 17 +- build/gulp/tasks/bundle.ts | 28 +-- build/gulp/tasks/docs.ts | 70 +++----- build/gulp/tasks/perf.ts | 6 +- build/gulp/tasks/test-dependencies/index.ts | 2 +- build/gulp/tasks/test-e2e.ts | 6 +- build/gulp/tasks/test-projects.ts | 4 +- build/gulp/tasks/test-unit.ts | 32 ++-- config.ts | 61 +++++-- jest.config.js | 17 +- package.json | 7 +- packages/ability-attributes/.gulp.js | 1 + packages/ability-attributes/babel.config.js | 1 + packages/ability-attributes/gulpfile.ts | 1 + packages/ability-attributes/package.json | 3 +- packages/accessibility/.gulp.js | 1 + packages/accessibility/babel.config.js | 1 + packages/accessibility/gulpfile.ts | 15 ++ packages/accessibility/package.json | 5 +- packages/code-sandbox/.gulp.js | 1 + packages/code-sandbox/babel.config.js | 1 + packages/code-sandbox/gulpfile.ts | 1 + packages/code-sandbox/package.json | 3 +- packages/docs-components/.gulp.js | 1 + packages/docs-components/babel.config.js | 1 + packages/docs-components/gulpfile.ts | 1 + packages/docs-components/package.json | 3 +- packages/internal-tooling/babel/index.js | 7 +- packages/perf-test/just.config.ts | 6 +- packages/react-bindings/.gulp.js | 1 + packages/react-bindings/babel.config.js | 1 + packages/react-bindings/gulpfile.ts | 1 + packages/react-bindings/package.json | 5 +- .../react-component-event-listener/.gulp.js | 1 + .../babel.config.js | 1 + .../gulpfile.ts | 1 + .../package.json | 5 +- .../react-component-nesting-registry/.gulp.js | 1 + .../babel.config.js | 1 + .../gulpfile.ts | 1 + .../package.json | 5 +- packages/react-component-ref/.gulp.js | 1 + packages/react-component-ref/babel.config.js | 1 + packages/react-component-ref/gulpfile.ts | 1 + packages/react-component-ref/package.json | 5 +- packages/react-proptypes/.gulp.js | 1 + packages/react-proptypes/babel.config.js | 1 + packages/react-proptypes/gulpfile.ts | 1 + packages/react-proptypes/package.json | 5 +- packages/react/.gulp.js | 1 + packages/react/babel.config.js | 1 + packages/react/gulpfile.ts | 15 ++ packages/react/package.json | 5 +- packages/state/.gulp.js | 1 + packages/state/babel.config.js | 1 + packages/state/gulpfile.ts | 1 + packages/state/package.json | 3 +- packages/styles/.gulp.js | 1 + packages/styles/babel.config.js | 1 + packages/styles/gulpfile.ts | 1 + packages/styles/package.json | 5 +- scripts/config/jest/jest.common.js | 3 + yarn.lock | 166 ++++++++++++++++-- 67 files changed, 412 insertions(+), 154 deletions(-) create mode 100644 .gulp.js delete mode 100644 .gulp.json create mode 100644 packages/ability-attributes/.gulp.js create mode 100644 packages/ability-attributes/babel.config.js create mode 100644 packages/ability-attributes/gulpfile.ts create mode 100644 packages/accessibility/.gulp.js create mode 100644 packages/accessibility/babel.config.js create mode 100644 packages/accessibility/gulpfile.ts create mode 100644 packages/code-sandbox/.gulp.js create mode 100644 packages/code-sandbox/babel.config.js create mode 100644 packages/code-sandbox/gulpfile.ts create mode 100644 packages/docs-components/.gulp.js create mode 100644 packages/docs-components/babel.config.js create mode 100644 packages/docs-components/gulpfile.ts create mode 100644 packages/react-bindings/.gulp.js create mode 100644 packages/react-bindings/babel.config.js create mode 100644 packages/react-bindings/gulpfile.ts create mode 100644 packages/react-component-event-listener/.gulp.js create mode 100644 packages/react-component-event-listener/babel.config.js create mode 100644 packages/react-component-event-listener/gulpfile.ts create mode 100644 packages/react-component-nesting-registry/.gulp.js create mode 100644 packages/react-component-nesting-registry/babel.config.js create mode 100644 packages/react-component-nesting-registry/gulpfile.ts create mode 100644 packages/react-component-ref/.gulp.js create mode 100644 packages/react-component-ref/babel.config.js create mode 100644 packages/react-component-ref/gulpfile.ts create mode 100644 packages/react-proptypes/.gulp.js create mode 100644 packages/react-proptypes/babel.config.js create mode 100644 packages/react-proptypes/gulpfile.ts create mode 100644 packages/react/.gulp.js create mode 100644 packages/react/babel.config.js create mode 100644 packages/react/gulpfile.ts create mode 100644 packages/state/.gulp.js create mode 100644 packages/state/babel.config.js create mode 100644 packages/state/gulpfile.ts create mode 100644 packages/styles/.gulp.js create mode 100644 packages/styles/babel.config.js create mode 100644 packages/styles/gulpfile.ts diff --git a/.circleci/config.yml b/.circleci/config.yml index c44712fc37..0489bb2c12 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: command: yarn prettier - run: name: Unit Tests - command: yarn test --maxWorkers=2 + command: yarn test - run: name: Report coverage command: bash <(curl -s https://codecov.io/bash) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 1111254447..a51e49094d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -3,7 +3,6 @@ - - [Getting started](#getting-started) - [Useful Commands](#useful-commands) - [Workflow](#workflow) @@ -168,11 +167,11 @@ These changes are required to setup internal tooling and package publishing. - "test": "echo \"Error: run tests from root\" && exit 1" - }, + "scripts": { -+ "build": "gulp bundle:package:no-umd --package react-proptypes" ++ "build": "gulp bundle:package:no-umd" + }, ``` -Don't forget to provide a correct directory name, you can also use `gulp bundle:package` to bundle your package with UMD. +You can also use `gulp bundle:package` to bundle your package with UMD. #### Create `tsconfig.json` diff --git a/.gulp.js b/.gulp.js new file mode 100644 index 0000000000..933825fda2 --- /dev/null +++ b/.gulp.js @@ -0,0 +1,6 @@ +// https://github.com/gulpjs/gulp-cli#configuration +module.exports = { + flags: { + require: '@fluentui/internal-tooling/babel/register', + }, +} diff --git a/.gulp.json b/.gulp.json deleted file mode 100644 index c2b45c997a..0000000000 --- a/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "require": "@fluentui/internal-tooling/babel/register" - } -} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7f84c578c4..7a2de03cb9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,14 +10,17 @@ trigger: [master] pool: vmImage: 'ubuntu-latest' -steps: -- task: ComponentGovernanceComponentDetection@0 - inputs: - scanType: 'Register' - verbosity: 'Verbose' - alertWarningLevel: 'High' - displayName: Component governance registration +variables: + # emulate circleci method of detecting whether build is running in CI or local + CI: 1 +steps: + - task: ComponentGovernanceComponentDetection@0 + inputs: + scanType: 'Register' + verbosity: 'Verbose' + alertWarningLevel: 'High' + displayName: Component governance registration # Rest of build is not being used for now, but leaving setup for reference # - task: NodeTool@0 diff --git a/build/gulp/tasks/bundle.ts b/build/gulp/tasks/bundle.ts index 99b8cb68ea..0621e8360d 100644 --- a/build/gulp/tasks/bundle.ts +++ b/build/gulp/tasks/bundle.ts @@ -1,8 +1,7 @@ import { task, series, parallel, src, dest } from 'gulp' import babel from 'gulp-babel' -import rimraf from 'rimraf' +import del from 'del' import webpack from 'webpack' -import { argv } from 'yargs' import config from '../../../config' import sh from '../sh' @@ -12,27 +11,18 @@ const g = require('gulp-load-plugins')() const { paths } = config const { log, PluginError } = g.util -const packageName = (argv.package as string) || 'react' +const packageName = config.package // ---------------------------------------- // Clean // ---------------------------------------- -task('bundle:package:clean:es', cb => { - rimraf(`${config.paths.packageDist(packageName)}/es/*`, cb) -}) - -task('bundle:package:clean:commonjs', cb => { - rimraf(`${config.paths.packageDist(packageName)}/commonjs/*`, cb) -}) - -task('bundle:package:clean:umd', cb => { - rimraf(`${config.paths.packageDist(packageName)}/umd/*`, cb) -}) - -task( - 'bundle:package:clean', - parallel('bundle:package:clean:es', 'bundle:package:clean:commonjs', 'bundle:package:clean:umd'), +task('bundle:package:clean', () => + del([ + `${paths.packageDist(packageName)}/es/*`, + `${paths.packageDist(packageName)}/commonjs/*`, + `${paths.packageDist(packageName)}/umd/*`, + ]), ) // ---------------------------------------- @@ -104,5 +94,5 @@ task('bundle:package', series('bundle:package:no-umd', 'bundle:package:umd')) task('bundle:all-packages', async () => { await sh('lerna run build') - rimraf.sync(`${config.paths.packages()}/*/dist/dts`) + del.sync(`${config.paths.packages()}/*/dist/dts`) }) diff --git a/build/gulp/tasks/docs.ts b/build/gulp/tasks/docs.ts index d920ca6c59..e5f0e92234 100644 --- a/build/gulp/tasks/docs.ts +++ b/build/gulp/tasks/docs.ts @@ -4,7 +4,7 @@ import cache from 'gulp-cache' import remember from 'gulp-remember' import fs from 'fs' import path from 'path' -import rimraf from 'rimraf' +import del from 'del' import through2 from 'through2' import webpack from 'webpack' import WebpackDevMiddleware from 'webpack-dev-middleware' @@ -43,40 +43,15 @@ const handleWatchUnlink = (group: any, filePath: string) => { task('clean:cache', () => cache.clearAll()) -task('clean:docs:schema', cb => { - rimraf(paths.packages('ability-attributes', 'src/schema.ts'), cb) -}) - -task('clean:docs:component-menu', cb => { - rimraf(paths.docsSrc('componentMenu.json'), cb) -}) - -task('clean:docs:component-menu-behaviors', cb => { - rimraf(paths.docsSrc('behaviorMenu.json'), cb) -}) - -task('clean:docs:dist', cb => { - rimraf(paths.docsDist(), cb) -}) - -task('clean:docs:example-menus', cb => { - rimraf(paths.docsSrc('exampleMenus'), cb) -}) - -task('clean:docs:example-sources', cb => { - rimraf(paths.docsSrc('exampleSources'), cb) -}) - -task( - 'clean:docs', - parallel( - 'clean:docs:component-menu', - 'clean:docs:component-menu-behaviors', - 'clean:docs:dist', - 'clean:docs:schema', - 'clean:docs:example-menus', - 'clean:docs:example-sources', - ), +task('clean:docs', () => + del([ + paths.packages('ability-attributes/src/schema.ts'), + paths.docsSrc('componentMenu.json'), + paths.docsSrc('behaviorMenu.json'), + paths.docsDist(), + paths.docsSrc('exampleMenus'), + paths.docsSrc('exampleSources'), + ]), ) // ---------------------------------------- @@ -232,13 +207,26 @@ task('serve:docs:stop', () => forceClose(server)) // Watch // ---------------------------------------- -task('watch:docs', cb => { +task('watch:docs:component-info', cb => { // rebuild component info watch(componentsSrc, series('build:docs:component-info')) .on('add', logWatchAdd) .on('change', logWatchChange) .on('unlink', logWatchUnlink) + cb() +}) + +task('watch:docs:component-menu-behaviors', cb => { + watch(behaviorSrc, series('build:docs:component-menu-behaviors')) + .on('add', logWatchAdd) + .on('change', logWatchChange) + .on('unlink', filePath => handleWatchUnlink('component-menu-behaviors', filePath)) + + cb() +}) + +task('watch:docs:other', cb => { watch(schemaSrc, series('build:docs:schema')).on('change', logWatchChange) // rebuild example menus @@ -261,11 +249,6 @@ task('watch:docs', cb => { } catch (e) {} }) - watch(behaviorSrc, series('build:docs:component-menu-behaviors')) - .on('add', logWatchAdd) - .on('change', logWatchChange) - .on('unlink', filePath => handleWatchUnlink('component-menu-behaviors', filePath)) - // rebuild images watch(`${config.paths.docsSrc()}/**/*.{png,jpg,gif}`, series('build:docs:images')) .on('add', logWatchAdd) @@ -275,6 +258,11 @@ task('watch:docs', cb => { cb() }) +task( + 'watch:docs', + series('watch:docs:component-info', 'watch:docs:component-menu-behaviors', 'watch:docs:other'), +) + // ---------------------------------------- // Default // ---------------------------------------- diff --git a/build/gulp/tasks/perf.ts b/build/gulp/tasks/perf.ts index b253aaea0c..0007058b91 100644 --- a/build/gulp/tasks/perf.ts +++ b/build/gulp/tasks/perf.ts @@ -4,7 +4,7 @@ import { series, task } from 'gulp' import _ from 'lodash' import ProgressBar from 'progress' import puppeteer from 'puppeteer' -import rimraf from 'rimraf' +import del from 'del' import { argv } from 'yargs' import markdownTable from 'markdown-table' @@ -109,9 +109,7 @@ const createMarkdownTable = ( ]) } -task('perf:clean', cb => { - rimraf(paths.perfDist(), cb) -}) +task('perf:clean', () => del(paths.perfDist())) task('perf:build', cb => { webpackPlugin(require('../../../build/webpack.config.perf').default, cb) diff --git a/build/gulp/tasks/test-dependencies/index.ts b/build/gulp/tasks/test-dependencies/index.ts index 0eb5d85c79..9de7151927 100644 --- a/build/gulp/tasks/test-dependencies/index.ts +++ b/build/gulp/tasks/test-dependencies/index.ts @@ -9,7 +9,7 @@ import config from '../../../../config' const { paths } = config const prefix = (argv.prefix as string) || '' -const packageName = (argv.package as string) || 'react' +const packageName = config.package /** * Lists runtime dependencies (by crawling the actual code) of the requested Fluent UI package. diff --git a/build/gulp/tasks/test-e2e.ts b/build/gulp/tasks/test-e2e.ts index e3107b3851..89a0bfe31e 100644 --- a/build/gulp/tasks/test-e2e.ts +++ b/build/gulp/tasks/test-e2e.ts @@ -1,6 +1,6 @@ import { task, series } from 'gulp' import * as yargs from 'yargs' -import rimraf from 'rimraf' +import del from 'del' import config from '../../../config' import webpackPlugin from '../plugins/gulp-webpack' @@ -15,9 +15,7 @@ const argv = yargs .option('testNamePattern', { alias: 't' }) .option('testFilePattern', { alias: 'F' }).argv -task('test:e2e:clean', cb => { - rimraf(paths.e2eDist(), cb) -}) +task('test:e2e:clean', () => del(paths.e2eDist())) task('test:e2e:build', cb => { webpackPlugin(require('../../../build/webpack.config.e2e').default, cb) diff --git a/build/gulp/tasks/test-projects.ts b/build/gulp/tasks/test-projects.ts index 816ea0ea2c..31b4ee39a7 100644 --- a/build/gulp/tasks/test-projects.ts +++ b/build/gulp/tasks/test-projects.ts @@ -6,7 +6,7 @@ import path from 'path' import portfinder from 'portfinder' import puppeteer from 'puppeteer' import sh from '../sh' -import rimraf from 'rimraf' +import del from 'del' import config from '../../../config' import tmp from 'tmp' @@ -87,7 +87,7 @@ const createReactApp = async (atTempDirectory: string, appName: string): Promise await runIn(tempUtilProjectPath)(`yarn create-react-app ${appProjectPath} --typescript`) } finally { // remove temp util directory - rimraf.sync(tempUtilProjectPath) + del.sync(tempUtilProjectPath) } return appProjectPath diff --git a/build/gulp/tasks/test-unit.ts b/build/gulp/tasks/test-unit.ts index 5876285aea..d61ca5d3f3 100644 --- a/build/gulp/tasks/test-unit.ts +++ b/build/gulp/tasks/test-unit.ts @@ -1,9 +1,10 @@ import { parallel, series, task } from 'gulp' import yargs from 'yargs' -import sh from '../sh' import jest, { JestPluginConfig } from '../plugins/gulp-jest' +import config from '../../../config' + const argv = yargs .option('runInBand', {}) .option('maxWorkers', {}) @@ -19,15 +20,9 @@ const jestConfigFromArgv: Partial = { testFilePattern: argv.testFilePattern as string, } -task('test:jest:pre', () => sh('yarn satisfied')) - -task( - 'test:jest:setup', - series( - 'test:jest:pre', - parallel('build:docs:component-info', 'build:docs:component-menu-behaviors'), - ), -) +if (process.env.CI) { + jestConfigFromArgv.maxWorkers = 2 +} task( 'test:jest', @@ -51,5 +46,18 @@ task( // Tests // ---------------------------------------- -task('test', series('test:jest:setup', 'test:jest')) -task('test:watch', series('test:jest:setup', parallel('test:jest:watch', 'watch:docs'))) +if (config.isRoot) { + // If running at root, define test and test:watch to build doc-related pre-reqs + task( + 'test:jest:setup', + parallel('build:docs:component-info', 'build:docs:component-menu-behaviors'), + ) + task('test', series('test:jest:setup', 'test:jest')) + task( + 'test:watch', + series('test:jest:setup', parallel('test:jest:watch', 'watch:docs:component-info')), + ) +} else { + task('test', series('test:jest')) + task('test:watch', series('test:jest', 'test:jest:watch')) +} diff --git a/config.ts b/config.ts index 7238e8a6fc..354e238362 100644 --- a/config.ts +++ b/config.ts @@ -68,6 +68,14 @@ const paths = { ), } +const isRoot = process.cwd() === __dirname +let packageName = isRoot ? 'react' : path.basename(process.cwd()) +// don't use yargs here because it causes build errors in certain circumstances +const packageArgIndex = process.argv.indexOf('--package') +if (packageArgIndex > -1 && process.argv[packageArgIndex + 1]) { + packageName = process.argv[packageArgIndex + 1] +} + const config = { ...envConfig, paths, @@ -101,23 +109,44 @@ const config = { compiler_output_path: paths.base(envConfig.dir_docs_dist), compiler_public_path: __BASENAME__, compiler_stats: { - hash: false, // the hash of the compilation - version: false, // webpack version info - timings: true, // timing info - assets: false, // assets info - chunks: false, // chunk info - colors: true, // with console colors - chunkModules: false, // built modules info to chunk info - modules: false, // built modules info - cached: false, // also info about cached (not built) modules - reasons: false, // info about the reasons modules are included - source: false, // the source code of modules - errorDetails: true, // details to errors (like resolving log) - chunkOrigins: false, // the origins of chunks and chunk merging info - modulesSort: '', // (string) sort the modules by that field - chunksSort: '', // (string) sort the chunks by that field - assetsSort: '', // (string) sort the assets by that field + /** the hash of the compilation */ + hash: false, + /** webpack version info */ + version: false, + /** timing info */ + timings: true, + /** assets info */ + assets: false, + /** chunk info */ + chunks: false, + /** with console colors */ + colors: true, + /** built modules info to chunk info */ + chunkModules: false, + /** built modules info */ + modules: false, + /** also info about cached (not built) modules */ + cached: false, + /** info about the reasons modules are included */ + reasons: false, + /** the source code of modules */ + source: false, + /** details to errors (like resolving log) */ + errorDetails: true, + /** the origins of chunks and chunk merging info */ + chunkOrigins: false, + /** sort the modules by that field */ + modulesSort: '', + /** sort the chunks by that field */ + chunksSort: '', + /** sort the assets by that field */ + assetsSort: '', }, + + /** True if command is running from repo root */ + isRoot, + /** Package name the task is running against: default to react if running at root, or cwd otherwise */ + package: packageName, } export default config diff --git a/jest.config.js b/jest.config.js index 463eb1c166..69c129cbe5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,16 +1,19 @@ const { coverageReporters } = require('@fluentui/internal-tooling/jest') const { rollup: lernaAliases } = require('lerna-alias') +const path = require('path') +const fs = require('fs') // packages/react/src -> packages/react, // as lernaAliases append 'src' by default -const projectPackages = lernaAliases({ sourceDirectory: false }) +const packagePaths = lernaAliases({ sourceDirectory: false }) -// Excludes the non-project packages -const excluded = ['@fluentui/playground', '@fluentui/react-theming'] - -const projects = Object.keys(projectPackages) - .filter(p => !excluded.includes(p)) - .map(packageName => projectPackages[packageName]) +// Exclude packages which build with just, and other special packages +const excludedPackages = ['@fluentui/internal-tooling'] +const projects = Object.keys(packagePaths).filter( + packageName => + !excludedPackages.includes(packageName) && + !fs.existsSync(path.join(packagePaths[packageName], 'just.config.ts')), +) module.exports = { coverageReporters, diff --git a/package.json b/package.json index 901ec29ff6..a82ba7c6d8 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "build:bundle": "gulp bundle:all-packages", "build:docs": "gulp build:docs", "ci": "yarn lint && yarn prettier && yarn test --strict", + "clean": "yarn clean:cache && yarn clean:docs && lerna run --stream clean", "clean:cache": "gulp clean:cache", + "clean:docs": "gulp clean:docs", "predeploy:docs": "cross-env NODE_ENV=production yarn build:docs", "deploy:docs": "gulp deploy:docs", "lint": "eslint \"**/*.{js,ts,tsx}\" && yarn lint:old", @@ -30,7 +32,7 @@ "stats:save": "gulp stats:save", "satisfied": "satisfied --skip-invalid", "pretest": "yarn satisfied && yarn syncpack list-mismatches", - "test": "gulp test", + "test": "yarn satisfied && lerna run test --stream", "test:e2e": "gulp test:e2e", "test:e2e:serve": "gulp test:e2e:serve", "test:watch": "gulp test:watch", @@ -78,7 +80,6 @@ "@types/react-dom": "^16.8.3", "@types/react-is": "^16.7.1", "@types/react-router-dom": "^4.3.4", - "@types/rimraf": "^2.0.2", "@types/webpack-dev-middleware": "^2.0.1", "@types/webpack-hot-middleware": "^2.16.3", "babel-loader": "^8.0.6", @@ -90,6 +91,7 @@ "copy-webpack-plugin": "^4.5.2", "cross-env": "^5.1.4", "danger": "^6.0.5", + "del": "^5.1.0", "doctoc": "^1.3.0", "doctrine": "^2.0.0", "enzyme": "^3.10.0", @@ -140,7 +142,6 @@ "react-vis": "^1.11.6", "read-package-json": "^2.0.13", "request-promise-native": "^1.0.5", - "rimraf": "^2.6.1", "satisfied": "^1.1.1", "screener-runner": "^0.10.43", "semver": "^6.2.0", diff --git a/packages/ability-attributes/.gulp.js b/packages/ability-attributes/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/ability-attributes/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/ability-attributes/babel.config.js b/packages/ability-attributes/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/ability-attributes/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/ability-attributes/gulpfile.ts b/packages/ability-attributes/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/ability-attributes/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/ability-attributes/package.json b/packages/ability-attributes/package.json index 714fe36c9a..2b73a20d93 100644 --- a/packages/ability-attributes/package.json +++ b/packages/ability-attributes/package.json @@ -23,7 +23,8 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "npm run schema && gulp bundle:package:no-umd --package ability-attributes", + "build": "npm run schema && gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean", "schema": "allyschema -c \"process.env.NODE_ENV !== 'production'\" schema.json > ./src/schema.ts" }, "sideEffects": false, diff --git a/packages/accessibility/.gulp.js b/packages/accessibility/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/accessibility/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/accessibility/babel.config.js b/packages/accessibility/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/accessibility/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/accessibility/gulpfile.ts b/packages/accessibility/gulpfile.ts new file mode 100644 index 0000000000..74b6d615c0 --- /dev/null +++ b/packages/accessibility/gulpfile.ts @@ -0,0 +1,15 @@ +import { parallel, series, task } from 'gulp' + +// Build off normal tasks +import '../../gulpfile' + +// Redefine test and test:watch to build behavior json file beforehand +task('test', series('build:docs:component-menu-behaviors', 'test:jest')) +task( + 'test:watch', + series( + 'build:docs:component-menu-behaviors', + 'test:jest', + parallel('test:jest:watch', 'watch:docs:component-menu-behaviors'), + ), +) diff --git a/packages/accessibility/package.json b/packages/accessibility/package.json index c5717e1a02..738605ea76 100644 --- a/packages/accessibility/package.json +++ b/packages/accessibility/package.json @@ -26,7 +26,10 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package accessibility" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean", + "test": "gulp test", + "test:watch": "gulp test:watch" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/code-sandbox/.gulp.js b/packages/code-sandbox/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/code-sandbox/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/code-sandbox/babel.config.js b/packages/code-sandbox/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/code-sandbox/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/code-sandbox/gulpfile.ts b/packages/code-sandbox/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/code-sandbox/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/code-sandbox/package.json b/packages/code-sandbox/package.json index 4b31021991..cfb86633c3 100644 --- a/packages/code-sandbox/package.json +++ b/packages/code-sandbox/package.json @@ -25,7 +25,8 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package code-sandbox" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/docs-components/.gulp.js b/packages/docs-components/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/docs-components/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/docs-components/babel.config.js b/packages/docs-components/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/docs-components/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/docs-components/gulpfile.ts b/packages/docs-components/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/docs-components/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/docs-components/package.json b/packages/docs-components/package.json index 26b6be8609..d5e29d4e0e 100644 --- a/packages/docs-components/package.json +++ b/packages/docs-components/package.json @@ -29,7 +29,8 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package docs-components" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/internal-tooling/babel/index.js b/packages/internal-tooling/babel/index.js index 9e07f9b582..3948f5bf8b 100644 --- a/packages/internal-tooling/babel/index.js +++ b/packages/internal-tooling/babel/index.js @@ -18,7 +18,7 @@ module.exports = api => { '@babel/preset-env', { modules: useESModules ? false : 'cjs', - targets: isNode ? { node: '8' } : undefined, + targets: isNode ? { node: '10' } : undefined, exclude: [ // https://github.com/microsoft/fluent-ui-react/pull/1895 'proposal-object-rest-spread', @@ -41,5 +41,10 @@ module.exports = api => { return { presets, plugins, + // Options to facilitate debugging in editor (set DEBUG environment var) + ...(process.env.DEBUG && { + sourceMaps: 'inline', + retainLines: true, + }), } } diff --git a/packages/perf-test/just.config.ts b/packages/perf-test/just.config.ts index 18036d88c1..888eb0738d 100644 --- a/packages/perf-test/just.config.ts +++ b/packages/perf-test/just.config.ts @@ -1,8 +1,6 @@ import path from 'path' import '@fluentui/scripts/tasks/preset' import { series, task } from '@fluentui/scripts' -import { digestStories } from '@fluentui/digest' -import runPerfTest from './tasks/perf-test' // TODO: FUR integration issues // - FUR build fails when it comes across these new packages inside of packages/ @@ -11,6 +9,8 @@ import runPerfTest from './tasks/perf-test' // - Existing perf story format diverges from CSF format, requiring special loader. function bundleStories() { return async function() { + // delay require in case digest isn't built yet + const { digestStories } = require('@fluentui/digest') await digestStories({ configDir: path.join(__dirname, '.digest'), outputDir: path.join(__dirname, 'dist'), @@ -24,6 +24,8 @@ function bundleStories() { task('perf-test:bundle', bundleStories()) task('perf-test:run', () => { + // delay require in case digest isn't built yet + const runPerfTest = require('./tasks/perf-test').default return runPerfTest() }) diff --git a/packages/react-bindings/.gulp.js b/packages/react-bindings/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/react-bindings/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/react-bindings/babel.config.js b/packages/react-bindings/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/react-bindings/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/react-bindings/gulpfile.ts b/packages/react-bindings/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/react-bindings/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/react-bindings/package.json b/packages/react-bindings/package.json index 9173a913e8..9529c62458 100644 --- a/packages/react-bindings/package.json +++ b/packages/react-bindings/package.json @@ -30,7 +30,10 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package react-bindings" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean", + "test": "gulp test", + "test:watch": "gulp test:watch" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/react-component-event-listener/.gulp.js b/packages/react-component-event-listener/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/react-component-event-listener/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/react-component-event-listener/babel.config.js b/packages/react-component-event-listener/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/react-component-event-listener/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/react-component-event-listener/gulpfile.ts b/packages/react-component-event-listener/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/react-component-event-listener/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/react-component-event-listener/package.json b/packages/react-component-event-listener/package.json index d63c619480..8098f24e28 100644 --- a/packages/react-component-event-listener/package.json +++ b/packages/react-component-event-listener/package.json @@ -29,7 +29,10 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package react-component-event-listener" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean", + "test": "gulp test", + "test:watch": "gulp test:watch" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/react-component-nesting-registry/.gulp.js b/packages/react-component-nesting-registry/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/react-component-nesting-registry/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/react-component-nesting-registry/babel.config.js b/packages/react-component-nesting-registry/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/react-component-nesting-registry/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/react-component-nesting-registry/gulpfile.ts b/packages/react-component-nesting-registry/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/react-component-nesting-registry/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/react-component-nesting-registry/package.json b/packages/react-component-nesting-registry/package.json index fbea7919d3..9bf2d562e1 100644 --- a/packages/react-component-nesting-registry/package.json +++ b/packages/react-component-nesting-registry/package.json @@ -29,7 +29,10 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package react-component-nesting-registry" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean", + "test": "gulp test", + "test:watch": "gulp test:watch" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/react-component-ref/.gulp.js b/packages/react-component-ref/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/react-component-ref/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/react-component-ref/babel.config.js b/packages/react-component-ref/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/react-component-ref/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/react-component-ref/gulpfile.ts b/packages/react-component-ref/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/react-component-ref/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/react-component-ref/package.json b/packages/react-component-ref/package.json index cdd792b811..6f23d96909 100644 --- a/packages/react-component-ref/package.json +++ b/packages/react-component-ref/package.json @@ -30,7 +30,10 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package react-component-ref" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean", + "test": "gulp test", + "test:watch": "gulp test:watch" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/react-proptypes/.gulp.js b/packages/react-proptypes/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/react-proptypes/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/react-proptypes/babel.config.js b/packages/react-proptypes/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/react-proptypes/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/react-proptypes/gulpfile.ts b/packages/react-proptypes/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/react-proptypes/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/react-proptypes/package.json b/packages/react-proptypes/package.json index 03183ec28a..b2c198db68 100644 --- a/packages/react-proptypes/package.json +++ b/packages/react-proptypes/package.json @@ -26,7 +26,10 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package react-proptypes" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean", + "test": "gulp test", + "test:watch": "gulp test:watch" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/react/.gulp.js b/packages/react/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/react/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/react/babel.config.js b/packages/react/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/react/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/react/gulpfile.ts b/packages/react/gulpfile.ts new file mode 100644 index 0000000000..8afed497a0 --- /dev/null +++ b/packages/react/gulpfile.ts @@ -0,0 +1,15 @@ +import { parallel, series, task } from 'gulp' + +// Build off normal tasks +import '../../gulpfile' + +// Redefine test and test:watch to build info json files beforehand +task('test', series('build:docs:component-info', 'test:jest')) +task( + 'test:watch', + series( + 'build:docs:component-info', + 'test:jest', + parallel('test:jest:watch', 'watch:docs:component-info'), + ), +) diff --git a/packages/react/package.json b/packages/react/package.json index 2d2d0c0df8..176901bab5 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -51,7 +51,10 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package --package react" + "build": "gulp bundle:package", + "clean": "gulp bundle:package:clean", + "test": "gulp test", + "test:watch": "gulp test:watch" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/state/.gulp.js b/packages/state/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/state/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/state/babel.config.js b/packages/state/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/state/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/state/gulpfile.ts b/packages/state/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/state/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/state/package.json b/packages/state/package.json index 066efacfe8..dc070e337d 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -24,7 +24,8 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package state" + "build": "gulp bundle:package:no-umd", + "clean": "gulp bundle:package:clean" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/packages/styles/.gulp.js b/packages/styles/.gulp.js new file mode 100644 index 0000000000..87c6422c6b --- /dev/null +++ b/packages/styles/.gulp.js @@ -0,0 +1 @@ +module.exports = require('../../.gulp') diff --git a/packages/styles/babel.config.js b/packages/styles/babel.config.js new file mode 100644 index 0000000000..a1c212ad45 --- /dev/null +++ b/packages/styles/babel.config.js @@ -0,0 +1 @@ +module.exports = api => require('@fluentui/internal-tooling/babel')(api) diff --git a/packages/styles/gulpfile.ts b/packages/styles/gulpfile.ts new file mode 100644 index 0000000000..de10829664 --- /dev/null +++ b/packages/styles/gulpfile.ts @@ -0,0 +1 @@ +import '../../gulpfile' diff --git a/packages/styles/package.json b/packages/styles/package.json index c368a30d3d..45bd7cbc20 100644 --- a/packages/styles/package.json +++ b/packages/styles/package.json @@ -26,7 +26,10 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package:no-umd --package styles" + "build": "gulp bundle:package", + "clean": "gulp bundle:package:clean", + "test": "gulp test", + "test:watch": "gulp test:watch" }, "sideEffects": false, "types": "dist/es/index.d.ts" diff --git a/scripts/config/jest/jest.common.js b/scripts/config/jest/jest.common.js index fb33ce4b95..fec3707205 100644 --- a/scripts/config/jest/jest.common.js +++ b/scripts/config/jest/jest.common.js @@ -6,6 +6,9 @@ module.exports = { transform: { ...tsjPreset.transform, }, + moduleNameMapper: { + ...require('lerna-alias').jest(), + }, testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$', globals: { 'ts-jest': { diff --git a/yarn.lock b/yarn.lock index cf50933a8f..34bcc0d7e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3211,11 +3211,32 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" +"@nodelib/fs.scandir@2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" + integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== + dependencies: + "@nodelib/fs.stat" "2.0.3" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3" + integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== + "@nodelib/fs.stat@^1.1.2": version "1.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@nodelib/fs.walk@^1.2.3": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976" + integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== + dependencies: + "@nodelib/fs.scandir" "2.1.3" + fastq "^1.6.0" + "@octokit/endpoint@^3.1.1": version "3.1.2" resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-3.1.2.tgz#22b5aa8596482fbefc3f1ce22c24ad217aed60fa" @@ -4553,14 +4574,6 @@ "@types/prop-types" "*" csstype "^2.2.0" -"@types/rimraf@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.2.tgz#7f0fc3cf0ff0ad2a99bb723ae1764f30acaf8b6e" - integrity sha512-Hm/bnWq0TCy7jmjeN5bKYij9vw5GrDFWME4IuxV08278NtU/VdGbzsBohcCUJ7+QMqmUq5hpRKB39HeQWJjztQ== - dependencies: - "@types/glob" "*" - "@types/node" "*" - "@types/serve-static@*": version "1.13.2" resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.2.tgz#f5ac4d7a6420a99a6a45af4719f4dcd8cd907a48" @@ -5140,6 +5153,14 @@ agentkeepalive@^3.4.1: dependencies: humanize-ms "^1.2.1" +aggregate-error@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" + integrity sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + "airbnb-js-shims@^1 || ^2": version "2.2.1" resolved "https://registry.npmjs.org/airbnb-js-shims/-/airbnb-js-shims-2.2.1.tgz#db481102d682b98ed1daa4c5baa697a05ce5c040" @@ -5574,6 +5595,11 @@ array-union@^1.0.1, array-union@^1.0.2: dependencies: array-uniq "^1.0.1" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.1, array-uniq@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -7041,6 +7067,11 @@ clean-css@4.2.x, clean-css@^4.2.1: dependencies: source-map "~0.6.0" +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + clean-webpack-plugin@^0.1.19: version "0.1.19" resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-0.1.19.tgz#ceda8bb96b00fe168e9b080272960d20fdcadd6d" @@ -8380,6 +8411,20 @@ defined@^1.0.0: resolved "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= +del@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/del/-/del-5.1.0.tgz#d9487c94e367410e6eff2925ee58c0c84a75b3a7" + integrity sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA== + dependencies: + globby "^10.0.1" + graceful-fs "^4.2.2" + is-glob "^4.0.1" + is-path-cwd "^2.2.0" + is-path-inside "^3.0.1" + p-map "^3.0.0" + rimraf "^3.0.0" + slash "^3.0.0" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -8523,6 +8568,13 @@ dir-glob@^2.0.0, dir-glob@^2.2.2: dependencies: path-type "^3.0.0" +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + discontinuous-range@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" @@ -9711,6 +9763,17 @@ fast-glob@^2.0.2, fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" +fast-glob@^3.0.3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.1.1.tgz#87ee30e9e9f3eb40d6f254a7997655da753d7c82" + integrity sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -9731,6 +9794,13 @@ fast-memoize@^2.5.1: resolved "https://registry.yarnpkg.com/fast-memoize/-/fast-memoize-2.5.1.tgz#c3519241e80552ce395e1a32dcdde8d1fd680f5d" integrity sha512-xdmw296PCL01tMOXx9mdJSmWY29jQgxyuZdq0rEHMu+Tpe1eOEtCycoG6chzlcrWsNgpZP7oL8RiQr7+G6Bl6g== +fastq@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.6.0.tgz#4ec8a38f4ac25f21492673adb7eae9cfef47d1c2" + integrity sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA== + dependencies: + reusify "^1.0.0" + fault@^1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/fault/-/fault-1.0.3.tgz#4da88cf979b6b792b4e13c7ec836767725170b7e" @@ -10632,9 +10702,9 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@^5.0.0, glob-parent@~5.1.0: +glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: version "5.1.0" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== dependencies: is-glob "^4.0.1" @@ -10825,6 +10895,20 @@ globby@9.2.0: pify "^4.0.1" slash "^2.0.0" +globby@^10.0.1: + version "10.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.2.tgz#277593e745acaa4646c3ab411289ec47a0392543" + integrity sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg== + dependencies: + "@types/glob" "^7.1.1" + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.0.3" + glob "^7.1.3" + ignore "^5.1.1" + merge2 "^1.2.3" + slash "^3.0.0" + globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -10889,9 +10973,9 @@ graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.1.tgz#1c1f0c364882c868f5bff6512146328336a11b1d" integrity sha512-b9usnbDGnD928gJB3LrCmxoibr3VE4U2SMo5PBuBnokWyDADTqDPXg4YpwKF1trpH+UbGp7QLicO3+aWEy0+mw== -graceful-fs@^4.1.9: +graceful-fs@^4.1.9, graceful-fs@^4.2.2: version "4.2.3" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== "graceful-readlink@>= 1.0.0": @@ -11659,6 +11743,11 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.1.1: + version "5.1.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" + integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== + immer@1.10.0: version "1.10.0" resolved "https://registry.npmjs.org/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" @@ -11752,6 +11841,11 @@ indent-string@^3.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + indexes-of@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" @@ -12238,6 +12332,11 @@ is-observable@^1.1.0: dependencies: symbol-observable "^1.1.0" +is-path-cwd@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" + integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== + is-path-inside@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" @@ -12245,6 +12344,11 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" +is-path-inside@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" + integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== + is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -14605,6 +14709,11 @@ merge2@^1.2.2, merge2@^1.2.3: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== +merge2@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" + integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -14653,9 +14762,9 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.0: +micromatch@^4.0.0, micromatch@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== dependencies: braces "^3.0.1" @@ -15817,6 +15926,13 @@ p-map@^1.1.1, p-map@^1.2.0: resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== +p-map@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" + integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== + dependencies: + aggregate-error "^3.0.0" + p-pipe@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.2.0.tgz#4b1a11399a11520a67790ee5a0c1d5881d6befe9" @@ -18252,6 +18368,11 @@ retry@^0.10.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= +reusify@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rfc6902@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/rfc6902/-/rfc6902-3.0.1.tgz#03a3d38329dbc266fbc92aa7fc14546d7839e89f" @@ -18271,6 +18392,13 @@ rimraf@^2.2.8, rimraf@^2.6.3: dependencies: glob "^7.1.3" +rimraf@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.0.tgz#614176d4b3010b75e5c390eb0ee96f6dc0cebb9b" + integrity sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -18325,6 +18453,11 @@ run-parallel-limit@^1.0.5: resolved "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.0.5.tgz#c29a4fd17b4df358cb52a8a697811a63c984f1b7" integrity sha512-NsY+oDngvrvMxKB3G8ijBzIema6aYbQMD2bHOamvN52BysbIGTnEY2xsNyfrcr9GhY995/t/0nQN3R3oZvaDlg== +run-parallel@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" + integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" @@ -18730,6 +18863,11 @@ slash@^2.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" From c10be51086b70b3e2015a4577095fce66e947a4c Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Fri, 10 Jan 2020 13:34:06 -0800 Subject: [PATCH 3/5] Fix tsc task --- build/gulp/tasks/bundle.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build/gulp/tasks/bundle.ts b/build/gulp/tasks/bundle.ts index 0621e8360d..e3434f4560 100644 --- a/build/gulp/tasks/bundle.ts +++ b/build/gulp/tasks/bundle.ts @@ -22,6 +22,7 @@ task('bundle:package:clean', () => `${paths.packageDist(packageName)}/es/*`, `${paths.packageDist(packageName)}/commonjs/*`, `${paths.packageDist(packageName)}/umd/*`, + `${paths.packageDist(packageName)}/dts`, ]), ) @@ -45,7 +46,13 @@ task('bundle:package:es', () => .pipe(dest(paths.packageDist(packageName, 'es'))), ) -task('bundle:package:types:tsc', () => sh(`cd packages/${packageName} && tsc -b`)) +task('bundle:package:types:tsc', () => { + let cmd = 'tsc -b' + if (process.cwd() === config.path_base) { + cmd = `cd packages && cd ${packageName} && ${cmd}` + } + return sh(cmd) +}) task('bundle:package:types:copy', () => { return src(paths.packageDist(packageName, 'dts/src/**/*.d.ts')).pipe( dest(paths.packageDist(packageName, 'es')), @@ -94,5 +101,5 @@ task('bundle:package', series('bundle:package:no-umd', 'bundle:package:umd')) task('bundle:all-packages', async () => { await sh('lerna run build') - del.sync(`${config.paths.packages()}/*/dist/dts`) + return del(`${config.paths.packages()}/*/dist/dts`) }) From 7fc1c98bea5af28cc0ccb1bb26fe1516f37efce3 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Fri, 10 Jan 2020 13:56:19 -0800 Subject: [PATCH 4/5] fix styles package.json --- packages/styles/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/styles/package.json b/packages/styles/package.json index 45bd7cbc20..51ad1d7e8a 100644 --- a/packages/styles/package.json +++ b/packages/styles/package.json @@ -26,7 +26,7 @@ }, "repository": "microsoft/fluent-ui-react.git", "scripts": { - "build": "gulp bundle:package", + "build": "gulp bundle:package:no-umd", "clean": "gulp bundle:package:clean", "test": "gulp test", "test:watch": "gulp test:watch" From a8e4b60f5787d5c2db996073a153acd6ca62234b Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Fri, 10 Jan 2020 17:24:23 -0800 Subject: [PATCH 5/5] fix test-projects cleanup --- build/gulp/tasks/test-projects.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gulp/tasks/test-projects.ts b/build/gulp/tasks/test-projects.ts index 31b4ee39a7..f2b7d61151 100644 --- a/build/gulp/tasks/test-projects.ts +++ b/build/gulp/tasks/test-projects.ts @@ -87,7 +87,7 @@ const createReactApp = async (atTempDirectory: string, appName: string): Promise await runIn(tempUtilProjectPath)(`yarn create-react-app ${appProjectPath} --typescript`) } finally { // remove temp util directory - del.sync(tempUtilProjectPath) + del.sync(tempUtilProjectPath, { force: true }) } return appProjectPath