Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
fail-fast: false
matrix:
include:
# When Node 18 is removed, remove the special cases in
# - build-tests-samples/heft-storybook-v9-react-tutorial/build.js
# - build-tests-samples/heft-storybook-v9-react-tutorial-app/build.js
- NodeVersion: 18.20.x
NodeVersionDisplayName: 18
OS: ubuntu-latest
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ These GitHub repositories provide supplementary resources for Rush Stack:
| [/build-tests-samples/heft-node-jest-tutorial](./build-tests-samples/heft-node-jest-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
| [/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-storybook-v6-react-tutorial](./build-tests-samples/heft-storybook-v6-react-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
| [/build-tests-samples/heft-storybook-v6-react-tutorial-app](./build-tests-samples/heft-storybook-v6-react-tutorial-app/) | Building this project is a regression test for heft-storybook-plugin |
| [/build-tests-samples/heft-storybook-v6-react-tutorial-storykit](./build-tests-samples/heft-storybook-v6-react-tutorial-storykit/) | Storybook build dependencies for heft-storybook-v6-react-tutorial |
| [/build-tests-samples/heft-storybook-v9-react-tutorial](./build-tests-samples/heft-storybook-v9-react-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
| [/build-tests-samples/heft-storybook-v9-react-tutorial-app](./build-tests-samples/heft-storybook-v9-react-tutorial-app/) | Building this project is a regression test for heft-storybook-plugin |
| [/build-tests-samples/heft-storybook-v9-react-tutorial-storykit](./build-tests-samples/heft-storybook-v9-react-tutorial-storykit/) | Storybook build dependencies for heft-storybook-v9-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 |
| [/build-tests-samples/heft-webpack-basic-tutorial](./build-tests-samples/heft-webpack-basic-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft |
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# heft-storybook-react-v6-tutorial-app

This is project builds the storybook exports from the
[heft-storybook-v6-react-tutorial](https://github.com/microsoft/rushstack-samples/tree/main/heft/heft-storybook-v6-react-tutorial) and is a regression test for the heft-storybook-plugin `cwdPackageName` option.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"taskPlugin": {
"pluginPackage": "@rushstack/heft-storybook-plugin",
"options": {
"storykitPackageName": "heft-storybook-react-tutorial-storykit",
"storykitPackageName": "heft-storybook-v6-react-tutorial-storykit",
"cliPackageName": "@storybook/react",
"cliCallingConvention": "storybook6",
"staticBuildOutputFolder": "dist",
"cwdPackageName": "heft-storybook-react-tutorial"
"cwdPackageName": "heft-storybook-v6-react-tutorial"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "heft-storybook-react-tutorial-app",
"name": "heft-storybook-v6-react-tutorial-app",
"description": "Building this project is a regression test for heft-storybook-plugin",
"version": "1.0.0",
"private": true,
Expand All @@ -9,11 +9,11 @@
"_phase:test": ""
},
"dependencies": {
"heft-storybook-react-tutorial": "workspace: *"
"heft-storybook-v6-react-tutorial": "workspace: *"
},
"devDependencies": {
"@rushstack/heft-storybook-plugin": "workspace:*",
"@rushstack/heft": "workspace:*",
"heft-storybook-react-tutorial-storykit": "workspace:*"
"heft-storybook-v6-react-tutorial-storykit": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// The "rig.json" file directs tools to look for their config files in an external package.
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",

"rigPackageName": "local-web-rig",
"rigProfile": "library"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const nodeTrustedToolProfile = require('local-web-rig/profiles/library/includes/eslint/flat/profile/web-app');
const friendlyLocalsMixin = require('local-web-rig/profiles/library/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
}
}
];
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "heft-storybook-react-tutorial-storykit",
"name": "heft-storybook-v6-react-tutorial-storykit",
"version": "0.0.0",
"private": true,
"description": "Storybook build dependencies for heft-storybook-react-tutorial",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"description": "Storybook build dependencies for heft-storybook-v6-react-tutorial",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "",
"_phase:build": ""
"build": "heft build --clean",
"_phase:build": "heft run --only build -- --clean"
},
"devDependencies": {
"dependencies": {
"@babel/core": "~7.20.0",
"@storybook/addon-actions": "~6.4.18",
"@storybook/addon-essentials": "~6.4.18",
Expand All @@ -34,5 +34,10 @@
"terser-webpack-plugin": "~3.0.8",
"typescript": "~5.8.2",
"webpack": "~4.47.0"
},
"devDependencies": {
"@rushstack/heft": "workspace:*",
"eslint": "~9.37.0",
"local-web-rig": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

// eslint-disable-next-line no-restricted-syntax
export * from '@storybook/react';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./node_modules/local-web-rig/profiles/library/tsconfig-base.json",
"compilerOptions": {
// The dependencies of this project have issues
"skipLibCheck": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.vscode
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# heft-webpack-basic-tutorial
# heft-storybook-v6-react-tutorial

This is a copy of the
[heft-storybook-react-tutorial](https://github.com/microsoft/rushstack-samples/tree/main/heft/heft-storybook-react-tutorial)
[heft-storybook-v6-react-tutorial](https://github.com/microsoft/rushstack-samples/tree/main/heft/heft-storybook-v6-react-tutorial)
tutorial project from the [rushstack-samples](https://github.com/microsoft/rushstack-samples) repo.

The copy here serves as a regression test, by using `"workspace:*"` references to the local projects in this repo.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"taskPlugin": {
"pluginPackage": "@rushstack/heft-storybook-plugin",
"options": {
"storykitPackageName": "heft-storybook-react-tutorial-storykit",
"storykitPackageName": "heft-storybook-v6-react-tutorial-storykit",
"cliPackageName": "@storybook/react",
"cliCallingConvention": "storybook6",
"staticBuildOutputFolder": "dist-storybook"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "heft-storybook-react-tutorial",
"name": "heft-storybook-v6-react-tutorial",
"description": "(Copy of sample project) Building this project is a regression test for Heft",
"version": "1.0.0",
"private": true,
Expand Down Expand Up @@ -33,7 +33,7 @@
"@types/webpack-env": "1.18.8",
"css-loader": "~5.2.7",
"eslint": "~9.37.0",
"heft-storybook-react-tutorial-storykit": "workspace:*",
"heft-storybook-v6-react-tutorial-storykit": "workspace:*",
"html-webpack-plugin": "~4.5.2",
"local-eslint-config": "workspace:*",
"source-map-loader": "~1.1.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE in the project root for license information.

import * as React from 'react';
import type { ComponentStory, ComponentMeta } from 'heft-storybook-react-tutorial-storykit';
import type { ComponentStory, ComponentMeta } from 'heft-storybook-v6-react-tutorial-storykit';

import { ToggleSwitch } from './ToggleSwitch';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# heft-storybook-v9-react-tutorial-app

This is project builds the storybook exports from the
[heft-storybook-v9-react-tutorial-app](https://github.com/microsoft/rushstack-samples/tree/main/heft/heft-storybook-v9-react-tutorial-app) 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,32 @@
// TODO: Remove this and change the _phase:build script back to "heft run --only build -- --clean --storybook"
// when we drop support for Node 18

const { Executable, Import } = require('@rushstack/node-core-library');

const heftBinPath = Import.resolveModule({
modulePath: '@rushstack/heft/bin/heft',
baseFolderPath: __dirname
});

const heftArgs = [
heftBinPath,
'run',
'--only',
'build',
'--',
'--clean',
...(process.version.startsWith('v18.')
? [] // Under Node 18, don't run storybook
: ['--storybook'])
];

const { signal, status } = Executable.spawnSync(process.argv0, heftArgs, {
stdio: 'inherit',
environment: process.env
});

if (signal) {
process.kill(process.pid, signal);
} else {
process.exit(status);
}
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-v9-react-tutorial-storykit",
"cliPackageName": "storybook",
"cliCallingConvention": "storybook9",
"staticBuildOutputFolder": "dist",
"cwdPackageName": "heft-storybook-v9-react-tutorial"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file exists for caching purposes in the rushstack repo
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json",

"operationSettings": [
{
"operationName": "_phase:lite-build",
"outputFolderNames": ["dist"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "heft-storybook-v9-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:lite-build": "node ./build"
},
"dependencies": {
"heft-storybook-v9-react-tutorial": "workspace: *"
},
"devDependencies": {
"@rushstack/heft-storybook-plugin": "workspace:*",
"@rushstack/heft": "workspace:*",
"heft-storybook-v9-react-tutorial-storykit": "workspace:*",
"@rushstack/node-core-library": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// The "rig.json" file directs tools to look for their config files in an external package.
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",

"rigPackageName": "local-web-rig",
"rigProfile": "library"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const nodeTrustedToolProfile = require('local-web-rig/profiles/library/includes/eslint/flat/profile/web-app');
const friendlyLocalsMixin = require('local-web-rig/profiles/library/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
}
}
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "heft-storybook-v9-react-tutorial-storykit",
"version": "0.0.0",
"private": true,
"description": "Storybook build dependencies for heft-storybook-v9-react-tutorial",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "heft build --clean",
"_phase:build": "heft run --only build -- --clean"
},
"dependencies": {
"@babel/core": "~7.20.0",
"@storybook/cli": "~9.1.6",
"@storybook/react": "~9.1.6",
"@storybook/react-webpack5": "~9.1.6",
"@types/heft-jest": "1.0.1",
"@types/node": "20.17.19",
"@types/react-dom": "19.2.3",
"@types/react": "19.2.7",
"@types/webpack-env": "1.18.8",
"babel-loader": "~8.2.3",
"css-loader": "~5.2.7",
"jest": "~29.3.1",
"react-dom": "~19.2.3",
"react": "~19.2.3",
"style-loader": "~2.0.0",
"terser-webpack-plugin": "~3.0.8",
"typescript": "~5.8.2",
"webpack": "~5.103.0",
"storybook": "~9.1.6",
"@testing-library/dom": "~7.21.4"
},
"devDependencies": {
"@rushstack/heft": "workspace:*",
"eslint": "~9.37.0",
"local-web-rig": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

// eslint-disable-next-line no-restricted-syntax
export * from '@storybook/react';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./node_modules/local-web-rig/profiles/library/tsconfig-base.json",
"compilerOptions": {
// The dependencies of this project have issues
"skipLibCheck": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.vscode
Loading
Loading