Skip to content

Commit

Permalink
fix: update for ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Sep 24, 2024
1 parent 6a79db8 commit a3a9604
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 61 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"access": "public",
"provenance": true
},
"type": "module",
"description": "Shared TypeScript definitions for Octokit projects",
"dependencies": {
"@octokit/openapi-types": "^22.2.0"
Expand Down
6 changes: 3 additions & 3 deletions scripts/update-endpoints/templates/endpoints.ts.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// DO NOT EDIT THIS FILE
import type { paths } from "@octokit/openapi-types";
import type { OctokitResponse } from "../OctokitResponse";
import type { RequestHeaders } from "../RequestHeaders";
import type { RequestRequestOptions } from "../RequestRequestOptions";
import type { OctokitResponse } from "../OctokitResponse.js";
import type { RequestHeaders } from "../RequestHeaders.js";
import type { RequestRequestOptions } from "../RequestRequestOptions.js";

/**
* @license (MIT OR CC0-1.0)
Expand Down
10 changes: 5 additions & 5 deletions src/AuthInterface.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { EndpointOptions } from "./EndpointOptions";
import type { OctokitResponse } from "./OctokitResponse";
import type { RequestInterface } from "./RequestInterface";
import type { RequestParameters } from "./RequestParameters";
import type { Route } from "./Route";
import type { EndpointOptions } from "./EndpointOptions.js";
import type { OctokitResponse } from "./OctokitResponse.js";
import type { RequestInterface } from "./RequestInterface.js";
import type { RequestParameters } from "./RequestParameters.js";
import type { Route } from "./Route.js";

/**
* Interface to implement complex authentication strategies for Octokit.
Expand Down
8 changes: 4 additions & 4 deletions src/EndpointDefaults.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RequestHeaders } from "./RequestHeaders";
import type { RequestMethod } from "./RequestMethod";
import type { RequestParameters } from "./RequestParameters";
import type { Url } from "./Url";
import type { RequestHeaders } from "./RequestHeaders.js";
import type { RequestMethod } from "./RequestMethod.js";
import type { RequestParameters } from "./RequestParameters.js";
import type { Url } from "./Url.js";

/**
* The `.endpoint()` method is guaranteed to set all keys defined by RequestParameters
Expand Down
10 changes: 5 additions & 5 deletions src/EndpointInterface.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { EndpointDefaults } from "./EndpointDefaults";
import type { RequestOptions } from "./RequestOptions";
import type { RequestParameters } from "./RequestParameters";
import type { Route } from "./Route";
import type { EndpointDefaults } from "./EndpointDefaults.js";
import type { RequestOptions } from "./RequestOptions.js";
import type { RequestParameters } from "./RequestParameters.js";
import type { Route } from "./Route.js";

import type { Endpoints } from "./generated/Endpoints";
import type { Endpoints } from "./generated/Endpoints.js";

export interface EndpointInterface<D extends object = object> {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/EndpointOptions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestMethod } from "./RequestMethod";
import type { Url } from "./Url";
import type { RequestParameters } from "./RequestParameters";
import type { RequestMethod } from "./RequestMethod.js";
import type { Url } from "./Url.js";
import type { RequestParameters } from "./RequestParameters.js";

export type EndpointOptions = RequestParameters & {
method: RequestMethod;
Expand Down
4 changes: 2 additions & 2 deletions src/OctokitResponse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ResponseHeaders } from "./ResponseHeaders";
import type { Url } from "./Url";
import type { ResponseHeaders } from "./ResponseHeaders.js";
import type { Url } from "./Url.js";

export interface OctokitResponse<T, S extends number = number> {
headers: ResponseHeaders;
Expand Down
10 changes: 5 additions & 5 deletions src/RequestInterface.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { EndpointInterface } from "./EndpointInterface";
import type { OctokitResponse } from "./OctokitResponse";
import type { RequestParameters } from "./RequestParameters";
import type { Route } from "./Route";
import type { EndpointInterface } from "./EndpointInterface.js";
import type { OctokitResponse } from "./OctokitResponse.js";
import type { RequestParameters } from "./RequestParameters.js";
import type { Route } from "./Route.js";

import type { Endpoints } from "./generated/Endpoints";
import type { Endpoints } from "./generated/Endpoints.js";

export interface RequestInterface<D extends object = object> {
/**
Expand Down
8 changes: 4 additions & 4 deletions src/RequestOptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RequestHeaders } from "./RequestHeaders";
import type { RequestMethod } from "./RequestMethod";
import type { RequestRequestOptions } from "./RequestRequestOptions";
import type { Url } from "./Url";
import type { RequestHeaders } from "./RequestHeaders.js";
import type { RequestMethod } from "./RequestMethod.js";
import type { RequestRequestOptions } from "./RequestRequestOptions.js";
import type { Url } from "./Url.js";

/**
* Generic request options as they are returned by the `endpoint()` method
Expand Down
6 changes: 3 additions & 3 deletions src/RequestParameters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestRequestOptions } from "./RequestRequestOptions";
import type { RequestHeaders } from "./RequestHeaders";
import type { Url } from "./Url";
import type { RequestRequestOptions } from "./RequestRequestOptions.js";
import type { RequestHeaders } from "./RequestHeaders.js";
import type { Url } from "./Url.js";

/**
* Parameters that can be passed into `request(route, parameters)` or `endpoint(route, parameters)` methods
Expand Down
4 changes: 2 additions & 2 deletions src/RequestRequestOptions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Fetch } from "./Fetch";
import type { Signal } from "./Signal";
import type { Fetch } from "./Fetch.js";
import type { Signal } from "./Signal.js";

/**
* Octokit-specific request options which are ignored for the actual request, but can be used by Octokit or plugins to manipulate how the request is sent or how a response is handled
Expand Down
2 changes: 1 addition & 1 deletion src/StrategyInterface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AuthInterface } from "./AuthInterface";
import type { AuthInterface } from "./AuthInterface.js";

export interface StrategyInterface<
StrategyOptions extends any[],
Expand Down
6 changes: 3 additions & 3 deletions src/generated/Endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// DO NOT EDIT THIS FILE
import type { paths } from "@octokit/openapi-types";
import type { OctokitResponse } from "../OctokitResponse";
import type { RequestHeaders } from "../RequestHeaders";
import type { RequestRequestOptions } from "../RequestRequestOptions";
import type { OctokitResponse } from "../OctokitResponse.js";
import type { RequestHeaders } from "../RequestHeaders.js";
import type { RequestRequestOptions } from "../RequestRequestOptions.js";

/**
* @license (MIT OR CC0-1.0)
Expand Down
42 changes: 21 additions & 21 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
export * from "./AuthInterface";
export * from "./EndpointDefaults";
export * from "./EndpointInterface";
export * from "./EndpointOptions";
export * from "./Fetch";
export * from "./OctokitResponse";
export * from "./RequestError";
export * from "./RequestHeaders";
export * from "./RequestInterface";
export * from "./RequestMethod";
export * from "./RequestOptions";
export * from "./RequestParameters";
export * from "./RequestRequestOptions";
export * from "./ResponseHeaders";
export * from "./Route";
export * from "./Signal";
export * from "./StrategyInterface";
export * from "./Url";
export * from "./VERSION";
export * from "./GetResponseTypeFromEndpointMethod";
export * from "./generated/Endpoints";
export * from "./AuthInterface.js";
export * from "./EndpointDefaults.js";
export * from "./EndpointInterface.js";
export * from "./EndpointOptions.js";
export * from "./Fetch.js";
export * from "./OctokitResponse.js";
export * from "./RequestError.js";
export * from "./RequestHeaders.js";
export * from "./RequestInterface.js";
export * from "./RequestMethod.js";
export * from "./RequestOptions.js";
export * from "./RequestParameters.js";
export * from "./RequestRequestOptions.js";
export * from "./ResponseHeaders.js";
export * from "./Route.js";
export * from "./Signal.js";
export * from "./StrategyInterface.js";
export * from "./Url.js";
export * from "./VERSION.js";
export * from "./GetResponseTypeFromEndpointMethod.js";
export * from "./generated/Endpoints.js";

0 comments on commit a3a9604

Please sign in to comment.