Skip to content

Commit a9fa6e9

Browse files
authored
Merge pull request #177 from arturbien/beta
v3 release 🎉 🥳
2 parents 315b2b2 + 7e02311 commit a9fa6e9

File tree

273 files changed

+53598
-16941
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+53598
-16941
lines changed

.circleci/config.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
version: 2
2+
jobs:
3+
install:
4+
docker:
5+
- image: 'circleci/node:latest'
6+
working_directory: ~/repo
7+
steps:
8+
- checkout
9+
- restore_cache:
10+
keys:
11+
- v1-npm-deps-{{ checksum "package-lock.json" }}
12+
- v1-npm-deps-
13+
- run:
14+
name: 'Install dependencies'
15+
command: npm ci
16+
- save_cache:
17+
key: v1-npm-deps-{{ checksum "package-lock.json" }}
18+
paths:
19+
- node_modules
20+
- persist_to_workspace:
21+
root: ~/repo
22+
paths:
23+
- node_modules
24+
test:
25+
docker:
26+
- image: 'circleci/node:latest'
27+
working_directory: ~/repo
28+
steps:
29+
- checkout
30+
- attach_workspace:
31+
at: ~/repo
32+
- run:
33+
name: 'Tests'
34+
command: npm run test:ci
35+
build-library:
36+
docker:
37+
- image: 'circleci/node:latest'
38+
working_directory: ~/repo
39+
steps:
40+
- checkout
41+
- attach_workspace:
42+
at: ~/repo
43+
- run:
44+
name: 'Build library'
45+
command: npm run build
46+
- persist_to_workspace:
47+
root: ~/repo
48+
paths:
49+
- dist
50+
build-storybook:
51+
docker:
52+
- image: 'circleci/node:latest'
53+
working_directory: ~/repo
54+
steps:
55+
- checkout
56+
- attach_workspace:
57+
at: ~/repo
58+
- run:
59+
name: 'Build Storybook'
60+
command: npm run build:storybook
61+
- persist_to_workspace:
62+
root: ~/repo
63+
paths:
64+
- storybook
65+
deploy-library:
66+
docker:
67+
- image: 'circleci/node:latest'
68+
working_directory: ~/repo
69+
steps:
70+
- checkout
71+
- attach_workspace:
72+
at: ~/repo
73+
- run:
74+
name: 'Deploy via Semantic Release'
75+
command: npm run semantic-release || true
76+
deploy-storybook:
77+
docker:
78+
- image: 'circleci/node:latest'
79+
working_directory: ~/repo
80+
steps:
81+
- checkout
82+
- attach_workspace:
83+
at: ~/repo
84+
- run:
85+
name: 'Deploy Storybook'
86+
command: ./node_modules/.bin/firebase deploy --token=$FIREBASE_TOKEN
87+
workflows:
88+
version: 2
89+
build-and-deploy:
90+
jobs:
91+
- install
92+
- test:
93+
requires:
94+
- install
95+
- build-library:
96+
requires:
97+
- install
98+
- build-storybook:
99+
requires:
100+
- install
101+
- deploy-library:
102+
requires:
103+
- test
104+
- build-library
105+
- build-storybook
106+
- deploy-storybook:
107+
requires:
108+
- deploy-library
109+
filters:
110+
branches:
111+
only:
112+
- master

.codesandbox/ci.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"buildCommand": "build:prod",
3+
"sandboxes": ["react95-template-xkfj0"]
4+
}

.env

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

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
jest: true
99
},
1010
rules: {
11+
'import/no-unresolved': ['error', { ignore: ['react95'] }],
1112
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
1213
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
1314
'jsx-a11y/label-has-associated-control': [
@@ -20,6 +21,8 @@ module.exports = {
2021
],
2122
'jsx-a11y/label-has-associated-control': ['error', { assert: 'either' }],
2223
'jsx-a11y/label-has-for': 'off',
23-
'prettier/prettier': 'error'
24+
'prettier/prettier': 'error',
25+
'react/no-array-index-key': 'off',
26+
'react/forbid-prop-types': 'off'
2427
}
2528
};

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "react95-storybook"
4+
}
5+
}

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@
88
# testing
99
/coverage
1010

