extension 3.0.0-next.28 → 3.0.0-next.29
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/cli.js +44 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -23,7 +23,7 @@ var __webpack_require__ = {};
|
|
|
23
23
|
})();
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
const external_commander_namespaceObject = require("commander");
|
|
26
|
-
var package_namespaceObject = JSON.parse('{"license":"MIT","repository":{"type":"git","url":"git+https://github.com/extension-js/extension.js.git","directory":"programs/cli"},"engines":{"node":">=18"},"exports":{".":{"types":"./dist/cli.d.ts","import":"./dist/cli.js","require":"./dist/cli.js"}},"main":"./dist/cli.js","types":"./dist/cli.d.ts","typesVersions":{"*":{"types":["./types/index.d.ts"],"types/*":["./types/*"]}},"files":["dist","types"],"bin":{"extension":"./dist/cli.js"},"name":"extension","version":"3.0.0-next.
|
|
26
|
+
var package_namespaceObject = JSON.parse('{"license":"MIT","repository":{"type":"git","url":"git+https://github.com/extension-js/extension.js.git","directory":"programs/cli"},"engines":{"node":">=18"},"exports":{".":{"types":"./dist/cli.d.ts","import":"./dist/cli.js","require":"./dist/cli.js"}},"main":"./dist/cli.js","types":"./dist/cli.d.ts","typesVersions":{"*":{"types":["./types/index.d.ts"],"types/*":["./types/*"]}},"files":["dist","types"],"bin":{"extension":"./dist/cli.js"},"name":"extension","version":"3.0.0-next.29","description":"Create cross-browser extensions with no build configuration.","homepage":"https://extension.js.org/","author":{"name":"Cezar Augusto","email":"boss@cezaraugusto.net","url":"https://cezaraugusto.com"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"prepare":"rslib build >/dev/null 2>&1 || true","postinstall":"rslib build >/dev/null 2>&1 || true","compile":"rslib build","watch":"rslib build --watch","test":"vitest run"},"keywords":["zero-config","build","develop","browser","extension","chrome extension","edge extension","firefox extension","safari extension","web","react","typescript","webextension","browser-extension","chrome-extension","firefox-addon","edge-extension","safari-web-extension","manifest-v3","mv3","cross-browser","content-script","background-script","devtools","create-extension","scaffold","starter-template","boilerplate","cli"],"dependencies":{"commander":"^12.1.0","extension-create":"^2.2.0","pintor":"0.3.0","semver":"^7.6.3","update-check":"^1.5.4"},"devDependencies":{"@rslib/core":"^0.6.9","@types/chrome":"^0.0.287","@types/node":"^22.10.1","@types/react":"^19.0.1","@types/react-dom":"^19.0.1","@types/webextension-polyfill":"0.12.3","@types/mock-fs":"^4.13.4","@types/semver":"^7.5.8","mock-fs":"^5.4.1","webextension-polyfill":"^0.12.0","tsconfig":"*","typescript":"5.7.2","vitest":"^3.2.4"}}');
|
|
27
27
|
const external_update_check_namespaceObject = require("update-check");
|
|
28
28
|
var external_update_check_default = /*#__PURE__*/ __webpack_require__.n(external_update_check_namespaceObject);
|
|
29
29
|
const external_pintor_namespaceObject = require("pintor");
|
|
@@ -520,6 +520,14 @@ async function requireOrDlx(moduleName, versionHint) {
|
|
|
520
520
|
const spec = versionHint ? `${moduleName}@${versionHint}` : moduleName;
|
|
521
521
|
const cacheDir = external_node_path_default().join(external_node_os_default().tmpdir(), 'extensionjs-cache', spec);
|
|
522
522
|
const modulePath = external_node_path_default().join(cacheDir, 'node_modules', moduleName);
|
|
523
|
+
try {
|
|
524
|
+
const localDist = external_node_path_default().resolve(__dirname, '..', '..', 'develop', 'dist', 'module.js');
|
|
525
|
+
if (external_node_fs_default().existsSync(localDist)) return await import((0, external_node_url_namespaceObject.pathToFileURL)(localDist).href);
|
|
526
|
+
} catch {}
|
|
527
|
+
try {
|
|
528
|
+
const cwdDist = external_node_path_default().resolve(process.cwd(), 'programs', 'develop', 'dist', 'module.js');
|
|
529
|
+
if (external_node_fs_default().existsSync(cwdDist)) return await import((0, external_node_url_namespaceObject.pathToFileURL)(cwdDist).href);
|
|
530
|
+
} catch {}
|
|
523
531
|
let prefer = String(process.env.EXTENSION_DLX || '').trim().toLowerCase();
|
|
524
532
|
const isWin = 'win32' === process.platform;
|
|
525
533
|
const npmCmd = isWin ? 'npm.cmd' : 'npm';
|
|
@@ -591,6 +599,37 @@ async function requireOrDlx(moduleName, versionHint) {
|
|
|
591
599
|
stdio: 'ignore'
|
|
592
600
|
}).status || 0;
|
|
593
601
|
}
|
|
602
|
+
if (0 !== status) {
|
|
603
|
+
try {
|
|
604
|
+
external_node_fs_default().writeFileSync(external_node_path_default().join(cacheDir, 'package.json'), JSON.stringify({
|
|
605
|
+
name: 'extensionjs-cache',
|
|
606
|
+
private: true
|
|
607
|
+
}, null, 2));
|
|
608
|
+
} catch {}
|
|
609
|
+
if ('pnpm' !== prefer) {
|
|
610
|
+
const args = [
|
|
611
|
+
'add',
|
|
612
|
+
spec,
|
|
613
|
+
'--reporter',
|
|
614
|
+
'silent',
|
|
615
|
+
'--no-frozen-lockfile'
|
|
616
|
+
];
|
|
617
|
+
status = (0, external_node_child_process_namespaceObject.spawnSync)(pnpmCmd, args, {
|
|
618
|
+
cwd: cacheDir,
|
|
619
|
+
stdio: 'ignore'
|
|
620
|
+
}).status || 0;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
if (0 !== status && 'bun' !== prefer) {
|
|
624
|
+
const args = [
|
|
625
|
+
'add',
|
|
626
|
+
spec
|
|
627
|
+
];
|
|
628
|
+
status = (0, external_node_child_process_namespaceObject.spawnSync)(bunCmd, args, {
|
|
629
|
+
cwd: cacheDir,
|
|
630
|
+
stdio: 'ignore'
|
|
631
|
+
}).status || 0;
|
|
632
|
+
}
|
|
594
633
|
if (0 !== status) throw new Error(`Failed to install ${spec}`);
|
|
595
634
|
try {
|
|
596
635
|
var _pkgJson_exports_2, _pkgJson_exports2, _pkgJson_exports_3, _pkgJson_exports3;
|
|
@@ -968,7 +1007,10 @@ if (process.argv.length <= 2) {
|
|
|
968
1007
|
extensionJs.outputHelp();
|
|
969
1008
|
process.exit(0);
|
|
970
1009
|
}
|
|
971
|
-
extensionJs.
|
|
1010
|
+
extensionJs.parseAsync().catch((err)=>{
|
|
1011
|
+
console.error(err);
|
|
1012
|
+
process.exit(1);
|
|
1013
|
+
});
|
|
972
1014
|
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
973
1015
|
Object.defineProperty(exports, '__esModule', {
|
|
974
1016
|
value: true
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"extension": "./dist/cli.js"
|
|
36
36
|
},
|
|
37
37
|
"name": "extension",
|
|
38
|
-
"version": "3.0.0-next.
|
|
38
|
+
"version": "3.0.0-next.29",
|
|
39
39
|
"description": "Create cross-browser extensions with no build configuration.",
|
|
40
40
|
"homepage": "https://extension.js.org/",
|
|
41
41
|
"author": {
|