feli 1.0.1 → 1.0.13
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/dist/index.d.ts +3 -0
- package/dist/index.js +37 -26
- package/package.json +21 -18
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
import yargs from "yargs";
|
|
5
5
|
import { hideBin } from "yargs/helpers";
|
|
6
6
|
import fs from "fs";
|
|
7
|
-
import
|
|
7
|
+
import { Hono } from "hono";
|
|
8
|
+
import { serve } from "@hono/node-server";
|
|
9
|
+
import { serveStatic } from "@hono/node-server/serve-static";
|
|
8
10
|
import open from "open";
|
|
9
11
|
import getport from "get-port";
|
|
10
12
|
|
|
@@ -12,7 +14,7 @@ import getport from "get-port";
|
|
|
12
14
|
var package_default = {
|
|
13
15
|
name: "feli",
|
|
14
16
|
description: "library for making quickly your mini-server for your front-end only web-app",
|
|
15
|
-
version: "1.0.
|
|
17
|
+
version: "1.0.13",
|
|
16
18
|
private: false,
|
|
17
19
|
repository: {
|
|
18
20
|
type: "git",
|
|
@@ -46,7 +48,7 @@ var package_default = {
|
|
|
46
48
|
},
|
|
47
49
|
tsup: {
|
|
48
50
|
entry: [
|
|
49
|
-
"src/index.ts"
|
|
51
|
+
"./src/index.ts"
|
|
50
52
|
],
|
|
51
53
|
format: "esm",
|
|
52
54
|
splitting: false,
|
|
@@ -72,31 +74,34 @@ var package_default = {
|
|
|
72
74
|
"test:unit": "vitest",
|
|
73
75
|
"test:unit:once": "vitest --run",
|
|
74
76
|
ci: "run-s check build pretty lint test:unit:once",
|
|
77
|
+
jsrpub: "npx jsr publish",
|
|
75
78
|
clean: "rimraf node_modules build dist tmp",
|
|
76
79
|
"run-test": "node scr/test-feli.js"
|
|
77
80
|
},
|
|
78
81
|
dependencies: {
|
|
79
|
-
|
|
80
|
-
"fs-extra": "^11.3.
|
|
81
|
-
"get-port": "^7.
|
|
82
|
-
|
|
82
|
+
"@hono/node-server": "^2.0.3",
|
|
83
|
+
"fs-extra": "^11.3.5",
|
|
84
|
+
"get-port": "^7.2.0",
|
|
85
|
+
hono: "^4.12.21",
|
|
86
|
+
open: "^11.0.0",
|
|
83
87
|
yargs: "^18.0.0"
|
|
84
88
|
},
|
|
85
89
|
devDependencies: {
|
|
86
|
-
"@eslint/js": "^
|
|
90
|
+
"@eslint/js": "^10.0.1",
|
|
87
91
|
"@types/eslint__js": "^8.42.3",
|
|
88
|
-
"@types/express": "^5.0.3",
|
|
89
92
|
"@types/fs-extra": "^11.0.4",
|
|
90
|
-
"@types/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
"@types/node": "^25.9.1",
|
|
94
|
+
"@types/yargs": "^17.0.35",
|
|
95
|
+
eslint: "^10.4.0",
|
|
96
|
+
"eslint-config-prettier": "^10.1.8",
|
|
97
|
+
jsr: "^0.14.3",
|
|
98
|
+
"npm-run-all2": "^9.0.0",
|
|
99
|
+
prettier: "^3.8.3",
|
|
100
|
+
rimraf: "^6.1.3",
|
|
101
|
+
tsup: "^8.5.1",
|
|
102
|
+
typescript: "^6.0.3",
|
|
103
|
+
"typescript-eslint": "^8.59.4",
|
|
104
|
+
vitest: "^4.1.6"
|
|
100
105
|
}
|
|
101
106
|
};
|
|
102
107
|
|
|
@@ -116,16 +121,22 @@ async function mini_server(aDirectory, aBrowser, aPort) {
|
|
|
116
121
|
if (portnumber === 0) {
|
|
117
122
|
portnumber = await getport();
|
|
118
123
|
}
|
|
119
|
-
const app =
|
|
124
|
+
const app = new Hono();
|
|
120
125
|
if (aDirectory !== "") {
|
|
121
|
-
app.use(
|
|
126
|
+
app.use("*", serveStatic({ root: aDirectory }));
|
|
122
127
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
serve(
|
|
129
|
+
{
|
|
130
|
+
fetch: app.fetch,
|
|
131
|
+
port: portnumber
|
|
132
|
+
},
|
|
133
|
+
(info) => {
|
|
134
|
+
console.log(
|
|
135
|
+
`${package_default.name} serves on port ${info.port} for host ${chost} the directory:
|
|
126
136
|
${aDirectory} ...`
|
|
127
|
-
|
|
128
|
-
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
);
|
|
129
140
|
await sleep(1e3);
|
|
130
141
|
const url = `http://localhost:${portnumber}`;
|
|
131
142
|
if (aBrowser) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feli",
|
|
3
3
|
"description": "library for making quickly your mini-server for your front-end only web-app",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.13",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"tsup": {
|
|
37
37
|
"entry": [
|
|
38
|
-
"src/index.ts"
|
|
38
|
+
"./src/index.ts"
|
|
39
39
|
],
|
|
40
40
|
"format": "esm",
|
|
41
41
|
"splitting": false,
|
|
@@ -61,30 +61,33 @@
|
|
|
61
61
|
"test:unit": "vitest",
|
|
62
62
|
"test:unit:once": "vitest --run",
|
|
63
63
|
"ci": "run-s check build pretty lint test:unit:once",
|
|
64
|
+
"jsrpub": "npx jsr publish",
|
|
64
65
|
"clean": "rimraf node_modules build dist tmp",
|
|
65
66
|
"run-test": "node scr/test-feli.js"
|
|
66
67
|
},
|
|
67
68
|
"dependencies": {
|
|
68
|
-
"
|
|
69
|
-
"fs-extra": "^11.3.
|
|
70
|
-
"get-port": "^7.
|
|
71
|
-
"
|
|
69
|
+
"@hono/node-server": "^2.0.3",
|
|
70
|
+
"fs-extra": "^11.3.5",
|
|
71
|
+
"get-port": "^7.2.0",
|
|
72
|
+
"hono": "^4.12.21",
|
|
73
|
+
"open": "^11.0.0",
|
|
72
74
|
"yargs": "^18.0.0"
|
|
73
75
|
},
|
|
74
76
|
"devDependencies": {
|
|
75
|
-
"@eslint/js": "^
|
|
77
|
+
"@eslint/js": "^10.0.1",
|
|
76
78
|
"@types/eslint__js": "^8.42.3",
|
|
77
|
-
"@types/express": "^5.0.3",
|
|
78
79
|
"@types/fs-extra": "^11.0.4",
|
|
79
|
-
"@types/
|
|
80
|
-
"
|
|
81
|
-
"eslint
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
80
|
+
"@types/node": "^25.9.1",
|
|
81
|
+
"@types/yargs": "^17.0.35",
|
|
82
|
+
"eslint": "^10.4.0",
|
|
83
|
+
"eslint-config-prettier": "^10.1.8",
|
|
84
|
+
"jsr": "^0.14.3",
|
|
85
|
+
"npm-run-all2": "^9.0.0",
|
|
86
|
+
"prettier": "^3.8.3",
|
|
87
|
+
"rimraf": "^6.1.3",
|
|
88
|
+
"tsup": "^8.5.1",
|
|
89
|
+
"typescript": "^6.0.3",
|
|
90
|
+
"typescript-eslint": "^8.59.4",
|
|
91
|
+
"vitest": "^4.1.6"
|
|
89
92
|
}
|
|
90
93
|
}
|