Skip to content
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
21 changes: 20 additions & 1 deletion .github/actions/javascript/bumpVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ class CLI {
.map((key) => `[--${key} <value>]`)
.join(' ');
const flagUsage = [...Object.keys(flags), '--yes', '--no', '--help'].map((key) => `[${key.startsWith('--') ? key : `--${key}`}]`).join(' ');
console.log(`\nUsage: npx ts-node ${scriptName} ${flagUsage} ${namedArgUsage} ${positionalUsage}\n`);
console.log(`\nUsage: ${CLI.detectRuntimeCommand()} ${scriptName} ${flagUsage} ${namedArgUsage} ${positionalUsage}\n`);
console.log('Flags:');
for (const [name, spec] of Object.entries(flags)) {
console.log(` --${name.padEnd(20)} ${spec.description}`);
Expand Down Expand Up @@ -2004,6 +2004,25 @@ class CLI {
console.log('');
}
}
/**
* Attempts to detect the command used to invoke the currently-running script, for display in the usage line of the help message.
* Checked in order of most to least reliable signal; falls back to plain `node` if nothing else matches.
*/
static detectRuntimeCommand() {
// Bun's own public, documented signal. Cast needed since @types/node's ProcessVersions type has no `bun` key.
if (process.versions.bun) {
return 'bun';
}
// Internal symbol ts-node sets on `process` when its register hook is active (the same mechanism other tools, e.g. fastify-autoload, rely on to detect ts-node).
if (Reflect.get(process, Symbol.for('ts-node.register.instance'))) {
return 'npx ts-node';
}
// tsx registers its loader hooks via --require/--import flags pointing into its own package, visible in execArgv regardless of how it was installed.
if (process.execArgv.some((arg) => arg.includes('tsx/dist/'))) {
return 'npx tsx';
}
return 'node';
}
static parseStringArg(rawString, paramName, spec) {
if ('parse' in spec && !!spec.parse) {
try {
Expand Down
5 changes: 3 additions & 2 deletions .github/actions/javascript/isDeployChecklistLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9227,6 +9227,7 @@ const CONST = {
ADD_CONTACT_METHOD: 'add_contact_method',
VALIDATE_ACCOUNT: 'validate_account',
REVEAL_CARD_DETAILS: 'reveal_card_details',
REGISTER_AUTHENTICATION_KEY: 'register_authentication_key',
},
EXPENSIFY_CARD: {
FEED_NAME: 'Expensify Card',
Expand Down Expand Up @@ -12784,8 +12785,8 @@ exports["default"] = {
* @returns {number} The amount of tax
*/
calculateTaxFromPercentage(total, percentage) {
const percentageAsDecimal = str_1.default.percentageStringToNumber(percentage) / 100;
const divisor = percentage ? percentageAsDecimal + 1 : 1;
const percentageAsDecimal = percentage ? str_1.default.percentageStringToNumber(percentage) / 100 : 0;
const divisor = percentageAsDecimal + 1;
return this.calculateTaxFromDivisor(total, divisor);
},
/**
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"date-fns-tz": "^3.2.0",
"dom-serializer": "^0.2.2",
"domhandler": "^5.0.3",
"expensify-common": "2.0.191",
"expensify-common": "2.0.195",
"expo": "56.0.8",
"expo-asset": "56.0.15",
"expo-audio": "56.0.11",
Expand Down
Loading