Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Commit 384aab5

Browse files
feat: refactor project
1 parent 2415170 commit 384aab5

File tree

117 files changed

+4232
-2290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+4232
-2290
lines changed

.babelrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

.browserslistrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> 1%
2+
last 2 versions

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.{js,jsx,ts,tsx,vue}]
2+
indent_style = space
3+
indent_size = 2
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true

.eslintrc.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
module.exports = {
22
root: true,
33
env: {
4-
browser: true,
54
node: true
65
},
7-
parser: '@typescript-eslint/parser',
8-
parserOptions: {
9-
sourceType: 'module'
10-
},
11-
extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
12-
plugins: ['import', 'prettier'],
13-
"rules": {
6+
'extends': [
7+
'plugin:vue/essential',
8+
'@vue/standard',
9+
'@vue/typescript'
10+
],
11+
rules: {
12+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
14+
'no-tabs': 'off',
1415
"@typescript-eslint/camelcase": "off",
1516
"@typescript-eslint/no-empty-interface": "off",
1617
'no-useless-constructor': 'off',
1718
'no-unused-vars': 'warn',
1819
'no-undef': 'off',
1920
'no-new': 'off',
2021
'eol-last': 'off'
22+
},
23+
parserOptions: {
24+
parser: '@typescript-eslint/parser'
2125
}
22-
};
26+
}

.github/auto-comment.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pullRequestOpened: >
2+
Thank you for raising your pull request.
3+
Please make sure you have followed @mazipan
4+
And please push ⭐ button in this repository

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ typings/
5757
# dotenv environment variables file
5858
.env
5959

60+
dist/
61+
lib/*.js

.travis.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,28 @@ branches:
44
only:
55
- master
66
- /^greenkeeper/.*$/
7-
script: npm run test
8-
after_script:
9-
- npm install -g codecov
10-
- codecov
7+
cache:
8+
yarn: true
9+
directories:
10+
- node_modules
11+
install:
12+
- yarn install
13+
script:
14+
- yarn build:demo
15+
# only for test the build process
16+
- yarn build:lib
17+
- yarn check:size
18+
# temporary hide
19+
# - yarn test
20+
# after_script:
21+
# - npm install -g codecov
22+
# - codecov
23+
deploy:
24+
provider: pages
25+
skip-cleanup: true
26+
github-token: $GITHUB_TOKEN
27+
keep-history: true
28+
local-dir: dist
29+
verbose: true
30+
on:
31+
branch: master

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# :scissors: Vue String Filter
22

3-
> Vue 2.x lightweight string manipulation filter
3+
> Lightweight Vue filter for string manipulation
44
55
[![License](https://img.shields.io/github/license/mazipan/vue-string-filter.svg?maxAge=3600)](https://github.com/mazipan/vue-string-filter) ![minified](https://badgen.net/bundlephobia/minzip/vue-string-filter) [![version](https://img.shields.io/npm/v/vue-string-filter.svg)](https://www.npmjs.com/package/vue-string-filter) [![downloads](https://img.shields.io/npm/dt/vue-string-filter.svg)](https://www.npmjs.com/package/vue-string-filter) [![Travis](https://img.shields.io/travis/mazipan/vue-string-filter.svg)](https://travis-ci.org/mazipan/vue-string-filter) [![codecov](https://codecov.io/gh/mazipan/vue-string-filter/branch/master/graph/badge.svg)](https://codecov.io/gh/mazipan/vue-string-filter)
66

@@ -47,18 +47,18 @@ Vue.use(VueStringFilter)
4747
```javascript
4848
import Vue from 'vue'
4949

50-
import append 'vue-string-filter/filters/append'
51-
import capitalize 'vue-string-filter/filters/capitalize'
52-
import cut 'vue-string-filter/filters/cut'
53-
import lowercase 'vue-string-filter/filters/lowercase'
54-
import remove_first 'vue-string-filter/filters/remove-first'
55-
import remove 'vue-string-filter/filters/remove'
56-
import replace_first 'vue-string-filter/filters/replace-first'
57-
import replace 'vue-string-filter/filters/replace'
58-
import slug 'vue-string-filter/filters/slug'
59-
import titlecase 'vue-string-filter/filters/titlecase'
60-
import truncate 'vue-string-filter/filters/truncate'
61-
import uppercase 'vue-string-filter/filters/uppercase'
50+
import append 'vue-string-filter/libs/append'
51+
import capitalize 'vue-string-filter/libs/capitalize'
52+
import cut 'vue-string-filter/libs/cut'
53+
import lowercase 'vue-string-filter/libs/lowercase'
54+
import remove_first 'vue-string-filter/libs/remove-first'
55+
import remove 'vue-string-filter/libs/remove'
56+
import replace_first 'vue-string-filter/libs/replace-first'
57+
import replace 'vue-string-filter/libs/replace'
58+
import slug 'vue-string-filter/libs/slug'
59+
import titlecase 'vue-string-filter/libs/titlecase'
60+
import truncate 'vue-string-filter/libs/truncate'
61+
import uppercase 'vue-string-filter/libs/uppercase'
6262

6363
Vue.filter('cut', cut)
6464
Vue.filter('lowercase', lowercase)

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

check-size.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
const gzipSize = require('gzip-size')
4+
const bytes = require('bytes')
5+
const chalk = require('chalk')
6+
7+
const SKIP_FILES = ['.gitkeep']
8+
9+
function readDirs (dirname, onDir, onError) {
10+
fs.readdir(dirname, function (err, filenames) {
11+
if (err) {
12+
onError(err)
13+
return
14+
}
15+
16+
filenames
17+
.filter(filename => !SKIP_FILES.includes(filename))
18+
.map(function (filename) {
19+
const isDir = fs.statSync(dirname + '/' + filename).isDirectory()
20+
if (isDir) {
21+
readDirs(dirname + '/' + filename, onDir, onError)
22+
} else {
23+
onDir(dirname + '/' + filename, filename)
24+
}
25+
})
26+
})
27+
}
28+
29+
setTimeout(() => {
30+
readDirs(path.resolve('./lib/'), async (filepath, filename) => {
31+
try {
32+
console.log(chalk.greenBright(`> ${filename}: ${bytes(gzipSize.fileSync(filepath))}`))
33+
} catch (err) {
34+
console.error(err)
35+
}
36+
}, (err) => {
37+
console.error(err)
38+
})
39+
}, 1000)

dist/bundle.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/bundle.js.LICENSE

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/bundle.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/filters/append.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/filters/append.js.LICENSE

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/filters/capitalize.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/filters/capitalize.js.LICENSE

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)