Skip to content

Commit

Permalink
Merge branch 'master' into useSlider
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jan 3, 2020
2 parents 2d97cdf + 57e1744 commit bb99f94
Show file tree
Hide file tree
Showing 254 changed files with 8,990 additions and 4,330 deletions.
21 changes: 18 additions & 3 deletions .circleci/config.yml
Expand Up @@ -3,17 +3,25 @@ version: 2
refs:
container: &container
docker:
- image: node:12.12.0
- image: node:12.14.0
working_directory: ~/repo
steps:
- &Versions
run:
name: Versions
command: node -v && npm -v && yarn -v
- &CacheRestore
restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
- &Install
run:
name: Install Dependencies
command: yarn install --pure-lockfile
- &CacheSave
save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- &Build
run:
name: Build
Expand Down Expand Up @@ -42,16 +50,19 @@ refs:
run:
name: Post commit status for Storybook
command: |
npx cross-ci :run \
npx commit-status success Storybook "'\${BUILD_VERSION}'" "'https://$CIRCLE_BUILD_NUM-154950925-gh.circle-artifacts.com/0/root/repo/storybook-static/index.html'"
npx cross-ci :run curl -H "'Authorization: token \${GITHUB_TOKEN}' -H 'Accept: application/vnd.github.v3+json'" \
"'https://api.github.com/repos/\${PROJECT_OWNER}/\${PROJECT_NAME}/statuses/$CIRCLE_SHA1'" -X POST \
-d "'{\"state\": \"success\", \"context\": \"Storybook\", \"description\": \"\${BUILD_VERSION}\", \"target_url\": \"https://$CIRCLE_BUILD_NUM-154950925-gh.circle-artifacts.com/0/root/repo/storybook-static/index.html\"}'"
jobs:
all:
<<: *container
steps:
- checkout
- *Versions
- *CacheRestore
- *Install
- *CacheSave
- *Build
- *Build_Storybook
- *Test
Expand All @@ -65,7 +76,9 @@ jobs:
steps:
- checkout
- *Versions
- *CacheRestore
- *Install
- *CacheSave
- *Build
- *Build_Storybook
- *Test
Expand All @@ -87,7 +100,9 @@ jobs:
steps:
- checkout
- *Versions
- *CacheRestore
- *Install
- *CacheSave
- *Build
- *Build_Storybook
- *Test
Expand Down
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,25 @@
# Description

<!-- Please include a summary of the change along with relevant motivation and context. -->


## Type of change

<!-- Check all relevant options. -->
- [ ] Bug fix _(non-breaking change which fixes an issue)_
- [ ] New feature _(non-breaking change which adds functionality)_
- [ ] **Breaking change** _(fix or feature that would cause existing functionality to not work as before)_

# Checklist
- [ ] Read the [Contributing Guide](https://github.com/streamich/react-use/blob/master/CONTRIBUTING.md)
- [ ] Perform a code self-review
- [ ] Comment the code, particularly in hard-to-understand areas
- [ ] Add documentation
- [ ] Add hook's story at Storybook
- [ ] Cover changes with tests
- [ ] Ensure the test suite passes (`yarn test`)
- [ ] Provide 100% tests coverage
- [ ] Make sure code lints (`yarn lint`). Fix it with `yarn lint:fix` in case of failure.
- [ ] Make sure types are fine (`yarn lint:types`).

<!-- If you can't check all the checkboxes right now - check what you can, create a Draft PR, make some changes if needed and get back to it when you will be able to put some marks in list. -->
2 changes: 1 addition & 1 deletion .storybook/config.js
Expand Up @@ -12,7 +12,7 @@ setOptions({
sidebarAnimations: false,
});

const req = require.context('../src/', true, /.*\.(stories|story)\.(js|jsx|ts|tsx)?$/);
const req = require.context('../stories/', true, /\.story\.tsx?$/);

const loadStories = () => {
req.keys().forEach((filename) => req(filename));
Expand Down
62 changes: 33 additions & 29 deletions .storybook/webpack.config.js
@@ -1,35 +1,39 @@
const path = require('path');
const {compilerOptions} = require('../tsconfig.json');
const { compilerOptions } = require('../tsconfig.json');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

const SRC_PATH = path.join(__dirname, '../src');
const basedir = path.join(__dirname, '..');

module.exports = {
module: {
rules: [
{
test: /\.md?$/,
loader: "markdown-loader",
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
include: [
SRC_PATH,
],
options: {
transpileOnly: true, // use transpileOnly mode to speed-up compilation
compilerOptions: {
...compilerOptions,
declaration: false,
},
module.exports = async ({ config, mode }) => {
config.module.rules.push(
{
test: /\.md?$/,
loader: "markdown-loader",
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
include: [
path.join(basedir, 'src'),
path.join(basedir, 'stories'),
],
options: {
transpileOnly: true, // use transpileOnly mode to speed-up compilation
compilerOptions: {
...compilerOptions,
declaration: false,
},
}
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
enforceExtension: false
},
plugins: [new ForkTsCheckerWebpackPlugin()],
},
},
);

config.plugins.push(new ForkTsCheckerWebpackPlugin());

config.resolve.extensions = ['.ts', '.tsx', '.js', '.jsx'];
config.resolve.enforceExtension = false;

// disable the hint about too big bundle
config.performance.hints = false;

return config;
};

0 comments on commit bb99f94

Please sign in to comment.