From 142ab393206bc3d47504064adcbe8d37f37e0bed Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 28 Mar 2024 15:59:39 +0100 Subject: [PATCH 1/7] Bump Express.js --- code/builders/builder-manager/package.json | 2 +- code/builders/builder-vite/package.json | 4 +- code/builders/builder-webpack5/package.json | 2 +- code/lib/core-server/package.json | 2 +- code/lib/types/package.json | 2 +- code/package.json | 2 +- code/yarn.lock | 96 +++++++++++++++++-- scripts/package.json | 4 +- scripts/yarn.lock | 94 ++++++++++++++++-- .../server-kitchen-sink/package.json | 4 +- 10 files changed, 184 insertions(+), 28 deletions(-) diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json index 78e7cad39276..e111dd0d92e7 100644 --- a/code/builders/builder-manager/package.json +++ b/code/builders/builder-manager/package.json @@ -54,7 +54,7 @@ "ejs": "^3.1.8", "esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0", "esbuild-plugin-alias": "^0.2.1", - "express": "^4.17.3", + "express": "^4.19.2", "fs-extra": "^11.1.0", "process": "^0.11.10", "util": "^0.12.4" diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 33a9b5ce1edb..036270247c8c 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -55,14 +55,14 @@ "@types/find-cache-dir": "^3.2.1", "browser-assert": "^1.2.1", "es-module-lexer": "^0.9.3", - "express": "^4.17.3", + "express": "^4.19.2", "find-cache-dir": "^3.0.0", "fs-extra": "^11.1.0", "magic-string": "^0.30.0", "ts-dedent": "^2.0.0" }, "devDependencies": { - "@types/express": "^4.17.13", + "@types/express": "^4.17.21", "@types/node": "^18.0.0", "glob": "^10.0.0", "slash": "^5.0.0", diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 86a394065112..286178b95726 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -79,7 +79,7 @@ "constants-browserify": "^1.0.0", "css-loader": "^6.7.1", "es-module-lexer": "^1.4.1", - "express": "^4.17.3", + "express": "^4.19.2", "fork-ts-checker-webpack-plugin": "^8.0.0", "fs-extra": "^11.1.0", "html-webpack-plugin": "^5.5.0", diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index 3ca426d6bfb0..d7549a6d1abb 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -81,7 +81,7 @@ "cli-table3": "^0.6.1", "compression": "^1.7.4", "detect-port": "^1.3.0", - "express": "^4.17.3", + "express": "^4.19.2", "fs-extra": "^11.1.0", "globby": "^11.0.2", "ip": "^2.0.1", diff --git a/code/lib/types/package.json b/code/lib/types/package.json index d3f6b1dd7217..8dce4bc18edc 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "@storybook/channels": "workspace:*", - "@types/express": "^4.7.0", + "@types/express": "^4.17.21", "file-system-cache": "2.3.0" }, "devDependencies": { diff --git a/code/package.json b/code/package.json index 399bf6dd0b11..42bc962d49ff 100644 --- a/code/package.json +++ b/code/package.json @@ -179,7 +179,7 @@ "@testing-library/jest-dom": "6.1.4", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", - "@types/express": "^4.17.11", + "@types/express": "^4.17.21", "@types/fs-extra": "^11.0.1", "@types/lodash": "^4.14.167", "@types/mock-require": "^2.0.3", diff --git a/code/yarn.lock b/code/yarn.lock index f4deb1517325..1cc66297b292 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5255,7 +5255,7 @@ __metadata: ejs: "npm:^3.1.8" esbuild: "npm:^0.18.0 || ^0.19.0 || ^0.20.0" esbuild-plugin-alias: "npm:^0.2.1" - express: "npm:^4.17.3" + express: "npm:^4.19.2" fs-extra: "npm:^11.1.0" process: "npm:^0.11.10" slash: "npm:^5.0.0" @@ -5277,12 +5277,12 @@ __metadata: "@storybook/preview": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/types": "workspace:*" - "@types/express": "npm:^4.17.13" + "@types/express": "npm:^4.17.21" "@types/find-cache-dir": "npm:^3.2.1" "@types/node": "npm:^18.0.0" browser-assert: "npm:^1.2.1" es-module-lexer: "npm:^0.9.3" - express: "npm:^4.17.3" + express: "npm:^4.19.2" find-cache-dir: "npm:^3.0.0" fs-extra: "npm:^11.1.0" glob: "npm:^10.0.0" @@ -5330,7 +5330,7 @@ __metadata: constants-browserify: "npm:^1.0.0" css-loader: "npm:^6.7.1" es-module-lexer: "npm:^1.4.1" - express: "npm:^4.17.3" + express: "npm:^4.19.2" fork-ts-checker-webpack-plugin: "npm:^8.0.0" fs-extra: "npm:^11.1.0" html-webpack-plugin: "npm:^5.5.0" @@ -5592,7 +5592,7 @@ __metadata: cli-table3: "npm:^0.6.1" compression: "npm:^1.7.4" detect-port: "npm:^1.3.0" - express: "npm:^4.17.3" + express: "npm:^4.19.2" fs-extra: "npm:^11.1.0" globby: "npm:^11.0.2" ip: "npm:^2.0.1" @@ -6414,7 +6414,7 @@ __metadata: "@testing-library/jest-dom": "npm:6.1.4" "@testing-library/react": "npm:^14.0.0" "@testing-library/user-event": "npm:^14.4.3" - "@types/express": "npm:^4.17.11" + "@types/express": "npm:^4.17.21" "@types/fs-extra": "npm:^11.0.1" "@types/lodash": "npm:^4.14.167" "@types/mock-require": "npm:^2.0.3" @@ -6713,7 +6713,7 @@ __metadata: dependencies: "@storybook/channels": "workspace:*" "@storybook/csf": "npm:^0.1.2" - "@types/express": "npm:^4.7.0" + "@types/express": "npm:^4.17.21" "@types/fs-extra": "npm:^11.0.1" "@types/node": "npm:^18.0.0" file-system-cache: "npm:2.3.0" @@ -7404,7 +7404,7 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:*, @types/express@npm:^4.17.11, @types/express@npm:^4.17.13, @types/express@npm:^4.7.0": +"@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.21": version: 4.17.21 resolution: "@types/express@npm:4.17.21" dependencies: @@ -10368,6 +10368,26 @@ __metadata: languageName: node linkType: hard +"body-parser@npm:1.20.2": + version: 1.20.2 + resolution: "body-parser@npm:1.20.2" + dependencies: + bytes: "npm:3.1.2" + content-type: "npm:~1.0.5" + debug: "npm:2.6.9" + depd: "npm:2.0.0" + destroy: "npm:1.2.0" + http-errors: "npm:2.0.0" + iconv-lite: "npm:0.4.24" + on-finished: "npm:2.4.1" + qs: "npm:6.11.0" + raw-body: "npm:2.5.2" + type-is: "npm:~1.6.18" + unpipe: "npm:1.0.0" + checksum: 10c0/06f1438fff388a2e2354c96aa3ea8147b79bfcb1262dfcc2aae68ec13723d01d5781680657b74e9f83c808266d5baf52804032fbde2b7382b89bd8cdb273ace9 + languageName: node + linkType: hard + "bonjour-service@npm:^1.0.11": version: 1.1.1 resolution: "bonjour-service@npm:1.1.1" @@ -11874,7 +11894,7 @@ __metadata: languageName: node linkType: hard -"content-type@npm:~1.0.4": +"content-type@npm:~1.0.4, content-type@npm:~1.0.5": version: 1.0.5 resolution: "content-type@npm:1.0.5" checksum: 10c0/b76ebed15c000aee4678c3707e0860cb6abd4e680a598c0a26e17f0bfae723ec9cc2802f0ff1bc6e4d80603719010431d2231018373d4dde10f9ccff9dadf5af @@ -11909,6 +11929,13 @@ __metadata: languageName: node linkType: hard +"cookie@npm:0.6.0": + version: 0.6.0 + resolution: "cookie@npm:0.6.0" + checksum: 10c0/f2318b31af7a31b4ddb4a678d024514df5e705f9be5909a192d7f116cfb6d45cbacf96a473fa733faa95050e7cff26e7832bb3ef94751592f1387b71c8956686 + languageName: node + linkType: hard + "copy-anything@npm:^2.0.1": version: 2.0.6 resolution: "copy-anything@npm:2.0.6" @@ -14654,6 +14681,45 @@ __metadata: languageName: node linkType: hard +"express@npm:^4.19.2": + version: 4.19.2 + resolution: "express@npm:4.19.2" + dependencies: + accepts: "npm:~1.3.8" + array-flatten: "npm:1.1.1" + body-parser: "npm:1.20.2" + content-disposition: "npm:0.5.4" + content-type: "npm:~1.0.4" + cookie: "npm:0.6.0" + cookie-signature: "npm:1.0.6" + debug: "npm:2.6.9" + depd: "npm:2.0.0" + encodeurl: "npm:~1.0.2" + escape-html: "npm:~1.0.3" + etag: "npm:~1.8.1" + finalhandler: "npm:1.2.0" + fresh: "npm:0.5.2" + http-errors: "npm:2.0.0" + merge-descriptors: "npm:1.0.1" + methods: "npm:~1.1.2" + on-finished: "npm:2.4.1" + parseurl: "npm:~1.3.3" + path-to-regexp: "npm:0.1.7" + proxy-addr: "npm:~2.0.7" + qs: "npm:6.11.0" + range-parser: "npm:~1.2.1" + safe-buffer: "npm:5.2.1" + send: "npm:0.18.0" + serve-static: "npm:1.15.0" + setprototypeof: "npm:1.2.0" + statuses: "npm:2.0.1" + type-is: "npm:~1.6.18" + utils-merge: "npm:1.0.1" + vary: "npm:~1.1.2" + checksum: 10c0/e82e2662ea9971c1407aea9fc3c16d6b963e55e3830cd0ef5e00b533feda8b770af4e3be630488ef8a752d7c75c4fcefb15892868eeaafe7353cb9e3e269fdcb + languageName: node + linkType: hard + "extend-shallow@npm:^2.0.1": version: 2.0.1 resolution: "extend-shallow@npm:2.0.1" @@ -23470,6 +23536,18 @@ __metadata: languageName: node linkType: hard +"raw-body@npm:2.5.2": + version: 2.5.2 + resolution: "raw-body@npm:2.5.2" + dependencies: + bytes: "npm:3.1.2" + http-errors: "npm:2.0.0" + iconv-lite: "npm:0.4.24" + unpipe: "npm:1.0.0" + checksum: 10c0/b201c4b66049369a60e766318caff5cb3cc5a900efd89bdac431463822d976ad0670912c931fdbdcf5543207daf6f6833bca57aa116e1661d2ea91e12ca692c4 + languageName: node + linkType: hard + "rc@npm:^1.2.7": version: 1.2.8 resolution: "rc@npm:1.2.8" diff --git a/scripts/package.json b/scripts/package.json index bff065475ea5..7d12d061c438 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -87,7 +87,7 @@ "@types/detect-port": "^1.3.2", "@types/ejs": "^3.1.1", "@types/escodegen": "^0.0.6", - "@types/express": "^4.17.11", + "@types/express": "^4.17.21", "@types/fs-extra": "^11.0.1", "@types/http-server": "^0.12.1", "@types/jest": "^29.5.5", @@ -129,7 +129,7 @@ "eslint": "^8.56.0", "eslint-plugin-storybook": "^0.8.0", "execa": "^6.1.0", - "express": "^4.17.3", + "express": "^4.19.2", "fast-folder-size": "^2.1.0", "fast-glob": "^3.2.12", "find-up": "^5.0.0", diff --git a/scripts/yarn.lock b/scripts/yarn.lock index e48f40c7ef08..dac6b393110f 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -2734,7 +2734,7 @@ __metadata: "@types/detect-port": "npm:^1.3.2" "@types/ejs": "npm:^3.1.1" "@types/escodegen": "npm:^0.0.6" - "@types/express": "npm:^4.17.11" + "@types/express": "npm:^4.17.21" "@types/fs-extra": "npm:^11.0.1" "@types/http-server": "npm:^0.12.1" "@types/jest": "npm:^29.5.5" @@ -2777,7 +2777,7 @@ __metadata: eslint: "npm:^8.56.0" eslint-plugin-storybook: "npm:^0.8.0" execa: "npm:^6.1.0" - express: "npm:^4.17.3" + express: "npm:^4.19.2" fast-folder-size: "npm:^2.1.0" fast-glob: "npm:^3.2.12" find-up: "npm:^5.0.0" @@ -3060,15 +3060,15 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:^4.17.11": - version: 4.17.20 - resolution: "@types/express@npm:4.17.20" +"@types/express@npm:^4.17.21": + version: 4.17.21 + resolution: "@types/express@npm:4.17.21" dependencies: "@types/body-parser": "npm:*" "@types/express-serve-static-core": "npm:^4.17.33" "@types/qs": "npm:*" "@types/serve-static": "npm:*" - checksum: 10c0/f73f5f92bd0a0fa4697598be3122c89522caa9e3bcb14c28b5e6d58a8e47f0301027478997153ae9ee4cf3d432576fb3fb0918ea0db521cc1204f8b759828a32 + checksum: 10c0/12e562c4571da50c7d239e117e688dc434db1bac8be55613294762f84fd77fbd0658ccd553c7d3ab02408f385bc93980992369dd30e2ecd2c68c358e6af8fabf languageName: node linkType: hard @@ -4838,6 +4838,26 @@ __metadata: languageName: node linkType: hard +"body-parser@npm:1.20.2": + version: 1.20.2 + resolution: "body-parser@npm:1.20.2" + dependencies: + bytes: "npm:3.1.2" + content-type: "npm:~1.0.5" + debug: "npm:2.6.9" + depd: "npm:2.0.0" + destroy: "npm:1.2.0" + http-errors: "npm:2.0.0" + iconv-lite: "npm:0.4.24" + on-finished: "npm:2.4.1" + qs: "npm:6.11.0" + raw-body: "npm:2.5.2" + type-is: "npm:~1.6.18" + unpipe: "npm:1.0.0" + checksum: 10c0/06f1438fff388a2e2354c96aa3ea8147b79bfcb1262dfcc2aae68ec13723d01d5781680657b74e9f83c808266d5baf52804032fbde2b7382b89bd8cdb273ace9 + languageName: node + linkType: hard + "boxen@npm:^7.1.1": version: 7.1.1 resolution: "boxen@npm:7.1.1" @@ -5521,7 +5541,7 @@ __metadata: languageName: node linkType: hard -"content-type@npm:~1.0.4": +"content-type@npm:~1.0.4, content-type@npm:~1.0.5": version: 1.0.5 resolution: "content-type@npm:1.0.5" checksum: 10c0/b76ebed15c000aee4678c3707e0860cb6abd4e680a598c0a26e17f0bfae723ec9cc2802f0ff1bc6e4d80603719010431d2231018373d4dde10f9ccff9dadf5af @@ -5549,6 +5569,13 @@ __metadata: languageName: node linkType: hard +"cookie@npm:0.6.0": + version: 0.6.0 + resolution: "cookie@npm:0.6.0" + checksum: 10c0/f2318b31af7a31b4ddb4a678d024514df5e705f9be5909a192d7f116cfb6d45cbacf96a473fa733faa95050e7cff26e7832bb3ef94751592f1387b71c8956686 + languageName: node + linkType: hard + "cookies@npm:0.8.0": version: 0.8.0 resolution: "cookies@npm:0.8.0" @@ -7256,7 +7283,7 @@ __metadata: languageName: node linkType: hard -"express@npm:4.18.2, express@npm:^4.17.3": +"express@npm:4.18.2": version: 4.18.2 resolution: "express@npm:4.18.2" dependencies: @@ -7295,6 +7322,45 @@ __metadata: languageName: node linkType: hard +"express@npm:^4.19.2": + version: 4.19.2 + resolution: "express@npm:4.19.2" + dependencies: + accepts: "npm:~1.3.8" + array-flatten: "npm:1.1.1" + body-parser: "npm:1.20.2" + content-disposition: "npm:0.5.4" + content-type: "npm:~1.0.4" + cookie: "npm:0.6.0" + cookie-signature: "npm:1.0.6" + debug: "npm:2.6.9" + depd: "npm:2.0.0" + encodeurl: "npm:~1.0.2" + escape-html: "npm:~1.0.3" + etag: "npm:~1.8.1" + finalhandler: "npm:1.2.0" + fresh: "npm:0.5.2" + http-errors: "npm:2.0.0" + merge-descriptors: "npm:1.0.1" + methods: "npm:~1.1.2" + on-finished: "npm:2.4.1" + parseurl: "npm:~1.3.3" + path-to-regexp: "npm:0.1.7" + proxy-addr: "npm:~2.0.7" + qs: "npm:6.11.0" + range-parser: "npm:~1.2.1" + safe-buffer: "npm:5.2.1" + send: "npm:0.18.0" + serve-static: "npm:1.15.0" + setprototypeof: "npm:1.2.0" + statuses: "npm:2.0.1" + type-is: "npm:~1.6.18" + utils-merge: "npm:1.0.1" + vary: "npm:~1.1.2" + checksum: 10c0/e82e2662ea9971c1407aea9fc3c16d6b963e55e3830cd0ef5e00b533feda8b770af4e3be630488ef8a752d7c75c4fcefb15892868eeaafe7353cb9e3e269fdcb + languageName: node + linkType: hard + "extend-shallow@npm:^2.0.1": version: 2.0.1 resolution: "extend-shallow@npm:2.0.1" @@ -12599,6 +12665,18 @@ __metadata: languageName: node linkType: hard +"raw-body@npm:2.5.2": + version: 2.5.2 + resolution: "raw-body@npm:2.5.2" + dependencies: + bytes: "npm:3.1.2" + http-errors: "npm:2.0.0" + iconv-lite: "npm:0.4.24" + unpipe: "npm:1.0.0" + checksum: 10c0/b201c4b66049369a60e766318caff5cb3cc5a900efd89bdac431463822d976ad0670912c931fdbdcf5543207daf6f6833bca57aa116e1661d2ea91e12ca692c4 + languageName: node + linkType: hard + "react-dom@npm:^18.2.0": version: 18.2.0 resolution: "react-dom@npm:18.2.0" diff --git a/test-storybooks/server-kitchen-sink/package.json b/test-storybooks/server-kitchen-sink/package.json index 7ed22443414b..44a029118f38 100644 --- a/test-storybooks/server-kitchen-sink/package.json +++ b/test-storybooks/server-kitchen-sink/package.json @@ -96,11 +96,11 @@ "@storybook/server-webpack5": "7.2.0-alpha.0", "concurrently": "^5.3.0", "cors": "^2.8.5", - "express": "^4.17.3", + "express": "^4.19.2", "morgan": "^1.10.0", "nodemon": "^2.0.7", "pug": "^3.0.0", "safe-identifier": "^0.4.1", "storybook": "7.2.0-alpha.0" } -} \ No newline at end of file +} From b50c0d34aa82be486e65325f52342a19548c1113 Mon Sep 17 00:00:00 2001 From: Dario Baumberger Date: Fri, 24 May 2024 07:39:31 +0200 Subject: [PATCH 2/7] fixed wrong detection of standalone component and added tests --- .../utils/PropertyExtractor.test.ts | 20 +++++++++++++++++++ .../angular-beta/utils/PropertyExtractor.ts | 12 ++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.test.ts b/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.test.ts index f92a4047dc5f..b5256a08370d 100644 --- a/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.test.ts +++ b/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.test.ts @@ -19,6 +19,11 @@ const TestComponent1 = Component({})(class {}); const TestComponent2 = Component({})(class {}); const StandaloneTestComponent = Component({ standalone: true })(class {}); const StandaloneTestDirective = Directive({ standalone: true })(class {}); +const MixedTestComponent1 = Component({ standalone: true })( + class extends StandaloneTestComponent {} +); +const MixedTestComponent2 = Component({})(class extends MixedTestComponent1 {}); +const MixedTestComponent3 = Component({ standalone: true })(class extends MixedTestComponent2 {}); const TestModuleWithDeclarations = NgModule({ declarations: [TestComponent1] })(class {}); const TestModuleWithImportsAndProviders = NgModule({ imports: [TestModuleWithDeclarations], @@ -152,6 +157,21 @@ describe('PropertyExtractor', () => { const { isStandalone } = PropertyExtractor.analyzeDecorators(StandaloneTestComponent); expect(isStandalone).toBe(true); }); + + it('isStandalone should be true', () => { + const { isStandalone } = PropertyExtractor.analyzeDecorators(MixedTestComponent1); + expect(isStandalone).toBe(true); + }); + + it('isStandalone should be false', () => { + const { isStandalone } = PropertyExtractor.analyzeDecorators(MixedTestComponent2); + expect(isStandalone).toBe(false); + }); + + it('isStandalone should be true', () => { + const { isStandalone } = PropertyExtractor.analyzeDecorators(MixedTestComponent3); + expect(isStandalone).toBe(true); + }); }); describe('extractProviders', () => { diff --git a/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.ts b/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.ts index 487fc3121c71..a0194da784bd 100644 --- a/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.ts +++ b/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.ts @@ -175,7 +175,17 @@ export class PropertyExtractor implements NgModuleMetadata { const isPipe = decorators.some((d) => this.isDecoratorInstanceOf(d, 'Pipe')); const isDeclarable = isComponent || isDirective || isPipe; - const isStandalone = (isComponent || isDirective) && decorators.some((d) => d.standalone); + + // Check if the hierarchically lowest Component or Directive decorator (the only relevant for importing dependencies) is standalone. + const isStandalone = !!( + (isComponent || isDirective) && + [...decorators] + .reverse() // reflectionCapabilities returns decorators in a hierarchically top-down order + .find( + (d) => + this.isDecoratorInstanceOf(d, 'Component') || this.isDecoratorInstanceOf(d, 'Directive') + )?.standalone + ); return { isDeclarable, isStandalone }; }; From 331f4256c35e5afeb3a45bc5786addab71252822 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Thu, 30 May 2024 04:22:18 +0000 Subject: [PATCH 3/7] Update CHANGELOG.md for v8.1.5 [skip ci] --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f44e6e3dfdf0..3ad9cb833c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 8.1.5 + +- CSF-Tools: Fix export specifier bug - [#27418](https://github.com/storybookjs/storybook/pull/27418), thanks @valentinpalkovic! +- Dependency: Upgrade tempy - [#27366](https://github.com/storybookjs/storybook/pull/27366), thanks @mnigh! +- Tags: Refine composition behavior - [#27379](https://github.com/storybookjs/storybook/pull/27379), thanks @shilman! +- Theming: Fix self-referencing type - [#27155](https://github.com/storybookjs/storybook/pull/27155), thanks @SimenB! + ## 8.1.4 - Angular: Revert style adjustments - [#27361](https://github.com/storybookjs/storybook/pull/27361), thanks @valentinpalkovic! From ea787d700a91c83c60c198220b4a8d1d0a81b754 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Thu, 30 May 2024 13:04:30 -0600 Subject: [PATCH 4/7] Use absolute imports in module mocking snippets --- docs/snippets/angular/before-each-in-meta-mock-date.ts.mdx | 2 +- docs/snippets/angular/storybook-test-fn-mock-spy.ts.mdx | 4 ++-- docs/snippets/angular/storybook-test-mock-return-value.ts.mdx | 2 +- docs/snippets/common/before-each-in-meta-mock-date.js.mdx | 2 +- docs/snippets/common/before-each-in-meta-mock-date.ts-4-9.mdx | 2 +- docs/snippets/common/before-each-in-meta-mock-date.ts.mdx | 2 +- docs/snippets/common/storybook-test-fn-mock-spy.js.mdx | 4 ++-- docs/snippets/common/storybook-test-fn-mock-spy.ts-4-9.mdx | 4 ++-- docs/snippets/common/storybook-test-fn-mock-spy.ts.mdx | 4 ++-- docs/snippets/common/storybook-test-mock-return-value.js.mdx | 2 +- .../common/storybook-test-mock-return-value.ts-4-9.mdx | 2 +- docs/snippets/common/storybook-test-mock-return-value.ts.mdx | 2 +- .../web-components/before-each-in-meta-mock-date.ts.mdx | 2 +- .../snippets/web-components/storybook-test-fn-mock-spy.js.mdx | 4 ++-- .../snippets/web-components/storybook-test-fn-mock-spy.ts.mdx | 4 ++-- .../web-components/storybook-test-mock-return-value.js.mdx | 2 +- .../web-components/storybook-test-mock-return-value.ts.mdx | 2 +- 17 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/snippets/angular/before-each-in-meta-mock-date.ts.mdx b/docs/snippets/angular/before-each-in-meta-mock-date.ts.mdx index 8168708e3825..1d2cf99e0127 100644 --- a/docs/snippets/angular/before-each-in-meta-mock-date.ts.mdx +++ b/docs/snippets/angular/before-each-in-meta-mock-date.ts.mdx @@ -4,7 +4,7 @@ import type { Meta, StoryObj } from '@storybook/angular'; import MockDate from 'mockdate'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; import { Page } from './Page'; const meta: Meta = { diff --git a/docs/snippets/angular/storybook-test-fn-mock-spy.ts.mdx b/docs/snippets/angular/storybook-test-fn-mock-spy.ts.mdx index 2108d5f64f1b..e23845a4be7a 100644 --- a/docs/snippets/angular/storybook-test-fn-mock-spy.ts.mdx +++ b/docs/snippets/angular/storybook-test-fn-mock-spy.ts.mdx @@ -4,8 +4,8 @@ import type { Meta, StoryObj } from '@storybook/angular'; import { expect, userEvent, within } from '@storybook/test'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { saveNote } from '../../app/actions.mock'; -import { createNotes } from '../../mocks/notes'; +import { saveNote } from '#app/actions.mock'; +import { createNotes } from '#mocks/notes'; import NoteUI from './note-ui'; const meta: Meta = { diff --git a/docs/snippets/angular/storybook-test-mock-return-value.ts.mdx b/docs/snippets/angular/storybook-test-mock-return-value.ts.mdx index f86630d0fe85..9c5c5982efe4 100644 --- a/docs/snippets/angular/storybook-test-mock-return-value.ts.mdx +++ b/docs/snippets/angular/storybook-test-mock-return-value.ts.mdx @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/angular'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; import { Page } from './Page'; const meta: Meta = { diff --git a/docs/snippets/common/before-each-in-meta-mock-date.js.mdx b/docs/snippets/common/before-each-in-meta-mock-date.js.mdx index 88358f60cbac..b39e8d8120b0 100644 --- a/docs/snippets/common/before-each-in-meta-mock-date.js.mdx +++ b/docs/snippets/common/before-each-in-meta-mock-date.js.mdx @@ -2,7 +2,7 @@ // Page.stories.js import MockDate from 'mockdate'; -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; import { Page } from './Page'; export default { diff --git a/docs/snippets/common/before-each-in-meta-mock-date.ts-4-9.mdx b/docs/snippets/common/before-each-in-meta-mock-date.ts-4-9.mdx index 32aa8c4dfe70..4a26f603d1ed 100644 --- a/docs/snippets/common/before-each-in-meta-mock-date.ts-4-9.mdx +++ b/docs/snippets/common/before-each-in-meta-mock-date.ts-4-9.mdx @@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/your-renderer'; import MockDate from 'mockdate'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; import { Page } from './Page'; const meta = { diff --git a/docs/snippets/common/before-each-in-meta-mock-date.ts.mdx b/docs/snippets/common/before-each-in-meta-mock-date.ts.mdx index cc15ba1b6251..89c3ca1717da 100644 --- a/docs/snippets/common/before-each-in-meta-mock-date.ts.mdx +++ b/docs/snippets/common/before-each-in-meta-mock-date.ts.mdx @@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/your-renderer'; import MockDate from 'mockdate'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; import { Page } from './Page'; const meta: Meta = { diff --git a/docs/snippets/common/storybook-test-fn-mock-spy.js.mdx b/docs/snippets/common/storybook-test-fn-mock-spy.js.mdx index b647d7f747f2..e9d26c1b36c4 100644 --- a/docs/snippets/common/storybook-test-fn-mock-spy.js.mdx +++ b/docs/snippets/common/storybook-test-fn-mock-spy.js.mdx @@ -2,8 +2,8 @@ // NoteUI.stories.js import { expect, userEvent, within } from '@storybook/test'; -import { saveNote } from '../../app/actions.mock'; -import { createNotes } from '../../mocks/notes'; +import { saveNote } from '#app/actions.mock'; +import { createNotes } from '#mocks/notes'; import NoteUI from './note-ui'; export default { diff --git a/docs/snippets/common/storybook-test-fn-mock-spy.ts-4-9.mdx b/docs/snippets/common/storybook-test-fn-mock-spy.ts-4-9.mdx index ebfeb6f4e41b..a081b0f00883 100644 --- a/docs/snippets/common/storybook-test-fn-mock-spy.ts-4-9.mdx +++ b/docs/snippets/common/storybook-test-fn-mock-spy.ts-4-9.mdx @@ -5,8 +5,8 @@ import type { Meta, StoryObj } from '@storybook/your-renderer'; import { expect, userEvent, within } from '@storybook/test'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { saveNote } from '../../app/actions.mock'; -import { createNotes } from '../../mocks/notes'; +import { saveNote } from '#app/actions.mock'; +import { createNotes } from '#mocks/notes'; import NoteUI from './note-ui'; const meta = { diff --git a/docs/snippets/common/storybook-test-fn-mock-spy.ts.mdx b/docs/snippets/common/storybook-test-fn-mock-spy.ts.mdx index 0b350296f3e6..3e2418789d6c 100644 --- a/docs/snippets/common/storybook-test-fn-mock-spy.ts.mdx +++ b/docs/snippets/common/storybook-test-fn-mock-spy.ts.mdx @@ -5,8 +5,8 @@ import type { Meta, StoryObj } from '@storybook/your-renderer'; import { expect, userEvent, within } from '@storybook/test'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { saveNote } from '../../app/actions.mock'; -import { createNotes } from '../../mocks/notes'; +import { saveNote } from '#app/actions.mock'; +import { createNotes } from '#mocks/notes'; import NoteUI from './note-ui'; const meta: Meta = { diff --git a/docs/snippets/common/storybook-test-mock-return-value.js.mdx b/docs/snippets/common/storybook-test-mock-return-value.js.mdx index cad1a2854f2f..40359fae8522 100644 --- a/docs/snippets/common/storybook-test-mock-return-value.js.mdx +++ b/docs/snippets/common/storybook-test-mock-return-value.js.mdx @@ -1,6 +1,6 @@ ```js // Page.stories.js -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; import { Page } from './Page'; export default { diff --git a/docs/snippets/common/storybook-test-mock-return-value.ts-4-9.mdx b/docs/snippets/common/storybook-test-mock-return-value.ts-4-9.mdx index 6044c33ddb99..8db3429a8bfa 100644 --- a/docs/snippets/common/storybook-test-mock-return-value.ts-4-9.mdx +++ b/docs/snippets/common/storybook-test-mock-return-value.ts-4-9.mdx @@ -4,7 +4,7 @@ import type { Meta, StoryObj } from '@storybook/your-renderer'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; import { Page } from './Page'; const meta = { diff --git a/docs/snippets/common/storybook-test-mock-return-value.ts.mdx b/docs/snippets/common/storybook-test-mock-return-value.ts.mdx index 549751464b22..bf7c4164992b 100644 --- a/docs/snippets/common/storybook-test-mock-return-value.ts.mdx +++ b/docs/snippets/common/storybook-test-mock-return-value.ts.mdx @@ -4,7 +4,7 @@ import type { Meta, StoryObj } from '@storybook/your-renderer'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; import { Page } from './Page'; const meta: Meta = { diff --git a/docs/snippets/web-components/before-each-in-meta-mock-date.ts.mdx b/docs/snippets/web-components/before-each-in-meta-mock-date.ts.mdx index 3e1c4911e348..166b29c6028e 100644 --- a/docs/snippets/web-components/before-each-in-meta-mock-date.ts.mdx +++ b/docs/snippets/web-components/before-each-in-meta-mock-date.ts.mdx @@ -4,7 +4,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import MockDate from 'mockdate'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; const meta: Meta = { component: 'my-page', diff --git a/docs/snippets/web-components/storybook-test-fn-mock-spy.js.mdx b/docs/snippets/web-components/storybook-test-fn-mock-spy.js.mdx index b89c145a5114..c93f3ba6b3ef 100644 --- a/docs/snippets/web-components/storybook-test-fn-mock-spy.js.mdx +++ b/docs/snippets/web-components/storybook-test-fn-mock-spy.js.mdx @@ -2,8 +2,8 @@ // NoteUI.stories.js import { expect, userEvent, within } from '@storybook/test'; -import { saveNote } from '../../app/actions.mock'; -import { createNotes } from '../../mocks/notes'; +import { saveNote } from '#app/actions.mock'; +import { createNotes } from '#mocks/notes'; export default { title: 'Mocked/NoteUI', diff --git a/docs/snippets/web-components/storybook-test-fn-mock-spy.ts.mdx b/docs/snippets/web-components/storybook-test-fn-mock-spy.ts.mdx index 9a94601ec81d..dfb83b7f8f07 100644 --- a/docs/snippets/web-components/storybook-test-fn-mock-spy.ts.mdx +++ b/docs/snippets/web-components/storybook-test-fn-mock-spy.ts.mdx @@ -4,8 +4,8 @@ import type { Meta, StoryObj } from '@storybook/react'; import { expect, userEvent, within } from '@storybook/test'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { saveNote } from '../../app/actions.mock'; -import { createNotes } from '../../mocks/notes'; +import { saveNote } from '#app/actions.mock'; +import { createNotes } from '#mocks/notes'; const meta: Meta = { title: 'Mocked/NoteUI', diff --git a/docs/snippets/web-components/storybook-test-mock-return-value.js.mdx b/docs/snippets/web-components/storybook-test-mock-return-value.js.mdx index 9f89343855b3..04c8c9858980 100644 --- a/docs/snippets/web-components/storybook-test-mock-return-value.js.mdx +++ b/docs/snippets/web-components/storybook-test-mock-return-value.js.mdx @@ -1,6 +1,6 @@ ```js // Page.stories.js -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; export default { component: 'my-page', diff --git a/docs/snippets/web-components/storybook-test-mock-return-value.ts.mdx b/docs/snippets/web-components/storybook-test-mock-return-value.ts.mdx index 54ffafc25108..053eb05ec8c6 100644 --- a/docs/snippets/web-components/storybook-test-mock-return-value.ts.mdx +++ b/docs/snippets/web-components/storybook-test-mock-return-value.ts.mdx @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; // 👇 Must include the `.mock` portion of filename to have mocks typed correctly -import { getUserFromSession } from '../../api/session.mock'; +import { getUserFromSession } from '#api/session.mock'; const meta: Meta = { component: 'my-page', From cc0d087aef0b1685cbb3e3fe03b083b84b367a2a Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 10:54:08 +0200 Subject: [PATCH 5/7] Linting --- code/lib/cli/src/automigrate/fixes/react-docgen.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/lib/cli/src/automigrate/fixes/react-docgen.ts b/code/lib/cli/src/automigrate/fixes/react-docgen.ts index 9800e0cb3b05..41e0875f475d 100644 --- a/code/lib/cli/src/automigrate/fixes/react-docgen.ts +++ b/code/lib/cli/src/automigrate/fixes/react-docgen.ts @@ -62,9 +62,9 @@ export const reactDocgen: Fix = { For known "react-docgen" limitations, see: ${chalk.yellow('https://github.com/storybookjs/storybook/issues/26606')} - Press Y to revert to ${chalk.cyan( - 'react-docgen-typesript' - )}, press N to use ${chalk.cyan('react-docgen')} + Press Y to revert to ${chalk.cyan('react-docgen-typesript')}, press N to use ${chalk.cyan( + 'react-docgen' + )} `; } }, From f993f25a479799c61e7f3d4b34ec83a9136d6678 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sun, 2 Jun 2024 12:18:49 +0800 Subject: [PATCH 6/7] Tags: Catch project-level tags errors and warn --- .../src/utils/StoryIndexGenerator.ts | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index ca8149656992..3330a7e21a54 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -672,8 +672,24 @@ export class StoryIndexGenerator { const defaultTags = ['dev', 'test']; const extraTags = this.options.docs.autodocs === true ? [AUTODOCS_TAG] : []; if (previewCode) { - const projectAnnotations = loadConfig(previewCode).parse(); - projectTags = projectAnnotations.getFieldValue(['tags']) ?? []; + try { + const projectAnnotations = loadConfig(previewCode).parse(); + projectTags = projectAnnotations.getFieldValue(['tags']) ?? []; + } catch (err) { + once.warn(dedent` + Unable to parse tags from project configuration. If defined, tags should be specified inline, e.g. + + export default { + tags: ['foo'], + } + + --- + + Received: + + ${previewCode} + `); + } } return [...defaultTags, ...projectTags, ...extraTags]; } From 6b840163d7aa29b9e9e1c7792fae1ca3d94d1fa5 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Sun, 2 Jun 2024 11:44:47 +0000 Subject: [PATCH 7/7] Write changelog for 8.2.0-alpha.5 [skip ci] --- CHANGELOG.prerelease.md | 6 ++++++ code/package.json | 3 ++- docs/versions/next.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 8d60a9ad49f8..7bcf905f3bc2 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,9 @@ +## 8.2.0-alpha.5 + +- Angular: Fix wrong detection of standalone components - [#27353](https://github.com/storybookjs/storybook/pull/27353), thanks @dario-baumberger! +- Dependency: Bump Express.js - [#26680](https://github.com/storybookjs/storybook/pull/26680), thanks @valentinpalkovic! +- Tags: Fix unsafe project-level tags lookup - [#27511](https://github.com/storybookjs/storybook/pull/27511), thanks @shilman! + ## 8.2.0-alpha.4 - CSF-Tools: Fix export specifier bug - [#27418](https://github.com/storybookjs/storybook/pull/27418), thanks @valentinpalkovic! diff --git a/code/package.json b/code/package.json index 1c74b360ae0d..b7faa6d9d7b5 100644 --- a/code/package.json +++ b/code/package.json @@ -298,5 +298,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "8.2.0-alpha.5" } diff --git a/docs/versions/next.json b/docs/versions/next.json index db3913715b30..467a20f42b4c 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.2.0-alpha.4","info":{"plain":"- CSF-Tools: Fix export specifier bug - [#27418](https://github.com/storybookjs/storybook/pull/27418), thanks @valentinpalkovic!\n- Dependency: Upgrade tempy - [#27366](https://github.com/storybookjs/storybook/pull/27366), thanks @mnigh!\n- Tags: Refine composition behavior - [#27379](https://github.com/storybookjs/storybook/pull/27379), thanks @shilman!\n- Theming: Fix self-referencing type - [#27155](https://github.com/storybookjs/storybook/pull/27155), thanks @SimenB!\n- Vue3: Enable new hydration mismatch compile time flag - [#27192](https://github.com/storybookjs/storybook/pull/27192), thanks @Cherry!"}} +{"version":"8.2.0-alpha.5","info":{"plain":"- Angular: Fix wrong detection of standalone components - [#27353](https://github.com/storybookjs/storybook/pull/27353), thanks @dario-baumberger!\n- Dependency: Bump Express.js - [#26680](https://github.com/storybookjs/storybook/pull/26680), thanks @valentinpalkovic!\n- Tags: Fix unsafe project-level tags lookup - [#27511](https://github.com/storybookjs/storybook/pull/27511), thanks @shilman!"}}