Skip to content

Commit

Permalink
Merge pull request #4472 from bartvandenende-wm/bartvandenende-wm/sto…
Browse files Browse the repository at this point in the history
…rybook-improvements

[heft-storybook-plugin] Add support for storybook 7, HMR and provide new plugin configuration options
  • Loading branch information
octogonz authored Jan 24, 2024
2 parents a1c8333 + 3482d2a commit 4eae55b
Show file tree
Hide file tree
Showing 16 changed files with 3,387 additions and 3,212 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bower_components
build/Release

# Dependency directories
node_modules/
node_modules
jspm_packages/

# Optional npm cache directory
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ These GitHub repositories provide supplementary resources for Rush Stack:
| [/build-tests-samples/heft-node-rig-tutorial](./build-tests-samples/heft-node-rig-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
| [/build-tests-samples/heft-serverless-stack-tutorial](./build-tests-samples/heft-serverless-stack-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
| [/build-tests-samples/heft-storybook-react-tutorial](./build-tests-samples/heft-storybook-react-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
| [/build-tests-samples/heft-storybook-react-tutorial-app](./build-tests-samples/heft-storybook-react-tutorial-app/) | Building this project is a regression test for heft-storybook-plugin |
| [/build-tests-samples/heft-storybook-react-tutorial-storykit](./build-tests-samples/heft-storybook-react-tutorial-storykit/) | Storybook build dependencies for heft-storybook-react-tutorial |
| [/build-tests-samples/heft-web-rig-app-tutorial](./build-tests-samples/heft-web-rig-app-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
| [/build-tests-samples/heft-web-rig-library-tutorial](./build-tests-samples/heft-web-rig-library-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# heft-storybook-react-tutorial-app

This is project builds the storybook exports from the
[heft-storybook-react-tutorial](https://github.com/microsoft/rushstack-samples/tree/main/heft/heft-storybook-react-tutorial) and is a regression test for the heft-storybook-plugin `cwdPackageName` option.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Defines configuration used by core Heft.
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json",

"phasesByName": {
"build": {
"tasksByName": {
"storybook": {
"taskPlugin": {
"pluginPackage": "@rushstack/heft-storybook-plugin",
"options": {
"storykitPackageName": "heft-storybook-react-tutorial-storykit",
"cliPackageName": "@storybook/react",
"cliCallingConvention": "storybook6",
"staticBuildOutputFolder": "dist",
"cwdPackageName": "heft-storybook-react-tutorial"
}
}
}
}
}
}
}
19 changes: 19 additions & 0 deletions build-tests-samples/heft-storybook-react-tutorial-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "heft-storybook-react-tutorial-app",
"description": "Building this project is a regression test for heft-storybook-plugin",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "heft build --clean --storybook",
"_phase:build": "heft run --only build -- --clean",
"_phase:test": ""
},
"dependencies": {
"heft-storybook-react-tutorial": "workspace: *"
},
"devDependencies": {
"@rushstack/heft-storybook-plugin": "workspace:*",
"@rushstack/heft": "workspace:*",
"heft-storybook-react-tutorial-storykit": "workspace:*"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"pluginPackage": "@rushstack/heft-storybook-plugin",
"options": {
"storykitPackageName": "heft-storybook-react-tutorial-storykit",
"startupModulePath": "@storybook/react/bin/index.js",
"staticBuildModulePath": "@storybook/react/bin/build.js",
"cliPackageName": "@storybook/react",
"cliCallingConvention": "storybook6",
"staticBuildOutputFolder": "dist-storybook"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"version": "1.0.0",
"private": true,
"scripts": {
"build": "heft build --clean --storybook",
"build": "heft build --clean",
"start": "heft build-watch",
"storybook": "heft build-watch --storybook",
"storybook": "heft build-watch --serve --storybook",
"build-storybook": "heft build --storybook",
"_phase:build": "heft run --only build -- --clean",
"_phase:build": "heft run --only build -- --clean --storybook",
"_phase:test": "heft run --only test -- --clean"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-storybook-plugin",
"comment": "Add support for storybook 7, HMR, and breaking chages in the plugin configuration option. The \"startupModulePath\" and \"staticBuildModulePath\" have been removed in favour of \"cliCallingConvention\" and \"cliPackageName\". A new 'cwdPackageName' option provides the ability to set an alternative dependency name as (cwd) target for the storybook commands." ,
"type": "minor"
}
],
"packageName": "@rushstack/heft-storybook-plugin"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/node-core-library",
"comment": "Improve 'bin' definition in `IPackageJson` type",
"type": "patch"
}
],
"packageName": "@rushstack/node-core-library"
}
Loading

0 comments on commit 4eae55b

Please sign in to comment.