From a9412991180ddfbf3230cacb5ffbd7bea164a663 Mon Sep 17 00:00:00 2001 From: David Michon Date: Tue, 28 Mar 2023 13:38:29 -0700 Subject: [PATCH] Update watch documentation --- apps/heft/UPGRADING.md | 33 +++++------------- .../pluginFramework/InternalHeftSession.ts | 13 ------- apps/heft/src/schemas/heft.schema.json | 26 -------------- apps/heft/src/utilities/CoreConfigFiles.ts | 6 ---- .../heft-node-basic-tutorial/config/heft.json | 7 ---- .../heft-node-jest-tutorial/config/heft.json | 7 ---- .../config/heft.json | 7 ---- .../config/heft.json | 7 ---- .../config/heft.json | 7 ---- .../heft-jest-reporters-test/config/heft.json | 7 ---- .../profiles/default/config/heft.json | 7 ---- .../config/heft.json | 7 ---- .../config/heft.json | 7 ---- .../config/heft.json | 7 ---- build-tests/heft-sass-test/config/heft.json | 7 ---- .../config/heft.json | 7 ---- .../config/heft.json | 7 ---- .../config/heft.json | 7 ---- common/config/rush/pnpm-lock.yaml | 34 ++++++++++++++++--- common/config/rush/repo-state.json | 2 +- heft-plugins/heft-jest-plugin/UPGRADING.md | 3 ++ heft-plugins/heft-jest-plugin/package.json | 9 +---- .../profiles/default/config/heft.json | 7 ---- .../profiles/app/config/heft.json | 7 ---- .../profiles/library/config/heft.json | 7 ---- 25 files changed, 42 insertions(+), 203 deletions(-) diff --git a/apps/heft/UPGRADING.md b/apps/heft/UPGRADING.md index a8d9166a33d..260989f7188 100644 --- a/apps/heft/UPGRADING.md +++ b/apps/heft/UPGRADING.md @@ -1,6 +1,6 @@ # Upgrade notes for @rushstack/heft -### Heft 0.49.0-rc.1 +### Heft 0.50.0-rc.4 Multi-phase Heft is a complete re-write of the `@rushstack/heft` project with the intention of being more closely compatible with multi-phase Rush builds. In addition, this update brings greater customizability and improved parallel process handling to Heft. @@ -37,7 +37,7 @@ Additionally, task- and phase-specific parameters may be provided to the `heft r In addition, Heft will generate actions for each phase specified in the "heft.json" configuration. These actions are executed by running `heft ` and run Heft to the specified phase, including all phase dependencies. As such, these inferred Heft actions are equivalent to running `heft run --to `, and are intended as a CLI shorthand. #### Watch Mode -Watch mode is now a first-class feature in Heft. Watch mode actions are created for all Heft actions. For example, to run "build" and "test" phases in watch mode, either of the commands `heft test-watch` or `heft run-watch --to test`. When running in watch mode, Heft will start a file watcher and watch for changes, restarting the watch loop when changes to source files are detected. The list of changed files will be provided to the plugin for incremental processing. +Watch mode is now a first-class feature in Heft. Watch mode actions are created for all Heft actions. For example, to run "build" and "test" phases in watch mode, either of the commands `heft test-watch` or `heft run-watch --to test`. When running in watch mode, Heft prefers the `runIncremental` hook to the `run` hook (see [Heft Task Plugins](#heft-task-plugins)). #### Heft Plugins ##### Heft Lifecycle Plugins @@ -48,8 +48,11 @@ Heft lifecycle plugins provide the implementation for certain lifecycle-related ##### Heft Task Plugins Heft task plugins provide the implementation for Heft tasks. Heft plugins provide an `apply` method, and here plugins can hook into the following Tapable hooks: +- `registerFileOperations` - Invoked exactly once before the first time a plugin runs. Allows a plugin to register copy or delete operations using the same options as the `copyFiles` and `deleteFiles` Heft events (this hook is how those events are implemented). - `run` - Used to provide plugin-related task functionality -- `runIncremental` - Used to provide plugin-related task functionality when in watch mode. A list of modified files is provided for the plugin to process. If no `runIncremental` implementation is provided, Heft will fall back to using the `run` hook as usual. +- `runIncremental` - Used to provide plugin-related task functionality when in watch mode. If no `runIncremental` implementation is provided for a task, Heft will fall back to using the `run` hook as usual. The options structure includes two functions used to support watch operations: + - `requestRun()` - This function asks the Heft runtime to schedule a new run of the plugin's owning task, potentially cancelling the current build. + - `watchGlobAsync(patterns, options)` - This function is provided for convenience for the common case of monitoring a glob for changes. It returns a `Map` that enumerates the list of files (or folders) selected by the glob and whether or not they have changed since the previous invocation. It will automatically invoke the `requestRun()` callback if it detects changes to files or directory listings that might impact the output of the glob. ##### Heft Cross-Plugin Interaction Heft plugins can use the `requestAccessToPluginByName` API to access the requested plugin accessors. Accessors are objects provided by plugins for external use and are the ideal place to share plugin-specific information or hooks used to provide additional plugin functionality. @@ -154,21 +157,7 @@ The following is an example "heft.json" file defining both a "build" and a "test } } ``` -##### Watch Mode Options in "heft.json" -Since watch mode and the associated file watcher are now directly managed by Heft, some watch mode options have been provided to modify behavior when encountering modified source files: -```json -{ - "watchOptions": { - "ignoredSourceFileGlobs": [ - "**/*.snap" - ], - "forbiddenSourceFileGlobs": [ - "tsconfig.json" - ] - } -} -``` -These options allow developers to tell Heft to ignore when specific source file changes are made (for example, when checked-in snapshot files are updated by Jest) or to break the Heft build when specific source file changes are made (for example, modifying a configuration file that is only loaded on the first execution). Notably, these properties are global and apply to all watch mode actions. + ##### Property Inheritance in "heft.json" Previously, common properties between a "heft.json" file its extended base file would merge arrays and overwrite objects. Now, both arrays and objects will merge, allowing for simplified use of the "heft.json" file when customizing extended base configurations. @@ -199,12 +188,6 @@ One thing to note is that different mergeBehavior verbs are used for the merging { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - "**/*.snap" - ] - }, - "phasesByName": { "build": { "cleanFiles": [ @@ -337,7 +320,7 @@ In updating to the new version of Heft, plugins will also need to be updated for - Plugins can no longer define their own actions. If a plugin deserves its own action, a dedicated phase should be added to the consumers "heft.json" - The `runScript` Heft event has been modified to only accept a `runAsync` method, and the properties have been updated to reflect what is available to normal Heft task plugins - Path-related variables have been renamed to clarify they are paths (ex. `HeftConfiguration.buildFolder` is now `HeftConfiguration.buildFolderPath`) -- The `runIncremental` hook can now be utilized to add native incremental watch mode support +- The `runIncremental` hook can now be utilized to add ensure that watch mode rebuilds occur in proper dependency order - The `clean` hook was removed in favor of the `cleanFiles` option in "heft.json" in order to make it obvious what files are being cleaned and when - The `folderNameForTests` and `extensionForTests` properties are now specified in the `@rushstack/heft-jest-plugin` options in "heft.json" instead of in "typescript.json" diff --git a/apps/heft/src/pluginFramework/InternalHeftSession.ts b/apps/heft/src/pluginFramework/InternalHeftSession.ts index d094cd5f3fc..739038dcbe4 100644 --- a/apps/heft/src/pluginFramework/InternalHeftSession.ts +++ b/apps/heft/src/pluginFramework/InternalHeftSession.ts @@ -116,19 +116,6 @@ export class InternalHeftSession { return this._phasesByName!; } - public get watchOptions(): IHeftSessionWatchOptions { - if (!this._watchOptions) { - this._watchOptions = { - ignoredSourceFileGlobs: this._heftConfigurationJson.watchOptions?.ignoredSourceFileGlobs || [], - forbiddenSourceFileGlobs: [ - ...FORBIDDEN_SOURCE_FILE_GLOBS, - ...(this._heftConfigurationJson.watchOptions?.forbiddenSourceFileGlobs || []) - ] - }; - } - return this._watchOptions; - } - public getSessionForPhase(phase: HeftPhase): HeftPhaseSession { let phaseSession: HeftPhaseSession | undefined = this._phaseSessionsByPhase.get(phase); if (!phaseSession) { diff --git a/apps/heft/src/schemas/heft.schema.json b/apps/heft/src/schemas/heft.schema.json index 3c1163de4d1..3b0211d3275 100644 --- a/apps/heft/src/schemas/heft.schema.json +++ b/apps/heft/src/schemas/heft.schema.json @@ -102,32 +102,6 @@ "type": "string" }, - "watchOptions": { - "title": "Watch Mode Options", - "type": "object", - "description": "Global options used by Heft when running in watch mode.", - "properties": { - "ignoredSourceFileGlobs": { - "title": "Ignored Source File Globs", - "type": "array", - "description": "Glob patterns for source files that should be ignored when watching for changes. Changes to these files will still be detected and recorded by Heft, but will not trigger a rebuild.", - "items": { - "type": "string", - "pattern": "[^\\\\]" - } - }, - "forbiddenSourceFileGlobs": { - "title": "Forbidden Source File Globs", - "type": "array", - "description": "Glob patterns for source files that should break the build when watching for changes. Changes to these files will cause Heft to exit with an error. Changes in project \"package.json\" files and \"config\" and \".rush\" folders are always forbidden and do not need to be included in this list.", - "items": { - "type": "string", - "pattern": "[^\\\\]" - } - } - } - }, - "heftPlugins": { "type": "array", "description": "List of Heft plugins that are used by a project.", diff --git a/apps/heft/src/utilities/CoreConfigFiles.ts b/apps/heft/src/utilities/CoreConfigFiles.ts index f4f7024842f..b23d61d95ab 100644 --- a/apps/heft/src/utilities/CoreConfigFiles.ts +++ b/apps/heft/src/utilities/CoreConfigFiles.ts @@ -45,15 +45,9 @@ export interface IHeftConfigurationJsonPhases { [phaseName: string]: IHeftConfigurationJsonPhaseSpecifier; } -export interface IHeftConfigurationJsonWatchOptions { - ignoredSourceFileGlobs?: string[]; - forbiddenSourceFileGlobs?: string[]; -} - export interface IHeftConfigurationJson { heftPlugins?: IHeftConfigurationJsonPluginSpecifier[]; phasesByName?: IHeftConfigurationJsonPhases; - watchOptions?: IHeftConfigurationJsonWatchOptions; } export class CoreConfigFiles { diff --git a/build-tests-samples/heft-node-basic-tutorial/config/heft.json b/build-tests-samples/heft-node-basic-tutorial/config/heft.json index 99f9970a62b..fc8cb12b842 100644 --- a/build-tests-samples/heft-node-basic-tutorial/config/heft.json +++ b/build-tests-samples/heft-node-basic-tutorial/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests-samples/heft-node-jest-tutorial/config/heft.json b/build-tests-samples/heft-node-jest-tutorial/config/heft.json index fe26372d75a..a3a9d3fa0f7 100644 --- a/build-tests-samples/heft-node-jest-tutorial/config/heft.json +++ b/build-tests-samples/heft-node-jest-tutorial/config/heft.json @@ -1,13 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests-samples/heft-serverless-stack-tutorial/config/heft.json b/build-tests-samples/heft-serverless-stack-tutorial/config/heft.json index e8c79388f73..400e71407f8 100644 --- a/build-tests-samples/heft-serverless-stack-tutorial/config/heft.json +++ b/build-tests-samples/heft-serverless-stack-tutorial/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests-samples/heft-storybook-react-tutorial/config/heft.json b/build-tests-samples/heft-storybook-react-tutorial/config/heft.json index 9c1f6c5ea7c..e20e0d63567 100644 --- a/build-tests-samples/heft-storybook-react-tutorial/config/heft.json +++ b/build-tests-samples/heft-storybook-react-tutorial/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests-samples/heft-webpack-basic-tutorial/config/heft.json b/build-tests-samples/heft-webpack-basic-tutorial/config/heft.json index 54a28ec1dab..2560702fa9a 100644 --- a/build-tests-samples/heft-webpack-basic-tutorial/config/heft.json +++ b/build-tests-samples/heft-webpack-basic-tutorial/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests/heft-jest-reporters-test/config/heft.json b/build-tests/heft-jest-reporters-test/config/heft.json index 4aaf8495d69..1da5919b562 100644 --- a/build-tests/heft-jest-reporters-test/config/heft.json +++ b/build-tests/heft-jest-reporters-test/config/heft.json @@ -1,13 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests/heft-minimal-rig-test/profiles/default/config/heft.json b/build-tests/heft-minimal-rig-test/profiles/default/config/heft.json index fd136427294..88b7e9f7d34 100644 --- a/build-tests/heft-minimal-rig-test/profiles/default/config/heft.json +++ b/build-tests/heft-minimal-rig-test/profiles/default/config/heft.json @@ -1,13 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests/heft-node-everything-esm-module-test/config/heft.json b/build-tests/heft-node-everything-esm-module-test/config/heft.json index 997548fa19b..5a87c229fd6 100644 --- a/build-tests/heft-node-everything-esm-module-test/config/heft.json +++ b/build-tests/heft-node-everything-esm-module-test/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - "phasesByName": { "build": { "cleanFiles": [ diff --git a/build-tests/heft-node-everything-test/config/heft.json b/build-tests/heft-node-everything-test/config/heft.json index d52dafe5eca..b3e11933a92 100644 --- a/build-tests/heft-node-everything-test/config/heft.json +++ b/build-tests/heft-node-everything-test/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests/heft-parameter-plugin-test/config/heft.json b/build-tests/heft-parameter-plugin-test/config/heft.json index 9649c93d8a2..f7aea5d035a 100644 --- a/build-tests/heft-parameter-plugin-test/config/heft.json +++ b/build-tests/heft-parameter-plugin-test/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests/heft-sass-test/config/heft.json b/build-tests/heft-sass-test/config/heft.json index 0aea4124024..979a56d2b02 100644 --- a/build-tests/heft-sass-test/config/heft.json +++ b/build-tests/heft-sass-test/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests/heft-typescript-composite-test/config/heft.json b/build-tests/heft-typescript-composite-test/config/heft.json index a8cd6059079..1735ae95b6e 100644 --- a/build-tests/heft-typescript-composite-test/config/heft.json +++ b/build-tests/heft-typescript-composite-test/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests/heft-webpack4-everything-test/config/heft.json b/build-tests/heft-webpack4-everything-test/config/heft.json index 486f4ea2f40..5bc79bb7605 100644 --- a/build-tests/heft-webpack4-everything-test/config/heft.json +++ b/build-tests/heft-webpack4-everything-test/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/build-tests/heft-webpack5-everything-test/config/heft.json b/build-tests/heft-webpack5-everything-test/config/heft.json index b98a675e047..4f6721f3c72 100644 --- a/build-tests/heft-webpack5-everything-test/config/heft.json +++ b/build-tests/heft-webpack5-everything-test/config/heft.json @@ -4,13 +4,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 5429fee6333..cafc97d3b4b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1628,7 +1628,6 @@ importers: '@rushstack/heft-config-file': workspace:* '@rushstack/heft-legacy': npm:@rushstack/heft@0.47.0 '@rushstack/heft-node-rig': 1.11.14 - '@rushstack/heft-typescript-plugin': workspace:* '@rushstack/node-core-library': workspace:* '@types/heft-jest': 1.0.1 '@types/lodash': 4.14.116 @@ -1658,7 +1657,6 @@ importers: '@rushstack/heft': link:../../apps/heft '@rushstack/heft-legacy': /@rushstack/heft/0.47.0 '@rushstack/heft-node-rig': 1.11.14_4dchqclsvvgybys5sefjzqvuhm - '@rushstack/heft-typescript-plugin': link:../heft-typescript-plugin '@types/heft-jest': 1.0.1 '@types/lodash': 4.14.116 '@types/node': 14.18.36 @@ -3019,6 +3017,9 @@ packages: /@aws-cdk/cloud-assembly-schema/2.7.0: resolution: {integrity: sha512-vKTKLMPvzUhsYo3c4/EbMJq+bwIgHkwK0lV9fc5mQlnTUTyHe6nGIvyzmWWMd5BVEkgNzw+QdecxeeYJNu/doA==} engines: {node: '>= 14.15.0'} + dependencies: + jsonschema: 1.4.1 + semver: 7.3.8 dev: true bundledDependencies: - jsonschema @@ -3042,6 +3043,7 @@ packages: engines: {node: '>= 14.15.0'} dependencies: '@aws-cdk/cloud-assembly-schema': 2.7.0 + semver: 7.3.8 dev: true bundledDependencies: - semver @@ -4659,6 +4661,10 @@ packages: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 + /@balena/dockerignore/1.0.2: + resolution: {integrity: sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q==} + dev: true + /@base2/pretty-print-object/1.0.1: resolution: {integrity: sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA==} dev: true @@ -10463,7 +10469,16 @@ packages: peerDependencies: constructs: ^10.0.0 dependencies: + '@balena/dockerignore': 1.0.2 + case: 1.6.3 constructs: 10.0.130 + fs-extra: 9.1.0 + ignore: 5.2.4 + jsonschema: 1.4.1 + minimatch: 3.1.2 + punycode: 2.3.0 + semver: 7.3.8 + yaml: 1.10.2 dev: true bundledDependencies: - '@balena/dockerignore' @@ -11278,6 +11293,11 @@ packages: engines: {node: '>=4'} dev: true + /case/1.6.3: + resolution: {integrity: sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==} + engines: {node: '>= 0.8.0'} + dev: true + /ccount/1.1.0: resolution: {integrity: sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==} dev: true @@ -12412,12 +12432,12 @@ packages: cosmiconfig: 7.1.0 debug: 4.3.4 deps-regex: 0.1.4 - ignore: 5.1.9 + ignore: 5.2.4 is-core-module: 2.11.0 js-yaml: 3.14.1 json5: 2.2.3 lodash: 4.17.21 - minimatch: 3.0.8 + minimatch: 3.1.2 multimatch: 5.0.0 please-upgrade-node: 3.2.0 query-ast: 1.0.5 @@ -17131,6 +17151,10 @@ packages: resolution: {integrity: sha512-e0Jtg4KAzDJKKwzbLaUtinCn0RZseWBVRTRGihSpvFlM3wTR7ExSp+PTdeTsDrLNJUe7L7JYJe8mblHX5SCT6A==} engines: {node: '>=10.0'} + /jsonschema/1.4.1: + resolution: {integrity: sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==} + dev: true + /jsonwebtoken/9.0.0: resolution: {integrity: sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==} engines: {node: '>=12', npm: '>=6'} @@ -17969,7 +17993,7 @@ packages: array-differ: 3.0.0 array-union: 2.1.0 arrify: 2.0.1 - minimatch: 3.0.8 + minimatch: 3.1.2 dev: false /mute-stream/0.0.8: diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 4b4191d3f60..41d00ed4298 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "dc2dd3424be617844daad07bd5e9f9cdb6ff3999", + "pnpmShrinkwrapHash": "1d574b1792e227839a532fba6e0813a8996d305e", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } diff --git a/heft-plugins/heft-jest-plugin/UPGRADING.md b/heft-plugins/heft-jest-plugin/UPGRADING.md index 85ef896ab78..532a8d928a6 100644 --- a/heft-plugins/heft-jest-plugin/UPGRADING.md +++ b/heft-plugins/heft-jest-plugin/UPGRADING.md @@ -1,5 +1,8 @@ # Upgrade notes for @rushstack/heft-jest-plugin +### Version 0.6.0-rc.4 +This release of `heft-jest-plugin` switched from using Jest's transformer infrastructure and pointing at TypeScript source files to instead directly point Jest at the compiled output files, relying on source maps to redirect snapshot files back to the committed source folder. If no source maps are present, the plugin will assume that the project is authored in raw ECMAScript and expect to find snapshots in a `__snapshots__` folder directly alongside the test files. + ### Version 0.3.0 This release of `heft-jest-plugin` enabled Jest's `clearMocks` option by default. diff --git a/heft-plugins/heft-jest-plugin/package.json b/heft-plugins/heft-jest-plugin/package.json index 4e785a9d68e..22917560a4a 100644 --- a/heft-plugins/heft-jest-plugin/package.json +++ b/heft-plugins/heft-jest-plugin/package.json @@ -16,13 +16,7 @@ "_phase:test": "node ./node_modules/@rushstack/heft-legacy/bin/heft --unmanaged test --no-build" }, "peerDependencies": { - "@rushstack/heft": "^0.50.0", - "@rushstack/heft-typescript-plugin": "^0.1.0" - }, - "peerDependenciesMeta": { - "@rushstack/heft-typescript-plugin": { - "optional": true - } + "@rushstack/heft": "^0.50.0" }, "dependencies": { "@jest/core": "~29.3.1", @@ -41,7 +35,6 @@ "@rushstack/heft": "workspace:*", "@rushstack/heft-legacy": "npm:@rushstack/heft@0.47.0", "@rushstack/heft-node-rig": "1.11.14", - "@rushstack/heft-typescript-plugin": "workspace:*", "@types/heft-jest": "1.0.1", "@types/lodash": "4.14.116", "@types/node": "14.18.36", diff --git a/rigs/heft-node-rig/profiles/default/config/heft.json b/rigs/heft-node-rig/profiles/default/config/heft.json index bd1b9f28ff0..faa542aae3d 100644 --- a/rigs/heft-node-rig/profiles/default/config/heft.json +++ b/rigs/heft-node-rig/profiles/default/config/heft.json @@ -10,13 +10,6 @@ */ // "extends": "base-project/config/heft.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/rigs/heft-web-rig/profiles/app/config/heft.json b/rigs/heft-web-rig/profiles/app/config/heft.json index 61ff36eb531..c2cd6d4fa06 100644 --- a/rigs/heft-web-rig/profiles/app/config/heft.json +++ b/rigs/heft-web-rig/profiles/app/config/heft.json @@ -10,13 +10,6 @@ */ // "extends": "base-project/config/heft.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": { diff --git a/rigs/heft-web-rig/profiles/library/config/heft.json b/rigs/heft-web-rig/profiles/library/config/heft.json index 5afa89c542f..16cc8eb180e 100644 --- a/rigs/heft-web-rig/profiles/library/config/heft.json +++ b/rigs/heft-web-rig/profiles/library/config/heft.json @@ -10,13 +10,6 @@ */ // "extends": "base-project/config/heft.json", - "watchOptions": { - "ignoredSourceFileGlobs": [ - // Snapshots from Jest are updated even when the source file hasn't changed - "**/*.snap" - ] - }, - // TODO: Add comments "phasesByName": { "build": {