@t8/serve 0.1.33 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./src/BundleConfig";
2
- export * from "./src/Config";
3
- export * from "./src/serve";
1
+ export * from "./src/BundleConfig.ts";
2
+ export * from "./src/Config.ts";
3
+ export * from "./src/serve.ts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/serve",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "Simple static file server + bundler, primarily for demo apps and tests, manual or automated",
5
5
  "keywords": [
6
6
  "node",
package/src/Config.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { IncomingMessage, ServerResponse } from "node:http";
2
- import type { BundleConfig } from "./BundleConfig";
2
+ import type { BundleConfig } from "./BundleConfig.ts";
3
3
 
4
4
  export type Config = {
5
5
  /** Server URL. */
package/src/bundle.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { rm } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { type BuildOptions, build, context } from "esbuild";
4
- import type { BundleConfig } from "./BundleConfig";
5
- import type { Config } from "./Config";
4
+ import type { BundleConfig } from "./BundleConfig.ts";
5
+ import type { Config } from "./Config.ts";
6
6
 
7
7
  export async function bundle({
8
8
  path = "",
@@ -1,6 +1,6 @@
1
1
  import { join } from "node:path";
2
- import type { Config } from "./Config";
3
- import { isValidFilePath } from "./isValidFilePath";
2
+ import type { Config } from "./Config.ts";
3
+ import { isValidFilePath } from "./isValidFilePath.ts";
4
4
 
5
5
  const cwd = process.cwd();
6
6
 
package/src/getTarget.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Config } from "./Config";
1
+ import type { Config } from "./Config.ts";
2
2
 
3
3
  const defaultHost = "localhost";
4
4
  const defaultPort = 3000;
package/src/run.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import type { Config } from "./Config";
3
- import { serve } from "./serve";
2
+ import type { Config } from "./Config.ts";
3
+ import { serve } from "./serve.ts";
4
4
 
5
5
  async function run() {
6
6
  let [url, ...args] = process.argv.slice(2);
package/src/serve.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { createReadStream } from "node:fs";
2
2
  import { createServer } from "node:http";
3
3
  import { extname } from "node:path";
4
- import { bundle } from "./bundle";
5
- import type { Config } from "./Config";
6
- import { getFilePath } from "./getFilePath";
7
- import { getTarget } from "./getTarget";
8
- import { mimeTypes } from "./mimeTypes";
4
+ import { bundle } from "./bundle.ts";
5
+ import type { Config } from "./Config.ts";
6
+ import { getFilePath } from "./getFilePath.ts";
7
+ import { getTarget } from "./getTarget.ts";
8
+ import { mimeTypes } from "./mimeTypes.ts";
9
9
 
10
10
  export type Server = ReturnType<typeof createServer>;
11
11
 
package/tsconfig.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "include": ["index.ts", "src"],
3
3
  "compilerOptions": {
4
+ "noEmit": true,
4
5
  "lib": ["ESNext", "DOM", "DOM.Iterable"],
5
- "target": "ESNext",
6
+ "target": "esnext",
6
7
  "outDir": "dist",
7
- "moduleResolution": "node",
8
+ "module": "nodenext",
9
+ "moduleResolution": "nodenext",
10
+ "allowImportingTsExtensions": true,
8
11
  "strict": true,
9
12
  "noUnusedLocals": true,
10
13
  "noUnusedParameters": true