commit fa507aa8508b6739c804a88586fa8a7440c4c126 Author: tristan Date: Thu Feb 19 10:48:42 2026 +0100 feat: first commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..007463b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_size = 2 +indent_style = space +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..52cd076 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + push: + branches: + - main + - master + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Configure Git Auth + env: + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + run: | + git config user.name "malio-ci" + git config user.email "ci@gitea.malio.fr" + git remote set-url origin "https://oauth2:${RELEASE_TOKEN}@gitea.malio.fr/MALIO-DEV/malio-layer-ui.git" + + - name: Install Dependencies + run: npm ci + + - name: Lint + run: | + npm run dev:prepare + npm run lint + + - name: Release + env: + GIT_AUTHOR_NAME: malio-ci + GIT_AUTHOR_EMAIL: ci@gitea.malio.fr + GIT_COMMITTER_NAME: malio-ci + GIT_COMMITTER_EMAIL: ci@gitea.malio.fr + GIT_CREDENTIALS: ${{ secrets.RELEASE_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + npx --yes \ + -p semantic-release@24 \ + -p @semantic-release/commit-analyzer@13 \ + -p @semantic-release/release-notes-generator@14 \ + -p @semantic-release/npm@12 \ + semantic-release diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..259809b --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +node_modules +*.log +.nuxt +nuxt.d.ts +.output +.data +.env +package-lock.json +framework +dist +.DS_Store + +# Yarn +.yarn/cache +.yarn/*state* + +# Local History +.history + +# VSCode +.vscode/ + +# JetBrains/WebStorm +.idea/ diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b4f32a9 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +@malio:registry=https://gitea.malio.fr/api/packages/MALIO-DEV/npm/ +//gitea.malio.fr/api/packages/MALIO-DEV/npm/:_authToken=${NPM_TOKEN} diff --git a/.nuxtrc b/.nuxtrc new file mode 100644 index 0000000..9eb49a5 --- /dev/null +++ b/.nuxtrc @@ -0,0 +1 @@ +typescript.includeWorkspace = true diff --git a/.playground/app.config.ts b/.playground/app.config.ts new file mode 100644 index 0000000..2e818ca --- /dev/null +++ b/.playground/app.config.ts @@ -0,0 +1,5 @@ +export default defineAppConfig({ + myLayer: { + name: 'My amazing Nuxt layer (overwritten)' + } +}) diff --git a/.playground/nuxt.config.ts b/.playground/nuxt.config.ts new file mode 100644 index 0000000..969a646 --- /dev/null +++ b/.playground/nuxt.config.ts @@ -0,0 +1,12 @@ +import { fileURLToPath } from 'node:url' + +export default defineNuxtConfig({ + extends: ['..'], + modules: ['@nuxt/eslint'], + eslint: { + config: { + // Use the generated ESLint config for lint root project as well + rootDir: fileURLToPath(new URL('..', import.meta.url)) + } + } +}) diff --git a/.playground/pages/index.vue b/.playground/pages/index.vue new file mode 100644 index 0000000..257a509 --- /dev/null +++ b/.playground/pages/index.vue @@ -0,0 +1,11 @@ + + + + diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..1675943 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,9 @@ +{ + "branches": ["main", "master"], + "repositoryUrl": "https://gitea.malio.fr/MALIO-DEV/malio-layer-ui.git", + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/npm" + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..cc1d779 --- /dev/null +++ b/README.md @@ -0,0 +1,132 @@ +# Malio UI Layer (Nuxt) + +Layer Nuxt partageable pour centraliser des composants UI et les réutiliser dans plusieurs projets. + +Le layer est à la racine du repo. +Le dossier `.playground/` sert à tester localement les composants du layer. + +## Commandes utiles + +### Installation + +```bash +npm install +``` + +### Développement local (playground) + +Préparer les fichiers Nuxt générés du playground (utile pour TypeScript + ESLint) : + +```bash +npm run dev:prepare +``` + +Lancer le playground : + +```bash +npm run dev +``` + +### Qualité + +Lancer le linter : + +```bash +npm run lint +``` + +### Build / preview + +Build de production du playground : + +```bash +npm run build +``` + +Génération statique du playground : + +```bash +npm run generate +``` + +Prévisualiser le build : + +```bash +npm run preview +``` + +### Livraison / publication du layer + +Vérifier le contenu qui sera publié : + +```bash +npm pack --dry-run +``` + +Publier sur le registry NPM configuré : + +```bash +npm publish +``` + +Publier explicitement sur un registry Gitea : + +```bash +npm publish --registry https:///api/packages//npm/ +``` + +## Tester un composant dans le playground + +Le playground étend déjà le layer via `.playground/nuxt.config.ts`. + +Exemple rapide : + +1. Créer un composant dans le layer +Fichier `app/components/malio/Badge.vue` + +```vue + + + +``` + +2. L’utiliser dans le playground +Fichier `.playground/pages/index.vue` + +```vue + +``` + +3. Lancer le playground + +```bash +npm run dev +``` + +## Utiliser ce layer dans un autre projet Nuxt + +Installer le package : + +```bash +npm install @malio/layer-ui +``` + +Étendre le layer dans `nuxt.config.ts` du projet consommateur : + +```ts +export default defineNuxtConfig({ + extends: ['@malio/layer-ui'], +}) +``` diff --git a/app.config.ts b/app.config.ts new file mode 100644 index 0000000..e3276b7 --- /dev/null +++ b/app.config.ts @@ -0,0 +1,14 @@ +export default defineAppConfig({ + myLayer: { + name: 'Hello from Nuxt layer' + } +}) + +declare module '@nuxt/schema' { + interface AppConfigInput { + myLayer?: { + /** Project name */ + name?: string + } + } +} diff --git a/app/app.vue b/app/app.vue new file mode 100644 index 0000000..f8eacfa --- /dev/null +++ b/app/app.vue @@ -0,0 +1,5 @@ + diff --git a/app/assets/css/tailwind.css b/app/assets/css/tailwind.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/app/assets/css/tailwind.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/app/components/malio/Input.vue b/app/components/malio/Input.vue new file mode 100644 index 0000000..17119af --- /dev/null +++ b/app/components/malio/Input.vue @@ -0,0 +1,38 @@ + + + diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..be2024e --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,3 @@ +import withNuxt from './.playground/.nuxt/eslint.config.mjs' + +export default withNuxt() diff --git a/nuxt.config.ts b/nuxt.config.ts new file mode 100644 index 0000000..daa8552 --- /dev/null +++ b/nuxt.config.ts @@ -0,0 +1,9 @@ +import { fileURLToPath } from 'node:url' +import { dirname, join } from 'node:path' + +const currentDir = dirname(fileURLToPath(import.meta.url)) + +export default defineNuxtConfig({ + modules: ['@nuxtjs/tailwindcss'], + css: [join(currentDir, './app/assets/css/tailwind.css')], +}) diff --git a/package.json b/package.json new file mode 100644 index 0000000..6167cc3 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "@malio/layer-ui", + "type": "module", + "version": "0.0.1", + "main": "./nuxt.config.ts", + "files": ["app/**", "nuxt.config.ts", "README.md"], + "scripts": { + "dev": "nuxi dev .playground", + "dev:prepare": "nuxt prepare .playground", + "build": "nuxt build .playground", + "generate": "nuxt generate .playground", + "preview": "nuxt preview .playground", + "lint": "eslint ." + }, + "peerDependencies": { + "nuxt": "^4.0.0" + }, + "devDependencies": { + "@nuxt/eslint": "latest", + "@types/node": "^24.10.13", + "eslint": "^10.0.0", + "nuxt": "^4.3.1", + "typescript": "^5.9.3", + "vue": "latest" + }, + "dependencies": { + "@nuxtjs/tailwindcss": "^6.14.0" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..1d746c1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./.playground/.nuxt/tsconfig.json" +}