feli 1.0.1 → 1.0.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/dist/index.js +30 -22
- package/package.json +14 -14
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.4",
|
|
16
18
|
private: false,
|
|
17
19
|
repository: {
|
|
18
20
|
type: "git",
|
|
@@ -76,27 +78,27 @@ var package_default = {
|
|
|
76
78
|
"run-test": "node scr/test-feli.js"
|
|
77
79
|
},
|
|
78
80
|
dependencies: {
|
|
79
|
-
|
|
80
|
-
"fs-extra": "^11.3.
|
|
81
|
+
"@hono/node-server": "^1.19.7",
|
|
82
|
+
"fs-extra": "^11.3.3",
|
|
81
83
|
"get-port": "^7.1.0",
|
|
82
|
-
|
|
84
|
+
hono: "^4.11.3",
|
|
85
|
+
open: "^11.0.0",
|
|
83
86
|
yargs: "^18.0.0"
|
|
84
87
|
},
|
|
85
88
|
devDependencies: {
|
|
86
89
|
"@eslint/js": "^9.10.0",
|
|
87
90
|
"@types/eslint__js": "^8.42.3",
|
|
88
|
-
"@types/express": "^5.0.3",
|
|
89
91
|
"@types/fs-extra": "^11.0.4",
|
|
90
|
-
"@types/yargs": "^17.0.
|
|
91
|
-
eslint: "^9.
|
|
92
|
-
"eslint-config-prettier": "^10.1.
|
|
92
|
+
"@types/yargs": "^17.0.35",
|
|
93
|
+
eslint: "^9.39.2",
|
|
94
|
+
"eslint-config-prettier": "^10.1.8",
|
|
93
95
|
"npm-run-all2": "^8.0.4",
|
|
94
|
-
prettier: "^3.
|
|
95
|
-
rimraf: "^6.
|
|
96
|
-
tsup: "^8.5.
|
|
97
|
-
typescript: "^5.
|
|
98
|
-
"typescript-eslint": "^8.
|
|
99
|
-
vitest: "^
|
|
96
|
+
prettier: "^3.7.4",
|
|
97
|
+
rimraf: "^6.1.2",
|
|
98
|
+
tsup: "^8.5.1",
|
|
99
|
+
typescript: "^5.9.3",
|
|
100
|
+
"typescript-eslint": "^8.50.1",
|
|
101
|
+
vitest: "^4.0.16"
|
|
100
102
|
}
|
|
101
103
|
};
|
|
102
104
|
|
|
@@ -116,16 +118,22 @@ async function mini_server(aDirectory, aBrowser, aPort) {
|
|
|
116
118
|
if (portnumber === 0) {
|
|
117
119
|
portnumber = await getport();
|
|
118
120
|
}
|
|
119
|
-
const app =
|
|
121
|
+
const app = new Hono();
|
|
120
122
|
if (aDirectory !== "") {
|
|
121
|
-
app.use(
|
|
123
|
+
app.use("*", serveStatic({ root: aDirectory }));
|
|
122
124
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
serve(
|
|
126
|
+
{
|
|
127
|
+
fetch: app.fetch,
|
|
128
|
+
port: portnumber
|
|
129
|
+
},
|
|
130
|
+
(info) => {
|
|
131
|
+
console.log(
|
|
132
|
+
`${package_default.name} serves on port ${info.port} for host ${chost} the directory:
|
|
126
133
|
${aDirectory} ...`
|
|
127
|
-
|
|
128
|
-
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
);
|
|
129
137
|
await sleep(1e3);
|
|
130
138
|
const url = `http://localhost:${portnumber}`;
|
|
131
139
|
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.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -65,26 +65,26 @@
|
|
|
65
65
|
"run-test": "node scr/test-feli.js"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"
|
|
69
|
-
"fs-extra": "^11.3.
|
|
68
|
+
"@hono/node-server": "^1.19.7",
|
|
69
|
+
"fs-extra": "^11.3.3",
|
|
70
70
|
"get-port": "^7.1.0",
|
|
71
|
-
"
|
|
71
|
+
"hono": "^4.11.3",
|
|
72
|
+
"open": "^11.0.0",
|
|
72
73
|
"yargs": "^18.0.0"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
76
|
"@eslint/js": "^9.10.0",
|
|
76
77
|
"@types/eslint__js": "^8.42.3",
|
|
77
|
-
"@types/express": "^5.0.3",
|
|
78
78
|
"@types/fs-extra": "^11.0.4",
|
|
79
|
-
"@types/yargs": "^17.0.
|
|
80
|
-
"eslint": "^9.
|
|
81
|
-
"eslint-config-prettier": "^10.1.
|
|
79
|
+
"@types/yargs": "^17.0.35",
|
|
80
|
+
"eslint": "^9.39.2",
|
|
81
|
+
"eslint-config-prettier": "^10.1.8",
|
|
82
82
|
"npm-run-all2": "^8.0.4",
|
|
83
|
-
"prettier": "^3.
|
|
84
|
-
"rimraf": "^6.
|
|
85
|
-
"tsup": "^8.5.
|
|
86
|
-
"typescript": "^5.
|
|
87
|
-
"typescript-eslint": "^8.
|
|
88
|
-
"vitest": "^
|
|
83
|
+
"prettier": "^3.7.4",
|
|
84
|
+
"rimraf": "^6.1.2",
|
|
85
|
+
"tsup": "^8.5.1",
|
|
86
|
+
"typescript": "^5.9.3",
|
|
87
|
+
"typescript-eslint": "^8.50.1",
|
|
88
|
+
"vitest": "^4.0.16"
|
|
89
89
|
}
|
|
90
90
|
}
|