Skip to content

Commit

Permalink
feat: Hello use-intersection 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
wadackel committed Mar 22, 2019
1 parent 3c658f1 commit 484d234
Show file tree
Hide file tree
Showing 31 changed files with 16,582 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,32 @@
version: 2

references:
yarn_cache_config: &yarn_cache_config
key: dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ checksum "package.json" }}
paths:
- node_modules

yarn_restore_cache: &yarn_restore_cache
restore_cache:
<<: *yarn_cache_config
name: Restore yarn cache

yarn_save_cache: &yarn_save_cache
save_cache:
<<: *yarn_cache_config
name: Save yarn cache

jobs:
build:
docker:
- image: catsoss/node-headless-chrome
working_directory: ~/workspace
steps:
- checkout
- *yarn_restore_cache
- run: yarn --pure-lockfile
- *yarn_save_cache
- run: yarn build
- run: yarn test
- run: yarn lint
- run: yarn format && git diff --exit-code || exit 1
1 change: 1 addition & 0 deletions .eslintignore
@@ -0,0 +1 @@
examples/ssr/node_modules/*
32 changes: 32 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,32 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['@typescript-eslint', 'react'],
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:prettier/recommended'],
env: {
node: true,
browser: true,
jest: true,
},
globals: {
page: true,
browser: true,
context: true,
jestPuppeteer: true,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/display-name': 'off',
'react/prop-types': 'off',
},
};
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,22 @@
<!-- Please replace {Please write here} with your description -->

## Expected Behavior

{Please write here}

## Actual Behavior

{Please write here}

## Steps to Reproduce (including precondition)

{Please write here}

## Screenshot on This Problem (if possible)

{Please write here}

## Your Environment

- OS: {Please write here}
- use-intersection version: {Please write here}
29 changes: 29 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,29 @@
<!-- Thank you for your contribution to use-intersection! Please replace {Please write here} with your description -->

## What does this do / why do we need it?

{Please write here}

## How this PR fixes the problem?

{Please write here}

## What should your reviewer look out for in this PR?

{Please write here}

## Check lists

- [ ] Test passed
- [ ] Coding style (indentation, etc)

## Additional Comments (if any)

{Please write here}

## Which issue(s) does this PR fix?

<!--
fixes #
fixes #
-->
142 changes: 142 additions & 0 deletions .gitignore
@@ -0,0 +1,142 @@
/lib
/storybook-static

# Created by https://www.gitignore.io/api/osx,windows,node
# Edit at https://www.gitignore.io/?templates=osx,windows,node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

### OSX ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/osx,windows,node
2 changes: 2 additions & 0 deletions .prettierignore
@@ -0,0 +1,2 @@
lib
examples/ssr/.next
11 changes: 11 additions & 0 deletions .prettierrc.js
@@ -0,0 +1,11 @@
module.exports = {
singleQuote: true,
useTabs: false,
tabWidth: 2,
semi: true,
bracketSpacing: true,
trailingComma: 'all',
arrowParens: 'always',
jsxBracketSameLine: true,
printWidth: 120,
};
3 changes: 3 additions & 0 deletions .storybook/addons.js
@@ -0,0 +1,3 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-options/register';
import '@storybook/addon-knobs/register';
14 changes: 14 additions & 0 deletions .storybook/config.js
@@ -0,0 +1,14 @@
import { addParameters, configure } from '@storybook/react';

addParameters({
options: {
name: 'useIntersection',
sidebarAnimations: false,
},
});

const req = require.context('../src/', true, /.*\.stories\.tsx$/);

configure(() => {
req.keys().forEach((filename) => req(filename));
}, module);
1 change: 1 addition & 0 deletions .storybook/preview-head.html
@@ -0,0 +1 @@
<script src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver%2CIntersectionObserverEntry"></script>
24 changes: 24 additions & 0 deletions .storybook/webpack.config.js
@@ -0,0 +1,24 @@
const path = require('path');
const ForkTsCherkWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const { compilerOptions } = require('../tsconfig.json');

module.exports = {
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
include: [path.join(__dirname, '../src')],
options: {
transpileOnly: true,
compilerOptions,
},
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
enforceExtension: false,
},
plugins: [new ForkTsCherkWebpackPlugin()],
};
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 Cyberagent, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

0 comments on commit 484d234

Please sign in to comment.