@node-cli/static-server 2.0.0 → 2.0.2
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 +0 -1
- package/dist/parse.js +1 -0
- package/dist/parse.js.map +1 -1
- package/package.json +6 -7
- package/dist/utilities.d.ts +0 -23
- package/dist/utilities.js +0 -27
- package/dist/utilities.js.map +0 -1
package/dist/index.d.ts
CHANGED
package/dist/parse.js
CHANGED
package/dist/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/parse.ts"],"sourcesContent":["import { defaultFlags, defaultParameters } from \"./defaults.js\";\n\nimport { parser } from \"@node-cli/parser\";\n\nexport type Flags = {\n\tcache?: number;\n\tcors?: boolean;\n\tdirs?: boolean;\n\tgzip?: boolean;\n\thttp2?: boolean;\n\tlogs?: boolean;\n\topen?: boolean;\n\tport?: number;\n};\n\nexport type Parameters = {\n\tpath?: string;\n};\n\nexport type Configuration = {\n\tflags?: Flags;\n\tparameters?: Parameters;\n\tusage?: boolean;\n\texamples?: string;\n};\n\nexport const config: Configuration = parser({\n\tflags: {\n\t\tcache: {\n\t\t\tshortFlag: \"c\",\n\t\t\tdefault: defaultFlags.cache,\n\t\t\tdescription: \"Time in seconds for caching files\",\n\t\t\ttype: \"number\",\n\t\t},\n\t\tcors: {\n\t\t\tshortFlag: \"C\",\n\t\t\tdefault: defaultFlags.cors,\n\t\t\tdescription: \"Set CORS headers to * to allow requests from any origin\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tdirs: {\n\t\t\tshortFlag: \"d\",\n\t\t\tdefault: defaultFlags.dirs,\n\t\t\tdescription: \"List the directory's contents\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tgzip: {\n\t\t\tshortFlag: \"g\",\n\t\t\tdefault: defaultFlags.gzip,\n\t\t\tdescription: \"Enable GZIP compression\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thelp: {\n\t\t\tshortFlag: \"h\",\n\t\t\tdescription: \"Display help instructions\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thttp2: {\n\t\t\tshortFlag: \"H\",\n\t\t\tdefault: defaultFlags.http2,\n\t\t\tdescription: \"Use HTTP/2 and SSL (local certificate provided)\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tlogs: {\n\t\t\tshortFlag: \"l\",\n\t\t\tdefault: defaultFlags.logs,\n\t\t\tdescription: \"Log HTTP requests at the prompt\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\topen: {\n\t\t\tshortFlag: \"o\",\n\t\t\tdefault: defaultFlags.open,\n\t\t\tdescription: \"Open in your default browser\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tport: {\n\t\t\tshortFlag: \"p\",\n\t\t\tdefault: defaultFlags.port,\n\t\t\tdescription: \"Port to listen on\",\n\t\t\ttype: \"number\",\n\t\t},\n\t\tversion: {\n\t\t\tshortFlag: \"v\",\n\t\t\tdescription: \"Output the current version\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t},\n\tparameters: {\n\t\tpath: {\n\t\t\tdefault: \"current folder\",\n\t\t\tdescription: \"the path to serve files from\",\n\t\t},\n\t},\n\tusage: true,\n\tdefaultFlags,\n\tdefaultParameters,\n});\n"],"names":["defaultFlags","defaultParameters","parser","config","flags","cache","shortFlag","default","description","type","cors","dirs","gzip","help","http2","logs","open","port","version","parameters","path","usage"],"mappings":"AAAA,SAASA,YAAY,EAAEC,iBAAiB,QAAQ,gBAAgB;AAEhE,SAASC,MAAM,QAAQ,mBAAmB;AAwB1C,OAAO,MAAMC,SAAwBD,OAAO;IAC3CE,OAAO;QACNC,OAAO;YACNC,WAAW;YACXC,
|
|
1
|
+
{"version":3,"sources":["../src/parse.ts"],"sourcesContent":["import { defaultFlags, defaultParameters } from \"./defaults.js\";\n\nimport { parser } from \"@node-cli/parser\";\n\nexport type Flags = {\n\tcache?: number;\n\tcors?: boolean;\n\tdirs?: boolean;\n\tgzip?: boolean;\n\thttp2?: boolean;\n\tlogs?: boolean;\n\topen?: boolean;\n\tport?: number;\n};\n\nexport type Parameters = {\n\tpath?: string;\n};\n\nexport type Configuration = {\n\tflags?: Flags;\n\tparameters?: Parameters;\n\tusage?: boolean;\n\texamples?: string;\n};\n\nexport const config: Configuration = parser({\n\tmeta: import.meta,\n\tflags: {\n\t\tcache: {\n\t\t\tshortFlag: \"c\",\n\t\t\tdefault: defaultFlags.cache,\n\t\t\tdescription: \"Time in seconds for caching files\",\n\t\t\ttype: \"number\",\n\t\t},\n\t\tcors: {\n\t\t\tshortFlag: \"C\",\n\t\t\tdefault: defaultFlags.cors,\n\t\t\tdescription: \"Set CORS headers to * to allow requests from any origin\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tdirs: {\n\t\t\tshortFlag: \"d\",\n\t\t\tdefault: defaultFlags.dirs,\n\t\t\tdescription: \"List the directory's contents\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tgzip: {\n\t\t\tshortFlag: \"g\",\n\t\t\tdefault: defaultFlags.gzip,\n\t\t\tdescription: \"Enable GZIP compression\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thelp: {\n\t\t\tshortFlag: \"h\",\n\t\t\tdescription: \"Display help instructions\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thttp2: {\n\t\t\tshortFlag: \"H\",\n\t\t\tdefault: defaultFlags.http2,\n\t\t\tdescription: \"Use HTTP/2 and SSL (local certificate provided)\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tlogs: {\n\t\t\tshortFlag: \"l\",\n\t\t\tdefault: defaultFlags.logs,\n\t\t\tdescription: \"Log HTTP requests at the prompt\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\topen: {\n\t\t\tshortFlag: \"o\",\n\t\t\tdefault: defaultFlags.open,\n\t\t\tdescription: \"Open in your default browser\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tport: {\n\t\t\tshortFlag: \"p\",\n\t\t\tdefault: defaultFlags.port,\n\t\t\tdescription: \"Port to listen on\",\n\t\t\ttype: \"number\",\n\t\t},\n\t\tversion: {\n\t\t\tshortFlag: \"v\",\n\t\t\tdescription: \"Output the current version\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t},\n\tparameters: {\n\t\tpath: {\n\t\t\tdefault: \"current folder\",\n\t\t\tdescription: \"the path to serve files from\",\n\t\t},\n\t},\n\tusage: true,\n\tdefaultFlags,\n\tdefaultParameters,\n});\n"],"names":["defaultFlags","defaultParameters","parser","config","meta","flags","cache","shortFlag","default","description","type","cors","dirs","gzip","help","http2","logs","open","port","version","parameters","path","usage"],"mappings":"AAAA,SAASA,YAAY,EAAEC,iBAAiB,QAAQ,gBAAgB;AAEhE,SAASC,MAAM,QAAQ,mBAAmB;AAwB1C,OAAO,MAAMC,SAAwBD,OAAO;IAC3CE,MAAM;IACNC,OAAO;QACNC,OAAO;YACNC,WAAW;YACXC,SAASR,aAAaM;YACtBG,aAAa;YACbC,MAAM;QACP;QACAC,MAAM;YACLJ,WAAW;YACXC,SAASR,aAAaW;YACtBF,aAAa;YACbC,MAAM;QACP;QACAE,MAAM;YACLL,WAAW;YACXC,SAASR,aAAaY;YACtBH,aAAa;YACbC,MAAM;QACP;QACAG,MAAM;YACLN,WAAW;YACXC,SAASR,aAAaa;YACtBJ,aAAa;YACbC,MAAM;QACP;QACAI,MAAM;YACLP,WAAW;YACXE,aAAa;YACbC,MAAM;QACP;QACAK,OAAO;YACNR,WAAW;YACXC,SAASR,aAAae;YACtBN,aAAa;YACbC,MAAM;QACP;QACAM,MAAM;YACLT,WAAW;YACXC,SAASR,aAAagB;YACtBP,aAAa;YACbC,MAAM;QACP;QACAO,MAAM;YACLV,WAAW;YACXC,SAASR,aAAaiB;YACtBR,aAAa;YACbC,MAAM;QACP;QACAQ,MAAM;YACLX,WAAW;YACXC,SAASR,aAAakB;YACtBT,aAAa;YACbC,MAAM;QACP;QACAS,SAAS;YACRZ,WAAW;YACXE,aAAa;YACbC,MAAM;QACP;IACD;IACAU,YAAY;QACXC,MAAM;YACLb,SAAS;YACTC,aAAa;QACd;IACD;IACAa,OAAO;IACPtB;IACAC;AACD,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-cli/static-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"description": "A simple, zero-configuration, command line HTTP server to serve static files locally",
|
|
@@ -25,16 +25,15 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@fastify/caching": "8.3.0",
|
|
28
|
-
"@fastify/compress": "6.
|
|
29
|
-
"@fastify/cors": "8.
|
|
30
|
-
"@fastify/static": "6.10.
|
|
28
|
+
"@fastify/compress": "6.4.0",
|
|
29
|
+
"@fastify/cors": "8.3.0",
|
|
30
|
+
"@fastify/static": "6.10.2",
|
|
31
31
|
"@node-cli/logger": ">=1.0.0",
|
|
32
|
-
"@node-cli/parser": ">=
|
|
32
|
+
"@node-cli/parser": ">=2.0.0",
|
|
33
33
|
"fastify": "4.17.0",
|
|
34
34
|
"fastify-plugin": "4.5.0",
|
|
35
35
|
"fs-extra": "11.1.1",
|
|
36
36
|
"kleur": "4.1.5",
|
|
37
|
-
"lodash": "4.17.21",
|
|
38
37
|
"open": "9.1.0",
|
|
39
38
|
"pino-pretty": "10.0.0",
|
|
40
39
|
"portfinder": "1.0.32"
|
|
@@ -42,5 +41,5 @@
|
|
|
42
41
|
"publishConfig": {
|
|
43
42
|
"access": "public"
|
|
44
43
|
},
|
|
45
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "f70aec7d6e950b8c76048917a1fcb01c90a0beb3"
|
|
46
45
|
}
|
package/dist/utilities.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrapper method for lodash `merge()` and `mergeWith()` methods.
|
|
3
|
-
*
|
|
4
|
-
* Without the `customizer` function, this method recursively merges own and inherited
|
|
5
|
-
* enumerable string keyed properties of source objects into the destination object.
|
|
6
|
-
* Source properties that resolve to undefined are skipped if a destination value exists.
|
|
7
|
-
* Array and plain object properties are merged recursively. Other objects and value
|
|
8
|
-
* types are overridden by assignment. Source objects are applied from left to right.
|
|
9
|
-
* Subsequent sources overwrite property assignments of previous sources.
|
|
10
|
-
*
|
|
11
|
-
* With the `customizer` function, the behavior is the same except that `customizer` is
|
|
12
|
-
* invoked to produce the merged values of the destination and source properties.
|
|
13
|
-
* If customizer returns undefined, merging is handled by the `shallowMerge` instead.
|
|
14
|
-
* The customizer is invoked with six arguments: `(objValue, srcValue, key, object,
|
|
15
|
-
* source, stack)`
|
|
16
|
-
* @param {object} objA
|
|
17
|
-
* @param {object} objB
|
|
18
|
-
* @param {function} customizer
|
|
19
|
-
* @returns {object}
|
|
20
|
-
*
|
|
21
|
-
* !! WARNING: this method will mutate objA
|
|
22
|
-
*/
|
|
23
|
-
export declare const shallowMerge: (objectA: any, objectB: any, customizer?: any) => object;
|
package/dist/utilities.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import _ from "lodash";
|
|
2
|
-
/**
|
|
3
|
-
* Wrapper method for lodash `merge()` and `mergeWith()` methods.
|
|
4
|
-
*
|
|
5
|
-
* Without the `customizer` function, this method recursively merges own and inherited
|
|
6
|
-
* enumerable string keyed properties of source objects into the destination object.
|
|
7
|
-
* Source properties that resolve to undefined are skipped if a destination value exists.
|
|
8
|
-
* Array and plain object properties are merged recursively. Other objects and value
|
|
9
|
-
* types are overridden by assignment. Source objects are applied from left to right.
|
|
10
|
-
* Subsequent sources overwrite property assignments of previous sources.
|
|
11
|
-
*
|
|
12
|
-
* With the `customizer` function, the behavior is the same except that `customizer` is
|
|
13
|
-
* invoked to produce the merged values of the destination and source properties.
|
|
14
|
-
* If customizer returns undefined, merging is handled by the `shallowMerge` instead.
|
|
15
|
-
* The customizer is invoked with six arguments: `(objValue, srcValue, key, object,
|
|
16
|
-
* source, stack)`
|
|
17
|
-
* @param {object} objA
|
|
18
|
-
* @param {object} objB
|
|
19
|
-
* @param {function} customizer
|
|
20
|
-
* @returns {object}
|
|
21
|
-
*
|
|
22
|
-
* !! WARNING: this method will mutate objA
|
|
23
|
-
*/ export const shallowMerge = (objectA, objectB, customizer)=>{
|
|
24
|
-
return typeof customizer === "function" ? _.mergeWith(objectA, objectB, customizer) : _.merge(objectA, objectB);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=utilities.js.map
|
package/dist/utilities.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utilities.ts"],"sourcesContent":["import _ from \"lodash\";\n\n/**\n * Wrapper method for lodash `merge()` and `mergeWith()` methods.\n *\n * Without the `customizer` function, this method recursively merges own and inherited\n * enumerable string keyed properties of source objects into the destination object.\n * Source properties that resolve to undefined are skipped if a destination value exists.\n * Array and plain object properties are merged recursively. Other objects and value\n * types are overridden by assignment. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * With the `customizer` function, the behavior is the same except that `customizer` is\n * invoked to produce the merged values of the destination and source properties.\n * If customizer returns undefined, merging is handled by the `shallowMerge` instead.\n * The customizer is invoked with six arguments: `(objValue, srcValue, key, object,\n * source, stack)`\n * @param {object} objA\n * @param {object} objB\n * @param {function} customizer\n * @returns {object}\n *\n * !! WARNING: this method will mutate objA\n */\nexport const shallowMerge = (\n\tobjectA: any,\n\tobjectB: any,\n\tcustomizer?: any\n): object => {\n\treturn typeof customizer === \"function\"\n\t\t? _.mergeWith(objectA, objectB, customizer)\n\t\t: _.merge(objectA, objectB);\n};\n"],"names":["_","shallowMerge","objectA","objectB","customizer","mergeWith","merge"],"mappings":"AAAA,OAAOA,OAAO,SAAS;AAEvB;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,MAAMC,eAAe,CAC3BC,SACAC,SACAC;IAEA,OAAO,OAAOA,eAAe,aAC1BJ,EAAEK,UAAUH,SAASC,SAASC,cAC9BJ,EAAEM,MAAMJ,SAASC;AACrB,EAAE"}
|