-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
4,079 additions
and
6,218 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
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
declare module 'global'; | ||
declare module 'react-sizeme'; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// TODO: following packages need definition files or a TS migration | ||
declare module 'global'; | ||
declare module 'react-inspector'; | ||
declare module 'uuid-browser/v4'; |
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
3 changes: 1 addition & 2 deletions
3
addons/docs/src/frameworks/react/__testfixtures__/9626-js-default-values/docgen.snapshot
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
1 change: 0 additions & 1 deletion
1
addons/docs/src/frameworks/react/__testfixtures__/9626-js-default-values/input.js
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,5 +1,4 @@ | ||
import React from 'react'; | ||
|
||
// eslint-disable-next-line react/prop-types | ||
export const Tag = ({ title = 'Beta' }) => <div>{title}</div>; | ||
export const component = Tag; |
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable react/forbid-prop-types */ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
|
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
57 changes: 32 additions & 25 deletions
57
lib/core/src/server/preview/virtualModuleEntry.template.js
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,29 +1,36 @@ | ||
/* eslint-disable import/no-unresolved */ | ||
import { addDecorator, addParameters, addLoader, addArgTypesEnhancer } from '{{clientApi}}'; | ||
import { logger } from '{{clientLogger}}'; | ||
import { | ||
decorators, | ||
parameters, | ||
loaders, | ||
argTypesEnhancers, | ||
globals, | ||
globalTypes, | ||
args, | ||
argTypes, | ||
} from '{{configFilename}}'; | ||
import * as config from '{{configFilename}}'; | ||
|
||
if (args || argTypes) { | ||
logger.warn('Invalid args/argTypes in config, ignoring.', JSON.stringify({ args, argTypes })); | ||
} | ||
if (decorators) { | ||
decorators.forEach((decorator) => addDecorator(decorator, false)); | ||
} | ||
if (loaders) { | ||
loaders.forEach((loader) => addLoader(loader, false)); | ||
} | ||
if (parameters || globals || globalTypes) { | ||
addParameters({ ...parameters, globals, globalTypes }, false); | ||
} | ||
if (argTypesEnhancers) { | ||
argTypesEnhancers.forEach((enhancer) => addArgTypesEnhancer(enhancer)); | ||
} | ||
Object.keys(config).forEach((key) => { | ||
const value = config[key]; | ||
switch (key) { | ||
case 'args': | ||
case 'argTypes': { | ||
return logger.warn('Invalid args/argTypes in config, ignoring.', JSON.stringify(value)); | ||
} | ||
case 'decorators': { | ||
return value.forEach((decorator) => addDecorator(decorator, false)); | ||
} | ||
case 'loaders': { | ||
return value.forEach((loader) => addLoader(loader, false)); | ||
} | ||
case 'parameters': { | ||
return addParameters({ ...value }, false); | ||
} | ||
case 'argTypesEnhancers': { | ||
return value.forEach((enhancer) => addArgTypesEnhancer(enhancer)); | ||
} | ||
case 'globals': | ||
case 'globalTypes': { | ||
const v = {}; | ||
v[key] = value; | ||
return addParameters(v, false); | ||
} | ||
default: { | ||
// eslint-disable-next-line prefer-template | ||
return console.log(key + ' was not supported :( !'); | ||
} | ||
} | ||
}); |
Oops, something went wrong.