@isentinel/jest-roblox 0.3.7 → 0.3.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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,55 @@
1
- import { $ as loadConfig, A as formatJobSummary, B as formatResult, C as BUILD_MANIFEST_VERSION, E as readBuildManifest, F as writeGameOutput, G as manifestSchema, I as createTimingCollector, J as applyAttribution, K as readManifest, L as formatJson, M as runProjects, N as formatGameOutputNotice, P as parseGameOutput, Q as mergeCliWithConfig, R as writeJsonFile, S as buildPlace, T as emitBuildManifest, U as hashFile, V as formatTestSummary, W as MANIFEST_VERSION, X as extractJsonFromOutput, Z as parseJestOutput, _ as COVERAGE_MANIFEST_PATH, a as loadRojoTree, at as SHARED_TEST_KEYS, b as visitExpression, c as StudioBackend, ct as defineProject, d as createOpenCloudBackend, et as resolveConfig, g as COVERAGE_BUILD_MANIFEST_PATH, h as generateTestScript, i as collectStubMounts, it as ROOT_CLI_KEYS, j as formatExecuteOutput, k as formatAnnotations, l as createStudioBackend, m as buildJestArgv, n as runJestRoblox, nt as GLOBAL_TEST_KEYS, o as runTypecheck, q as writeManifest, r as runSingleOrMulti, rt as JEST_ARGV_EXCLUDED_KEYS, s as resolveAllProjects, st as defineConfig, t as getRawProjects, tt as DEFAULT_CONFIG, u as OpenCloudBackend, v as findRojoProject, w as buildManifestSchema, x as visitStatement, y as visitBlock, z as formatFailure } from "./run-Bh8G33J1.mjs";
1
+ import { $ as writeManifest, A as buildManifestSchema, B as parseGameOutput, C as COVERAGE_MANIFEST_PATH, D as visitStatement, E as visitExpression, F as formatAnnotations, G as formatFailure, H as createTimingCollector, I as formatJobSummary, K as formatResult, L as formatExecuteOutput, M as readBuildManifest, O as buildPlace, Q as readManifest, R as runProjects, S as COVERAGE_BUILD_MANIFEST_PATH, T as visitBlock, U as formatJson, V as writeGameOutput, W as writeJsonFile, X as MANIFEST_VERSION, Y as hashFile, Z as manifestSchema, _ as createOpenCloudBackend, _t as defineProject, a as collectStubMounts, at as parseCoverageEnvelope, b as buildJestArgv, c as runTypecheck, ct as loadConfig, d as resolveAllProjects, dt as GLOBAL_TEST_KEYS, et as applyAttribution, f as StudioBackend, ft as JEST_ARGV_EXCLUDED_KEYS, g as OpenCloudBackend, gt as defineConfig, h as createStudioCliBackend, i as buildImplicitProject, it as normalizeRawCoverage, j as emitBuildManifest, k as BUILD_MANIFEST_VERSION, l as cleanLeftoverStubs, lt as resolveConfig, m as StudioCliBackend, mt as SHARED_TEST_KEYS, n as runJestRoblox, nt as extractJsonFromOutput, o as loadRojoTree, ot as mergeRawCoverage, p as createStudioBackend, pt as ROOT_CLI_KEYS, q as formatTestSummary, r as runSingleOrMulti, rt as parseJestOutput, s as prepareBakedCoverage, st as mergeCliWithConfig, t as getRawProjects, u as generateProjectStubs, ut as DEFAULT_CONFIG, w as findRojoProject, x as generateTestScript, z as formatGameOutputNotice } from "./run-BM5sqclu.mjs";
2
2
  import * as path$1 from "node:path";
