feli 0.5.3 → 0.5.6

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 CHANGED
@@ -8,6 +8,14 @@ Presentation
8
8
  *feli* is a javascript library for building a static web-server for installing and running locally your front-end web-app.
9
9
 
10
10
 
11
+ Links
12
+ -----
13
+
14
+ - [source code](https://github.com/charlyoleg2/feli_mono)
15
+ - [html-page](https://charlyoleg2.github.io/feli_mono/)
16
+ - [npm-package](https://www.npmjs.com/package/feli)
17
+
18
+
11
19
  Requirements
12
20
  ------------
13
21
 
@@ -23,30 +31,36 @@ npm i -D feli
23
31
  ```
24
32
 
25
33
 
26
- Getting started
27
- ---------------
28
-
29
- ```javascript
34
+ Usage
35
+ -----
30
36
 
37
+ Here the typical code for creating a mini-server:
31
38
 
39
+ ```javascript
40
+ import { feli_cli } from '../dist/index.js';
41
+ import process from 'node:process';
42
+ import path from 'node:path';
43
+
44
+ const scrDir = import.meta.dirname;
45
+ const defaultPublicDir = path.join(scrDir, 'public');
46
+
47
+ try {
48
+ await feli_cli(defaultPublicDir, process.argv);
49
+ } catch (err) {
50
+ console.error(`CATCH ERROR: ${err}`);
51
+ }
32
52
  ```
33
53
 
34
- Mini-server usage
35
- -----------------
36
-
37
- ```bash
38
- npx myMiniServer
39
- npx myMiniServer --help
40
- ```
41
54
 
55
+ Usage of the created mini-server
56
+ --------------------------------
42
57
 
43
- Mini-server usage without installation
44
- --------------------------------------
58
+ If you publish your mini-server, you can use it as following
45
59
 
46
60
  ```bash
61
+ npm i myMiniServer
47
62
  npx myMiniServer
48
- npx --package=myMiniServerPkg myMiniServer
49
- npx --package=myMiniServerPkg myMiniServer --help
63
+ npx myMiniServer --help
50
64
  ```
51
65
 
52
66
 
@@ -57,7 +71,7 @@ Development
57
71
  git clone https://github.com/charlyoleg2/feli_mono
58
72
  cd feli_mono
59
73
  npm install
60
- npm run ci
61
- npm -w feli run run
74
+ npm -w feli run ci
75
+ npm -w feli run test-feli
62
76
  ```
63
77
 
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ declare function feli_cli(defaultPublicDir: string, argv: string[]): Promise<void>;
3
+
4
+ export { feli_cli };
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import getport from "get-port";
12
12
  var package_default = {
13
13
  name: "feli",
14
14
  description: "library for making quickly your mini-server for your front-end only web-app",
15
- version: "0.5.3",
15
+ version: "0.5.6",
16
16
  private: false,
17
17
  repository: {
18
18
  type: "git",
@@ -30,13 +30,13 @@ var package_default = {
30
30
  type: "module",
31
31
  exports: {
32
32
  ".": {
33
- types: "./dist/feli.d.ts",
34
- default: "./dist/feli.js"
33
+ types: "./dist/index.d.ts",
34
+ default: "./dist/index.js"
35
35
  }
36
36
  },
37
37
  files: [
38
38
  "dist/",
39
- "!dist/**/*.d.ts",
39
+ "dist/**/*.d.ts",
40
40
  "!dist/**/*.map",
41
41
  "!dist/**/*.test.*",
42
42
  "!dist/**/*.spec.*"
@@ -72,7 +72,8 @@ var package_default = {
72
72
  "test:unit": "vitest",
73
73
  "test:unit:once": "vitest --run",
74
74
  ci: "run-s check build pretty lint test:unit:once",
75
- clean: "rimraf node_modules build dist tmp"
75
+ clean: "rimraf node_modules build dist tmp",
76
+ "run-test": "node scr/test-feli.js"
76
77
  },
77
78
  dependencies: {
78
79
  express: "^5.1.0",
@@ -87,14 +88,14 @@ var package_default = {
87
88
  "@types/express": "^5.0.3",
88
89
  "@types/fs-extra": "^11.0.4",
89
90
  "@types/yargs": "^17.0.33",
90
- eslint: "^9.29.0",
91
+ eslint: "^9.30.1",
91
92
  "eslint-config-prettier": "^10.1.5",
92
93
  "npm-run-all2": "^8.0.4",
93
- prettier: "^3.6.0",
94
+ prettier: "^3.6.2",
94
95
  rimraf: "^6.0.1",
95
96
  tsup: "^8.5.0",
96
97
  typescript: "^5.8.3",
97
- "typescript-eslint": "^8.35.0",
98
+ "typescript-eslint": "^8.35.1",
98
99
  vitest: "^3.2.4"
99
100
  }
100
101
  };
@@ -146,7 +147,7 @@ async function feli_cli(defaultPublicDir, argv) {
146
147
  type: "string",
147
148
  description: "path to the directory to be served.",
148
149
  //default: `${__dirname}/webui`,
149
- //default: `${scrDir}/public`
150
+ //default: path.join(scrDir, 'public')
150
151
  default: defaultPublicDir
151
152
  }).option("browser", {
152
153
  alias: "b",
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": "0.5.3",
4
+ "version": "0.5.6",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
@@ -19,13 +19,13 @@
19
19
  "type": "module",
20
20
  "exports": {
21
21
  ".": {
22
- "types": "./dist/feli.d.ts",
23
- "default": "./dist/feli.js"
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
24
  }
25
25
  },
26
26
  "files": [
27
27
  "dist/",
28
- "!dist/**/*.d.ts",
28
+ "dist/**/*.d.ts",
29
29
  "!dist/**/*.map",
30
30
  "!dist/**/*.test.*",
31
31
  "!dist/**/*.spec.*"
@@ -61,7 +61,8 @@
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
- "clean": "rimraf node_modules build dist tmp"
64
+ "clean": "rimraf node_modules build dist tmp",
65
+ "run-test": "node scr/test-feli.js"
65
66
  },
66
67
  "dependencies": {
67
68
  "express": "^5.1.0",
@@ -76,14 +77,14 @@
76
77
  "@types/express": "^5.0.3",
77
78
  "@types/fs-extra": "^11.0.4",
78
79
  "@types/yargs": "^17.0.33",
79
- "eslint": "^9.29.0",
80
+ "eslint": "^9.30.1",
80
81
  "eslint-config-prettier": "^10.1.5",
81
82
  "npm-run-all2": "^8.0.4",
82
- "prettier": "^3.6.0",
83
+ "prettier": "^3.6.2",
83
84
  "rimraf": "^6.0.1",
84
85
  "tsup": "^8.5.0",
85
86
  "typescript": "^5.8.3",
86
- "typescript-eslint": "^8.35.0",
87
+ "typescript-eslint": "^8.35.1",
87
88
  "vitest": "^3.2.4"
88
89
  }
89
90
  }