Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Commit

Permalink
add skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed May 22, 2017
0 parents commit c32025b
Show file tree
Hide file tree
Showing 21 changed files with 408 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .babelrc
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
}]
]
}
18 changes: 18 additions & 0 deletions .editorconfig
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
10 changes: 10 additions & 0 deletions .eslintrc
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
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/dist
node_modules
npm-debug.log
yarn.lock
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
__tests__
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- 'stable'
6 changes: 6 additions & 0 deletions CHANGELOG.md
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
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
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**!
21 changes: 21 additions & 0 deletions LICENSE.md
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.
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# package_description

[![Latest Version on NPM](https://img.shields.io/npm/v/package_name.svg?style=flat-square)](https://npmjs.com/package/package_name)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/spatie/package_name/master.svg?style=flat-square)](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.
5 changes: 5 additions & 0 deletions __tests__/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"env": {
"jest": true
}
}
9 changes: 9 additions & 0 deletions __tests__/__snapshots__/exampleComponent.test.js.snap
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>
"
`;
30 changes: 30 additions & 0 deletions __tests__/exampleComponent.test.js
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] };
}
8 changes: 8 additions & 0 deletions docs/app.js
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',
});
40 changes: 40 additions & 0 deletions docs/index.html
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>
25 changes: 25 additions & 0 deletions docs/webpack.config.js
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,
},
});
59 changes: 59 additions & 0 deletions package.json
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"
}
}
}
18 changes: 18 additions & 0 deletions src/components/ExampleComponent.vue
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>
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as ExampleComponent } from './components/ExampleComponent';
Loading

0 comments on commit c32025b

Please sign in to comment.