@wdio/static-server-service 7.21.0 → 8.0.0-alpha.239
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 +1 -1
- package/build/index.d.ts +3 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -25
- package/build/launcher.d.ts +1 -1
- package/build/launcher.d.ts.map +1 -1
- package/build/launcher.js +16 -22
- package/build/types.js +1 -2
- package/package.json +9 -7
package/README.md
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import StaticServerLauncher from './launcher';
|
|
2
|
-
import { StaticServerOptions } from './types';
|
|
1
|
+
import StaticServerLauncher from './launcher.js';
|
|
2
|
+
import type { StaticServerOptions } from './types';
|
|
3
3
|
export default class StaticServerService {
|
|
4
4
|
}
|
|
5
5
|
export declare const launcher: typeof StaticServerLauncher;
|
|
6
|
-
export * from './types';
|
|
6
|
+
export * from './types.js';
|
|
7
7
|
declare global {
|
|
8
8
|
namespace WebdriverIO {
|
|
9
9
|
interface ServiceOption extends StaticServerOptions {
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,CAAC,OAAO,OAAO,mBAAmB;CAAI;AAC5C,eAAO,MAAM,QAAQ,6BAAuB,CAAA;AAC5C,cAAc,YAAY,CAAA;AAE1B,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,WAAW,CAAC;QAClB,UAAU,aAAc,SAAQ,mBAAmB;SAAG;KACzD;CACJ"}
|
package/build/index.js
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* istanbul ignore file */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.launcher = void 0;
|
|
22
|
-
const launcher_1 = __importDefault(require("./launcher"));
|
|
23
|
-
class StaticServerService {
|
|
2
|
+
import StaticServerLauncher from './launcher.js';
|
|
3
|
+
export default class StaticServerService {
|
|
24
4
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
__exportStar(require("./types"), exports);
|
|
5
|
+
export const launcher = StaticServerLauncher;
|
|
6
|
+
export * from './types.js';
|
package/build/launcher.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Services } from '@wdio/types';
|
|
2
|
-
import { FolderOption, MiddleWareOption } from './types';
|
|
2
|
+
import type { FolderOption, MiddleWareOption } from './types';
|
|
3
3
|
export default class StaticServerLauncher implements Services.ServiceInstance {
|
|
4
4
|
private _folders;
|
|
5
5
|
private _port;
|
package/build/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAM7D,MAAM,CAAC,OAAO,OAAO,oBAAqB,YAAW,QAAQ,CAAC,eAAe;IACzE,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,OAAO,CAAC,CAAiB;gBAErB,EAAE,OAAO,EAAE,IAAW,EAAE,UAAe,EAAE,EAAE;QAAE,OAAO,CAAC,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;KAAE;IAM5I,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;CA0BxD"}
|
package/build/launcher.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const express_1 = __importDefault(require("express"));
|
|
9
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
-
const morgan_1 = __importDefault(require("morgan"));
|
|
11
|
-
const logger_1 = __importDefault(require("@wdio/logger"));
|
|
12
|
-
const log = (0, logger_1.default)('@wdio/static-server-service');
|
|
1
|
+
import { join, resolve } from 'node:path';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import express from 'express';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import morgan from 'morgan';
|
|
6
|
+
import logger from '@wdio/logger';
|
|
7
|
+
const log = logger('@wdio/static-server-service');
|
|
13
8
|
const DEFAULT_LOG_NAME = 'wdio-static-server-service.log';
|
|
14
|
-
class StaticServerLauncher {
|
|
9
|
+
export default class StaticServerLauncher {
|
|
15
10
|
constructor({ folders, port = 4567, middleware = [] }) {
|
|
16
11
|
this._folders = folders ? Array.isArray(folders) ? folders : [folders] : null;
|
|
17
12
|
this._port = port;
|
|
@@ -21,21 +16,20 @@ class StaticServerLauncher {
|
|
|
21
16
|
if (!this._folders) {
|
|
22
17
|
return;
|
|
23
18
|
}
|
|
24
|
-
this._server = (
|
|
19
|
+
this._server = express();
|
|
25
20
|
if (outputDir) {
|
|
26
|
-
const file =
|
|
27
|
-
|
|
28
|
-
const stream =
|
|
29
|
-
this._server.use((
|
|
21
|
+
const file = join(outputDir, DEFAULT_LOG_NAME);
|
|
22
|
+
await fs.createFile(file);
|
|
23
|
+
const stream = fs.createWriteStream(file);
|
|
24
|
+
this._server.use(morgan('tiny', { stream }));
|
|
30
25
|
}
|
|
31
26
|
this._folders.forEach((folder) => {
|
|
32
|
-
log.info('Mounting folder `%s` at `%s`',
|
|
33
|
-
this._server.use(folder.mount,
|
|
27
|
+
log.info('Mounting folder `%s` at `%s`', resolve(folder.path), folder.mount);
|
|
28
|
+
this._server.use(folder.mount, express.static(folder.path));
|
|
34
29
|
});
|
|
35
30
|
this._middleware.forEach((ware) => this._server.use(ware.mount, ware.middleware));
|
|
36
|
-
const listen =
|
|
31
|
+
const listen = promisify(this._server.listen.bind(this._server));
|
|
37
32
|
await listen(this._port);
|
|
38
33
|
log.info(`Static server running at http://localhost:${this._port}`);
|
|
39
34
|
}
|
|
40
35
|
}
|
|
41
|
-
exports.default = StaticServerLauncher;
|
package/build/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/static-server-service",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.239+00a68ded0",
|
|
4
4
|
"description": "A WebdriverIO service that can serve your static websites",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-static-server-service",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"main": "./build/index",
|
|
9
8
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
9
|
+
"node": "^16.13 || >=18"
|
|
11
10
|
},
|
|
12
11
|
"repository": {
|
|
13
12
|
"type": "git",
|
|
@@ -26,12 +25,16 @@
|
|
|
26
25
|
"bugs": {
|
|
27
26
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
28
27
|
},
|
|
28
|
+
"type": "module",
|
|
29
|
+
"exports": "./build/index.js",
|
|
30
|
+
"types": "./build/index.d.ts",
|
|
31
|
+
"typeScriptVersion": "3.8.3",
|
|
29
32
|
"dependencies": {
|
|
30
33
|
"@types/express": "^4.17.8",
|
|
31
34
|
"@types/fs-extra": "^9.0.1",
|
|
32
35
|
"@types/morgan": "^1.9.1",
|
|
33
|
-
"@wdio/logger": "
|
|
34
|
-
"@wdio/types": "
|
|
36
|
+
"@wdio/logger": "8.0.0-alpha.239+00a68ded0",
|
|
37
|
+
"@wdio/types": "8.0.0-alpha.239+00a68ded0",
|
|
35
38
|
"express": "^4.14.0",
|
|
36
39
|
"fs-extra": "^10.0.0",
|
|
37
40
|
"morgan": "^1.7.0"
|
|
@@ -39,6 +42,5 @@
|
|
|
39
42
|
"publishConfig": {
|
|
40
43
|
"access": "public"
|
|
41
44
|
},
|
|
42
|
-
"
|
|
43
|
-
"gitHead": "808149cc5875529a2c0b3592dc5e255796e8ece4"
|
|
45
|
+
"gitHead": "00a68ded03fea7b5f348eff0ca1d9b771f90fa75"
|
|
44
46
|
}
|