extension-develop 3.8.11 → 3.8.12
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/dist/535.cjs +9 -0
- package/dist/928.cjs +54 -6
- package/dist/module.cjs +223 -7
- package/package.json +1 -1
package/dist/535.cjs
CHANGED
|
@@ -10135,6 +10135,7 @@ Set background.noDynamicEntryWarning to true to disable this warning.
|
|
|
10135
10135
|
}
|
|
10136
10136
|
}
|
|
10137
10137
|
plugin_browsers_define_property(BrowsersPlugin, "name", 'plugin-browsers');
|
|
10138
|
+
var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
|
|
10138
10139
|
function plugin_wasm_define_property(obj, key, value) {
|
|
10139
10140
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
10140
10141
|
value: value,
|
|
@@ -10264,6 +10265,14 @@ Set background.noDynamicEntryWarning to true to disable this warning.
|
|
|
10264
10265
|
manifestPath
|
|
10265
10266
|
})
|
|
10266
10267
|
];
|
|
10268
|
+
if (devOptions.noBrowser) plugins.push(new plugin_playwright.Tb({
|
|
10269
|
+
packageJsonDir,
|
|
10270
|
+
browser: devOptions.browser,
|
|
10271
|
+
mode: devOptions.mode,
|
|
10272
|
+
outputPath: primaryExtensionOutputDir,
|
|
10273
|
+
manifestPath,
|
|
10274
|
+
port: devOptions.port
|
|
10275
|
+
}));
|
|
10267
10276
|
if (!devOptions.noBrowser) plugins.push(new BrowsersPlugin({
|
|
10268
10277
|
extension: unpackedExtensionDirsToLoad,
|
|
10269
10278
|
browser: devOptions.browser,
|
package/dist/928.cjs
CHANGED
|
@@ -11,6 +11,7 @@ exports.modules = {
|
|
|
11
11
|
var core_ = __webpack_require__("@rspack/core");
|
|
12
12
|
var dev_server_ = __webpack_require__("@rspack/dev-server");
|
|
13
13
|
var external_webpack_merge_ = __webpack_require__("webpack-merge");
|
|
14
|
+
var external_fs_ = __webpack_require__("fs");
|
|
14
15
|
var external_pintor_ = __webpack_require__("pintor");
|
|
15
16
|
var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_);
|
|
16
17
|
function getLoggingPrefix(type) {
|
|
@@ -24,15 +25,49 @@ exports.modules = {
|
|
|
24
25
|
if ('info' === type) return external_pintor_default().gray('►►►');
|
|
25
26
|
return external_pintor_default().green('►►►');
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function messages_ready(mode, browser) {
|
|
28
29
|
const extensionOutput = 'firefox' === browser || 'gecko-based' === browser || 'edge' === browser ? 'Add-on' : 'Extension';
|
|
29
30
|
const b = String(browser || '');
|
|
30
31
|
const cap = b.charAt(0).toUpperCase() + b.slice(1);
|
|
31
32
|
const pretty = external_pintor_default().green('ready for ' + mode);
|
|
32
33
|
return `${getLoggingPrefix('info')} ${cap} ${extensionOutput} ${pretty}.`;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
35
|
+
function readJsonRecord(filePath) {
|
|
36
|
+
try {
|
|
37
|
+
return JSON.parse(external_fs_.readFileSync(filePath, 'utf8'));
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function capitalizeToken(value) {
|
|
43
|
+
return value.split('-').filter(Boolean).map((token)=>token.charAt(0).toUpperCase() + token.slice(1)).join('-');
|
|
44
|
+
}
|
|
45
|
+
function getExtensionVersion() {
|
|
46
|
+
return process.env.EXTENSION_DEVELOP_VERSION || process.env.EXTENSION_CLI_VERSION || (()=>{
|
|
47
|
+
try {
|
|
48
|
+
return __webpack_require__("./package.json").rE;
|
|
49
|
+
} catch {
|
|
50
|
+
return 'unknown';
|
|
51
|
+
}
|
|
52
|
+
})();
|
|
53
|
+
}
|
|
54
|
+
function browserRunnerDisabled(args) {
|
|
55
|
+
const manifest = readJsonRecord(args.manifestPath);
|
|
56
|
+
const ready = readJsonRecord(args.readyPath);
|
|
57
|
+
const browserLabel = capitalizeToken(String(args.browser || 'unknown'));
|
|
58
|
+
const runId = String(ready?.runId || '').trim();
|
|
59
|
+
const pid = Number.isInteger(ready?.pid) ? String(ready?.pid) : '';
|
|
60
|
+
const runLabel = runId ? `${external_pintor_default().gray(runId)}${pid ? ` · ${external_pintor_default().gray(`PID ${pid}`)}` : ''}` : pid ? external_pintor_default().gray(`PID ${pid}`) : external_pintor_default().gray('n/a');
|
|
61
|
+
const extensionName = String(manifest?.name || 'Extension');
|
|
62
|
+
const extensionVersion = String(manifest?.version || '').trim();
|
|
63
|
+
const extensionLabel = extensionVersion ? `${extensionName} ${extensionVersion}` : extensionName;
|
|
64
|
+
const extensionJsVersion = getExtensionVersion();
|
|
65
|
+
return [
|
|
66
|
+
` 🧩 ${external_pintor_default().brightBlue('Extension.js')} ${external_pintor_default().gray(extensionJsVersion)}`,
|
|
67
|
+
` Browser ${external_pintor_default().gray(`${browserLabel} (build-only mode)`)}`,
|
|
68
|
+
` Extension ${external_pintor_default().gray(extensionLabel)}`,
|
|
69
|
+
` Run ID ${runLabel}`
|
|
70
|
+
].join('\n');
|
|
36
71
|
}
|
|
37
72
|
function portInUse(requestedPort, newPort) {
|
|
38
73
|
return `Port: Requested port ${external_pintor_default().brightBlue(requestedPort.toString())} is in use; using ${external_pintor_default().brightBlue(newPort.toString())} instead.`;
|
|
@@ -150,7 +185,6 @@ exports.modules = {
|
|
|
150
185
|
this.basePort = basePort;
|
|
151
186
|
}
|
|
152
187
|
}
|
|
153
|
-
var external_fs_ = __webpack_require__("fs");
|
|
154
188
|
function hasDependency(projectPath, dependency) {
|
|
155
189
|
const findNearestPackageJsonDirectory = (startPath)=>{
|
|
156
190
|
let currentDirectory = startPath;
|
|
@@ -323,6 +357,7 @@ exports.modules = {
|
|
|
323
357
|
process.on('SIGHUP', cancelAndCleanup);
|
|
324
358
|
return cancelAutoExit;
|
|
325
359
|
}
|
|
360
|
+
var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
|
|
326
361
|
var webpack_config = __webpack_require__("./webpack/webpack-config.ts");
|
|
327
362
|
async function dev_server_devServer(projectStructure, devOptions) {
|
|
328
363
|
process.env.EXTENSION_BROWSER_LAUNCH_ENABLED = devOptions.noBrowser ? '0' : '1';
|
|
@@ -383,6 +418,14 @@ exports.modules = {
|
|
|
383
418
|
}
|
|
384
419
|
};
|
|
385
420
|
const compiler = (0, core_.rspack)(compilerConfig);
|
|
421
|
+
const metadata = (0, plugin_playwright.Ih)({
|
|
422
|
+
packageJsonDir,
|
|
423
|
+
browser: String(devOptions.browser || 'chromium'),
|
|
424
|
+
command: 'dev',
|
|
425
|
+
distPath: external_path_.join(packageJsonDir, 'dist', String(devOptions.browser || 'chromium')),
|
|
426
|
+
manifestPath,
|
|
427
|
+
port
|
|
428
|
+
});
|
|
386
429
|
setupCompilerHooks(compiler, portAllocation.port);
|
|
387
430
|
if (void 0 !== devOptions.port && devOptions.port !== port) console.log(portInUse(devOptions.port, port));
|
|
388
431
|
const serverConfig = {
|
|
@@ -435,10 +478,15 @@ exports.modules = {
|
|
|
435
478
|
}, START_TIMEOUT_MS);
|
|
436
479
|
await devServer.start();
|
|
437
480
|
if (startTimeout) clearTimeout(startTimeout);
|
|
438
|
-
console.log(
|
|
439
|
-
if (devOptions.noBrowser) console.log(browserRunnerDisabled(
|
|
481
|
+
console.log(messages_ready('development', devOptions.browser));
|
|
482
|
+
if (devOptions.noBrowser) console.log(browserRunnerDisabled({
|
|
483
|
+
browser: String(devOptions.browser || 'chromium'),
|
|
484
|
+
manifestPath,
|
|
485
|
+
readyPath: metadata.readyPath
|
|
486
|
+
}));
|
|
440
487
|
} catch (error) {
|
|
441
488
|
if (startTimeout) clearTimeout(startTimeout);
|
|
489
|
+
metadata.writeError('dev_server_start_failed', error instanceof Error ? error.message : String(error));
|
|
442
490
|
console.log(extensionJsRunnerError(error));
|
|
443
491
|
process.exit(1);
|
|
444
492
|
}
|
package/dist/module.cjs
CHANGED
|
@@ -3,7 +3,7 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
|
3
3
|
return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
4
|
}();
|
|
5
5
|
var __webpack_modules__ = {
|
|
6
|
-
"../../node_modules/.pnpm/immutable@5.1.
|
|
6
|
+
"../../node_modules/.pnpm/immutable@5.1.5/node_modules/immutable/dist/immutable.es.js" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
"use strict";
|
|
8
8
|
__webpack_require__.r(__webpack_exports__);
|
|
9
9
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -1416,6 +1416,9 @@ var __webpack_modules__ = {
|
|
|
1416
1416
|
function isDataStructure(value) {
|
|
1417
1417
|
return 'object' == typeof value && (isImmutable(value) || Array.isArray(value) || isPlainObject(value));
|
|
1418
1418
|
}
|
|
1419
|
+
function isProtoKey(key) {
|
|
1420
|
+
return 'string' == typeof key && ('__proto__' === key || 'constructor' === key);
|
|
1421
|
+
}
|
|
1419
1422
|
function arrCopy(arr, offset) {
|
|
1420
1423
|
offset = offset || 0;
|
|
1421
1424
|
var len = Math.max(0, arr.length - offset);
|
|
@@ -1426,7 +1429,9 @@ var __webpack_modules__ = {
|
|
|
1426
1429
|
function shallowCopy(from) {
|
|
1427
1430
|
if (Array.isArray(from)) return arrCopy(from);
|
|
1428
1431
|
var to = {};
|
|
1429
|
-
for(var key in from)if (
|
|
1432
|
+
for(var key in from)if (!isProtoKey(key)) {
|
|
1433
|
+
if (hasOwnProperty.call(from, key)) to[key] = from[key];
|
|
1434
|
+
}
|
|
1430
1435
|
return to;
|
|
1431
1436
|
}
|
|
1432
1437
|
function merge(collection) {
|
|
@@ -1464,6 +1469,7 @@ var __webpack_modules__ = {
|
|
|
1464
1469
|
if (merged === collection) merged = shallowCopy(merged);
|
|
1465
1470
|
merged.push(value);
|
|
1466
1471
|
} : function(value, key) {
|
|
1472
|
+
if (isProtoKey(key)) return;
|
|
1467
1473
|
var hasVal = hasOwnProperty.call(merged, key);
|
|
1468
1474
|
var nextVal = hasVal && merger ? merger(merged[key], value, key) : value;
|
|
1469
1475
|
if (!hasVal || nextVal !== merged[key]) {
|
|
@@ -2083,6 +2089,7 @@ var __webpack_modules__ = {
|
|
|
2083
2089
|
return collectionCopy;
|
|
2084
2090
|
}
|
|
2085
2091
|
function set(collection, key, value) {
|
|
2092
|
+
if ('string' == typeof key && isProtoKey(key)) return collection;
|
|
2086
2093
|
if (!isDataStructure(collection)) throw new TypeError('Cannot update non-data-structure value: ' + collection);
|
|
2087
2094
|
if (isImmutable(collection)) {
|
|
2088
2095
|
if (!collection.set) throw new TypeError('Cannot update immutable value without .set() method: ' + collection);
|
|
@@ -3174,6 +3181,7 @@ var __webpack_modules__ = {
|
|
|
3174
3181
|
assertNotInfinite(this.size);
|
|
3175
3182
|
var object = {};
|
|
3176
3183
|
this.__iterate(function(v, k) {
|
|
3184
|
+
if (isProtoKey(k)) return;
|
|
3177
3185
|
object[k] = v;
|
|
3178
3186
|
});
|
|
3179
3187
|
return object;
|
|
@@ -3187,6 +3195,7 @@ var __webpack_modules__ = {
|
|
|
3187
3195
|
if (isKeyed(value)) {
|
|
3188
3196
|
var result$1 = {};
|
|
3189
3197
|
value.__iterate(function(v, k) {
|
|
3198
|
+
if (isProtoKey(k)) return;
|
|
3190
3199
|
result$1[k] = toJS(v);
|
|
3191
3200
|
});
|
|
3192
3201
|
return result$1;
|
|
@@ -3976,7 +3985,7 @@ var __webpack_modules__ = {
|
|
|
3976
3985
|
function defaultConverter(k, v) {
|
|
3977
3986
|
return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
|
|
3978
3987
|
}
|
|
3979
|
-
var version1 = "5.1.
|
|
3988
|
+
var version1 = "5.1.5";
|
|
3980
3989
|
var Iterable = Collection;
|
|
3981
3990
|
},
|
|
3982
3991
|
"../../node_modules/.pnpm/sass@1.97.2/node_modules/sass/sass.dart.js" () {
|
|
@@ -127118,7 +127127,7 @@ var __webpack_modules__ = {
|
|
|
127118
127127
|
stream: __webpack_require__("stream"),
|
|
127119
127128
|
nodeModule: __webpack_require__("module"),
|
|
127120
127129
|
fs: __webpack_require__("fs"),
|
|
127121
|
-
immutable: __webpack_require__("../../node_modules/.pnpm/immutable@5.1.
|
|
127130
|
+
immutable: __webpack_require__("../../node_modules/.pnpm/immutable@5.1.5/node_modules/immutable/dist/immutable.es.js")
|
|
127122
127131
|
});
|
|
127123
127132
|
module.exports = library;
|
|
127124
127133
|
},
|
|
@@ -133062,6 +133071,193 @@ var __webpack_modules__ = {
|
|
|
133062
133071
|
};
|
|
133063
133072
|
}
|
|
133064
133073
|
},
|
|
133074
|
+
"./webpack/plugin-playwright/index.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
133075
|
+
"use strict";
|
|
133076
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
133077
|
+
Ih: ()=>createPlaywrightMetadataWriter,
|
|
133078
|
+
Tb: ()=>PlaywrightPlugin
|
|
133079
|
+
});
|
|
133080
|
+
var fs__rspack_import_0 = __webpack_require__("fs");
|
|
133081
|
+
var path__rspack_import_1 = __webpack_require__("path");
|
|
133082
|
+
var _webpack_lib_paths__rspack_import_2 = __webpack_require__("./webpack/webpack-lib/paths.ts");
|
|
133083
|
+
function _define_property(obj, key, value) {
|
|
133084
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
133085
|
+
value: value,
|
|
133086
|
+
enumerable: true,
|
|
133087
|
+
configurable: true,
|
|
133088
|
+
writable: true
|
|
133089
|
+
});
|
|
133090
|
+
else obj[key] = value;
|
|
133091
|
+
return obj;
|
|
133092
|
+
}
|
|
133093
|
+
function nowISO() {
|
|
133094
|
+
return new Date().toISOString();
|
|
133095
|
+
}
|
|
133096
|
+
function createRunId() {
|
|
133097
|
+
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
133098
|
+
}
|
|
133099
|
+
function ensureDirSync(dirPath) {
|
|
133100
|
+
try {
|
|
133101
|
+
fs__rspack_import_0.mkdirSync(dirPath, {
|
|
133102
|
+
recursive: true
|
|
133103
|
+
});
|
|
133104
|
+
} catch {}
|
|
133105
|
+
}
|
|
133106
|
+
function writeJsonAtomic(filePath, value) {
|
|
133107
|
+
try {
|
|
133108
|
+
const tmpPath = `${filePath}.tmp-${process.pid}`;
|
|
133109
|
+
fs__rspack_import_0.writeFileSync(tmpPath, JSON.stringify(value, null, 2) + '\n', 'utf-8');
|
|
133110
|
+
fs__rspack_import_0.renameSync(tmpPath, filePath);
|
|
133111
|
+
} catch {}
|
|
133112
|
+
}
|
|
133113
|
+
function getPlaywrightMetadataDir(packageJsonDir, browser) {
|
|
133114
|
+
return (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(packageJsonDir, 'dist', 'extension-js', browser));
|
|
133115
|
+
}
|
|
133116
|
+
function createPlaywrightMetadataWriter(options) {
|
|
133117
|
+
const metadataDir = getPlaywrightMetadataDir(options.packageJsonDir, options.browser);
|
|
133118
|
+
const readyPath = (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(metadataDir, 'ready.json'));
|
|
133119
|
+
const eventsPath = (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(metadataDir, 'events.ndjson'));
|
|
133120
|
+
const base = {
|
|
133121
|
+
command: options.command,
|
|
133122
|
+
browser: options.browser,
|
|
133123
|
+
runId: createRunId(),
|
|
133124
|
+
startedAt: nowISO(),
|
|
133125
|
+
distPath: options.distPath,
|
|
133126
|
+
manifestPath: options.manifestPath,
|
|
133127
|
+
port: (()=>{
|
|
133128
|
+
if ('number' == typeof options.port && Number.isFinite(options.port)) return options.port;
|
|
133129
|
+
if ('string' == typeof options.port) {
|
|
133130
|
+
const parsed = parseInt(options.port, 10);
|
|
133131
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
133132
|
+
}
|
|
133133
|
+
return null;
|
|
133134
|
+
})()
|
|
133135
|
+
};
|
|
133136
|
+
function writeReady(status, extra) {
|
|
133137
|
+
ensureDirSync(metadataDir);
|
|
133138
|
+
const payload = {
|
|
133139
|
+
...base,
|
|
133140
|
+
status,
|
|
133141
|
+
pid: process.pid,
|
|
133142
|
+
ts: nowISO(),
|
|
133143
|
+
compiledAt: extra?.compiledAt ?? null,
|
|
133144
|
+
errors: Array.isArray(extra?.errors) ? extra.errors : []
|
|
133145
|
+
};
|
|
133146
|
+
if (extra?.code) payload.code = extra.code;
|
|
133147
|
+
if (extra?.message) payload.message = extra.message;
|
|
133148
|
+
writeJsonAtomic(readyPath, payload);
|
|
133149
|
+
}
|
|
133150
|
+
function appendEvent(event) {
|
|
133151
|
+
ensureDirSync(metadataDir);
|
|
133152
|
+
try {
|
|
133153
|
+
fs__rspack_import_0.appendFileSync(eventsPath, `${JSON.stringify(event)}\n`, 'utf-8');
|
|
133154
|
+
} catch {}
|
|
133155
|
+
}
|
|
133156
|
+
return {
|
|
133157
|
+
metadataDir,
|
|
133158
|
+
readyPath,
|
|
133159
|
+
eventsPath,
|
|
133160
|
+
writeStarting () {
|
|
133161
|
+
writeReady('starting');
|
|
133162
|
+
},
|
|
133163
|
+
writeReady (compiledAt) {
|
|
133164
|
+
writeReady('ready', {
|
|
133165
|
+
compiledAt: compiledAt || nowISO()
|
|
133166
|
+
});
|
|
133167
|
+
},
|
|
133168
|
+
writeError (code, message, errors) {
|
|
133169
|
+
writeReady('error', {
|
|
133170
|
+
code,
|
|
133171
|
+
message,
|
|
133172
|
+
errors: Array.isArray(errors) ? errors : [],
|
|
133173
|
+
compiledAt: null
|
|
133174
|
+
});
|
|
133175
|
+
},
|
|
133176
|
+
appendEvent
|
|
133177
|
+
};
|
|
133178
|
+
}
|
|
133179
|
+
class PlaywrightPlugin {
|
|
133180
|
+
apply(compiler) {
|
|
133181
|
+
this.writer.writeStarting();
|
|
133182
|
+
compiler.hooks.compile.tap(PlaywrightPlugin.name, ()=>{
|
|
133183
|
+
this.writer.appendEvent({
|
|
133184
|
+
type: 'compile_start',
|
|
133185
|
+
ts: nowISO(),
|
|
133186
|
+
command: this.command,
|
|
133187
|
+
browser: this.browser
|
|
133188
|
+
});
|
|
133189
|
+
});
|
|
133190
|
+
compiler.hooks.done.tap(PlaywrightPlugin.name, (stats)=>{
|
|
133191
|
+
const durationMs = Number((stats?.compilation?.endTime || 0) - (stats?.compilation?.startTime || 0));
|
|
133192
|
+
const hasErrors = Boolean(stats?.hasErrors?.());
|
|
133193
|
+
const errorsCount = Number(Array.isArray(stats?.toJson?.({
|
|
133194
|
+
all: false,
|
|
133195
|
+
errors: true
|
|
133196
|
+
})?.errors) ? stats.toJson({
|
|
133197
|
+
all: false,
|
|
133198
|
+
errors: true
|
|
133199
|
+
}).errors.length : 0);
|
|
133200
|
+
if (hasErrors) {
|
|
133201
|
+
this.writer.appendEvent({
|
|
133202
|
+
type: 'compile_error',
|
|
133203
|
+
ts: nowISO(),
|
|
133204
|
+
command: this.command,
|
|
133205
|
+
browser: this.browser,
|
|
133206
|
+
durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
|
|
133207
|
+
errorCount: Number.isFinite(errorsCount) ? errorsCount : 1
|
|
133208
|
+
});
|
|
133209
|
+
this.writer.writeError('compile_error', 'Compilation failed', [
|
|
133210
|
+
`errors: ${String(errorsCount || 1)}`
|
|
133211
|
+
]);
|
|
133212
|
+
return;
|
|
133213
|
+
}
|
|
133214
|
+
this.writer.appendEvent({
|
|
133215
|
+
type: 'compile_success',
|
|
133216
|
+
ts: nowISO(),
|
|
133217
|
+
command: this.command,
|
|
133218
|
+
browser: this.browser,
|
|
133219
|
+
durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
|
|
133220
|
+
errorCount: 0
|
|
133221
|
+
});
|
|
133222
|
+
this.writer.writeReady(nowISO());
|
|
133223
|
+
});
|
|
133224
|
+
compiler.hooks.failed.tap(PlaywrightPlugin.name, (error)=>{
|
|
133225
|
+
this.writer.appendEvent({
|
|
133226
|
+
type: 'compile_error',
|
|
133227
|
+
ts: nowISO(),
|
|
133228
|
+
command: this.command,
|
|
133229
|
+
browser: this.browser,
|
|
133230
|
+
errorCount: 1
|
|
133231
|
+
});
|
|
133232
|
+
this.writer.writeError('compile_failed', error instanceof Error ? error.message : String(error));
|
|
133233
|
+
});
|
|
133234
|
+
compiler.hooks.watchClose.tap(PlaywrightPlugin.name, ()=>{
|
|
133235
|
+
this.writer.appendEvent({
|
|
133236
|
+
type: 'shutdown',
|
|
133237
|
+
ts: nowISO(),
|
|
133238
|
+
command: this.command,
|
|
133239
|
+
browser: this.browser
|
|
133240
|
+
});
|
|
133241
|
+
});
|
|
133242
|
+
}
|
|
133243
|
+
constructor(options){
|
|
133244
|
+
_define_property(this, "writer", void 0);
|
|
133245
|
+
_define_property(this, "command", void 0);
|
|
133246
|
+
_define_property(this, "browser", void 0);
|
|
133247
|
+
this.browser = String(options.browser || 'chromium');
|
|
133248
|
+
this.command = options.command || ('development' === options.mode ? 'dev' : 'start');
|
|
133249
|
+
this.writer = createPlaywrightMetadataWriter({
|
|
133250
|
+
packageJsonDir: options.packageJsonDir,
|
|
133251
|
+
browser: this.browser,
|
|
133252
|
+
command: this.command,
|
|
133253
|
+
distPath: options.outputPath,
|
|
133254
|
+
manifestPath: options.manifestPath,
|
|
133255
|
+
port: options.port
|
|
133256
|
+
});
|
|
133257
|
+
}
|
|
133258
|
+
}
|
|
133259
|
+
_define_property(PlaywrightPlugin, "name", 'plugin-playwright');
|
|
133260
|
+
},
|
|
133065
133261
|
"./webpack/webpack-lib/check-build-dependencies.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
133066
133262
|
"use strict";
|
|
133067
133263
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -134832,7 +135028,7 @@ var __webpack_modules__ = {
|
|
|
134832
135028
|
},
|
|
134833
135029
|
"./package.json" (module) {
|
|
134834
135030
|
"use strict";
|
|
134835
|
-
module.exports = JSON.parse('{"rE":"3.8.
|
|
135031
|
+
module.exports = JSON.parse('{"rE":"3.8.12","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","extension-from-store":"^0.1.1","firefox-location2":"3.0.0","go-git-it":"^5.1.1","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
|
|
134836
135032
|
}
|
|
134837
135033
|
};
|
|
134838
135034
|
var __webpack_module_cache__ = {};
|
|
@@ -135887,6 +136083,7 @@ var __webpack_exports__ = {};
|
|
|
135887
136083
|
process.exit(1);
|
|
135888
136084
|
}
|
|
135889
136085
|
}
|
|
136086
|
+
var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
|
|
135890
136087
|
var sanitize = __webpack_require__("./webpack/webpack-lib/sanitize.ts");
|
|
135891
136088
|
var utils = __webpack_require__("./webpack/feature-special-folders/folder-extensions/utils.ts");
|
|
135892
136089
|
function resolveCompanionExtensionDirs(opts) {
|
|
@@ -136031,17 +136228,34 @@ var __webpack_exports__ = {};
|
|
|
136031
136228
|
const browser = (0, webpack_lib_paths.YN)(previewOptions.browser || 'chrome', previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary);
|
|
136032
136229
|
const outputPath = (0, webpack_lib_paths.u2)(projectStructure, browser, previewOptions.outputPath);
|
|
136033
136230
|
const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
|
|
136231
|
+
const metadataCommand = 'start' === previewOptions.metadataCommand ? 'start' : 'preview';
|
|
136232
|
+
const metadata = (0, plugin_playwright.Ih)({
|
|
136233
|
+
packageJsonDir,
|
|
136234
|
+
browser: String(browser),
|
|
136235
|
+
command: metadataCommand,
|
|
136236
|
+
distPath,
|
|
136237
|
+
manifestPath: projectStructure.manifestPath,
|
|
136238
|
+
port: 'number' == typeof previewOptions.port ? previewOptions.port : 'string' == typeof previewOptions.port ? parseInt(previewOptions.port, 10) : null
|
|
136239
|
+
});
|
|
136240
|
+
metadata.writeStarting();
|
|
136034
136241
|
if (debug) {
|
|
136035
136242
|
console.log(messages.SG(manifestDir, packageJsonDir));
|
|
136036
136243
|
console.log(messages._A(browser, previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary));
|
|
136037
136244
|
console.log(messages.jV(outputPath, distPath));
|
|
136038
136245
|
}
|
|
136039
136246
|
const manifestAtOutput = external_path_.join(outputPath, 'manifest.json');
|
|
136040
|
-
if (!external_fs_.existsSync(manifestAtOutput))
|
|
136247
|
+
if (!external_fs_.existsSync(manifestAtOutput)) {
|
|
136248
|
+
metadata.writeError('preview_manifest_missing', `Expected manifest at ${manifestAtOutput}`);
|
|
136249
|
+
throw new Error(`Preview is run-only and does not compile.\nExpected an unpacked extension at:\n ${manifestAtOutput}\n\nRun \`extension build\` or \`extension dev\` first, or pass --output-path to an existing unpacked extension directory.`);
|
|
136250
|
+
}
|
|
136041
136251
|
const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'preview');
|
|
136042
136252
|
const browserConfig = await (0, config_loader.xY)(packageJsonDir, browser);
|
|
136043
136253
|
console.log(messages.V_(browser));
|
|
136044
|
-
if (previewOptions.noBrowser)
|
|
136254
|
+
if (previewOptions.noBrowser) {
|
|
136255
|
+
console.log(messages.k4(browser));
|
|
136256
|
+
metadata.writeReady();
|
|
136257
|
+
return;
|
|
136258
|
+
}
|
|
136045
136259
|
const safeBrowserConfig = (0, sanitize.a)(browserConfig);
|
|
136046
136260
|
const safeCommandConfig = (0, sanitize.a)(commandConfig);
|
|
136047
136261
|
const safePreviewOptions = (0, sanitize.a)(previewOptions);
|
|
@@ -136090,6 +136304,7 @@ var __webpack_exports__ = {};
|
|
|
136090
136304
|
port: merged.port,
|
|
136091
136305
|
dryRun: merged.dryRun
|
|
136092
136306
|
});
|
|
136307
|
+
metadata.writeReady();
|
|
136093
136308
|
}
|
|
136094
136309
|
async function extensionStart(pathOrRemoteUrl, startOptions) {
|
|
136095
136310
|
const projectStructure = await getProjectStructure(pathOrRemoteUrl);
|
|
@@ -136131,6 +136346,7 @@ var __webpack_exports__ = {};
|
|
|
136131
136346
|
...commandConfig,
|
|
136132
136347
|
...startOptions,
|
|
136133
136348
|
browser,
|
|
136349
|
+
metadataCommand: 'start',
|
|
136134
136350
|
geckoBinary: startOptions.geckoBinary || startOptions.firefoxBinary || browserConfig.geckoBinary || browserConfig.firefoxBinary || commandConfig.geckoBinary || commandConfig.firefoxBinary,
|
|
136135
136351
|
outputPath: distPath
|
|
136136
136352
|
});
|
package/package.json
CHANGED