Skip to content

Commit

Permalink
resolved error issue
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinesamuel committed Nov 10, 2024
1 parent 131e057 commit a903726
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

A javascript sdk for working with hasnode graphql api

This package is stil a work in progress, so i intend to add more features and make it more robust and write a comprehensive documentation. However, you can still use it to interact with the hashnode graphql api. and if you have any feature request or issue, feel free to open an issue or a pull request.
This package is stil a work in progress, so i intend to add more features and make it more robust and write a comprehensive documentation. However, you can still use it to interact with the hashnode graphql api. and if you have any feature request or issue, feel free to open an issue or a pull request.

How to use the code

```javascript
const client = new HashnodeSDKClient({
apiKey: '2a26946b-d2da-48fa-9dba-a4acb8e97e93',
apiKey: '2a26946b-d2da-48fa-9dba-a4acb8e97e93',
});

const run = async () => {
const isDomainAvailable = await client.domainAvailabilityManager.checkSubdomainAvailability("test");
const isDomainAvailable =
await client.domainAvailabilityManager.checkSubdomainAvailability('test');
console.log(user);
};

run();
```
```
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
],
"type": "commonjs",
"license": "MIT",
"main": "dist/index.cjs",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"devDependencies": {
"@arethetypeswrong/cli": "^0.16.4",
"@changesets/cli": "^2.27.9",
Expand All @@ -40,19 +42,23 @@
"check-format": "prettier --check .",
"check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
"lint": "tsc",
"ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
"ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test || true",
"test": "vitest run",
"dev": "node .testRequest.js",
"local-release": "changeset version && changeset publish",
"prepublishOnly": "npm run ci"
},
"exports": {
"./package.json": "./package.json",
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js"
},
"./dist/*": "./dist/*"
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"dependencies": {
"@graphql-codegen/cli": "^5.0.3",
Expand Down
9 changes: 9 additions & 0 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

import { describe, it, expect } from 'vitest';
import * as HashnodeSDK from '../index';

describe('Hashnode SDK', () => {
it('should export the SDK', () => {
expect(HashnodeSDK).toBeDefined();
});
});

0 comments on commit a903726

Please sign in to comment.