Skip to content

Commit b4fc16c

Browse files
imolorheacao
authored andcommitted
Migrated codemirror-graphql to typescript (#1790)
* Migrated codemirror-graphql to typescript * Migrated codemirror-graphql tests to typescript * Cleaned up codemirror-graphql package.json set build output to root (to align with current behavior) * ignore generated __tests__ folder from eslint * Updated codemirror typing * Updated codemirror typing * Updated ci-e2e script * Exclude babel and jest config from npm files
1 parent 59296d5 commit b4fc16c

48 files changed

Lines changed: 1266 additions & 737 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/fresh-crabs-think.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'codemirror-graphql': major
3+
---
4+
5+
BREAKING CHANGE Migrate to Typescript - [@imolorhe](https://github.com/imolorhe)

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ packages/graphiql/*.html
5555
**/codemirror-graphql/lint.*
5656
**/codemirror-graphql/info.*
5757
**/codemirror-graphql/hint.*
58+
**/codemirror-graphql/__tests__
5859

5960

6061
# Vendored files

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"npm": "please_use_yarn_instead"
2626
},
2727
"scripts": {
28-
"build": "yarn run build-clean && yarn build-ts && yarn build-babel",
29-
"build-babel": "yarn workspace codemirror-graphql run build",
28+
"build": "yarn tsc --clean && yarn tsc",
29+
"postbuild": "yarn workspace codemirror-graphql run postbuild",
3030
"build-ts": "yarn run tsc --force",
3131
"build-ts-cjs": "yarn run tsc resources/tsconfig.build.cjs.json",
3232
"build-ts-esm": "yarn run tsc resources/tsconfig.build.esm.json",
@@ -42,7 +42,7 @@
4242
"jest": "jest",
4343
"test-all": "yarn test --coverage",
4444
"ci": "yarn lint && yarn run check && yarn build && yarn test-all",
45-
"ci-e2e": "yarn build-ts-esm && yarn workspace codemirror-graphql run build && yarn workspace graphiql run build-bundles-min && yarn run e2e",
45+
"ci-e2e": "yarn build && yarn build-ts-esm && yarn workspace graphiql run build-bundles-min && yarn run e2e",
4646
"ci-validate": "yarn build-ts-esm && yarn build-validate",
4747
"testonly": "jest && yarn workspace codemirror-graphql run test",
4848
"e2e": "yarn workspace graphiql e2e",

packages/codemirror-graphql/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ node_modules/
22
coverage/
33
/*.js
44
/*.js.flow
5+
/*.js.map
6+
/*.d.ts
7+
/*.d.ts.map
58
!babel.config.js
69
!jest.config.js
710
/utils
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
const base = require('../../jest.config.base')(__dirname);
2-
3-
module.exports = {
4-
...base,
5-
};
1+
module.exports = require('../../jest.config.base')(__dirname);

packages/codemirror-graphql/package.json

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,30 @@
1313
"url": "https://github.com/graphql/graphiql/issues?q=issue+label:codemirror-graphql"
1414
},
1515
"license": "MIT",
16+
"main": "index.js",
17+
"module": "esm/index.js",
1618
"files": [
17-
"hint.esm.js",
18-
"hint.js",
19-
"hint.js.flow",
20-
"info.esm.js",
21-
"info.js",
22-
"info.js.flow",
23-
"jump.esm.js",
24-
"jump.js",
25-
"jump.js.flow",
26-
"lint.esm.js",
27-
"lint.js",
28-
"lint.js.flow",
29-
"mode.esm.js",
30-
"mode.js",
31-
"mode.js.flow",
19+
"dist",
3220
"utils",
3321
"variables",
34-
"results"
22+
"results",
23+
"/*.js",
24+
"/*.js.flow",
25+
"/*.js.map",
26+
"/*.d.ts",
27+
"/*.d.ts.map",
28+
"!babel.config.js",
29+
"!jest.config.js"
3530
],
3631
"scripts": {
3732
"build": "yarn build-clean && yarn build-js && yarn build-esm && yarn build-flow .",
38-
"build-js": "babel src --root-mode upward --ignore **/__tests__/**,**/__mocks__/** --out-dir .",
39-
"build-esm": "cross-env ESM=true babel src --root-mode upward --ignore **/__tests__/**,**/__mocks__/** --out-dir esm && node ../../resources/renameFileExtensions.js './esm/{**,!**/__tests__/}/*.js' . .esm.js",
40-
"build-clean": "rimraf {mode,hint,info,jump,lint}.{js,esm.js,js.flow} && rimraf esm results utils variables coverage __tests__",
33+
"build-js": "yarn tsc",
34+
"build-esm": "cross-env ESM=true yarn tsc --project tsconfig.esm.json && node ../../resources/renameFileExtensions.js './esm/{**,!**/__tests__/}/*.js' . .esm.js",
35+
"build-clean": "rimraf {mode,hint,info,jump,lint}.{js,esm.js,js.flow,js.map,d.ts,d.ts.map} && rimraf esm results utils variables coverage __tests__",
4136
"build-flow": "node ../../resources/buildFlow.js",
4237
"watch": "babel --optional runtime resources/watch.js | node",
43-
"test": "jest"
38+
"test": "jest",
39+
"postbuild": "node ../../resources/renameFileExtensions.js './esm/{**,!**/__tests__/}/*.js' . .esm.js"
4440
},
4541
"peerDependencies": {
4642
"codemirror": "^5.54.0",

0 commit comments

Comments
 (0)