Offer CLI option to exclude/include tasks in UI5 server#1447
Open
RandomByte wants to merge 4 commits into
Open
Offer CLI option to exclude/include tasks in UI5 server#1447RandomByte wants to merge 4 commits into
RandomByte wants to merge 4 commits into
Conversation
9c94ab3 to
e701002
Compare
Accept 'includedTasks' and 'excludedTasks' on serve()'s options and pass them through to graph.serve() as-is. The hardcoded exclusion list that used to live here (minify, generateLibraryPreload, generateComponentPreload, generateBundle) is dropped: the dev server now runs the same task set as a regular build unless the caller opts out via 'excludedTasks'. Enables the follow-up 'ui5 serve --include-task' / '--exclude-task' plumbing in @ui5/cli.
Both 'ui5 build' and 'ui5 serve' trigger a build internally and honour the same task filters, but until now only 'build' exposed the CLI flags. Add an 'applyBuildOptions(cli)' helper to lib/cli/options.js — same pattern as the existing 'applyProjectConfigOptions' / 'applyWorkspaceOptions' — and call it from both commands. 'serve.handler' forwards the values into the server config under the API names 'includedTasks' / 'excludedTasks' (mirroring 'build.handler'). Combined with the sibling refactor in @ui5/server, this means 'ui5 serve --exclude-task buildThemes' or 'ui5 serve --include-task minify' now Do The Right Thing. Existing serve-command tests asserted deepEqual on the full config bag passed to @ui5/server.serve — those blocks now include 'includedTasks: undefined, excludedTasks: undefined'. A new test covers the flags flowing through the handler.
4987642 to
bc590b1
Compare
The dev server no longer skips 'minify', 'generateLibraryPreload', 'generateComponentPreload', or 'generateBundle', so two main.js assertions on application.a's built output need adjusting: - /versionTest.js now carries the //# sourceMappingURL trailer appended by 'minify'. - The root index of application.a lists 15 entries instead of 9: the extra six come from 'minify' (test-dbg.js, test.js.map, versionTest-dbg.js, versionTest.js.map) and 'generateComponentPreload' (Component-preload.js, Component-preload.js.map).
ccdeedb to
5290d1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: CPOUI5FOUNDATION-1276