From 28854190a051b4c969f8521dcdef57f5fa5c5fd0 Mon Sep 17 00:00:00 2001 From: sct Date: Sun, 23 Aug 2020 06:23:19 +0000 Subject: [PATCH 1/3] ci: adds linting/build workflow to commits --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ package.json | 1 + 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..27f1bea53 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: Overseerr CI + +on: + pull_request: + branches: + - "*" + push: + branches: + - develop + +jobs: + test: + runs-on: ubuntu-18.04 + container: node:12.18-alpine + steps: + - name: checkout + uses: actions/checkout@v2 + - name: install dependencies + env: + HUSKY_SKIP_INSTALL: 1 + run: yarn + - name: lint + run: npm run lint + - name: build + run: yarn build diff --git a/package.json b/package.json index a72fb95a3..b63e8f12d 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build:server": "tsc --project server/tsconfig.json", "build:next": "next build", "build": "yarn build:next && yarn build:server", + "lint": "eslint \"./server/**/*.{ts,tsx}\" \"./src/**/*.{ts,tsx}\"", "start": "NODE_ENV=production node dist/server/index.js" }, "dependencies": { From de8ee9ba85e0160b0b472cab44f92c01796efec8 Mon Sep 17 00:00:00 2001 From: sct Date: Sun, 23 Aug 2020 06:34:38 +0000 Subject: [PATCH 2/3] fix: fixes next.js build to not include server files Also fixes the next.js build to properly purge unused css classes from tailwind --- package.json | 2 +- server/tsconfig.json | 3 ++- tailwind.config.js | 2 +- tsconfig.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b63e8f12d..17aef5445 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build:next": "next build", "build": "yarn build:next && yarn build:server", "lint": "eslint \"./server/**/*.{ts,tsx}\" \"./src/**/*.{ts,tsx}\"", - "start": "NODE_ENV=production node dist/server/index.js" + "start": "NODE_ENV=production node dist/index.js" }, "dependencies": { "@tailwindcss/ui": "^0.5.0", diff --git a/server/tsconfig.json b/server/tsconfig.json index e27ab81e5..773022433 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -7,5 +7,6 @@ "strictPropertyInitialization": false, "experimentalDecorators": true, "emitDecoratorMetadata": true - } + }, + "include": ["**/*.ts", "**/*.tsx"] } diff --git a/tailwind.config.js b/tailwind.config.js index 5439340d5..4a75d60aa 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,7 +2,7 @@ const defaultTheme = require('tailwindcss/defaultTheme'); module.exports = { - purge: ['./pages/**/*.{ts,tsx}', './components/**/*.{ts,tsx}'], + purge: ['./src/pages/**/*.{ts,tsx}', './src/components/**/*.{ts,tsx}'], theme: { extend: { fontFamily: { diff --git a/tsconfig.json b/tsconfig.json index 4fa631c26..f395aa1d5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,6 +14,6 @@ "isolatedModules": true, "jsx": "preserve" }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "src/**/*.ts", "src/**/*.tsx"], "exclude": ["node_modules"] } From f07669748f1581e2d0dfae69c343785d55ca2d35 Mon Sep 17 00:00:00 2001 From: sct Date: Sun, 23 Aug 2020 06:36:34 +0000 Subject: [PATCH 3/3] ci: change lint command to use yarn --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27f1bea53..88bef0216 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,6 @@ jobs: HUSKY_SKIP_INSTALL: 1 run: yarn - name: lint - run: npm run lint + run: yarn lint - name: build run: yarn build