extension 1.4.6 → 1.5.0
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 +15 -15
- package/dist/cli.js +9 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
[fossa-image]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcezaraugusto%2Fextension.svg?type=shield&issueType=license
|
|
13
13
|
[fossa-url]: https://app.fossa.com/projects/git%2Bgithub.com%2Fcezaraugusto%2Fextension?ref=badge_shield&issueType=license
|
|
14
14
|
|
|
15
|
-
# Extension [![npm][npm-image]][npm-url] [![fossa][fossa-image]][fossa-url] [![workflow][action-image]][action-url] [![downloads][downloads-image]][downloads-url] [![PR's welcome][prs]][prs-url]
|
|
15
|
+
# Extension.js [![npm][npm-image]][npm-url] [![fossa][fossa-image]][fossa-url] [![workflow][action-image]][action-url] [![downloads][downloads-image]][downloads-url] [![PR's welcome][prs]][prs-url]
|
|
16
16
|
|
|
17
17
|
> Plug-and-play, zero-config, cross-browser extension development tool.
|
|
18
18
|
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
|
|
27
27
|
- [Create A New Extension](#create-a-new-extension) — How to create a new extension.
|
|
28
28
|
- [Get Started Immediately](#get-started-immediately) — Get work done in no time.
|
|
29
|
-
- [I have An Extension](#i-have-an-extension) - Use only specific parts of `
|
|
29
|
+
- [I have An Extension](#i-have-an-extension) - Use only specific parts of `Extension.js`.
|
|
30
30
|
|
|
31
|
-
<!-- `
|
|
31
|
+
<!-- `Extension.js` is a development tool for browser extensions with built-in support for TypeScript, WebAssembly, React, and modern JavaScript. -->
|
|
32
32
|
|
|
33
|
-
`
|
|
33
|
+
`Extension.js` is a plug-and-play, zero-config, cross-browser extension development tool with built-in support for TypeScript, WebAssembly, React, and modern JavaScript.
|
|
34
34
|
|
|
35
35
|
## Create A New Extension
|
|
36
36
|
|
|
@@ -70,7 +70,7 @@ https://github.com/cezaraugusto/extension/assets/4672033/ee221a94-6ec7-4e04-8553
|
|
|
70
70
|
|
|
71
71
|
### Use `Microsoft Edge` to kickstart any sample from [chrome-extesions-sample](https://github.com/GoogleChrome/chrome-extensions-samples/)
|
|
72
72
|
|
|
73
|
-
`
|
|
73
|
+
`Extension.js` supports a variety of browsers, including Microsoft Edge. To start an Edge-compatible extension, simply:
|
|
74
74
|
|
|
75
75
|
1. Open your terminal.
|
|
76
76
|
2. Navigate to your desired project directory.
|
|
@@ -111,7 +111,7 @@ https://github.com/cezaraugusto/extension/assets/4672033/130cb430-1567-419c-8c90
|
|
|
111
111
|
|
|
112
112
|
https://github.com/cezaraugusto/extension/assets/4672033/48694a23-b7f1-4098-9c5d-eff49983739c
|
|
113
113
|
|
|
114
|
-
If you have an existing extension which is using a package manager, you can install the `
|
|
114
|
+
If you have an existing extension which is using a package manager, you can install the `Extension.js` package and manually create the scripts used to run your extension. See the demo above or follow these instructions to get it done:
|
|
115
115
|
|
|
116
116
|
**Step 1 - Install extension as a `devDependency`**
|
|
117
117
|
|
|
@@ -119,7 +119,7 @@ If you have an existing extension which is using a package manager, you can inst
|
|
|
119
119
|
npm install extension --save-dev
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
**Step 2 - Link your npm scripts with the executable `
|
|
122
|
+
**Step 2 - Link your npm scripts with the executable `Extension.js` commands**
|
|
123
123
|
|
|
124
124
|
```json
|
|
125
125
|
{
|
|
@@ -147,17 +147,17 @@ Done. You are all set!
|
|
|
147
147
|
|
|
148
148
|
☑️ = Likely works but no browser runner support yet.
|
|
149
149
|
|
|
150
|
-
| <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/brave/brave.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera.svg" width="100" height="100"> | <img width="100" height="100" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari.svg"
|
|
151
|
-
|
|
152
|
-
| Brave Browser
|
|
153
|
-
| ☑️
|
|
150
|
+
| <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/brave/brave.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera.svg" width="100" height="100"> | <img width="100" height="100" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari.svg"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/vivaldi/vivaldi.svg" width="100" height="100"> |
|
|
151
|
+
| ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
152
|
+
| Brave Browser | Google Chrome | Microsoft Edge | Mozilla Firefox | Opera Browser | Apple Safari | Vivaldi Browser |
|
|
153
|
+
| ☑️ | ✅ | ✅ | ✅ | ☑️ | ⛔️ | ☑️ |
|
|
154
154
|
|
|
155
155
|
### Mobile Browsers
|
|
156
156
|
|
|
157
|
-
| <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari-ios/safari-ios.svg" width="100" height="100"> |
|
|
158
|
-
|
|
159
|
-
| Firefox For Android
|
|
160
|
-
| ⛔️
|
|
157
|
+
| <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox.svg" width="100" height="100"> | <img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari-ios/safari-ios.svg" width="100" height="100"> |
|
|
158
|
+
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
159
|
+
| Firefox For Android | Safari On iOS |
|
|
160
|
+
| ⛔️ | ⛔️ |
|
|
161
161
|
|
|
162
162
|
If you want to target a specific browser, just pass the `--browser` flag to the `dev`/`start` command (based on the list available above), like `npx extension dev path/to/extension --browser=edge`.
|
|
163
163
|
|
package/dist/cli.js
CHANGED
|
@@ -141,7 +141,7 @@ var package_default = {
|
|
|
141
141
|
node: ">=18"
|
|
142
142
|
},
|
|
143
143
|
name: "extension",
|
|
144
|
-
version: "1.
|
|
144
|
+
version: "1.5.0",
|
|
145
145
|
description: "Create cross-browser extensions with no build configuration.",
|
|
146
146
|
main: "./dist/cli.js",
|
|
147
147
|
types: "./dist/cli.d.ts",
|
|
@@ -207,14 +207,13 @@ if (import_semver.default.lte(process.version, "18.0.0")) {
|
|
|
207
207
|
messages_default.unsupportedNodeVersion();
|
|
208
208
|
process.exit(1);
|
|
209
209
|
}
|
|
210
|
-
var
|
|
211
|
-
var isExtensionCreateNamespace = package_default.name !== "extension";
|
|
210
|
+
var extensionJs = import_commander.program;
|
|
212
211
|
if (process.env.EXTENSION_ENV === "development") {
|
|
213
212
|
console.log(`Running extension via ${package_default.name}...`);
|
|
214
213
|
}
|
|
215
|
-
|
|
216
|
-
var vendors = (browser) => browser === "all" ? "chrome,edge".split(",") : browser.split(",");
|
|
217
|
-
|
|
214
|
+
extensionJs.name(package_default.name).description(package_default.description).version(package_default.version).addHelpText("after", messages_default.programHelp());
|
|
215
|
+
var vendors = (browser) => browser === "all" ? "chrome,edge,firefox".split(",") : browser.split(",");
|
|
216
|
+
extensionJs.command("create").arguments("<project-name|project-path>").usage("create <project-name|project-path> [options]").description("Creates a new extension.").option(
|
|
218
217
|
"-t, --template <template-name>",
|
|
219
218
|
"specify a template for the created project"
|
|
220
219
|
).action(async function(pathOrRemoteUrl, {
|
|
@@ -254,7 +253,7 @@ extensionCreate.command("create").arguments("<project-name|project-path>").usage
|
|
|
254
253
|
break;
|
|
255
254
|
}
|
|
256
255
|
});
|
|
257
|
-
|
|
256
|
+
extensionJs.command("dev").arguments("[project-path|remote-url]").usage("dev [project-path|remote-url] [options]").description("Starts the development server (development mode)").option(
|
|
258
257
|
"-u, --user-data-dir <path-to-file | boolean>",
|
|
259
258
|
"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"
|
|
260
259
|
).option(
|
|
@@ -275,7 +274,7 @@ extensionCreate.command("dev").arguments("[project-path|remote-url]").usage("dev
|
|
|
275
274
|
});
|
|
276
275
|
}
|
|
277
276
|
});
|
|
278
|
-
|
|
277
|
+
extensionJs.command("start").arguments("[project-path|remote-url]").usage("start [project-path|remote-url] [options]").description("Starts the development server (production mode)").option(
|
|
279
278
|
"-u, --user-data-dir <path-to-file | boolean>",
|
|
280
279
|
"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"
|
|
281
280
|
).option(
|
|
@@ -296,7 +295,7 @@ extensionCreate.command("start").arguments("[project-path|remote-url]").usage("s
|
|
|
296
295
|
});
|
|
297
296
|
}
|
|
298
297
|
});
|
|
299
|
-
|
|
298
|
+
extensionJs.command("build").arguments("[project-name]").usage("build [path-to-remote-extension] [options]").description("Builds the extension for production").option(
|
|
300
299
|
"-b, --browser <chrome | edge>",
|
|
301
300
|
"specify a browser to run your extension in development mode"
|
|
302
301
|
).option(
|
|
@@ -310,4 +309,4 @@ extensionCreate.command("build").arguments("[project-name]").usage("build [path-
|
|
|
310
309
|
});
|
|
311
310
|
}
|
|
312
311
|
});
|
|
313
|
-
|
|
312
|
+
extensionJs.parse();
|