This repository has been archived by the owner on Oct 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c32025b
Showing
21 changed files
with
408 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"targets": { | ||
"browsers": ["last 2 versions", "safari >= 7"] | ||
}, | ||
"modules": "umd" | ||
}] | ||
], | ||
"plugins": [ | ||
"transform-object-rest-spread", | ||
["transform-runtime", { | ||
"polyfill": false, | ||
"regenerator": true | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
; This file is for unifying the coding style for different editors and IDEs. | ||
; More information at http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 4 | ||
indent_style = space | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[{package.json,*.scss,*.css}] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "spatie/vue", | ||
"parserOptions": { | ||
"ecmaVersion": 8 | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/dist | ||
node_modules | ||
npm-debug.log | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
__tests__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- 'stable' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Changelog | ||
|
||
All notable changes to `package_name` will be documented in this file | ||
|
||
## 1.0.0 | ||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Contributing | ||
|
||
Contributions are **welcome** and will be fully **credited**. | ||
|
||
We accept contributions via Pull Requests on [Github](https://github.com/spatie/package_name). | ||
|
||
## Pull Requests | ||
|
||
- Use the ES2015 syntax. | ||
- Your patch won't be accepted if it doesn't pass the tests and lints (`npm run test`). | ||
- If there's a `/demo` section, try to add an example. | ||
- **Document any change in behaviour:** Make sure the `README.md`, `CHANGELOG.md` and any other relevant documentation are kept up-to-date. | ||
- **Consider our release cycle:** We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. | ||
- **Create feature branches:** Don't ask us to pull from your master branch. | ||
- **One pull request per feature:** If you want to do more than one thing, send multiple pull requests. | ||
- **Send coherent history:** Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. | ||
|
||
## Running Tests | ||
|
||
``` bash | ||
jest | ||
``` | ||
|
||
**Happy coding**! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# The MIT License (MIT) | ||
|
||
Copyright (c) Spatie bvba <[email protected]> | ||
|
||
> Permission is hereby granted, free of charge, to any person obtaining a copy | ||
> of this software and associated documentation files (the "Software"), to deal | ||
> in the Software without restriction, including without limitation the rights | ||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
> copies of the Software, and to permit persons to whom the Software is | ||
> furnished to do so, subject to the following conditions: | ||
> | ||
> The above copyright notice and this permission notice shall be included in | ||
> all copies or substantial portions of the Software. | ||
> | ||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
> THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# package_description | ||
|
||
[](https://npmjs.com/package/package_name) | ||
[](LICENSE.md) | ||
[](https://travis-ci.org/spatie/package_name) | ||
|
||
**Note:** Replace all occurrences ```author_name``` ```author_username``` ```author_email``` ```package_name``` ```package_description``` with their correct values, then delete this line. | ||
|
||
Add a short description here, with some examples on how the package can be used. | ||
|
||
## Demo | ||
|
||
Add a link to a site where the component is being demonstrated live. | ||
|
||
## Postcardware | ||
|
||
You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. | ||
|
||
Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium. | ||
|
||
All postcards are published [on our website](https://spatie.be/opensource/postcards). | ||
|
||
## Installation | ||
|
||
You can install the package via yarn: | ||
|
||
```bash | ||
yarn add package_name | ||
``` | ||
|
||
or npm: | ||
|
||
```bash | ||
npm install package_name --save | ||
``` | ||
|
||
## Usage | ||
|
||
Add instruction on how the package can be used | ||
|
||
## Change log | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. | ||
|
||
## Testing | ||
|
||
```bash | ||
yarn test | ||
``` | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING](CONTRIBUTING.md) for details. | ||
|
||
## Security | ||
|
||
If you discover any security related issues, please contact author_email instead of using the issue tracker. | ||
|
||
## Credits | ||
|
||
- [author_name](https://github.com/author_username) | ||
- [All Contributors](../../contributors) | ||
|
||
## About Spatie | ||
Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource). | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"env": { | ||
"jest": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ExampleComponent can mount 1`] = ` | ||
" | ||
<div id=\\"app\\"><div> | ||
I am an example component | ||
</div></div> | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ExampleComponent } from '../src'; | ||
import Vue from 'vue/dist/vue.js'; | ||
|
||
describe('ExampleComponent', () => { | ||
Vue.component('example-component', ExampleComponent); | ||
|
||
beforeEach(() => { | ||
document.body.innerHTML = ` | ||
<div id="app"> | ||
<example-component></example-component> | ||
</div> | ||
`; | ||
}); | ||
|
||
it('can mount', async () => { | ||
await createVm(); | ||
|
||
expect(document.body.innerHTML).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
async function createVm() { | ||
const vm = new Vue({ | ||
el: '#app', | ||
}); | ||
|
||
await Vue.nextTick(() => {}); | ||
|
||
return { app: vm, component: vm.$children[0] }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Vue from 'vue'; | ||
import { ExampleComponent } from '../src'; | ||
|
||
new Vue({ | ||
components: { ExampleComponent }, | ||
|
||
el: '#app', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<html> | ||
<head> | ||
<title>package_name</title> | ||
|
||
<style> | ||
|
||
*, | ||
*:after, | ||
*:before { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
background-color: #efefef; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; | ||
font-size: 16px; | ||
padding: 2em; | ||
} | ||
|
||
.page { | ||
background-color: #fff; | ||
max-width: 66em; | ||
margin: 0 auto; | ||
padding: 4em 2em; | ||
} | ||
|
||
</style> | ||
|
||
</head> | ||
<body> | ||
<div id="app" class="page"> | ||
<div> | ||
<ExampleComponent></ExampleComponent> | ||
</div> | ||
</div> | ||
<script src="/build/app.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const path = require('path'); | ||
const merge = require('webpack-merge'); | ||
|
||
module.exports = merge(require('../webpack.base'), { | ||
context: __dirname, | ||
|
||
entry: './app.js', | ||
|
||
output: { | ||
path: path.resolve(__dirname, 'build'), | ||
filename: 'app.js', | ||
publicPath: '/build/', | ||
}, | ||
|
||
resolve: { | ||
alias: { | ||
vue: 'vue/dist/vue.js', | ||
}, | ||
}, | ||
|
||
devServer: { | ||
contentBase: __dirname, | ||
port: 2000, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"name": "package_name", | ||
"version": "0.0.1", | ||
"description": "package_description", | ||
"main": "dist/index.js", | ||
"jsnext:main": "src/index.js", | ||
"scripts": { | ||
"start": "webpack-dev-server --config docs/webpack.config.js", | ||
"build": "rm -rf dist && NODE_ENV=production webpack", | ||
"lint": "eslint --ext .js,.vue --fix src __tests__; exit 0", | ||
"prepublish": "npm run test; npm run build", | ||
"test": "jest" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/spatie/package_name.git" | ||
}, | ||
"keywords": [ | ||
"spatie" | ||
], | ||
"author": "author_name", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/spatie/package_name/issues" | ||
}, | ||
"homepage": "https://github.com/spatie/package_name", | ||
"peerDependencies": { | ||
"vue": "^2.3.0" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.24.1", | ||
"babel-loader": "^7.0.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.16.0", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-env": "^1.4.0", | ||
"css-loader": "^0.28.1", | ||
"eslint": "^3.7.1", | ||
"eslint-config-spatie": "^1.1.0", | ||
"jest": "^19.0.0", | ||
"jest-vue-preprocessor": "^0.2.0", | ||
"vue": "^2.3.0", | ||
"vue-loader": "^12.0.3", | ||
"vue-template-compiler": "^2.3.0", | ||
"webpack": "^2.3.3", | ||
"webpack-dev-server": "^2.4.2", | ||
"webpack-merge": "^4.1.0" | ||
}, | ||
"jest": { | ||
"testRegex": "test.js$", | ||
"moduleFileExtensions": [ | ||
"js", | ||
"vue" | ||
], | ||
"transform": { | ||
"^.+\\.js$": "<rootDir>/node_modules/babel-jest", | ||
".*\\.(vue)$": "<rootDir>/node_modules/jest-vue-preprocessor" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<div> | ||
I am an example component | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: {}, | ||
data: () => ({}), | ||
computed: {}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as ExampleComponent } from './components/ExampleComponent'; |
Oops, something went wrong.