[PR #5] [MERGED] refactor: Port to TypeScript #145

Closed
opened 2026-03-15 11:37:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/atulmy/gql-query-builder/pull/5
Author: @bebraw
Created: 3/13/2019
Status: Merged
Merged: 3/13/2019
Merged by: @atulmy

Base: masterHead: feat-ts


📝 Commits (1)

  • 8906cbf refactor: Port to TypeScript

📊 Changes

11 files changed (+4014 additions, -3225 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 README.md (+73 -55)
index.js (+0 -85)
index.test.js (+0 -137)
jest.config.js (+28 -0)
📝 package-lock.json (+3601 -2945)
📝 package.json (+35 -3)
src/index.test.ts (+141 -0)
src/index.ts (+108 -0)
tsconfig.json (+16 -0)
tslint.json (+9 -0)

📄 Description

I also integrated lint-staged (runs only on changed files).

Note that I had to change the way variables work. Now only object format is supported in this case. I went this way as it's easier to type and doing this simplified the codebase a notch. I can try to match the old behavior, though.

Another gotcha is that when you import from Node env (i.e. CommonJS), you have to do something like this:

const query = require('gql-query-builder').default;

I'm not entirely sure how to fix that in a neat manner. I guess we could just expose an object (regular export) as that's same for different environments and avoids this interoperability problem.

Please give this a go.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/atulmy/gql-query-builder/pull/5 **Author:** [@bebraw](https://github.com/bebraw) **Created:** 3/13/2019 **Status:** ✅ Merged **Merged:** 3/13/2019 **Merged by:** [@atulmy](https://github.com/atulmy) **Base:** `master` ← **Head:** `feat-ts` --- ### 📝 Commits (1) - [`8906cbf`](https://github.com/atulmy/gql-query-builder/commit/8906cbfc1f10d3be4fd0501731e3d5310cb5eb38) refactor: Port to TypeScript ### 📊 Changes **11 files changed** (+4014 additions, -3225 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `README.md` (+73 -55) ➖ `index.js` (+0 -85) ➖ `index.test.js` (+0 -137) ➕ `jest.config.js` (+28 -0) 📝 `package-lock.json` (+3601 -2945) 📝 `package.json` (+35 -3) ➕ `src/index.test.ts` (+141 -0) ➕ `src/index.ts` (+108 -0) ➕ `tsconfig.json` (+16 -0) ➕ `tslint.json` (+9 -0) </details> ### 📄 Description I also integrated lint-staged (runs only on changed files). Note that I had to change the way variables work. Now only object format is supported in this case. I went this way as it's easier to type and doing this simplified the codebase a notch. I can try to match the old behavior, though. Another gotcha is that when you import from Node env (i.e. CommonJS), you have to do something like this: ```javascript const query = require('gql-query-builder').default; ``` I'm not entirely sure how to fix that in a neat manner. I guess we could just expose an object (regular `export`) as that's same for different environments and avoids this interoperability problem. Please give this a go. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:37:58 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gql-query-builder#145
No description provided.