Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit f9e5acc

Browse files
committed
Housekeeping
* Update deps * Update tests * removed .npmignore
1 parent 702424e commit f9e5acc

14 files changed

+720
-253
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ spaces_around_operators = true
3434
indent_brace_style = 1TBS
3535
spaces_around_brackets = both
3636

37-
[*.{scss,css,js,html,json,vue,yml,babelrc,eslintrc}]
37+
[*.{scss,css,js,ts,html,json,vue,yml,babelrc,eslintrc}]
3838
indent_size = 2

.github/CONTRIBUTING.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,17 @@
77

88

99
### Pull requests guidelines
10-
* Checkout a topic branch from the relevant branch, and merge back against that branch.
10+
* Always create a separate branch from `master` branch for your commits.
11+
* One concern one PR.
1112
* It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
12-
* Work in ``src`` folder never touch or commit in ``dist`` folder
1313

1414

1515
### Development setup
16-
* You will need [node-js](http://nodejs.org/) >=6.10 || >=9.0 and [yarn](https://yarnpkg.com/en/docs/install) v1.x
17-
* After cloning the repo, run:
18-
```
19-
yarn install
20-
```
16+
* Install [node-js](http://nodejs.org/) >=6.10 || >=9.0 and [yarn](https://yarnpkg.com/en/docs/install) v1.x
17+
* Clone the repo
18+
* Create a separate branch `git checkout -b your-branch-name`
19+
* Install dependencies : `yarn install`
2120
* Make changes in ``src`` folder
2221
* Write/update test case for the feature/fix you made
23-
* You can check if everything is working fine by running tests
24-
```
25-
yarn test
26-
```
22+
* You can check if everything is working fine by running tests `yarn test`
23+

.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*.sublime-*
1111
.brackets.json
1212
.vscode
13-
_notes
1413

1514
# logs and cache
1615
/logs/
@@ -52,9 +51,6 @@ node_modules/
5251
# bower packages
5352
bower_components/
5453

55-
# svn folders
56-
.svn/
57-
5854
# Composer, exclude on root vendor folder
5955
/vendor/
6056
composer.phar

.npmignore

-22
This file was deleted.

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ git:
1010
depth: 10
1111
submodules: false
1212

13-
# Install custom version
13+
# Install specific version
1414
before_install:
1515
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2
1616
- export PATH="$HOME/.yarn/bin:$PATH"
@@ -25,7 +25,7 @@ script:
2525
after_success:
2626
- bash <(curl -s https://codecov.io/bash) -e TRAVIS_NODE_VERSION
2727

28-
# Tell Travis CI to monitor only these branches
28+
# Monitor only these branches
2929
branches:
3030
only:
3131
- master

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Ankur Kumar
3+
Copyright (c) Ankur Kumar
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

__test__/events.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ describe('Flatpickr events', () => {
2121
afterEach(() => {
2222
wrapper.destroy();
2323
wrapper = null;
24+
jest.resetAllMocks();
2425
});
2526

2627
test('emits change event on value change', () => {
@@ -29,7 +30,6 @@ describe('Flatpickr events', () => {
2930
wrapper.setProps({value: '2017-10-04'});
3031

3132
expect(stub).toHaveBeenCalled();
32-
stub.mockClear();
3333
});
3434

3535
test('emits open event on focus', () => {
@@ -38,14 +38,12 @@ describe('Flatpickr events', () => {
3838
wrapper.trigger('focus');
3939

4040
expect(stub).toHaveBeenCalled();
41-
stub.mockClear();
4241
});
4342

4443
test('calls original onChange method on value change', () => {
4544
wrapper.setProps({value: '2017-10-04'});
4645

4746
expect(onChangeStub).toHaveBeenCalled();
48-
onChangeStub.mockReset();
4947
});
5048

5149

__test__/plugin.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ describe('Flatpickr global component', () => {
55

66
// Make a copy of local vue
77
let localVue = createLocalVue();
8-
// Define a global component
8+
// Define the global component
99
localVue.use(Component, 'date-picker');
1010

1111
test('works as plugin', () => {
1212

13-
let app = localVue.component('app', {
13+
let app = {
1414
template: `<div id="app">
1515
<date-picker class="form-control" name="date" v-model="date"></date-picker>
1616
</div>`,
@@ -19,7 +19,7 @@ describe('Flatpickr global component', () => {
1919
date: '2017-10-04'
2020
}
2121
}
22-
});
22+
};
2323

2424
let wrapper = mount(app, {
2525
localVue
@@ -31,7 +31,7 @@ describe('Flatpickr global component', () => {
3131
expect(input.is('input')).toBe(true);
3232
expect(input.vm.$el.value).toBe('2017-10-04');
3333
expect(input.classes()).toContain('form-control');
34-
expect(input.vm.$el.getAttribute('name')).toBe('date');
34+
expect(input.attributes().name).toBe('date');
3535

3636
wrapper.destroy();
3737
});

__test__/props.spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ describe('Flatpickr props', () => {
2626

2727
test('accepts config via prop', () => {
2828
expect(wrapper.props().config).toEqual(props.config);
29-
// fp contains the flatpickr instance
3029
expect(wrapper.vm.fp.config).toHaveProperty('dateFormat', props.config.dateFormat);
3130
});
3231

__test__/watchers.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Flatpickr watchers', () => {
2020
wrapper = null;
2121
});
2222

23-
test('updates input value in DOM on value change', () => {
23+
test('updates input value in DOM on value changed from parent component', () => {
2424
wrapper.setProps({value: '2019-10-04'});
2525
expect(wrapper.vm.$el.value).toEqual('2019-10-04');
2626
});

examples/App.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
ref="datePickerWrap"
6868
>
6969
</flat-pickr>
70-
<div class="input-group-btn">
70+
<div class="input-group-append">
7171
<button class="btn btn-success" type="button" title="Toggle" data-toggle>
7272
Toggle
7373
</button>
@@ -90,7 +90,7 @@
9090
<div class="input-group">
9191
<flat-pickr :config="configs.timePicker" class="form-control" v-model="form.time"
9292
placeholder="Time"></flat-pickr>
93-
<div class="input-group-btn">
93+
<div class="input-group-append">
9494
<button class="btn btn-secondary" type="button" title="Toggle" data-toggle>
9595
Clock
9696
</button>

package.json

+14-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"description": "Vue.js component for Flatpickr date-time picker",
55
"main": "dist/vue-flatpickr.js",
66
"unpkg": "dist/vue-flatpickr.min.js",
7+
"files": [
8+
"src",
9+
"dist"
10+
],
711
"repository": {
812
"type": "git",
913
"url": "git+https://github.com/ankurk91/vue-flatpickr-component.git"
@@ -12,7 +16,8 @@
1216
"vue",
1317
"flatpickr",
1418
"vue-flatpickr",
15-
"datepicker"
19+
"datepicker",
20+
"timepicker"
1621
],
1722
"author": "ankurk91",
1823
"license": "MIT",
@@ -29,30 +34,30 @@
2934
"prepublishOnly": "npm run test && npm run build"
3035
},
3136
"dependencies": {
32-
"flatpickr": "^4.1.4"
37+
"flatpickr": "^4.2.3"
3338
},
3439
"devDependencies": {
3540
"babel-core": "^6.25.0",
3641
"babel-loader": "^7.1.0",
3742
"babel-preset-env": "^1.6.1",
38-
"bootstrap": "^4.0.0-beta.2",
43+
"bootstrap": "^4.0.0-beta.3",
3944
"clean-webpack-plugin": "^0.1.16",
40-
"css-loader": "^0.28.4",
45+
"css-loader": "^0.28.8",
4146
"file-loader": "^1.1.6",
4247
"html-webpack-plugin": "^2.30.1",
43-
"jest": "^22.0.3",
48+
"jest": "^22.0.4",
4449
"jquery": "^3.2.1",
4550
"popper.js": "^1.12.9",
4651
"style-loader": "^0.19.1",
4752
"unminified-webpack-plugin": "^1.4.2",
48-
"vee-validate": "^2.0.0-rc.27",
53+
"vee-validate": "^2.0.0",
4954
"vue": "^2.5.13",
5055
"vue-jest": "^1.4.0",
51-
"vue-loader": "^13.6.0",
56+
"vue-loader": "^13.6.2",
5257
"vue-template-compiler": "^2.5.13",
53-
"vue-test-utils": "^1.0.0-beta.8",
58+
"vue-test-utils": "^1.0.0-beta.9",
5459
"webpack": "^3.10.0",
55-
"webpack-dev-server": "^2.9.7"
60+
"webpack-dev-server": "^2.10.0"
5661
},
5762
"peerDependencies": {
5863
"vue": "^2.0.0"

webpack.config.dev.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
modules: [
1111
path.resolve(__dirname, 'src'),
1212
path.resolve(__dirname, 'examples'),
13-
'node_modules'
13+
path.resolve(__dirname, 'node_modules'),
1414
],
1515
alias: {
1616
'vue$': 'vue/dist/vue.esm.js'
@@ -64,8 +64,6 @@ module.exports = {
6464
minifyJS: false,
6565
minifyCSS: false,
6666
minifyURLs: false
67-
// More options here
68-
// https://github.com/kangax/html-minifier#options-quick-reference
6967
}
7068
}),
7169
new webpack.ProvidePlugin({

0 commit comments

Comments
 (0)