Skip to content

Commit 74f7b19

Browse files
committed
feat(moment): add all moment library files
Add filters and global moment accessors
0 parents  commit 74f7b19

28 files changed

+20630
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.babelrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
["vue-app", {
4+
"modules": false
5+
}]
6+
],
7+
"plugins": [
8+
["module-resolver", {
9+
"extensions": [".js", ".vue", ".json"]
10+
}]
11+
],
12+
"env": {
13+
"test": {
14+
"plugins": ["dynamic-import-node"]
15+
}
16+
}
17+
}

.commitlintrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@commitlint/config-conventional"
4+
]
5+
}

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.github/
2+
_book/
3+
docs/
4+
coverage/
5+
dist/

.eslintrc.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// https://eslint.org/docs/user-guide/configuring
2+
3+
module.exports = {
4+
root: true,
5+
parserOptions: {
6+
parser: 'babel-eslint',
7+
ecmaVersion: 2017,
8+
sourceType: 'module'
9+
},
10+
plugins: ['html', 'vue'],
11+
extends: [
12+
'eslint:recommended',
13+
'plugin:prettier/recommended',
14+
'plugin:vue/recommended',
15+
'plugin:import/errors',
16+
'plugin:import/warnings'
17+
],
18+
env: {
19+
browser: true,
20+
node: true,
21+
commonjs: true,
22+
es6: true,
23+
jest: true
24+
},
25+
rules: {
26+
// allow async-await
27+
'generator-star-spacing': 'off',
28+
// don't require .vue extension when importing
29+
'import/extensions': ['error', 'always', {
30+
'js': 'never',
31+
'vue': 'never'
32+
}],
33+
// disallow reassignment of function parameters
34+
// disallow parameter object manipulation except for specific exclusions
35+
'no-param-reassign': ['error', {
36+
props: true,
37+
ignorePropertyModificationsFor: [
38+
'state', // for vuex state
39+
'acc', // for reduce accumulators
40+
'e' // for e.returnvalue
41+
]
42+
}],
43+
// allow optionalDependencies
44+
'import/no-extraneous-dependencies': ['error', {
45+
optionalDependencies: ['test/index.js']
46+
}],
47+
// allow debugger during development
48+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
49+
},
50+
"settings": {
51+
// resolve using plugin babel module resolver
52+
"import/resolver": {
53+
"babel-module": {}
54+
}
55+
}
56+
}

.github/CODE_OF_CONDUCT.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

.github/COMMIT_CONVENTION.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
## Git Commit Message Convention
2+
3+
> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md).
4+
5+
#### Examples
6+
7+
Appears under "Features" header, `compiler` subheader:
8+
9+
```
10+
feat(compiler): add 'comments' option
11+
```
12+
13+
Appears under "Bug Fixes" header, `v-model` subheader, with a link to issue #28:
14+
15+
```
16+
fix(v-model): handle events on blur
17+
18+
close #28
19+
```
20+
21+
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
22+
23+
```
24+
perf(core): improve vdom diffing by removing 'foo' option
25+
26+
BREAKING CHANGE: The 'foo' option has been removed.
27+
```
28+
29+
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
30+
31+
```
32+
revert: feat(compiler): add 'comments' option
33+
34+
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
35+
```
36+
37+
### Full Message Format
38+
39+
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
40+
41+
```
42+
<type>(<scope>): <subject>
43+
<BLANK LINE>
44+
<body>
45+
<BLANK LINE>
46+
<footer>
47+
```
48+
49+
The **header** is mandatory and the **scope** of the header is optional.
50+
51+
### Revert
52+
53+
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
54+
55+
### Type
56+
57+
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
58+
59+
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.
60+
61+
### Scope
62+
63+
The scope could be anything specifying place of the commit change. For example `core`, `compiler`, `ssr`, `v-model`, `transition` etc...
64+
65+
### Subject
66+
67+
The subject contains succinct description of the change:
68+
69+
* use the imperative, present tense: "change" not "changed" nor "changes"
70+
* don't capitalize first letter
71+
* no dot (.) at the end
72+
73+
### Body
74+
75+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
76+
The body should include the motivation for the change and contrast this with previous behavior.
77+
78+
### Footer
79+
80+
The footer should contain any information about **Breaking Changes** and is also the place to
81+
reference GitHub issues that this commit **Closes**.
82+
83+
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

