@arcadialdev/arcality 2.2.8 → 2.2.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/package.json +1 -1
- package/scripts/gen-and-run.mjs +18 -3
package/package.json
CHANGED
package/scripts/gen-and-run.mjs
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import 'dotenv/config';
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
|
+
import { createRequire } from 'node:module';
|
|
9
10
|
import { spawn, exec } from "node:child_process";
|
|
10
11
|
import chalk from "chalk";
|
|
11
12
|
import { fileURLToPath } from 'url';
|
|
@@ -711,9 +712,23 @@ async function main() {
|
|
|
711
712
|
console.log(chalk.gray(`\n>> ARCALITY_PROJECT_ID: ${finalProjectId}`));
|
|
712
713
|
}
|
|
713
714
|
|
|
714
|
-
//
|
|
715
|
-
//
|
|
716
|
-
|
|
715
|
+
// Resolve playwright CLI using Node's module resolution algorithm.
|
|
716
|
+
// This handles BOTH cases:
|
|
717
|
+
// - Global install: playwright is inside arcality's own node_modules
|
|
718
|
+
// - Local install: playwright is hoisted to the project's root node_modules
|
|
719
|
+
let playwrightCli;
|
|
720
|
+
try {
|
|
721
|
+
const arcalityRequire = createRequire(path.join(PROJECT_ROOT, 'package.json'));
|
|
722
|
+
playwrightCli = arcalityRequire.resolve('playwright/cli');
|
|
723
|
+
} catch {
|
|
724
|
+
// Fallback: try local hoisted path (project_root/../../playwright)
|
|
725
|
+
const hoistedPath = path.join(PROJECT_ROOT, '..', '..', 'playwright', 'cli.js');
|
|
726
|
+
if (fs.existsSync(hoistedPath)) {
|
|
727
|
+
playwrightCli = hoistedPath;
|
|
728
|
+
} else {
|
|
729
|
+
playwrightCli = path.join(PROJECT_ROOT, 'node_modules', 'playwright', 'cli.js');
|
|
730
|
+
}
|
|
731
|
+
}
|
|
717
732
|
const configFile = path.join(PROJECT_ROOT, 'playwright.config.ts');
|
|
718
733
|
|
|
719
734
|
try {
|