@alternative-path/testlens-playwright-reporter 0.4.4 → 0.4.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alternative-path/testlens-playwright-reporter",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Universal Playwright reporter for TestLens - works with both TypeScript and JavaScript projects",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -56,6 +56,7 @@
56
56
  "dotenv": "^16.4.5",
57
57
  "form-data": "^4.0.1",
58
58
  "mime": "^4.0.4",
59
+ "pino": "^9.0.0",
59
60
  "tslib": "^2.8.1"
60
61
  },
61
62
  "engines": {
package/postinstall.js CHANGED
@@ -1,39 +1,49 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- try {
5
- // Get the parent project's node_modules/.bin directory
6
- // When installed, we are in: project/node_modules/testlens-playwright-reporter/
7
- // We need to go to: project/node_modules/.bin/
8
- const parentBinDir = path.resolve(__dirname, '..', '.bin');
9
- const localBinDir = path.resolve(__dirname, 'node_modules', '.bin');
10
-
11
- // Check if parent bin directory exists
12
- if (!fs.existsSync(parentBinDir)) {
13
- console.log('Parent .bin directory not found, skipping cross-env setup');
14
- process.exit(0);
15
- }
16
-
17
- // Check if cross-env exists in our node_modules
18
- const crossEnvCmd = process.platform === 'win32' ? 'cross-env.cmd' : 'cross-env';
19
- const crossEnvPs1 = 'cross-env.ps1';
20
- const sourceCmdPath = path.join(localBinDir, crossEnvCmd);
21
- const sourcePs1Path = path.join(localBinDir, crossEnvPs1);
22
-
23
- if (fs.existsSync(sourceCmdPath)) {
24
- const targetCmdPath = path.join(parentBinDir, crossEnvCmd);
25
-
26
- // Copy the file
27
- fs.copyFileSync(sourceCmdPath, targetCmdPath);
28
- console.log(' cross-env binary installed');
29
-
30
- // Also copy PowerShell script on Windows
31
- if (process.platform === 'win32' && fs.existsSync(sourcePs1Path)) {
32
- const targetPs1Path = path.join(parentBinDir, crossEnvPs1);
33
- fs.copyFileSync(sourcePs1Path, targetPs1Path);
34
- }
35
- }
36
- } catch (error) {
37
- // Don't fail installation if this doesn't work
38
- console.log('Note: Could not setup cross-env automatically:', error.message);
39
- }
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const pino = require('pino');
4
+
5
+ const logger = pino({
6
+ level: process.env.LOG_LEVEL || 'info',
7
+ base: null,
8
+ timestamp: false,
9
+ formatters: {
10
+ level: () => ({})
11
+ }
12
+ });
13
+
14
+ try {
15
+ // Get the parent project's node_modules/.bin directory
16
+ // When installed, we are in: project/node_modules/testlens-playwright-reporter/
17
+ // We need to go to: project/node_modules/.bin/
18
+ const parentBinDir = path.resolve(__dirname, '..', '.bin');
19
+ const localBinDir = path.resolve(__dirname, 'node_modules', '.bin');
20
+
21
+ // Check if parent bin directory exists
22
+ if (!fs.existsSync(parentBinDir)) {
23
+ logger.info('Parent .bin directory not found, skipping cross-env setup');
24
+ process.exit(0);
25
+ }
26
+
27
+ // Check if cross-env exists in our node_modules
28
+ const crossEnvCmd = process.platform === 'win32' ? 'cross-env.cmd' : 'cross-env';
29
+ const crossEnvPs1 = 'cross-env.ps1';
30
+ const sourceCmdPath = path.join(localBinDir, crossEnvCmd);
31
+ const sourcePs1Path = path.join(localBinDir, crossEnvPs1);
32
+
33
+ if (fs.existsSync(sourceCmdPath)) {
34
+ const targetCmdPath = path.join(parentBinDir, crossEnvCmd);
35
+
36
+ // Copy the file
37
+ fs.copyFileSync(sourceCmdPath, targetCmdPath);
38
+ logger.info(' cross-env binary installed');
39
+
40
+ // Also copy PowerShell script on Windows
41
+ if (process.platform === 'win32' && fs.existsSync(sourcePs1Path)) {
42
+ const targetPs1Path = path.join(parentBinDir, crossEnvPs1);
43
+ fs.copyFileSync(sourcePs1Path, targetPs1Path);
44
+ }
45
+ }
46
+ } catch (error) {
47
+ // Don't fail installation if this doesn't work
48
+ logger.info('Note: Could not setup cross-env automatically:', error.message);
49
+ }