Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.

Commit 7e9786e

Browse files
committed
Initial version
0 parents  commit 7e9786e

36 files changed

+28360
-0
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on: [push]
4+
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Prepare repository
13+
run: git fetch --unshallow --tags
14+
15+
- name: Use Node.js 14.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 14.x
19+
20+
- name: Install dependencies
21+
uses: bahmutov/npm-install@v1
22+
23+
- name: Create Release
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
27+
run: |
28+
yarn release

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.log
2+
.DS_Store
3+
dist
4+
5+
node_modules
6+
example/node_modules

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"prettier.bracketSpacing": true,
3+
"prettier.semi": false,
4+
"prettier.singleQuote": true,
5+
"prettier.trailingComma": "all",
6+
"prettier.tabWidth": 2,
7+
"prettier.printWidth": 100,
8+
"editor.formatOnSave": true,
9+
"editor.tabSize": 2,
10+
"deepscan.enable": true
11+
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.0.1
2+
3+
Initial version

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Storybook testing utilities
2+
3+
Testing utilities will allow you to reuse your stories in your unit tests!

example/.storybook/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
stories: ['../src/**/*.stories.tsx'],
3+
logLevel: 'debug',
4+
addons: [
5+
'@storybook/preset-create-react-app',
6+
'@storybook/addon-essentials',
7+
],
8+
};

example/.storybook/preview.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
import { Story } from '@storybook/react';
3+
4+
export const decorators = [
5+
(
6+
StoryFn: Story,
7+
{
8+
globals: {
9+
locale: { value = 'en' },
10+
},
11+
}
12+
) => (
13+
<>
14+
<div>{value}</div>
15+
<StoryFn />
16+
</>
17+
),
18+
];
19+
20+
export const globalTypes = {
21+
locale: {
22+
name: 'Locale',
23+
description: 'Internationalization locale',
24+
defaultValue: 'en',
25+
toolbar: {
26+
icon: 'globe',
27+
items: [
28+
{ value: 'en', right: '🇺🇸', title: 'English' },
29+
{ value: 'es', right: '🇪🇸', title: 'Español' },
30+
{ value: 'zh', right: '🇨🇳', title: '中文' },
31+
{ value: 'kr', right: '🇰🇷', title: '한국어' },
32+
],
33+
},
34+
},
35+
};

example/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Demonstrate `@storybook/testing-utilities` usage in a CRA / Typescript project.

0 commit comments

Comments
 (0)