Skip to content

Commit 1c2dd93

Browse files
committed
feat: added files
1 parent 0cbf004 commit 1c2dd93

29 files changed

+8863
-0
lines changed

.eslintrc.js

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* eslint-env node */
2+
require('@rushstack/eslint-patch/modern-module-resolution')
3+
4+
module.exports = {
5+
root: true,
6+
env: {
7+
es2021: true,
8+
browser: true,
9+
node: true
10+
},
11+
extends: [
12+
'plugin:vue/vue3-recommended',
13+
'standard',
14+
'@vue/eslint-config-typescript/recommended',
15+
'plugin:prettier-vue/recommended',
16+
'prettier'
17+
],
18+
parserOptions: {
19+
ecmaVersion: 2021
20+
},
21+
plugins: ['html'],
22+
ignorePatterns: ['**/node_modules/**', '{tmp,temp}/**', '**/*.min.js', 'vendor/**', 'dist/**', 'public/**'],
23+
overrides: [
24+
{
25+
files: ['*.json'],
26+
rules: {
27+
quotes: [2, 'double']
28+
}
29+
},
30+
{
31+
files: ['*.vue'],
32+
parser: 'vue-eslint-parser',
33+
parserOptions: {
34+
parser: '@typescript-eslint/parser'
35+
}
36+
},
37+
{
38+
files: ['**/*.spec.{j,t}s?(x)'],
39+
env: {
40+
jest: true
41+
}
42+
}
43+
],
44+
rules: {
45+
// Console and debugger settings depending whether we're on production or not
46+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
47+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
48+
49+
// 'vue/no-export-in-script-setup': 'off',
50+
51+
// '@typescript-eslint/no-unused-vars': 'off',
52+
// 'no-unused-vars': 'off'
53+
}
54+
}

.github/workflows/release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main, beta]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 14.x
19+
- name: Install dependencies
20+
run: npx ci
21+
- name: Install semantic-release extra plugins
22+
run: npm install --save-dev @semantic-release/changelog @semantic-release/git
23+
- name: Lint
24+
run: npm run lint-fix
25+
- name: Typecheck
26+
run: npm run typecheck
27+
- name: Test
28+
run: npm run test:unit-coverage --if-present
29+
- name: Build
30+
run: npm run build
31+
- name: Release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
run: npx semantic-release

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.DS_Store
3+
dist-ssr
4+
*.local
5+
.vscode

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit "$1"

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# vue-search-input <a href="https://npm.im/vue-search-input"><img src="https://badgen.net/npm/v/vue-search-input"></a> ![](https://img.badgesize.io/kouts/vue-search-input/main/dist/vue-search-input.umd.js.svg) ![](https://img.badgesize.io/kouts/vue-search-input/main/dist/vue-search-input.umd.js.svg?compression=gzip) ![](coverage/badge.svg)
2+
3+
A Vue.js 3 search input component, inspired by the global search input of Storybook and GitHub.
4+
5+
The `SearchInput` component displays a search input with some additional features built-in.
6+
7+
**Features:**
8+
- Includes default styling but it's completely customizable with `slots`.
9+
- Displays an `x` icon on the right side of the search input, used for **clearing** the text when there's a value typed inside.
10+
- **Focus** on the search input at any time by pressing the `/` key on the keyboard.
11+
- The search text gets cleared by pressing the `esc` key when the search input has focus.
12+
13+
***Important:*** It is advisable that you include the `SearchInput` component **only once** on each page.
14+
In case multiple `SearchInput` components are present, the first one being displayed will take focus precedence upon the `/` keypress.
15+
16+
## Installation
17+
18+
```bash
19+
npm i vue-search-input
20+
```

babel.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
node: 'current'
8+
}
9+
}
10+
]
11+
]
12+
}

commitlint.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'body-max-line-length': [1, 'always', 200]
5+
}
6+
}

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Playground for vue-search-input</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/playground/main.ts"></script>
12+
</body>
13+
</html>

jest.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'jsdom',
4+
transform: {
5+
'^.+\\.vue$': '@vue/vue3-jest',
6+
'^.+\\js$': 'babel-jest',
7+
'^.+\\.ts$': 'ts-jest'
8+
},
9+
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts)$',
10+
moduleFileExtensions: ['vue', 'js', 'ts'],
11+
moduleNameMapper: {
12+
'^@/(.*)$': '<rootDir>/src/$1',
13+
'^@playground/(.*)$': '<rootDir>/playground/$1',
14+
'^@root/(.*)$': '<rootDir>/$1'
15+
},
16+
coveragePathIgnorePatterns: ['/node_modules/', '/playground/', '/tests/'],
17+
coverageReporters: ['text', 'json-summary']
18+
}

lint-staged.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
'*.{vue,ts,js}': ['npm run lint-fix']
3+
}

0 commit comments

Comments
 (0)