This repository has been archived by the owner on Sep 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Showing
72 changed files
with
906 additions
and
896 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,16 @@ | ||
{ | ||
"presets": [ | ||
["es2015", { "modules": false }], | ||
"stage-2", | ||
], | ||
"plugins": [ | ||
"transform-runtime", | ||
"transform-vue-jsx", | ||
], | ||
"comments": false, | ||
"env": { | ||
"test": { | ||
"plugins": ["istanbul"], | ||
}, | ||
}, | ||
} |
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 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
File renamed without changes.
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 @@ | ||
// http://eslint.org/docs/user-guide/configuring | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
}, | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
plugins: [ | ||
'html', // required to lint *.vue files | ||
], | ||
root: true, | ||
rules: { | ||
'comma-dangle': ['error', 'always'], | ||
'indent': ['error', 4], | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, // allow debugger in development | ||
'quotes': ['error', 'single'], | ||
'semi': ['error', 'always'], | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.DS_Store | ||
node_modules/ | ||
dist/ | ||
/assets | ||
/node_modules | ||
/pages | ||
npm-debug.log | ||
selenium-debug.log | ||
test/unit/coverage |
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,7 @@ | ||
Copyright 2016-2017 Scott Bedard | ||
|
||
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 |
---|---|---|
@@ -1,68 +1,56 @@ | ||
<p align="center"> | ||
<a href="//github.com/vuejs/vue" target="_blank"><img src="http://vuejs.org/images/logo.png" width="auto" height="105px"><a href="//github.com/octobercms/october" target="_blank"><img src="https://raw.githubusercontent.com/octobercms/october/master/themes/demo/assets/images/october.png" alt="October" width="auto" height="100px" /></a></a> | ||
</p> | ||
|
||
# oc-vuetober-theme | ||
|
||
This project is an opinionated approach to single page applications within the wonderful worlds of [Vue.js](https://vuejs.org), [October CMS](https://octobercms.com), and [Laravel](https://laravel.com). To see what's included out of the box, check out the [live demo](http://vuetober.scottbedard.net). | ||
|
||
<a name="getting-started"></a> | ||
### Getting started | ||
|
||
Before getting started, make sure you have both [NPM](https://www.npmjs.com) and [vue-cli](https://github.com/vuejs/vue-cli) installed. Once that is taken care of, run the following command from your `/themes` directory. | ||
In order to use this theme, you'll need to have a fair understanding of [Vue.js](https://vuejs.org). If you've never used this framework before, you can get the fundamentals down through [this free screencast series](http://vuecasts.com/). | ||
|
||
```bash | ||
$ vue init scottbedard/oc-vuetober-theme myawesometheme | ||
$ cd myawesometheme | ||
$ npm install | ||
``` | ||
To install a Vuetober theme, run the following commands from your `/themes` directory. | ||
|
||
To build your site for production, run the following command. | ||
> **Note:** As of version 2.1, pulling in `vue-cli` is no longer neccessary. | ||
```bash | ||
$ npm run build | ||
``` | ||
# clone down the repository and cd into it | ||
$ git clone https://github.com/scottbedard/oc-vuetober-theme.git mytheme | ||
$ cd mytheme | ||
|
||
The development server can be fired up at `localhost:3000` by running the following. | ||
# install dependencies | ||
$ npm install | ||
|
||
```bash | ||
$ npm run dev | ||
# run setup command | ||
$ npm run setup | ||
``` | ||
|
||
For a better development experience, make sure to install the [Vue devtools](https://github.com/vuejs/vue-devtools) Chrome extension. | ||
Other available commands | ||
|
||
<a name="routing"></a> | ||
### Routing | ||
```bash | ||
# compile production assets | ||
$ npm run build | ||
|
||
Routes can be registered from the `app/routes.js` file. Simply import your component, and assign it to a route. | ||
# start development server | ||
$ npm run dev | ||
|
||
The layout components exist to provide an easy way of creating multiple site structures. To use a given layout for your page, make sure to register its route as a child route of the layout component. | ||
# run unit tests | ||
$ npm test | ||
``` | ||
|
||
When displaying dynamic content that may contain local links, it is recommended that you attach the `v-linkable` directive to the container. This will hijack click events and keep your user within the SPA. Without doing this, a full page reload will occur. | ||
<a name="features"></a> | ||
### Features | ||
|
||
```html | ||
<div v-html="blogPost" v-linkable></div> | ||
``` | ||
**Single file components** | ||
|
||
<a name="unit-testing"></a> | ||
### Unit testing and continuous integration | ||
Vue is a fantastic framework, and when using `.vue` files we have a great foundation for creating small, composable components. With this setup, we're able to write our code using any pre-processors we like, and take advantage of things like [hot reloading](https://vue-loader.vuejs.org/en/features/hot-reload.html) and [scoped css](https://vue-loader.vuejs.org/en/features/scoped-css.html). | ||
|
||
This theme comes ready to go with unit testing and code coverage reporting. To run the test suite, execute the following command. | ||
**State of the art tooling** | ||
|
||
```bash | ||
$ npm test | ||
``` | ||
This theme takes full advantage of [Webpack 2](https://webpack.js.org). The build script will optimize your application with techniques like automatically inlining small images, tree shaking, and more. In addition to this, [ESLint](http://eslint.org/docs/rules) will automatically fix your javascript to ensure a consistent style throughout your codebase. | ||
|
||
Most continuous integration services like [Travic CI](https://travis-ci.org) and [Circle CI](https://circleci.com) should be able to infer the test command. Also, this theme works seamlessly with coverage reporting such as [Coveralls](https://coveralls.io). | ||
**Modern Javascript** | ||
|
||
<a name="resources"></a> | ||
### Resources | ||
You're free to use the latest and greatest Javascript and [JSX](https://github.com/vuejs/babel-plugin-transform-vue-jsx). Your code will be compiled by Babel into something that every browser can understand. | ||
|
||
This theme uses quite a few different tools. If you've never used some of these before, it is highly recommended that you familiarize yourself with them by giving their docs the once over. | ||
**Unit testing** | ||
|
||
- [Karma](https://karma-runner.github.io/1.0/index.html) | ||
- [Vue](http://vuejs.org/guide) | ||
- [Vue Loader](http://vue-loader.vuejs.org) | ||
- [Vue Resource](https://github.com/vuejs/vue-resource) | ||
- [Vue Router](http://router.vuejs.org) | ||
- [Webpack](https://webpack.github.io) | ||
Every aspect of this theme is unit testable, with great tooling set up to help you deliver rock solid code. This includes the ability to easily render components in tests, mock dependencies, and even spy on functions. In addition to this, code coverage reporting is already configured, which means it's trivially easy to integrate with a service like [CodeCov](https://codecov.io). |
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
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,48 @@ | ||
var chalk = require('chalk'); | ||
var semver = require('semver'); | ||
var packageConfig = require('../package.json'); | ||
|
||
function exec (cmd) { | ||
return require('child_process').execSync(cmd).toString().trim(); | ||
}; | ||
|
||
var versionRequirements = [ | ||
{ | ||
name: 'node', | ||
currentVersion: semver.clean(process.version), | ||
versionRequirement: packageConfig.engines.node, | ||
}, | ||
{ | ||
name: 'npm', | ||
currentVersion: exec('npm --version'), | ||
versionRequirement: packageConfig.engines.npm, | ||
}, | ||
]; | ||
|
||
module.exports = function () { | ||
var warnings = []; | ||
for (var i = 0; i < versionRequirements.length; i++) { | ||
var mod = versionRequirements[i]; | ||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { | ||
warnings.push( | ||
mod.name + ': ' + | ||
chalk.red(mod.currentVersion) + ' should be ' + | ||
chalk.green(mod.versionRequirement) | ||
); | ||
} | ||
} | ||
|
||
if (warnings.length) { | ||
console.log(''); | ||
console.log(chalk.yellow('To use this template, you must update following to modules:')); | ||
console.log(); | ||
|
||
for (var i = 0; i < warnings.length; i++) { | ||
var warning = warnings[i]; | ||
console.log(' ' + warning); | ||
} | ||
|
||
console.log(); | ||
process.exit(1); | ||
} | ||
}; |
File renamed without changes.
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
Oops, something went wrong.