-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,189 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: {} | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Master | ||
uses: actions/checkout@v2 | ||
- name: Use Node | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: '16' | ||
- name: Cache Yarn | ||
uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-16-15-yarn-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-16-15-yarn | ||
- name: Install Dependencies using Yarn | ||
run: yarn install --ignore-engines && git checkout yarn.lock | ||
- name: Lint | ||
run: yarn lint | ||
build: | ||
name: Type Check on GraphQL v${{matrix.graphql_version}} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
graphql_version: | ||
# - 14 | ||
- 15 | ||
# - 16.0.0-rc.1 | ||
steps: | ||
- name: Checkout Master | ||
uses: actions/checkout@v2 | ||
- name: Use Node | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: '16' | ||
- name: Cache Yarn | ||
uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-16-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-16-${{matrix.graphql_version}}-yarn | ||
- name: Use GraphQL v${{matrix.graphql_version}} | ||
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}} | ||
- name: Install Dependencies using Yarn | ||
run: yarn install --ignore-engines && git checkout yarn.lock | ||
- name: Build | ||
run: yarn ts:check | ||
test: | ||
name: Unit Test on Node ${{matrix.node-version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}} | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] # remove windows to speed up the tests | ||
node-version: [12, '16'] | ||
graphql_version: | ||
# - 14 | ||
- 15 | ||
# - 16.0.0-rc.1 | ||
steps: | ||
- name: Checkout Master | ||
uses: actions/checkout@v2 | ||
- name: Use Node | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache Yarn | ||
uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn | ||
- name: Use GraphQL v${{matrix.graphql_version}} | ||
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}} | ||
- name: Install Dependencies using Yarn | ||
run: yarn install --ignore-engines && git checkout yarn.lock | ||
- name: Cache Jest | ||
uses: actions/cache@v2 | ||
with: | ||
path: .cache/jest | ||
key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-jest-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-jest- | ||
- name: Test | ||
run: yarn test --ci | ||
env: | ||
CI: true | ||
test_esm: | ||
name: ESM Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Master | ||
uses: actions/checkout@v2 | ||
- name: Use Node | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: '16' | ||
- name: Cache Yarn | ||
uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-16-15-yarn-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-16-15-yarn | ||
- name: Install Dependencies using Yarn | ||
run: yarn install --ignore-engines && git checkout yarn.lock | ||
- name: Build Packages | ||
run: yarn build | ||
- name: Test ESM | ||
run: node scripts/test-esm.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
presets: [['@babel/preset-env', { targets: { node: process.versions.node.split('.')[0] } }], '@babel/preset-typescript'], | ||
plugins: [['@babel/plugin-proposal-decorators', { legacy: true }], '@babel/plugin-proposal-class-properties'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
const { resolve } = require('path'); | ||
const { pathsToModuleNameMapper } = require('ts-jest/utils'); | ||
const { compilerOptions } = require('./tsconfig.json'); | ||
const CI = !!process.env.CI; | ||
|
||
const ROOT_DIR = __dirname; | ||
const TSCONFIG = resolve(ROOT_DIR, 'tsconfig.json'); | ||
const tsconfig = require(TSCONFIG); | ||
|
||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
modulePathIgnorePatterns: ["/dist/"], | ||
testPathIgnorePatterns: ["/node_modules/", "/dist/"], | ||
globals: { | ||
'ts-jest': { | ||
diagnostics: false | ||
} | ||
}, | ||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }) | ||
}; | ||
rootDir: ROOT_DIR, | ||
restoreMocks: true, | ||
reporters: ['default'], | ||
modulePathIgnorePatterns: ['dist', 'test-assets', 'test-files', 'fixtures'], | ||
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: `${ROOT_DIR}/` }), | ||
collectCoverage: false, | ||
cacheDirectory: resolve(ROOT_DIR, `${CI ? '' : 'node_modules/'}.cache/jest`), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const { writeFileSync } = require('fs'); | ||
const { resolve } = require('path'); | ||
const { argv, cwd } = require('process'); | ||
|
||
const pkgPath = resolve(cwd(), './package.json'); | ||
|
||
const pkg = require(pkgPath); | ||
|
||
const version = argv[2]; | ||
|
||
pkg.resolutions = pkg.resolutions || {}; | ||
if (pkg.resolutions.graphql.startsWith(version)) { | ||
console.info(`GraphQL v${version} already installed! Skipping.`); | ||
} | ||
|
||
const npmVersion = version.includes('-') ? version : `^${version}`; | ||
pkg.resolutions.graphql = npmVersion; | ||
pkg.devDependencies.graphql = npmVersion; | ||
|
||
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"sourceMap": false, | ||
"inlineSourceMap": false | ||
}, | ||
"exclude": ["**/test/*.ts", "*.spec.ts", "**/tests", "**/test-assets", "**/test-files", "packages/testing"] | ||
} |
Oops, something went wrong.
eb38f44
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: