@lowdefy/e2e-utils 5.1.0 → 5.2.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.
@@ -26,16 +26,28 @@ function generateManifest({ buildDir = '.lowdefy' }) {
26
26
  pages: {}
27
27
  };
28
28
  if (fs.existsSync(pagesDir)) {
29
- for (const pageId of fs.readdirSync(pagesDir)){
30
- const pageConfigPath = path.join(pagesDir, pageId, `${pageId}.json`);
31
- if (fs.existsSync(pageConfigPath)) {
32
- const pageConfig = JSON.parse(fs.readFileSync(pageConfigPath, 'utf-8'));
33
- manifest.pages[pageId] = extractBlockMap({
34
- pageConfig,
35
- typesBlocks: types.blocks ?? {}
36
- });
29
+ // Recursively find all .json page config files under pages/
30
+ // Page artifacts are written as pages/{pageId}.json where pageId may contain slashes.
31
+ // Skip files inside /requests/ subdirectories (those are request artifacts).
32
+ function findPageFiles(dir, prefix) {
33
+ for (const entry of fs.readdirSync(dir, {
34
+ withFileTypes: true
35
+ })){
36
+ if (entry.isDirectory()) {
37
+ if (entry.name === 'requests') continue;
38
+ findPageFiles(path.join(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
39
+ } else if (entry.isFile() && entry.name.endsWith('.json')) {
40
+ const pageId = prefix ? `${prefix}/${entry.name.replace(/\.json$/, '')}` : entry.name.replace(/\.json$/, '');
41
+ const pageConfigPath = path.join(dir, entry.name);
42
+ const pageConfig = JSON.parse(fs.readFileSync(pageConfigPath, 'utf-8'));
43
+ manifest.pages[pageId] = extractBlockMap({
44
+ pageConfig,
45
+ typesBlocks: types.blocks ?? {}
46
+ });
47
+ }
37
48
  }
38
49
  }
50
+ findPageFiles(pagesDir, '');
39
51
  }
40
52
  const manifestPath = path.join(buildDir, 'e2e-manifest.json');
41
53
  const tempPath = path.join(buildDir, `e2e-manifest.${process.pid}.tmp`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/e2e-utils",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Lowdefy E2E Testing Utilities for Playwright",
6
6
  "homepage": "https://lowdefy.com",
@@ -36,7 +36,7 @@
36
36
  "dist/*"
37
37
  ],
38
38
  "dependencies": {
39
- "@lowdefy/helpers": "5.1.0",
39
+ "@lowdefy/helpers": "5.2.0",
40
40
  "js-yaml": "4.1.0",
41
41
  "prompts": "2.4.2"
42
42
  },