Skip to content
Closed
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ These GitHub repositories provide supplementary resources for Rush Stack:
| [/rush-plugins/rush-redis-cobuild-plugin](./rush-plugins/rush-redis-cobuild-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Frush-redis-cobuild-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Frush-redis-cobuild-plugin) | | [@rushstack/rush-redis-cobuild-plugin](https://www.npmjs.com/package/@rushstack/rush-redis-cobuild-plugin) |
| [/rush-plugins/rush-resolver-cache-plugin](./rush-plugins/rush-resolver-cache-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Frush-resolver-cache-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Frush-resolver-cache-plugin) | | [@rushstack/rush-resolver-cache-plugin](https://www.npmjs.com/package/@rushstack/rush-resolver-cache-plugin) |
| [/rush-plugins/rush-serve-plugin](./rush-plugins/rush-serve-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Frush-serve-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Frush-serve-plugin) | | [@rushstack/rush-serve-plugin](https://www.npmjs.com/package/@rushstack/rush-serve-plugin) |
| [/storybook/telemetry-stub](./storybook/telemetry-stub/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fstorybook-telemetry-stub.svg)](https://badge.fury.io/js/%40rushstack%2Fstorybook-telemetry-stub) | [changelog](./storybook/telemetry-stub/CHANGELOG.md) | [@rushstack/storybook-telemetry-stub](https://www.npmjs.com/package/@rushstack/storybook-telemetry-stub) |
| [/webpack/hashed-folder-copy-plugin](./webpack/hashed-folder-copy-plugin/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fhashed-folder-copy-plugin.svg)](https://badge.fury.io/js/%40rushstack%2Fhashed-folder-copy-plugin) | [changelog](./webpack/hashed-folder-copy-plugin/CHANGELOG.md) | [@rushstack/hashed-folder-copy-plugin](https://www.npmjs.com/package/@rushstack/hashed-folder-copy-plugin) |
| [/webpack/loader-load-themed-styles](./webpack/loader-load-themed-styles/) | [![npm version](https://badge.fury.io/js/%40microsoft%2Floader-load-themed-styles.svg)](https://badge.fury.io/js/%40microsoft%2Floader-load-themed-styles) | [changelog](./webpack/loader-load-themed-styles/CHANGELOG.md) | [@microsoft/loader-load-themed-styles](https://www.npmjs.com/package/@microsoft/loader-load-themed-styles) |
| [/webpack/loader-raw-script](./webpack/loader-raw-script/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Floader-raw-script.svg)](https://badge.fury.io/js/%40rushstack%2Floader-raw-script) | [changelog](./webpack/loader-raw-script/CHANGELOG.md) | [@rushstack/loader-raw-script](https://www.npmjs.com/package/@rushstack/loader-raw-script) |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/storybook-telemetry-stub",
"comment": "Initial package creation: stub replacement for @storybook/telemetry",
"type": "minor"
}
],
"packageName": "@rushstack/storybook-telemetry-stub"
}
12 changes: 8 additions & 4 deletions common/config/rush/nonbrowser-approved-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@
"name": "@rushstack/heft-dev-cert-plugin",
"allowedCategories": [ "libraries", "tests" ]
},
{
"name": "@rushstack/heft-static-asset-typings-plugin",
"allowedCategories": [ "libraries", "tests" ]
},
{
"name": "@rushstack/heft-isolated-typescript-transpile-plugin",
"allowedCategories": [ "tests" ]
Expand Down Expand Up @@ -242,6 +238,10 @@
"name": "@rushstack/heft-serverless-stack-plugin",
"allowedCategories": [ "tests" ]
},
{
"name": "@rushstack/heft-static-asset-typings-plugin",
"allowedCategories": [ "libraries", "tests" ]
},
{
"name": "@rushstack/heft-storybook-plugin",
"allowedCategories": [ "tests" ]
Expand Down Expand Up @@ -474,6 +474,10 @@
"name": "@storybook/react-webpack5",
"allowedCategories": [ "libraries", "tests" ]
},
{
"name": "@storybook/telemetry-8",
"allowedCategories": [ "libraries" ]
},
{
"name": "@storybook/theming",
"allowedCategories": [ "tests" ]
Expand Down
3 changes: 2 additions & 1 deletion common/config/rush/pnpm-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@
// TODO: Remove once Heft is 1.0.0
"allowAny": ["@rushstack/heft"],
"allowedVersions": {
"webpack": "^4 || ^5"
"webpack": "^4 || ^5",
"storybook": "*"
}
},

Expand Down
58 changes: 41 additions & 17 deletions common/config/subspaces/default/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/subspaces/default/repo-state.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"pnpmShrinkwrapHash": "8cea08431b1a848463c751666dcd35e9533ea73d",
"pnpmShrinkwrapHash": "fd55f1b42937aafab015d7ca41826e4e34b5ea85",
"preferredVersionsHash": "029c99bd6e65c5e1f25e2848340509811ff9753c"
}
8 changes: 8 additions & 0 deletions rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,14 @@
"projectFolder": "libraries/rush-pnpm-kit-v10",
"reviewCategory": "libraries",
"shouldPublish": true
},

