Skip to content

Commit

Permalink
chore: update dsfr dependencies (#570)
Browse files Browse the repository at this point in the history
* update vue-dsfr and datagouv-components
* simplify dsfrTabs
* upgrade eslint-auto-import config
* small fix in app + unplugin conf
* auto-imports example on App.vue
* remove icon override in main.css
* remove not needed icons.js
* doc + add files to prettier format
* fix dsfr search bar radius button
  • Loading branch information
narduin authored Nov 6, 2024
1 parent 2ca1305 commit 5b59c3d
Show file tree
Hide file tree
Showing 21 changed files with 3,026 additions and 477 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*.d.ts
eslintrc-auto-import.mjs
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

Verticales thématiques adossées à [data.gouv.fr](https://www.data.gouv.fr/).


## Configuration

Chaque verticale est configurée dans un fichier `config.yaml` stocké sous [`configs/$verticale`](configs).

La variable d'environnement `VITE_SITE_ID` permet de définir la configuration utilisée au lancement de l'application.
Cette variable peut être définie dans le fichier [`.env`](.env) ou ses dérivés.


## Développement

### Environnement recommandé
Expand Down Expand Up @@ -66,9 +64,33 @@ npm run hint
npm run format
```

## Librairies et plugins utilisés

### Librairies

- `@datagouv/components` // composants provenant de data.gouv.fr
- `@gouvminint/vue-dsfr` // intégration `vue` de composants issus du DSFR
- `@gouvfr/dsfr` // nécessaire pour les deux précédentes
- `@vueuse/core` // collection d'utilitaires `vue` (`useTitle`)
- `@vueuse/integrations` // intégration supplémentaires de vueuse (`focustrap`)
- `unplugin-auto-import` - `vite.config.mts` // auto-import d'API `vue` (`ref`, `computed`…) et `vue-dsfr` ([d'après ce tutoriel](https://vue-ds.fr/guide/pour-commencer#avoir-un-bundle-optimise-et-une-dx-optimale))
- `unplugin-vue-components` - `vite.config.mts` // auto-import des composants custom et `vue-dsfr` ([idem](https://vue-ds.fr/guide/pour-commencer#avoir-un-bundle-optimise-et-une-dx-optimale))
- `vee-validate` // validation de formulaire
- `@vee-validate/rules` // collection de règles de validation
- `@unhead/vue` // SEO (en gros)

### Formatage et validation du code

- `eslint` - `eslint.config.mjs`
- `typescript-eslint`
- `eslint-plugin-json`
- `eslint-plugin-vue`
- `prettier` - `.prettierrc.mjs`
- `prettier-plugin-organize-imports` // organise et/ou supprime les imports des fichiers

À chaque `git commit`, `husky` lance `lint-staged` qui formate les fichiers "staged" avec `prettier`.

## Auteurs

- data.gouv.fr, Direction interministérielle du numérique.
- Ecolab, Commissariat général au développement durable, Ministère de la transition écologique.

9 changes: 8 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ export default [
},
{
name: 'files-to-ignore',
ignores: ['.gitignore', '**/dist/**', '**/dist-ssr/**', '**/coverage/**']
ignores: [
'.gitignore',
'**/dist/**',
'**/dist-ssr/**',
'**/coverage/**',
'**/*.d.ts',
'eslintrc-auto-import.mjs'
]
},
eslintConfigPrettier,

Expand Down
94 changes: 94 additions & 0 deletions eslintrc-auto-import.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
export default {
"globals": {
"Component": true,
"ComponentPublicInstance": true,
"ComputedRef": true,
"DirectiveBinding": true,
"EffectScope": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,
"InjectionKey": true,
"MaybeRef": true,
"MaybeRefOrGetter": true,
"PropType": true,
"Ref": true,
"VNode": true,
"WritableComputedRef": true,
"afterAll": true,
"afterEach": true,
"assert": true,
"beforeAll": true,
"beforeEach": true,
"chai": true,
"computed": true,
"createApp": true,
"customRef": true,
"defineAsyncComponent": true,
"defineComponent": true,
"describe": true,
"effectScope": true,
"expect": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"inject": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"it": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeRouteLeave": true,
"onBeforeRouteUpdate": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onUnmounted": true,
"onUpdated": true,
"onWatcherCleanup": true,
"provide": true,
"reactive": true,
"readonly": true,
"ref": true,
"resolveComponent": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"suite": true,
"test": true,
"toRaw": true,
"toRef": true,
"toRefs": true,
"toValue": true,
"triggerRef": true,
"unref": true,
"useAttrs": true,
"useCssModule": true,
"useCssVars": true,
"useId": true,
"useLink": true,
"useModel": true,
"useRoute": true,
"useRouter": true,
"useScheme": true,
"useSlots": true,
"useTabs": true,
"useTemplateRef": true,
"vi": true,
"vitest": true,
"watch": true,
"watchEffect": true,
"watchPostEffect": true,
"watchSyncEffect": true
}
}
Loading

0 comments on commit 5b59c3d

Please sign in to comment.