@allurereport/static-server 3.21.0 → 3.22.0
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 +18 -5
- package/package.json +13 -11
package/dist/index.js
CHANGED
|
@@ -162,10 +162,11 @@ export const serve = async (options) => {
|
|
|
162
162
|
})
|
|
163
163
|
: identity;
|
|
164
164
|
const serverUrl = resolveServerUrl(host, serverPort);
|
|
165
|
-
console.info(`Allure is running on ${serverUrl}
|
|
165
|
+
console.info(`Allure is running on ${serverUrl}. Press CTRL+C to stop.`);
|
|
166
166
|
if (open) {
|
|
167
167
|
openUrl(serverUrl);
|
|
168
168
|
}
|
|
169
|
+
let stopPromise;
|
|
169
170
|
return {
|
|
170
171
|
url: serverUrl,
|
|
171
172
|
port: serverPort,
|
|
@@ -179,10 +180,22 @@ export const serve = async (options) => {
|
|
|
179
180
|
}
|
|
180
181
|
await openUrl(url);
|
|
181
182
|
},
|
|
182
|
-
stop:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
stop: () => {
|
|
184
|
+
stopPromise ?? (stopPromise = (async () => {
|
|
185
|
+
const closed = new Promise((resolve, reject) => {
|
|
186
|
+
server.close((err) => {
|
|
187
|
+
if (err) {
|
|
188
|
+
reject(err);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
resolve();
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
server.closeAllConnections();
|
|
196
|
+
await Promise.all([closed, unwatch()]);
|
|
197
|
+
})());
|
|
198
|
+
return stopPromise;
|
|
186
199
|
},
|
|
187
200
|
};
|
|
188
201
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/static-server",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.0",
|
|
4
4
|
"description": "Minimalistic web-server for serving static files",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -25,23 +25,23 @@
|
|
|
25
25
|
"build": "run clean && tsc --project ./tsconfig.json",
|
|
26
26
|
"clean": "rimraf ./dist",
|
|
27
27
|
"pretest": "rimraf ./out && playwright install chromium",
|
|
28
|
-
"test": "run
|
|
29
|
-
"test:unit": "
|
|
28
|
+
"test": "rimraf out && run test:unit && run test:e2e",
|
|
29
|
+
"test:unit": "vp test run",
|
|
30
30
|
"test:e2e": "playwright test",
|
|
31
|
-
"lint": "
|
|
32
|
-
"lint:fix": "
|
|
31
|
+
"lint": "vp lint --import-plugin src test features stories",
|
|
32
|
+
"lint:fix": "vp lint --import-plugin --fix src test features stories"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@allurereport/directory-watcher": "3.
|
|
35
|
+
"@allurereport/directory-watcher": "3.22.0",
|
|
36
36
|
"open": "^11.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@allurereport/
|
|
40
|
-
"@playwright/test": "
|
|
39
|
+
"@allurereport/common-config": "3.22.0",
|
|
40
|
+
"@playwright/test": "1.62.1",
|
|
41
41
|
"@types/node": "^20",
|
|
42
|
-
"@vitest/coverage-istanbul": "
|
|
42
|
+
"@vitest/coverage-istanbul": "5.0.4",
|
|
43
43
|
"@vitest/runner": "^2",
|
|
44
|
-
"@vitest/snapshot": "
|
|
44
|
+
"@vitest/snapshot": "5.0.4",
|
|
45
45
|
"allure-js-commons": "^3",
|
|
46
46
|
"allure-playwright": "^3.10.2",
|
|
47
47
|
"allure-vitest": "^3",
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
"npm-run-all2": "^7.0.1",
|
|
51
51
|
"rimraf": "^6",
|
|
52
52
|
"typescript": "^5",
|
|
53
|
-
"
|
|
53
|
+
"vite": "@voidzero-dev/vite-plus-core@1.2.0",
|
|
54
|
+
"vite-plus": "1.2.0",
|
|
55
|
+
"vitest": "5.0.4"
|
|
54
56
|
}
|
|
55
57
|
}
|