Skip to content

Conversation

@perf2711
Copy link
Contributor

@perf2711 perf2711 commented Dec 8, 2023

This PR adds some changes to add-sources:

  • by default, it will now warn about sources that failed to add if the source is not there, and skip it if the source is already in the sourcemap,
    • you can control what happens with failed sources using --source-error-behavior
  • if --force is passed, all sources are treated as if they were not there

Jira task: BT-2080

@perf2711 perf2711 added the enhancement New feature or request label Dec 8, 2023
@perf2711 perf2711 self-assigned this Dec 8, 2023
@perf2711 perf2711 force-pushed the feature/cli-add-sources-error-behavior branch from 8e091a8 to 3b0f066 Compare December 8, 2023 10:45
const skipped: string[] = [];
const failed: string[] = [];

const sourcesContent: string[] = sourceMap.sourcesContent ?? [];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just checking:
if we skip the source content, because someone added a js file without type definition, will sources array be bigger than sourcesContent array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I don't push to this array, I set the indices directly. If the file does not have an original source, the respective source content will be null.

@perf2711 perf2711 merged commit 0a4cfd1 into dev Dec 12, 2023
@perf2711 perf2711 deleted the feature/cli-add-sources-error-behavior branch December 12, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants