Skip to content

Commit

Permalink
Merge branch 'next' into valentin/introduce-skip-compiler-typescript-…
Browse files Browse the repository at this point in the history
…option
  • Loading branch information
valentinpalkovic authored Nov 15, 2023
2 parents 217b11e + df35702 commit 7a561f4
Show file tree
Hide file tree
Showing 159 changed files with 1,195 additions and 1,429 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/generate-sandboxes-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:
git config --global user.name "Storybook Bot"
git config --global user.email "[email protected]"
- name: Install dependencies
run: node ./scripts/check-dependencies.js
run: |
cd ./scripts
node --loader esbuild-register/loader -r esbuild-register ./check-dependencies.ts
cd ..
- name: Compile Storybook libraries
run: yarn task --task compile --start-from=auto --no-link
- name: Publishing to local registry
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/generate-sandboxes-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:
git config --global user.name "Storybook Bot"
git config --global user.email "[email protected]"
- name: Install dependencies
run: node ./scripts/check-dependencies.js
run: |
cd ./scripts
node --loader esbuild-register/loader -r esbuild-register ./check-dependencies.ts
cd ..
- name: Compile Storybook libraries
run: yarn task --task compile --start-from=auto --no-link
- name: Publishing to local registry
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 7.6.0-alpha.6

- Addon: Move Visual Test addon to the code directory - [#24771](https://github.com/storybookjs/storybook/pull/24771), thanks [@cdedreuille](https://github.com/cdedreuille)!
- FastBuild: Improve config loading & naming - [#24837](https://github.com/storybookjs/storybook/pull/24837), thanks [@ndelangen](https://github.com/ndelangen)!
- TestBuild: Revert defaulting to SWC in test build, but keep using esbuild for minification - [#24843](https://github.com/storybookjs/storybook/pull/24843), thanks [@kasperpeulen](https://github.com/kasperpeulen)!
- Viewport: Add newer device viewports - [#24777](https://github.com/storybookjs/storybook/pull/24777), thanks [@Tomo5524](https://github.com/Tomo5524)!
- Vite: Prevent non-deterministic build output - [#24833](https://github.com/storybookjs/storybook/pull/24833), thanks [@henkerik](https://github.com/henkerik)!

## 7.6.0-alpha.5

- Addons, core: Make `react` and Storybook packages `devDependencies` where possible - [#24676](https://github.com/storybookjs/storybook/pull/24676), thanks [@JReinhold](https://github.com/JReinhold)!
Expand Down
73 changes: 60 additions & 13 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
const path = require('path');
const fs = require('fs');

const scriptPath = path.join(__dirname, '..', 'scripts');

const addonsPackages = fs
.readdirSync(path.join(__dirname, 'addons'))
.filter((p) => fs.statSync(path.join(__dirname, 'addons', p)).isDirectory());
const libPackages = fs
.readdirSync(path.join(__dirname, 'lib'))
.filter((p) => fs.statSync(path.join(__dirname, 'lib', p)).isDirectory());
const uiPackages = fs
.readdirSync(path.join(__dirname, 'ui'))
.filter((p) => fs.statSync(path.join(__dirname, 'ui', p)).isDirectory())
.filter((p) => !p.startsWith('.'));

module.exports = {
root: true,
extends: [path.join(scriptPath, '.eslintrc.cjs')],
Expand Down Expand Up @@ -53,7 +65,6 @@ module.exports = {
project: null,
},
rules: {
// '@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-throw-literal': 'off',
Expand All @@ -77,15 +88,7 @@ module.exports = {
},
{
// these packages use pre-bundling, dependencies will be bundled, and will be in devDepenencies
files: [
'addons/**/*',
'frameworks/**/*',
'lib/**/*',
'builders/**/*',
'deprecated/**/*',
'renderers/**/*',
'ui/**/*',
],
files: ['frameworks/**/*', 'builders/**/*', 'deprecated/**/*', 'renderers/**/*'],
excludedFiles: ['frameworks/angular/**/*', 'frameworks/ember/**/*', 'lib/core-server/**/*'],
rules: {
'import/no-extraneous-dependencies': [
Expand All @@ -95,11 +98,47 @@ module.exports = {
},
},
{
files: ['**/ui/*', '**/ui/.storybook/*'],
files: ['**/ui/.storybook/**'],
rules: {
'import/no-extraneous-dependencies': ['error', { packageDir: __dirname }],
'import/no-extraneous-dependencies': [
'error',
{ packageDir: [__dirname], devDependencies: true },
],
},
},
...addonsPackages.map((directory) => ({
files: [path.join('**', 'addons', directory, '**', '*.*')],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: [__dirname, path.join(__dirname, 'addons', directory)],
devDependencies: true,
},
],
},
})),
...uiPackages.map((directory) => ({
files: [path.join('**', 'ui', directory, '**', '*.*')],
rules: {
'import/no-extraneous-dependencies': [
'error',
{ packageDir: [__dirname, path.join(__dirname, 'ui', directory)], devDependencies: true },
],
},
})),
...libPackages.map((directory) => ({
files: [path.join('**', 'lib', directory, '**', '*.*')],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: [__dirname, path.join(__dirname, 'lib', directory)],
devDependencies: true,
},
],
},
})),
{
files: [
'**/__tests__/**',
Expand All @@ -121,16 +160,24 @@ module.exports = {
'react/require-default-props': 'off',
},
},
{ files: '**/.storybook/config.js', rules: { 'global-require': 'off' } },
{
files: ['**/*.stories.*'],
rules: {
'no-console': 'off',
},
},
{
files: ['**/renderers/preact/**/*'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
},
},
{
files: ['**/*.tsx', '**/*.ts'],
rules: {
'no-shadow': 'off',
'@typescript-eslint/ban-types': 'warn', // should become error, in the future
'react/require-default-props': 'off',
'react/prop-types': 'off', // we should use types
'react/forbid-prop-types': 'off', // we should use types
Expand Down
57 changes: 19 additions & 38 deletions code/addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "7.6.0-alpha.5",
"version": "7.6.0-alpha.6",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
Expand Down Expand Up @@ -32,21 +32,9 @@
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./manager": {
"types": "./dist/manager.d.ts",
"require": "./dist/manager.js",
"import": "./dist/manager.mjs"
},
"./preview": {
"types": "./dist/preview.d.ts",
"require": "./dist/preview.js",
"import": "./dist/preview.mjs"
},
"./register": {
"types": "./dist/manager.d.ts",
"require": "./dist/manager.js",
"import": "./dist/manager.mjs"
},
"./manager": "./dist/manager.js",
"./preview": "./dist/preview.js",
"./register": "./dist/manager.js",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand All @@ -61,47 +49,40 @@
],
"scripts": {
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/addon-highlight": "workspace:*",
"axe-core": "^4.2.0"
},
"devDependencies": {
"@storybook/channels": "workspace:*",
"@storybook/client-logger": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/theming": "workspace:*",
"@storybook/types": "workspace:*",
"axe-core": "^4.2.0",
"lodash": "^4.17.21",
"react-resize-detector": "^7.1.2"
},
"devDependencies": {
"@testing-library/react": "^11.2.2",
"lodash": "^4.17.21",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"react-resize-detector": "^7.1.2",
"resize-observer-polyfill": "^1.5.1",
"typescript": "~4.9.3"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
},
"bundler": {
"entries": [
"./src/index.ts",
"./src/manager.tsx",
"exportEntries": [
"./src/index.ts"
],
"managerEntries": [
"./src/manager.tsx"
],
"previewEntries": [
"./src/preview.tsx"
]
},
Expand Down
70 changes: 21 additions & 49 deletions code/addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "7.6.0-alpha.5",
"version": "7.6.0-alpha.6",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
Expand Down Expand Up @@ -33,21 +33,9 @@
"require": "./dist/decorator.js",
"import": "./dist/decorator.mjs"
},
"./manager": {
"types": "./dist/manager.d.ts",
"require": "./dist/manager.js",
"import": "./dist/manager.mjs"
},
"./preview": {
"types": "./dist/preview.d.ts",
"require": "./dist/preview.js",
"import": "./dist/preview.mjs"
},
"./register.js": {
"types": "./dist/manager.d.ts",
"require": "./dist/manager.js",
"import": "./dist/manager.mjs"
},
"./manager": "./dist/manager.js",
"./preview": "./dist/preview.js",
"./register.js": "./dist/manager.js",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand All @@ -58,14 +46,8 @@
"*": [
"dist/index.d.ts"
],
"manager": [
"dist/manager.d.ts"
],
"decorator": [
"dist/decorator.d.ts"
],
"preview": [
"dist/preview.d.ts"
]
}
},
Expand All @@ -78,51 +60,41 @@
],
"scripts": {
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/global": "^5.0.0",
"@types/uuid": "^9.0.1",
"dequal": "^2.0.2",
"polished": "^4.2.2",
"uuid": "^9.0.0"
},
"devDependencies": {
"@storybook/client-logger": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/theming": "workspace:*",
"@storybook/types": "workspace:*",
"dequal": "^2.0.2",
"lodash": "^4.17.21",
"polished": "^4.2.2",
"prop-types": "^15.7.2",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"react-inspector": "^6.0.0",
"telejson": "^7.2.0",
"ts-dedent": "^2.0.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/lodash": "^4.14.167",
"@types/uuid": "^9.0.1",
"typescript": "~4.9.3"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
},
"bundler": {
"entries": [
"./src/index.ts",
"exportEntries": [
"./src/decorator.ts",
"./src/manager.tsx",
"./src/index.ts"
],
"managerEntries": [
"./src/manager.tsx"
],
"previewEntries": [
"./src/preview.ts"
]
},
Expand Down
Loading

0 comments on commit 7a561f4

Please sign in to comment.