diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5901d23 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,30 @@ +# EditorConfig: https://EditorConfig.org + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[*.py] +indent_style = space +indent_size = 4 +max_line_length = 88 + +[*.{js,jsx,ts,tsx}] +indent_style = space +indent_size = 2 +max_line_length = 80 + +[*.{yml,yaml,json,css,styl}] +indent_style = space +indent_size = 2 + +[*.sass] +indent_style = space +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false diff --git a/.github/workflows/ci-dev.yml b/.github/workflows/ci-dev.yml new file mode 100644 index 0000000..14cfba1 --- /dev/null +++ b/.github/workflows/ci-dev.yml @@ -0,0 +1,109 @@ +name: Deploy static content to website-develop + +on: + push: + branches: + - develop + pull_request: + branches: + - develop + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages-dev' + cancel-in-progress: true + +jobs: + format: + name: JS Code Format + runs-on: ubuntu-latest + timeout-minutes: 3 + steps: + - name: Checkout branch + uses: actions/checkout@v2 + with: + path: pycon-website + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '25.2' + - name: Install node dependencies + run: | + cd pycon-website/ + npm ci + - name: Show node environment + run: | + node --version + npm --version + - name: Run JS lint + run: | + cd pycon-website/ + npm run format:check + + build: + name: Build + runs-on: ubuntu-latest + needs: format + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup nodeJS + uses: actions/setup-node@v4 + with: + node-version: '25.2' + - name: Install dependencies + run: npm ci + - name: Build project + run: npm run build + - name: Upload dist folder as artifact + uses: actions/upload-artifact@v4 + with: + name: dist-artifact + path: dist/ + + deploy: + if: github.event_name == 'push' + name: Deploy to Develop + runs-on: ubuntu-latest + needs: build + steps: + - name: Generate access token + if: always() + id: generate_access_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.PYCON_CO_APP_ID }} + private-key: ${{ secrets.PYCON_CO_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + - name: Checkout target repository + uses: actions/checkout@v4 + with: + repository: PyConColombia/website-develop + token: ${{ steps.generate_access_token.outputs.token }} + path: website-develop + - name: Download dist artifact + uses: actions/download-artifact@v4 + with: + name: dist-artifact + path: dist + - name: Prepare deployment + run: | + find website-develop/ -mindepth 1 ! -name 'CNAME' ! -path "website-develop/.git*" -delete + mv dist/* website-develop/ + - name: Commit and push changes + run: | + cd website-develop + git config user.name "github-actions" + git config user.email "github-actions@github.com" + if [[ -n "$(git status --porcelain)" ]]; then + git add . + git commit -m "Deploy: $(date +'%Y-%m-%d %H:%M:%S') to branch ${{ github.ref_name }}" + git push origin gh-pages + else + echo "No changes to commit. Skipping deployment." + fi diff --git a/README.md b/README.md index 963909f..b4266a2 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,53 @@ -# React + Vite +# website-2026 -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +React + Vite project with HMR, ESLint, and Biome for formatting. -Currently, two official plugins are available: +## Prerequisites -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh +- **Node.js** 18+ (recommended: current LTS) +- **npm** 9+ (or use the Node-bundled version) -## React Compiler +## Setup & run -The React Compiler is currently not compatible with SWC. See [this issue](https://github.com/vitejs/vite-plugin-react/issues/428) for tracking the progress. +### 1. Install dependencies -## Expanding the ESLint configuration +```bash +npm install +``` -If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project. +### 2. Run the development server + +```bash +npm run dev +``` + +Then open the URL shown in the terminal (usually `http://localhost:5173`). + +### 3. Build for production + +```bash +npm run build +``` + +Output is in the `dist/` folder. + +### 4. Preview production build locally + +```bash +npm run preview +``` + +## Other scripts + +| Script | Description | +|-----------------|--------------------------------| +| `npm run format` | Format and fix with Biome | +| `npm run format:check`| Check formatting (no write) | + +## Tech stack + +- [React](https://react.dev/) 19 +- [Vite](https://vite.dev/) 7 +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc) for Fast Refresh +- [Biome](https://biomejs.dev/) for linting and formatting +- ESLint for additional lint rules diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..76e5a5a --- /dev/null +++ b/biome.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.3.13/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "files": { + "ignoreUnknown": false + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2 + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + } +} diff --git a/eslint.config.js b/eslint.config.js index 4fa125d..0c01cbb 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,13 +1,13 @@ -import js from '@eslint/js' -import globals from 'globals' -import reactHooks from 'eslint-plugin-react-hooks' -import reactRefresh from 'eslint-plugin-react-refresh' -import { defineConfig, globalIgnores } from 'eslint/config' +import js from "@eslint/js"; +import { defineConfig, globalIgnores } from "eslint/config"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import globals from "globals"; export default defineConfig([ - globalIgnores(['dist']), + globalIgnores(["dist"]), { - files: ['**/*.{js,jsx}'], + files: ["**/*.{js,jsx}"], extends: [ js.configs.recommended, reactHooks.configs.flat.recommended, @@ -17,13 +17,13 @@ export default defineConfig([ ecmaVersion: 2020, globals: globals.browser, parserOptions: { - ecmaVersion: 'latest', + ecmaVersion: "latest", ecmaFeatures: { jsx: true }, - sourceType: 'module', + sourceType: "module", }, }, rules: { - 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], + "no-unused-vars": ["error", { varsIgnorePattern: "^[A-Z_]" }], }, }, -]) +]); diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..11aef97 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./src/*"], + "@/node_modules/*": ["./node_modules/*"] + } + } +} diff --git a/package-lock.json b/package-lock.json index a604e43..7d7e018 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "react-dom": "^19.2.0" }, "devDependencies": { + "@biomejs/biome": "2.3.13", "@eslint/js": "^9.39.1", "@types/react": "^19.2.5", "@types/react-dom": "^19.2.3", @@ -264,6 +265,169 @@ "node": ">=6.9.0" } }, + "node_modules/@biomejs/biome": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.3.13.tgz", + "integrity": "sha512-Fw7UsV0UAtWIBIm0M7g5CRerpu1eKyKAXIazzxhbXYUyMkwNrkX/KLkGI7b+uVDQ5cLUMfOC9vR60q9IDYDstA==", + "dev": true, + "license": "MIT OR Apache-2.0", + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.21.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "2.3.13", + "@biomejs/cli-darwin-x64": "2.3.13", + "@biomejs/cli-linux-arm64": "2.3.13", + "@biomejs/cli-linux-arm64-musl": "2.3.13", + "@biomejs/cli-linux-x64": "2.3.13", + "@biomejs/cli-linux-x64-musl": "2.3.13", + "@biomejs/cli-win32-arm64": "2.3.13", + "@biomejs/cli-win32-x64": "2.3.13" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.3.13.tgz", + "integrity": "sha512-0OCwP0/BoKzyJHnFdaTk/i7hIP9JHH9oJJq6hrSCPmJPo8JWcJhprK4gQlhFzrwdTBAW4Bjt/RmCf3ZZe59gwQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.3.13.tgz", + "integrity": "sha512-AGr8OoemT/ejynbIu56qeil2+F2WLkIjn2d8jGK1JkchxnMUhYOfnqc9sVzcRxpG9Ycvw4weQ5sprRvtb7Yhcw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.3.13.tgz", + "integrity": "sha512-xvOiFkrDNu607MPMBUQ6huHmBG1PZLOrqhtK6pXJW3GjfVqJg0Z/qpTdhXfcqWdSZHcT+Nct2fOgewZvytESkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.3.13.tgz", + "integrity": "sha512-TUdDCSY+Eo/EHjhJz7P2GnWwfqet+lFxBZzGHldrvULr59AgahamLs/N85SC4+bdF86EhqDuuw9rYLvLFWWlXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.3.13.tgz", + "integrity": "sha512-s+YsZlgiXNq8XkgHs6xdvKDFOj/bwTEevqEY6rC2I3cBHbxXYU1LOZstH3Ffw9hE5tE1sqT7U23C00MzkXztMw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.3.13.tgz", + "integrity": "sha512-0bdwFVSbbM//Sds6OjtnmQGp4eUjOTt6kHvR/1P0ieR9GcTUAlPNvPC3DiavTqq302W34Ae2T6u5VVNGuQtGlQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.3.13.tgz", + "integrity": "sha512-QweDxY89fq0VvrxME+wS/BXKmqMrOTZlN9SqQ79kQSIc3FrEwvW/PvUegQF6XIVaekncDykB5dzPqjbwSKs9DA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.3.13.tgz", + "integrity": "sha512-trDw2ogdM2lyav9WFQsdsfdVy1dvZALymRpgmWsvSez0BJzBjulhOT/t+wyKeh3pZWvwP3VMs1SoOKwO3wecMQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", diff --git a/package.json b/package.json index 95b79fa..1fc1041 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "dev": "vite", "build": "vite build", - "lint": "eslint .", + "format": "biome check --write", + "format:check": "biome check", "preview": "vite preview" }, "dependencies": { @@ -14,6 +15,7 @@ "react-dom": "^19.2.0" }, "devDependencies": { + "@biomejs/biome": "2.3.13", "@eslint/js": "^9.39.1", "@types/react": "^19.2.5", "@types/react-dom": "^19.2.3", diff --git a/src/App.jsx b/src/App.jsx index f67355a..5a9934b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,26 +1,20 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import './App.css' +import viteLogo from "/vite.svg"; +import reactLogo from "./assets/react.svg"; +import "./App.css"; function App() { - const [count, setCount] = useState(0) - return ( <>
- + Vite logo - + React logo

Vite + React

-

Edit src/App.jsx and save to test HMR

@@ -29,7 +23,7 @@ function App() { Click on the Vite and React logos to learn more

- ) + ); } -export default App +export default App; diff --git a/src/main.jsx b/src/main.jsx index b9a1a6d..fdce256 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,10 +1,10 @@ -import { StrictMode } from 'react' -import { createRoot } from 'react-dom/client' -import './index.css' -import App from './App.jsx' +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; +import "./index.css"; +import App from "./App.jsx"; -createRoot(document.getElementById('root')).render( +createRoot(document.getElementById("root")).render( , -) +); diff --git a/vite.config.js b/vite.config.js index 2328e17..756f1dd 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,7 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react-swc' +import react from "@vitejs/plugin-react-swc"; +import { defineConfig } from "vite"; // https://vite.dev/config/ export default defineConfig({ plugins: [react()], -}) +});