Skip to content

Commit 40346a4

Browse files
6eDesignJonathan Greenemeier
and
Jonathan Greenemeier
authored
breaking change: add snowpack build process, github actions, and fix for default start/end dates (#103)
* BREAKING CHANGE: update default start/end dates & new build process * feat: CI workflow * fix: CI workflow update * fix: remove package-lock from gitignore * fix: remove .travis.yml * fix: add github pages to release.yml workflow * fix: update readme Co-authored-by: Jonathan Greenemeier <[email protected]>
1 parent 368efc5 commit 40346a4

35 files changed

+16600
-353
lines changed

.eslintrc.js

+24-26
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
module.exports = {
2-
env: {
3-
browser: true,
4-
es6: true
2+
env: {
3+
browser: true,
4+
es6: true,
5+
'jest/globals': true,
6+
},
7+
// extends: 'eslint:recommended',
8+
extends: 'airbnb-base/legacy',
9+
ignorePatterns: ['src/index.js'],
10+
globals: {
11+
Atomics: 'readonly',
12+
SharedArrayBuffer: 'readonly',
13+
},
14+
parserOptions: {
15+
ecmaVersion: 2018,
16+
sourceType: 'module',
17+
},
18+
plugins: ['svelte3', 'jest'],
19+
overrides: [
20+
{
21+
files: ['src/**/*.svelte'],
22+
processor: 'svelte3/svelte3',
523
},
6-
// extends: 'eslint:recommended',
7-
extends: 'airbnb-base/legacy',
8-
globals: {
9-
Atomics: 'readonly',
10-
SharedArrayBuffer: 'readonly'
11-
},
12-
parserOptions: {
13-
ecmaVersion: 2018,
14-
sourceType: 'module'
15-
},
16-
plugins: [
17-
'svelte3'
18-
],
19-
overrides: [
20-
{
21-
files: ['src/**/*.svelte'],
22-
processor: 'svelte3/svelte3'
23-
}
24-
],
25-
rules: {
26-
27-
}
28-
};
24+
],
25+
rules: {},
26+
};

.github/workflows/ci.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- master
6+
jobs:
7+
release:
8+
name: Lint
9+
runs-on: ubuntu-18.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Lint
22+
run: npm run pretest

.github/workflows/release.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-18.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Lint
22+
run: npm run pretest
23+
- name: Github Pages
24+
run: npm run build && cp -r build/ docs/
25+
- name: Release
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
run: npx semantic-release

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.DS_Store
22
node_modules
3-
package-lock.json
43
yarn.lock
4+
build

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"svelteSortOrder": "scripts-markup-styles",
7+
"svelteBracketNewLine": true
8+
}

.travis.yml

-10
This file was deleted.

README.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,28 @@
22

33
A small date picker built with Svelte 3. Demo available here: [demo page].
44

5+
## Installation
6+
7+
```sh
8+
npm i -D svelte-calendar
9+
```
10+
511
## Basic usage
612

713
```html
14+
<script>
15+
import Datepicker from 'svelte-calendar';
16+
</script>
17+
818
<Datepicker start={minDate} end={maxDate} />
919
```
1020

1121
## Props
1222

1323
prop name | type | default
1424
---------------------|------------------------|-------------------------
15-
`start` | `date` | `new Date(1987, 9, 29)`
16-
`end` | `date` | `new Date(2020, 9, 29)`
25+
`start` | `date` | one year in past
26+
`end` | `date` | one year in future
1727
`selected` | `date` | `today`
1828
`formattedSelected` | `string` | `today`
1929
`dateChosen` | `boolean` | `false`
@@ -24,7 +34,7 @@ prop name | type | default
2434
`style` | `string` | ""
2535

2636
### `start` and `end`
27-
These properties set the minimum and maximum dates that will be rendered by this calendar. It is **highly** recommended that you do not leave these as their defaults and supply values which suit your application's needs.
37+
These properties set the minimum and maximum dates that will be rendered by this calendar. It is recommended that you do not leave these as their defaults and supply values which suit your application's needs.
2838

2939
### `selected` and `formattedSelected`
3040
Bind to these properties to observe the selected date as either a date or a string. Use `selected` to set the day which is selected by default.
@@ -36,10 +46,10 @@ Bind to this property to observe whether a user has selected a day.
3646
Provide a function which accepts a date and returns a boolean determining whether a day between `start` and `end` is selectable. For example, use this to prevent weekend days from being selected.
3747

3848
### `format`
39-
Date formatting uses [`timeUtils`] formatting (MM/DD/YYYY by default). If you would like to use a different formatting library, supply a function which accepts a date and returns a string.
49+
Date formatting uses [`timeUtils`] formatting (MM/DD/YYYY by default). If you would like to use a different formatting library, supply a function which accepts a date and returns a string.
4050

4151
### `daysOfWeek` and `monthsOfYear`
42-
These two props are used to internationalize the calendar. The default values are:
52+
These two props are used to internationalize the calendar. The default values are:
4353

4454
```javascript
4555
export let daysOfWeek = [
@@ -51,6 +61,7 @@ export let daysOfWeek = [
5161
['Friday', 'Fri'],
5262
['Saturday', 'Sat']
5363
];
64+
5465
export let monthsOfYear = [
5566
['January', 'Jan'],
5667
['February', 'Feb'],

docs/bundle.css

-7
This file was deleted.

0 commit comments

Comments
 (0)