extension 1.8.0-beta.1 → 1.8.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 +3 -1
- package/dist/cli.js +8 -46
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
[vunlerabilities]: https://snyk.io/test/github/cezaraugusto/extension/badge.svg
|
|
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
|
+
[discord-image]: https://dcbadge.limes.pink/api/server/kr9rjDmy?style=flat&compact=true
|
|
15
|
+
[discord-url]: https://discord.gg/zkspfFwqDg
|
|
14
16
|
|
|
15
|
-
# Extension.js [![npm][npm-image]][npm-url] [![fossa][fossa-image]][fossa-url] [![workflow][action-image]][action-url] [![downloads][downloads-image]][downloads-url] [![
|
|
17
|
+
# Extension.js [![npm][npm-image]][npm-url] [![fossa][fossa-image]][fossa-url] [![workflow][action-image]][action-url] [![downloads][downloads-image]][downloads-url] [![downloads][discord-image]][discord-url]
|
|
16
18
|
|
|
17
19
|
<!-- > Plug-and-play, zero-config, cross-browser extension development tool. -->
|
|
18
20
|
|
package/dist/cli.js
CHANGED
|
@@ -28,7 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
));
|
|
29
29
|
|
|
30
30
|
// cli.ts
|
|
31
|
-
var import_semver = __toESM(require("semver"));
|
|
32
31
|
var import_commander = require("commander");
|
|
33
32
|
var import_create = __toESM(require("@extension-create/create"));
|
|
34
33
|
var import_develop = require("@extension-create/develop");
|
|
@@ -141,7 +140,7 @@ var package_default = {
|
|
|
141
140
|
node: ">=18"
|
|
142
141
|
},
|
|
143
142
|
name: "extension",
|
|
144
|
-
version: "1.8.0
|
|
143
|
+
version: "1.8.0",
|
|
145
144
|
description: "Create cross-browser extensions with no build configuration.",
|
|
146
145
|
main: "./dist/cli.js",
|
|
147
146
|
types: "./dist/cli.d.ts",
|
|
@@ -158,13 +157,17 @@ var package_default = {
|
|
|
158
157
|
url: "https://cezaraugusto.com"
|
|
159
158
|
},
|
|
160
159
|
scripts: {
|
|
160
|
+
watch: "yarn compile --watch",
|
|
161
161
|
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
162
162
|
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
163
163
|
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
164
164
|
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
165
165
|
compile: "yarn compile:readme-files && yarn compile:tailwind-config && yarn compile:stylelint-config &&yarn compile:cli",
|
|
166
166
|
clean: "rm -rf dist",
|
|
167
|
-
test: "
|
|
167
|
+
"before:test": "./spec/fixtures/install-npm-deps-for-fixtures.sh",
|
|
168
|
+
"test:build": "npm run before:test && jest spec/build.spec.ts",
|
|
169
|
+
"test:cli": "npm run before:test && jest spec/cli.spec.ts",
|
|
170
|
+
"test:create": "npm run before:test && jest spec/create.spec.ts"
|
|
168
171
|
},
|
|
169
172
|
keywords: [
|
|
170
173
|
"zero-config",
|
|
@@ -203,55 +206,14 @@ var package_default = {
|
|
|
203
206
|
|
|
204
207
|
// cli.ts
|
|
205
208
|
checkUpdates(package_default);
|
|
206
|
-
if (import_semver.default.lte(process.version, "18.0.0")) {
|
|
207
|
-
messages_default.unsupportedNodeVersion();
|
|
208
|
-
process.exit(1);
|
|
209
|
-
}
|
|
210
209
|
var extensionJs = import_commander.program;
|
|
211
|
-
if (process.env.EXTENSION_ENV === "development") {
|
|
212
|
-
console.log(`Running extension via ${package_default.name}...`);
|
|
213
|
-
}
|
|
214
210
|
extensionJs.name(package_default.name).description(package_default.description).version(package_default.version).addHelpText("after", messages_default.programHelp());
|
|
215
211
|
var vendors = (browser) => browser === "all" ? "chrome,edge,firefox".split(",") : browser.split(",");
|
|
216
212
|
extensionJs.command("create").arguments("<project-name|project-path>").usage("create <project-name|project-path> [options]").description("Creates a new extension.").option(
|
|
217
213
|
"-t, --template <template-name>",
|
|
218
214
|
"specify a template for the created project"
|
|
219
|
-
).action(async function(pathOrRemoteUrl, {
|
|
220
|
-
|
|
221
|
-
template,
|
|
222
|
-
...otherCommandOptions
|
|
223
|
-
}) {
|
|
224
|
-
switch (pathOrRemoteUrl) {
|
|
225
|
-
case "dev":
|
|
226
|
-
for (const vendor of vendors(browser)) {
|
|
227
|
-
await (0, import_develop.extensionDev)(pathOrRemoteUrl, {
|
|
228
|
-
mode: "development",
|
|
229
|
-
browser: vendor,
|
|
230
|
-
...otherCommandOptions
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
break;
|
|
234
|
-
case "start":
|
|
235
|
-
for (const vendor of vendors(browser)) {
|
|
236
|
-
await (0, import_develop.extensionStart)(pathOrRemoteUrl, {
|
|
237
|
-
mode: "production",
|
|
238
|
-
browser: vendor,
|
|
239
|
-
...otherCommandOptions
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
break;
|
|
243
|
-
case "build":
|
|
244
|
-
for (const vendor of vendors(browser)) {
|
|
245
|
-
await (0, import_develop.extensionBuild)(pathOrRemoteUrl, {
|
|
246
|
-
browser: vendor,
|
|
247
|
-
...otherCommandOptions
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
break;
|
|
251
|
-
default:
|
|
252
|
-
await (0, import_create.default)(pathOrRemoteUrl, { template });
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
215
|
+
).action(async function(pathOrRemoteUrl, { template }) {
|
|
216
|
+
await (0, import_create.default)(pathOrRemoteUrl, { template });
|
|
255
217
|
});
|
|
256
218
|
extensionJs.command("dev").arguments("[project-path|remote-url]").usage("dev [project-path|remote-url] [options]").description("Starts the development server (development mode)").option(
|
|
257
219
|
"-u, --user-data-dir <path-to-file | boolean>",
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
11
|
"name": "extension",
|
|
12
|
-
"version": "1.8.0
|
|
12
|
+
"version": "1.8.0",
|
|
13
13
|
"description": "Create cross-browser extensions with no build configuration.",
|
|
14
14
|
"main": "./dist/cli.js",
|
|
15
15
|
"types": "./dist/cli.d.ts",
|
|
@@ -26,13 +26,17 @@
|
|
|
26
26
|
"url": "https://cezaraugusto.com"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
|
+
"watch": "yarn compile --watch",
|
|
29
30
|
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
30
31
|
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
31
32
|
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
32
33
|
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
33
34
|
"compile": "yarn compile:readme-files && yarn compile:tailwind-config && yarn compile:stylelint-config &&yarn compile:cli",
|
|
34
35
|
"clean": "rm -rf dist",
|
|
35
|
-
"test": "
|
|
36
|
+
"before:test": "./spec/fixtures/install-npm-deps-for-fixtures.sh",
|
|
37
|
+
"test:build": "npm run before:test && jest spec/build.spec.ts",
|
|
38
|
+
"test:cli": "npm run before:test && jest spec/cli.spec.ts",
|
|
39
|
+
"test:create": "npm run before:test && jest spec/create.spec.ts"
|
|
36
40
|
},
|
|
37
41
|
"keywords": [
|
|
38
42
|
"zero-config",
|