Skip to content

Commit

Permalink
fix ci!!!!!!!!!!!!!!!!!!!!!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
ayame113 committed Dec 11, 2024
1 parent d3538fb commit 41568ab
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@std/http": "jsr:@std/http@^1.0.12",
"@std/media-types": "jsr:@std/media-types@^1.1.0",
"@std/testing": "jsr:@std/testing@^1.0.6",
"@ayame113/ts-serve": "./"
"@ayame113/ts-serve": "./mod.ts",
"@ayame113/ts-serve/": "./"
}
}
2 changes: 1 addition & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { MediaType, transpile } from "./utils/transpile.ts";
* However, performance can be an issue on the server as loading the wasm file takes time.
* In that case, calling this function in advance can speed up later calls to the transpile function.
*
* ```ts
* ```ts ignore
* import { serveDirWithTs, forceInstantiateWasm } from "@ayame113/ts-serve";
*
* // load the wasm file in the background when the server starts.
Expand Down
1 change: 1 addition & 0 deletions oak_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async function startServer() {
app.addEventListener("listen", (e) => {
listener.resolve(e);
});
// deno-lint-ignore no-unused-vars
const server = app.listen({ port, signal: killSignal.signal });
await listener.promise;

Expand Down
8 changes: 4 additions & 4 deletions src/file_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
} from "@std/http/file-server";

import { transpileResponse } from "../utils/transpile_response.ts";
import { TranspileOptions } from "../utils/transpile.ts";
import type { TranspileOptions } from "../utils/transpile.ts";

/**
* This can be used in the same way as the [serveFile](https://jsr.io/@std/http/doc/~/serveFile) function of the standard library, but if the file is TypeScript, it will be rewritten to JavaScript.
*
* ```ts
* ```ts ignore
* import { serveFileWithTs, forceInstantiateWasm } from "@ayame113/ts-serve";
*
* forceInstantiateWasm();
Expand All @@ -36,7 +36,7 @@ export async function serveFileWithTs(
/**
* This can be used in the same way as the [serveDir](https://jsr.io/@std/http/doc/~/serveDir) function of the standard library, but if the file is TypeScript, it will be rewritten to JavaScript.
*
* ```ts
* ```ts ignore
* import { serveDirWithTs, forceInstantiateWasm } from "@ayame113/ts-serve";
*
* forceInstantiateWasm();
Expand All @@ -57,4 +57,4 @@ export async function serveDirWithTs(
);
}

export { type ServeDirOptions, type ServeFileOptions, type TranspileOptions };
export type { ServeDirOptions, ServeFileOptions, TranspileOptions };
4 changes: 2 additions & 2 deletions src/oak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const jsxType = new Set<string | undefined>(["jsx", ".jsx", "text/jsx"]);
/**
* Oak middleware that rewrites TypeScript response to JavaScript response (with transpile config).
*
* ```ts
* ```ts ignore
* import { Application } from "@oak/oak";
* import { createTsMiddleware, forceInstantiateWasm } from "@ayame113/ts-serve";
*
Expand Down Expand Up @@ -109,7 +109,7 @@ export function createTsMiddleware(
/**
* Oak middleware that rewrites TypeScript response to JavaScript response.
*
* ```ts
* ```ts ignore
* import { Application } from "@oak/oak";
* import { tsMiddleware, forceInstantiateWasm } from "@ayame113/ts-serve";
*
Expand Down
1 change: 1 addition & 0 deletions test/a.jsx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// deno-lint-ignore no-unused-vars
const a = <a>hello</a>;
1 change: 1 addition & 0 deletions test/a.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// deno-lint-ignore no-unused-vars
const a = <a>hello</a>;
4 changes: 2 additions & 2 deletions utils/transpile_response.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { contentType } from "@std/media-types";
import { MediaType, transpile, TranspileOptions } from "./transpile.ts";
import { MediaType, transpile, type TranspileOptions } from "./transpile.ts";

const jsContentType = contentType(".js");

/**
* Transpile the body of the response and return a new response.
*
* ```ts
* ```ts ignore
* import { serveFile } from "@std/http/file-server";
*
* import { transpileResponse } from "@ayame113/ts-serve/utils/transpile_response.ts"
Expand Down

0 comments on commit 41568ab

Please sign in to comment.