extension 2.0.0-beta.2 → 2.0.0-beta.3
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/README.md +1 -1
- package/dist/cli.js +53 -29
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ https://github.com/cezaraugusto/extension/assets/4672033/7263d368-99c4-434f-a60a
|
|
|
52
52
|
|
|
53
53
|
## Web Standards and Modern JavaScript Support
|
|
54
54
|
|
|
55
|
-
For a preview of extensions running these technologies, see documentation about [Templates](https://extension.js.org/
|
|
55
|
+
For a preview of extensions running these technologies, see documentation about [Templates](https://extension.js.org/docs/getting-started/templates).
|
|
56
56
|
|
|
57
57
|
| <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/a9e2541a-96f0-4caa-9fc9-5fc5c3e901c8" width="70"> | <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/b42c5330-9e2a-4045-99c3-1f7d264dfaf4" width="70"> | <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/f19edff3-9005-4f50-b05c-fba615896a7f" width="70"> | <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/ff64721d-d145-4213-930d-e70193f8d57e" width="70"> | <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/15f1314a-aa65-4ce2-a3f3-cf53c4f730cf" width="70"> | <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/c5f8a127-3c2a-4ceb-bb46-948cf2c8bd89" width="70"> | <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/de1082fd-7cf6-4202-8c12-a5c3cd3e5b42" width="70"> | <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/78e5fe3d-dc79-4aa2-954e-1a5973d1d9db" width="70"> | <img src="https://github.com/cezaraugusto/extension.js/assets/4672033/8807efd9-93e5-4db5-a1d2-9ac524f7ecc2" width="70"> |
|
|
58
58
|
| :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: |
|
package/dist/cli.js
CHANGED
|
@@ -117,7 +117,7 @@ var package_default = {
|
|
|
117
117
|
node: ">=18"
|
|
118
118
|
},
|
|
119
119
|
name: "extension",
|
|
120
|
-
version: "2.0.0-beta.
|
|
120
|
+
version: "2.0.0-beta.3",
|
|
121
121
|
description: "Create cross-browser extensions with no build configuration.",
|
|
122
122
|
main: "./dist/cli.js",
|
|
123
123
|
types: "./dist/cli.d.ts",
|
|
@@ -188,8 +188,8 @@ var package_default = {
|
|
|
188
188
|
// cli.ts
|
|
189
189
|
checkUpdates2(package_default);
|
|
190
190
|
var extensionJs = import_commander.program;
|
|
191
|
-
extensionJs.name(package_default.name).description(package_default.description).version(package_default.version).addHelpText("after", programHelp());
|
|
192
191
|
var vendors = (browser) => browser === "all" ? "chrome,edge,firefox".split(",") : browser.split(",");
|
|
192
|
+
extensionJs.name(package_default.name).description(package_default.description).version(package_default.version).addHelpText("after", programHelp());
|
|
193
193
|
extensionJs.command("create").arguments("<project-name|project-path>").usage("create <project-name|project-path> [options]").description("Creates a new extension.").option(
|
|
194
194
|
"-t, --template <template-name>",
|
|
195
195
|
"specify a template for the created project"
|
|
@@ -203,14 +203,11 @@ extensionJs.command("create").arguments("<project-name|project-path>").usage("cr
|
|
|
203
203
|
});
|
|
204
204
|
});
|
|
205
205
|
extensionJs.command("dev").arguments("[project-path|remote-url]").usage("dev [project-path|remote-url] [options]").description("Starts the development server (development mode)").option(
|
|
206
|
-
"-u, --user-data-dir <path-to-file | boolean>",
|
|
207
|
-
'[DEPRECATED - Use "--profile" instead] 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'
|
|
208
|
-
).option(
|
|
209
206
|
"--profile <path-to-file | boolean>",
|
|
210
207
|
"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"
|
|
211
208
|
).option(
|
|
212
|
-
"
|
|
213
|
-
"specify a browser to
|
|
209
|
+
"--browser <chrome | edge | firefox>",
|
|
210
|
+
"specify a browser to preview your extension in production mode. Defaults to `chrome`"
|
|
214
211
|
).option(
|
|
215
212
|
"--chromium-binary <path-to-binary>",
|
|
216
213
|
"specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default"
|
|
@@ -219,27 +216,37 @@ extensionJs.command("dev").arguments("[project-path|remote-url]").usage("dev [pr
|
|
|
219
216
|
"specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default"
|
|
220
217
|
).option(
|
|
221
218
|
"--polyfill [boolean]",
|
|
222
|
-
"whether or not to apply the cross-browser polyfill. Defaults to `
|
|
219
|
+
"whether or not to apply the cross-browser polyfill. Defaults to `false`"
|
|
223
220
|
).option(
|
|
224
|
-
"
|
|
225
|
-
"
|
|
221
|
+
"--open [boolean]",
|
|
222
|
+
"whether or not to open the browser automatically. Defaults to `true`"
|
|
223
|
+
).option(
|
|
224
|
+
"--starting-url <url>",
|
|
225
|
+
"specify the starting URL for the browser. Defaults to `undefined`"
|
|
226
226
|
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...devOptions }) {
|
|
227
227
|
for (const vendor of vendors(browser)) {
|
|
228
228
|
await (0, import_extension_develop.extensionDev)(pathOrRemoteUrl, {
|
|
229
|
+
...devOptions,
|
|
230
|
+
profile: devOptions.profile,
|
|
229
231
|
browser: vendor,
|
|
230
|
-
|
|
232
|
+
chromiumBinary: devOptions.chromiumBinary,
|
|
233
|
+
geckoBinary: devOptions.geckoBinary,
|
|
234
|
+
// @ts-expect-error open is a boolean
|
|
235
|
+
polyfill: devOptions.polyfill === "false" ? false : true,
|
|
236
|
+
open: devOptions.open,
|
|
237
|
+
startingUrl: devOptions.startingUrl
|
|
231
238
|
});
|
|
232
239
|
}
|
|
233
240
|
});
|
|
234
241
|
extensionJs.command("start").arguments("[project-path|remote-url]").usage("start [project-path|remote-url] [options]").description("Starts the development server (production mode)").option(
|
|
235
|
-
"-u, --user-data-dir <path-to-file | boolean>",
|
|
236
|
-
'[DEPRECATED - Use "--profile" instead] 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'
|
|
237
|
-
).option(
|
|
238
242
|
"--profile <path-to-file | boolean>",
|
|
239
243
|
"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"
|
|
240
244
|
).option(
|
|
241
|
-
"
|
|
242
|
-
"specify a browser to
|
|
245
|
+
"--browser <chrome | edge | firefox>",
|
|
246
|
+
"specify a browser to preview your extension in production mode. Defaults to `chrome`"
|
|
247
|
+
).option(
|
|
248
|
+
"--polyfill [boolean]",
|
|
249
|
+
"whether or not to apply the cross-browser polyfill. Defaults to `true`"
|
|
243
250
|
).option(
|
|
244
251
|
"--chromium-binary <path-to-binary>",
|
|
245
252
|
"specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default"
|
|
@@ -247,40 +254,50 @@ extensionJs.command("start").arguments("[project-path|remote-url]").usage("start
|
|
|
247
254
|
"--gecko-binary <path-to-binary>",
|
|
248
255
|
"specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default"
|
|
249
256
|
).option(
|
|
250
|
-
"--
|
|
251
|
-
"
|
|
252
|
-
).option(
|
|
253
|
-
"-p, --port <number>",
|
|
254
|
-
"what port should Extension.js run. Defaults to `3000`"
|
|
257
|
+
"--starting-url <url>",
|
|
258
|
+
"specify the starting URL for the browser. Defaults to `undefined`"
|
|
255
259
|
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...startOptions }) {
|
|
256
260
|
for (const vendor of vendors(browser)) {
|
|
257
261
|
await (0, import_extension_develop.extensionStart)(pathOrRemoteUrl, {
|
|
262
|
+
mode: "production",
|
|
263
|
+
profile: startOptions.profile,
|
|
258
264
|
browser: vendor,
|
|
259
|
-
|
|
265
|
+
chromiumBinary: startOptions.chromiumBinary,
|
|
266
|
+
geckoBinary: startOptions.geckoBinary,
|
|
267
|
+
startingUrl: startOptions.startingUrl
|
|
260
268
|
});
|
|
261
269
|
}
|
|
262
270
|
});
|
|
263
|
-
extensionJs.command("preview").arguments("[project-name]").usage("preview [path-to-remote-extension] [options]").description("
|
|
271
|
+
extensionJs.command("preview").arguments("[project-name]").usage("preview [path-to-remote-extension] [options]").description("Preview the extension in production mode").option(
|
|
272
|
+
"--profile <path-to-file | boolean>",
|
|
273
|
+
"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"
|
|
274
|
+
).option(
|
|
275
|
+
"--browser <chrome | edge | firefox>",
|
|
276
|
+
"specify a browser to preview your extension in production mode. Defaults to `chrome`"
|
|
277
|
+
).option(
|
|
264
278
|
"--chromium-binary <path-to-binary>",
|
|
265
279
|
"specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default"
|
|
266
280
|
).option(
|
|
267
281
|
"--gecko-binary <path-to-binary>",
|
|
268
282
|
"specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default"
|
|
269
283
|
).option(
|
|
270
|
-
"-
|
|
271
|
-
"specify
|
|
284
|
+
"--starting-url <url>",
|
|
285
|
+
"specify the starting URL for the browser. Defaults to `undefined`"
|
|
272
286
|
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...previewOptions }) {
|
|
273
287
|
for (const vendor of vendors(browser)) {
|
|
274
288
|
await (0, import_extension_develop.extensionPreview)(pathOrRemoteUrl, {
|
|
275
289
|
mode: "production",
|
|
290
|
+
profile: previewOptions.profile,
|
|
276
291
|
browser: vendor,
|
|
277
|
-
|
|
292
|
+
chromiumBinary: previewOptions.chromiumBinary,
|
|
293
|
+
geckoBinary: previewOptions.geckoBinary,
|
|
294
|
+
startingUrl: previewOptions.startingUrl
|
|
278
295
|
});
|
|
279
296
|
}
|
|
280
297
|
});
|
|
281
298
|
extensionJs.command("build").arguments("[project-name]").usage("build [path-to-remote-extension] [options]").description("Builds the extension for production").option(
|
|
282
|
-
"
|
|
283
|
-
"specify a browser to
|
|
299
|
+
"--browser <chrome | edge | firefox>",
|
|
300
|
+
"specify a browser to preview your extension in production mode. Defaults to `chrome`"
|
|
284
301
|
).option(
|
|
285
302
|
"--polyfill [boolean]",
|
|
286
303
|
"whether or not to apply the cross-browser polyfill. Defaults to `false`"
|
|
@@ -293,11 +310,18 @@ extensionJs.command("build").arguments("[project-name]").usage("build [path-to-r
|
|
|
293
310
|
).option(
|
|
294
311
|
"--zip-filename <string>",
|
|
295
312
|
"specify the name of the ZIP file. Defaults to the extension name and version"
|
|
313
|
+
).option(
|
|
314
|
+
"--silent [boolean]",
|
|
315
|
+
"whether or not to open the browser automatically. Defaults to `false`"
|
|
296
316
|
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...buildOptions }) {
|
|
297
317
|
for (const vendor of vendors(browser)) {
|
|
298
318
|
await (0, import_extension_develop.extensionBuild)(pathOrRemoteUrl, {
|
|
299
319
|
browser: vendor,
|
|
300
|
-
|
|
320
|
+
polyfill: buildOptions.polyfill,
|
|
321
|
+
zip: buildOptions.zip,
|
|
322
|
+
zipSource: buildOptions.zipSource,
|
|
323
|
+
zipFilename: buildOptions.zipFilename,
|
|
324
|
+
silent: buildOptions.silent
|
|
301
325
|
});
|
|
302
326
|
}
|
|
303
327
|
});
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
11
|
"name": "extension",
|
|
12
|
-
"version": "2.0.0-beta.
|
|
12
|
+
"version": "2.0.0-beta.3",
|
|
13
13
|
"description": "Create cross-browser extensions with no build configuration.",
|
|
14
14
|
"main": "./dist/cli.js",
|
|
15
15
|
"types": "./dist/cli.d.ts",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"semver": "^7.5.4",
|
|
50
50
|
"update-check": "^1.5.4",
|
|
51
51
|
"webextension-polyfill": "^0.12.0",
|
|
52
|
-
"extension-create": "2.0.0-beta.
|
|
53
|
-
"extension-develop": "2.0.0-beta.
|
|
52
|
+
"extension-create": "2.0.0-beta.3",
|
|
53
|
+
"extension-develop": "2.0.0-beta.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/jest": "^29.5.11",
|