Skip to content

Commit

Permalink
feat: init v1
Browse files Browse the repository at this point in the history
BREAKING CHANGE
  • Loading branch information
francoischalifour committed Feb 11, 2020
1 parent 906d8b7 commit e863791
Show file tree
Hide file tree
Showing 121 changed files with 20,057 additions and 24,747 deletions.
102 changes: 102 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,102 @@
aliases:
- &install_yarn_version
name: Install specific Yarn version
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.21.1
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV
- &restore_yarn_cache
name: Restore Yarn cache
keys:
- yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }}

- &save_yarn_cache
name: Save Yarn cache
key: yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn

- &run_yarn_install
name: Install dependencies
command: yarn install

defaults: &defaults
working_directory: ~/autocompletejs
docker:
- image: circleci/node:12.14.1

version: 2
jobs:
test_build:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Build & Test packages size
command: |
yarn run build
yarn run test:size
test_lint:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Lint & Code styles
command: yarn run lint
- run:
name: Type Checking
command: yarn run type-check

test_unit:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Unit tests
command: yarn run test --maxWorkers=4

release:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Release
command: yarn run release:trigger

workflows:
version: 2
ci:
jobs:
- test_build:
filters:
branches:
only: next
- test_unit:
filters:
branches:
only: next
- test_lint:
filters:
branches:
only: next
- release:
filters:
branches:
only: next
1 change: 0 additions & 1 deletion .coveralls.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .editorconfig
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .env.sample
@@ -0,0 +1 @@
GITHUB_TOKEN=
3 changes: 3 additions & 0 deletions .eslintignore
@@ -0,0 +1,3 @@
/node_modules
dist
/examples
12 changes: 0 additions & 12 deletions .eslintrc

This file was deleted.

31 changes: 31 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,31 @@
module.exports = {
extends: ['algolia', 'algolia/jest', 'algolia/react', 'algolia/typescript'],
globals: {
__DEV__: false,
},
settings: {
react: {
version: 'detect',
pragma: 'h',
},
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx'],
},
},
},
rules: {
'no-param-reassign': 0,
'valid-jsdoc': 0,
'no-shadow': 0,
'prefer-template': 0,
'jest/no-disabled-tests': 0,
'react/prop-types': 0,
'react/no-unescaped-entities': 0,
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'import/extensions': 0,
'@typescript-eslint/camelcase': ['error', { allow: ['__autocomplete_id'] }],
// Useful to call functions like `nodeItem?.scrollIntoView()`.
'no-unused-expressions': 0,
},
};
6 changes: 0 additions & 6 deletions .gitattributes

This file was deleted.

25 changes: 14 additions & 11 deletions .gitignore
@@ -1,16 +1,19 @@
*.swp
# Generated files
node_modules/
.DS_Store

.grunt
_SpecRunner.html
.eslintcache
*.log
coverage/
.cache

# Bundle build files
dist/

node_modules
npm-debug.log
# Deployment build files
/website/stories

bower_components
# IDE
.vscode/

*.iml
.idea
.vscode
netlify-dist/
# Environment files
.env
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
12.14.1
5 changes: 5 additions & 0 deletions .prettierrc
@@ -0,0 +1,5 @@
{
"proseWrap": "never",
"singleQuote": true,
"trailingComma": "es5"
}
20 changes: 20 additions & 0 deletions .storybook/config.ts
@@ -0,0 +1,20 @@
import { addParameters, configure } from '@storybook/html';
import { create } from '@storybook/theming';

addParameters({
options: {
theme: create({
base: 'light',
brandTitle: 'Autocomplete.js',
brandUrl: 'https://github.com/algolia/autocomplete.js',
}),
},
});

const req = require.context('../stories', true, /.stories.(js|ts|tsx)$/);

function loadStories() {
req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
25 changes: 25 additions & 0 deletions .storybook/decorators/index.ts
@@ -0,0 +1,25 @@
type StoryFn = ({
container,
dropdownContainer,
}: {
container: HTMLElement;
dropdownContainer: HTMLElement;
}) => void;

export function withPlayground(storyFn: StoryFn) {
return () => {
const root = document.createElement('div');
const container = document.createElement('div');
const dropdownContainer = document.createElement('div');

root.appendChild(container);
root.appendChild(dropdownContainer);

storyFn({
container,
dropdownContainer,
});

return root;
};
}
2 changes: 2 additions & 0 deletions .storybook/preview-head.html
@@ -0,0 +1,2 @@
<link rel="stylesheet" href="storybook.css" />
<link rel="stylesheet" href="autocomplete.css" />

0 comments on commit e863791

Please sign in to comment.