Skip to content

Commit

Permalink
Merge pull request #27474 from storybookjs/version-non-patch-from-8.2…
Browse files Browse the repository at this point in the history
….0-alpha.4

Release: Prerelease 8.2.0-alpha.5
  • Loading branch information
shilman authored Jun 2, 2024
2 parents 80703e3 + 6b84016 commit 70c69ef
Show file tree
Hide file tree
Showing 33 changed files with 432 additions and 127 deletions.
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

0 comments on commit 70c69ef

Please sign in to comment.