Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip ignoreURLParametersMatching in workbox wizard --injectManifest #2992

Merged
merged 1 commit into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions packages/workbox-cli/src/lib/questions/ask-questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,32 @@ interface ConfigWithConfigLocation {
export async function askQuestions(
options = {},
): Promise<ConfigWithConfigLocation> {
const isInjectManifest = 'injectManifest' in options;

const globDirectory = await askRootOfWebApp();
const globPatterns = await askExtensionsToCache(globDirectory);
const swSrc = 'injectManifest' in options ? await askSWSrc() : undefined;
const swSrc = isInjectManifest ? await askSWSrc() : undefined;
const swDest = await askSWDest(globDirectory);
const configLocation = await askConfigLocation();
const ignoreURLParametersMatching = await askQueryParametersInStartUrl();
// See https://github.com/GoogleChrome/workbox/issues/2985
const ignoreURLParametersMatching = isInjectManifest
? undefined
: await askQueryParametersInStartUrl();

const config: {[key: string]: any} = {
globDirectory,
globPatterns,
ignoreURLParametersMatching,
swDest,
};

if (swSrc) {
config.swSrc = swSrc;
}

if (ignoreURLParametersMatching) {
config.ignoreURLParametersMatching = ignoreURLParametersMatching;
}

return {
config,
configLocation,
Expand Down
3 changes: 1 addition & 2 deletions test/workbox-cli/node/lib/questions/ask-questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ describe(`[workbox-cli] lib/questions/ask-questions.js`, function () {
globPatterns: 1,
swSrc: 2,
swDest: 3,
ignoreURLParametersMatching: 5,
},
configLocation: 4,
});
expect(stub.callCount).to.eql(6);
expect(stub.callCount).to.eql(5);
});
});