diff --git a/.drone.yml b/.drone.yml index 41de1c4..939dfdb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,7 +25,7 @@ steps: path: /cache - name: Frontend install - image: node:18.2.0 + image: node:24.13.1 commands: - node -v - yarn --version @@ -42,8 +42,14 @@ steps: - name: cache path: /cache + - name: Lint project using eslint + image: node:24.13.1 + commands: + - yarn lint + failure: ignore + - name: Frontend build - image: node:18.2.0 + image: node:24.13.1 commands: - yarn build environment: @@ -56,12 +62,6 @@ steps: SEASONED_DOMAIN: from_secret: SEASONED_DOMAIN - - name: Lint project using eslint - image: node:18.2.0 - commands: - - yarn lint - failure: ignore - - name: Build and publish docker image image: plugins/docker settings: @@ -105,3 +105,8 @@ trigger: include: - push # - pull_request +--- +kind: signature +hmac: 6f10b2871d2bd6b5cd26ddf72796325991ba211ba1eb62b657baf993e9d549c8 + +... diff --git a/.env.example b/.env.example index 78b073f..da0dc81 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,3 @@ -SEASONED_API= -ELASTIC= -ELASTIC_INDEX=shows,movies -SEASONED_DOMAIN= \ No newline at end of file +SEASONED_API=http://localhost:31459 +ELASTIC_URL=http://elastic.local:9200/tmdb-movies-shows +ELASTIC_API_KEY= diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index cbeec6e..0000000 --- a/.eslintrc +++ /dev/null @@ -1,31 +0,0 @@ -{ - "root": true, - "parser": "vue-eslint-parser", - "parserOptions": { - "parser": "@typescript-eslint/parser", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "@vue/eslint-config-airbnb", - "plugin:vue/recommended", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", - ], - "rules": { - "vue/no-v-model-argument": "off", - "no-underscore-dangle": "off", - "vue/multi-word-component-names": "off", - "no-shadow": "off", - "@typescript-eslint/no-shadow": ["error"], - }, - "settings": { - "import/resolver": { - webpack: { - config: "./webpack.config.js" - } - } - } -} diff --git a/.gitignore b/.gitignore index 93bd3be..e75c9fe 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ src/config.json # Build directory dist/ +lib/ # Node packages node_modules/ diff --git a/Dockerfile b/Dockerfile index fa3e0f3..3187dbd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,39 @@ -FROM nginx:latest +FROM node:24.13.1 AS build -COPY public /usr/share/nginx/html +# Set the working directory for the build stage +WORKDIR /app + +# Install dependencies +COPY package.json yarn.lock . +RUN yarn install --frozen-lockfile + +# Copy source files that the build depends on +COPY index.html . +COPY public/ public/ +COPY src/ src/ +COPY tsconfig.json vite.config.ts . + +ARG SEASONED_API=http://localhost:31459 +ENV VITE_SEASONED_API=$SEASONED_API + +ARG ELASTIC_URL=http://elastic.local:9200/tmdb-movies-shows +ENV VITE_ELASTIC_URL=$ELASTIC_URL +ARG ELASTIC_API_KEY= +ENV VITE_ELASTIC_API_KEY=$ELASTIC_API_KEY + +RUN yarn build + +FROM nginx:1.29.5 + +# Copy the static build from the previous stage +COPY index.html /usr/share/nginx/html +COPY public/ /usr/share/nginx/html +COPY --from=build /app/dist /usr/share/nginx/html + +# Copy nginx config file COPY nginx.conf /etc/nginx/conf.d/default.conf.template + +# Manual entrypoint after nginx substring COPY docker-entrypoint.sh /docker-entrypoint.d/05-docker-entrypoint.sh RUN chmod +x /docker-entrypoint.d/05-docker-entrypoint.sh diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..6a8cafc --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,67 @@ +import path from "node:path"; + +import { includeIgnoreFile } from "@eslint/compat"; +import js from "@eslint/js"; +import { defineConfig } from "eslint/config"; +import { configs, plugins } from "eslint-config-airbnb-extended"; +import { rules as prettierConfigRules } from "eslint-config-prettier"; +import prettierPlugin from "eslint-plugin-prettier"; + +const CUSTOM_RULES = { + "vue/no-v-model-argument": "off", + "no-underscore-dangle": "off", + "vue/multi-word-component-names": "off", + "no-shadow": "off", + "@typescript-eslint/no-shadow": ["error"] +}; + +const gitignorePath = path.resolve(".", ".gitignore"); + +// ESLint recommended config +const jsConfig = defineConfig([ + { + name: "js/config", + ...js.configs.recommended + }, + plugins.stylistic, + plugins.importX, + ...configs.base.recommended // Airbnb base recommended config +]); + +// Node & Airbnb recommended config +const nodeConfig = defineConfig([plugins.node, ...configs.node.recommended]); + +// Typescript & Airbnb base TS config +const typescriptConfig = defineConfig([ + plugins.typescriptEslint, + ...configs.base.typescript +]); + +// Prettier config +const prettierConfig = defineConfig([ + { + name: "prettier/plugin/config", + plugins: { + prettier: prettierPlugin + } + }, + { + name: "prettier/config", + rules: { + ...prettierConfigRules, + "prettier/prettier": "error" + } + } +]); + +export default defineConfig([ + // Ignore files and folders listed in .gitignore + includeIgnoreFile(gitignorePath), + ...jsConfig, + ...nodeConfig, + ...typescriptConfig, + ...prettierConfig, + { + rules: CUSTOM_RULES + } +]); diff --git a/src/index.html b/index.html similarity index 91% rename from src/index.html rename to index.html index 021490c..555c1b7 100644 --- a/src/index.html +++ b/index.html @@ -24,7 +24,9 @@ -
+
+ + diff --git a/src/components/ui/SeasonedButton.vue b/src/components/ui/SeasonedButton.vue index e51df58..2f82c50 100644 --- a/src/components/ui/SeasonedButton.vue +++ b/src/components/ui/SeasonedButton.vue @@ -23,8 +23,8 @@