Skip to content

Commit

Permalink
🐛 vue-dash: Fix npm compatibility (#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
deraw authored Oct 19, 2021
1 parent 262b124 commit 88ae2a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
- **template:** Correction du rapport de couverture de code ([#1479](https://github.com/assurance-maladie-digital/design-system/pull/1479)) ([de0f728](https://github.com/assurance-maladie-digital/design-system/commit/de0f728b70cd56eb31e85f8686aa4d7e2fc7e79c))
- **template:** Correction de l'utilisation du composant `ErrorPage` lorsque i18n n'est pas installé ([#1480](https://github.com/assurance-maladie-digital/design-system/pull/1480)) ([bfbee3f](https://github.com/assurance-maladie-digital/design-system/commit/bfbee3f645b9c529de954ce29e21afccd9d5e408))
- **template:** Correction des erreurs de validation HTML ([#1506](https://github.com/assurance-maladie-digital/design-system/pull/1506)) ([ce41668](https://github.com/assurance-maladie-digital/design-system/commit/ce41668c7177bcccb50be2920617f4dc4bfb7ad5))
- **template:** Correction de la compatibilité avec npm ([#1514](https://github.com/assurance-maladie-digital/design-system/pull/1514))

- ♻️ **Refactoring**
- **template:** Utilisation du caractère apostrophe ([#1472](https://github.com/assurance-maladie-digital/design-system/pull/1472)) ([9ad9f0b](https://github.com/assurance-maladie-digital/design-system/commit/9ad9f0b62ee685b366514adecf1fae360d0ea764))
- **template:** Mise à jour du message par défaut lorsque JavaScript est désactivé ([#1473](https://github.com/assurance-maladie-digital/design-system/pull/1473)) ([a3f8e49](https://github.com/assurance-maladie-digital/design-system/commit/a3f8e4912a5c610a518beb935212960385185b9a))
- **template:** Mise à jour des styles du loader ([#1513](https://github.com/assurance-maladie-digital/design-system/pull/1513))
- **template:** Mise à jour des styles du loader ([#1513](https://github.com/assurance-maladie-digital/design-system/pull/1513)) ([262b124](https://github.com/assurance-maladie-digital/design-system/commit/262b1241e600078ee9c6f7eec31ca8b928f18cfc))

- 🚨 **Lint**
- **template:** Correction des erreurs de lint lorsque i18n n'est pas installé ([#1478](https://github.com/assurance-maladie-digital/design-system/pull/1478)) ([5e50e1e](https://github.com/assurance-maladie-digital/design-system/commit/5e50e1eb53a45007d0d6bdc513fadf4600acc5d6))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const FormBuilderVersion = normalizeVersion(devDependencies['@cnamts/form-builde
* @param {object} options The plugin options
* @returns {void}
*/
function extendPackage(api, options) {
function extendPackage(api, options, pm) {
const newPackageProperties = {
scripts: {
'serve': 'vue-cli-service serve',
Expand Down Expand Up @@ -79,7 +79,7 @@ function extendPackage(api, options) {
'eslint-plugin-promise': '^5.1.0',
'eslint-plugin-vue': '^7.17.0',
'jest-serializer-vue': '^2.0.2',
'sass': '1.32.13', // @see https://github.com/vuetifyjs/vuetify/issues/13694
'sass': '1.32.13', /** @see https://github.com/vuetifyjs/vuetify/issues/13694 */
'sass-loader': '^10.2.0',
'typescript': '~4.4.2',
'vue-class-component': '^7.2.6',
Expand All @@ -95,11 +95,17 @@ function extendPackage(api, options) {
'babel-jest': '^26.6.3'
},
engines: {
'node': '^12 || ^14',
'yarn': '^1.12'
'node': '^12 || ^14'
}
};

if (pm === 'npm') {
newPackageProperties.devDependencies['deepmerge'] = '^4.2.2'; /** @see https://github.com/assurance-maladie-digital/vue-cli-preset/issues/5 */
newPackageProperties.engines['npm'] = '^7.20.6';
} else if (pm === 'yarn') {
newPackageProperties.engines['yarn'] = '^1.12';
}

if (options.i18n) {
newPackageProperties.dependencies['vue-i18n'] = '^8.25.0';
}
Expand Down
5 changes: 3 additions & 2 deletions packages/vue-cli-plugin-vue-dash/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { capitalizeFirstLetter } = require('../utils');

module.exports = (api, userOptions) => {
const projectName = api.rootOptions.projectName;
const pm = api.generator.pm.bin;

// By default, do not render template when invoking
// except if --render-template option is provided
Expand All @@ -21,15 +22,15 @@ module.exports = (api, userOptions) => {
// Custom options
name: projectName,
footerDate: getFooterDate(),
pm: 'yarn',
pm,
// Functions
capitalizeFirstLetter
};

api.render('./template', options);

// Update package.json
extendPackage(api, options);
extendPackage(api, options, pm);

// Delete old ressources and parse public/index.html
api.postProcessFiles((resources) => {
Expand Down

0 comments on commit 88ae2a2

Please sign in to comment.