Skip to content

Commit

Permalink
Merge pull request #1 from redwoodjs/pp-burnsy-main-please-merge
Browse files Browse the repository at this point in the history
Merge main + small tweaks
  • Loading branch information
burnsy authored Aug 7, 2020
2 parents 7b12f99 + 78239d5 commit 5466fe0
Show file tree
Hide file tree
Showing 60 changed files with 1,294 additions and 1,245 deletions.
94 changes: 87 additions & 7 deletions .github/workflows/build-eslint-jest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,49 @@ on:
types: [opened, edited, synchronize, reopened]

jobs:
build:

## LINUX
dependency_cache_linux:
strategy:
matrix:
os: ['ubuntu-latest']
node-version: ['14']
fail-fast: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache "node_modules"
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files

lint_build_test_linux:
needs: dependency_cache_linux
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: ['ubuntu-latest']
node-version: ['12', '14']
fail-fast: false
fail-fast: true
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} | Node ${{ matrix.node-version }} latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Print node and yarn versions
run: |
node --version
yarn --version
- name: Cache "node_modules"
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Run ESLint
Expand All @@ -37,3 +62,58 @@ jobs:
run: yarn test
env:
CI: true


## WINDOWS
dependency_cache_windows:
strategy:
matrix:
os: ['windows-latest']
node-version: ['14']
fail-fast: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache "node_modules"
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
lint_build_test_windows:
needs: dependency_cache_windows
strategy:
matrix:
os: ['windows-latest']
node-version: ['12', '14']
fail-fast: true
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} | Node ${{ matrix.node-version }} latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache "node_modules"
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Run ESLint
run: yarn lint
env:
CI: true
- name: Build
run: yarn build
- name: Run tests
run: yarn test
env:
CI: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.DS_Store
node_modules
dist
packages/api/importAll.macro.js
.buildcache
lerna-debug.log
yarn-error.log
**/*.tsbuildinfo
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
**/dist
packages/api/importAll.macro.js

# Do not format Markdown files to allow easier documentation contribution
*.md
8 changes: 4 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ module.exports = {
],
},
],
// Do not build tests or mocks in production.
// Ignore test directories when we're not testing
ignore:
process.env.NODE_ENV === 'production'
? [/\.test\.(js|ts)/, '**/__tests__', '**/__mocks__']
: [],
process.env.NODE_ENV === 'test'
? []
: [/\.test\.(js|ts)/, '**/__tests__', '**/__mocks__'],
}
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-remove-code": "^0.0.6",
"bundlesize": "^0.18.0",
"cp-cli": "^2.0.0",
"cross-env": "^7.0.2",
"jest": "^26.1.0",
"lerna": "^3.20.2",
"msw": "0.20.0",
"nodemon": "^2.0.2",
"rimraf": "^3.0.2",
"typescript": "^3.9.6",
"whatwg-fetch": "3.0.0"
},
Expand All @@ -39,13 +41,10 @@
"extends": "@redwoodjs/eslint-config"
},
"scripts": {
"build": "yarn build:clean && yarn build:js",
"build:clean": "lerna run build:clean",
"build:js": "cross-env NODE_ENV=production lerna run build",
"build:types": "tsc --build --clean && tsc --build",
"build": "lerna run build",
"build:watch": "lerna run build:watch --parallel",
"test": "lerna run test --stream -- --colors --maxWorkers=4",
"lint": "yarn eslint packages",
"lint:fix": "yarn eslint --fix packages"
"lint": "eslint packages",
"lint:fix": "eslint --fix packages"
}
}
36 changes: 13 additions & 23 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,45 @@
"name": "@redwoodjs/api",
"version": "0.15.3",
"files": [
"dist",
"importAll.macro.js"
"dist"
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
"dependencies": {
"@prisma/client": "~2.3.0",
"@prisma/client": "2.4.0",
"@redwoodjs/internal": "^0.15.3",
"apollo-server-lambda": "2.16.0",
"babel-plugin-macros": "^2.8.0",
"core-js": "3.6.4",
"glob": "^7.1.6",
"graphql": "^14.6.0",
"graphql-iso-date": "^3.6.1",
"graphql-scalars": "^1.2.6",
"graphql-tools": "4.0.7",
"graphql-type-json": "^0.3.1",
"jsonwebtoken": "^8.5.1",
"jwks-rsa": "^1.8.0",
"jwks-rsa": "^1.8.1",
"lodash.merge": "^4.6.2",
"lodash.omitby": "^4.6.0",
"merge-graphql-schemas": "^1.7.6"
},
"devDependencies": {
"@redwoodjs/auth": "^0.15.3",
"@types/graphql-iso-date": "^3.4.0",
"@types/graphql-type-json": "^0.3.2",
"@redwoodjs/dev-server": "^0.15.3",
"@types/jsonwebtoken": "^8.3.9",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.omitby": "^4.6.6",
"babel-plugin-tester": "^9.0.0",
"del-cli": "^3.0.0",
"gotrue-js": "^0.9.25",
"move-cli": "^1.2.1"
"@types/lodash.omitby": "^4.6.6"
},
"jest": {
"testPathIgnorePatterns": [
"/fixtures/",
"/dist/"
]
},
"scripts": {
"build": "yarn build:clean && yarn build:js",
"build:js": "yarn cross-env NODE_ENV=production babel src -d dist --extensions \".js,.ts\" --source-maps inline && yarn move-cli ./dist/importAll.macro.js ./importAll.macro.js",
"build:types": "tsc --build --clean && tsc --build",
"build:clean": "yarn del-cli dist importAll.macro.js",
"prepublishOnly": "yarn build",
"build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --ignore importAll.macro.js --exec \"yarn build:js\"",
"test": "yarn jest",
"build": "yarn build:js && yarn build:types",
"prepublishOnly": "yarn cross-env NODE_ENV=production yarn build",
"build:js": "babel src -d dist --extensions \".js,.ts,.tsx\" --delete-dir-on-start",
"build:types": "tsc --build --verbose && yarn postbuild:types",
"postbuild:types": "yarn cp-cli .buildcache/ dist/",
"build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"",
"test": "jest",
"test:watch": "yarn test --watch"
},
"gitHead": "1cb7c8d1085147787209af423c33a9c91c3e6517"
Expand Down

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
24 changes: 0 additions & 24 deletions packages/api/src/__tests__/importAll.macro.test.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createContextHandler } from '../functions/graphql'
import { context } from '../globalContext'

import { createContextHandler } from './graphql'

describe('graphql createContextHandler', () => {
it('merges the context correctly', async () => {
const handler = createContextHandler({ a: 1 })
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/functions/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const createGraphQLHandler = (
if (isDevEnv) {
// I want the dev-server to pick this up!?
// TODO: Move the error handling into a separate package
// @ts-ignore
import('@redwoodjs/dev-server/dist/error')
.then(({ handleError }) => {
return handleError(error.originalError as Error)
Expand Down
Loading

0 comments on commit 5466fe0

Please sign in to comment.