From 03eb4565a6b641f8db685333e8e6cd7e1bce016a Mon Sep 17 00:00:00 2001 From: zaid450 Date: Fri, 25 Sep 2020 11:11:37 -0400 Subject: [PATCH] fix: ESM export and export all related structures --- .eslintignore | 1 + esm/index.mjs | 13 +++++++++++-- package.json | 2 +- src/index.ts | 7 ++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.eslintignore b/.eslintignore index b5f429a..7681d6f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,5 @@ tests/ node_modules/ dist/ +esm/ *.config.js \ No newline at end of file diff --git a/esm/index.mjs b/esm/index.mjs index e06da61..f07009f 100644 --- a/esm/index.mjs +++ b/esm/index.mjs @@ -1,3 +1,12 @@ -const {QuizizzClient} = require("../dist/index.js"); +const QuizizzJS = require("../dist/index.js"); -export { QuizizzClient }; +export const QuizizzJS; + +export const { + QuizizzClient, + Question, + User, + Quiz, + Structure, + RequestError +} = QuizizzJS diff --git a/package.json b/package.json index d4523c4..727323a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "require": "./dist/index.js" }, "scripts": { - "build": "tsc", + "build": "tsc --project tsconfig.json", "test": "npm run build && npm run test", "lint": "npx eslint src/ --fix", "docs": "typedoc --options typedoc.json" diff --git a/src/index.ts b/src/index.ts index 90374d9..23529c9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,8 @@ import QuizizzClient from "./QuizizzClient"; +import Question from "./structures/Question"; +import Quiz from "./structures/Quiz"; +import RequestError from "./structures/RequestError"; +import Structure from "./structures/Structure"; +import User from "./structures/User"; -export { QuizizzClient }; +export { QuizizzClient, Question, User, Quiz, Structure, RequestError };