extension 2.0.0-alpha.9 → 2.0.0-beta.1
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.d.ts +1 -0
- package/dist/cli.js +41 -18
- package/package.json +22 -20
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -22,8 +22,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
23
|
mod
|
|
24
24
|
));
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
26
|
|
|
26
27
|
// cli.ts
|
|
28
|
+
var cli_exports = {};
|
|
29
|
+
module.exports = __toCommonJS(cli_exports);
|
|
27
30
|
var import_commander = require("commander");
|
|
28
31
|
var import_extension_create = require("extension-create");
|
|
29
32
|
var import_extension_develop = require("extension-develop");
|
|
@@ -45,37 +48,37 @@ Please update to the latest version to enjoy new features and improvements.
|
|
|
45
48
|
}
|
|
46
49
|
function programHelp() {
|
|
47
50
|
return `\u{1F9E9}
|
|
48
|
-
${(0, import_safe.
|
|
51
|
+
${(0, import_safe.underline)("Help center for the Extension.js program")}
|
|
49
52
|
|
|
50
53
|
${(0, import_safe.brightYellow)("Usage:")} extension [command] [options]
|
|
51
54
|
|
|
52
|
-
${(0, import_safe.
|
|
55
|
+
${(0, import_safe.brightYellow)("Note:")} If you are looking for a specific list of options,
|
|
53
56
|
all high-level commands offer their own \`--help\` file with
|
|
54
57
|
information about usage and a list of command flags available.
|
|
55
58
|
|
|
56
59
|
For example:
|
|
57
60
|
|
|
58
|
-
${(0, import_safe.
|
|
59
|
-
outputs information about the
|
|
61
|
+
${(0, import_safe.brightGreen)("extension create --help")}
|
|
62
|
+
outputs information about the "create" command.
|
|
60
63
|
|
|
61
64
|
Options available:
|
|
62
65
|
|
|
63
|
-
${(0, import_safe.
|
|
66
|
+
${(0, import_safe.brightGreen)("extension create <extension-name>")}
|
|
64
67
|
Creates a new extension from a template. The "create" command
|
|
65
68
|
is optional and can be omitted.
|
|
66
69
|
|
|
67
|
-
${(0, import_safe.
|
|
70
|
+
${(0, import_safe.brightGreen)("extension dev <extension-path>")}
|
|
68
71
|
Starts a new browser instance in development mode, with the target
|
|
69
72
|
extension loaded and auto-reloaded based on file changes.
|
|
70
73
|
|
|
71
|
-
${(0, import_safe.
|
|
74
|
+
${(0, import_safe.brightGreen)("extension start <extension-path>")}
|
|
72
75
|
Starts a new browser instance in production mode, with the target
|
|
73
76
|
extension compiled based on the browser choice.
|
|
74
77
|
|
|
75
|
-
${(0, import_safe.
|
|
78
|
+
${(0, import_safe.brightGreen)("extension build <extension-path>")}
|
|
76
79
|
Builds the target extension with browser defaults, ready for packaging.
|
|
77
80
|
|
|
78
|
-
${(0, import_safe.
|
|
81
|
+
${(0, import_safe.brightGreen)("extension --help")}
|
|
79
82
|
This command ;) Outputs a help file with key command options.
|
|
80
83
|
|
|
81
84
|
${(0, import_safe.brightYellow)("Feels something is wrong? Help by reporting a bug:")}
|
|
@@ -114,7 +117,7 @@ var package_default = {
|
|
|
114
117
|
node: ">=18"
|
|
115
118
|
},
|
|
116
119
|
name: "extension",
|
|
117
|
-
version: "2.0.0-
|
|
120
|
+
version: "2.0.0-beta.1",
|
|
118
121
|
description: "Create cross-browser extensions with no build configuration.",
|
|
119
122
|
main: "./dist/cli.js",
|
|
120
123
|
types: "./dist/cli.d.ts",
|
|
@@ -131,13 +134,13 @@ var package_default = {
|
|
|
131
134
|
url: "https://cezaraugusto.com"
|
|
132
135
|
},
|
|
133
136
|
scripts: {
|
|
134
|
-
watch: "
|
|
137
|
+
watch: "pnpm compile --watch",
|
|
135
138
|
"compile:types": "bash install_scripts.sh",
|
|
136
139
|
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
137
140
|
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
138
141
|
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
139
142
|
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
140
|
-
compile: "
|
|
143
|
+
compile: "pnpm compile:readme-files && pnpm compile:tailwind-config && pnpm compile:stylelint-config && pnpm compile:cli && pnpm compile:types",
|
|
141
144
|
clean: "rm -rf dist",
|
|
142
145
|
test: 'echo "Note: no test specified" && exit 0',
|
|
143
146
|
"test:cli": "jest __spec__/cli.spec.ts"
|
|
@@ -156,12 +159,15 @@ var package_default = {
|
|
|
156
159
|
"typescript"
|
|
157
160
|
],
|
|
158
161
|
dependencies: {
|
|
159
|
-
"@types/node": "^20.11.5",
|
|
160
|
-
"@types/chrome": "^0.0.268",
|
|
161
162
|
"@colors/colors": "^1.6.0",
|
|
162
|
-
"
|
|
163
|
-
"
|
|
163
|
+
"@types/chrome": "^0.0.270",
|
|
164
|
+
"@types/firefox-webext-browser": "^120.0.4",
|
|
165
|
+
"@types/node": "^22.5.3",
|
|
166
|
+
"@types/react": "^18.3.5",
|
|
167
|
+
"@types/react-dom": "^18.2.18",
|
|
164
168
|
commander: "^11.1.0",
|
|
169
|
+
"extension-create": "workspace:*",
|
|
170
|
+
"extension-develop": "workspace:*",
|
|
165
171
|
semver: "^7.5.4",
|
|
166
172
|
"update-check": "^1.5.4",
|
|
167
173
|
"webextension-polyfill": "^0.12.0"
|
|
@@ -169,7 +175,6 @@ var package_default = {
|
|
|
169
175
|
devDependencies: {
|
|
170
176
|
"@types/jest": "^29.5.11",
|
|
171
177
|
"@types/mock-fs": "^4.13.4",
|
|
172
|
-
"@types/node": "^20.11.5",
|
|
173
178
|
"@types/semver": "^7.5.6",
|
|
174
179
|
jest: "^29.7.0",
|
|
175
180
|
"mock-fs": "^5.2.0",
|
|
@@ -199,16 +204,25 @@ extensionJs.command("create").arguments("<project-name|project-path>").usage("cr
|
|
|
199
204
|
});
|
|
200
205
|
extensionJs.command("dev").arguments("[project-path|remote-url]").usage("dev [project-path|remote-url] [options]").description("Starts the development server (development mode)").option(
|
|
201
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
|
+
"--profile <path-to-file | boolean>",
|
|
202
210
|
"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"
|
|
203
211
|
).option(
|
|
204
212
|
"-b, --browser <chrome | edge | firefox>",
|
|
205
213
|
"specify a browser to run your extension in development mode"
|
|
214
|
+
).option(
|
|
215
|
+
"--chromium-binary <path-to-binary>",
|
|
216
|
+
"specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default"
|
|
217
|
+
).option(
|
|
218
|
+
"--gecko-binary <path-to-binary>",
|
|
219
|
+
"specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default"
|
|
206
220
|
).option(
|
|
207
221
|
"--polyfill [boolean]",
|
|
208
222
|
"whether or not to apply the cross-browser polyfill. Defaults to `true`"
|
|
209
223
|
).option(
|
|
210
224
|
"-p, --port <number>",
|
|
211
|
-
"what port should Extension.js run. Defaults to `
|
|
225
|
+
"what port should Extension.js WebSocket server run. Defaults to `8000`"
|
|
212
226
|
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...devOptions }) {
|
|
213
227
|
for (const vendor of vendors(browser)) {
|
|
214
228
|
await (0, import_extension_develop.extensionDev)(pathOrRemoteUrl, {
|
|
@@ -219,10 +233,19 @@ extensionJs.command("dev").arguments("[project-path|remote-url]").usage("dev [pr
|
|
|
219
233
|
});
|
|
220
234
|
extensionJs.command("start").arguments("[project-path|remote-url]").usage("start [project-path|remote-url] [options]").description("Starts the development server (production mode)").option(
|
|
221
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
|
+
"--profile <path-to-file | boolean>",
|
|
222
239
|
"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"
|
|
223
240
|
).option(
|
|
224
241
|
"-b, --browser <chrome | edge | firefox>",
|
|
225
242
|
"specify a browser to run your extension in development mode"
|
|
243
|
+
).option(
|
|
244
|
+
"--chromium-binary <path-to-binary>",
|
|
245
|
+
"specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default"
|
|
246
|
+
).option(
|
|
247
|
+
"--gecko-binary <path-to-binary>",
|
|
248
|
+
"specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default"
|
|
226
249
|
).option(
|
|
227
250
|
"--polyfill [boolean]",
|
|
228
251
|
"whether or not to apply the cross-browser polyfill. Defaults to `true`"
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
11
|
"name": "extension",
|
|
12
|
-
"version": "2.0.0-
|
|
12
|
+
"version": "2.0.0-beta.1",
|
|
13
13
|
"description": "Create cross-browser extensions with no build configuration.",
|
|
14
14
|
"main": "./dist/cli.js",
|
|
15
15
|
"types": "./dist/cli.d.ts",
|
|
@@ -25,18 +25,6 @@
|
|
|
25
25
|
"email": "boss@cezaraugusto.net",
|
|
26
26
|
"url": "https://cezaraugusto.com"
|
|
27
27
|
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"watch": "yarn compile --watch",
|
|
30
|
-
"compile:types": "bash install_scripts.sh",
|
|
31
|
-
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
32
|
-
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
33
|
-
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
34
|
-
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
35
|
-
"compile": "yarn compile:readme-files && yarn compile:tailwind-config && yarn compile:stylelint-config && yarn compile:cli && yarn compile:types",
|
|
36
|
-
"clean": "rm -rf dist",
|
|
37
|
-
"test": "echo \"Note: no test specified\" && exit 0",
|
|
38
|
-
"test:cli": "jest __spec__/cli.spec.ts"
|
|
39
|
-
},
|
|
40
28
|
"keywords": [
|
|
41
29
|
"zero-config",
|
|
42
30
|
"build",
|
|
@@ -51,20 +39,22 @@
|
|
|
51
39
|
"typescript"
|
|
52
40
|
],
|
|
53
41
|
"dependencies": {
|
|
54
|
-
"@types/node": "^20.11.5",
|
|
55
|
-
"@types/chrome": "^0.0.268",
|
|
56
42
|
"@colors/colors": "^1.6.0",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
43
|
+
"@types/chrome": "^0.0.270",
|
|
44
|
+
"@types/firefox-webext-browser": "^120.0.4",
|
|
45
|
+
"@types/node": "^22.5.3",
|
|
46
|
+
"@types/react": "^18.3.5",
|
|
47
|
+
"@types/react-dom": "^18.2.18",
|
|
59
48
|
"commander": "^11.1.0",
|
|
60
49
|
"semver": "^7.5.4",
|
|
61
50
|
"update-check": "^1.5.4",
|
|
62
|
-
"webextension-polyfill": "^0.12.0"
|
|
51
|
+
"webextension-polyfill": "^0.12.0",
|
|
52
|
+
"extension-create": "2.0.0-beta.1",
|
|
53
|
+
"extension-develop": "2.0.0-beta.1"
|
|
63
54
|
},
|
|
64
55
|
"devDependencies": {
|
|
65
56
|
"@types/jest": "^29.5.11",
|
|
66
57
|
"@types/mock-fs": "^4.13.4",
|
|
67
|
-
"@types/node": "^20.11.5",
|
|
68
58
|
"@types/semver": "^7.5.6",
|
|
69
59
|
"jest": "^29.7.0",
|
|
70
60
|
"mock-fs": "^5.2.0",
|
|
@@ -72,5 +62,17 @@
|
|
|
72
62
|
"tsconfig": "*",
|
|
73
63
|
"tsup": "^8.0.1",
|
|
74
64
|
"typescript": "5.3.3"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"watch": "pnpm compile --watch",
|
|
68
|
+
"compile:types": "bash install_scripts.sh",
|
|
69
|
+
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
70
|
+
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
71
|
+
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
72
|
+
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
73
|
+
"compile": "pnpm compile:readme-files && pnpm compile:tailwind-config && pnpm compile:stylelint-config && pnpm compile:cli && pnpm compile:types",
|
|
74
|
+
"clean": "rm -rf dist",
|
|
75
|
+
"test": "echo \"Note: no test specified\" && exit 0",
|
|
76
|
+
"test:cli": "jest __spec__/cli.spec.ts"
|
|
75
77
|
}
|
|
76
|
-
}
|
|
78
|
+
}
|