monocart-reporter 2.0.1 → 2.0.2

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.
@@ -100,11 +100,11 @@ const saveNetworkHtmlReport = async (reportData, _options) => {
100
100
 
101
101
  // deps
102
102
  const jsFiles = ['monocart-code-viewer', 'monocart-formatter', 'turbogrid'].map((it) => {
103
- return path.resolve(`node_modules/${it}/dist/${it}.js`);
103
+ return Util.resolveNodeModule(`${it}/dist/${it}.js`);
104
104
  });
105
105
 
106
- jsFiles.push(path.resolve(__dirname, '../../packages/monocart-common.js'));
107
- jsFiles.push(path.resolve(__dirname, '../../packages/monocart-network.js'));
106
+ jsFiles.push(Util.resolvePackage('monocart-common.js'));
107
+ jsFiles.push(Util.resolvePackage('monocart-network.js'));
108
108
 
109
109
  const options = {
110
110
  inline,
package/lib/utils/util.js CHANGED
@@ -151,6 +151,34 @@ const Util = {
151
151
  Util.initDir(assetsDir);
152
152
  },
153
153
 
154
+ resolveNodeModule: (p) => {
155
+ // same level dep
156
+ const dep = path.resolve(__dirname, '../../../', p);
157
+ if (fs.existsSync(dep)) {
158
+ return dep;
159
+ }
160
+
161
+ // root
162
+ const cwd = path.resolve('node_modules', p);
163
+ if (fs.existsSync(cwd)) {
164
+ return cwd;
165
+ }
166
+
167
+ // sub node modules
168
+ const sub = path.resolve(__dirname, '../../node_modules', p);
169
+ if (fs.existsSync(sub)) {
170
+ return sub;
171
+ }
172
+
173
+ Util.logError(`Not found module: ${p}`);
174
+
175
+ return cwd;
176
+ },
177
+
178
+ resolvePackage: (p) => {
179
+ return path.resolve(__dirname, '../packages', p);
180
+ },
181
+
154
182
  saveHtmlReport: async (options) => {
155
183
 
156
184
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-reporter",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "A playwright test reporter. Shows suites/cases/steps with tree style, markdown annotations, custom columns/formatters/data collection visitors, console logs, style tags, send email.",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -48,7 +48,7 @@
48
48
  "koa": "^2.14.2",
49
49
  "koa-static-resolver": "^1.0.4",
50
50
  "lz-utils": "^2.0.1",
51
- "monocart-coverage-reports": "^1.0.7",
51
+ "monocart-coverage-reports": "^1.0.8",
52
52
  "nodemailer": "^6.9.7",
53
53
  "open": "^9.1.0",
54
54
  "turbogrid": "^3.0.10"
@@ -61,7 +61,7 @@
61
61
  "eslint-config-plus": "^1.0.6",
62
62
  "eslint-plugin-html": "^7.1.0",
63
63
  "eslint-plugin-vue": "^9.19.2",
64
- "stylelint": "^15.11.0",
64
+ "stylelint": "^16.0.2",
65
65
  "stylelint-config-plus": "^1.0.4",
66
66
  "vine-ui": "^3.1.12"
67
67
  }