.github/CONTRIBUTING.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributing
2+
3+
## Usage
4+
5+
```bash
6+
# Install dependencies
7+
npm install
8+
9+
# Build
10+
npm run build
11+
12+
# Run development server with storybook
13+
npm run storybook
14+
15+
# Run all tests with lint/jest
16+
npm run test
17+
18+
# Run test in watch mode
19+
npm run test:watch
20+
21+
# Update test snapshot
22+
npm run test:update
23+
24+
# Run linter
25+
npm run lint
26+
27+
# Run linter with auto fix
28+
npm run lint:fix
29+
30+
# Commit files with commitizen (use this instead of git commit)
31+
npm run cz
32+
```
33+
## Workflow
34+
35+
- Create a component in the src/components folder
36+
- Add tests in the src/components/\_\_tests\_\_ folder
37+
- Register this component in src/index.js
38+
- Write stories which use your component as a template in src/stories/index.stories.js
39+
- Run `npm run storybook` to author your components by having a development environment
40+
- Run lint and tests before commiting anything
41+
- Commit using [Commit Convention](.github/COMMIT_CONVENTION.md) and push to github
42+
- If deployment is setup correctly(see next section), your components will be available on npm and release on github :)
43+
44+
## Deployment
45+
46+
This repository is intended to be used with travisCI for deployment. [Semantic-release](https://github.com/semantic-release/semantic-release) is used and setup to auto-generate changelog, auto-publish to npm and auto-release to github based on commit messages structure. For it to work properly you have to follow this [Commit Convention](.github/COMMIT_CONVENTION.md).
47+
48+
You may need to install [Semantic-release-cli](https://github.com/semantic-release/cli) to enable and pre-configure travisCI with npm and github tokens.
49+
50+
So to enjoy an automated continuous deployment, it is required to have a NPM account, to have this project hosted on github, and to have previously login to travisCI.
51+
52+
Warning: After setting up semantic-release, your library will be publish automatically to npm and release to github. If you are not ready to publish to npm or to release you can do this later.
53+
54+
```bash
55+
# Login to npm from your command-line
56+
npm login
57+
58+
# Your npm account must be protected by a two-factor authentification in auth-only mode
59+
npm profile enable-2fa auth-only
60+
61+
# Create your token manually since semantic-release-cli is not working yet with npm in 2FA
62+
npm token create
63+
64+
# Then activate travisCI for your repository and launch semantic-release-cli
65+
npm install -g semantic-release-cli
66+
cd thisRepository
67+
semantic-release-cli setup --npm-token=YOUR_NPM_TOKEN
68+
69+
# Fill your github credentials, select travisCI and select to replace .travis.yml
70+
# TravisCI will be automatically enabled for your github repository
71+
# And tokens will be injected in your travisCI repository config as environment variables
72+
```
73+
74+
If everything is setup properly, every commit on master will generate a release if needed automatically. For the win.

.github/ISSUE_TEMPLATE.md

Whitespace-only changes.

.github/PULL_REQUEST_TEMPLATE.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!--
2+
Please make sure to read the Pull Request Guidelines:
3+
https://github.com/julon/vue-moment-lib/.github/CONTRIBUTING.md#pull-request-guidelines
4+
-->
5+
6+
<!-- PULL REQUEST TEMPLATE -->
7+
<!-- (Update "[ ]" to "[x]" to check a box) -->
8+
9+
**What kind of change does this PR introduce?** (check at least one)
10+
11+
- [ ] Bugfix
12+
- [ ] Feature
13+
- [ ] Code style update
14+
- [ ] Refactor
15+
- [ ] Build-related changes
16+
- [ ] Other, please describe:
17+
18+
**Does this PR introduce a breaking change?** (check one)
19+
20+
- [ ] Yes
21+
- [ ] No
22+
23+
If yes, please describe the impact and migration path for existing applications:
24+
25+
**The PR fulfills these requirements:**
26+
27+
- [ ] It's submitted to the `develop` branch (or to a previous version branch), _not_ the `master` branch
28+
- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
29+
- [ ] All tests are passing
30+
- [ ] New/updated tests are included
31+
32+
If adding a **new feature**, the PR's description includes:
33+
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)
34+
35+
**Other information:**

0 commit comments

Comments
 (0)