Skip to content

Commit

Permalink
Merge pull request #3208 from threefoldtech/development_support_node_…
Browse files Browse the repository at this point in the history
…gql_client

Add support for node in graphql client build
  • Loading branch information
MohamedElmdary authored Aug 4, 2024
2 parents c112478 + ccbb881 commit 275da6f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
16 changes: 13 additions & 3 deletions packages/graphql_client/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
{
"name": "@threefold/graphql_client",
"version": "2.5.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "./dist/node/index.js",
"module": "./dist/es6/index.js",
"exports": {
"require": "./dist/node/index.js",
"import": "./dist/es6/index.js"
},
"types": "dist/es6/index.d.ts",
"files": [
"/dist"
],
"license": "MIT",
"scripts": {
"build": "tsc"
"build": "npm run es6-build && npm run node-build",
"node-build": "tsc --build tsconfig-node.json",
"es6-build": "tsc --build tsconfig.json"
},
"dependencies": {
"@threefold/types": "2.5.0",
Expand Down
22 changes: 22 additions & 0 deletions packages/graphql_client/tsconfig-node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "CommonJS",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"types": ["node", "jest"],
"declaration": true,
"declarationMap": true,
"outDir": "./dist/node",
"esModuleInterop": true,
"resolveJsonModule": true,
"allowJs": true,
"baseUrl": "./src",
"skipLibCheck": true,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": false
},
"include": ["src"],
"exclude": ["node_modules", "tests"]
}
6 changes: 4 additions & 2 deletions packages/graphql_client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
"target": "ES2017",
"module": "ES2015",
"moduleResolution": "node",
"types": ["node"],
"baseUrl": "./src",
"outDir": "./dist",
"outDir": "./dist/es6",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"noImplicitAny": false
"noImplicitAny": false,
"resolveJsonModule": true
},
"include": ["src"],
"exclude": ["node_modules", "tests"]
Expand Down

0 comments on commit 275da6f

Please sign in to comment.