Skip to content

Commit

Permalink
Rename manifest.json to manifest.webmanifest
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Nov 16, 2021
1 parent 6974461 commit 968ec9b
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 35 deletions.
4 changes: 3 additions & 1 deletion src/platforms/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ export class AndroidPlatform extends Platform {
}

private manifestFileName(): string {
return this.options.files?.android?.manifestFileName ?? "manifest.json";
return (
this.options.files?.android?.manifestFileName ?? "manifest.webmanifest"
);
}

private manifest(): FaviconFile {
Expand Down
8 changes: 4 additions & 4 deletions test/__snapshots__/array.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -107,7 +107,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down Expand Up @@ -465,7 +465,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -500,7 +500,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/background.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -107,7 +107,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/default.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -107,7 +107,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/loadManifestWithCredentials.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
],
"html": Array [
"<link rel=\\"manifest\\" href=\\"/manifest.json\\" crossOrigin=\\"use-credentials\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\" crossOrigin=\\"use-credentials\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
8 changes: 4 additions & 4 deletions test/__snapshots__/manifestMaskable.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -161,7 +161,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down Expand Up @@ -555,7 +555,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -590,7 +590,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/manifestRelativePaths.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -103,7 +103,7 @@ Object {
},
],
"html": Array [
"<link rel=\\"manifest\\" href=\\"/favicons/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/favicons/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/meta.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -108,7 +108,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#abc\\">",
"<meta name=\\"application-name\\" content=\\"PWA\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/offset.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -107,7 +107,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/pixelart.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -107,7 +107,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/prefixed.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -107,7 +107,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"https://domain/subdomain/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"https://domain/subdomain/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"https://domain/subdomain/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"https://domain/subdomain/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"https://domain/subdomain/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/stream.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ Object {
],
"type": "Buffer",
},
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": Object {
Expand Down Expand Up @@ -2220,7 +2220,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/svg.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Object {
}
]
}",
"name": "manifest.json",
"name": "manifest.webmanifest",
},
Object {
"contents": "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Expand Down Expand Up @@ -107,7 +107,7 @@ Object {
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"16x16\\" href=\\"/favicon-16x16.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"32x32\\" href=\\"/favicon-32x32.png\\">",
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.json\\">",
"<link rel=\\"manifest\\" href=\\"/manifest.webmanifest\\">",
"<meta name=\\"mobile-web-app-capable\\" content=\\"yes\\">",
"<meta name=\\"theme-color\\" content=\\"#fff\\">",
"<meta name=\\"application-name\\">",
Expand Down
12 changes: 6 additions & 6 deletions test/manifest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it("should not prefer any related applications by default", async () => {
output: { images: false, html: false },
});
const manifestFile = result.files.find(
(file) => file.name === "manifest.json"
(file) => file.name === "manifest.webmanifest"
);

expect(manifestFile).toBeDefined();
Expand Down Expand Up @@ -39,7 +39,7 @@ it("should list preferrable related applications", async () => {
output: { images: false, html: false },
});
const manifestFile = result.files.find(
(file) => file.name === "manifest.json"
(file) => file.name === "manifest.webmanifest"
);

expect(manifestFile).toBeDefined();
Expand All @@ -52,7 +52,7 @@ it("should list preferrable related applications", async () => {
});

it("should allow renaming of manifest", async () => {
// expect.assertions(2);
expect.assertions(2);

const result = await favicons(logo_png, {
output: { images: false, html: false },
Expand All @@ -61,7 +61,7 @@ it("should allow renaming of manifest", async () => {

expect(new Set(filenames)).toEqual(
new Set([
"manifest.json",
"manifest.webmanifest",
"browserconfig.xml",
"yandex-browser-manifest.json",
])
Expand All @@ -70,7 +70,7 @@ it("should allow renaming of manifest", async () => {
const result2 = await favicons(logo_png, {
output: { images: false, html: false },
files: {
android: { manifestFileName: "android-manifest.json" },
android: { manifestFileName: "android-manifest.webmanifest" },
windows: { manifestFileName: "windows-browserconfig.xml" },
yandex: { manifestFileName: "yandex-manifest.json" },
},
Expand All @@ -79,7 +79,7 @@ it("should allow renaming of manifest", async () => {

expect(new Set(filenames2)).toEqual(
new Set([
"android-manifest.json",
"android-manifest.webmanifest",
"windows-browserconfig.xml",
"yandex-manifest.json",
])
Expand Down

0 comments on commit 968ec9b

Please sign in to comment.