3
+ //#region src/artifacts/build-coverage-place.ts
4
+ const CACHE_DIR$1 = path$1.join(".jest-roblox", "cache");
5
+ /**
6
+ * Build the coverage-instrumented place **without running it** — the offline
7
+ * half of the split producer. Instruments (incrementally) and rojo-builds the
8
+ * place, bakes each project's `jest.config` stub into it so any runner that
9
+ * opens the place can discover and run the suite unaided, publishes the sibling
10
+ * Build + Coverage manifests, and hands back the place. No backend is resolved,
11
+ * no suite executes, nothing hits the network. Coverage collection is forced on
12
+ * regardless of the input config.
13
+ *
14
+ * The counterpart to `prepareArtifacts`, minus the run and the Clean Place —
15
+ * the entry point for a machine that cannot execute Roblox at all. It shares the
16
+ * `prepareBakedCoverage` seam with the run path but always bakes stubs (the run
17
+ * path skips baking for studio-cli, which injects configs at runtime), because a
18
+ * place handed to a foreign runner must be self-contained.
19
+ */
20
+ async function buildCoveragePlace(config) {
21
+ const merged = mergeCliWithConfig({}, {
22
+ ...config,
23
+ collectCoverage: true
24
+ });
25
+ const projects = await resolveProjects(merged);
26
+ const cacheRoot = path$1.resolve(merged.rootDir, CACHE_DIR$1);
27
+ cleanLeftoverStubs(projects, merged.rootDir);
28
+ generateProjectStubs(projects, merged.rootDir, cacheRoot);
29
+ const { artifacts } = prepareBakedCoverage(merged, projects, cacheRoot, true);
30
+ if (artifacts.rebuilt) emitBuildManifest(COVERAGE_BUILD_MANIFEST_PATH, artifacts);
31
+ return {
32
+ buildId: artifacts.buildId,
33
+ buildManifestPath: COVERAGE_BUILD_MANIFEST_PATH,
34
+ coverageManifestPath: COVERAGE_MANIFEST_PATH,
35
+ coveragePlace: artifacts.coveragePlace,
36
+ projects: artifacts.projects,
37
+ rebuilt: artifacts.rebuilt
38
+ };
39
+ }
40
+ /**
41
+ * Resolve the project set the place is built from, mirroring `runSingleOrMulti`
42
+ * dispatch: an explicit `projects:` config resolves through `resolveAllProjects`;
43
+ * a bare config collapses to the single implicit project derived from its luau
44
+ * roots. Type-only configs are irrelevant here — a build always instruments.
45
+ */
46
+ async function resolveProjects(config) {
47
+ const rojoTree = loadRojoTree(config);
48
+ const rawProjects = getRawProjects(config);
49
+ if (rawProjects !== void 0 && rawProjects.length > 0) return resolveAllProjects(rawProjects, config, rojoTree, config.rootDir);
50
+ return [buildImplicitProject(config, rojoTree)];
51
+ }
52
+ //#endregion
3
53
  //#region src/artifacts/prepare-artifacts.ts
4
54
  const COVERAGE_DIR = path$1.dirname(COVERAGE_BUILD_MANIFEST_PATH);
5
55
  const CLEAN_PLACE_FILE = path$1.join(COVERAGE_DIR, "clean.rbxl");
@@ -81,4 +131,4 @@ async function buildCleanPlace(config) {
81
131
  });
82
132
  }
83
133
  //#endregion
84
- export { BUILD_MANIFEST_VERSION, DEFAULT_CONFIG, GLOBAL_TEST_KEYS, JEST_ARGV_EXCLUDED_KEYS, MANIFEST_VERSION, OpenCloudBackend, ROOT_CLI_KEYS, SHARED_TEST_KEYS, StudioBackend, buildJestArgv, buildManifestSchema, manifestSchema as coverageManifestSchema, createOpenCloudBackend, createStudioBackend, defineConfig, defineProject, extractJsonFromOutput, formatAnnotations, formatExecuteOutput, formatFailure, formatGameOutputNotice, formatJobSummary, formatJson, formatResult, formatTestSummary, generateTestScript, hashFile, loadConfig, parseGameOutput, parseJestOutput, prepareArtifacts, readBuildManifest, readManifest as readCoverageManifest, resolveConfig, runJestRoblox, runProjects, runTypecheck, visitBlock, visitExpression, visitStatement, writeGameOutput, writeJsonFile };
134
+ export { BUILD_MANIFEST_VERSION, DEFAULT_CONFIG, GLOBAL_TEST_KEYS, JEST_ARGV_EXCLUDED_KEYS, MANIFEST_VERSION, OpenCloudBackend, ROOT_CLI_KEYS, SHARED_TEST_KEYS, StudioBackend, StudioCliBackend, buildCoveragePlace, buildJestArgv, buildManifestSchema, manifestSchema as coverageManifestSchema, createOpenCloudBackend, createStudioBackend, createStudioCliBackend, defineConfig, defineProject, extractJsonFromOutput, formatAnnotations, formatExecuteOutput, formatFailure, formatGameOutputNotice, formatJobSummary, formatJson, formatResult, formatTestSummary, generateTestScript, hashFile, loadConfig, mergeRawCoverage, normalizeRawCoverage, parseCoverageEnvelope, parseGameOutput, parseJestOutput, prepareArtifacts, readBuildManifest, readManifest as readCoverageManifest, resolveConfig, runJestRoblox, runProjects, runTypecheck, visitBlock, visitExpression, visitStatement, writeGameOutput, writeJsonFile };