Skip to content

Commit

Permalink
fix(pkg): include types files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jungley8 committed Apr 23, 2023
1 parent 50e7292 commit 7925193
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 24 deletions.
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Integrating OpenAI Billing API with TypeScript and Axios",
"main": "./lib/index.js",
"files": [
"lib/**/*"
"lib/**/*",
"types/*"
],
"scripts": {
"build": "tsc --project tsconfig.build.json",
Expand All @@ -31,15 +32,9 @@
"node": ">=12.0"
},
"keywords": [
"boilerplate",
"template",
"typescript",
"vscode",
"jest",
"husky",
"commitizen",
"semantic-release",
"codecov"
"openai",
"api",
"billing"
],
"bugs": {
"url": "https://github.com/jungley8/openai-api/issues"
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import axios, { AxiosError, AxiosInstance, CreateAxiosDefaults } from 'axios';
import { DayUsage } from './types/day-usage';
import { BillingSubscription } from './types/subscription';
import { CreditSummary } from './types/credit-summary';
import { DailyCostsList } from './types/usage';
import { Config, DataOrError } from './types/billing-api';
import { DayUsage } from '../types/day-usage';
import { BillingSubscription } from '../types/subscription';
import { CreditSummary } from '../types/credit-summary';
import { DailyCostsList } from '../types/usage';
import { Config, DataOrError } from '../types/billing-api';

const erorrHandler = (error: AxiosError) => {
if (error.response) {
Expand Down
18 changes: 9 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
"declaration": true /* Generates corresponding '.d.ts' file. */,
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./lib/", /* Redirect output structure to the directory. */
"outDir": "./lib/" /* Redirect output structure to the directory. */,
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
Expand All @@ -25,7 +25,7 @@
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
Expand All @@ -50,7 +50,7 @@
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */

Expand All @@ -65,8 +65,8 @@
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */

/* Advanced Options */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
"skipLibCheck": true /* Skip type checking of declaration files. */,
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": ["src/**/*.ts", "test/**/*.ts"]
"include": ["src/**/*.ts", "test/**/*.ts", "types/*.d.ts"]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7925193

Please sign in to comment.