@t8/serve 0.1.3 → 0.1.4
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/README.md +10 -0
- package/package.json +36 -36
- package/src/run.ts +0 -7
package/README.md
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
```sh
|
|
2
|
+
npx @t8/serve [url|port] [app_dir] [...assets_dirs] [-b [bundle_input_path] [bundle_output_path]]
|
|
3
|
+
|
|
4
|
+
npx @t8/serve 3000 app
|
|
5
|
+
npx @t8/serve 3000 app -b
|
|
6
|
+
npx @t8/serve 3000 app public dist
|
|
7
|
+
npx @t8/serve 127.0.0.1:3000 app public dist
|
|
8
|
+
npx @t8/serve 3000 app public dist -b
|
|
9
|
+
npx @t8/serve 3000 app public dist -b src/index.ts
|
|
10
|
+
```
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@t8/serve",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"node",
|
|
7
|
-
"server",
|
|
8
|
-
"static"
|
|
9
|
-
],
|
|
10
|
-
"bin": {
|
|
11
|
-
"serve": "dist/run.mjs"
|
|
12
|
-
},
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/t8js/serve.git"
|
|
16
|
-
},
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"author": "axtk",
|
|
19
|
-
"type": "module",
|
|
20
|
-
"main": "dist/index.js",
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "npx npm-run-all clean -p compile compile-mjs-bin compile-cjs-bin",
|
|
23
|
-
"clean": "node -e \"require('node:fs').rmSync('dist', {force: true, recursive: true});\"",
|
|
24
|
-
"compile": "npx esbuild index.ts --bundle --outdir=dist --platform=node",
|
|
25
|
-
"compile-mjs-bin": "npx esbuild src/run.ts --bundle --outfile=dist/run.mjs --platform=node --format=esm",
|
|
26
|
-
"compile-cjs-bin": "npx esbuild src/run.ts --bundle --outfile=dist/run.cjs --platform=node --format=cjs",
|
|
27
|
-
"prepublishOnly": "npm run build",
|
|
28
|
-
"preversion": "npx npm-run-all typecheck shape build",
|
|
29
|
-
"shape": "npx codeshape",
|
|
30
|
-
"typecheck": "tsc --noEmit"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@types/node": "^24.5.2",
|
|
34
|
-
"typescript": "^5.9.2"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@t8/serve",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"node",
|
|
7
|
+
"server",
|
|
8
|
+
"static"
|
|
9
|
+
],
|
|
10
|
+
"bin": {
|
|
11
|
+
"serve": "dist/run.mjs"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/t8js/serve.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"author": "axtk",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "npx npm-run-all clean -p compile compile-mjs-bin compile-cjs-bin",
|
|
23
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', {force: true, recursive: true});\"",
|
|
24
|
+
"compile": "npx esbuild index.ts --bundle --outdir=dist --platform=node",
|
|
25
|
+
"compile-mjs-bin": "npx esbuild src/run.ts --bundle --outfile=dist/run.mjs --platform=node --format=esm",
|
|
26
|
+
"compile-cjs-bin": "npx esbuild src/run.ts --bundle --outfile=dist/run.cjs --platform=node --format=cjs",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
28
|
+
"preversion": "npx npm-run-all typecheck shape build",
|
|
29
|
+
"shape": "npx codeshape",
|
|
30
|
+
"typecheck": "tsc --noEmit"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^24.5.2",
|
|
34
|
+
"typescript": "^5.9.2"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/run.ts
CHANGED
|
@@ -7,13 +7,6 @@ import { serve } from "./serve";
|
|
|
7
7
|
|
|
8
8
|
const exec = promisify(originalExec);
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* @example
|
|
12
|
-
* serve 3000 app public dist
|
|
13
|
-
* serve 127.0.0.1:3000 app public dist
|
|
14
|
-
* serve 3000 app public dist -b
|
|
15
|
-
* serve 3000 app public dist -b src/index.ts
|
|
16
|
-
*/
|
|
17
10
|
async function run() {
|
|
18
11
|
let [url, path = "", ...args] = process.argv.slice(2);
|
|
19
12
|
let buildFlagIndex = args.indexOf("-b");
|