extension 3.5.0-next.0 → 3.5.0-next.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.
- package/dist/cli.cjs +41 -36
- package/package.json +3 -3
package/dist/cli.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
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
|
+
}();
|
|
2
5
|
"use strict";
|
|
3
6
|
var __webpack_modules__ = {
|
|
4
7
|
"extension-develop/package.json" (module) {
|
|
@@ -651,6 +654,38 @@ Cross-Browser Compatibility
|
|
|
651
654
|
});
|
|
652
655
|
});
|
|
653
656
|
}
|
|
657
|
+
function registerCreateCommand(program, telemetry) {
|
|
658
|
+
program.command('create').arguments('<project-name|project-path>').usage('create <project-name|project-path> [options]').description(commandDescriptions.create).option('-t, --template <template-name>', 'specify a template for the created project').action(async function(pathOrRemoteUrl, { template }) {
|
|
659
|
+
const startedAt = Date.now();
|
|
660
|
+
telemetry.track('cli_command_start', {
|
|
661
|
+
command: 'create',
|
|
662
|
+
template: template || 'default'
|
|
663
|
+
});
|
|
664
|
+
try {
|
|
665
|
+
const { extensionCreate } = await import("extension-create");
|
|
666
|
+
external_path_namespaceObject.isAbsolute(pathOrRemoteUrl) || external_path_namespaceObject.join(process.cwd(), pathOrRemoteUrl);
|
|
667
|
+
await extensionCreate(pathOrRemoteUrl, {
|
|
668
|
+
template,
|
|
669
|
+
cliVersion: getCliPackageJson().version
|
|
670
|
+
});
|
|
671
|
+
telemetry.track('cli_command_finish', {
|
|
672
|
+
command: 'create',
|
|
673
|
+
duration_ms: Date.now() - startedAt,
|
|
674
|
+
success: true,
|
|
675
|
+
exit_code: 0
|
|
676
|
+
});
|
|
677
|
+
} catch (err) {
|
|
678
|
+
telemetry.track('cli_command_finish', {
|
|
679
|
+
command: 'create',
|
|
680
|
+
duration_ms: Date.now() - startedAt,
|
|
681
|
+
success: false,
|
|
682
|
+
exit_code: 1
|
|
683
|
+
});
|
|
684
|
+
throw err;
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
const external_module_namespaceObject = require("module");
|
|
654
689
|
require("node:url");
|
|
655
690
|
function parseOptionalBoolean(value) {
|
|
656
691
|
if (void 0 === value) return true;
|
|
@@ -685,39 +720,6 @@ Cross-Browser Compatibility
|
|
|
685
720
|
process.exit(1);
|
|
686
721
|
}
|
|
687
722
|
}
|
|
688
|
-
function registerCreateCommand(program, telemetry) {
|
|
689
|
-
program.command('create').arguments('<project-name|project-path>').usage('create <project-name|project-path> [options]').description(commandDescriptions.create).option('-t, --template <template-name>', 'specify a template for the created project').option('--install [boolean]', 'whether or not to install the dependencies after creating the project (enabled by default)', parseOptionalBoolean, true).action(async function(pathOrRemoteUrl, { template, install }) {
|
|
690
|
-
const startedAt = Date.now();
|
|
691
|
-
telemetry.track('cli_command_start', {
|
|
692
|
-
command: 'create',
|
|
693
|
-
template: template || 'default',
|
|
694
|
-
install: Boolean(install)
|
|
695
|
-
});
|
|
696
|
-
try {
|
|
697
|
-
const { extensionCreate } = await import("extension-create");
|
|
698
|
-
external_path_namespaceObject.isAbsolute(pathOrRemoteUrl) || external_path_namespaceObject.join(process.cwd(), pathOrRemoteUrl);
|
|
699
|
-
await extensionCreate(pathOrRemoteUrl, {
|
|
700
|
-
template,
|
|
701
|
-
install,
|
|
702
|
-
cliVersion: getCliPackageJson().version
|
|
703
|
-
});
|
|
704
|
-
telemetry.track('cli_command_finish', {
|
|
705
|
-
command: 'create',
|
|
706
|
-
duration_ms: Date.now() - startedAt,
|
|
707
|
-
success: true,
|
|
708
|
-
exit_code: 0
|
|
709
|
-
});
|
|
710
|
-
} catch (err) {
|
|
711
|
-
telemetry.track('cli_command_finish', {
|
|
712
|
-
command: 'create',
|
|
713
|
-
duration_ms: Date.now() - startedAt,
|
|
714
|
-
success: false,
|
|
715
|
-
exit_code: 1
|
|
716
|
-
});
|
|
717
|
-
throw err;
|
|
718
|
-
}
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
723
|
function normalizeSourceOption(source, startingUrl) {
|
|
722
724
|
if (!source) return;
|
|
723
725
|
const hasExplicitSourceString = 'string' == typeof source && 'true' !== String(source).trim().toLowerCase();
|
|
@@ -740,6 +742,7 @@ Cross-Browser Compatibility
|
|
|
740
742
|
const values = String(raw).split(',').map((s)=>s.trim()).filter((s)=>s.length > 0).filter((c)=>allowed.includes(c));
|
|
741
743
|
return values.length > 0 ? values : void 0;
|
|
742
744
|
}
|
|
745
|
+
const dev_require = (0, external_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
|
|
743
746
|
function registerDevCommand(program, telemetry) {
|
|
744
747
|
program.command('dev').arguments('[project-path|remote-url]').usage('dev [project-path|remote-url] [options]').description(commandDescriptions.dev).option('--profile <path-to-file | boolean>', 'what path to use for the browser profile. A boolean value of false sets the profile to the default user profile. Defaults to a fresh profile').option('--browser <chrome | chromium | edge | firefox | chromium-based | gecko-based | firefox-based>', 'specify a browser/engine to run. Defaults to `chromium`').option('--chromium-binary <path-to-binary>', 'specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default').option('--gecko-binary, --firefox-binary <path-to-binary>', 'specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default').option('--polyfill [boolean]', 'whether or not to apply the cross-browser polyfill. Defaults to `false`').option('--no-open', 'do not open the browser automatically (default: open)').option('--no-runner', 'do not launch the browser runner (dev server still starts)').option('--starting-url <url>', 'specify the starting URL for the browser. Defaults to `undefined`').option('--port <port>', 'specify the port to use for the development server. Defaults to `8080`').option('--log-context <list>', '[experimental] comma-separated contexts to include (background,content,page,sidebar,popup,options,devtools). Use `all` to include all contexts (default)').option('--logs <off|error|warn|info|debug|trace|all>', '[experimental] minimum centralized logger level to display in terminal (default: off)').option('--log-format <pretty|json>', '[experimental] output format for logger events. Defaults to `pretty`').option('--no-log-timestamps', 'disable ISO timestamps in pretty output').option('--no-log-color', 'disable color in pretty output').option('--log-url <pattern>', '[experimental] only show logs where event.url matches this substring or regex (/re/i)').option('--log-tab <id>', 'only show logs for a specific tabId (number)').option('--source [url]', "[experimental] opens the provided URL in Chrome and prints the full, live HTML of the page after content scripts are injected").option('--install [boolean]', '[internal] install project dependencies when missing', parseOptionalBoolean).option('--author, --author-mode', '[internal] enable maintainer diagnostics (does not affect user runtime logs)').action(async function(pathOrRemoteUrl, { browser = 'chromium', ...devOptions }) {
|
|
745
748
|
if (devOptions.author || devOptions['authorMode']) {
|
|
@@ -764,7 +767,7 @@ Cross-Browser Compatibility
|
|
|
764
767
|
devOptions.source = normalizedSource;
|
|
765
768
|
devOptions.watchSource = true;
|
|
766
769
|
}
|
|
767
|
-
const { extensionDev } =
|
|
770
|
+
const { extensionDev } = dev_require('extension-develop');
|
|
768
771
|
for (const vendor of list){
|
|
769
772
|
const vendorStart = Date.now();
|
|
770
773
|
telemetry.track('cli_vendor_start', {
|
|
@@ -809,6 +812,7 @@ Cross-Browser Compatibility
|
|
|
809
812
|
});
|
|
810
813
|
});
|
|
811
814
|
}
|
|
815
|
+
const start_require = (0, external_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
|
|
812
816
|
function registerStartCommand(program, telemetry) {
|
|
813
817
|
program.command('start').arguments('[project-path|remote-url]').usage('start [project-path|remote-url] [options]').description(commandDescriptions.start).option('--profile <path-to-file | boolean>', 'what path to use for the browser profile. A boolean value of false sets the profile to the default user profile. Defaults to a fresh profile').option('--browser <chrome | chromium | edge | firefox | chromium-based | gecko-based | firefox-based>', 'specify a browser/engine to run. Defaults to `chromium`').option('--polyfill [boolean]', 'whether or not to apply the cross-browser polyfill. Defaults to `true`').option('--chromium-binary <path-to-binary>', 'specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default').option('--gecko-binary, --firefox-binary <path-to-binary>', 'specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default').option('--starting-url <url>', 'specify the starting URL for the browser. Defaults to `undefined`').option('--no-runner', 'do not launch the browser runner (build still runs)').option('--port <port>', 'specify the port to use for the development server. Defaults to `8080`').option('--log-context <list>', '[experimental] comma-separated contexts to include (background,content,page,sidebar,popup,options,devtools). Use `all` to include all contexts (default)').option('--logs <off|error|warn|info|debug|trace|all>', '[experimental] minimum centralized logger level to display in terminal (default: off)').option('--log-format <pretty|json>', '[experimental] output format for logger events. Defaults to `pretty`').option('--no-log-timestamps', 'disable ISO timestamps in pretty output').option('--no-log-color', 'disable color in pretty output').option('--log-url <pattern>', '[experimental] only show logs where event.url matches this substring or regex (/re/i)').option('--log-tab <id>', 'only show logs for a specific tabId (number)').option('--source [url]', "[experimental] opens the provided URL in Chrome and prints the full, live HTML of the page after content scripts are injected").option('--install [boolean]', '[experimental] install project dependencies when missing', parseOptionalBoolean).option('--author, --author-mode', '[experimental] enable maintainer diagnostics (does not affect user runtime logs)').action(async function(pathOrRemoteUrl, { browser = 'chromium', ...startOptions }) {
|
|
814
818
|
if (startOptions.author || startOptions.authorMode) {
|
|
@@ -825,7 +829,7 @@ Cross-Browser Compatibility
|
|
|
825
829
|
validateVendorsOrExit(list, (invalid, supported)=>{
|
|
826
830
|
console.error(unsupportedBrowserFlag(invalid, supported));
|
|
827
831
|
});
|
|
828
|
-
const { extensionStart } =
|
|
832
|
+
const { extensionStart } = start_require('extension-develop');
|
|
829
833
|
for (const vendor of list){
|
|
830
834
|
const vendorStart = Date.now();
|
|
831
835
|
telemetry.track('cli_vendor_start', {
|
|
@@ -869,6 +873,7 @@ Cross-Browser Compatibility
|
|
|
869
873
|
});
|
|
870
874
|
});
|
|
871
875
|
}
|
|
876
|
+
const preview_require = (0, external_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
|
|
872
877
|
function registerPreviewCommand(program, telemetry) {
|
|
873
878
|
program.command('preview').arguments('[project-name]').usage('preview [path-to-remote-extension] [options]').description(commandDescriptions.preview).option('--profile <path-to-file | boolean>', 'what path to use for the browser profile. A boolean value of false sets the profile to the default user profile. Defaults to a fresh profile').option('--browser <chrome | chromium | edge | firefox | chromium-based | gecko-based | firefox-based>', 'specify a browser/engine to run. Defaults to `chromium`').option('--chromium-binary <path-to-binary>', 'specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default').option('--gecko-binary, --firefox-binary <path-to-binary>', 'specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default').option('--starting-url <url>', 'specify the starting URL for the browser. Defaults to `undefined`').option('--no-runner', 'do not launch the browser runner').option('--port <port>', 'specify the port to use for the development server. Defaults to `8080`').option('--log-context <list>', '[experimental] comma-separated contexts to include (background,content,page,sidebar,popup,options,devtools). Use `all` to include all contexts (default)').option('--logs <off|error|warn|info|debug|trace|all>', '[experimental] minimum centralized logger level to display in terminal (default: off)').option('--log-format <pretty|json>', '[experimental] output format for logger events. Defaults to `pretty`').option('--no-log-timestamps', 'disable ISO timestamps in pretty output').option('--no-log-color', 'disable color in pretty output').option('--log-url <pattern>', '[experimental] only show logs where event.url matches this substring or regex (/re/i)').option('--log-tab <id>', 'only show logs for a specific tabId (number)').option('--source [url]', "[experimental] opens the provided URL in Chrome and prints the full, live HTML of the page after content scripts are injected").option('--author, --author-mode', '[internal] enable maintainer diagnostics (does not affect user runtime logs)').action(async function(pathOrRemoteUrl, { browser = 'chromium', ...previewOptions }) {
|
|
874
879
|
if (previewOptions.author || previewOptions['authorMode']) {
|
|
@@ -888,7 +893,7 @@ Cross-Browser Compatibility
|
|
|
888
893
|
const isRemote = 'string' == typeof pathOrRemoteUrl && /^https?:/i.test(pathOrRemoteUrl);
|
|
889
894
|
if (isRemote) process.env.EXTJS_LIGHT = '1';
|
|
890
895
|
}
|
|
891
|
-
const { extensionPreview } =
|
|
896
|
+
const { extensionPreview } = preview_require('extension-develop');
|
|
892
897
|
for (const vendor of list){
|
|
893
898
|
const vendorStart = Date.now();
|
|
894
899
|
telemetry.track('cli_vendor_start', {
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"extension": "./bin/extension.cjs"
|
|
34
34
|
},
|
|
35
35
|
"name": "extension",
|
|
36
|
-
"version": "3.5.0-next.
|
|
36
|
+
"version": "3.5.0-next.2",
|
|
37
37
|
"description": "Create cross-browser extensions with no build configuration.",
|
|
38
38
|
"homepage": "https://extension.js.org/",
|
|
39
39
|
"bugs": {
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"@types/chrome": "^0.1.33",
|
|
91
91
|
"@types/node": "^25.0.9",
|
|
92
92
|
"@types/webextension-polyfill": "0.12.4",
|
|
93
|
-
"extension-create": "^3.5.0-next.
|
|
94
|
-
"extension-develop": "^3.5.0-next.
|
|
93
|
+
"extension-create": "^3.5.0-next.2",
|
|
94
|
+
"extension-develop": "^3.5.0-next.2",
|
|
95
95
|
"commander": "^14.0.2",
|
|
96
96
|
"pintor": "0.3.0",
|
|
97
97
|
"semver": "^7.7.3",
|