generated from lit/lit-element-starter-ts
-
Notifications
You must be signed in to change notification settings - Fork 27
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 #6 from halkeye/storybook
Storybook
- Loading branch information
Showing
38 changed files
with
50,232 additions
and
13,360 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-react", | ||
{ | ||
"development": true | ||
} | ||
], | ||
[ | ||
"@babel/preset-typescript" | ||
], | ||
[ | ||
"@babel/env", | ||
{ | ||
"modules": false | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
[ | ||
"@babel/plugin-proposal-decorators", | ||
{ | ||
"decoratorsBeforeExport": true, | ||
"legacy": false | ||
} | ||
], | ||
"@babel/proposal-class-properties", | ||
"@babel/proposal-object-rest-spread" | ||
] | ||
} |
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,36 @@ | ||
module.exports = { | ||
"root": true, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:wc/recommended", "plugin:lit/all", "plugin:storybook/recommended", "prettier"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module", | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"env": { | ||
"browser": true | ||
}, | ||
"rules": { | ||
"no-prototype-builtins": "off", | ||
"@typescript-eslint/ban-types": "off", | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-explicit-any": "error", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-unused-vars": ["warn", { | ||
"argsIgnorePattern": "^_" | ||
}] | ||
}, | ||
"overrides": [{ | ||
"files": ["rollup.config.js", "web-test-runner.config.js", ".eslintrc.cjs", "*.cjs"], | ||
"env": { | ||
"node": true | ||
} | ||
}, { | ||
"files": ["*_test.ts", "**/custom_typings/*.ts", "packages/labs/ssr/src/test/integration/tests/**", "packages/labs/ssr/src/lib/util/parse5-utils.ts"], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
}] | ||
}; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ coverage/ | |
/test/ | ||
build/ | ||
dist/ | ||
storybook-static/ | ||
custom-elements.json | ||
# top level source | ||
jio-*.d.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,45 @@ | ||
const path = require('path'); | ||
const postcss = require('postcss'); | ||
|
||
const processor = postcss(require('../postcss.config.cjs')); | ||
|
||
module.exports = { | ||
core: { | ||
builder: "webpack5", | ||
manager: "webpack5", | ||
}, | ||
"stories": [ | ||
"../src/**/*.stories.mdx", | ||
"../src/**/*.stories.@(js|jsx|ts|tsx)" | ||
], | ||
"addons": [ | ||
"storybook-dark-mode", | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials" | ||
], | ||
"framework": { | ||
"name": "@storybook/web-components-webpack5", | ||
"options": {} | ||
}, | ||
webpackFinal: async (config, {}) => { | ||
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION' | ||
// You can change the configuration based on that. | ||
// 'PRODUCTION' is used when building the static version of storybook. | ||
|
||
const cssRule = config.module.rules.find(rule => rule.test.toString() === '/\\.css$/'); | ||
cssRule.use = [ | ||
{ | ||
loader: 'lit-css-loader', | ||
options: { | ||
transform: (rawCSS, {filePath}) => { | ||
const {css} = processor.process(rawCSS, {from: filePath}) | ||
return css; | ||
} | ||
} | ||
} | ||
]; | ||
|
||
// Return the altered config | ||
return 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<script src="https://unpkg.com/@webcomponents/[email protected]/webcomponents-loader.js"></script> | ||
<script src="https://unpkg.com/[email protected]/polyfill-support.js"></script> | ||
<script data='ionicons' src='https://cdnjs.cloudflare.com/ajax/libs/ionicons/5.5.2/ionicons/ionicons.esm.js' type='module'></script> | ||
<script data='ionicons' nomodule='' src='https://cdnjs.cloudflare.com/ajax/libs/ionicons/5.5.2/ionicons/ionicons.js'></script> |
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,15 @@ | ||
import {setCustomElementsManifest} from '@storybook/web-components'; | ||
import customElements from '../custom-elements.json'; | ||
setCustomElementsManifest(customElements); | ||
|
||
export const parameters = { | ||
// docs: {inlineStories: false, }, | ||
actions: {argTypesRegex: "^on[A-Z].*"}, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /(^date$|Date$)/, | ||
boolean: /^show/, | ||
}, | ||
}, | ||
} |
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
Oops, something went wrong.