diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..24e364c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.webp filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index b73156b..357457f 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -55,8 +55,15 @@ jobs: - name: Checkout Head uses: actions/checkout@v4 with: + lfs: true ref: ${{ github.event.pull_request.head.sha }} + - name: Set-up Build-time env file + run: | + echo "${PR_ENV}" > .env + env: + PR_ENV: ${{ vars[format('PR_{0}', github.event.pull_request.number)] }} + - name: Authenticate to Google Cloud uses: google-github-actions/auth@v2 with: @@ -73,7 +80,15 @@ jobs: - name: Build Image run: | - docker build -t ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ github.event.pull_request.number }} -f ci/Dockerfile . + set -a + source .env + set +a + + docker build \ + --build-arg NODE_ENV="$NODE_ENV" \ + --build-arg VITE_API_BASE_URL="$VITE_API_BASE_URL" \ + -t ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ github.event.pull_request.number }} \ + -f ci/Dockerfile . - name: Push Image run: | diff --git a/.prettierignore b/.prettierignore index 1b8ac88..311239d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,7 @@ -# Ignore artifacts: +dist build coverage +node_modules +.turbo +.out +pnpm-lock.yaml diff --git a/.prettierrc.json b/.prettierrc.json index a2646f2..d04b735 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -3,26 +3,25 @@ "semi": true, "trailingComma": "es5", "singleQuote": true, + "jsxSingleQuote": false, + "bracketSpacing": true, + "bracketSameLine": false, + "arrowParens": "always", + "useTabs": true, + "tabWidth": 2, "plugins": ["@ianvs/prettier-plugin-sort-imports"], - "importOrderParserPlugins": [ - "typescript", - "decorators" - ], + "importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"], "importOrder": [ + "^solid-js$", + "^solid-js/web$", + "^solid-devtools$", "", "", "", + "^@/(.*)$", + "", "", - "^@bootstrap/(.*)$", - "^@config/(.*)$", - "^@controllers/(.*)$", - "^@database/(.*)$", - "^@core/(.*)$", - "^@exceptions/(.*)$", - "^@lib/(.*)$", - "^@routes/(.*)$", - "^@validations/(.*)$", "", - "^[.]" + "^.*\\.css$" ] } diff --git a/apps/challenge-mf/eslint.config.mjs b/apps/challenge-mf/eslint.config.mjs deleted file mode 100644 index 8e74380..0000000 --- a/apps/challenge-mf/eslint.config.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { config } from '@repo/eslint-config/react'; - -/** @type {import("eslint").Linter.Config} */ -export default config; diff --git a/apps/challenge-mf/lib/entry-client.tsx b/apps/challenge-mf/lib/entry-client.tsx deleted file mode 100644 index 8c6ce63..0000000 --- a/apps/challenge-mf/lib/entry-client.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { createRoot } from 'react-dom/client'; -import App from '../src/App'; - -export function mountApp(container: HTMLElement, props?: any) { - const root = createRoot(container); - root.render(); -} diff --git a/apps/challenge-mf/lib/entry-server.tsx b/apps/challenge-mf/lib/entry-server.tsx deleted file mode 100644 index 09111f6..0000000 --- a/apps/challenge-mf/lib/entry-server.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import { renderToString } from 'react-dom/server'; -import App from '../src/App'; - -export function render() { - return renderToString(); -} diff --git a/apps/challenge-mf/package.json b/apps/challenge-mf/package.json deleted file mode 100755 index 1cd3121..0000000 --- a/apps/challenge-mf/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@dojoh-dev/challenge-mf", - "scripts": { - "dev": "vite dev --port 4000", - "build": "tsc && vite build", - "preview": "vite preview --port 4000", - "check-types": "tsc --noEmit", - "lint": "eslint src/ --fix --ext .ts,.tsx" - }, - "sideEffects": [ - "**/*.css" - ], - "dependencies": { - "@repo/shared": "workspace:*", - "lucide-react": "^0.575.0", - "react": "19.x", - "react-dom": "19.x", - "vite": "^7.0.0" - }, - "devDependencies": { - "@repo/eslint-config": "workspace:*", - "@repo/typescript-config": "workspace:*", - "@types/node": "24.x", - "@types/react": "19.x", - "@types/react-dom": "19.x", - "@vitejs/plugin-react": "^5.1.4", - "eslint": "^10.0.2", - "typescript": "~5.9.3", - "web": "link:apps/web" - } -} diff --git a/apps/challenge-mf/src/App.tsx b/apps/challenge-mf/src/App.tsx deleted file mode 100644 index 1b5cace..0000000 --- a/apps/challenge-mf/src/App.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import Summary from './components/templates/summary'; -import TestRunner from './components/templates/test-runner'; -import CodeEditor from './components/templates/code-editor'; -import Grid from './components/ui/grid'; - -import '@repo/shared/styles/default.css'; -import '@repo/shared/styles/reset.css'; - -export default function App() { - return ( - - - - - - ); -} diff --git a/apps/challenge-mf/src/components/templates/code-editor/index.module.css b/apps/challenge-mf/src/components/templates/code-editor/index.module.css deleted file mode 100644 index cce3250..0000000 --- a/apps/challenge-mf/src/components/templates/code-editor/index.module.css +++ /dev/null @@ -1,75 +0,0 @@ -.editorHero { - width: 100%; - height: 100%; - - grid-area: code; - background-color: var(--card-color); - border-radius: var(--radii); - border: 1px solid var(--border-color); -} - -.editorBody { - display: flex; - flex-direction: row; - width: 100%; - height: calc(100% - 50px); - overflow-y: auto; - - ul { - list-style: none; - padding: 10px; - margin: 0; - - li { - text-align: right; - font-family: var(--font-sans); - font-size: var(--font-md); - color: var(--secondary-color); - line-height: 1.5; - } - } - - textarea { - width: 100%; - height: 100%; - padding: 10px; - font-family: var(--font-mono); - font-size: var(--font-md); - color: var(--foreground-color); - resize: none; - border: none; - background: transparent; - outline: none; - line-height: 1.5; - } -} - -.editorHeader { - height: 50px; - display: flex; - align-items: center; - justify-content: space-between; - column-gap: 8px; - border-bottom: 1px solid var(--border-color); - padding-inline: 10px; - - ul { - display: flex; - align-items: center; - justify-content: center; - column-gap: 6px; - list-style: none; - - li { - display: grid; - place-items: center; - } - } - - h3 { - font-weight: 500; - font-family: var(--font-sans); - font-size: var(--font-sm); - color: var(--foreground-color); - } -} diff --git a/apps/challenge-mf/src/components/templates/code-editor/index.tsx b/apps/challenge-mf/src/components/templates/code-editor/index.tsx deleted file mode 100644 index 01ffde1..0000000 --- a/apps/challenge-mf/src/components/templates/code-editor/index.tsx +++ /dev/null @@ -1,63 +0,0 @@ -'use client'; - -import { useState } from 'react'; -import { Bolt, Braces } from 'lucide-react'; - -import styles from './index.module.css'; - -const DEFAULT_CODE = `/** - * Returns the number that appears only once. - * All other numbers appear exactly twice. - */ -export function findUnique(nums: number[]): number { - // TODO: Implement your solution here -}`; - -export default function CodeEditor() { - const [code, setCode] = useState(DEFAULT_CODE); - - const lines = code.split('\n').length; - - const handleChange = (e: React.ChangeEvent) => { - setCode(e.target.value); - }; - - return ( -
-
-
    -
  • - -
  • -
  • -

    TypeScript

    -
  • -
- -
    -
  • - -
  • -
-
- -
-
    - {Array.from({ length: lines }, (_, i) => ( -
  • {i + 1}
  • - ))} -
-