Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Prerelease 8.2.0-alpha.5 #27474

Merged
merged 20 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
142ab39
Bump Express.js
valentinpalkovic Mar 28, 2024
634d922
Merge branch 'next' into valentin/bump-express
valentinpalkovic Apr 1, 2024
dd4a0d6
Merge branch 'next' into valentin/bump-express
valentinpalkovic Apr 3, 2024
49e7ade
Merge remote-tracking branch 'origin/next' into valentin/bump-express
valentinpalkovic May 14, 2024
b50c0d3
fixed wrong detection of standalone component and added tests
dario-baumberger May 24, 2024
c86d64d
Merge branch 'next' into issue-26056-fix-mixed-extends-import-problem
valentinpalkovic May 24, 2024
cda2e71
Merge branch 'next' into issue-26056-fix-mixed-extends-import-problem
dario-baumberger May 24, 2024
89a193d
Merge branch 'next' into issue-26056-fix-mixed-extends-import-problem
valentinpalkovic May 28, 2024
11285d4
Merge branch 'next' into issue-26056-fix-mixed-extends-import-problem
dario-baumberger May 29, 2024
331f425
Update CHANGELOG.md for v8.1.5 [skip ci]
storybook-bot May 30, 2024
ea787d7
Use absolute imports in module mocking snippets
kylegach May 30, 2024
fa80d22
Merge pull request #27426 from storybookjs/update-sub-path-imports-sn…
kylegach May 30, 2024
9fa5e39
Merge branch 'next' into issue-26056-fix-mixed-extends-import-problem
valentinpalkovic May 31, 2024
cc0d087
Linting
valentinpalkovic May 31, 2024
2b3aedd
Merge pull request #27353 from dario-baumberger/issue-26056-fix-mixed…
valentinpalkovic May 31, 2024
c4ca417
Merge branch 'next' into valentin/bump-express
valentinpalkovic May 31, 2024
4bd5ef3
Merge pull request #26680 from storybookjs/valentin/bump-express
valentinpalkovic May 31, 2024
f993f25
Tags: Catch project-level tags errors and warn
shilman Jun 2, 2024
341904e
Merge pull request #27511 from storybookjs/shilman/27510-wrap-project…
shilman Jun 2, 2024
6b84016
Write changelog for 8.2.0-alpha.5 [skip ci]
storybook-bot Jun 2, 2024
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"ejs": "^3.1.10",
"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"
Expand Down
4 changes: 2 additions & 2 deletions code/builders/builder-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
"@types/find-cache-dir": "^3.2.1",
"browser-assert": "^1.2.1",
"es-module-lexer": "^1.5.0",
"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",
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"constants-browserify": "^1.0.0",
"css-loader": "^6.7.1",
"es-module-lexer": "^1.5.0",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
};
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"compression": "^1.7.4",
"detect-port": "^1.3.0",
"diff": "^5.2.0",
"express": "^4.17.3",
"express": "^4.19.2",
"fs-extra": "^11.1.0",
"globby": "^14.0.1",
"ip": "^2.0.1",
Expand Down
20 changes: 18 additions & 2 deletions code/lib/core-server/src/utils/StoryIndexGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion code/lib/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 3 additions & 2 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,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",
Expand Down Expand Up @@ -298,5 +298,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "8.2.0-alpha.5"
}
Loading