Skip to content

Commit 998098f

Browse files
committed
fix!: Remove transformManfiest option (#1181)
1 parent b6f8789 commit 998098f

File tree

5 files changed

+0
-60
lines changed

5 files changed

+0
-60
lines changed

packages/wxt/src/core/resolve-config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ export async function resolveConfig(
202202
typesDir,
203203
wxtDir,
204204
zip: resolveZipConfig(root, browser, outBaseDir, mergedConfig),
205-
transformManifest: mergedConfig.transformManifest,
206205
analysis: resolveAnalysisConfig(root, mergedConfig),
207206
userConfigMetadata: userConfigMetadata ?? {},
208207
alias,
@@ -251,12 +250,6 @@ async function mergeInlineConfig(
251250
return defu(inline, user);
252251
};
253252

254-
// Merge transformManifest option
255-
const transformManifest: InlineConfig['transformManifest'] = (manifest) => {
256-
userConfig.transformManifest?.(manifest);
257-
inlineConfig.transformManifest?.(manifest);
258-
};
259-
260253
const merged = defu(inlineConfig, userConfig);
261254

262255
// Builders
@@ -269,7 +262,6 @@ async function mergeInlineConfig(
269262
return {
270263
...merged,
271264
// Custom merge values
272-
transformManifest,
273265
imports,
274266
manifest,
275267
...builderConfig,

packages/wxt/src/core/utils/__tests__/manifest.test.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,31 +1113,6 @@ describe('Manifest Utils', () => {
11131113
});
11141114
});
11151115

1116-
describe('transformManifest option', () => {
1117-
it("should call the transformManifest option after the manifest is generated, but before it's returned", async () => {
1118-
const entrypoints: Entrypoint[] = [];
1119-
const buildOutput = fakeBuildOutput();
1120-
const newAuthor = 'Custom Author';
1121-
setFakeWxt({
1122-
config: {
1123-
transformManifest(manifest: any) {
1124-
manifest.author = newAuthor;
1125-
},
1126-
},
1127-
});
1128-
const expected = {
1129-
author: newAuthor,
1130-
};
1131-
1132-
const { manifest: actual } = await generateManifest(
1133-
entrypoints,
1134-
buildOutput,
1135-
);
1136-
1137-
expect(actual).toMatchObject(expected);
1138-
});
1139-
});
1140-
11411116
describe('version', () => {
11421117
it.each(['chrome', 'safari', 'edge'] as const)(
11431118
'should include version and version_name as is on %s',

packages/wxt/src/core/utils/manifest.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ export async function generateManifest(
116116
if (wxt.config.command === 'serve') addDevModeCsp(manifest);
117117
if (wxt.config.command === 'serve') addDevModePermissions(manifest);
118118

119-
// TODO: Remove in v1
120-
wxt.config.transformManifest?.(manifest);
121119
await wxt.hooks.callHook('build:manifestGenerated', wxt, manifest);
122120

123121
if (wxt.config.manifestVersion === 2) {

packages/wxt/src/core/utils/testing/fake-objects.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ export const fakeResolvedConfig = fakeObjectCreator<ResolvedConfig>(() => {
293293
compressionLevel: 9,
294294
zipSources: false,
295295
},
296-
transformManifest: () => {},
297296
userConfigMetadata: {},
298297
alias: {},
299298
experimental: {},

packages/wxt/src/types.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -253,26 +253,6 @@ export interface InlineConfig {
253253
*/
254254
compressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
255255
};
256-
257-
/**
258-
* @deprecated Use `hooks.build.manifestGenerated` to modify your manifest instead. This option
259-
* will be removed in v1.0
260-
*
261-
* Transform the final manifest before it's written to the file system. Edit the `manifest`
262-
* parameter directly, do not return a new object. Return values are ignored.
263-
*
264-
* @example
265-
* defineConfig({
266-
* // Add a CSS-only content script.
267-
* transformManifest(manifest) {
268-
* manifest.content_scripts.push({
269-
* matches: ["*://google.com/*"],
270-
* css: ["content-scripts/some-example.css"],
271-
* });
272-
* }
273-
* })
274-
*/
275-
transformManifest?: (manifest: chrome.runtime.Manifest) => void;
276256
analysis?: {
277257
/**
278258
* Explicitly include bundle analysis when running `wxt build`. This can be overridden by the
@@ -1337,10 +1317,6 @@ export interface ResolvedConfig {
13371317
*/
13381318
zipSources: boolean;
13391319
};
1340-
/**
1341-
* @deprecated Use `build:manifestGenerated` hook instead.
1342-
*/
1343-
transformManifest?: (manifest: chrome.runtime.Manifest) => void;
13441320
analysis: {
13451321
enabled: boolean;
13461322
open: boolean;

0 commit comments

Comments
 (0)