wxt 0.20.13 → 0.20.15
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/browser.d.mts +20 -0
- package/dist/browser.mjs +18 -3
- package/dist/builtin-modules/index.mjs +7 -2
- package/dist/builtin-modules/unimport.mjs +69 -75
- package/dist/cli/cli-utils.mjs +54 -50
- package/dist/cli/commands.mjs +78 -103
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +9 -4
- package/dist/core/{build.d.ts → build.d.mts} +6 -2
- package/dist/core/build.mjs +23 -4
- package/dist/core/builders/vite/index.mjs +293 -343
- package/dist/core/builders/vite/plugins/bundleAnalysis.mjs +11 -12
- package/dist/core/builders/vite/plugins/cssEntrypoints.mjs +27 -20
- package/dist/core/builders/vite/plugins/defineImportMeta.mjs +17 -12
- package/dist/core/builders/vite/plugins/devHtmlPrerender.mjs +105 -136
- package/dist/core/builders/vite/plugins/devServerGlobals.mjs +15 -14
- package/dist/core/builders/vite/plugins/download.mjs +23 -12
- package/dist/core/builders/vite/plugins/entrypointGroupGlobals.mjs +18 -14
- package/dist/core/builders/vite/plugins/extensionApiMock.mjs +31 -33
- package/dist/core/builders/vite/plugins/globals.mjs +14 -13
- package/dist/core/builders/vite/plugins/iifeFooter.mjs +17 -11
- package/dist/core/builders/vite/plugins/index.mjs +18 -16
- package/dist/core/builders/vite/plugins/noopBackground.mjs +21 -15
- package/dist/core/builders/vite/plugins/removeEntrypointMainFunction.mjs +26 -23
- package/dist/core/builders/vite/plugins/resolveAppConfig.mjs +26 -24
- package/dist/core/builders/vite/plugins/resolveVirtualModules.mjs +28 -26
- package/dist/core/builders/vite/plugins/tsconfigPaths.mjs +11 -11
- package/dist/core/builders/vite/plugins/wxtPluginLoader.mjs +42 -47
- package/dist/core/{clean.d.ts → clean.d.mts} +7 -3
- package/dist/core/clean.mjs +38 -35
- package/dist/core/{create-server.d.ts → create-server.d.mts} +6 -2
- package/dist/core/create-server.mjs +236 -247
- package/dist/core/define-config.d.mts +6 -0
- package/dist/core/define-config.mjs +6 -2
- package/dist/core/define-web-ext-config.d.mts +13 -0
- package/dist/core/define-web-ext-config.mjs +16 -7
- package/dist/core/generate-wxt-dir.mjs +110 -148
- package/dist/core/index.d.mts +9 -0
- package/dist/core/index.mjs +12 -8
- package/dist/core/initialize.d.mts +8 -0
- package/dist/core/initialize.mjs +110 -124
- package/dist/core/keyboard-shortcuts.mjs +30 -28
- package/dist/core/package-managers/bun.mjs +18 -16
- package/dist/core/package-managers/deno.mjs +12 -8
- package/dist/core/package-managers/index.mjs +52 -60
- package/dist/core/package-managers/npm.mjs +51 -52
- package/dist/core/package-managers/pnpm.mjs +21 -18
- package/dist/core/package-managers/yarn.mjs +31 -28
- package/dist/core/prepare.d.mts +6 -0
- package/dist/core/prepare.mjs +12 -7
- package/dist/core/resolve-config.mjs +393 -462
- package/dist/core/runners/index.mjs +15 -10
- package/dist/core/runners/manual.mjs +13 -14
- package/dist/core/runners/safari.mjs +13 -14
- package/dist/core/runners/web-ext.mjs +62 -83
- package/dist/core/runners/wsl.mjs +13 -14
- package/dist/core/utils/arrays.mjs +23 -12
- package/dist/core/utils/building/build-entrypoints.mjs +44 -40
- package/dist/core/utils/building/detect-dev-changes.mjs +84 -105
- package/dist/core/utils/building/find-entrypoints.mjs +278 -359
- package/dist/core/utils/building/group-entrypoints.mjs +42 -35
- package/dist/core/utils/building/index.mjs +8 -6
- package/dist/core/utils/building/internal-build.mjs +86 -102
- package/dist/core/utils/building/rebuild.mjs +50 -30
- package/dist/core/utils/cache.mjs +29 -18
- package/dist/core/utils/constants.mjs +9 -1
- package/dist/core/utils/content-scripts.mjs +56 -54
- package/dist/core/utils/content-security-policy.mjs +36 -39
- package/dist/core/utils/entrypoints.mjs +51 -28
- package/dist/core/utils/env.mjs +22 -17
- package/dist/core/utils/environments/browser-environment.mjs +13 -12
- package/dist/core/utils/environments/environment.mjs +36 -33
- package/dist/core/utils/environments/extension-environment.mjs +15 -10
- package/dist/core/utils/environments/index.mjs +4 -2
- package/dist/core/utils/eslint.mjs +11 -10
- package/dist/core/utils/fs.mjs +23 -11
- package/dist/core/utils/globals.mjs +53 -51
- package/dist/core/utils/i18n.mjs +41 -32
- package/dist/core/utils/index.mjs +3 -0
- package/dist/core/utils/log/index.mjs +6 -4
- package/dist/core/utils/log/printBuildSummary.mjs +20 -25
- package/dist/core/utils/log/printFileList.mjs +30 -33
- package/dist/core/utils/log/printHeader.mjs +9 -5
- package/dist/core/utils/log/printTable.mjs +19 -21
- package/dist/core/utils/manifest.mjs +366 -479
- package/dist/core/utils/minimatch-multiple.mjs +26 -15
- package/dist/core/utils/network.mjs +27 -33
- package/dist/core/utils/number.mjs +7 -3
- package/dist/core/utils/package.mjs +20 -13
- package/dist/core/utils/paths.d.mts +8 -0
- package/dist/core/utils/paths.mjs +26 -7
- package/dist/core/utils/strings.mjs +19 -14
- package/dist/core/utils/syntax-errors.mjs +14 -16
- package/dist/core/utils/time.mjs +19 -15
- package/dist/core/utils/transform.mjs +129 -160
- package/dist/core/utils/types.d.mts +6 -0
- package/dist/core/utils/validation.mjs +43 -50
- package/dist/core/utils/virtual-modules.mjs +20 -12
- package/dist/core/utils/wsl.mjs +11 -3
- package/dist/core/wxt.mjs +65 -60
- package/dist/core/{zip.d.ts → zip.d.mts} +6 -2
- package/dist/core/zip.mjs +118 -140
- package/dist/index.d.mts +13 -0
- package/dist/index.mjs +13 -3
- package/dist/{modules.d.ts → modules.d.mts} +14 -16
- package/dist/modules.mjs +179 -51
- package/dist/testing/fake-browser.d.mts +2 -0
- package/dist/testing/fake-browser.mjs +3 -1
- package/dist/testing/index.d.mts +3 -0
- package/dist/testing/index.mjs +4 -2
- package/dist/testing/{wxt-vitest-plugin.d.ts → wxt-vitest-plugin.d.mts} +7 -9
- package/dist/testing/wxt-vitest-plugin.mjs +38 -19
- package/dist/types.d.mts +1475 -0
- package/dist/utils/app-config.d.mts +6 -0
- package/dist/utils/app-config.mjs +8 -2
- package/dist/utils/content-script-context.d.mts +134 -0
- package/dist/utils/content-script-context.mjs +187 -175
- package/dist/utils/content-script-ui/iframe.d.mts +42 -0
- package/dist/utils/content-script-ui/iframe.mjs +42 -27
- package/dist/utils/content-script-ui/integrated.d.mts +37 -0
- package/dist/utils/content-script-ui/integrated.mjs +36 -29
- package/dist/utils/content-script-ui/shadow-root.d.mts +80 -0
- package/dist/utils/content-script-ui/shadow-root.mjs +75 -82
- package/dist/utils/content-script-ui/shared.mjs +115 -150
- package/dist/utils/content-script-ui/types.d.mts +107 -0
- package/dist/utils/content-script-ui/types.mjs +1 -0
- package/dist/utils/{define-app-config.d.ts → define-app-config.d.mts} +5 -3
- package/dist/utils/define-app-config.mjs +22 -2
- package/dist/utils/define-background.d.mts +7 -0
- package/dist/utils/define-background.mjs +7 -3
- package/dist/utils/define-content-script.d.mts +6 -0
- package/dist/utils/define-content-script.mjs +6 -2
- package/dist/utils/define-unlisted-script.d.mts +7 -0
- package/dist/utils/define-unlisted-script.mjs +7 -3
- package/dist/utils/define-wxt-plugin.d.mts +6 -0
- package/dist/utils/define-wxt-plugin.mjs +6 -2
- package/dist/utils/inject-script.d.mts +41 -0
- package/dist/utils/inject-script.mjs +44 -34
- package/dist/utils/internal/custom-events.d.mts +9 -0
- package/dist/utils/internal/custom-events.mjs +18 -10
- package/dist/utils/internal/location-watcher.mjs +23 -20
- package/dist/utils/internal/logger.mjs +15 -12
- package/dist/utils/match-patterns.d.mts +1 -0
- package/dist/utils/match-patterns.mjs +3 -1
- package/dist/utils/{split-shadow-root-css.d.ts → split-shadow-root-css.d.mts} +6 -3
- package/dist/utils/split-shadow-root-css.mjs +16 -7
- package/dist/utils/storage.d.mts +1 -0
- package/dist/utils/storage.mjs +3 -1
- package/dist/version.d.mts +4 -0
- package/dist/version.mjs +5 -1
- package/dist/virtual/background-entrypoint.d.mts +4 -0
- package/dist/virtual/background-entrypoint.mjs +143 -161
- package/dist/virtual/content-script-isolated-world-entrypoint.d.mts +4 -0
- package/dist/virtual/content-script-isolated-world-entrypoint.mjs +26 -27
- package/dist/virtual/content-script-main-world-entrypoint.d.mts +4 -0
- package/dist/virtual/content-script-main-world-entrypoint.mjs +24 -24
- package/dist/virtual/mock-browser.d.mts +6 -0
- package/dist/virtual/mock-browser.mjs +5 -3
- package/dist/virtual/reload-html.d.mts +1 -0
- package/dist/virtual/reload-html.mjs +57 -53
- package/dist/virtual/unlisted-script-entrypoint.d.mts +4 -0
- package/dist/virtual/unlisted-script-entrypoint.mjs +35 -43
- package/package.json +56 -50
- package/dist/browser.d.ts +0 -30
- package/dist/builtin-modules/index.d.ts +0 -2
- package/dist/builtin-modules/unimport.d.ts +0 -5
- package/dist/cli/cli-utils.d.ts +0 -25
- package/dist/cli/commands.d.ts +0 -2
- package/dist/cli/index.d.ts +0 -1
- package/dist/core/builders/vite/index.d.ts +0 -7
- package/dist/core/builders/vite/plugins/bundleAnalysis.d.ts +0 -7
- package/dist/core/builders/vite/plugins/cssEntrypoints.d.ts +0 -13
- package/dist/core/builders/vite/plugins/defineImportMeta.d.ts +0 -14
- package/dist/core/builders/vite/plugins/devHtmlPrerender.d.ts +0 -7
- package/dist/core/builders/vite/plugins/devServerGlobals.d.ts +0 -6
- package/dist/core/builders/vite/plugins/download.d.ts +0 -10
- package/dist/core/builders/vite/plugins/entrypointGroupGlobals.d.ts +0 -6
- package/dist/core/builders/vite/plugins/extensionApiMock.d.ts +0 -6
- package/dist/core/builders/vite/plugins/globals.d.ts +0 -3
- package/dist/core/builders/vite/plugins/iifeFooter.d.ts +0 -8
- package/dist/core/builders/vite/plugins/index.d.ts +0 -16
- package/dist/core/builders/vite/plugins/noopBackground.d.ts +0 -6
- package/dist/core/builders/vite/plugins/removeEntrypointMainFunction.d.ts +0 -6
- package/dist/core/builders/vite/plugins/resolveAppConfig.d.ts +0 -6
- package/dist/core/builders/vite/plugins/resolveVirtualModules.d.ts +0 -6
- package/dist/core/builders/vite/plugins/tsconfigPaths.d.ts +0 -3
- package/dist/core/builders/vite/plugins/wxtPluginLoader.d.ts +0 -6
- package/dist/core/define-config.d.ts +0 -2
- package/dist/core/define-web-ext-config.d.ts +0 -9
- package/dist/core/generate-wxt-dir.d.ts +0 -5
- package/dist/core/index.d.ts +0 -8
- package/dist/core/initialize.d.ts +0 -5
- package/dist/core/keyboard-shortcuts.d.ts +0 -12
- package/dist/core/package-managers/bun.d.ts +0 -2
- package/dist/core/package-managers/deno.d.ts +0 -2
- package/dist/core/package-managers/index.d.ts +0 -2
- package/dist/core/package-managers/npm.d.ts +0 -17
- package/dist/core/package-managers/pnpm.d.ts +0 -2
- package/dist/core/package-managers/types.d.ts +0 -2
- package/dist/core/package-managers/types.mjs +0 -0
- package/dist/core/package-managers/yarn.d.ts +0 -2
- package/dist/core/prepare.d.ts +0 -2
- package/dist/core/resolve-config.d.ts +0 -11
- package/dist/core/runners/index.d.ts +0 -2
- package/dist/core/runners/manual.d.ts +0 -5
- package/dist/core/runners/safari.d.ts +0 -5
- package/dist/core/runners/web-ext.d.ts +0 -5
- package/dist/core/runners/wsl.d.ts +0 -5
- package/dist/core/utils/arrays.d.ts +0 -13
- package/dist/core/utils/building/build-entrypoints.d.ts +0 -3
- package/dist/core/utils/building/detect-dev-changes.d.ts +0 -61
- package/dist/core/utils/building/find-entrypoints.d.ts +0 -5
- package/dist/core/utils/building/group-entrypoints.d.ts +0 -8
- package/dist/core/utils/building/index.d.ts +0 -6
- package/dist/core/utils/building/internal-build.d.ts +0 -12
- package/dist/core/utils/building/rebuild.d.ts +0 -23
- package/dist/core/utils/cache.d.ts +0 -8
- package/dist/core/utils/cli.d.ts +0 -3
- package/dist/core/utils/cli.mjs +0 -26
- package/dist/core/utils/constants.d.ts +0 -5
- package/dist/core/utils/content-scripts.d.ts +0 -12
- package/dist/core/utils/content-security-policy.d.ts +0 -14
- package/dist/core/utils/entrypoints.d.ts +0 -31
- package/dist/core/utils/env.d.ts +0 -5
- package/dist/core/utils/environments/browser-environment.d.ts +0 -3
- package/dist/core/utils/environments/environment.d.ts +0 -8
- package/dist/core/utils/environments/extension-environment.d.ts +0 -6
- package/dist/core/utils/environments/index.d.ts +0 -2
- package/dist/core/utils/eslint.d.ts +0 -1
- package/dist/core/utils/fs.d.ts +0 -13
- package/dist/core/utils/globals.d.ts +0 -11
- package/dist/core/utils/i18n.d.ts +0 -11
- package/dist/core/utils/log/index.d.ts +0 -4
- package/dist/core/utils/log/printBuildSummary.d.ts +0 -2
- package/dist/core/utils/log/printFileList.d.ts +0 -1
- package/dist/core/utils/log/printHeader.d.ts +0 -1
- package/dist/core/utils/log/printTable.d.ts +0 -1
- package/dist/core/utils/manifest.d.ts +0 -40
- package/dist/core/utils/minimatch-multiple.d.ts +0 -15
- package/dist/core/utils/network.d.ts +0 -7
- package/dist/core/utils/number.d.ts +0 -1
- package/dist/core/utils/package.d.ts +0 -6
- package/dist/core/utils/paths.d.ts +0 -11
- package/dist/core/utils/strings.d.ts +0 -14
- package/dist/core/utils/syntax-errors.d.ts +0 -11
- package/dist/core/utils/testing/fake-objects.d.ts +0 -11665
- package/dist/core/utils/testing/fake-objects.mjs +0 -326
- package/dist/core/utils/time.d.ts +0 -9
- package/dist/core/utils/transform.d.ts +0 -11
- package/dist/core/utils/types.d.ts +0 -13
- package/dist/core/utils/types.mjs +0 -0
- package/dist/core/utils/validation.d.ts +0 -15
- package/dist/core/utils/virtual-modules.d.ts +0 -22
- package/dist/core/utils/wsl.d.ts +0 -4
- package/dist/core/wxt.d.ts +0 -24
- package/dist/index.d.ts +0 -11
- package/dist/testing/fake-browser.d.ts +0 -10
- package/dist/testing/index.d.ts +0 -10
- package/dist/types.d.ts +0 -1459
- package/dist/types.mjs +0 -0
- package/dist/utils/app-config.d.ts +0 -2
- package/dist/utils/content-script-context.d.ts +0 -134
- package/dist/utils/content-script-ui/iframe.d.ts +0 -32
- package/dist/utils/content-script-ui/integrated.d.ts +0 -34
- package/dist/utils/content-script-ui/shadow-root.d.ts +0 -76
- package/dist/utils/content-script-ui/shared.d.ts +0 -5
- package/dist/utils/content-script-ui/types.d.ts +0 -104
- package/dist/utils/define-background.d.ts +0 -4
- package/dist/utils/define-content-script.d.ts +0 -3
- package/dist/utils/define-unlisted-script.d.ts +0 -4
- package/dist/utils/define-wxt-plugin.d.ts +0 -3
- package/dist/utils/inject-script.d.ts +0 -36
- package/dist/utils/internal/custom-events.d.ts +0 -10
- package/dist/utils/internal/dev-server-websocket.d.ts +0 -21
- package/dist/utils/internal/dev-server-websocket.mjs +0 -37
- package/dist/utils/internal/location-watcher.d.ts +0 -12
- package/dist/utils/internal/logger.d.ts +0 -9
- package/dist/utils/match-patterns.d.ts +0 -5
- package/dist/utils/storage.d.ts +0 -5
- package/dist/version.d.ts +0 -1
|
@@ -1,55 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
errorCount,
|
|
19
|
-
warningCount
|
|
20
|
-
};
|
|
1
|
+
//#region src/core/utils/validation.ts
|
|
2
|
+
function validateEntrypoints(entrypoints) {
|
|
3
|
+
const errors = entrypoints.flatMap((entrypoint) => {
|
|
4
|
+
switch (entrypoint.type) {
|
|
5
|
+
case "content-script": return validateContentScriptEntrypoint(entrypoint);
|
|
6
|
+
default: return validateBaseEntrypoint(entrypoint);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
let errorCount = 0;
|
|
10
|
+
let warningCount = 0;
|
|
11
|
+
for (const err of errors) if (err.type === "warning") warningCount++;
|
|
12
|
+
else errorCount++;
|
|
13
|
+
return {
|
|
14
|
+
errors,
|
|
15
|
+
errorCount,
|
|
16
|
+
warningCount
|
|
17
|
+
};
|
|
21
18
|
}
|
|
22
19
|
function validateContentScriptEntrypoint(definition) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
return errors;
|
|
20
|
+
const errors = validateBaseEntrypoint(definition);
|
|
21
|
+
if (definition.options.registration !== "runtime" && definition.options.matches == null) errors.push({
|
|
22
|
+
type: "error",
|
|
23
|
+
message: "`matches` is required for manifest registered content scripts",
|
|
24
|
+
value: definition.options.matches,
|
|
25
|
+
entrypoint: definition
|
|
26
|
+
});
|
|
27
|
+
return errors;
|
|
33
28
|
}
|
|
34
29
|
function validateBaseEntrypoint(definition) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
entrypoint: definition
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return errors;
|
|
53
|
-
}
|
|
54
|
-
export class ValidationError extends Error {
|
|
30
|
+
const errors = [];
|
|
31
|
+
if (definition.options.exclude != null && !Array.isArray(definition.options.exclude)) errors.push({
|
|
32
|
+
type: "error",
|
|
33
|
+
message: "`exclude` must be an array of browser names",
|
|
34
|
+
value: definition.options.exclude,
|
|
35
|
+
entrypoint: definition
|
|
36
|
+
});
|
|
37
|
+
if (definition.options.include != null && !Array.isArray(definition.options.include)) errors.push({
|
|
38
|
+
type: "error",
|
|
39
|
+
message: "`include` must be an array of browser names",
|
|
40
|
+
value: definition.options.include,
|
|
41
|
+
entrypoint: definition
|
|
42
|
+
});
|
|
43
|
+
return errors;
|
|
55
44
|
}
|
|
45
|
+
var ValidationError = class extends Error {};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { ValidationError, validateEntrypoints };
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region src/core/utils/virtual-modules.ts
|
|
2
|
+
const virtualEntrypointTypes = [
|
|
3
|
+
"content-script-main-world",
|
|
4
|
+
"content-script-isolated-world",
|
|
5
|
+
"background",
|
|
6
|
+
"unlisted-script"
|
|
6
7
|
];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
/**
|
|
9
|
+
* All the names of entrypoint files in the `src/virtual/` and `dist/virtual/` directories, minus the extension.
|
|
10
|
+
*/
|
|
11
|
+
const virtualEntrypointModuleNames = virtualEntrypointTypes.map((name) => `${name}-entrypoint`);
|
|
12
|
+
/**
|
|
13
|
+
* All the names of files in the `src/virtual/` and `dist/virtual/` directories, minus the extension.
|
|
14
|
+
*/
|
|
15
|
+
const virtualModuleNames = [
|
|
16
|
+
...virtualEntrypointModuleNames,
|
|
17
|
+
"mock-browser",
|
|
18
|
+
"reload-html"
|
|
14
19
|
];
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { virtualModuleNames };
|
package/dist/core/utils/wsl.mjs
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import isWsl_ from "is-wsl";
|
|
2
|
+
|
|
3
|
+
//#region src/core/utils/wsl.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns true when running on WSL or WSL2.
|
|
6
|
+
*/
|
|
7
|
+
function isWsl() {
|
|
8
|
+
return isWsl_;
|
|
4
9
|
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { isWsl };
|
package/dist/core/wxt.mjs
CHANGED
|
@@ -1,69 +1,74 @@
|
|
|
1
|
+
import { builtinModules } from "../builtin-modules/index.mjs";
|
|
1
2
|
import { resolveConfig } from "./resolve-config.mjs";
|
|
2
|
-
import { createHooks } from "hookable";
|
|
3
3
|
import { createWxtPackageManager } from "./package-managers/index.mjs";
|
|
4
4
|
import { createViteBuilder } from "./builders/vite/index.mjs";
|
|
5
|
-
import { builtinModules } from "../builtin-modules/index.mjs";
|
|
6
5
|
import { relative } from "path";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
6
|
+
import { createHooks } from "hookable";
|
|
7
|
+
|
|
8
|
+
//#region src/core/wxt.ts
|
|
9
|
+
/**
|
|
10
|
+
* Global variable set once `createWxt` is called once. Since this variable is used everywhere, this
|
|
11
|
+
* global can be used instead of passing the variable as a function parameter everywhere.
|
|
12
|
+
*/
|
|
13
|
+
let wxt;
|
|
14
|
+
/**
|
|
15
|
+
* Create and register a global instance of the Wxt interface for use throughout the project.
|
|
16
|
+
*/
|
|
17
|
+
async function registerWxt(command, inlineConfig = {}) {
|
|
18
|
+
process.env.NODE_ENV ??= inlineConfig.mode ?? (command === "serve" ? "development" : "production");
|
|
19
|
+
const hooks = createHooks();
|
|
20
|
+
const config = await resolveConfig(inlineConfig, command);
|
|
21
|
+
const [builder, pm] = await Promise.all([createViteBuilder(config, hooks, () => wxt.server), createWxtPackageManager(config.root)]);
|
|
22
|
+
wxt = {
|
|
23
|
+
config,
|
|
24
|
+
hooks,
|
|
25
|
+
hook: hooks.hook.bind(hooks),
|
|
26
|
+
get logger() {
|
|
27
|
+
return config.logger;
|
|
28
|
+
},
|
|
29
|
+
async reloadConfig() {
|
|
30
|
+
if (wxt.config.dev.server?.port) {
|
|
31
|
+
inlineConfig.dev ??= {};
|
|
32
|
+
inlineConfig.dev.server ??= {};
|
|
33
|
+
inlineConfig.dev.server.port = wxt.config.dev.server.port;
|
|
34
|
+
}
|
|
35
|
+
wxt.config = await resolveConfig(inlineConfig, command);
|
|
36
|
+
await wxt.hooks.callHook("config:resolved", wxt);
|
|
37
|
+
},
|
|
38
|
+
pm,
|
|
39
|
+
builder,
|
|
40
|
+
server: void 0
|
|
41
|
+
};
|
|
42
|
+
await initWxtModules();
|
|
35
43
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
await wxt.hooks.callHook("ready", wxt);
|
|
54
|
-
await wxt.hooks.callHook("config:resolved", wxt);
|
|
44
|
+
async function initWxtModules() {
|
|
45
|
+
for (const mod of builtinModules) await initWxtModule(mod);
|
|
46
|
+
for (const mod of wxt.config.userModules) await initWxtModule(mod);
|
|
47
|
+
wxt.hooks.addHooks(wxt.config.hooks);
|
|
48
|
+
if (wxt.config.debug) {
|
|
49
|
+
const order = [
|
|
50
|
+
...builtinModules.map((module) => module.name),
|
|
51
|
+
...wxt.config.userModules.map((module) => relative(wxt.config.root, module.id)),
|
|
52
|
+
"wxt.config.ts > hooks"
|
|
53
|
+
];
|
|
54
|
+
wxt.logger.debug("Hook execution order:");
|
|
55
|
+
order.forEach((name, i) => {
|
|
56
|
+
wxt.logger.debug(` ${i + 1}. ${name}`);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
await wxt.hooks.callHook("ready", wxt);
|
|
60
|
+
await wxt.hooks.callHook("config:resolved", wxt);
|
|
55
61
|
}
|
|
56
62
|
async function initWxtModule(module) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
wxt,
|
|
60
|
-
// @ts-expect-error: Untyped configKey field
|
|
61
|
-
module.configKey ? wxt.config[module.configKey] : void 0
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
export function deinitWxtModules() {
|
|
65
|
-
wxt.hooks.removeAllHooks();
|
|
63
|
+
if (module.hooks) wxt.hooks.addHooks(module.hooks);
|
|
64
|
+
await module.setup?.(wxt, module.configKey ? wxt.config[module.configKey] : void 0);
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Unloads WXT modules.
|
|
68
|
+
*/
|
|
69
|
+
function deinitWxtModules() {
|
|
70
|
+
wxt.hooks.removeAllHooks();
|
|
69
71
|
}
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { deinitWxtModules, initWxtModules, registerWxt, wxt };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { InlineConfig } from
|
|
1
|
+
import { InlineConfig } from "../types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/core/zip.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Build and zip the extension for distribution.
|
|
4
6
|
* @param config Optional config that will override your `<root>/wxt.config.ts`.
|
|
5
7
|
* @returns A list of all files included in the ZIP.
|
|
6
8
|
*/
|
|
7
|
-
|
|
9
|
+
declare function zip(config?: InlineConfig): Promise<string[]>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { zip };
|
package/dist/core/zip.mjs
CHANGED
|
@@ -1,150 +1,128 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { safeFilename } from "./utils/strings.mjs";
|
|
4
|
-
import { getPackageJson } from "./utils/package.mjs";
|
|
1
|
+
import { normalizePath } from "./utils/paths.mjs";
|
|
2
|
+
import "./utils/index.mjs";
|
|
5
3
|
import { formatDuration } from "./utils/time.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { findEntrypoints, internalBuild } from "./utils/building/index.mjs";
|
|
4
|
+
import { safeFilename } from "./utils/strings.mjs";
|
|
8
5
|
import { registerWxt, wxt } from "./wxt.mjs";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import { findEntrypoints } from "./utils/building/find-entrypoints.mjs";
|
|
7
|
+
import { printFileList } from "./utils/log/printFileList.mjs";
|
|
8
|
+
import "./utils/log/index.mjs";
|
|
9
|
+
import { getPackageJson } from "./utils/package.mjs";
|
|
10
|
+
import { internalBuild } from "./utils/building/internal-build.mjs";
|
|
11
|
+
import "./utils/building/index.mjs";
|
|
12
12
|
import { minimatchMultiple } from "./utils/minimatch-multiple.mjs";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
await wxt.hooks.callHook("zip:sources:done", wxt, sourcesZipPath);
|
|
63
|
-
}
|
|
64
|
-
await printFileList(
|
|
65
|
-
wxt.logger.success,
|
|
66
|
-
`Zipped extension in ${formatDuration(Date.now() - start)}`,
|
|
67
|
-
wxt.config.outBaseDir,
|
|
68
|
-
zipFiles
|
|
69
|
-
);
|
|
70
|
-
await wxt.hooks.callHook("zip:done", wxt, zipFiles);
|
|
71
|
-
return zipFiles;
|
|
13
|
+
import fs from "fs-extra";
|
|
14
|
+
import glob from "fast-glob";
|
|
15
|
+
import path from "node:path";
|
|
16
|
+
import JSZip from "jszip";
|
|
17
|
+
|
|
18
|
+
//#region src/core/zip.ts
|
|
19
|
+
/**
|
|
20
|
+
* Build and zip the extension for distribution.
|
|
21
|
+
* @param config Optional config that will override your `<root>/wxt.config.ts`.
|
|
22
|
+
* @returns A list of all files included in the ZIP.
|
|
23
|
+
*/
|
|
24
|
+
async function zip(config) {
|
|
25
|
+
await registerWxt("build", config);
|
|
26
|
+
const output = await internalBuild();
|
|
27
|
+
await wxt.hooks.callHook("zip:start", wxt);
|
|
28
|
+
const start = Date.now();
|
|
29
|
+
wxt.logger.info("Zipping extension...");
|
|
30
|
+
const zipFiles = [];
|
|
31
|
+
const packageJson = await getPackageJson();
|
|
32
|
+
const projectName = wxt.config.zip.name ?? safeFilename(packageJson?.name || path.basename(process.cwd()));
|
|
33
|
+
const applyTemplate = (template) => template.replaceAll("{{name}}", projectName).replaceAll("{{browser}}", wxt.config.browser).replaceAll("{{version}}", output.manifest.version_name ?? output.manifest.version).replaceAll("{{packageVersion}}", packageJson?.version).replaceAll("{{mode}}", wxt.config.mode).replaceAll("{{manifestVersion}}", `mv${wxt.config.manifestVersion}`);
|
|
34
|
+
await fs.ensureDir(wxt.config.outBaseDir);
|
|
35
|
+
await wxt.hooks.callHook("zip:extension:start", wxt);
|
|
36
|
+
const outZipFilename = applyTemplate(wxt.config.zip.artifactTemplate);
|
|
37
|
+
const outZipPath = path.resolve(wxt.config.outBaseDir, outZipFilename);
|
|
38
|
+
await zipDir(wxt.config.outDir, outZipPath, { exclude: wxt.config.zip.exclude });
|
|
39
|
+
zipFiles.push(outZipPath);
|
|
40
|
+
await wxt.hooks.callHook("zip:extension:done", wxt, outZipPath);
|
|
41
|
+
if (wxt.config.zip.zipSources) {
|
|
42
|
+
const skippedEntrypoints = (await findEntrypoints()).filter((entry) => entry.skipped);
|
|
43
|
+
const excludeSources = [...wxt.config.zip.excludeSources, ...skippedEntrypoints.map((entry) => path.relative(wxt.config.zip.sourcesRoot, entry.inputPath))].map((paths) => paths.replaceAll("\\", "/"));
|
|
44
|
+
await wxt.hooks.callHook("zip:sources:start", wxt);
|
|
45
|
+
const { overrides, files: downloadedPackages } = await downloadPrivatePackages();
|
|
46
|
+
const sourcesZipFilename = applyTemplate(wxt.config.zip.sourcesTemplate);
|
|
47
|
+
const sourcesZipPath = path.resolve(wxt.config.outBaseDir, sourcesZipFilename);
|
|
48
|
+
await zipDir(wxt.config.zip.sourcesRoot, sourcesZipPath, {
|
|
49
|
+
include: wxt.config.zip.includeSources,
|
|
50
|
+
exclude: excludeSources,
|
|
51
|
+
transform(absolutePath, zipPath, content) {
|
|
52
|
+
if (zipPath.endsWith("package.json")) return addOverridesToPackageJson(absolutePath, content, overrides);
|
|
53
|
+
},
|
|
54
|
+
additionalFiles: downloadedPackages
|
|
55
|
+
});
|
|
56
|
+
zipFiles.push(sourcesZipPath);
|
|
57
|
+
await wxt.hooks.callHook("zip:sources:done", wxt, sourcesZipPath);
|
|
58
|
+
}
|
|
59
|
+
await printFileList(wxt.logger.success, `Zipped extension in ${formatDuration(Date.now() - start)}`, wxt.config.outBaseDir, zipFiles);
|
|
60
|
+
await wxt.hooks.callHook("zip:done", wxt, zipFiles);
|
|
61
|
+
return zipFiles;
|
|
72
62
|
}
|
|
73
63
|
async function zipDir(directory, outputPath, options) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
await options?.additionalWork?.(archive);
|
|
103
|
-
await new Promise(
|
|
104
|
-
(resolve, reject) => archive.generateNodeStream({
|
|
105
|
-
type: "nodebuffer",
|
|
106
|
-
...wxt.config.zip.compressionLevel === 0 ? { compression: "STORE" } : {
|
|
107
|
-
compression: "DEFLATE",
|
|
108
|
-
compressionOptions: { level: wxt.config.zip.compressionLevel }
|
|
109
|
-
}
|
|
110
|
-
}).pipe(fs.createWriteStream(outputPath)).on("error", reject).on("close", resolve)
|
|
111
|
-
);
|
|
64
|
+
const archive = new JSZip();
|
|
65
|
+
const filesToZip = [...(await glob(["**/*", ...options?.include || []], {
|
|
66
|
+
cwd: directory,
|
|
67
|
+
ignore: ["**/node_modules"],
|
|
68
|
+
onlyFiles: true
|
|
69
|
+
})).filter((relativePath) => {
|
|
70
|
+
return minimatchMultiple(relativePath, options?.include) || !minimatchMultiple(relativePath, options?.exclude);
|
|
71
|
+
}), ...(options?.additionalFiles ?? []).map((file) => path.relative(directory, file))];
|
|
72
|
+
for (const file of filesToZip) {
|
|
73
|
+
const absolutePath = path.resolve(directory, file);
|
|
74
|
+
if (file.endsWith(".json")) {
|
|
75
|
+
const content = await fs.readFile(absolutePath, "utf-8");
|
|
76
|
+
archive.file(file, await options?.transform?.(absolutePath, file, content) || content);
|
|
77
|
+
} else {
|
|
78
|
+
const content = await fs.readFile(absolutePath);
|
|
79
|
+
archive.file(file, content);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
await options?.additionalWork?.(archive);
|
|
83
|
+
await new Promise((resolve, reject) => archive.generateNodeStream({
|
|
84
|
+
type: "nodebuffer",
|
|
85
|
+
...wxt.config.zip.compressionLevel === 0 ? { compression: "STORE" } : {
|
|
86
|
+
compression: "DEFLATE",
|
|
87
|
+
compressionOptions: { level: wxt.config.zip.compressionLevel }
|
|
88
|
+
}
|
|
89
|
+
}).pipe(fs.createWriteStream(outputPath)).on("error", reject).on("close", resolve));
|
|
112
90
|
}
|
|
113
91
|
async function downloadPrivatePackages() {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return { overrides, files };
|
|
92
|
+
const overrides = {};
|
|
93
|
+
const files = [];
|
|
94
|
+
if (wxt.config.zip.downloadPackages.length > 0) {
|
|
95
|
+
const _downloadPackages = new Set(wxt.config.zip.downloadPackages);
|
|
96
|
+
const downloadPackages = (await wxt.pm.listDependencies({
|
|
97
|
+
all: true,
|
|
98
|
+
cwd: wxt.config.root
|
|
99
|
+
})).filter((pkg) => _downloadPackages.has(pkg.name));
|
|
100
|
+
for (const pkg of downloadPackages) {
|
|
101
|
+
wxt.logger.info(`Downloading package: ${pkg.name}@${pkg.version}`);
|
|
102
|
+
const id = `${pkg.name}@${pkg.version}`;
|
|
103
|
+
const tgzPath = await wxt.pm.downloadDependency(id, wxt.config.zip.downloadedPackagesDir);
|
|
104
|
+
files.push(tgzPath);
|
|
105
|
+
overrides[id] = tgzPath;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
overrides,
|
|
110
|
+
files
|
|
111
|
+
};
|
|
137
112
|
}
|
|
138
113
|
function addOverridesToPackageJson(absolutePackageJsonPath, content, overrides) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
114
|
+
if (Object.keys(overrides).length === 0) return content;
|
|
115
|
+
const packageJsonDir = path.dirname(absolutePackageJsonPath);
|
|
116
|
+
const oldPackage = JSON.parse(content);
|
|
117
|
+
const newPackage = {
|
|
118
|
+
...oldPackage,
|
|
119
|
+
[wxt.pm.overridesKey]: { ...oldPackage[wxt.pm.overridesKey] }
|
|
120
|
+
};
|
|
121
|
+
Object.entries(overrides).forEach(([key, absolutePath]) => {
|
|
122
|
+
newPackage[wxt.pm.overridesKey][key] = "file://./" + normalizePath(path.relative(packageJsonDir, absolutePath));
|
|
123
|
+
});
|
|
124
|
+
return JSON.stringify(newPackage, null, 2);
|
|
150
125
|
}
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
export { zip };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BackgroundDefinition, BackgroundEntrypoint, BackgroundEntrypointOptions, BaseContentScriptEntrypointOptions, BaseEntrypoint, BaseEntrypointOptions, BuildOutput, BuildStepOutput, ConfigEnv, ContentScriptDefinition, ContentScriptEntrypoint, CopiedPublicFile, Dependency, Entrypoint, EntrypointGroup, EntrypointInfo, EslintGlobalsPropValue, Eslintrc, ExtensionRunner, ExtensionRunnerConfig, FsCache, GeneratedPublicFile, GenericEntrypoint, HookResult, InlineConfig, IsolatedWorldContentScriptDefinition, IsolatedWorldContentScriptEntrypointOptions, Logger, MainWorldContentScriptDefinition, MainWorldContentScriptEntrypointOptions, OnContentScriptStopped, OptionsEntrypoint, OptionsEntrypointOptions, OutputAsset, OutputChunk, OutputFile, PerBrowserMap, PerBrowserOption, PopupEntrypoint, PopupEntrypointOptions, ReloadContentScriptPayload, ResolvedBasePublicFile, ResolvedConfig, ResolvedEslintrc, ResolvedPerBrowserOptions, ResolvedPublicFile, ServerInfo, SidepanelEntrypoint, SidepanelEntrypointOptions, TargetBrowser, TargetManifestVersion, ThemeIcon, UnlistedScriptDefinition, UserConfig, UserManifest, UserManifestFn, WebExtConfig, Wxt, WxtBuilder, WxtBuilderServer, WxtCommand, WxtDevServer, WxtDirEntry, WxtDirFileEntry, WxtDirTypeReferenceEntry, WxtHooks, WxtModule, WxtModuleOptions, WxtModuleSetup, WxtModuleWithMetadata, WxtPackageManager, WxtPlugin, WxtResolvedUnimportOptions, WxtUnimportOptions, WxtViteConfig } from "./types.mjs";
|
|
2
|
+
import { build } from "./core/build.mjs";
|
|
3
|
+
import { clean } from "./core/clean.mjs";
|
|
4
|
+
import { defineConfig } from "./core/define-config.mjs";
|
|
5
|
+
import { defineRunnerConfig, defineWebExtConfig } from "./core/define-web-ext-config.mjs";
|
|
6
|
+
import { createServer } from "./core/create-server.mjs";
|
|
7
|
+
import { initialize } from "./core/initialize.mjs";
|
|
8
|
+
import { prepare } from "./core/prepare.mjs";
|
|
9
|
+
import { zip } from "./core/zip.mjs";
|
|
10
|
+
import { normalizePath } from "./core/utils/paths.mjs";
|
|
11
|
+
import "./core/index.mjs";
|
|
12
|
+
import { version } from "./version.mjs";
|
|
13
|
+
export { BackgroundDefinition, BackgroundEntrypoint, BackgroundEntrypointOptions, BaseContentScriptEntrypointOptions, BaseEntrypoint, BaseEntrypointOptions, BuildOutput, BuildStepOutput, ConfigEnv, ContentScriptDefinition, ContentScriptEntrypoint, CopiedPublicFile, Dependency, Entrypoint, EntrypointGroup, EntrypointInfo, EslintGlobalsPropValue, Eslintrc, ExtensionRunner, ExtensionRunnerConfig, FsCache, GeneratedPublicFile, GenericEntrypoint, HookResult, InlineConfig, IsolatedWorldContentScriptDefinition, IsolatedWorldContentScriptEntrypointOptions, Logger, MainWorldContentScriptDefinition, MainWorldContentScriptEntrypointOptions, OnContentScriptStopped, OptionsEntrypoint, OptionsEntrypointOptions, OutputAsset, OutputChunk, OutputFile, PerBrowserMap, PerBrowserOption, PopupEntrypoint, PopupEntrypointOptions, ReloadContentScriptPayload, ResolvedBasePublicFile, ResolvedConfig, ResolvedEslintrc, ResolvedPerBrowserOptions, ResolvedPublicFile, ServerInfo, SidepanelEntrypoint, SidepanelEntrypointOptions, TargetBrowser, TargetManifestVersion, ThemeIcon, UnlistedScriptDefinition, UserConfig, UserManifest, UserManifestFn, WebExtConfig, Wxt, WxtBuilder, WxtBuilderServer, WxtCommand, WxtDevServer, WxtDirEntry, WxtDirFileEntry, WxtDirTypeReferenceEntry, WxtHooks, WxtModule, WxtModuleOptions, WxtModuleSetup, WxtModuleWithMetadata, WxtPackageManager, WxtPlugin, WxtResolvedUnimportOptions, WxtUnimportOptions, WxtViteConfig, build, clean, createServer, defineConfig, defineRunnerConfig, defineWebExtConfig, initialize, normalizePath, prepare, version, zip };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { normalizePath } from "./core/utils/paths.mjs";
|
|
2
|
+
import { version } from "./version.mjs";
|
|
3
|
+
import { build } from "./core/build.mjs";
|
|
4
|
+
import { clean } from "./core/clean.mjs";
|
|
5
|
+
import { defineConfig } from "./core/define-config.mjs";
|
|
6
|
+
import { defineRunnerConfig, defineWebExtConfig } from "./core/define-web-ext-config.mjs";
|
|
7
|
+
import { createServer } from "./core/create-server.mjs";
|
|
8
|
+
import { initialize } from "./core/initialize.mjs";
|
|
9
|
+
import { prepare } from "./core/prepare.mjs";
|
|
10
|
+
import { zip } from "./core/zip.mjs";
|
|
11
|
+
import "./core/index.mjs";
|
|
12
|
+
|
|
13
|
+
export { build, clean, createServer, defineConfig, defineRunnerConfig, defineWebExtConfig, initialize, normalizePath, prepare, version, zip };
|