@cnamts/vue-cli-plugin-vue-dash
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -21,7 +21,5 @@ const fs = require('fs'); | ||
// If config.js doesn't exists but config.js.dist does | ||
if (shouldCopyFile) { | ||
warn('Fix missing config.js file'); | ||
// Copy config.js.dist to config.js | ||
fs.copyFileSync(envFilePathDist, envFilePath); | ||
@@ -28,0 +26,0 @@ |
@@ -12,4 +12,2 @@ /** | ||
// If there is no condition, delete the resource, | ||
// Else, test the condition | ||
if (typeof resource.condition === 'undefined') { | ||
@@ -21,18 +19,10 @@ shouldDeleteFile = true; | ||
// If the ressource is a file | ||
if (resource.type === 'file') { | ||
if (shouldDeleteFile) { | ||
// Delete it | ||
delete resources[resource.path]; | ||
} | ||
if (resource.type === 'file' && shouldDeleteFile) { | ||
delete resources[resource.path]; | ||
return; | ||
} | ||
// Else, if it's a folder | ||
if (resource.type === 'folder') { | ||
// Loop in all files | ||
for (const resourceFile in resources) { | ||
// If the path of the ressource matches a file | ||
// and we should delete the file | ||
if (resourceFile.match(resource.path) && shouldDeleteFile) { | ||
// Delete it | ||
delete resources[resourceFile]; | ||
@@ -39,0 +29,0 @@ } |
@@ -14,3 +14,2 @@ const { devDependencies } = require('../../package.json'); | ||
// If the version is an alpha or a beta | ||
if (version.includes('alpha') || version.includes('beta')) { | ||
@@ -24,3 +23,2 @@ // Remove ^ char to avoid version auto-bump | ||
// Use dev dependencies to get packages versions | ||
const VueDotVersion = normalizeVersion(devDependencies['@cnamts/vue-dot']); | ||
@@ -50,42 +48,45 @@ const DesignTokensVersion = normalizeVersion(devDependencies['@cnamts/design-tokens']); | ||
'@cnamts/vue-dot': VueDotVersion, | ||
'axios': '^0.24.0', | ||
'core-js': '^3.19.3', | ||
'axios': '^0.26.1', | ||
'core-js': '^3.21.1', | ||
'custom-event-polyfill': '^1.0.7', | ||
'dayjs': '^1.10.7', | ||
'dayjs': '^1.11.0', | ||
'languages': '^0.1.3', | ||
'vue': '^2.6.14', | ||
'vue-input-facade': '^1.3.7', | ||
'vue-input-facade': '^2.0.0', | ||
'vue-meta': '^2.4.0', | ||
'vue-router': '^3.5.3', | ||
'vuetify': '^2.6.1', | ||
'vuetify': '^2.6.4', | ||
'vuex': '^3.6.2' | ||
}, | ||
devDependencies: { | ||
'@babel/core': '^7.16.0', | ||
'@mdi/js': '^6.5.95', | ||
'@babel/core': '^7.17.8', | ||
'@mdi/js': '^6.6.95', | ||
'@rushstack/eslint-patch': '^1.1.1', | ||
'@types/jest': '^26.0.24', | ||
'@types/webfontloader': '^1.6.33', | ||
'@typescript-eslint/eslint-plugin': '^5.6.0', | ||
'@typescript-eslint/parser': '^5.6.0', | ||
'@vue/cli-plugin-babel': '~4.5.15', | ||
'@vue/cli-plugin-eslint': '~4.5.15', | ||
'@vue/cli-plugin-router': '~4.5.15', | ||
'@vue/cli-plugin-typescript': '~4.5.15', | ||
'@vue/cli-plugin-unit-jest': '~4.5.15', | ||
'@vue/cli-plugin-vuex': '~4.5.15', | ||
'@vue/cli-service': '~4.5.15', | ||
'@types/webfontloader': '^1.6.34', | ||
'@typescript-eslint/eslint-plugin': '^5.16.0', | ||
'@typescript-eslint/parser': '^5.16.0', | ||
'@vue/cli-plugin-babel': '~4.5.17', | ||
'@vue/cli-plugin-eslint': '~4.5.17', | ||
'@vue/cli-plugin-router': '~4.5.17', | ||
'@vue/cli-plugin-typescript': '~4.5.17', | ||
'@vue/cli-plugin-unit-jest': '~4.5.17', | ||
'@vue/cli-plugin-vuex': '~4.5.17', | ||
'@vue/cli-service': '~4.5.17', | ||
'@vue/eslint-config-standard': '^6.1.0', | ||
'@vue/eslint-config-typescript': '^8.0.0', | ||
'@vue/eslint-config-typescript': '^10.0.0', | ||
'@vue/test-utils': '^1.3.0', | ||
'eslint': '^7.32.0', | ||
'eslint-plugin-import': '^2.25.3', | ||
'eslint-plugin-import': '^2.25.4', | ||
'eslint-plugin-node': '^11.1.0', | ||
'eslint-plugin-promise': '^5.2.0', | ||
'eslint-plugin-vue': '^7.20.0', | ||
'eslint-plugin-promise': '^6.0.0', | ||
'eslint-plugin-vue': '^8.5.0', | ||
'jest-serializer-vue': '^2.0.2', | ||
'sass': '1.32.13', /** @see https://github.com/vuetifyjs/vuetify/issues/13694 */ | ||
'sass-loader': '^10.2.0', | ||
'typescript': '~4.5.3', | ||
'lint-staged': '^12.3.7', | ||
'sass': '~1.32.13', /** @see https://github.com/vuetifyjs/vuetify/issues/13694 */ | ||
'sass-loader': '^10.2.1', | ||
'ts-node': '^10.7.0', | ||
'typescript': '~4.6.3', | ||
'vue-class-component': '^7.2.6', | ||
'vue-cli-plugin-vuetify': '^2.4.5', | ||
'vue-cli-plugin-vuetify': '^2.4.8', | ||
'vue-template-compiler': '^2.6.14', | ||
@@ -103,2 +104,11 @@ 'vuetify-loader': '^1.7.3', | ||
'node': '^12 || ^14' | ||
}, | ||
gitHooks: { | ||
'pre-commit': 'lint-staged' | ||
}, | ||
'lint-staged': { | ||
'*.{ts,vue}': [ | ||
'vue-cli-service lint', | ||
'git add' | ||
] | ||
} | ||
@@ -115,9 +125,8 @@ }; | ||
if (options.i18n) { | ||
newPackageProperties.dependencies['vue-i18n'] = '^8.26.7'; | ||
newPackageProperties.dependencies['vue-i18n'] = '^8.27.0'; | ||
} | ||
if (options.vuexPersist) { | ||
// We need 2.0.1 specifically since in | ||
// later version there is a bug with | ||
// Internet Explorer | ||
// We need 2.0.1 specifically since in later | ||
// versions there is a bug with IE 11 | ||
newPackageProperties.dependencies['vuex-persist'] = '2.0.1'; | ||
@@ -127,3 +136,3 @@ } | ||
if (options.cypress) { | ||
newPackageProperties.devDependencies['@vue/cli-plugin-e2e-cypress'] = '~4.5.15'; | ||
newPackageProperties.devDependencies['@vue/cli-plugin-e2e-cypress'] = '~4.5.17'; | ||
@@ -133,3 +142,3 @@ newPackageProperties.scripts['test:e2e'] = 'vue-cli-service test:e2e --headless'; | ||
newPackageProperties.resolutions['cypress'] = '^9.1.1'; | ||
newPackageProperties.resolutions['cypress'] = '^9.5.2'; | ||
} | ||
@@ -136,0 +145,0 @@ |
@@ -8,3 +8,2 @@ /** | ||
function parseIndexFile(indexFile) { | ||
// Replace {BASE_URL} with <%= BASE_URL %> | ||
return indexFile.replace(/{BASE_URL}/g, '<%= BASE_URL %>'); | ||
@@ -11,0 +10,0 @@ } |
@@ -30,6 +30,4 @@ const { extendPackage } = require('./functions/extendPackage'); | ||
// Update package.json | ||
extendPackage(api, options, pm); | ||
// Delete old ressources and parse public/index.html | ||
api.postProcessFiles((resources) => { | ||
@@ -36,0 +34,0 @@ const resourcesToDelete = getResourcesToDelete(options); |
@@ -1,2 +0,4 @@ | ||
module.exports = { | ||
import type { Config } from '@jest/types'; | ||
const config: Config.InitialOptions = { | ||
preset: '@vue/cli-plugin-unit-jest/presets/typescript', | ||
@@ -51,1 +53,3 @@ testMatch: [ | ||
}; | ||
export default config; |
@@ -11,6 +11,4 @@ import Vue from 'vue'; | ||
// Tests | ||
describe('AppFooter', () => { | ||
it('renders correctly', () => { | ||
// Mount component | ||
wrapper = mountComponent(AppFooter); | ||
@@ -17,0 +15,0 @@ |
@@ -11,10 +11,24 @@ import Vue from 'vue'; | ||
// Tests | ||
describe('AppHeader', () => { | ||
it('renders correctly', () => { | ||
// Mount component | ||
wrapper = mountComponent(AppHeader); | ||
wrapper = mountComponent(AppHeader, { | ||
mocks: { | ||
$t: (key: string) => { | ||
return key === 'components.layout.appHeader.navigationItems' ? [] : key; | ||
} | ||
} | ||
}); | ||
expect(html(wrapper)).toMatchSnapshot(); | ||
}); | ||
it('renders correctly when maintenance is enabled', () => { | ||
wrapper = mountComponent(AppHeader, { | ||
mocks: { | ||
$maintenanceEnabled: true | ||
} | ||
}); | ||
expect(html(wrapper)).toMatchSnapshot(); | ||
}); | ||
}); |
@@ -0,5 +1,6 @@ | ||
import { NotificationModule } from '@cnamts/vue-dot/src/modules/notification/types'; | ||
import { VuexBindings } from './store/types'; | ||
declare module 'vue/types/vue' { | ||
interface Vue extends VuexBindings { | ||
interface Vue extends VuexBindings, NotificationModule { | ||
// Here you can add types for plugins | ||
@@ -6,0 +7,0 @@ // that don't have typings |
/* eslint-disable @typescript-eslint/no-empty-interface */ | ||
export interface RootState {} | ||
import { NotificationObj } from '@cnamts/vue-dot/src/modules/notification'; | ||
/** | ||
* This is used to properly type components using mappers from Vuex | ||
* see https://github.com/vuejs/vuex/pull/1121 | ||
* @see https://github.com/vuejs/vuex/pull/1121 | ||
*/ | ||
export interface VuexBindings { | ||
// modules/notification | ||
addNotification: (notification: NotificationObj) => void; | ||
clearNotification: () => void; | ||
notification: NotificationObj | null; | ||
} | ||
export interface VuexBindings {} |
@@ -16,3 +16,13 @@ export default { | ||
} | ||
] | ||
], | ||
user: 'Utilisateur', | ||
role: 'Développeur', | ||
userMenuLinks: [ | ||
{ | ||
title: 'Accueil', | ||
to: { | ||
name: 'home' | ||
} | ||
} | ||
], | ||
}; |
import appHeader from './appHeader'; | ||
import headerMenu from './headerMenu'; | ||
export default { | ||
appHeader, | ||
headerMenu | ||
appHeader | ||
}; |
@@ -24,6 +24,4 @@ import Vue from 'vue'; | ||
// Tests | ||
describe('About', () => { | ||
it('renders correctly', () => { | ||
// Mount component | ||
wrapper = mountComponent(About<% if (i18n) { %>, { | ||
@@ -30,0 +28,0 @@ mocks: { |
@@ -11,6 +11,4 @@ import Vue from 'vue'; | ||
// Tests | ||
describe('Home', () => { | ||
it('renders correctly', () => { | ||
// Mount component | ||
wrapper = mountComponent(Home); | ||
@@ -17,0 +15,0 @@ |
@@ -11,6 +11,4 @@ import Vue from 'vue'; | ||
// Tests | ||
describe('Maintenance', () => { | ||
it('renders correctly', () => { | ||
// Mount component | ||
wrapper = mountComponent(Maintenance); | ||
@@ -17,0 +15,0 @@ |
@@ -11,6 +11,4 @@ import Vue from 'vue'; | ||
// Tests | ||
describe('NotFound', () => { | ||
it('renders correctly', () => { | ||
// Mount component | ||
wrapper = mountComponent(NotFound); | ||
@@ -17,0 +15,0 @@ |
@@ -11,6 +11,4 @@ import Vue from 'vue'; | ||
// Tests | ||
describe('App', () => { | ||
it('renders correctly', () => { | ||
// Mount component | ||
wrapper = mountComponent(App, { | ||
@@ -17,0 +15,0 @@ router |
const { fixEnvFile } = require('./fixEnvFile'); | ||
/** | ||
* Augment serve command with fixEnvFile | ||
* | ||
* @param {object} api The plugin API | ||
@@ -12,3 +14,2 @@ * @returns {void} | ||
// Augment serve command with fixEnvFile | ||
serve.fn = (...args) => { | ||
@@ -15,0 +16,0 @@ fixEnvFile(); |
{ | ||
"name": "@cnamts/vue-cli-plugin-vue-dash", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Vue CLI plugin to scaffold front-end projects", | ||
@@ -32,5 +32,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"@cnamts/design-tokens": "^2.2.0", | ||
"@cnamts/form-builder": "^2.2.0", | ||
"@cnamts/vue-dot": "^2.2.0" | ||
"@cnamts/design-tokens": "^2.3.0", | ||
"@cnamts/form-builder": "^2.3.0", | ||
"@cnamts/vue-dot": "^2.3.0" | ||
}, | ||
@@ -40,3 +40,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "8b451d6ee04bfce956092262e1aa37e93c0417e6" | ||
"gitHead": "2f1aad0becee1fed5dd3d836755794c0ce9d43df" | ||
} |
@@ -5,3 +5,2 @@ const shouldRenderTemplate = require('./shouldRenderTemplate'); | ||
// Make a function, so you can call superb() | ||
const superb = () => Superb.random(); | ||
@@ -8,0 +7,0 @@ |
@@ -37,1 +37,21 @@ # Vue CLI plugin Vue Dash | ||
This way you have no setup to do when cloning a project! | ||
### Vue Dot tree-shaking | ||
By default, when importing the Vue Dot library, all components are registered globally. | ||
You can reduce the final size of your application by importing only the components that you use. | ||
For this, the `vueDotLoader` is used in combinaison with the [Vuetify Loader](https://github.com/vuetifyjs/vuetify-loader) plugin: | ||
```js | ||
// vue.config.js | ||
const { vueDotLoader } = require('@cnamts/vue-cli-plugin-vue-dash/vueDotLoader'); | ||
module.exports = { | ||
chainWebpack: config => { | ||
// Auto-load Vue Dot components | ||
config.plugin('VuetifyLoaderPlugin').tap(vueDotLoader); | ||
} | ||
}; | ||
``` |
@@ -1,4 +0,1 @@ | ||
// Vue CLI configuration | ||
// see https://cli.vuejs.org/guide/ for help | ||
const componentMap = { | ||
@@ -15,2 +12,3 @@ // Elements | ||
PageContainer: 'elements', | ||
UserMenuBtn: 'elements', | ||
// Patterns | ||
@@ -17,0 +15,0 @@ DataListGroup: 'patterns', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
57
162084
109
1825