[iceshrimp-js] Build with tsc so we get type declarations

This commit is contained in:
Laura Hausmann 2023-12-04 19:24:11 +01:00
parent d4aef0b930
commit 7f58107311
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605
7 changed files with 30 additions and 17 deletions

View File

@ -5,7 +5,7 @@
"main": "./built/index.js",
"types": "./built/index.d.ts",
"scripts": {
"build": "swc src -d built -D",
"build": "tsc",
"build:debug": "swc src -d built -s -D",
"render": "yarn build && yarn api && yarn api-prod && cp temp/iceshrimp-js.api.json etc/ && yarn api-doc",
"tsd": "tsc && tsd",

View File

@ -1,4 +1,4 @@
import { Endpoints } from "./api.types";
import { Endpoints } from "./api.types.js";
const MK_API_ERROR = Symbol();

View File

@ -34,7 +34,7 @@ import {
NoteReaction,
Signin,
MessagingMessage,
} from "./entities";
} from "./entities.js";
type TODO = Record<string, any> | null;

View File

@ -1,8 +1,8 @@
import { Endpoints } from "./api.types";
import Stream, { Connection } from "./streaming";
import { Channels } from "./streaming.types";
import { Acct } from "./acct";
import * as consts from "./consts";
import { Endpoints } from "./api.types.js";
import Stream, { Connection } from "./streaming.js";
import { Channels } from "./streaming.types.js";
import { Acct } from "./acct.js";
import * as consts from "./consts.js";
export { Endpoints, Stream, Connection as ChannelConnection, Channels, Acct };
@ -14,6 +14,6 @@ export const ffVisibility = consts.ffVisibility;
// api extractor not supported yet
//export * as api from './api';
//export * as entities from './entities';
import * as api from "./api";
import * as entities from "./entities";
import * as api from "./api.js";
import * as entities from "./entities.js";
export { api, entities };

View File

@ -1,6 +1,6 @@
import { EventEmitter } from "eventemitter3";
import ReconnectingWebsocket from "reconnecting-websocket";
import { BroadcastEvents, Channels } from "./streaming.types";
import { BroadcastEvents, Channels } from "./streaming.types.js";
function autobind(instance: any): void {
const prototype = Object.getPrototypeOf(instance);

View File

@ -9,7 +9,7 @@ import type {
PageEvent,
User,
UserGroup,
} from "./entities";
} from "./entities.js";
type FIXME = any;

View File

@ -1,8 +1,9 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"target": "ES2022",
"module": "nodenext",
"moduleResolution": "nodenext",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
@ -13,8 +14,20 @@
"strictNullChecks": true,
"experimentalDecorators": true,
"noImplicitReturns": true,
"esModuleInterop": true
"esModuleInterop": true,
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"esnext",
"dom"
]
},
"include": ["src/**/*"],
"exclude": ["node_modules", "test/**/*"]
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"test/**/*"
]
}