├── .babelrc
├── .eslintrc.js
├── .gitignore
├── .storybook
├── addons.js
└── config.js
├── README.md
├── assets
├── css
│ └── main.css
└── img
│ └── logo.png
├── backpack.config.js
├── components
├── AdminNav.vue
├── Button.story.js
├── Button.vue
├── Footer.story.js
├── Footer.vue
└── __snapshots__
│ ├── Button.story.storyshot
│ └── Footer.story.storyshot
├── images
└── footer-component-error.png
├── layouts
├── default.vue
└── error.vue
├── nuxt.config.js
├── package-lock.json
├── package.json
├── pages
├── _id.vue
├── admin
│ └── index.vue
└── index.vue
├── plugins
├── axios.js
└── eventsHub.js
├── server
├── api
│ ├── auth.js
│ └── index.js
└── index.js
├── static
├── default_profile_pic.jpg
└── favicon.ico
├── store
└── index.js
├── test
└── unit
│ ├── .eslintrc
│ ├── coverage
│ ├── clover.xml
│ ├── coverage-final.json
│ ├── lcov-report
│ │ ├── base.css
│ │ ├── components
│ │ │ ├── AdminNav.vue.html
│ │ │ ├── Button.story.js.html
│ │ │ ├── Button.vue.html
│ │ │ ├── Footer.story.js.html
│ │ │ ├── Footer.vue.html
│ │ │ └── index.html
│ │ ├── index.html
│ │ ├── layouts
│ │ │ ├── default.vue.html
│ │ │ ├── error.vue.html
│ │ │ └── index.html
│ │ ├── pages
│ │ │ ├── _id.vue.html
│ │ │ ├── admin
│ │ │ │ ├── index.html
│ │ │ │ └── index.vue.html
│ │ │ ├── index.html
│ │ │ └── index.vue.html
│ │ ├── prettify.css
│ │ ├── prettify.js
│ │ ├── sort-arrow-sprite.png
│ │ └── sorter.js
│ └── lcov.info
│ ├── jest.conf.js
│ ├── specs
│ ├── components
│ │ ├── Button.spec.js
│ │ ├── Footer.spec.js
│ │ └── __snapshots__
│ │ │ ├── Button.spec.js.snap
│ │ │ └── Footer.spec.js.snap
│ ├── layouts
│ │ ├── __snapshots__
│ │ │ └── default.spec.js.snap
│ │ └── default.spec.js
│ └── pages
│ │ ├── __snapshots__
│ │ └── index.spec.js.snap
│ │ └── index.spec.js
│ └── storyshots.test.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "env",
4 | "vue"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: 'babel-eslint',
4 | env: {
5 | browser: true,
6 | node: true
7 | },
8 | extends: 'airbnb-base',
9 | // required to lint *.vue files
10 | plugins: [
11 | 'html'
12 | ],
13 | // add your custom rules here
14 | rules: {
15 | // don't require .vue extension when importing
16 | "import/extensions": 0,
17 | "no-param-reassign": 0,
18 | "arrow-body-style": 0,
19 | "no-underscore-dangle": 0,
20 | "max-len": 0,
21 | camelcase: 0,
22 | // allow optionalDependencies
23 | "import/no-extraneous-dependencies": [
24 | "error",
25 | {
26 | optionalDependencies: ["test/unit/index.js"]
27 | }
28 | ],
29 | "import/no-unresolved": [
30 | "error",
31 | {
32 | ignore: ["~", "axios"]
33 | }
34 | ],
35 | indent: ["error", 2],
36 | "no-plusplus": 0,
37 | "no-bitwise": 0,
38 | "no-control-regex": 0,
39 | },
40 | globals: {}
41 | }
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # dependencies
2 | node_modules
3 |
4 | # logs
5 | npm-debug.log
6 |
7 | # Nuxt build
8 | .nuxt
9 |
10 | # Nuxt generate
11 | dist
12 |
13 | # Backpack build
14 | build
15 |
16 | # Misc
17 | .tutorials
18 | /.buildpath
19 | /build/
20 | */archive/
21 |
22 | __MACOSX
23 | .DS_Store
24 |
25 | .project
26 | .settings
27 | .classpath
28 | .sass-cache/
29 |
30 | # OS generated files #
31 | ######################
32 | */.DS_Store
33 | .DS_Store
34 | .DS_Store?
35 | ._*
36 | .Spotlight-V100
37 | .Trashes
38 | Icon?
39 | ehthumbs.db
40 | Thumbs.db
41 |
42 | # Packages #
43 | ############
44 | # it's better to unpack these files and commit the raw source
45 | # git has its own built in compression methods
46 | *.7z
47 | *.dmg
48 | *.gz
49 | *.iso
50 | *.jar
51 | *.rar
52 | *.tar
53 | *.zip
--------------------------------------------------------------------------------
/.storybook/addons.js:
--------------------------------------------------------------------------------
1 | import '@storybook/addon-actions/register'
2 | import '@storybook/addon-links/register'
3 |
--------------------------------------------------------------------------------
/.storybook/config.js:
--------------------------------------------------------------------------------
1 | import { configure } from '@storybook/vue';
2 |
3 | import Vue from 'vue';
4 | // import Vuex from 'vuex'; // Vue plugins
5 |
6 | const req = require.context('../components', true, /\.story\.js$/)
7 |
8 | function loadStories() {
9 | req.keys().forEach((filename) => req(filename))
10 | }
11 |
12 | configure(loadStories, module);
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Nuxt Starter Kit v2
2 |
3 | > I've learned a lot about Nuxt and best practices. Instead of trying to restructure v1 of my starter kit I decided to start fresh. Based off of the [Nuxt Express template](https://github.com/nuxt-community/express-template).
4 |
5 |
6 |
7 | ## Build Setup
8 |
9 | ``` bash
10 | # install dependencies
11 | $ npm install # Or yarn install
12 |
13 | # serve with hot reload at localhost:3000
14 | $ npm run dev
15 |
16 | # build for production and launch server
17 | $ npm start
18 | ```
19 |
20 | For detailed explanation on how Nuxt works, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js).
21 |
22 | ## Backpack
23 |
24 | Nuxt uses [backpack](https://github.com/palmerhq/backpack) to watch and build the application, so you can use the latest ES6 features (module syntax, async/await, etc.).
25 |
26 | ## Storybook
27 |
28 | > [Storybook](https://storybook.js.org/basics/guide-vue/) is a development environment for UI components. It allows you to browse a component library, view the different states of each component, and interactively develop and test components.
29 |
30 | ``` bash
31 | # build and run Storybook
32 | $ npm run storybook
33 | ```
34 |
35 | Stories are written in the components folder. This is not a hard and fast rule. You can change where stories are located by changing the config in `.storybook/config.js`. Out of the box it's set to look for any files inside of the `components` directory that has a `.story.js` extension.
36 |
37 | ## Authentication and Authorization
38 | Using Express and Axios this project allows you to auth users and protect pages. `server/api/auth.js` shows the endpoints used to log a user in. You can find [documentation on what the endpoints expect and return on Postman.](https://documenter.getpostman.com/view/3748927/nuxt-starter-kit-v2/RVg2AoNd) It uses `store/index.js` to manage the state of a user and send login/logout actions. Also check `pages/index.vue` to see what methods to use to log in and `pages/admin/index.vue` to see how to protect a page so only authenticated users can see it.
--------------------------------------------------------------------------------
/assets/css/main.css:
--------------------------------------------------------------------------------
1 | html, body
2 | {
3 | background-color: #fff;
4 | color: #000;
5 | letter-spacing: 0.5px;
6 | font-family: "Source Sans Pro", Arial, sans-serif;
7 | height: 100vh;
8 | margin: 0;
9 | }
10 |
11 | footer
12 | {
13 | padding: 20px;
14 | text-align: center;
15 | border-top: 1px solid #ddd;
16 | }
17 |
18 | a, a:hover, a:focus, a:visited
19 | {
20 | color: #000;
21 | }
22 |
23 | .logo {
24 | width: 100%;
25 | height: auto;
26 | max-width: 400px;
27 | max-height: 289px;
28 | }
29 |
--------------------------------------------------------------------------------
/assets/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itsMattShull/nuxt-starter-kit-v2/b18615b11fddea31c627df5e44eb37f5fcd55899/assets/img/logo.png
--------------------------------------------------------------------------------
/backpack.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | webpack: (config, options, webpack) => {
3 | config.entry.main = './server/index.js'
4 | return config
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/components/AdminNav.vue:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
39 |
40 |
--------------------------------------------------------------------------------
/components/Button.story.js:
--------------------------------------------------------------------------------
1 | import { storiesOf } from '@storybook/vue';
2 | import { action } from '@storybook/addon-actions';
3 | // import { linkTo } from '@storybook/addon-links';
4 | // import { addonNotes } from '@storybook/addon-notes';
5 | // import { addonKnobs, text, number, boolean, array, select, color, date } from '@storybook/addon-knobs';
6 | import MyButton from './Button.vue';
7 |
8 | storiesOf('MyButton', module)
9 | // Works if Vue.component is called in the config.js in .storybook
10 | .add('rounded', () => ({
11 | components: { MyButton },
12 | template: 'A Button with rounded edges',
13 | }))
14 | .add('square', () => ({
15 | components: { MyButton },
16 | template: 'A Button with square edges',
17 | }))
18 | .add('change color', () => ({
19 | components: { MyButton },
20 | template: 'A Button with changed colors',
21 | }))
22 | .add('template + methods', () => ({
23 | components: { MyButton },
24 | template: `
25 |
26 | MyButton rendered in a template + props & methods
27 |
`,
28 | methods: { log: action('log1') },
29 | }));
30 |
--------------------------------------------------------------------------------
/components/Button.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
32 |
--------------------------------------------------------------------------------
/components/Footer.story.js:
--------------------------------------------------------------------------------
1 | import { storiesOf } from '@storybook/vue';
2 |
3 | import MyFooter from './Footer.vue';
4 |
5 | storiesOf('MyFooter', module)
6 | .add('story as a component', () => ({
7 | components: { MyFooter },
8 | template: 'story as a component',
9 | }));
10 |
--------------------------------------------------------------------------------
/components/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/components/__snapshots__/Button.story.storyshot:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Storyshots MyButton change color 1`] = `
4 |
10 | `;
11 |
12 | exports[`Storyshots MyButton rounded 1`] = `
13 |
19 | `;
20 |
21 | exports[`Storyshots MyButton square 1`] = `
22 |
28 | `;
29 |
30 | exports[`Storyshots MyButton template + methods 1`] = `
31 |
32 |
38 |
39 | `;
40 |
--------------------------------------------------------------------------------
/components/__snapshots__/Footer.story.storyshot:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Storyshots MyFooter story as a component 1`] = `
4 |
14 | `;
15 |
--------------------------------------------------------------------------------
/images/footer-component-error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itsMattShull/nuxt-starter-kit-v2/b18615b11fddea31c627df5e44eb37f5fcd55899/images/footer-component-error.png
--------------------------------------------------------------------------------
/layouts/default.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
17 |
18 |
53 |
--------------------------------------------------------------------------------
/layouts/error.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{ error.statusCode }}
6 |
7 |
8 | {{ error.message }}
9 |
10 |
11 | Homepage
12 |
13 |
14 |
15 |
20 |
21 |
38 |
--------------------------------------------------------------------------------
/nuxt.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | /*
3 | ** Headers of the page
4 | */
5 | head: {
6 | title: 'starter',
7 | meta: [
8 | { charset: 'utf-8' },
9 | { name: 'viewport', content: 'width=device-width, initial-scale=1' },
10 | { hid: 'description', name: 'description', content: 'Nuxt.js project' },
11 | ],
12 | link: [
13 | { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
14 | ],
15 | },
16 | modules: [
17 | '@nuxtjs/axios',
18 | ],
19 | plugins: [
20 | '~/plugins/axios',
21 | ],
22 | axios: {
23 | // baseURL: `http://${process.env.HOST || 'localhost'}:${process.env.PORT || 3000}`,
24 | baseURL: 'https://c3c8ff6e-057d-43f7-98fa-595b3622ec0d.mock.pstmn.io',
25 | browserBaseURL: '/',
26 | },
27 | /*
28 | ** Global CSS
29 | */
30 | css: ['~/assets/css/main.css'],
31 | /*
32 | ** Add axios globally
33 | */
34 | build: {
35 | vendor: ['axios'],
36 | /*
37 | ** Run ESLINT on save
38 | */
39 | extend(config, ctx) {
40 | if (ctx.isClient) {
41 | config.module.rules.push({
42 | enforce: 'pre',
43 | test: /\.(js|vue)$/,
44 | loader: 'eslint-loader',
45 | exclude: /(node_modules)/,
46 | });
47 | }
48 | },
49 | },
50 | };
51 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-project",
3 | "version": "1.0.0",
4 | "description": "Nuxt.js project",
5 | "author": "Matt Shull ",
6 | "private": true,
7 | "scripts": {
8 | "dev": "backpack dev",
9 | "build": "nuxt build && backpack build",
10 | "start": "cross-env NODE_ENV=production node build/main.js",
11 | "precommit": "npm run lint",
12 | "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
13 | "storybook": "start-storybook -p 9001 -c .storybook",
14 | "test": "jest --config test/unit/jest.conf.js --coverage"
15 | },
16 | "dependencies": {
17 | "@nuxtjs/axios": "^5.0.1",
18 | "@storybook/addon-actions": "^3.3.14",
19 | "axios": "^0.16.2",
20 | "body-parser": "^1.18.2",
21 | "cross-env": "^5.0.1",
22 | "express": "^4.15.3",
23 | "express-session": "^1.15.6",
24 | "lory.js": "^2.3.4",
25 | "nuxt": "^1.0.0-rc3",
26 | "request": "^2.83.0",
27 | "source-map-support": "^0.4.15",
28 | "vue": "^2.5.13",
29 | "vue-loader": "13.7.0",
30 | "vuex": "^3.0.1"
31 | },
32 | "devDependencies": {
33 | "@storybook/addon-storyshots": "^3.4.0-alpha.5",
34 | "@storybook/addons": "^3.4.0-alpha.5",
35 | "@storybook/vue": "3.4.0-alpha.5",
36 | "@vue/test-utils": "^1.0.0-beta.10",
37 | "babel-core": "^6.26.0",
38 | "babel-eslint": "^7.2.3",
39 | "backpack-core": "^0.4.1",
40 | "eslint": "^4.3.0",
41 | "eslint-config-airbnb-base": "^12.1.0",
42 | "eslint-config-standard": "^10.2.1",
43 | "eslint-loader": "^1.9.0",
44 | "eslint-plugin-html": "^3.1.1",
45 | "eslint-plugin-import": "^2.7.0",
46 | "eslint-plugin-node": "^5.1.1",
47 | "eslint-plugin-promise": "^3.5.0",
48 | "eslint-plugin-standard": "^3.0.1",
49 | "jest": "^22.1.4",
50 | "jest-serializer-vue": "^0.3.0",
51 | "jest-vue-preprocessor": "^1.3.1",
52 | "node-sass": "^4.7.2",
53 | "react-test-renderer": "^16.2.0",
54 | "sass-loader": "^6.0.6",
55 | "vue-jest": "^1.4.0",
56 | "vue-server-renderer": "^2.5.13",
57 | "vue-template-compiler": "^2.5.13"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/pages/_id.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | User
6 |
7 |
8 | {{ user.name }}
9 |
10 |
11 | Users
12 |
13 |
14 |
15 |
16 |
33 |
34 |
51 |
--------------------------------------------------------------------------------
/pages/admin/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
41 |
42 |
--------------------------------------------------------------------------------
/pages/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
58 |
59 |
73 |
--------------------------------------------------------------------------------
/plugins/axios.js:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line
2 | export default ({ $axios, redirect, app, store }) => {
3 | $axios.onRequest((config) => {
4 | if (store.state.user) {
5 | // eslint-disable-next-line
6 | config.headers.common['Authorization'] = store.state.user.token;
7 | }
8 | });
9 |
10 | $axios.onResponseError((error) => {
11 | const request = error.config;
12 | if (store.state.user && error.response && error.response.status === 401 && !request.retry) {
13 | request.retry = true;
14 | $axios.get(`https://c3c8ff6e-057d-43f7-98fa-595b3622ec0d.mock.pstmn.io/refreshtoken?token=${store.state.user.token}`).then((response) => {
15 | store.state.user = response.data;
16 | return $axios(request);
17 | }).catch(async () => {
18 | await store.dispatch('logout');
19 | redirect('/');
20 | });
21 | }
22 | });
23 | };
24 |
--------------------------------------------------------------------------------
/plugins/eventsHub.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 |
3 | export default new Vue();
4 |
--------------------------------------------------------------------------------
/server/api/auth.js:
--------------------------------------------------------------------------------
1 | import { Router } from 'express';
2 | import axios from 'axios';
3 |
4 | const router = Router();
5 |
6 | router.post('/login', (req, res) => {
7 | try {
8 | axios.post('https://c3c8ff6e-057d-43f7-98fa-595b3622ec0d.mock.pstmn.io/login', { username: req.body.username, password: req.body.password }).then((tokenResponse) => {
9 | req.session.user = tokenResponse.data;
10 | res.json(req.session.user);
11 | }).catch((e) => {
12 | res.status(401).json({ error: 'Bad credentials', message: e });
13 | });
14 | } catch (e) {
15 | res.status(401).json({ error: 'Bad credentials' });
16 | }
17 | });
18 |
19 | router.get('/logout', (req, res) => {
20 | try {
21 | delete req.session.user;
22 | res.json({ message: 'it worked!' });
23 | } catch (e) {
24 | res.status(401).json({ error: 'Bad logout' });
25 | }
26 | });
27 |
28 | export default router;
29 |
--------------------------------------------------------------------------------
/server/api/index.js:
--------------------------------------------------------------------------------
1 | import { Router } from 'express';
2 |
3 | import auth from './auth';
4 |
5 | const router = Router();
6 |
7 | // Add USERS Routes
8 | router.use(auth);
9 |
10 | export default router;
11 |
--------------------------------------------------------------------------------
/server/index.js:
--------------------------------------------------------------------------------
1 | import express from 'express';
2 | import { Nuxt, Builder } from 'nuxt';
3 | import api from './api';
4 |
5 | const session = require('express-session');
6 | const bodyParser = require('body-parser');
7 |
8 | const app = express();
9 | const host = process.env.HOST || '127.0.0.1';
10 | const port = process.env.PORT || 3000;
11 |
12 | app.use(bodyParser.urlencoded({ extended: true }));
13 | app.use(bodyParser.json());
14 |
15 | // Sessions to create req.session
16 | app.use(session({
17 | secret: 'super-secret-key',
18 | resave: false,
19 | saveUninitialized: false,
20 | cookie: { maxAge: 60000 },
21 | }));
22 |
23 | app.set('port', port);
24 |
25 | // Import API Routes
26 | app.use('/api', api);
27 |
28 | // Import and Set Nuxt.js options
29 | const config = require('../nuxt.config.js');
30 |
31 | config.dev = !(process.env.NODE_ENV === 'production');
32 |
33 | // Init Nuxt.js
34 | const nuxt = new Nuxt(config);
35 |
36 | // Build only in dev mode
37 | if (config.dev) {
38 | const builder = new Builder(nuxt);
39 | builder.build();
40 | }
41 |
42 | // Give nuxt middleware to express
43 | app.use(nuxt.render);
44 |
45 | // Listen the server
46 | app.listen(port, host);
47 | console.log(`Server listening on ${host}:${port}`); // eslint-disable-line no-console
48 |
--------------------------------------------------------------------------------
/static/default_profile_pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itsMattShull/nuxt-starter-kit-v2/b18615b11fddea31c627df5e44eb37f5fcd55899/static/default_profile_pic.jpg
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itsMattShull/nuxt-starter-kit-v2/b18615b11fddea31c627df5e44eb37f5fcd55899/static/favicon.ico
--------------------------------------------------------------------------------
/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex';
3 |
4 | Vue.use(Vuex);
5 |
6 | const store = () => {
7 | const returnValue = new Vuex.Store({
8 | state: {
9 | user: null,
10 | },
11 | mutations: {
12 | SET_USER: function SET_USER(state, user) {
13 | // eslint-disable-next-line
14 | state.user = user;
15 | },
16 | },
17 | actions: {
18 | nuxtServerInit({ commit }, { req }) {
19 | if (req.session && req.session.user) {
20 | commit('SET_USER', req.session.user);
21 | }
22 | },
23 | login({ commit }, { username, password }) {
24 | return this.$axios.$post('/api/login', {
25 | username,
26 | password,
27 | }).then((res) => {
28 | console.log('user: ', res);
29 | if (res.status === 401) {
30 | throw new Error('Bad credentials');
31 | } else {
32 | return res;
33 | }
34 | }).then((user) => {
35 | commit('SET_USER', user);
36 | });
37 | },
38 | async logout({ commit }) {
39 | await this.$axios.$get('/api/logout').then(() => {
40 | commit('SET_USER', null);
41 | });
42 | },
43 | },
44 | });
45 |
46 | return returnValue;
47 | };
48 |
49 | export default store;
50 |
--------------------------------------------------------------------------------
/test/unit/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "jest": true
4 | },
5 | "globals": {}
6 | }
--------------------------------------------------------------------------------
/test/unit/coverage/clover.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/test/unit/coverage/coverage-final.json:
--------------------------------------------------------------------------------
1 | {"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/components/AdminNav.vue": {"path":"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/components/AdminNav.vue","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":null,"column":-1}},"1":{"start":{"line":17,"column":6},"end":{"line":null,"column":-1}}},"fnMap":{"0":{"name":"logout","decl":{"start":{"line":16,"column":12},"end":{"line":16,"column":17}},"loc":{"start":{"line":16,"column":18},"end":{"line":18,"column":5}}}},"branchMap":{},"s":{"0":0,"1":0},"f":{"0":0},"b":{}}
2 | ,"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/components/Button.vue": {"path":"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/components/Button.vue","statementMap":{"0":{"start":{"line":6,"column":15},"end":{"line":null,"column":-1}},"1":{"start":{"line":6,"column":21},"end":{"line":null,"column":-1}}},"fnMap":{"0":{"name":"_default","decl":{"start":{"line":6,"column":15},"end":{"line":null,"column":-1}},"loc":{"start":{"line":6,"column":15},"end":{"line":null,"column":-1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":6,"column":21},"end":{"line":null,"column":-1}},"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":15}}}},"branchMap":{},"s":{"0":4,"1":0},"f":{"0":4,"1":0},"b":{}}
3 | ,"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/layouts/default.vue": {"path":"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/layouts/default.vue","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":null,"column":-1}}},"fnMap":{},"branchMap":{},"s":{"0":1},"f":{},"b":{}}
4 | ,"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/pages/_id.vue": {"path":"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/pages/_id.vue","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":null,"column":-1}},"1":{"start":{"line":6,"column":31},"end":{"line":6,"column":30}},"2":{"start":{"line":7,"column":4},"end":{"line":null,"column":-1}},"3":{"start":{"line":7,"column":64},"end":{"line":null,"column":-1}},"4":{"start":{"line":8,"column":6},"end":{"line":null,"column":-1}},"5":{"start":{"line":12,"column":4},"end":{"line":null,"column":-1}}},"fnMap":{"0":{"name":"asyncData","decl":{"start":{"line":4,"column":15},"end":{"line":6,"column":30}},"loc":{"start":{"line":6,"column":31},"end":{"line":4,"column":15}}},"1":{"name":"(anonymous_2)","decl":{"start":{"line":7,"column":53},"end":{"line":7,"column":53}},"loc":{"start":{"line":7,"column":62},"end":{"line":7,"column":11}}},"2":{"name":"(anonymous_3)","decl":{"start":{"line":7,"column":100},"end":{"line":7,"column":105}},"loc":{"start":{"line":7,"column":106},"end":{"line":7,"column":11}}},"3":{"name":"head","decl":{"start":{"line":4,"column":15},"end":{"line":11,"column":8}},"loc":{"start":{"line":11,"column":9},"end":{"line":15,"column":3}}}},"branchMap":{},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0},"f":{"0":0,"1":0,"2":0,"3":0},"b":{}}
5 | ,"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/pages/index.vue": {"path":"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/pages/index.vue","statementMap":{"0":{"start":{"line":6,"column":4},"end":{"line":null,"column":-1}},"1":{"start":{"line":11,"column":4},"end":{"line":null,"column":-1}},"2":{"start":{"line":16,"column":29},"end":{"line":16,"column":28}},"3":{"start":{"line":17,"column":4},"end":{"line":19,"column":5}},"4":{"start":{"line":18,"column":6},"end":{"line":null,"column":-1}},"5":{"start":{"line":20,"column":4},"end":{"line":null,"column":-1}},"6":{"start":{"line":22,"column":11},"end":{"line":null,"column":-1}},"7":{"start":{"line":29,"column":8},"end":{"line":null,"column":-1}},"8":{"start":{"line":30,"column":8},"end":{"line":null,"column":-1}},"9":{"start":{"line":31,"column":8},"end":{"line":null,"column":-1}},"10":{"start":{"line":34,"column":8},"end":{"line":null,"column":-1}}},"fnMap":{"0":{"name":"head","decl":{"start":{"line":4,"column":15},"end":{"line":5,"column":8}},"loc":{"start":{"line":5,"column":9},"end":{"line":4,"column":15}}},"1":{"name":"data","decl":{"start":{"line":4,"column":15},"end":{"line":10,"column":8}},"loc":{"start":{"line":10,"column":9},"end":{"line":4,"column":15}}},"2":{"name":"fetch","decl":{"start":{"line":4,"column":15},"end":{"line":16,"column":28}},"loc":{"start":{"line":16,"column":29},"end":{"line":4,"column":15}}},"3":{"name":"(anonymous_9)","decl":{"start":{"line":22,"column":11},"end":{"line":null,"column":-1}},"loc":{"start":{"line":22,"column":11},"end":{"line":null,"column":-1}}}},"branchMap":{"0":{"loc":{"start":{"line":17,"column":4},"end":{"line":19,"column":5}},"type":"if","locations":[{"start":{"line":17,"column":4},"end":{"line":19,"column":5}},{"start":{"line":17,"column":4},"end":{"line":19,"column":5}}]},"1":{"loc":{"start":{"line":22,"column":11},"end":{"line":null,"column":-1}},"type":"switch","locations":[{"start":{"line":22,"column":11},"end":{"line":null,"column":-1}},{"start":{"line":22,"column":11},"end":{"line":null,"column":-1}},{"start":{"line":22,"column":11},"end":{"line":34,"column":8}},{"start":{"line":22,"column":11},"end":{"line":null,"column":-1}},{"start":{"line":22,"column":11},"end":{"line":null,"column":-1}}]}},"s":{"0":0,"1":1,"2":0,"3":0,"4":0,"5":0,"6":2,"7":0,"8":0,"9":0,"10":0},"f":{"0":0,"1":1,"2":0,"3":1},"b":{"0":[0,0],"1":[0,0,0,0,0]}}
6 | ,"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/pages/admin/index.vue": {"path":"/home/jefrydco/Projects/Github/nuxt-starter-kit-v2/pages/admin/index.vue","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":null,"column":-1}},"1":{"start":{"line":3,"column":0},"end":{"line":null,"column":-1}},"2":{"start":{"line":10,"column":29},"end":{"line":10,"column":28}},"3":{"start":{"line":11,"column":4},"end":{"line":13,"column":5}},"4":{"start":{"line":12,"column":6},"end":{"line":null,"column":-1}},"5":{"start":{"line":14,"column":4},"end":{"line":null,"column":-1}},"6":{"start":{"line":16,"column":11},"end":{"line":null,"column":-1}},"7":{"start":{"line":20,"column":8},"end":{"line":null,"column":-1}},"8":{"start":{"line":23,"column":8},"end":{"line":null,"column":-1}},"9":{"start":{"line":27,"column":12},"end":{"line":null,"column":-1}},"10":{"start":{"line":28,"column":4},"end":{"line":null,"column":-1}},"11":{"start":{"line":29,"column":6},"end":{"line":null,"column":-1}}},"fnMap":{"0":{"name":"fetch","decl":{"start":{"line":5,"column":15},"end":{"line":10,"column":28}},"loc":{"start":{"line":10,"column":29},"end":{"line":5,"column":15}}},"1":{"name":"(anonymous_8)","decl":{"start":{"line":16,"column":11},"end":{"line":null,"column":-1}},"loc":{"start":{"line":16,"column":11},"end":{"line":null,"column":-1}}},"2":{"name":"mounted","decl":{"start":{"line":5,"column":15},"end":{"line":27,"column":11}},"loc":{"start":{"line":27,"column":12},"end":{"line":31,"column":3}}},"3":{"name":"(anonymous_13)","decl":{"start":{"line":28,"column":27},"end":{"line":28,"column":32}},"loc":{"start":{"line":28,"column":33},"end":{"line":28,"column":4}}}},"branchMap":{"0":{"loc":{"start":{"line":11,"column":4},"end":{"line":13,"column":5}},"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":13,"column":5}},{"start":{"line":11,"column":4},"end":{"line":13,"column":5}}]},"1":{"loc":{"start":{"line":16,"column":11},"end":{"line":null,"column":-1}},"type":"switch","locations":[{"start":{"line":16,"column":11},"end":{"line":null,"column":-1}},{"start":{"line":16,"column":11},"end":{"line":null,"column":-1}},{"start":{"line":16,"column":11},"end":{"line":23,"column":8}},{"start":{"line":16,"column":11},"end":{"line":null,"column":-1}},{"start":{"line":16,"column":11},"end":{"line":null,"column":-1}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"f":{"0":0,"1":0,"2":0,"3":0},"b":{"0":[0,0],"1":[0,0,0,0,0]}}
7 | }
8 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/base.css:
--------------------------------------------------------------------------------
1 | body, html {
2 | margin:0; padding: 0;
3 | height: 100%;
4 | }
5 | body {
6 | font-family: Helvetica Neue, Helvetica, Arial;
7 | font-size: 14px;
8 | color:#333;
9 | }
10 | .small { font-size: 12px; }
11 | *, *:after, *:before {
12 | -webkit-box-sizing:border-box;
13 | -moz-box-sizing:border-box;
14 | box-sizing:border-box;
15 | }
16 | h1 { font-size: 20px; margin: 0;}
17 | h2 { font-size: 14px; }
18 | pre {
19 | font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
20 | margin: 0;
21 | padding: 0;
22 | -moz-tab-size: 2;
23 | -o-tab-size: 2;
24 | tab-size: 2;
25 | }
26 | a { color:#0074D9; text-decoration:none; }
27 | a:hover { text-decoration:underline; }
28 | .strong { font-weight: bold; }
29 | .space-top1 { padding: 10px 0 0 0; }
30 | .pad2y { padding: 20px 0; }
31 | .pad1y { padding: 10px 0; }
32 | .pad2x { padding: 0 20px; }
33 | .pad2 { padding: 20px; }
34 | .pad1 { padding: 10px; }
35 | .space-left2 { padding-left:55px; }
36 | .space-right2 { padding-right:20px; }
37 | .center { text-align:center; }
38 | .clearfix { display:block; }
39 | .clearfix:after {
40 | content:'';
41 | display:block;
42 | height:0;
43 | clear:both;
44 | visibility:hidden;
45 | }
46 | .fl { float: left; }
47 | @media only screen and (max-width:640px) {
48 | .col3 { width:100%; max-width:100%; }
49 | .hide-mobile { display:none!important; }
50 | }
51 |
52 | .quiet {
53 | color: #7f7f7f;
54 | color: rgba(0,0,0,0.5);
55 | }
56 | .quiet a { opacity: 0.7; }
57 |
58 | .fraction {
59 | font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
60 | font-size: 10px;
61 | color: #555;
62 | background: #E8E8E8;
63 | padding: 4px 5px;
64 | border-radius: 3px;
65 | vertical-align: middle;
66 | }
67 |
68 | div.path a:link, div.path a:visited { color: #333; }
69 | table.coverage {
70 | border-collapse: collapse;
71 | margin: 10px 0 0 0;
72 | padding: 0;
73 | }
74 |
75 | table.coverage td {
76 | margin: 0;
77 | padding: 0;
78 | vertical-align: top;
79 | }
80 | table.coverage td.line-count {
81 | text-align: right;
82 | padding: 0 5px 0 20px;
83 | }
84 | table.coverage td.line-coverage {
85 | text-align: right;
86 | padding-right: 10px;
87 | min-width:20px;
88 | }
89 |
90 | table.coverage td span.cline-any {
91 | display: inline-block;
92 | padding: 0 5px;
93 | width: 100%;
94 | }
95 | .missing-if-branch {
96 | display: inline-block;
97 | margin-right: 5px;
98 | border-radius: 3px;
99 | position: relative;
100 | padding: 0 4px;
101 | background: #333;
102 | color: yellow;
103 | }
104 |
105 | .skip-if-branch {
106 | display: none;
107 | margin-right: 10px;
108 | position: relative;
109 | padding: 0 4px;
110 | background: #ccc;
111 | color: white;
112 | }
113 | .missing-if-branch .typ, .skip-if-branch .typ {
114 | color: inherit !important;
115 | }
116 | .coverage-summary {
117 | border-collapse: collapse;
118 | width: 100%;
119 | }
120 | .coverage-summary tr { border-bottom: 1px solid #bbb; }
121 | .keyline-all { border: 1px solid #ddd; }
122 | .coverage-summary td, .coverage-summary th { padding: 10px; }
123 | .coverage-summary tbody { border: 1px solid #bbb; }
124 | .coverage-summary td { border-right: 1px solid #bbb; }
125 | .coverage-summary td:last-child { border-right: none; }
126 | .coverage-summary th {
127 | text-align: left;
128 | font-weight: normal;
129 | white-space: nowrap;
130 | }
131 | .coverage-summary th.file { border-right: none !important; }
132 | .coverage-summary th.pct { }
133 | .coverage-summary th.pic,
134 | .coverage-summary th.abs,
135 | .coverage-summary td.pct,
136 | .coverage-summary td.abs { text-align: right; }
137 | .coverage-summary td.file { white-space: nowrap; }
138 | .coverage-summary td.pic { min-width: 120px !important; }
139 | .coverage-summary tfoot td { }
140 |
141 | .coverage-summary .sorter {
142 | height: 10px;
143 | width: 7px;
144 | display: inline-block;
145 | margin-left: 0.5em;
146 | background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147 | }
148 | .coverage-summary .sorted .sorter {
149 | background-position: 0 -20px;
150 | }
151 | .coverage-summary .sorted-desc .sorter {
152 | background-position: 0 -10px;
153 | }
154 | .status-line { height: 10px; }
155 | /* dark red */
156 | .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
157 | .low .chart { border:1px solid #C21F39 }
158 | /* medium red */
159 | .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
160 | /* light red */
161 | .low, .cline-no { background:#FCE1E5 }
162 | /* light green */
163 | .high, .cline-yes { background:rgb(230,245,208) }
164 | /* medium green */
165 | .cstat-yes { background:rgb(161,215,106) }
166 | /* dark green */
167 | .status-line.high, .high .cover-fill { background:rgb(77,146,33) }
168 | .high .chart { border:1px solid rgb(77,146,33) }
169 |
170 |
171 | .medium .chart { border:1px solid #666; }
172 | .medium .cover-fill { background: #666; }
173 |
174 | .cbranch-no { background: yellow !important; color: #111; }
175 |
176 | .cstat-skip { background: #ddd; color: #111; }
177 | .fstat-skip { background: #ddd; color: #111 !important; }
178 | .cbranch-skip { background: #ddd !important; color: #111; }
179 |
180 | span.cline-neutral { background: #eaeaea; }
181 | .medium { background: #eaeaea; }
182 |
183 | .cover-fill, .cover-empty {
184 | display:inline-block;
185 | height: 12px;
186 | }
187 | .chart {
188 | line-height: 0;
189 | }
190 | .cover-empty {
191 | background: white;
192 | }
193 | .cover-full {
194 | border-right: none !important;
195 | }
196 | pre.prettyprint {
197 | border: none !important;
198 | padding: 0 !important;
199 | margin: 0 !important;
200 | }
201 | .com { color: #999 !important; }
202 | .ignore-none { color: #999; font-weight: normal; }
203 |
204 | .wrapper {
205 | min-height: 100%;
206 | height: auto !important;
207 | height: 100%;
208 | margin: 0 auto -48px;
209 | }
210 | .footer, .push {
211 | height: 48px;
212 | }
213 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/components/AdminNav.vue.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for components/AdminNav.vue
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 0%
24 | Statements
25 | 0/2
26 |
27 |
28 | 100%
29 | Branches
30 | 0/0
31 |
32 |
33 | 0%
34 | Functions
35 | 0/1
36 |
37 |
38 | 0%
39 | Lines
40 | 0/2
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10
56 | 11
57 | 12
58 | 13
59 | 14
60 | 15
61 | 16
62 | 17
63 | 18
64 | 19
65 | 20
66 | 21 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | |
87 | import eventHub from '~/plugins/eventsHub.js';
88 |
89 | export default {
90 | props: {
91 | name: {
92 | type: String,
93 | default: 'User',
94 | },
95 | imageUrl: {
96 | type: String,
97 | default: '/default_profile_pic.jpg',
98 | },
99 | },
100 | methods: {
101 | logout: () => {
102 | eventHub.$emit('logout');
103 | },
104 | },
105 | };
106 | |
107 |
108 |
109 |
110 |
114 |
115 |
116 |
123 |
124 |
125 |
126 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/components/Button.story.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for components/Button.story.js
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 0%
24 | Statements
25 | 0/9
26 |
27 |
28 | 0%
29 | Branches
30 | 0/4
31 |
32 |
33 | 0%
34 | Functions
35 | 0/4
36 |
37 |
38 | 0%
39 | Lines
40 | 0/7
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10
56 | 11
57 | 12
58 | 13
59 | 14
60 | 15
61 | 16
62 | 17
63 | 18
64 | 19
65 | 20
66 | 21
67 | 22
68 | 23
69 | 24
70 | 25
71 | 26 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | | import { storiesOf } from '@storybook/vue';
97 | import { action } from '@storybook/addon-actions';
98 | // import { linkTo } from '@storybook/addon-links';
99 | // import { addonNotes } from '@storybook/addon-notes';
100 | // import { addonKnobs, text, number, boolean, array, select, color, date } from '@storybook/addon-knobs';
101 | import MyButton from './Button.vue';
102 |
103 | storiesOf('MyButton', module)
104 | // Works if Vue.component is called in the config.js in .storybook
105 | .add('rounded', () => ({
106 | components: { MyButton },
107 | template: '<my-button :rounded="true">A Button with rounded edges</my-button>',
108 | }))
109 | .add('square', () => ({
110 | components: { MyButton },
111 | template: '<my-button :rounded="false">A Button with square edges</my-button>',
112 | }))
113 | .add('template + methods', () => ({
114 | components: { MyButton },
115 | template: `
116 | <p>
117 | <my-button :rounded="true" :handle-click="log">MyButton rendered in a template + props & methods</my-button>
118 | </p>`,
119 | methods: { log: action('log1') },
120 | }));
121 | |
122 |
123 |
124 |
125 |
129 |
130 |
131 |
138 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/components/Button.vue.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for components/Button.vue
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 50%
24 | Statements
25 | 1/2
26 |
27 |
28 | 100%
29 | Branches
30 | 0/0
31 |
32 |
33 | 50%
34 | Functions
35 | 1/2
36 |
37 |
38 | 100%
39 | Lines
40 | 1/1
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10
56 | 11
57 | 12
58 | 13 |
59 |
60 |
61 |
62 |
63 | 4x
64 |
65 |
66 |
67 |
68 |
69 |
70 | |
71 | export default {
72 | props: {
73 | rounded: Boolean,
74 | handleClick: {
75 | default: () => () => null,
76 | },
77 | color: {
78 | default: '#42b983',
79 | },
80 | },
81 | };
82 | |
83 |
84 |
85 |
86 |
90 |
91 |
92 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/components/Footer.story.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for components/Footer.story.js
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 0%
24 | Statements
25 | 0/6
26 |
27 |
28 | 0%
29 | Branches
30 | 0/4
31 |
32 |
33 | 0%
34 | Functions
35 | 0/2
36 |
37 |
38 | 0%
39 | Lines
40 | 0/4
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | | import { storiesOf } from '@storybook/vue';
65 |
66 | import MyFooter from './Footer.vue';
67 |
68 | storiesOf('MyFooter', module)
69 | .add('story as a component', () => ({
70 | components: { MyFooter },
71 | template: '<my-footer>story as a component</my-footer>',
72 | }));
73 | |
74 |
75 |
76 |
77 |
81 |
82 |
83 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/components/Footer.vue.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for components/Footer.vue
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 0%
24 | Statements
25 | 0/13
26 |
27 |
28 | 0%
29 | Branches
30 | 0/6
31 |
32 |
33 | 0%
34 | Functions
35 | 0/2
36 |
37 |
38 | 0%
39 | Lines
40 | 0/13
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10
56 | 11 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | | <template>
67 | <footer>
68 | Visit our website for more documentation : <a href="https://nuxtjs.org" target="_blank">nuxtjs.org</a>
69 | </footer>
70 | </template>
71 |
72 | <script>
73 | export default {
74 |
75 | }
76 | </script> |
77 |
78 |
79 |
80 |
84 |
85 |
86 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/components/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for components
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
19 | All files components
20 |
21 |
22 |
23 | 25%
24 | Statements
25 | 1/4
26 |
27 |
28 | 100%
29 | Branches
30 | 0/0
31 |
32 |
33 | 33.33%
34 | Functions
35 | 1/3
36 |
37 |
38 | 33.33%
39 | Lines
40 | 1/3
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | | File |
50 | |
51 | Statements |
52 | |
53 | Branches |
54 | |
55 | Functions |
56 | |
57 | Lines |
58 | |
59 |
60 |
61 |
62 | | AdminNav.vue |
63 | |
64 | 0% |
65 | 0/2 |
66 | 100% |
67 | 0/0 |
68 | 0% |
69 | 0/1 |
70 | 0% |
71 | 0/2 |
72 |
73 |
74 |
75 | | Button.vue |
76 | |
77 | 50% |
78 | 1/2 |
79 | 100% |
80 | 0/0 |
81 | 50% |
82 | 1/2 |
83 | 100% |
84 | 1/1 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
95 |
96 |
97 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for All files
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
19 | All files
20 |
21 |
22 |
23 | 11.76%
24 | Statements
25 | 4/34
26 |
27 |
28 | 0%
29 | Branches
30 | 0/14
31 |
32 |
33 | 20%
34 | Functions
35 | 3/15
36 |
37 |
38 | 12.5%
39 | Lines
40 | 4/32
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | | File |
50 | |
51 | Statements |
52 | |
53 | Branches |
54 | |
55 | Functions |
56 | |
57 | Lines |
58 | |
59 |
60 |
61 |
62 | | components |
63 | |
64 | 25% |
65 | 1/4 |
66 | 100% |
67 | 0/0 |
68 | 33.33% |
69 | 1/3 |
70 | 33.33% |
71 | 1/3 |
72 |
73 |
74 |
75 | | layouts |
76 | |
77 | 100% |
78 | 1/1 |
79 | 100% |
80 | 0/0 |
81 | 100% |
82 | 0/0 |
83 | 100% |
84 | 1/1 |
85 |
86 |
87 |
88 | | pages |
89 | |
90 | 11.76% |
91 | 2/17 |
92 | 0% |
93 | 0/7 |
94 | 25% |
95 | 2/8 |
96 | 12.5% |
97 | 2/16 |
98 |
99 |
100 |
101 | | pages/admin |
102 | |
103 | 0% |
104 | 0/12 |
105 | 0% |
106 | 0/7 |
107 | 0% |
108 | 0/4 |
109 | 0% |
110 | 0/12 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
121 |
122 |
123 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/layouts/default.vue.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for layouts/default.vue
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 100%
24 | Statements
25 | 1/1
26 |
27 |
28 | 100%
29 | Branches
30 | 0/0
31 |
32 |
33 | 100%
34 | Functions
35 | 0/0
36 |
37 |
38 | 100%
39 | Lines
40 | 1/1
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9 |
55 | 1x
56 |
57 |
58 |
59 |
60 |
61 |
62 | |
63 | import MyFooter from '~/components/Footer.vue';
64 |
65 | export default {
66 | components: {
67 | MyFooter,
68 | },
69 | };
70 | |
71 |
72 |
73 |
74 |
78 |
79 |
80 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/layouts/error.vue.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for layouts/error.vue
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 0%
24 | Statements
25 | 0/9
26 |
27 |
28 | 0%
29 | Branches
30 | 0/6
31 |
32 |
33 | 0%
34 | Functions
35 | 0/1
36 |
37 |
38 | 0%
39 | Lines
40 | 0/9
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10
56 | 11
57 | 12
58 | 13
59 | 14
60 | 15
61 | 16
62 | 17
63 | 18
64 | 19
65 | 20
66 | 21
67 | 22
68 | 23
69 | 24
70 | 25
71 | 26
72 | 27
73 | 28
74 | 29
75 | 30
76 | 31
77 | 32
78 | 33
79 | 34
80 | 35
81 | 36
82 | 37
83 | 38 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 | | <template>
121 | <section class="container">
122 | <img src="../assets/img/logo.png" alt="Nuxt.js Logo" class="logo" />
123 | <h1 class="title">
124 | {{ error.statusCode }}
125 | </h1>
126 | <h2 class="info">
127 | {{ error.message }}
128 | </h2>
129 | <nuxt-link class="button" to="/" v-if="error.statusCode === 404">
130 | Homepage
131 | </nuxt-link>
132 | </section>
133 | </template>
134 | <script>
135 | export default {
136 | props: ['error']
137 | }
138 | </script>
139 |
140 | <style scoped>
141 | .title
142 | {
143 | margin-top: 15px;
144 | font-size: 5em;
145 | }
146 | .info
147 | {
148 | font-weight: 300;
149 | color: #9aabb1;
150 | margin: 0;
151 | }
152 | .button
153 | {
154 | margin-top: 50px;
155 | }
156 | </style>
157 | |
158 |
159 |
160 |
161 |
165 |
166 |
167 |
174 |
175 |
176 |
177 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/layouts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for layouts
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 100%
24 | Statements
25 | 1/1
26 |
27 |
28 | 100%
29 | Branches
30 | 0/0
31 |
32 |
33 | 100%
34 | Functions
35 | 0/0
36 |
37 |
38 | 100%
39 | Lines
40 | 1/1
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | | File |
50 | |
51 | Statements |
52 | |
53 | Branches |
54 | |
55 | Functions |
56 | |
57 | Lines |
58 | |
59 |
60 |
61 |
62 | | default.vue |
63 | |
64 | 100% |
65 | 1/1 |
66 | 100% |
67 | 0/0 |
68 | 100% |
69 | 0/0 |
70 | 100% |
71 | 1/1 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
82 |
83 |
84 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/pages/_id.vue.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for pages/_id.vue
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 0%
24 | Statements
25 | 0/6
26 |
27 |
28 | 100%
29 | Branches
30 | 0/0
31 |
32 |
33 | 0%
34 | Functions
35 | 0/4
36 |
37 |
38 | 0%
39 | Lines
40 | 0/5
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10
56 | 11
57 | 12
58 | 13
59 | 14
60 | 15
61 | 16
62 | 17 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | |
79 | import axios from '~/plugins/axios.js';
80 |
81 | export default {
82 | name: 'id',
83 | asyncData({ params, error }) {
84 | return axios.get(`/api/users/${params.id}`).then((res) => { return { user: res.data }; }).catch(() => {
85 | error({ statusCode: 404, message: 'User not found' });
86 | });
87 | },
88 | head() {
89 | return {
90 | title: `User: ${this.user.name}`,
91 | };
92 | },
93 | };
94 | |
95 |
96 |
97 |
98 |
102 |
103 |
104 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/pages/admin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for pages/admin
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
19 | All files pages/admin
20 |
21 |
22 |
23 | 0%
24 | Statements
25 | 0/12
26 |
27 |
28 | 0%
29 | Branches
30 | 0/7
31 |
32 |
33 | 0%
34 | Functions
35 | 0/4
36 |
37 |
38 | 0%
39 | Lines
40 | 0/12
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | | File |
50 | |
51 | Statements |
52 | |
53 | Branches |
54 | |
55 | Functions |
56 | |
57 | Lines |
58 | |
59 |
60 |
61 |
62 | | index.vue |
63 | |
64 | 0% |
65 | 0/12 |
66 | 0% |
67 | 0/7 |
68 | 0% |
69 | 0/4 |
70 | 0% |
71 | 0/12 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
82 |
83 |
84 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/pages/admin/index.vue.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for pages/admin/index.vue
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 0%
24 | Statements
25 | 0/12
26 |
27 |
28 | 0%
29 | Branches
30 | 0/7
31 |
32 |
33 | 0%
34 | Functions
35 | 0/4
36 |
37 |
38 | 0%
39 | Lines
40 | 0/12
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10
56 | 11
57 | 12
58 | 13
59 | 14
60 | 15
61 | 16
62 | 17
63 | 18
64 | 19
65 | 20
66 | 21
67 | 22
68 | 23
69 | 24
70 | 25
71 | 26
72 | 27
73 | 28
74 | 29
75 | 30
76 | 31
77 | 32
78 | 33 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | |
111 | import AdminNav from '~/components/AdminNav.vue';
112 | import eventHub from '~/plugins/eventsHub.js';
113 |
114 | export default {
115 | layout: 'admin',
116 | components: {
117 | AdminNav,
118 | },
119 | fetch({ store, redirect }) {
120 | if (!store.state.user) {
121 | return redirect('/');
122 | }
123 | return false;
124 | },
125 | methods: {
126 | async logout() {
127 | try {
128 | await this.$store.dispatch('logout');
129 | window.location.replace('/');
130 | } catch (e) {
131 | // eslint-disable-next-line
132 | console.log(e);
133 | }
134 | },
135 | },
136 | mounted() {
137 | eventHub.$on('logout', () => {
138 | this.logout();
139 | });
140 | },
141 | };
142 | |
143 |
144 |
145 |
146 |
150 |
151 |
152 |
159 |
160 |
161 |
162 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/pages/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for pages
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 11.76%
24 | Statements
25 | 2/17
26 |
27 |
28 | 0%
29 | Branches
30 | 0/7
31 |
32 |
33 | 25%
34 | Functions
35 | 2/8
36 |
37 |
38 | 12.5%
39 | Lines
40 | 2/16
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | | File |
50 | |
51 | Statements |
52 | |
53 | Branches |
54 | |
55 | Functions |
56 | |
57 | Lines |
58 | |
59 |
60 |
61 |
62 | | _id.vue |
63 | |
64 | 0% |
65 | 0/6 |
66 | 100% |
67 | 0/0 |
68 | 0% |
69 | 0/4 |
70 | 0% |
71 | 0/5 |
72 |
73 |
74 |
75 | | index.vue |
76 | |
77 | 18.18% |
78 | 2/11 |
79 | 0% |
80 | 0/7 |
81 | 50% |
82 | 2/4 |
83 | 18.18% |
84 | 2/11 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
95 |
96 |
97 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/pages/index.vue.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for pages/index.vue
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 | 18.18%
24 | Statements
25 | 2/11
26 |
27 |
28 | 0%
29 | Branches
30 | 0/7
31 |
32 |
33 | 50%
34 | Functions
35 | 2/4
36 |
37 |
38 | 18.18%
39 | Lines
40 | 2/11
41 |
42 |
43 |
44 |
45 |
46 | | 1
47 | 2
48 | 3
49 | 4
50 | 5
51 | 6
52 | 7
53 | 8
54 | 9
55 | 10
56 | 11
57 | 12
58 | 13
59 | 14
60 | 15
61 | 16
62 | 17
63 | 18
64 | 19
65 | 20
66 | 21
67 | 22
68 | 23
69 | 24
70 | 25
71 | 26
72 | 27
73 | 28
74 | 29
75 | 30
76 | 31
77 | 32
78 | 33
79 | 34
80 | 35
81 | 36
82 | 37
83 | 38
84 | 39 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | 1x
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | 2x
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | |
123 | // import axios from '~/plugins/axios';
124 |
125 | export default {
126 | head() {
127 | return {
128 | title: 'Log In',
129 | };
130 | },
131 | data() {
132 | return {
133 | username: '',
134 | password: '',
135 | };
136 | },
137 | fetch({ store, redirect }) {
138 | if (store.state.user) {
139 | return redirect('/admin');
140 | }
141 | return false;
142 | },
143 | methods: {
144 | async login() {
145 | try {
146 | await this.$store.dispatch('login', {
147 | username: this.username,
148 | password: this.password,
149 | });
150 | this.username = '';
151 | this.password = '';
152 | window.location.replace('/admin');
153 | } catch (e) {
154 | // eslint-disable-next-line
155 | console.log(e);
156 | }
157 | },
158 | },
159 | };
160 | |
161 |
162 |
163 |
164 |
168 |
169 |
170 |
177 |
178 |
179 |
180 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/prettify.css:
--------------------------------------------------------------------------------
1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
2 |
--------------------------------------------------------------------------------
/test/unit/coverage/lcov-report/prettify.js:
--------------------------------------------------------------------------------
1 | window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^