Merge pull request #14258 from storybookjs/fix/update-wc-types

WebComponents: Fix types and improve CLI detection
This commit is contained in:
Norbert de Langen 2021-03-17 14:26:13 +01:00 committed by GitHub
commit a4e981c68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 5 deletions

View File

@ -1,5 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { TemplateResult, SVGTemplateResult } from 'lit-element';
import { TemplateResult, SVGTemplateResult } from 'lit-html';
export type { RenderContext } from '@storybook/core';
export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';

View File

@ -159,6 +159,16 @@ const MOCK_FRAMEWORK_FILES = [
},
},
},
{
name: ProjectType.WEB_COMPONENTS,
files: {
'package.json': {
dependencies: {
'lit-html': '1.0.0',
},
},
},
},
{
name: ProjectType.MITHRIL,
files: {

View File

@ -206,9 +206,9 @@ export const supportedTemplates: TemplateConfiguration[] = [
},
{
preset: ProjectType.WEB_COMPONENTS,
dependencies: ['lit-element'],
dependencies: ['lit-element', 'lit-html'],
matcherFunction: ({ dependencies }) => {
return dependencies.every(Boolean);
return dependencies.some(Boolean);
},
},
{

View File

@ -164,7 +164,7 @@ export const vue3: Parameters = {
export const web_components: Parameters = {
name: 'web_components',
version: 'latest',
generator: fromDeps('lit-html', 'lit-element'),
generator: fromDeps('lit-element'),
};
export const web_components_typescript: Parameters = {

View File

@ -51,6 +51,10 @@ packages:
access: $all
publish: $all
proxy: npmjs
'@storybook/addon-svelte-csf':
access: $all
publish: $all
proxy: npmjs
# storybook packages are NOT proxied to global registry
# allowing us to republish any version during tests