@public-ui/visual-tests 3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0 → 3.0.2-rc.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.
- package/package.json +2 -2
- package/src/index.js +8 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/visual-tests",
|
|
3
|
-
"version": "3.0.2-
|
|
3
|
+
"version": "3.0.2-rc.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"axe-playwright": "2.1.0",
|
|
30
30
|
"portfinder": "1.0.37",
|
|
31
31
|
"serve": "14.2.4",
|
|
32
|
-
"@public-ui/sample-react": "3.0.2-
|
|
32
|
+
"@public-ui/sample-react": "3.0.2-rc.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/eslint-parser": "7.27.5",
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as crypto from 'crypto';
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import { readFile } from 'fs/promises';
|
|
4
1
|
import child_process from 'node:child_process';
|
|
5
2
|
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
4
|
+
import * as crypto from 'crypto';
|
|
5
|
+
import { readFile } from 'fs/promises';
|
|
6
|
+
import * as fs from 'fs';
|
|
6
7
|
import portfinder from 'portfinder';
|
|
7
8
|
import * as process from 'process';
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
9
|
|
|
10
10
|
const tempDir = process.env.RUNNER_TEMP || process.env.TMPDIR; // TODO: Check on Windows
|
|
11
11
|
|
|
@@ -27,14 +27,15 @@ if (!fs.existsSync(workingDir)) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const buildPath = path.join(tempDir, `kolibri-visual-testing-build-${crypto.randomUUID()}`);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const rawPackageJsonPath = new URL(path.join(workingDir, 'package.json'), import.meta.url).href;
|
|
31
|
+
const packageJsonPath = process.platform === 'win32' ? pathToFileURL(rawPackageJsonPath) : rawPackageJsonPath;
|
|
32
|
+
const packageJsonContent = await readFile(new URL(packageJsonPath, import.meta.url), 'utf8');
|
|
32
33
|
const packageJson = JSON.parse(packageJsonContent);
|
|
33
34
|
|
|
34
35
|
console.log(`
|
|
35
36
|
Building React Sample App (v${packageJson?.version ?? '#.#.#'}) …`);
|
|
36
37
|
|
|
37
|
-
const buildResult = child_process.spawnSync('pnpm', ['run', 'build', `--outDir
|
|
38
|
+
const buildResult = child_process.spawnSync('pnpm', ['run', 'build', `--outDir="${buildPath}"`], {
|
|
38
39
|
cwd: workingDir,
|
|
39
40
|
encoding: 'utf-8',
|
|
40
41
|
shell: true,
|