extension 2.0.0-rc.24 → 2.0.0-rc.25
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 -2
- package/dist/cli.js +293 -72
- package/dist/stylelint.config.js +7 -0
- package/dist/tailwind.config.js +25 -0
- package/dist/types/index.d.ts +11 -28
- package/package.json +18 -19
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,118 +1,339 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
|
|
27
|
+
// cli.ts
|
|
28
|
+
var cli_exports = {};
|
|
29
|
+
module.exports = __toCommonJS(cli_exports);
|
|
30
|
+
var import_commander = require("commander");
|
|
31
|
+
var import_extension_create = require("extension-create");
|
|
32
|
+
var import_extension_develop = require("extension-develop");
|
|
33
|
+
|
|
34
|
+
// cli-lib/messages.ts
|
|
35
|
+
var import_safe = require("@colors/colors/safe");
|
|
7
36
|
function updateFailed(err) {
|
|
8
|
-
|
|
37
|
+
return "\u{1F9E9}\n" + (0, import_safe.red)(`Failed to check for updates: ${err.message}`);
|
|
9
38
|
}
|
|
10
39
|
function checkUpdates(packageJson, update) {
|
|
11
|
-
|
|
40
|
+
return `\u{1F9E9}
|
|
41
|
+
${(0, import_safe.brightYellow)("Notice:")} A new version of ${(0, import_safe.brightGreen)(
|
|
42
|
+
"Extension.js"
|
|
43
|
+
)} is available!
|
|
44
|
+
You are currently using version ${(0, import_safe.brightYellow)(packageJson.version)}.
|
|
45
|
+
The latest stable version is ${(0, import_safe.brightYellow)(update.latest)}.
|
|
46
|
+
Please update to the latest version to enjoy new features and improvements.
|
|
47
|
+
`;
|
|
12
48
|
}
|
|
13
49
|
function programHelp() {
|
|
14
|
-
|
|
15
|
-
${
|
|
50
|
+
return `\u{1F9E9}
|
|
51
|
+
${(0, import_safe.underline)("Help center for the Extension.js program")}
|
|
16
52
|
|
|
17
|
-
${
|
|
53
|
+
${(0, import_safe.brightYellow)("Usage:")} extension [command] [options]
|
|
18
54
|
|
|
19
|
-
${
|
|
55
|
+
${(0, import_safe.brightYellow)("Note:")} If you are looking for a specific list of options,
|
|
20
56
|
all high-level commands offer their own \`--help\` file with
|
|
21
57
|
information about usage and a list of command flags available.
|
|
22
58
|
|
|
23
59
|
For example:
|
|
24
60
|
|
|
25
|
-
${
|
|
61
|
+
${(0, import_safe.brightGreen)("extension create --help")}
|
|
26
62
|
outputs information about the "create" command.
|
|
27
63
|
|
|
28
64
|
Options available:
|
|
29
65
|
|
|
30
|
-
${
|
|
66
|
+
${(0, import_safe.brightGreen)("extension create <extension-name>")}
|
|
31
67
|
Creates a new extension from a template. The "create" command
|
|
32
68
|
is optional and can be omitted.
|
|
33
69
|
|
|
34
|
-
${
|
|
70
|
+
${(0, import_safe.brightGreen)("extension dev <extension-path>")}
|
|
35
71
|
Starts a new browser instance in development mode, with the target
|
|
36
72
|
extension loaded and auto-reloaded based on file changes.
|
|
37
73
|
|
|
38
|
-
${
|
|
74
|
+
${(0, import_safe.brightGreen)("extension start <extension-path>")}
|
|
39
75
|
Starts a new browser instance in production mode, with the target
|
|
40
76
|
extension compiled based on the browser choice.
|
|
41
77
|
|
|
42
|
-
${
|
|
78
|
+
${(0, import_safe.brightGreen)("extension build <extension-path>")}
|
|
43
79
|
Builds the target extension with browser defaults, ready for packaging.
|
|
44
80
|
|
|
45
|
-
${
|
|
81
|
+
${(0, import_safe.brightGreen)("extension --help")}
|
|
46
82
|
This command ;) Outputs a help file with key command options.
|
|
47
83
|
|
|
48
|
-
${
|
|
49
|
-
${
|
|
84
|
+
${(0, import_safe.brightYellow)("Feels something is wrong? Help by reporting a bug:")}
|
|
85
|
+
${(0, import_safe.underline)("https://github.com/cezaraugusto/extension/issues/new")}
|
|
50
86
|
`;
|
|
51
87
|
}
|
|
88
|
+
|
|
89
|
+
// check-updates.ts
|
|
90
|
+
var import_update_check = __toESM(require("update-check"));
|
|
52
91
|
function isStableVersion(version) {
|
|
53
|
-
|
|
92
|
+
return !/[a-zA-Z]/.test(version);
|
|
54
93
|
}
|
|
55
|
-
async function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
94
|
+
async function checkUpdates2(packageJson) {
|
|
95
|
+
let update = null;
|
|
96
|
+
try {
|
|
97
|
+
update = await (0, import_update_check.default)(packageJson);
|
|
98
|
+
} catch (err) {
|
|
99
|
+
if (process.env.EXTENSION_ENV === "development") {
|
|
100
|
+
console.error(updateFailed(err));
|
|
61
101
|
}
|
|
62
|
-
|
|
102
|
+
}
|
|
103
|
+
if (update && isStableVersion(update.latest)) {
|
|
104
|
+
console.log(checkUpdates(packageJson, update));
|
|
105
|
+
}
|
|
63
106
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
107
|
+
|
|
108
|
+
// package.json
|
|
109
|
+
var package_default = {
|
|
110
|
+
license: "MIT",
|
|
111
|
+
repository: {
|
|
112
|
+
type: "git",
|
|
113
|
+
url: "https://github.com/cezaraugusto/extension.git",
|
|
114
|
+
directory: "programs/cli"
|
|
115
|
+
},
|
|
116
|
+
engines: {
|
|
117
|
+
node: ">=18"
|
|
118
|
+
},
|
|
119
|
+
name: "extension",
|
|
120
|
+
version: "2.0.0-rc.25",
|
|
121
|
+
description: "Create cross-browser extensions with no build configuration.",
|
|
122
|
+
main: "./dist/cli.js",
|
|
123
|
+
types: "./dist/cli.d.ts",
|
|
124
|
+
files: [
|
|
125
|
+
"dist",
|
|
126
|
+
"README.md"
|
|
127
|
+
],
|
|
128
|
+
bin: {
|
|
129
|
+
extension: "./dist/cli.js"
|
|
130
|
+
},
|
|
131
|
+
author: {
|
|
132
|
+
name: "Cezar Augusto",
|
|
133
|
+
email: "boss@cezaraugusto.net",
|
|
134
|
+
url: "https://cezaraugusto.com"
|
|
135
|
+
},
|
|
136
|
+
scripts: {
|
|
137
|
+
watch: "pnpm compile --watch",
|
|
138
|
+
"compile:types": "bash install_scripts.sh",
|
|
139
|
+
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
140
|
+
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
141
|
+
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
142
|
+
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
143
|
+
compile: "pnpm compile:readme-files && pnpm compile:tailwind-config && pnpm compile:stylelint-config && pnpm compile:cli && pnpm compile:types",
|
|
144
|
+
clean: "rm -rf dist",
|
|
145
|
+
test: 'echo "Note: no test specified" && exit 0',
|
|
146
|
+
"test:cli": "jest __spec__/cli.spec.ts"
|
|
147
|
+
},
|
|
148
|
+
keywords: [
|
|
149
|
+
"zero-config",
|
|
150
|
+
"build",
|
|
151
|
+
"develop",
|
|
152
|
+
"browser",
|
|
153
|
+
"extension",
|
|
154
|
+
"chrome extension",
|
|
155
|
+
"edge extension",
|
|
156
|
+
"firefox extension",
|
|
157
|
+
"safari extension",
|
|
158
|
+
"web",
|
|
159
|
+
"react",
|
|
160
|
+
"typescript"
|
|
161
|
+
],
|
|
162
|
+
dependencies: {
|
|
163
|
+
"@colors/colors": "^1.6.0",
|
|
164
|
+
"@types/chrome": "^0.0.287",
|
|
165
|
+
"@types/firefox-webext-browser": "^120.0.4",
|
|
166
|
+
"@types/node": "^22.10.1",
|
|
167
|
+
"@types/react": "^19.0.1",
|
|
168
|
+
"@types/react-dom": "^19.0.1",
|
|
169
|
+
commander: "^12.1.0",
|
|
170
|
+
"extension-create": "workspace:*",
|
|
171
|
+
"extension-develop": "workspace:*",
|
|
172
|
+
semver: "^7.6.3",
|
|
173
|
+
"update-check": "^1.5.4",
|
|
174
|
+
"webextension-polyfill": "^0.12.0"
|
|
175
|
+
},
|
|
176
|
+
devDependencies: {
|
|
177
|
+
"@types/jest": "^29.5.14",
|
|
178
|
+
"@types/mock-fs": "^4.13.4",
|
|
179
|
+
"@types/semver": "^7.5.8",
|
|
180
|
+
jest: "^29.7.0",
|
|
181
|
+
"mock-fs": "^5.4.1",
|
|
182
|
+
"ts-jest": "^29.3.1",
|
|
183
|
+
tsconfig: "*",
|
|
184
|
+
tsup: "^8.3.5",
|
|
185
|
+
typescript: "5.7.2"
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// cli.ts
|
|
190
|
+
checkUpdates2(package_default);
|
|
191
|
+
var extensionJs = import_commander.program;
|
|
192
|
+
var vendors = (browser) => browser === "all" ? "chrome,edge,firefox".split(",") : browser.split(",");
|
|
193
|
+
extensionJs.name(package_default.name).description(package_default.description).version(package_default.version).addHelpText("after", programHelp());
|
|
194
|
+
extensionJs.command("create").arguments("<project-name|project-path>").usage("create <project-name|project-path> [options]").description("Creates a new extension.").option(
|
|
195
|
+
"-t, --template <template-name>",
|
|
196
|
+
"specify a template for the created project"
|
|
197
|
+
).option(
|
|
198
|
+
"--install",
|
|
199
|
+
"whether or not to install the dependencies after creating the project"
|
|
200
|
+
).action(async function(pathOrRemoteUrl, { template, install }) {
|
|
201
|
+
await (0, import_extension_create.extensionCreate)(pathOrRemoteUrl, {
|
|
202
|
+
template,
|
|
203
|
+
install,
|
|
204
|
+
cliVersion: package_default.version
|
|
205
|
+
});
|
|
75
206
|
});
|
|
76
|
-
extensionJs.command(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
207
|
+
extensionJs.command("dev").arguments("[project-path|remote-url]").usage("dev [project-path|remote-url] [options]").description("Starts the development server (development mode)").option(
|
|
208
|
+
"--profile <path-to-file | boolean>",
|
|
209
|
+
"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"
|
|
210
|
+
).option(
|
|
211
|
+
"--browser <chrome | edge | firefox>",
|
|
212
|
+
"specify a browser to preview your extension in production mode. Defaults to `chrome`"
|
|
213
|
+
).option(
|
|
214
|
+
"--chromium-binary <path-to-binary>",
|
|
215
|
+
"specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default"
|
|
216
|
+
).option(
|
|
217
|
+
"--gecko-binary <path-to-binary>",
|
|
218
|
+
"specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default"
|
|
219
|
+
).option(
|
|
220
|
+
"--polyfill [boolean]",
|
|
221
|
+
"whether or not to apply the cross-browser polyfill. Defaults to `false`"
|
|
222
|
+
).option(
|
|
223
|
+
"--open [boolean]",
|
|
224
|
+
"whether or not to open the browser automatically. Defaults to `true`"
|
|
225
|
+
).option(
|
|
226
|
+
"--starting-url <url>",
|
|
227
|
+
"specify the starting URL for the browser. Defaults to `undefined`"
|
|
228
|
+
).option(
|
|
229
|
+
"--port <port>",
|
|
230
|
+
"specify the port to use for the development server. Defaults to `8080`"
|
|
231
|
+
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...devOptions }) {
|
|
232
|
+
for (const vendor of vendors(browser)) {
|
|
233
|
+
await (0, import_extension_develop.extensionDev)(pathOrRemoteUrl, {
|
|
234
|
+
...devOptions,
|
|
235
|
+
profile: devOptions.profile,
|
|
236
|
+
browser: vendor,
|
|
237
|
+
chromiumBinary: devOptions.chromiumBinary,
|
|
238
|
+
geckoBinary: devOptions.geckoBinary,
|
|
239
|
+
// @ts-expect-error open is a boolean
|
|
240
|
+
polyfill: devOptions.polyfill === "false" ? false : true,
|
|
241
|
+
open: devOptions.open,
|
|
242
|
+
startingUrl: devOptions.startingUrl
|
|
86
243
|
});
|
|
244
|
+
}
|
|
87
245
|
});
|
|
88
|
-
extensionJs.command(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
246
|
+
extensionJs.command("start").arguments("[project-path|remote-url]").usage("start [project-path|remote-url] [options]").description("Starts the development server (production mode)").option(
|
|
247
|
+
"--profile <path-to-file | boolean>",
|
|
248
|
+
"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"
|
|
249
|
+
).option(
|
|
250
|
+
"--browser <chrome | edge | firefox>",
|
|
251
|
+
"specify a browser to preview your extension in production mode. Defaults to `chrome`"
|
|
252
|
+
).option(
|
|
253
|
+
"--polyfill [boolean]",
|
|
254
|
+
"whether or not to apply the cross-browser polyfill. Defaults to `true`"
|
|
255
|
+
).option(
|
|
256
|
+
"--chromium-binary <path-to-binary>",
|
|
257
|
+
"specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default"
|
|
258
|
+
).option(
|
|
259
|
+
"--gecko-binary <path-to-binary>",
|
|
260
|
+
"specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default"
|
|
261
|
+
).option(
|
|
262
|
+
"--starting-url <url>",
|
|
263
|
+
"specify the starting URL for the browser. Defaults to `undefined`"
|
|
264
|
+
).option(
|
|
265
|
+
"--port <port>",
|
|
266
|
+
"specify the port to use for the development server. Defaults to `8080`"
|
|
267
|
+
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...startOptions }) {
|
|
268
|
+
for (const vendor of vendors(browser)) {
|
|
269
|
+
await (0, import_extension_develop.extensionStart)(pathOrRemoteUrl, {
|
|
270
|
+
mode: "production",
|
|
271
|
+
profile: startOptions.profile,
|
|
272
|
+
browser: vendor,
|
|
273
|
+
chromiumBinary: startOptions.chromiumBinary,
|
|
274
|
+
geckoBinary: startOptions.geckoBinary,
|
|
275
|
+
startingUrl: startOptions.startingUrl
|
|
96
276
|
});
|
|
277
|
+
}
|
|
97
278
|
});
|
|
98
|
-
extensionJs.command(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
279
|
+
extensionJs.command("preview").arguments("[project-name]").usage("preview [path-to-remote-extension] [options]").description("Preview the extension in production mode").option(
|
|
280
|
+
"--profile <path-to-file | boolean>",
|
|
281
|
+
"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"
|
|
282
|
+
).option(
|
|
283
|
+
"--browser <chrome | edge | firefox>",
|
|
284
|
+
"specify a browser to preview your extension in production mode. Defaults to `chrome`"
|
|
285
|
+
).option(
|
|
286
|
+
"--chromium-binary <path-to-binary>",
|
|
287
|
+
"specify a path to the Chromium binary. This option overrides the --browser setting. Defaults to the system default"
|
|
288
|
+
).option(
|
|
289
|
+
"--gecko-binary <path-to-binary>",
|
|
290
|
+
"specify a path to the Gecko binary. This option overrides the --browser setting. Defaults to the system default"
|
|
291
|
+
).option(
|
|
292
|
+
"--starting-url <url>",
|
|
293
|
+
"specify the starting URL for the browser. Defaults to `undefined`"
|
|
294
|
+
).option(
|
|
295
|
+
"--port <port>",
|
|
296
|
+
"specify the port to use for the development server. Defaults to `8080`"
|
|
297
|
+
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...previewOptions }) {
|
|
298
|
+
for (const vendor of vendors(browser)) {
|
|
299
|
+
await (0, import_extension_develop.extensionPreview)(pathOrRemoteUrl, {
|
|
300
|
+
mode: "production",
|
|
301
|
+
profile: previewOptions.profile,
|
|
302
|
+
browser: vendor,
|
|
303
|
+
chromiumBinary: previewOptions.chromiumBinary,
|
|
304
|
+
geckoBinary: previewOptions.geckoBinary,
|
|
305
|
+
startingUrl: previewOptions.startingUrl
|
|
106
306
|
});
|
|
307
|
+
}
|
|
107
308
|
});
|
|
108
|
-
extensionJs.command(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
309
|
+
extensionJs.command("build").arguments("[project-name]").usage("build [path-to-remote-extension] [options]").description("Builds the extension for production").option(
|
|
310
|
+
"--browser <chrome | edge | firefox>",
|
|
311
|
+
"specify a browser to preview your extension in production mode. Defaults to `chrome`"
|
|
312
|
+
).option(
|
|
313
|
+
"--polyfill [boolean]",
|
|
314
|
+
"whether or not to apply the cross-browser polyfill. Defaults to `false`"
|
|
315
|
+
).option(
|
|
316
|
+
"--zip [boolean]",
|
|
317
|
+
"whether or not to compress the extension into a ZIP file. Defaults to `false`"
|
|
318
|
+
).option(
|
|
319
|
+
"--zip-source [boolean]",
|
|
320
|
+
"whether or not to include the source files in the ZIP file. Defaults to `false`"
|
|
321
|
+
).option(
|
|
322
|
+
"--zip-filename <string>",
|
|
323
|
+
"specify the name of the ZIP file. Defaults to the extension name and version"
|
|
324
|
+
).option(
|
|
325
|
+
"--silent [boolean]",
|
|
326
|
+
"whether or not to open the browser automatically. Defaults to `false`"
|
|
327
|
+
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...buildOptions }) {
|
|
328
|
+
for (const vendor of vendors(browser)) {
|
|
329
|
+
await (0, import_extension_develop.extensionBuild)(pathOrRemoteUrl, {
|
|
330
|
+
browser: vendor,
|
|
331
|
+
polyfill: buildOptions.polyfill,
|
|
332
|
+
zip: buildOptions.zip,
|
|
333
|
+
zipSource: buildOptions.zipSource,
|
|
334
|
+
zipFilename: buildOptions.zipFilename,
|
|
335
|
+
silent: buildOptions.silent
|
|
116
336
|
});
|
|
337
|
+
}
|
|
117
338
|
});
|
|
118
339
|
extensionJs.parse();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
|
|
4
|
+
const [, pathOrRemoteUrl] = process.argv.slice(2)
|
|
5
|
+
const projectDir = pathOrRemoteUrl.startsWith('http')
|
|
6
|
+
? process.cwd() + path.basename(pathOrRemoteUrl)
|
|
7
|
+
: path.resolve(__dirname, pathOrRemoteUrl)
|
|
8
|
+
|
|
9
|
+
const tailwindConfig = path.join(projectDir, 'tailwind.config.js')
|
|
10
|
+
|
|
11
|
+
/** @type {import('tailwindcss').Config} */
|
|
12
|
+
const tailwindConfigData = fs.existsSync(tailwindConfig)
|
|
13
|
+
? require(tailwindConfig)
|
|
14
|
+
: {content: []}
|
|
15
|
+
|
|
16
|
+
/** @type {import('tailwindcss').Config} */
|
|
17
|
+
const tailwindRootConfig = {
|
|
18
|
+
...tailwindConfigData,
|
|
19
|
+
content: [
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
21
|
+
...tailwindConfigData.content.map((file) => path.join(projectDir, file))
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = tailwindRootConfig
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,42 +5,25 @@
|
|
|
5
5
|
/// <reference path="./css-modules.d.ts" />
|
|
6
6
|
/// <reference path="./images.d.ts" />
|
|
7
7
|
|
|
8
|
-
type ExtensionBrowser =
|
|
9
|
-
| 'chrome'
|
|
10
|
-
| 'edge'
|
|
11
|
-
| 'firefox'
|
|
12
|
-
| 'chromium-based'
|
|
13
|
-
| 'gecko-based'
|
|
14
|
-
type ExtensionMode = 'development' | 'production'
|
|
15
|
-
|
|
16
|
-
interface ExtensionEnv {
|
|
17
|
-
EXTENSION_BROWSER: ExtensionBrowser
|
|
18
|
-
EXTENSION_MODE: ExtensionMode
|
|
19
|
-
EXTENSION_PUBLIC_BROWSER: ExtensionBrowser
|
|
20
|
-
EXTENSION_PUBLIC_MODE: ExtensionMode
|
|
21
|
-
EXTENSION_PUBLIC_DESCRIPTION_TEXT: string
|
|
22
|
-
EXTENSION_PUBLIC_OPENAI_API_KEY: string
|
|
23
|
-
EXTENSION_ENV: ExtensionMode
|
|
24
|
-
}
|
|
25
|
-
|
|
26
8
|
declare namespace NodeJS {
|
|
27
|
-
interface ProcessEnv
|
|
28
|
-
|
|
9
|
+
interface ProcessEnv {
|
|
10
|
+
readonly EXTENSION_BROWSER:
|
|
11
|
+
| 'chrome'
|
|
12
|
+
| 'edge'
|
|
13
|
+
| 'firefox'
|
|
14
|
+
| 'chromium-based'
|
|
15
|
+
| 'gecko-based'
|
|
16
|
+
readonly EXTENSION_MODE: 'development' | 'production'
|
|
29
17
|
}
|
|
30
18
|
}
|
|
31
19
|
|
|
32
|
-
interface ImportMetaEnv
|
|
33
|
-
|
|
20
|
+
interface ImportMetaEnv {
|
|
21
|
+
readonly EXTENSION_BROWSER: NodeJS.ProcessEnv['EXTENSION_BROWSER']
|
|
22
|
+
readonly EXTENSION_MODE: NodeJS.ProcessEnv['EXTENSION_MODE']
|
|
34
23
|
}
|
|
35
24
|
|
|
36
25
|
interface ImportMeta {
|
|
37
26
|
readonly env: ImportMetaEnv
|
|
38
|
-
// @ts-expect-error - This is a webpack specific property
|
|
39
|
-
readonly webpackHot?: {
|
|
40
|
-
accept: (module?: string | string[], callback?: () => void) => void
|
|
41
|
-
dispose: (callback: () => void) => void
|
|
42
|
-
}
|
|
43
|
-
url: string
|
|
44
27
|
}
|
|
45
28
|
|
|
46
29
|
interface Window {
|
package/package.json
CHANGED
|
@@ -8,24 +8,18 @@
|
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"types": "./dist/cli.d.ts",
|
|
15
|
-
"import": "./dist/cli.js"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
11
|
+
"name": "extension",
|
|
12
|
+
"version": "2.0.0-rc.25",
|
|
13
|
+
"description": "Create cross-browser extensions with no build configuration.",
|
|
18
14
|
"main": "./dist/cli.js",
|
|
19
15
|
"types": "./dist/cli.d.ts",
|
|
20
16
|
"files": [
|
|
21
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
22
19
|
],
|
|
23
20
|
"bin": {
|
|
24
21
|
"extension": "./dist/cli.js"
|
|
25
22
|
},
|
|
26
|
-
"name": "extension",
|
|
27
|
-
"version": "2.0.0-rc.24",
|
|
28
|
-
"description": "Create cross-browser extensions with no build configuration.",
|
|
29
23
|
"author": {
|
|
30
24
|
"name": "Cezar Augusto",
|
|
31
25
|
"email": "boss@cezaraugusto.net",
|
|
@@ -46,7 +40,7 @@
|
|
|
46
40
|
"typescript"
|
|
47
41
|
],
|
|
48
42
|
"dependencies": {
|
|
49
|
-
"
|
|
43
|
+
"@colors/colors": "^1.6.0",
|
|
50
44
|
"@types/chrome": "^0.0.287",
|
|
51
45
|
"@types/firefox-webext-browser": "^120.0.4",
|
|
52
46
|
"@types/node": "^22.10.1",
|
|
@@ -56,25 +50,30 @@
|
|
|
56
50
|
"semver": "^7.6.3",
|
|
57
51
|
"update-check": "^1.5.4",
|
|
58
52
|
"webextension-polyfill": "^0.12.0",
|
|
59
|
-
"extension-create": "2.0.0-rc.
|
|
60
|
-
"extension-develop": "2.0.0-rc.
|
|
53
|
+
"extension-create": "2.0.0-rc.25",
|
|
54
|
+
"extension-develop": "2.0.0-rc.25"
|
|
61
55
|
},
|
|
62
56
|
"devDependencies": {
|
|
63
|
-
"@
|
|
57
|
+
"@types/jest": "^29.5.14",
|
|
64
58
|
"@types/mock-fs": "^4.13.4",
|
|
65
59
|
"@types/semver": "^7.5.8",
|
|
60
|
+
"jest": "^29.7.0",
|
|
66
61
|
"mock-fs": "^5.4.1",
|
|
62
|
+
"ts-jest": "^29.3.1",
|
|
67
63
|
"tsconfig": "*",
|
|
64
|
+
"tsup": "^8.3.5",
|
|
68
65
|
"typescript": "5.7.2"
|
|
69
66
|
},
|
|
70
67
|
"scripts": {
|
|
71
|
-
"watch": "
|
|
68
|
+
"watch": "pnpm compile --watch",
|
|
72
69
|
"compile:types": "bash install_scripts.sh",
|
|
73
70
|
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
74
|
-
"compile:
|
|
75
|
-
"compile": "
|
|
71
|
+
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
72
|
+
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
73
|
+
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
74
|
+
"compile": "pnpm compile:readme-files && pnpm compile:tailwind-config && pnpm compile:stylelint-config && pnpm compile:cli && pnpm compile:types",
|
|
76
75
|
"clean": "rm -rf dist",
|
|
77
76
|
"test": "echo \"Note: no test specified\" && exit 0",
|
|
78
|
-
"test:cli": "
|
|
77
|
+
"test:cli": "jest __spec__/cli.spec.ts"
|
|
79
78
|
}
|
|
80
79
|
}
|