@midscene/cli 1.8.8-beta-20260603024013.0 → 1.8.9

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.
@@ -2346,6 +2346,10 @@ var __webpack_modules__ = {
2346
2346
  "use strict";
2347
2347
  module.exports = require("node:path");
2348
2348
  },
2349
+ "node:url" (module) {
2350
+ "use strict";
2351
+ module.exports = require("node:url");
2352
+ },
2349
2353
  os (module) {
2350
2354
  "use strict";
2351
2355
  module.exports = require("os");
@@ -2931,15 +2935,8 @@ var __webpack_exports__ = {};
2931
2935
  const toPosixPath = (value)=>value.split(external_node_path_.sep).join('/');
2932
2936
  const toImportLiteral = (value)=>JSON.stringify(toPosixPath(value));
2933
2937
  const toVirtualModuleId = (fileStem)=>`virtual:midscene-yaml/${fileStem}.test.ts`;
2934
- const trimEdgeHyphens = (value)=>{
2935
- let start = 0;
2936
- let end = value.length;
2937
- while(start < end && 45 === value.charCodeAt(start))start += 1;
2938
- while(end > start && 45 === value.charCodeAt(end - 1))end -= 1;
2939
- return value.slice(start, end);
2940
- };
2941
2938
  const safeFileStem = (file, index)=>{
2942
- const base = trimEdgeHyphens((0, external_node_path_.basename)(file, (0, external_node_path_.extname)(file)).replace(/[^a-zA-Z0-9._-]+/g, '-'));
2939
+ const base = (0, external_node_path_.basename)(file, (0, external_node_path_.extname)(file)).replace(/[^a-zA-Z0-9._-]+/g, '-').replace(/^-+|-+$/g, '');
2943
2940
  return `${String(index + 1).padStart(3, '0')}-${base || 'case'}`;
2944
2941
  };
2945
2942
  const resolveTestName = (projectDir, yamlFile)=>{
@@ -3058,7 +3055,7 @@ defineYamlBatchTest(${JSON.stringify(testOptions, null, 2)});
3058
3055
  };
3059
3056
  }
3060
3057
  const external_node_module_namespaceObject = require("node:module");
3061
- const rstest_namespaceObject = require("@midscene/shared/rstest");
3058
+ var external_node_url_ = __webpack_require__("node:url");
3062
3059
  const requireFromCliEntry = ()=>{
3063
3060
  const entry = process.argv[1] ? (0, external_node_path_.resolve)(process.argv[1]) : (0, external_node_path_.join)(process.cwd(), 'midscene-cli.js');
3064
3061
  return (0, external_node_module_namespaceObject.createRequire)(entry);
@@ -3075,20 +3072,41 @@ defineYamlBatchTest(${JSON.stringify(testOptions, null, 2)});
3075
3072
  }
3076
3073
  const formatRunError = (error)=>error.stack || `${error.name}: ${error.message}`;
3077
3074
  async function runRstestYamlProject(options) {
3075
+ const [{ runRstest }, { rspack }] = await Promise.all([
3076
+ import("@rstest/core/api"),
3077
+ import((0, external_node_url_.pathToFileURL)(resolvePackageFromRstestCore('@rsbuild/core')).href)
3078
+ ]);
3078
3079
  const { project } = options;
3079
- const result = await (0, rstest_namespaceObject.runRstestWithVirtualModules)({
3080
- cwd: options.cwd || project.projectDir,
3080
+ const maxConcurrency = void 0 !== project.maxConcurrency ? Math.max(1, project.maxConcurrency) : void 0;
3081
+ const inlineConfig = {
3081
3082
  root: project.projectDir,
3082
3083
  include: project.include,
3083
- virtualModules: project.virtualModules,
3084
- rsbuildEntry: resolvePackageFromRstestCore('@rsbuild/core'),
3084
+ testEnvironment: 'node',
3085
3085
  testTimeout: project.testTimeout,
3086
- maxConcurrency: project.maxConcurrency,
3087
- bail: project.bail,
3088
- reporters: []
3086
+ ...void 0 !== maxConcurrency ? {
3087
+ maxConcurrency
3088
+ } : {},
3089
+ ...void 0 !== maxConcurrency ? {
3090
+ pool: {
3091
+ maxWorkers: maxConcurrency,
3092
+ minWorkers: maxConcurrency
3093
+ }
3094
+ } : {},
3095
+ ...void 0 !== project.bail ? {
3096
+ bail: project.bail
3097
+ } : {},
3098
+ reporters: [],
3099
+ tools: {
3100
+ rspack: (_config, { appendPlugins })=>{
3101
+ appendPlugins(new rspack.experiments.VirtualModulesPlugin(project.virtualModules));
3102
+ }
3103
+ }
3104
+ };
3105
+ const result = await runRstest({
3106
+ cwd: options.cwd || project.projectDir,
3107
+ inlineConfig
3089
3108
  });
3090
- const unhandledErrors = result.unhandledErrors ?? [];
3091
- if (!result.ok && 'pipe' !== options.stdio && unhandledErrors.length) console.error(unhandledErrors.map((error)=>formatRunError(error)).join('\n'));
3109
+ if (!result.ok && 'pipe' !== options.stdio && result.unhandledErrors.length) console.error(result.unhandledErrors.map((error)=>formatRunError(error)).join('\n'));
3092
3110
  return result.ok ? 0 : 1;
3093
3111
  }
3094
3112
  const createCaseOptions = (config)=>{