-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29332 from storybookjs/version-non-patch-from-8.4…
….0-alpha.6 Release: Prerelease 8.4.0-alpha.7
- Loading branch information
Showing
16 changed files
with
231 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default <T>(a: T[], b: T[]): T[] => { | ||
// no point in intersecting if one of the input is ill-defined | ||
if (!a || !b) { | ||
return []; | ||
} | ||
|
||
return a.reduce((acc: T[], aValue) => { | ||
if (b.includes(aValue)) { | ||
acc.push(aValue); | ||
} | ||
|
||
return acc; | ||
}, []); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
import intersect from '../lib/intersect'; | ||
|
||
describe('Manager API utilities - intersect', () => { | ||
it('returns identity when intersecting identity', () => { | ||
const a = ['foo', 'bar']; | ||
expect(intersect(a, a)).toEqual(a); | ||
}); | ||
|
||
it('returns a when b is a superset of a', () => { | ||
const a = ['foo', 'bar']; | ||
const b = ['a', 'foo', 'b', 'bar', 'c', 'ter']; | ||
expect(intersect(a, b)).toEqual(a); | ||
}); | ||
|
||
it('returns b when a is a superset of b', () => { | ||
const a = ['a', 'foo', 'b', 'bar', 'c', 'ter']; | ||
const b = ['foo', 'bar']; | ||
expect(intersect(a, b)).toEqual(b); | ||
}); | ||
|
||
it('returns an intersection', () => { | ||
const a = ['a', 'bar', 'b', 'c']; | ||
const b = ['foo', 'bar', 'ter']; | ||
expect(intersect(a, b)).toEqual(['bar']); | ||
}); | ||
|
||
it('returns an empty set when there is no overlap', () => { | ||
const a = ['a', 'b', 'c']; | ||
const b = ['foo', 'bar', 'ter']; | ||
expect(intersect(a, b)).toEqual([]); | ||
}); | ||
|
||
it('returns an empty set if a is undefined', () => { | ||
const b = ['foo', 'bar', 'ter']; | ||
expect(intersect(undefined as unknown as [], b)).toEqual([]); | ||
}); | ||
|
||
it('returns an empty set if b is undefined', () => { | ||
const a = ['foo', 'bar', 'ter']; | ||
expect(intersect(a, undefined as unknown as [])).toEqual([]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
code/lib/create-storybook/src/generators/SVELTE/index.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
import type { JsPackageManager } from '@storybook/core/common'; | ||
|
||
import { getAddonSvelteCsfVersion } from './index'; | ||
|
||
describe('installed', () => { | ||
it.each([ | ||
['3.0.0', ''], | ||
['4.0.0', '4'], | ||
['5.0.0', '^5.0.0-next.0'], | ||
['6.0.0', ''], | ||
['3.0.0-next.0', ''], | ||
['4.0.0-next.0', '4'], | ||
['4.2.19::__archiveUrl=https%3A%2F%2Fregistry.npmjs.org%2Fsvelte%2F-%2Fsvelte-4.2.19.tgz', '4'], | ||
['5.0.0-next.0', '^5.0.0-next.0'], | ||
['6.0.0-next.0', ''], | ||
])('svelte %s => %s', async (svelteVersion, expectedAddonSpecifier) => { | ||
const packageManager = { | ||
getInstalledVersion: async (pkg: string) => (pkg === 'svelte' ? svelteVersion : undefined), | ||
getAllDependencies: async () => ({ svelte: `^${svelteVersion}` }), | ||
} as any as JsPackageManager; | ||
await expect(getAddonSvelteCsfVersion(packageManager)).resolves.toBe(expectedAddonSpecifier); | ||
}); | ||
}); | ||
|
||
describe('uninstalled', () => { | ||
it.each([ | ||
['^3', ''], | ||
['^4', '4'], | ||
['^5', '^5.0.0-next.0'], | ||
['^6', ''], | ||
['^3.0.0-next.0', ''], | ||
['^4.0.0-next.0', '4'], | ||
['^5.0.0-next.0', '^5.0.0-next.0'], | ||
['^6.0.0-next.0', ''], | ||
])('svelte %s => %s', async (svelteSpecifier, expectedAddonSpecifier) => { | ||
const packageManager = { | ||
getInstalledVersion: async (pkg: string) => undefined, | ||
getAllDependencies: async () => ({ svelte: svelteSpecifier }), | ||
} as any as JsPackageManager; | ||
await expect(getAddonSvelteCsfVersion(packageManager)).resolves.toBe(expectedAddonSpecifier); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,5 +293,6 @@ | |
"Dependency Upgrades" | ||
] | ||
] | ||
} | ||
}, | ||
"deferredNextVersion": "8.4.0-alpha.7" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
```shell renderer="common" language="js" packageManager="npm" | ||
npx storybook add @storybook/addon-a11y | ||
``` | ||
|
||
```shell renderer="common" language="js" packageManager="pnpm" | ||
pnpm exec storybook add @storybook/addon-a11y | ||
``` | ||
|
||
```shell renderer="common" language="js" packageManager="yarn" | ||
yarn exec storybook add @storybook/addon-a11y | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,3 @@ const config: StorybookConfig = { | |
|
||
export default config; | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"8.4.0-alpha.6","info":{"plain":"- Addon-docs, blocks: Prebundle dependencies - [#29301](https://github.com/storybookjs/storybook/pull/29301), thanks @JReinhold!\n- React: Prebundle all of `renderers/react`'s dependencies - [#29298](https://github.com/storybookjs/storybook/pull/29298), thanks @ndelangen!\n- Vite: Cleanup and prebundle dependencies - [#29302](https://github.com/storybookjs/storybook/pull/29302), thanks @JReinhold!"}} | ||
{"version":"8.4.0-alpha.7","info":{"plain":"- CLI: Install Svelte CSF v5 in Svelte5 projects - [#29323](https://github.com/storybookjs/storybook/pull/29323), thanks @shilman!\n- Manager: Add tags property to ComponentEntry objects - [#29343](https://github.com/storybookjs/storybook/pull/29343), thanks @Sidnioulz!"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters