vue-cli-plugin-access
Advanced tools
Comparing version 1.0.3 to 1.2.0
module.exports = (api, opts, rootOptions) => { | ||
const utils = require('./utils')(api) | ||
api.extendPackage({ | ||
scripts: { | ||
"build": "vue-cli-service build --mode production", | ||
"stage": "vue-cli-service build --mode staging" | ||
} | ||
}) | ||
api.extendPackage({ | ||
dependencies: { | ||
"axios": "^0.18.0", | ||
'element-ui': '^2.4.5', | ||
"js-cookie": "^2.2.0", | ||
"normalize.css": "^8.0.1", | ||
"nprogress": "^0.2.0", | ||
"v-money": "^0.8.1", | ||
"vue-i18n": "^8.7.0", | ||
"vue-router": "^3.0.1", | ||
"vuex": "^3.0.1", | ||
"vuex-shortly": "^0.1.2", | ||
"vuex-persistedstate": "^2.5.4" | ||
} | ||
}) | ||
api.render({ | ||
api.render({ | ||
'./.env': './templates/_env', | ||
'./pre-commit': './templates/pre-commit', | ||
'./vue.config.js': './templates/vue.config.js', | ||
'./.circleci/config.yml': './templates/.circleci/config.yml', | ||
'./src/assets/404_images/404.png': './templates/src/assets/404_images/404.png', | ||
'./src/assets/404_images/404_cloud.png': './templates/src/assets/404_images/404_cloud.png', | ||
'./src/assets/fundo_site.jpg': './templates/src/assets/fundo_site.jpg', | ||
'./public/android-chrome-144x144.png': './templates/public/android-chrome-144x144.png', | ||
'./public/apple-touch-icon.png': './templates/public/apple-touch-icon.png', | ||
'./public/browserconfig.xml': './templates/public/browserconfig.xml', | ||
'./public/favicon-16x16.png': './templates/public/favicon-16x16.png', | ||
'./public/favicon-32x32.png': './templates/public/favicon-32x32.png', | ||
'./public/favicon.ico': './templates/public/favicon.ico', | ||
'./public/index.html': './templates/public/index.html', | ||
'./public/mstile-150x150.png': './templates/public/mstile-150x150.png', | ||
'./public/safari-pinned-tab.svg': './templates/public/safari-pinned-tab.svg', | ||
'./public/site.webmanifest': './templates/public/site.webmanifest', | ||
'./src/components/A55Logo.vue': './templates/src/components/A55Logo.vue', | ||
'./src/components/ChartCard.vue': './templates/src/components/ChartCard.vue', | ||
'./src/main.js': './templates/src/main.js', | ||
'./src/graphql/Example.gql': './templates/src/graphql/Example.gql', | ||
'./src/plugins/apollo.js': './templates/src/plugins/apollo.js', | ||
'./src/plugins/axios.js': './templates/src/plugins/axios.js', | ||
'./src/plugins/element.js': './templates/src/plugins/element.js', | ||
'./src/plugins/i18n.js': './templates/src/plugins/i18n.js', | ||
'./src/plugins/index.js': './templates/src/plugins/index.js', | ||
'./src/plugins/money.js': './templates/src/plugins/money.js', | ||
'./src/plugins/permissions.js': './templates/src/plugins/permissions.js', | ||
'./src/plugins/element.js': './templates/src/plugins/element.js', | ||
'./src/plugins/event-bus.js': './templates/src/plugins/event-bus.js', | ||
'./src/plugins/i18n.js': './templates/src/plugins/i18n.js', | ||
'./src/plugins/index.js': './templates/src/plugins/index.js', | ||
'./src/plugins/money.js': './templates/src/plugins/money.js', | ||
'./src/plugins/permissions.js': './templates/src/plugins/permissions.js', | ||
@@ -45,30 +37,72 @@ './src/router/index.js': './templates/src/router/index.js', | ||
'./src/store/index.js': './templates/src/store/index.js', | ||
'./src/store/types.js': './templates/src/store/types.js', | ||
'./src/store/modules/auth.js': './templates/src/store/modules/auth.js', | ||
'./src/store/types.js': './templates/src/store/types.js', | ||
'./src/store/modules/auth.js': './templates/src/store/modules/auth.js', | ||
'./src/store/modules/index.js': './templates/src/store/modules/index.js', | ||
'./src/styles/mixins.scss': './templates/src/styles/mixins.scss', | ||
'./src/views/Dashboard.vue': './templates/src/views/Dashboard.vue', | ||
'./src/views/Login.vue': './templates/src/views/Login.vue', | ||
'./src/views/Example.vue': './templates/src/views/Example.vue', | ||
'./src/views/NotFound.vue': './templates/src/views/NotFound.vue', | ||
'./src/views/Private.vue': './templates/src/views/Private.vue', | ||
'./src/views/Public.vue': './templates/src/views/Public.vue', | ||
'./src/styles/mixins.scss': './templates/src/styles/mixins.scss', | ||
'./src/App.vue': './templates/src/App.vue', | ||
'./vue.config.js': './templates/vue.config.js', | ||
'./.circleci/config.yml': './templates/.circleci/config.yml', | ||
'./.env': './templates/_env' | ||
}) | ||
api.render({ | ||
'./src/element-variables.scss': './templates/src/element-variables.scss', | ||
'./src/element-variables.source.scss': './templates/src/element-variables.source.scss', | ||
'./src/main.js': './templates/src/main.js' | ||
}) | ||
api.extendPackage({ | ||
scripts: { | ||
"build": "vue-cli-service build --mode production", | ||
"stage": "vue-cli-service build --mode staging" | ||
}, | ||
dependencies: { | ||
"@statnett/vue-plotly": "^0.2.0", | ||
"apollo-cache-inmemory": "^1.4.2", | ||
"apollo-upload-client": "^10.0.0", | ||
"axios": "^0.18.0", | ||
'element-ui': '^2.4.5', | ||
"js-cookie": "^2.2.0", | ||
"normalize.css": "^8.0.1", | ||
"nprogress": "^0.2.0", | ||
"plotly.js": "^1.44.1", | ||
"v-money": "^0.8.1", | ||
"vue-apollo": "^3.0.0-beta.27", | ||
"vue-i18n": "^8.7.0", | ||
"vue-router": "^3.0.1", | ||
"vuex": "^3.0.1", | ||
"vuex-shortly": "^0.1.2", | ||
"vuex-persistedstate": "^2.5.4" | ||
}, | ||
devDependencies: { | ||
'sass-loader': '^7.0.3', | ||
"eslint-plugin-graphql": "^3.0.1", | ||
"vue-cli-plugin-apollo": "^0.19.1", | ||
"graphql-tag": "^2.10.1", | ||
'node-sass': '^4.9.2' | ||
}, | ||
gitHooks: { | ||
"pre-commit": "./pre-commit" | ||
}, | ||
eslintConfig: { | ||
"plugins": [ "graphql" ], | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"plugin:vue/essential", | ||
"eslint:recommended" | ||
], | ||
"rules": { | ||
"no-console": 0 | ||
}, | ||
"parserOptions": { | ||
"parser": "babel-eslint" | ||
} | ||
} | ||
}) | ||
} |
@@ -6,2 +6,3 @@ import Vue from 'vue' | ||
import './plugins/' | ||
import createProvider from "./plugins/apollo"; | ||
@@ -13,3 +14,4 @@ Vue.config.productionTip = false | ||
router, | ||
store | ||
store, | ||
apolloProvider: createProvider(), | ||
}).$mount('#app') |
import Vue from 'vue' | ||
<%_ if (options.import === 'full') { _%> | ||
import Element from 'element-ui' | ||
<%_ if (options.customTheme) { _%> | ||
import '../element-variables.scss' | ||
<%_ } else { _%> | ||
import 'element-ui/lib/theme-chalk/index.css' | ||
<%_ } _%> | ||
<%_ if (options.lang !== 'zh-CN') { _%> | ||
import locale from 'element-ui/lib/locale/lang/<%= options.lang %>' | ||
Vue.use(Element, { locale }) | ||
<%_ } else { _%> | ||
Vue.use(Element) | ||
<%_ } _%> | ||
<%_ } else { _%> | ||
import { Button } from 'element-ui' | ||
<%_ if (options.lang !== 'zh-CN') { _%> | ||
import lang from 'element-ui/lib/locale/lang/<%= options.lang %>' | ||
import ElementUI from 'element-ui' | ||
import lang from 'element-ui/lib/locale/lang/en' | ||
import locale from 'element-ui/lib/locale' | ||
import '@/element-variables.scss' | ||
Vue.use(ElementUI); | ||
locale.use(lang) | ||
<%_ } _%> | ||
<%_ } _%> |
@@ -5,10 +5,4 @@ import store from '@/store' | ||
import 'nprogress/nprogress.css' | ||
import { Message } from 'element-ui' | ||
import { AUTH_LOGOUT, AUTH_VERIFY } from "@/store/types"; | ||
const whiteList = [ | ||
'Login', | ||
'Page Not Found' | ||
] | ||
const guard = async (to, from, next) => { | ||
@@ -19,20 +13,13 @@ try { | ||
} catch (error) { | ||
await store.dispatch(AUTH_LOGOUT); | ||
Message.error(error || 'Verification failed, please login again') | ||
next("/login"); | ||
store.dispatch(AUTH_LOGOUT); | ||
window.location = `${process.env.VUE_APP_AUTH_URL}?redirect=${window.location}` | ||
} | ||
}; | ||
router.beforeEach((to, from, next) => { | ||
router.afterEach(() => { NProgress.done() }); | ||
router.beforeEach(async (to, from, next) => { | ||
NProgress.start(); | ||
if (whiteList.indexOf(to.name) === -1) { | ||
guard(to, from, next); | ||
} else { | ||
next(); | ||
} | ||
await guard(to, from, next); | ||
NProgress.done(); | ||
}); | ||
router.afterEach(() => { | ||
NProgress.done(); | ||
}); |
import Vue from "vue"; | ||
import Router from "vue-router"; | ||
const Login = () => import(/* webpackChunkName: 'public' */ "@/views/Login"); | ||
const Public = () => import(/* webpackChunkName: 'public' */ "@/views/Public"); | ||
const NotFound = () => import(/* webpackChunkName: 'public' */ "@/views/NotFound"); | ||
const Private = () => import(/* webpackChunkName: 'private' */ "@/views/Private"); | ||
const Dashboard = () => import(/* webpackChunkName: 'private' */ "@/views/Dashboard"); | ||
const Example = () => import(/* webpackChunkName: 'private' */ "@/views/Example"); | ||
@@ -16,14 +15,2 @@ Vue.use(Router); | ||
{ | ||
path: "/login", | ||
component: Public, | ||
hidden: true, | ||
children: [ | ||
{ | ||
path: "", | ||
name: "Login", | ||
component: Login | ||
} | ||
] | ||
}, | ||
{ | ||
path: "/", | ||
@@ -39,6 +26,6 @@ component: Private, | ||
{ | ||
path: "companies", | ||
name: "Companies", | ||
path: "example", | ||
name: "Example", | ||
icon: "el-icon-star-off", | ||
component: Dashboard | ||
component: Example | ||
} | ||
@@ -48,6 +35,6 @@ ] | ||
{ | ||
path: "*", | ||
name: "Page Not Found", | ||
hidden: true, | ||
component: NotFound | ||
path: "*", | ||
name: "Page Not Found", | ||
hidden: true, | ||
component: NotFound | ||
} | ||
@@ -57,2 +44,14 @@ ] | ||
export const menuEntries = [ | ||
{ | ||
"label": "Dashboard", | ||
"path": "/", | ||
"icon": "dashboard" | ||
}, { | ||
"label": "Example", | ||
"path": "/example", | ||
"icon": "casino" | ||
} | ||
]; | ||
export default router; |
@@ -6,8 +6,5 @@ import Vue from "vue"; | ||
import * as modules from "@/store/modules"; | ||
import { name, version } from "../../package.json"; | ||
Vue.use(Vuex); | ||
const versionKey = `${name}-${version}`; | ||
const store = new Vuex.Store({ | ||
@@ -18,4 +15,4 @@ strict: true, | ||
versionState({ | ||
key: versionKey, | ||
paths: ["auth.token"], | ||
key: "a55-auth", | ||
paths: ["auth.token", "auth.user"], | ||
storage: { | ||
@@ -22,0 +19,0 @@ getItem: key => Cookies.get(key), |
@@ -42,3 +42,3 @@ import * as types from "@/store/types"; | ||
commit(types.AUTH_TOKEN, null); | ||
commit(types.AUTH_USER, {}); | ||
commit(types.AUTH_USER, {}); | ||
} | ||
@@ -45,0 +45,0 @@ }; |
{ | ||
"name": "vue-cli-plugin-access", | ||
"version": "1.0.3", | ||
"version": "1.2.0", | ||
"description": "vue-cli 3 plugin to add A55 presets", | ||
"main": "index.js", | ||
"scripts": { | ||
"setup": "rm -Rf app/ && vue create app", | ||
"access": "cd app && npm install --save-dev file:.. && vue invoke access" | ||
}, | ||
"keywords": [ | ||
@@ -7,0 +11,0 @@ "access-55", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1251595
95
685
1
9
1