diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..9e3d11990 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +**/node_modules +**/dist +**/.DS_Store +**/.env* +**/Dockerfile +**/.dockerignore +**/*.yaml +.secrets*.yaml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..0d2850682 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# 2 space indentation +[*.{ts,js}] +indent_style = space +indent_size = 2 + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..cb5c21b08 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,16 @@ +{ + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:prettier/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest" + }, + "plugins": ["@typescript-eslint"], + "rules": { + "semi": [2, "never"] + } +} diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml new file mode 100644 index 000000000..e6737cfa6 --- /dev/null +++ b/.github/workflows/run-tests.yaml @@ -0,0 +1,74 @@ +name: Run tests +on: + push: + branches: + - master + paths-ignore: + - 'apple/**' + pull_request: + branches: + - master + paths-ignore: + - 'apple/**' + +jobs: + run-graphql-inspector: + name: Run GraphQL Inspector Checks + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' + runs-on: self-hosted + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: kamilkisiela/graphql-inspector@master + with: + schema: 'master:packages/api/src/generated/schema.graphql' + + run-code-tests: + name: Run Codebase tests + runs-on: self-hosted + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Initialize the database + run: | + cp ./packages/api/.env.test ./packages/api/.env + psql --host localhost --port ${{ job.services.postgres.ports[5432] }} --user postgres --password -c "CREATE DATABASE omnivore_test;" + env: + PGPASSWORD: postgres + - name: Setup nodejs 14.18 + run: source ~/.nvm/nvm.sh && nvm install 14.18 && nvm use 14.18 && npm install -g yarn + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(source ~/.nvm/nvm.sh && yarn cache dir)" + - name: Install dependencies + run: | + source ~/.nvm/nvm.sh + yarn install --frozen-lockfile + - name: TypeScript, Lint, Tests + run: | + source ~/.nvm/nvm.sh + yarn build + yarn lint + yarn test + env: + PG_HOST: localhost + PG_PORT: ${{ job.services.postgres.ports[5432] }} + PG_USER: postgres + PG_PASSWORD: postgres + PG_DB: omnivore_test + PG_POOL_MAX: 10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..39f960640 --- /dev/null +++ b/.gitignore @@ -0,0 +1,61 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Dependency directories +node_modules/ +jspm_packages/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Banish npm lock +package-lock.json + +# Docker data +.docker + +# DSStore: +.DS_Store + +# next.js build output +.next + +# dotenv environment variables file +.env +.env.local +.env.production + + +# build & dist dirs +build +dist + +# Ignore local secret files +**/.secrets-*.yaml + +# Ignore local SA JSON files +**/*.sa.json + +# JetBrains Products +.idea/ + +# VScode local configurations +.vscode/ + +# Xcode +xcuserdata/ + +omnivore-app-sa-gcs* + +# Emacs temp files +*~ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..b2095be81 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/.vercelignore b/.vercelignore new file mode 100644 index 000000000..7b5de6e1d --- /dev/null +++ b/.vercelignore @@ -0,0 +1,14 @@ +/pkg +/.gcp +/.github +/apple +/docs +/e2e +/imageproxy +/packages/api +/packages/data-exploration +/packages/db +/packages/gcf-shared +/packages/readabilityjs +/packages/pdf-handler +/packages/puppeteer-parse \ No newline at end of file