Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

80 changes: 36 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,47 @@
name: 🚀 Criar Release
name: 🧪 CI

on:
push:
tags:
- 'v*' # Dispara quando um novo tag versão é criado (ex: v1.0.0)
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
release:
unit:
name: 🧩 Unit + Lint + Typecheck
runs-on: ubuntu-latest
permissions:
contents: write # Necessário para criar releases com GITHUB_TOKEN

steps:
- name: 🛎️ Checkout do código
uses: actions/checkout@v6
- uses: actions/checkout@v6

- name: ⚙️ Configurar Node.js
uses: actions/setup-node@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
node-version: 24
cache: 'npm'

- name: 📦 Instalar dependências
run: npm ci

- name: 📦 Construir pacote
run: npm run build

- name: 📄 Verificar se CHANGELOG.md existe
run: |
if [ ! -f CHANGELOG.md ]; then
echo "Arquivo CHANGELOG.md não encontrado!"
exit 1
fi

- name: 📄 Adicionar Changelog na Release
id: changelog
run: |
VERSION="${{ github.ref_name }}"
awk "/^## \[/{if (p) exit; p=1} p" CHANGELOG.md > temp_changelog.md
echo "BODY<<EOF" >> $GITHUB_ENV
cat temp_changelog.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: 🚀 Criar Release no GitHub
uses: softprops/action-gh-release@v2
version: 10

- uses: actions/setup-node@v6
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: ${{ env.BODY }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} # Ou remova essa linha se estiver usando GITHUB_TOKEN padrão
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: 🔧 Preparar ambiente Nuxt
run: npx nuxi prepare

- name: 🔧 Preparar ambiente do Playground
run: cd playground && npx nuxi prepare

- name: 🚀 Iniciar Nuxt no Playground
run: cd playground && pnpm dev & # Roda em segundo plano

- name: ⏳ Aguardar o servidor estar pronto
run: sleep 10 # Ajuste o tempo conforme necessário

- name: Run Unit Tests
run: pnpm test
113 changes: 113 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: 🚀 Release

on:
push:
tags:
- 'v*.*.*' # Trigger only on version tags like v1.0.0

jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write # necessário para --provenance

steps:
# 📥 Checkout repository
- name: 📥 Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

# 📦 Enable pnpm
- uses: pnpm/action-setup@v4
with:
version: 10

# 🟢 Setup Node.js
- name: 🟢 Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 20
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org/' # Importante!

# 📦 Install dependencies
- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile

# 🏗 Build package
- name: 🏗 Build package
run: pnpm build

# 🔎 Verify tag version matches package.json
- name: 🔎 Validate version
run: |
# Extrai apenas o nome da tag (remove refs/tags/)
TAG_FULL="${GITHUB_REF_NAME#refs/tags/}" # v1.3.0
TAG_VERSION="${TAG_FULL#v}" # 1.3.0
PACKAGE_VERSION=$(node -p "require('./package.json').version")

echo "Tag version: $TAG_VERSION"
echo "Package version: $PACKAGE_VERSION"

if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "❌ Tag version does not match package.json version"
exit 1
fi

# ✅ Verify CHANGELOG exists
- name: ✅ Verify CHANGELOG.md
run: |
if [ ! -f CHANGELOG.md ]; then
echo "❌ CHANGELOG.md not found!"
exit 1
fi

# 📄 Extract current version changelog
- name: 📄 Extract current version changelog
id: changelog
run: |
VERSION="${GITHUB_REF_NAME#refs/tags/}"
VERSION_NUMBER="${VERSION#v}"

awk -v ver="$VERSION_NUMBER" '
/^## / {
heading = $0
sub(/^##[ ]*/, "", heading) # Remove ##
sub(/^\[/, "", heading) # Remove [
sub(/\]$/, "", heading) # Remove ]
sub(/^v/, "", heading) # Remove v
flag = (heading == ver)
next
}
flag
' CHANGELOG.md > temp_changelog.md

if [ ! -s temp_changelog.md ]; then
echo "❌ No changelog section found for version ${VERSION} in CHANGELOG.md"
exit 1
fi

echo "BODY<<EOF" >> $GITHUB_ENV
cat temp_changelog.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

# 🚀 Publish to npm
- name: 🚀 Publish to npm
run: pnpm publish --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# 🚀 Create GitHub Release
- name: 🚀 Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: 🚀 Release ${{ github.ref_name }}
body: ${{ env.BODY }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 changes: 0 additions & 45 deletions .github/workflows/test.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
.nuxt
.output
.nitro
coverage
playground
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"trailingComma": "es5",
"arrowParens": "always"
}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file.

[v0.4.4] - 2025-04-11

## v0.4.9

[compare changes](https://github.com/4sllan/six-dropzone/compare/v1.0.5...v0.4.9)

### 🚀 Enhancements

- **test:** Adiciona configuração inicial do Vitest ([99bb350](https://github.com/4sllan/six-dropzone/commit/99bb350))
- **prettier:** Adiciona configuração e ignorados do Prettier ([46f03da](https://github.com/4sllan/six-dropzone/commit/46f03da))
- **core:** Configura ESLint com formato flat e regras Nuxt ([3926491](https://github.com/4sllan/six-dropzone/commit/3926491))
- **ci/release:** Implementar fluxo de CI/CD para release ([d5e96fd](https://github.com/4sllan/six-dropzone/commit/d5e96fd))
- **test:** Adiciona testes abrangentes para dropzone e utils ([547b0fa](https://github.com/4sllan/six-dropzone/commit/547b0fa))
- **core:** Migra o projeto para PNPM e atualiza dependências ([56f3d0b](https://github.com/4sllan/six-dropzone/commit/56f3d0b))

### 🩹 Fixes

- **assets:** Move imagem checkerboard.jpg ([590f080](https://github.com/4sllan/six-dropzone/commit/590f080))

### 💅 Refactors

- **core:** Move componentes e paginas para app/ ([f5cf26d](https://github.com/4sllan/six-dropzone/commit/f5cf26d))

### ❤️ Contributors

- Aslan.gama <aslan.gama@sixchains.com.br>

### Added
- 🎉 Standalone Component Support
- six-dropzone can now be used outside of Nuxt 3, directly in Vue 3 projects.
Expand Down
49 changes: 49 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'

export default createConfigForNuxt({
features: { tooling: true, typescript: true },
})
.override('nuxt/javascript', {
rules: {
curly: ['error', 'all'],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'prefer-const': ['error'],
},
})
// --- BLOCO PARA VUE ---
.override('nuxt/vue/rules', {
rules: {
'vue/html-self-closing': ['error', {
html: {
void: 'always', // Exige /> em tags como <input>, <br>, <img>
normal: 'always', // Exige /> em tags vazias como <div v-if="..." />
component: 'always' // Exige /> em componentes <MeuComponente />
},
svg: 'always',
math: 'always'
}],
'vue/multi-word-component-names': 'off', // desativa erro de nome de componente
'vue/attributes-order': 'off', // ignora aviso de ordem de atributos
}
})
// ------------------------------------
.override('nuxt/typescript/rules', {
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-imports': 'off', // ignora erro de imports só como type
},
})
.append({
files: [
'src/runtime/**/*.ts',
'src/module.ts',
],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/prefer-number-properties': 'off',
'curly': 'off',
},
})
Loading
Loading