Skip to content
Closed
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
25 changes: 18 additions & 7 deletions js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@
*/

/**
* Serializes command line options into an arguments array.
* Serializes options into an arguments array for the sentry-cli command.
*
* @param {OptionsSchema} schema An options schema required by the command.
* @param {object} options An options object according to the schema.
* @returns {string[]} An arguments array that can be passed via command line.
* @param {OptionsSchema} schema The options schema required by the command.
* @param {Object} options The options object.
* @returns {string[]} An array of command line arguments.
*/
function serializeOptions(schema, options) {
return Object.keys(schema).reduce((newOptions, option) => {
Expand All @@ -208,8 +208,19 @@
return newOptions;
}

const paramType = schema[option].type;
const paramName = schema[option].param;
const schemaEntry = schema[option];
const paramType = schemaEntry.type;
const paramName = schemaEntry.param;

// Handle deprecated options
if (schemaEntry.deprecated) {

Check failure on line 216 in js/helper.js

View workflow job for this annotation

GitHub Actions / Test Node / Type Check

Property 'deprecated' does not exist on type 'OptionSchema'.
if (paramValue) {
console.warn(`Warning: The '${option}' option is deprecated and will be removed in a future version. ` +
`Artifact bundles are now used by default, so this option is no longer needed.`);
}
// Don't add deprecated options to CLI arguments - just return existing options
return newOptions;
}

if (paramType === 'array') {
if (!Array.isArray(paramValue)) {
Expand All @@ -226,7 +237,7 @@
throw new Error(`${option} should be a bool`);
}

const invertedParamName = schema[option].invertedParam;
const invertedParamName = schemaEntry.invertedParam;

if (paramValue && paramName !== undefined) {
return newOptions.concat([paramName]);
Expand Down
4 changes: 3 additions & 1 deletion js/releases/options/uploadSourcemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ module.exports = {
type: 'array',
},
useArtifactBundle: {
param: '--use-artifact-bundle',
// Deprecated option - no param to avoid passing --use-artifact-bundle to CLI
// param: '--use-artifact-bundle', // REMOVED - this flag is deprecated in CLI
type: 'boolean',
deprecated: true, // Custom flag to identify deprecated options
},
};
Loading
Loading