11-
# production
11+
# library build
12+
/cjs
13+
/esm
14+
/themes
15+
/images
16+
/fonts
1217
/dist
1318

19+
# storybook
20+
/storybook
21+
/.firebase
22+
1423
# misc
1524
.DS_Store
1625
.env.local
@@ -24,3 +33,7 @@ yarn-error.log*
2433

2534
# JetBrains IDEs
2635
.idea/*
36+
37+
# Docs
38+
.docz
39+
/docs/build

.storybook/addons.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

.storybook/config.js

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
1-
import { configure, addDecorator } from "@storybook/react";
2-
import { withInfo } from "@storybook/addon-info";
3-
import { withThemesProvider } from "storybook-addon-styled-component-theme";
1+
import { configure, addDecorator } from '@storybook/react';
2+
import { withThemesProvider } from 'storybook-addon-styled-component-theme';
3+
import themes from '../src/common/themes';
4+
import GlobalStyle from './decorators/globalStyle';
45

5-
import themes from "../src/components/common/themes";
6+
const {
7+
original,
8+
rainyDay,
9+
vaporTeal,
10+
theSixtiesUSA,
11+
olive,
12+
tokyoDark,
13+
rose,
14+
plum,
15+
matrix,
16+
travel,
17+
...otherThemes
18+
} = themes;
619

7-
import GlobalStyle from "./decorators/globalStyle";
20+
const reorderedThemes = {
21+
original,
22+
rainyDay,
23+
vaporTeal,
24+
theSixtiesUSA,
25+
olive,
26+
tokyoDark,
27+
rose,
28+
plum,
29+
matrix,
30+
travel,
31+
...otherThemes
32+
};
833

9-
const demoThemes = [
10-
themes.default,
11-
themes.lilacRoseDark,
12-
themes.water,
13-
themes.coldGray,
14-
themes.violetDark
15-
];
16-
17-
addDecorator(
18-
withInfo({
19-
inline: true,
20-
header: false,
21-
source: false,
22-
maxPropsIntoLine: 1,
23-
styles: stylesheet => ({
24-
// Setting the style with a function
25-
...stylesheet,
26-
table: {
27-
background: "red"
28-
}
29-
})
30-
})
31-
);
3234
addDecorator(GlobalStyle);
33-
addDecorator(withThemesProvider(demoThemes));
34-
35-
const req = require.context("../src", true, /\.stories\.js$/);
36-
function loadStories() {
37-
req.keys().forEach(filename => req(filename));
38-
}
39-
configure(loadStories, module);
35+
addDecorator(withThemesProvider(Object.values(reorderedThemes)));

.storybook/decorators/globalStyle.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1-
import React from "react";
2-
import { createGlobalStyle } from "styled-components";
1+
import React from 'react';
2+
import { createGlobalStyle } from 'styled-components';
33

4-
import reset from "../../src/components/common/reset";
4+
import styleReset from '../../src/common/styleReset';
5+
// TODO is there a way to keep import paths consistent with what end user will get?
6+
import ms_sans_serif from '../../src/assets/fonts/dist/ms_sans_serif.woff2';
7+
import ms_sans_serif_bold from '../../src/assets/fonts/dist/ms_sans_serif_bold.woff2';
58

69
const GlobalStyle = createGlobalStyle`
7-
${reset}
10+
${styleReset}
11+
@font-face {
12+
font-family: 'ms_sans_serif';
13+
src: url('${ms_sans_serif}') format('woff2');
14+
font-weight: 400;
15+
font-style: normal
16+
}
17+
@font-face {
18+
font-family: 'ms_sans_serif';
19+
src: url('${ms_sans_serif_bold}') format("woff2");
20+
font-weight: bold;
21+
font-style: normal
22+
}
23+
body {
24+
font-family: 'ms_sans_serif', 'sans-serif';
25+
}
826
`;
927

1028
export default storyFn => (

.storybook/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
stories: [
3+
'../src/**/*.stories.(js|mdx)',
4+
'../.storybook/**/*.stories.(js|mdx)'
5+
],
6+
addons: [
7+
'@storybook/addon-docs',
8+
'storybook-addon-styled-component-theme/dist/register',
9+
'@storybook/addon-storysource'
10+
]
11+
};

0 commit comments

Comments
 (0)