Skip to content

Commit

Permalink
TS Migration: enable tests and remove flow infra (graphql#3091)
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj authored and twof committed May 28, 2021
1 parent 8cfe3e3 commit e46a9ea
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .babelrc-deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"plugins": [
<<<<<<< HEAD
"@babel/plugin-syntax-typescript",
=======
"@babel/plugin-transform-typescript",
>>>>>>> TS Migration: enable tests and remove flow infra (#3091)
["./resources/add-extension-to-import-paths", { "extension": "ts" }],
"./resources/inline-invariant"
]
Expand Down
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
"changelog": "node resources/gen-changelog.js",
"benchmark": "node benchmark/benchmark.js",
"test": "npm run lint && npm run check && npm run testonly && npm run prettier:check && npm run check:spelling && npm run check:integrations",
<<<<<<< HEAD
"lint": "eslint --cache --max-warnings 0 .",
=======
"lint": "eslint --cache .",
>>>>>>> TS Migration: enable tests and remove flow infra (#3091)
"check": "tsc --pretty",
"testonly": "mocha --full-trace src/**/__tests__/**/*-test.ts",
"testonly:cover": "nyc npm run testonly",
Expand All @@ -46,7 +50,10 @@
"devDependencies": {
"@babel/core": "7.14.0",
"@babel/eslint-parser": "7.13.14",
<<<<<<< HEAD
"@babel/plugin-syntax-typescript": "7.12.13",
=======
>>>>>>> TS Migration: enable tests and remove flow infra (#3091)
"@babel/plugin-transform-typescript": "7.13.0",
"@babel/preset-env": "7.14.1",
"@babel/register": "7.13.16",
Expand Down
4 changes: 4 additions & 0 deletions resources/build-deno.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ if (require.main === module) {
const destPath = path.join('./denoDist', filepath);

fs.mkdirSync(path.dirname(destPath), { recursive: true });
<<<<<<< HEAD
if (filepath.endsWith('.ts')) {
=======
if (filepath.endsWith('.ts') && !filepath.endsWith('.d.ts')) {
>>>>>>> TS Migration: enable tests and remove flow infra (#3091)
const options = { babelrc: false, configFile: './.babelrc-deno.json' };
const output = babel.transformFileSync(srcPath, options).code + '\n';
writeGeneratedFile(destPath, output);
Expand Down
9 changes: 9 additions & 0 deletions resources/build-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@ if (require.main === module) {
const destPath = path.join('./npmDist', filepath);

fs.mkdirSync(path.dirname(destPath), { recursive: true });
<<<<<<< HEAD
if (filepath.endsWith('.ts')) {
=======
if (filepath.endsWith('.ts') && !filepath.endsWith('.d.ts')) {
>>>>>>> TS Migration: enable tests and remove flow infra (#3091)
const cjs = babelBuild(srcPath, { envName: 'cjs' });
writeGeneratedFile(destPath.replace(/\.ts$/, '.js'), cjs);

const mjs = babelBuild(srcPath, { envName: 'mjs' });
writeGeneratedFile(destPath.replace(/\.ts$/, '.mjs'), mjs);
<<<<<<< HEAD
=======
} else if (filepath.endsWith('.d.ts')) {
fs.copyFileSync(srcPath, destPath);
>>>>>>> TS Migration: enable tests and remove flow infra (#3091)
}
}

Expand Down
7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
"module": "commonjs",
"lib": ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"],
"target": "es2019",
<<<<<<< HEAD
"strict": true,
=======
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
>>>>>>> TS Migration: enable tests and remove flow infra (#3091)
"noEmit": true,
"forceConsistentCasingInFileNames": true
}
Expand Down

0 comments on commit e46a9ea

Please sign in to comment.