commit 4840b31c96b18b772d185c498a53b5a25a0a20c0 Author: fbenoist68 Date: Sat Dec 2 12:49:31 2023 +0100 first commit diff --git a/.editorconfig b/.editorconfig new file mode 100755 index 0000000..63c8c4c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,38 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.{js,py}] +charset = utf-8 + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +# 2 space indentation +[*.{vue,scss,ts}] +indent_style = space +indent_size = 2 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab + +# Indentation override for all JS under lib directory +[lib/**.js] +indent_style = space +indent_size = 2 + +# Matches the exact files either package.json or .travis.yml +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/.env.example b/.env.example new file mode 100755 index 0000000..b8ca0df --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +VITE_API_BASE_URL= diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100755 index 0000000..a578d06 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,245 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: [ + '@antfu/eslint-config-vue', + 'plugin:vue/vue3-recommended', + 'plugin:import/recommended', + 'plugin:import/typescript', + 'plugin:promise/recommended', + 'plugin:sonarjs/recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:case-police/recommended', + + // 'plugin:unicorn/recommended', + ], + parser: 'vue-eslint-parser', + parserOptions: { + ecmaVersion: 13, + parser: '@typescript-eslint/parser', + sourceType: 'module', + }, + plugins: [ + 'vue', + '@typescript-eslint', + 'regex', + ], + ignorePatterns: ['src/plugins/iconify/*.js', 'node_modules', 'dist', '*.d.ts', 'vendor'], + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + + // indentation (Already present in TypeScript) + 'comma-spacing': ['error', { before: false, after: true }], + 'key-spacing': ['error', { afterColon: true }], + 'n/prefer-global/process': ['off'], + 'sonarjs/cognitive-complexity': ['off'], + + 'vue/first-attribute-linebreak': ['error', { + singleline: 'beside', + multiline: 'below', + }], + + 'antfu/top-level-function': 'off', + '@typescript-eslint/no-explicit-any': 'off', + + // indentation (Already present in TypeScript) + 'indent': ['error', 2], + + // Enforce trailing comma (Already present in TypeScript) + 'comma-dangle': ['error', 'always-multiline'], + + // Enforce consistent spacing inside braces of object (Already present in TypeScript) + 'object-curly-spacing': ['error', 'always'], + + // Enforce camelCase naming convention + 'camelcase': 'error', + + // Disable max-len + 'max-len': 'off', + + // we don't want it + 'semi': ['error', 'never'], + + // add parens ony when required in arrow function + 'arrow-parens': ['error', 'as-needed'], + + // add new line above comment + 'newline-before-return': 'error', + + // add new line above comment + 'lines-around-comment': [ + 'error', + { + beforeBlockComment: true, + beforeLineComment: true, + allowBlockStart: true, + allowClassStart: true, + allowObjectStart: true, + allowArrayStart: true, + + // We don't want to add extra space above closing SECTION + ignorePattern: '!SECTION', + }, + ], + + // Ignore _ as unused variable + '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_+$', argsIgnorePattern: '^_+$' }], + + 'array-element-newline': ['error', 'consistent'], + 'array-bracket-newline': ['error', 'consistent'], + + 'vue/multi-word-component-names': 'off', + + 'padding-line-between-statements': [ + 'error', + { blankLine: 'always', prev: 'expression', next: 'const' }, + { blankLine: 'always', prev: 'const', next: 'expression' }, + { blankLine: 'always', prev: 'multiline-const', next: '*' }, + { blankLine: 'always', prev: '*', next: 'multiline-const' }, + ], + + // Plugin: eslint-plugin-import + 'import/prefer-default-export': 'off', + 'import/newline-after-import': ['error', { count: 1 }], + 'no-restricted-imports': ['error', 'vuetify/components', { + name: 'vue3-apexcharts', + message: 'apexcharts are autoimported', + }], + + // For omitting extension for ts files + 'import/extensions': [ + 'error', + 'ignorePackages', + { + js: 'never', + jsx: 'never', + ts: 'never', + tsx: 'never', + }, + ], + + // ignore virtual files + 'import/no-unresolved': [2, { + ignore: [ + '~pages$', + 'virtual:generated-layouts', + + // Ignore vite's ?raw imports + '.*\?raw', + ], + }], + + // Thanks: https://stackoverflow.com/a/63961972/10796681 + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': ['error'], + + '@typescript-eslint/consistent-type-imports': 'error', + + // Plugin: eslint-plugin-promise + 'promise/always-return': 'off', + 'promise/catch-or-return': 'off', + + // ESLint plugin vue + 'vue/block-tag-newline': 'error', + 'vue/component-api-style': 'error', + 'vue/component-name-in-template-casing': ['error', 'PascalCase', { registeredComponentsOnly: false, ignores: ['/^swiper-/'] }], + 'vue/custom-event-name-casing': ['error', 'camelCase', { + ignores: [ + '/^(click):[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?/', + ], + }], + 'vue/define-macros-order': 'error', + 'vue/html-comment-content-newline': 'error', + 'vue/html-comment-content-spacing': 'error', + 'vue/html-comment-indent': 'error', + 'vue/match-component-file-name': 'error', + 'vue/no-child-content': 'error', + 'vue/require-default-prop': 'off', + + 'vue/no-duplicate-attr-inheritance': 'error', + 'vue/no-empty-component-block': 'error', + 'vue/no-multiple-objects-in-class': 'error', + 'vue/no-reserved-component-names': 'error', + 'vue/no-template-target-blank': 'error', + 'vue/no-useless-mustaches': 'error', + 'vue/no-useless-v-bind': 'error', + 'vue/padding-line-between-blocks': 'error', + 'vue/prefer-separate-static-class': 'error', + 'vue/prefer-true-attribute-shorthand': 'error', + 'vue/v-on-function-call': 'error', + 'vue/no-restricted-class': ['error', '/^(p|m)(l|r)-/'], + 'vue/valid-v-slot': ['error', { + allowModifiers: true, + }], + + // -- Extension Rules + 'vue/no-irregular-whitespace': 'error', + 'vue/template-curly-spacing': 'error', + + // -- Sonarlint + 'sonarjs/no-duplicate-string': 'off', + 'sonarjs/no-nested-template-literals': 'off', + + // -- Unicorn + // 'unicorn/filename-case': 'off', + // 'unicorn/prevent-abbreviations': ['error', { + // replacements: { + // props: false, + // }, + // }], + + // Internal Rules + 'valid-appcardcode-code-prop': 'error', + 'valid-appcardcode-demo-sfc': 'error', + + // https://github.com/gmullerb/eslint-plugin-regex + 'regex/invalid': [ + 'error', + [ + { + regex: '@/assets/images', + replacement: '@images', + message: 'Use \'@images\' path alias for image imports', + }, + { + regex: '@/assets/styles', + replacement: '@styles', + message: 'Use \'@styles\' path alias for importing styles from \'src/assets/styles\'', + }, + + { + id: 'Disallow icon of icon library', + regex: 'mdi-\\w', + message: 'Only \'tabler\' icons are allowed', + }, + + { + regex: '@core/\\w', + message: 'You can\'t use @core when you are in @layouts module', + files: { + inspect: '@layouts/.*', + }, + }, + { + regex: 'useLayouts\\(', + message: '`useLayouts` composable is only allowed in @layouts & @core directory. Please use `useThemeConfig` composable instead.', + files: { + inspect: '^(?!.*(@core|@layouts)).*', + }, + }, + ], + + // Ignore files + '\.eslintrc\.cjs', + ], + }, + settings: { + 'import/resolver': { + node: true, + typescript: {}, + }, + }, +} diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..11d02e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# 👉 Custom Git ignores + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +!.vscode/settings.json +!.vscode/*.code-snippets +!.vscode/tours +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +.yarn + +# iconify dist files +src/plugins/iconify/icons.css + +# Ignore MSW script +public/mockServiceWorker.js + +# Env files +.env* +!.env.example diff --git a/.npmrc b/.npmrc new file mode 100755 index 0000000..4b10cef --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +auto-install-peers=true +shamefully-hoist=true diff --git a/.nvmrc b/.nvmrc new file mode 100755 index 0000000..b009dfb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/* diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100755 index 0000000..b028674 --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,45 @@ +{ + "extends": [ + "stylelint-config-standard-scss", + "stylelint-config-idiomatic-order" + ], + "plugins": [ + "stylelint-use-logical-spec", + "stylelint-codeguide" + ], + "overrides": [ + { + "files": [ + "**/*.scss" + ], + "customSyntax": "postcss-scss" + }, + { + "files": [ + "**/*.vue" + ], + "customSyntax": "postcss-html" + } + ], + "rules": { + "codeguide/max-line-length": [ + 120, + { + "ignore": "comments" + } + ], + "codeguide/indentation": 2, + "liberty/use-logical-spec": true, + "selector-class-pattern": null, + "color-function-notation": null, + "annotation-no-unknown": [ + true, + { + "ignoreAnnotations": [ + "default" + ] + } + ], + "media-feature-range-notation": null + } +} diff --git a/.vscode/anchor-comments.code-snippets b/.vscode/anchor-comments.code-snippets new file mode 100755 index 0000000..7342c88 --- /dev/null +++ b/.vscode/anchor-comments.code-snippets @@ -0,0 +1,23 @@ +{ + "Add hand emoji": { + "prefix": "cm-hand-emoji", + "body": [ + "👉" + ], + "description": "Add hand emoji" + }, + "Add info emoji": { + "prefix": "cm-info-emoji", + "body": [ + "ℹ️" + ], + "description": "Add info emoji" + }, + "Add warning emoji": { + "prefix": "cm-warning-emoji", + "body": [ + "❗" + ], + "description": "Add warning emoji" + } +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100755 index 0000000..27843f1 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,15 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "editorconfig.editorconfig", + "xabikos.javascriptsnippets", + "stylelint.vscode-stylelint", + "fabiospampinato.vscode-highlight", + "github.vscode-pull-request-github", + "vue.volar", + "antfu.iconify", + "cipchk.cssrem", + "matijao.vue-nuxt-snippets", + "dongido.sync-env" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100755 index 0000000..3326d67 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,113 @@ +{ + "editor.formatOnSave": true, + "files.insertFinalNewline": true, + "javascript.updateImportsOnFileMove.enabled": "always", + "[javascript]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[typescript]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "editor.autoClosingBrackets": "always" + }, + "[markdown]": { + "editor.defaultFormatter": "DavidAnson.vscode-markdownlint" + }, + // SCSS + "[scss]": { + "editor.defaultFormatter": "stylelint.vscode-stylelint" + }, + // JSON + "[json]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + // Vue + "[vue]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint", + }, + // Extension: Volar + "volar.preview.port": 3000, + "volar.completion.preferredTagNameCase": "pascal", + // Extension: ESLint + "eslint.options": { + "rulePaths": [ + "eslint-internal-rules" + ] + }, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true, + "source.fixAll.stylelint": true, + "source.organizeImports": true, + }, + "eslint.alwaysShowStatus": true, + "eslint.format.enable": true, + // Extension: Stylelint + "stylelint.packageManager": "pnpm", + "stylelint.validate": [ + "css", + "scss", + "vue" + ], + // Extension: Spell Checker + "cSpell.words": [ + "Composables", + "Customizer", + "flagpack", + "Iconify", + "psudo", + "stylelint", + "touchless", + "triggerer", + "vuetify" + ], + // Extension: Comment Anchors + "commentAnchors.tags.list": [ + { + "tag": "ℹ️", + "scope": "hidden", + // This color is taken from "Better Comments" Extension (?) + "highlightColor": "#3498DB", + "styleComment": true, + "isItalic": false, + }, + { + "tag": "👉", + "scope": "file", + // This color is taken from "Better Comments" Extension (*) + "highlightColor": "#98C379", + "styleComment": true, + "isItalic": false + }, + { + "tag": "❗", + "scope": "hidden", + // This color is taken from "Better Comments" Extension (*) + "highlightColor": "#FF2D00", + "styleComment": true, + "isItalic": false, + }, + ], + // Extension: fabiospampinato.vscode-highlight + "highlight.regexFlags": "gi", + "highlight.regexes": { + // We flaged this for enforcing logical CSS properties + "(100vh|translate|margin:|padding:|margin-left|margin-right|rotate|text-align|border-top|border-right|border-bottom|border-left|float|background-position|transform|width|height|top|left|bottom|right|float|clear|(p|m)(l|r)-|border-(start|end)-(start|end)-radius)": [ + { + // "rangeBehavior": 1, + "borderWidth": "1px", + "borderColor": "tomato", + "borderStyle": "solid" + } + ], + "(overflow-x:|overflow-y:)": [ + { + // "rangeBehavior": 1, + "borderWidth": "1px", + "borderColor": "green", + "borderStyle": "solid" + } + ] + } +} diff --git a/.vscode/vue-ts.code-snippets b/.vscode/vue-ts.code-snippets new file mode 100755 index 0000000..360713a --- /dev/null +++ b/.vscode/vue-ts.code-snippets @@ -0,0 +1,18 @@ +{ + "Vue TS - DefineProps": { + "prefix": "dprops", + "body": [ + "defineProps<${1:Props}>()" + ], + "description": "DefineProps in script setup" + }, + "Vue TS - Props interface": { + "prefix": "iprops", + "body": [ + "interface Props {", + " ${1}", + "}" + ], + "description": "Create props interface in script setup" + } +} diff --git a/.vscode/vue.code-snippets b/.vscode/vue.code-snippets new file mode 100755 index 0000000..814d167 --- /dev/null +++ b/.vscode/vue.code-snippets @@ -0,0 +1,63 @@ +{ + "script": { + "prefix": "vue-sfc-ts", + "body": [ + "", + "", + "", + "", + "", + "" + ], + "description": "Vue SFC Typescript" + }, + "template": { + "scope": "vue", + "prefix": "template", + "body": [ + "" + ], + "description": "Create