Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update to Material UI Search Bar #112

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ba45f0d
init ts changes
Jul 31, 2021
e6d7f5a
removed previous project License
Jul 31, 2021
0ebffad
Create LICENSE
SnekCode Jul 31, 2021
2fd3cff
Merge pull request #1 from SnekCode/add-license-1
SnekCode Jul 31, 2021
5aeca14
working roll up ts build minus styles
Jul 31, 2021
0316792
bump react version
Jul 31, 2021
815ab01
peer depen for react set to ^16.8
Jul 31, 2021
1759982
typescript convert
Aug 1, 2021
d15a595
working ts conversion tested with ts next app
Aug 1, 2021
b2e55f2
.gitignore update
Aug 1, 2021
afe87ac
merge with master
Aug 1, 2021
9ca5ba1
removed rollup.config and babel.js files
Aug 1, 2021
09f93e2
Merge pull request #2 from SnekCode/fix/tsConversion
SnekCode Aug 1, 2021
9df3d60
fixing errors incured during fix/tsConversion merge
Aug 1, 2021
bf0b138
update @babel/preset-env and added eslint to help catch errors
Aug 1, 2021
d0cdc2c
working storybook
Aug 1, 2021
827a085
Merge pull request #3 from SnekCode/feat/storybook
SnekCode Aug 1, 2021
14d8fa6
unit test for search bar,
Aug 1, 2021
a42f001
Merge pull request #4 from SnekCode/feat/unitTests
SnekCode Aug 1, 2021
d806c14
removed test coverage folder
Aug 1, 2021
7247e89
adding CI/CD
Aug 1, 2021
3b3c3c6
Merge pull request #5 from SnekCode/ci/cd
SnekCode Aug 1, 2021
b845aa6
adding code coverage to CI
Aug 1, 2021
9ace433
adding code coverage to CI
Aug 1, 2021
fe631e1
adding codecov to package.json
Aug 1, 2021
5ede984
added test:ci script
Aug 1, 2021
efa355d
adding badge to readme for test coverage
Aug 1, 2021
5744797
ignoring storybook files for test coverage
Aug 1, 2021
def71f8
added icon order props to shift the search button and clear button le…
Aug 4, 2021
d522d95
added React.useImperativeHandle back for ref
Aug 4, 2021
42819a0
adding auto gh page update to CI
Aug 4, 2021
f81b112
moved deploy gh pages to new stage
Aug 4, 2021
a8b9eb5
removing gh deploy from actions for now
Aug 4, 2021
700568f
story update and pacakge increment
Aug 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"presets": ["@babel/preset-react", "@babel/preset-env"],
"plugins": [["@babel/plugin-proposal-class-properties", { "loose": true }]]
"presets": [
"@babel/env",
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": [
"@babel/proposal-class-properties"
],
}
82 changes: 82 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// rules
const lintTS = {
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
warnOnUnsupportedTypeScriptVersion: false, // suppress the typescript version difference
},
// typescript-eslint https://github.com/typescript-eslint/typescript-eslint/tree/d0d71862efd7e079694fa9513ea983cc908ec6f6/packages/eslint-plugin
rules: {
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off', // turning off because we do not care if we import using es6 or common js... stupid lint
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': ['error', { variables: true }],
'react/display-name': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: ['interface'],
format: ['PascalCase'],
prefix: ['I'],
},
{
selector: ['enum'],
format: ['PascalCase'],
prefix: ['E'],
},
],
},
};

const lintReact = {
plugins: ['react'],
extends: ['plugin:react/recommended'],
// React Rules: https://www.npmjs.com/package/eslint-plugin-react
rules: {
'react/react-in-jsx-scope': 'off', // from react: Prevent missing React when using JSX -- turned off for next.js
'react/jsx-filename-extension': ['warn', { extensions: ['.tsx'] }], // from react: Restrict file extensions that may contain JSX
'react/prop-types': 'off', // from react: Prevent missing props validation in a React component definition
'react/jsx-props-no-spreading': ['error', { custom: 'ignore' }], // from react: Prevent JSX prop spreading
'react/no-unescaped-entities': 'warn', // Turning on to catch possible mistakes
},
settings: {
pragma: 'React',
version: 'detect',
},
};

module.exports = {
root: true,
parserOptions: lintTS.parserOptions,
parser: '@typescript-eslint/parser',
plugins: [...lintTS.plugins, ...lintReact.plugins],
extends: ['eslint:recommended', ...lintTS.extends, ...lintReact.extends],
rules: {
// eslint rules: https://eslint.org/docs/rules/
'prefer-const': 'warn', // from eslint: require `const` declarations for variables that are never reassigned after declared
// needed because of https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use & https://stackoverflow.com/questions/63818415/react-was-used-before-it-was-defined
'no-use-before-define': 'off', // from eslint: disallow the use of variables before they are defined
...lintTS.rules,
...lintReact.rules,
},
settings: {
react: lintReact.settings,
'import/resolver': {
'babel-module': {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
paths: ['src'],
},
},
},
};
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI/CD

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]

workflow_dispatch:

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup NodeJS
uses: actions/setup-node@v1
with:
node-version: 16

- name: Install dependencies
run: npm install

- name: Test
run: npm run test:ci
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ node_modules
build
lib
styleguide/*
storybook/*
storybook*
*.sh
*.tgz
.DS_Store
sb_build
coverage
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ src/*
styleguide/*
.storybook/*
storybook/*
demo.gif
.babelrc
*sh
*tgz
tsconfig.json
lib/**/index.ts
7 changes: 7 additions & 0 deletions .storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
]
}
10 changes: 10 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
"stories": [
"../src/stories/*.stories.mdx",
"../src/stories/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials"
]
}
9 changes: 9 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2020 Wertarbyte and contributors
Copyright (c) 2021 Snekcode

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![codecov](https://codecov.io/gh/SnekCode/material-ui-search-bar/branch/master/graph/badge.svg?token=9QWG3SY3Q3)](https://codecov.io/gh/SnekCode/material-ui-search-bar)
# Material Search Bar

![Example](demo.gif)
Expand Down
17 changes: 17 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint @typescript-eslint/no-var-requires: "off" */
const { defaults } = require('jest-config');

module.exports = {
...defaults,
testEnvironment: 'jsdom',
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/src/stories/'
],
collectCoverage: true,
coveragePathIgnorePatterns: [
'/node_modules/'
],
coverageReporters: ['json', 'lcov', 'text', 'text-summary'],
collectCoverageFrom: ['src/components/**/*.{ts,tsx}'],
};
Loading