Skip to content

create new wrapper component #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{
"presets": ["env"],
"plugins": ["transform-object-rest-spread"]
"presets": [
[
"env",
]
],
"plugins": [
"transform-vue-jsx",
"transform-object-rest-spread"
],
"env": {
"test": {
"plugins": [
"istanbul"
]
}
}
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/*.js
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
extends: 'vue',
// add your custom rules here
'rules': {
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
},
globals: {
requestAnimationFrame: true,
performance: true
}
}
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.DS_Store
.idea
bower_components/
/node_modules
node_modules/
npm-debug.log
test/coverage
dist
yarn-error.log
reports
19 changes: 19 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { configure } from '@storybook/vue';

import Vue from 'vue';
import jquery from 'jquery';

// Import your custom components.
import FullPage from '../src/FullPage';

// Register custom components.
Vue.component('full-page', FullPage);

global.$ = global.jQuery = jquery;

function loadStories() {
// You can require as many stories as you need.
require('./stories');
}

configure(loadStories, module);
55 changes: 55 additions & 0 deletions .storybook/stories/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import {storiesOf} from '@storybook/vue';

import fullpage from '../../src/FullPage';

const stories = storiesOf('FullPage', module);

stories.add('Local component', () => ({
components: {fullpage},
data(){
return {
options: {
navigation: true,
anchors: ['page1', 'page2', 'page3'],
sectionsColor: ['#41b883', '#ff5f45', '#0798ec', '#fec401', '#1bcee6', '#ee1a59', '#2c3e4f', '#ba5be9', '#b4b8ab']
}
}
},
template:
'<fullpage :options="options">\n' +
' <div class="section">\n' +
' <h3>Section 1</h3>\n' +
' </div>\n' +
' <div class="section">\n' +
' <div class="slide">\n' +
' <h3>Slide 2.1</h3>\n' +
' </div>\n' +
' <div class="slide">\n' +
' <h3>Slide 2.2</h3>\n' +
' </div>\n' +
' <div class="slide">\n' +
' <h3>Slide 2.3</h3>\n' +
' </div>\n' +
' </div>\n' +
' <div class="section">\n' +
' <h3>Section 3</h3>\n' +
' </div>\n' +
'</fullpage>'
}));

stories.add('Global component', () => ({
data(){
return {
options: {
height: '200px'
}
}
},
template:
'<full-page :options="options">' +
'<div class="section">Some section</div>' +
'<div class="section">Some section</div>' +
'<div class="section">Some section</div>' +
'<div class="section">Some section</div>' +
'</full-page>'
}));
9 changes: 9 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const webpack = require('webpack');

module.exports = {
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
}),
],
};
7 changes: 7 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"processors": ["stylelint-processor-html"],
"extends": "stylelint-config-standard",
"rules": {
"no-empty-source": null
}
}
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com//vue-fullpage).


## Pull Requests

- **Keep the same style** - eslint will automatically be ran before committing

- **Tip** to pass lint tests easier use the `npm run lint:fix` command

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.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 your commits message means something


## Running Tests

Launch visual tests and watch the components at the same time

``` bash
$ npm run dev
```


**Happy coding**!
Loading