@rstest/core 0.6.0 → 0.6.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/LICENSE.md +0 -14
- package/dist/0~171.js +4 -6
- package/dist/0~204.js +67 -77
- package/dist/0~263.js +1423 -0
- package/dist/0~350.js +30 -373
- package/dist/0~365.js +92 -0
- package/dist/0~463.js +331 -0
- package/dist/0~470.js +382 -0
- package/dist/0~535.js +10 -0
- package/dist/0~607.js +119 -0
- package/dist/0~610.js +10 -0
- package/dist/0~673.js +10 -0
- package/dist/0~691.js +74 -82
- package/dist/0~711.js +30 -373
- package/dist/0~763.js +10 -0
- package/dist/0~764.js +13284 -0
- package/dist/0~814.js +900 -0
- package/dist/0~830.js +1130 -0
- package/dist/0~836.js +13 -21
- package/dist/0~971.js +130 -136
- package/dist/597.js +174 -0
- package/dist/603.js +41 -0
- package/dist/808.js +167 -0
- package/dist/857.js +3252 -0
- package/dist/index.js +2394 -5971
- package/dist/mockRuntimeCode.js +11 -4
- package/dist/runtime.js +60 -0
- package/dist/worker.js +155 -1389
- package/dist-types/index.d.ts +25 -3
- package/dist-types/worker.d.ts +9 -2
- package/package.json +3 -3
- package/dist/0~33.js +0 -425
- package/dist/0~414.js +0 -16
- package/dist/0~493.js +0 -126
- package/dist/0~603.js +0 -50
- package/dist/0~628.js +0 -1089
- package/dist/0~655.js +0 -11533
- package/dist/0~85.js +0 -1819
- package/dist/0~873.js +0 -1220
- package/dist/0~928.js +0 -1432
- package/dist/0~967.js +0 -99
- /package/dist/{0~928.js.LICENSE.txt → 0~263.js.LICENSE.txt} +0 -0
- /package/dist/{0~655.js.LICENSE.txt → 0~764.js.LICENSE.txt} +0 -0
package/dist/0~967.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import 'module';
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
export const __webpack_id__ = "967";
|
|
4
|
-
export const __webpack_ids__ = [
|
|
5
|
-
"967"
|
|
6
|
-
];
|
|
7
|
-
export const __webpack_modules__ = {
|
|
8
|
-
"./src/core/restart.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
10
|
-
onBeforeRestart: ()=>onBeforeRestart,
|
|
11
|
-
watchFilesForRestart: ()=>watchFilesForRestart
|
|
12
|
-
});
|
|
13
|
-
var external_node_path_ = __webpack_require__("node:path");
|
|
14
|
-
var commands = __webpack_require__("./src/cli/commands.ts");
|
|
15
|
-
var utils = __webpack_require__("./src/utils/index.ts");
|
|
16
|
-
const GLOB_REGEX = /[*?{}[\]()!@+|]/;
|
|
17
|
-
const isGlob = (str)=>GLOB_REGEX.test(str);
|
|
18
|
-
async function createChokidar(pathOrGlobs, root, options) {
|
|
19
|
-
const chokidar = await Promise.all([
|
|
20
|
-
__webpack_require__.e("928"),
|
|
21
|
-
__webpack_require__.e("414")
|
|
22
|
-
]).then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js"));
|
|
23
|
-
const watchFiles = new Set();
|
|
24
|
-
const globPatterns = pathOrGlobs.filter((pathOrGlob)=>{
|
|
25
|
-
if (isGlob(pathOrGlob)) return true;
|
|
26
|
-
watchFiles.add(pathOrGlob);
|
|
27
|
-
return false;
|
|
28
|
-
});
|
|
29
|
-
if (globPatterns.length) {
|
|
30
|
-
const { glob } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs"));
|
|
31
|
-
const files = await glob(globPatterns, {
|
|
32
|
-
cwd: root,
|
|
33
|
-
absolute: true
|
|
34
|
-
});
|
|
35
|
-
for (const file of files)watchFiles.add(file);
|
|
36
|
-
}
|
|
37
|
-
return chokidar.watch(Array.from(watchFiles), options);
|
|
38
|
-
}
|
|
39
|
-
let cleaners = [];
|
|
40
|
-
const onBeforeRestart = (cleaner)=>{
|
|
41
|
-
cleaners.push(cleaner);
|
|
42
|
-
};
|
|
43
|
-
const clearConsole = ()=>{
|
|
44
|
-
if ((0, utils.Un)() && !process.env.DEBUG) process.stdout.write('\x1B[H\x1B[2J');
|
|
45
|
-
};
|
|
46
|
-
const beforeRestart = async ({ filePath, root, clear = true })=>{
|
|
47
|
-
if (clear) clearConsole();
|
|
48
|
-
if (filePath) {
|
|
49
|
-
const filename = external_node_path_["default"].relative(root, filePath);
|
|
50
|
-
utils.vF.info(`restarting Rstest as ${utils.yW.yellow(filename)} changed\n`);
|
|
51
|
-
} else utils.vF.info('restarting Rstest...\n');
|
|
52
|
-
for (const cleaner of cleaners)await cleaner();
|
|
53
|
-
cleaners = [];
|
|
54
|
-
};
|
|
55
|
-
const restart = async ({ filePath, clear = true, options, filters, root })=>{
|
|
56
|
-
await beforeRestart({
|
|
57
|
-
filePath,
|
|
58
|
-
root,
|
|
59
|
-
clear
|
|
60
|
-
});
|
|
61
|
-
await (0, commands.a)({
|
|
62
|
-
options,
|
|
63
|
-
filters,
|
|
64
|
-
command: 'watch'
|
|
65
|
-
});
|
|
66
|
-
return true;
|
|
67
|
-
};
|
|
68
|
-
async function watchFilesForRestart({ rstest, watchOptions, options, filters }) {
|
|
69
|
-
const configFilePaths = [
|
|
70
|
-
rstest.context.configFilePath,
|
|
71
|
-
...rstest.context.projects.map((project)=>project.configFilePath)
|
|
72
|
-
].filter(Boolean);
|
|
73
|
-
if (0 === configFilePaths.length) return;
|
|
74
|
-
const root = rstest.context.rootPath;
|
|
75
|
-
const watcher = await createChokidar(configFilePaths, root, {
|
|
76
|
-
ignoreInitial: true,
|
|
77
|
-
ignorePermissionErrors: true,
|
|
78
|
-
...watchOptions
|
|
79
|
-
});
|
|
80
|
-
let restarting = false;
|
|
81
|
-
const onChange = async (filePath)=>{
|
|
82
|
-
if (restarting) return;
|
|
83
|
-
restarting = true;
|
|
84
|
-
const restarted = await restart({
|
|
85
|
-
options,
|
|
86
|
-
root,
|
|
87
|
-
filters,
|
|
88
|
-
filePath
|
|
89
|
-
});
|
|
90
|
-
if (restarted) await watcher.close();
|
|
91
|
-
else utils.vF.error('Restart failed');
|
|
92
|
-
restarting = false;
|
|
93
|
-
};
|
|
94
|
-
watcher.on('add', onChange);
|
|
95
|
-
watcher.on('change', onChange);
|
|
96
|
-
watcher.on('unlink', onChange);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
};
|
|
File without changes
|
|
File without changes
|