diff --git a/.eslintrc.js b/.eslintrc.js index f95277a..897787e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -20,9 +20,12 @@ module.exports = { settings: { 'import/resolver': { node: { - extensions: ['.js', '.jsx', '.ts', '.tsx'], + extensions: ['.js', '.ts'], + moduleDirectory: ['node_modules', 'packages', 'server/src'], + }, + typescript: { + alwaysTryTypes: true, }, - typescript: {}, }, vue: { version: '3.0', // Explicitly specify Vue 3 @@ -49,7 +52,7 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-unused-vars': [ - 'error', + 'warn', { args: 'after-used', argsIgnorePattern: '^_', @@ -63,21 +66,43 @@ module.exports = { // Allow missing file extensions 'import/extensions': [ - 'warn', + 'off', 'ignorePackages', { - js: 'off', + js: 'never', jsx: 'never', ts: 'never', tsx: 'never', }, ], + 'no-unused-vars': 'warn', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': 'error', + 'no-restricted-imports': ['error', '../*'], + 'import/no-relative-packages': 'off', }, overrides: [ { - files: ['**/tests/**/*.js', '**/tests/**/*.ts', '**/*.test.ts'], // Adjust the pattern to match your test files + files: ['**/tests/**/*.js', '**/tests/**/*.ts', '**/*.test.ts'], rules: { - 'import/extensions': 'off', // Turn off the rule for test files + 'import/extensions': 'off', + 'import/no-extraneous-dependencies': 'off', + }, + }, + { + files: ['server/**/*.ts'], + rules: { + 'import/no-extraneous-dependencies': 'off', + }, + }, + { + files: ['**/packages/**/*.ts'], + rules: { + 'no-restricted-imports': 'off', 'import/no-extraneous-dependencies': 'off', }, }, diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index bf12175..9bf278c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,6 +1,7 @@ name: E2E Tests -on: [push, pull_request] +on: + workflow_dispatch: jobs: e2e: diff --git a/.gitignore b/.gitignore index eeb5072..b831f99 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ config +.quest # Logs logs diff --git a/.vscode/settings.json b/.vscode/settings.json index a5aabc7..fd4883f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "editor.tabSize": 2, "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true + "editor.formatOnSave": true, + "yaml.schemas": { + "packages/game/quest.json": "quests/**/game.yml" + } } diff --git a/README.md b/README.md index e2f8ac1..ef124a4 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,17 @@ Run Cypress in container, create brand-new containers along with it: ## Deployment +Create production env + + cp .env.prod.sample .env.prod + +Edit `.env.prod` + + BASE_URL=https://yourdomain.com # IMPORTANT to make login work + SECRET_KEY=xxxx # Change it to something safe! + +Start the service + # Build the images (only allowed for maintainers) docker compose -f docker-compose.prod.yml build docker compose -f docker-compose.prod.yml push diff --git a/app/Dockerfile b/app/Dockerfile index aa511c6..c3be3df 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,26 +1,15 @@ # Base stage -FROM node:20-alpine as base +FROM node:20-alpine as build WORKDIR /app -COPY package.json yarn.lock tsconfig.json ./ -COPY packages/file-graph/package.json ./packages/file-graph/package.json -COPY packages/utils/package.json ./packages/utils/package.json -COPY packages/constants/package.json ./packages/constants/package.json -COPY packages/models/package.json ./packages/models/package.json +COPY package.json yarn.lock ./ COPY app/package.json ./app/package.json +COPY server/package.json ./server/package.json RUN yarn install --frozen-lockfile -# Dev stage -FROM base as dev -WORKDIR /app/app -CMD [ "yarn", "dev:docker", "--host", "0.0.0.0" ] - -# Build stage -FROM base as build -COPY packages/file-graph ./packages/file-graph -COPY packages/utils ./packages/utils -COPY packages/constants ./packages/constants -COPY packages/models ./packages/models +COPY tsconfig.json ./tsconfig.json +COPY server ./server +COPY packages ./packages COPY app ./app RUN yarn workspace app build diff --git a/app/package.json b/app/package.json index e689a4d..db74fed 100644 --- a/app/package.json +++ b/app/package.json @@ -5,8 +5,8 @@ "scripts": { "dev": "vite", "dev:docker": "API_TARGET=http://backend:3000 vite", - "build": "vue-tsc -b && vite build", - "type-check": "vue-tsc -b", + "build": "vue-tsc && vite build", + "type-check": "vue-tsc", "preview": "vite preview" }, "dependencies": { @@ -16,10 +16,7 @@ "@fortawesome/free-regular-svg-icons": "^6.4.0", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/vue-fontawesome": "^3.0.3", - "@linux-odyssey/constants": "*", - "@linux-odyssey/file-graph": "*", - "@linux-odyssey/models": "*", - "@linux-odyssey/utils": "*", + "@trpc/client": "^11.1.0", "@types/dompurify": "^3.0.5", "axios": "^1.6.0", "dompurify": "^3.0.6", @@ -37,13 +34,14 @@ }, "devDependencies": { "@types/validator": "^13.11.9", - "@vitejs/plugin-vue": "^4.5.2", "@vue/compiler-sfc": "^3.3.13", "autoprefixer": "^10.4.14", "postcss": "^8.4.31", "tailwindcss": "^3.3.3", - "typescript": "^5.3.3", - "vite": "^4.5.3", - "vue-tsc": "^2.0.10" + "@vitejs/plugin-vue": "^5.2.2", + "@vue/tsconfig": "^0.7.0", + "typescript": "~5.7.2", + "vite": "^6.3.1", + "vue-tsc": "^2.2.8" } } diff --git a/app/src/components/FileNode.vue b/app/src/components/FileNode.vue index 45f556f..a4508e5 100644 --- a/app/src/components/FileNode.vue +++ b/app/src/components/FileNode.vue @@ -22,7 +22,7 @@ function nodeClass() {