Skip to content

Commit

Permalink
Merge pull request #177 from arturbien/beta
Browse files Browse the repository at this point in the history
v3 release 🎉 🥳
  • Loading branch information
arturbien authored Jul 18, 2020
2 parents 315b2b2 + 7e02311 commit a9fa6e9
Show file tree
Hide file tree
Showing 273 changed files with 53,598 additions and 16,941 deletions.
112 changes: 112 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
version: 2
jobs:
install:
docker:
- image: 'circleci/node:latest'
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-npm-deps-{{ checksum "package-lock.json" }}
- v1-npm-deps-
- run:
name: 'Install dependencies'
command: npm ci
- save_cache:
key: v1-npm-deps-{{ checksum "package-lock.json" }}
paths:
- node_modules
- persist_to_workspace:
root: ~/repo
paths:
- node_modules
test:
docker:
- image: 'circleci/node:latest'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: ~/repo
- run:
name: 'Tests'
command: npm run test:ci
build-library:
docker:
- image: 'circleci/node:latest'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: ~/repo
- run:
name: 'Build library'
command: npm run build
- persist_to_workspace:
root: ~/repo
paths:
- dist
build-storybook:
docker:
- image: 'circleci/node:latest'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: ~/repo
- run:
name: 'Build Storybook'
command: npm run build:storybook
- persist_to_workspace:
root: ~/repo
paths:
- storybook
deploy-library:
docker:
- image: 'circleci/node:latest'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: ~/repo
- run:
name: 'Deploy via Semantic Release'
command: npm run semantic-release || true
deploy-storybook:
docker:
- image: 'circleci/node:latest'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: ~/repo
- run:
name: 'Deploy Storybook'
command: ./node_modules/.bin/firebase deploy --token=$FIREBASE_TOKEN
workflows:
version: 2
build-and-deploy:
jobs:
- install
- test:
requires:
- install
- build-library:
requires:
- install
- build-storybook:
requires:
- install
- deploy-library:
requires:
- test
- build-library
- build-storybook
- deploy-storybook:
requires:
- deploy-library
filters:
branches:
only:
- master
4 changes: 4 additions & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"buildCommand": "build:prod",
"sandboxes": ["react95-template-xkfj0"]
}
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BROWSER=none
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
jest: true
},
rules: {
'import/no-unresolved': ['error', { ignore: ['react95'] }],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'jsx-a11y/label-has-associated-control': [
Expand All @@ -20,6 +21,8 @@ module.exports = {
],
'jsx-a11y/label-has-associated-control': ['error', { assert: 'either' }],
'jsx-a11y/label-has-for': 'off',
'prettier/prettier': 'error'
'prettier/prettier': 'error',
'react/no-array-index-key': 'off',
'react/forbid-prop-types': 'off'
}
};
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "react95-storybook"
}
}
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@
# testing
/coverage

# production
# library build
/cjs
/esm
/themes
/images
/fonts
/dist

# storybook
/storybook
/.firebase

# misc
.DS_Store
.env.local
Expand All @@ -24,3 +33,7 @@ yarn-error.log*

# JetBrains IDEs
.idea/*

# Docs
.docz
/docs/build
4 changes: 0 additions & 4 deletions .storybook/addons.js

This file was deleted.

66 changes: 31 additions & 35 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
import { configure, addDecorator } from "@storybook/react";
import { withInfo } from "@storybook/addon-info";
import { withThemesProvider } from "storybook-addon-styled-component-theme";
import { configure, addDecorator } from '@storybook/react';
import { withThemesProvider } from 'storybook-addon-styled-component-theme';
import themes from '../src/common/themes';
import GlobalStyle from './decorators/globalStyle';

import themes from "../src/components/common/themes";
const {
original,
rainyDay,
vaporTeal,
theSixtiesUSA,
olive,
tokyoDark,
rose,
plum,
matrix,
travel,
...otherThemes
} = themes;

import GlobalStyle from "./decorators/globalStyle";
const reorderedThemes = {
original,
rainyDay,
vaporTeal,
theSixtiesUSA,
olive,
tokyoDark,
rose,
plum,
matrix,
travel,
...otherThemes
};

const demoThemes = [
themes.default,
themes.lilacRoseDark,
themes.water,
themes.coldGray,
themes.violetDark
];

addDecorator(
withInfo({
inline: true,
header: false,
source: false,
maxPropsIntoLine: 1,
styles: stylesheet => ({
// Setting the style with a function
...stylesheet,
table: {
background: "red"
}
})
})
);
addDecorator(GlobalStyle);
addDecorator(withThemesProvider(demoThemes));

const req = require.context("../src", true, /\.stories\.js$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}
configure(loadStories, module);
addDecorator(withThemesProvider(Object.values(reorderedThemes)));
26 changes: 22 additions & 4 deletions .storybook/decorators/globalStyle.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
import React from "react";
import { createGlobalStyle } from "styled-components";
import React from 'react';
import { createGlobalStyle } from 'styled-components';

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

const GlobalStyle = createGlobalStyle`
${reset}
${styleReset}
@font-face {
font-family: 'ms_sans_serif';
src: url('${ms_sans_serif}') format('woff2');
font-weight: 400;
font-style: normal
}
@font-face {
font-family: 'ms_sans_serif';
src: url('${ms_sans_serif_bold}') format("woff2");
font-weight: bold;
font-style: normal
}
body {
font-family: 'ms_sans_serif', 'sans-serif';
}
`;

export default storyFn => (
Expand Down
11 changes: 11 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
stories: [
'../src/**/*.stories.(js|mdx)',
'../.storybook/**/*.stories.(js|mdx)'
],
addons: [
'@storybook/addon-docs',
'storybook-addon-styled-component-theme/dist/register',
'@storybook/addon-storysource'
]
};
23 changes: 15 additions & 8 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
const path = require('path');

module.exports = ({config}) => {
config.module.rules.push({
test: /\.stories\.js?$/,
loaders: [require.resolve('@storybook/addon-storysource/loader')],
enforce: 'pre',
});
module.exports = ({ config }) => {
config.module.rules.push({
test: /\.stories\.js?$/,
loaders: [require.resolve('@storybook/addon-storysource/loader')],
enforce: 'pre'
});

return config;
};
config.resolve = Object.assign(config.resolve, {
alias: {
...config.resolve.alias,
react95: path.resolve(__dirname, '../src/index')
}
});

return config;
};
Loading

1 comment on commit a9fa6e9

@vercel
Copy link

@vercel vercel bot commented on a9fa6e9 Jul 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.