// "storybook" folder (alphabetical order)
{
"packageName": "@rushstack/storybook-telemetry-stub",
"projectFolder": "storybook/telemetry-stub",
"reviewCategory": "libraries",
"shouldPublish": true
}
]
}
36 changes: 36 additions & 0 deletions storybook/telemetry-stub/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# THIS IS A STANDARD TEMPLATE FOR .npmignore FILES IN THIS REPO.

# Ignore all files by default, to avoid accidentally publishing unintended files.
*

# Use negative patterns to bring back the specific things we want to publish.
!/bin/**
!/lib/**
!/lib-*/**
!/dist/**
!/includes/**

!CHANGELOG.md
!CHANGELOG.json
!heft-plugin.json
!rush-plugin-manifest.json
!ThirdPartyNotice.txt

# Ignore certain patterns that should not get published.
/dist/*.stats.*
/lib/**/test/
/lib-*/**/test/
*.test.js
*.test.[cm]js
*.test.d.ts
*.test.d.[cm]ts

# NOTE: These don't need to be specified, because NPM includes them automatically.
#
# package.json
# README.md
# LICENSE

# ---------------------------------------------------------------------------
# DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below.
# ---------------------------------------------------------------------------
24 changes: 24 additions & 0 deletions storybook/telemetry-stub/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@rushstack/storybook-telemetry-stub

Copyright (c) Microsoft Corporation. All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 14 additions & 0 deletions storybook/telemetry-stub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# @rushstack/storybook-telemetry-stub

A stub replacement of `@storybook/telemetry` for use in environments that absolutely forbid outbound
network connections and want to ensure that Storybook doesn't probe outside of its project folder,
e.g. for discovering what kind of package manager the repository uses.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README is important, since the usage and underlying motivations are not obvious from looking at the package itself. I think the README can be organized a bit better, along the lines of:

  1. The problem: Storybook makes network calls (why), mutates package.json (how? why?) during normal operation, etc. These are really separate behaviors, so let's call them out individually rather than rolling them into one sentence.
  2. Alternatives: Do certain versions of Storybook support environment variables or "off" switches? People from the Storybook community may claim that this stub is not needed for whatever reason, but maybe they are wrong in some edge cases. The README can provide a paragraph that we can use to track those details.
  3. How does it work: Explain stubbing.
  4. How do you use it? Briefly explain how somebody enables this in their Rush repo.


All exported names mirror those of the official `@storybook/telemetry` package, but every function
is a no-op and every object is an empty stand-in.

## Links

- [CHANGELOG.md](./CHANGELOG.md) - Find out what's new in the latest version

`@rushstack/storybook-telemetry-stub` is part of the [Rush Stack](https://rushstack.io/) family of projects.
3 changes: 3 additions & 0 deletions storybook/telemetry-stub/config/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "local-node-rig/profiles/default/config/jest.config.json"
}
4 changes: 4 additions & 0 deletions storybook/telemetry-stub/config/rig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
"rigPackageName": "local-node-rig"
}
18 changes: 18 additions & 0 deletions storybook/telemetry-stub/eslint.config.js
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-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
}
}
];
32 changes: 32 additions & 0 deletions storybook/telemetry-stub/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@rushstack/storybook-telemetry-stub",
"version": "0.0.0",
"description": "A stub replacement of @storybook/telemetry for environments that forbid outbound network connections",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/rushstack.git",
"directory": "storybook/telemetry-stub"
},
"license": "MIT",
"scripts": {
"build": "heft build --clean",
"start": "heft test --clean --watch",
"_phase:build": "heft run --only build -- --clean",
"_phase:test": "heft run --only test -- --clean"
},
"dependencies": {},
"devDependencies": {
"@storybook/telemetry-8": "npm:@storybook/telemetry@~8.6.0",
"@rushstack/heft": "workspace:*",
"eslint": "~9.37.0",
"local-node-rig": "workspace:*"
},
"typesVersions": {
"*": {
"lib/*": [
"lib-dts/*"
]
}
},
"sideEffects": false
}
Loading
Loading