-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Prevent opts()
from unsafely exposing a private object and expose a proxy instead
#1921
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
Conversation
opts()
from exposing private object
Bit of a mind dump, take with salt. Leaning towards towards PR and giving this a go in next major version, although no issues reported so low priority. I did wonder about making a shallow clone at the time the code was added (not mentioned): #1102 I have a vague performance concern about code like:
But:
Thinking about traps, a possible trap is people writing mixed code like: .action((options, cmd) => {
if (options)
cmd.setOptionValueWithSource('foo', 'bar', 'my-source');
doSomething(options); // does this include 'bar'? Change in behaviour.
}) |
I see two solutions:
|
A shallow clone does not protect against modification to non-trivial properties. I knew that was the case, and wondering how relevant. Yup! The quick check I did was an array, like for a variadic option. A more complex example is some object created by a custom parser, like say an URL. |
Another idea: make It seems like all difficult problems can be solved by using proxies :) |
I don't think this is relevant, I think the user should expect to receive an object with actual option values and act accordingly (make deep clones if option value mutations are undesired). Also, it would mean too much work to do deep cloning every time |
A proxy is returned only when options-as-properties are disabled.
For consistency, the object returned from
|
…constructor Borrowed from tj#1919. Makes _optionValues the only true storage for option values. Has the added benefit of supporting option names conflicting with instance's properties even when options-as-properties are enabled.
When using options-as-properties: - Added getter and setter for value of version option - Limit setOptionValueWithSource() to registered options
I did some light experimentation, and noticed one slightly odd output: import { Command } from 'commander';
const program = new Command();
program.storeOptionsAsProperties();
program.option('--xyz', 'description');
program.parse();
console.log(program.opts()); 1921 % node index.mjs --xyz
{ undefined: [Getter/Setter], xyz: true } |
Historically the way options were stored on the command object itself caused many problems: #933 The new way of storing the options is in a separate object: #1102. I am not too concerned about exposing the underlying object via A fully private implementation would allow changing the underlying representation (say to a map) without externally visible changes, but having the API at all offers the major benefits. Good enough. |
Gave it a go! 😆 I find it both clever, and slightly alarming, to return the This approach does allow some guardrails and do more than a free-for-all object without an explicit API to make it possible. |
I fixed this in a3f0e28, and even made the property look like a data property despite using getters and setters in the console output.
It would be okay to expose the underlying object without a proxy if setting / deleting an option did not require a change to a different object, namely
With both proxies I've added, the options object could be made available as a property while still supporting both storage modes (
Yes, and it worked!
Yet, it is supported, and I think even subclassing works as expected. I am not sure why you closed the PR to be honest. Is preventing the unsafe exposure something you are not interested in? I would like to open a new PR for this branch since the essence has changed and is now not to change the return value of
Is it okay if I open it? |
I didn't think just making comments would send a clear enough message. I'll explain at some length and hopefully give you some insight into my reasoning. Commander is a widely used and long-lived library with many existing users. I am conservative about changes. I see the goal of the PR as being of low value and more about theoretical correctness than a practical concern. Adding a spread operator: maybe. Changing the actual object returned from the Command constructor, and introducing a subtle layer for every use of the command object, and multiple handler "traps", and potential maintenance complications, and risk of unanticipated breaking changes, and explicit breaking changes with only being able to store known options as properties in legacy programs: no no no no no no.
I don't think that is worthwhile based on my current understanding. The PR template includes in particular:
To expand on that. What problem affecting users are you solving? Is this blocking you, or preventing some reasonable or best practice author patterns? If this supported by your own experience with writing a real program, or been reported as an issue? Is this something that will affect many users and we could help them learn how to do it correctly? Should this be enforced in code or just change documentation? Is this something the maintainers of the library may be concerned about causing more problems in the future? To be clear: holes in the logical behaviour of the library are still of interest! (But making the program more opinionated and stricter will also break some existing users and usages. Are the benefits worthwhile?) |
I'll add a couple of examples of concerns about the depth of these changes. |
You think subclassing works as expected? I expect this was just a casual and honest comment, but this is a big red flag. Neither of us have experience or expertise with I did some reading about // add private property to Command class
class Command extends EventEmitter {
#sequenceNumber = 1;
incrementSequence(value) {
value = value ?? 1;
this.#sequenceNumber += value;
} import { program } from 'commander';
program.incrementSequence(); % node private.mjs
/Users/john/Documents/Sandpits/commander/my-fork/lib/command.js:20
this.#sequenceNumber += value;
^
TypeError: Cannot read private member #sequenceNumber from an object whose class did not declare it
at Proxy.incrementSequence (/Users/john/Documents/Sandpits/commander/my-fork/lib/command.js:20:9)
at file:///Users/john/Documents/Sandpits/commander/issues/1919/private.mjs:2:9
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Node.js v18.16.1 NB: I know that this can potentially be worked around by yet more work in the My point is that adopting a sophisticated pattern has costs and unanticipated side-affects. Working with a plain Class is core JavaScript. I see |
Enough exposition! Hopefully you have a better idea of what I think about as a conservative library maintainer. |
A related issue for me to read later, and for you If you're interested: |
For interest, here is a solution I came up with even before reading into the issue: class Instance {
#secret = 'hedgehog';
constructor() {
return new Proxy(this, {
get(target, key) {
const value = Reflect.get(target, key);
return value instanceof Function ? value.bind(target) : value;
}
});
}
revealSecret() {
console.log(this.#secret);
}
}
const instance = new Instance();
instance.revealSecret(); Update: There are some complications, though.
Update: All the issues can be solved by returning a proxy further up the prototype chain! class InstanceBase {
constructor() {
return new Proxy(this, {});
}
}
class Instance extends InstanceBase {
#secret = 'hedgehog';
revealSecret() {
console.log(this.#secret);
}
}
const instance = new Instance();
instance.revealSecret(); // succeeds
console.log(instance.revealSecret === instance.revealSecret); // true
function someMethod() {}
instance.someMethod = someMethod;
console.log(instance.someMethod === someMethod); // true |
The change ensures the this object used in methods is the proxy from the very beginning. This solves pretty much all issues with returning the proxy from a constructor. For example, private fields can be used now. More details available at: tj#1921 (comment) Additionally, wrong spelling has been fixed in comments.
Now implemented on the branch I wanted this PR to merge, see eb142d8.
I admit my knowledge of proxies is not perfect, but I had already had some exposure to them before adding them here which I had got first and foremost from giving this answer on Stack Overflow 2 years ago, not even hoping it would ever be read by anyone because of how old and specific the question was, but just because I had fun experimenting with this stuff. Now, as I keep experimenting here, my knowledge gets better by the hour. For example, since now the
As you may have noticed by now, I am used to the "code first" approach and let myself indulge in experiments before having a clear idea about what they should end in and unit tests ready. But that doesn't mean I am taking all of this lightly and don't understand the responsibility that comes with making changes to a project of such scale. It is great you pointed me in the right direction by finding the issue with private fields, and that is something that should happen when changes adopting sophisticated tools like this one are discussed. It is definitely worth it to keep looking thoroughly for further problems / unanticipated side effects, but I am honestly beginning to doubt there will be any now when the problem with private fields is fixed, because the solution with a constructor returning the proxy further up the prototype chain seems to be a silver bullet in a way. I will be happy if you prove me wrong, though, and I challenge you to do so :) That would show me I am being a little too careless and would be a good lesson for me. As for me, I personally don't see any way the users could tell they are dealing with a proxy except for the obvious
I am not sure I agree with you on that. I find the way the following code works quite problematic, and not only from the theoretical point of view: program.setOptionValueWithSource('foo', 'bar', 'config');
const optionValues = program.opts();
console.log(program.getOptionValue('foo')); // bar
console.log(program.getOptionValueSource('foo')); // config
optionValues.foo = 'baz';
console.log(program.getOptionValue('foo')); // baz
console.log(program.getOptionValueSource('foo')); // still config, but should be undefined
delete optionValues.foo;
console.log(program.getOptionValue('foo')); // undefined
console.log(program.getOptionValueSource('foo')); // still config, but should be undefined Note that only public methods are used here and, despite that, inconsistent states are reached. That should definitely not be allowed, but the only way to prevent it while keeping the object returned from The first proxy it leads us to is
That is what this PR is all about. No, the issue does not affect many users and has probably never been reported, and deleting an option value like in the example above is not something I have thought of doing in a real application. However, I do think the library should not allow inconsistent states like the ones in the example to be reached, even if it almost never happens in practice.
Setting or deleting an option value without caring about its saved source remaining unchanged is usage that should never have been made possible in the first place since it is simply wrong. To sum up, I still think you gave up on this PR too early. |
The consistency between the modes in the way the return value of If you say this discrepancy is desired because keeping the old approach as backwards compatible as possible is: weil, in that case, there is no need to return a proxy from a constructor as part of this PR, but I still think it's a reasonable change because of the advantages I've named. |
Very interesting and deep commentary on a controversial issue from multiple experts. Thanks. Some divergence between the envisaged uses of Proxy (i.e. membranes) and the way it has been described and used.
I apologise that I did assume you had recently discovered proxies, and were seeing them as solutions everywhere.
I recommend using
Effectively yes. The old approach is still available for backwards compatibility, not as an alternative mechanism for accessing options. (I suspect this may not be a direct response to your comment, but still relevant.)
Short version: I did that. I am still comfortable with it. |
Borrowed from eb142d8 that was supposed to land in the now-closed tj#1921. The change ensures the this object used in Command is the proxy from the very beginning, even in the constructor. This solves pretty much all issues with returning the proxy from a constructor. For example, private fields can be used now. More details available at: tj#1921 (comment) Additionally, the ownKeys() trap and wrong spelling in comments have been fixed (the former change being borrowed from fc927c8).
On the contrary, this is a very useful response. I now reverted 1b94efb (see aweebit@ef54142) to make Check develop...aweebit:feature/opts-return to see the file changes that would be suggested by this PR if it were reopened now. There would be nothing new but a thin layer on top of Do you think just this one proxy use is still problematic? I personally think it is highly unlikely to cause any trouble, including when changes to the language are made. After all, |
opts()
from exposing private objectopts()
from unsafely exposing a private object and expose a proxy instead
Everything is now prepared for a potential reopen, see the updated PR title and description. |
The _version and _versionOptionName properties are initialized to undefined in the constructor. The reasoning is - to make them visible when the Command instance is logged into the console before .version() is called, and not only appear after suddenly - to not break anything if the proxy use for consistent option value handling in the legacy setOptionValueWithSource mode suggested in tj#1919 (and previously in tj#1921) is adopted
This is a sensibly minor use of proxy.
However, still not something I am concerned about fixing at this time. But interesting to know that Copy of relevant code for possible future reference:
|
* Wrap command description in help (tj#1804) * Wrap command description. Replace trimRight by trimEnd. * Preserve empty lines when wrapping * Simplify line end handling * Translate Windows line endings to keep things sane * Bump supported versions (tj#1808) * Update minimum version of node in README (tj#1815) * Update dependencies (tj#1826) * Add Command.options to TypeScript (tj#1827) Make options and commands readonly to discourage direct manipulation. Co-authored-by: Cynthia <[email protected]> Co-authored-by: Marcelo Shima <[email protected]> Co-authored-by: Dmitry Maganov <[email protected]> * *: update dev deps and make tweaks - Update the developer dependencies to their latest versions. - Remove usage of the `--experimental-modules` CLI flag as it's a no-op now. - Change the typings file to make the linters happy. * Update CHANGELOG (tj#1840) * 10.0.0 * Remove unused property (tj#1844) * Assume a string parameter to implies is name of boolean option. (tj#1854) * Link to Help class in configure-help.js and README. * Describe help description wrapping * Add parsing life cycle and hooks * Add new documentation to README * Could be multiple hooks, pluralise * Update CHANGELOG and version for 10.0.1 * ci: add 20.x to `node-version` * Have help command call help directly for subcommands, when possible (tj#1864) * Add npm run-script to README (tj#1872) * trim() input string of .arguments method * Deprecate import from commander/esm.mjs (tj#1887) * Add separate type file for esm per TypeScript guidelines (tj#1886) * Update to minimum of node 16 - update dependencies - fresh package-lock.json * Lint fixes for latest rules * Update CHANGELOG for 11.0.0 * Adjust date * Bump version * Add example of displaying custom usage in subcommand list (tj#1896) * Add example of displaying custom usage in subcommand list * Make example more focused * Bump extra Commander version number in lock file (tj#1905) * Add missing checks for passThroughOptions * Add tests for illegal passThroughOptions * Remove illegal passThroughOptions check deemed unnecessary * Use weaker wording: "broken" instead of "illegal" * Unclutter error message in broken passThrough checks Co-authored-by: John Gee <[email protected]> * Refactor _checkForBrokenPassThrough() to make it instance-aware * Fix grammar in docs * Fix indentation Signed-off-by: abetomo <[email protected]> * Watch for npm package updates with dependabot Signed-off-by: abetomo <[email protected]> * Add note on inherited settings to docs (cherry picked from commit ac955dc) * Improve docs about inherited settings (cherry picked from commit dfe2fc7) Co-authored-by: John Gee <[email protected]> * Fix executableDir() return type * Fix version() parameter type Borrowed from a3f0e28 that was supposed to land in the now-closed tj#1921. * Change initial variable values in test for better error messages (cherry picked from commit 87db4ba) * Do not use undefined long help option flag in legacy code * Revert "Fix version() parameter type" This reverts commit e8bea4a. * Fix help for commands with executable handler & only a short help flag * Throw error on options-as-properties config after setting option values (cherry picked from commit 20c7cfa) * Add test for storeOptionsAsProperties() after setting option value * Call storeOptionsAsProperties() with appropriate parameter value in test * Introduce _getCommandAndAncestors() Replaces getCommandAndParents(): - turned into an instance method - used "ancestors" instead of "parents" because it is more precise (cherry picked from commit aa280af) * Use _getCommandAndAncestors() consistently (cherry picked from commit 777a452) * Use _getCommandAndAncestors() less aggressively Only call when all elements are to be iterated. Resort to manual iteration via .parent in other cases. * Improve chain variable name (tj#1958) * Refactor to wrap invalid argument (tj#1977) Wrap handling command.invalidArgument to simplify calling code * Types for version getter (tj#1982) * Update types since .version() returns version. * Remove extra space * Make OptionValueSource a string with well-known values for auto-complete. (tj#1983) * Move Jest configuration to config file (tj#2005) * Rework option inline doc (tj#2009) * Work-around bug in Jest (tj#2011) Co-authored-by: Wee Bit <[email protected]> * Add public Arguments property (tj#2010) Co-authored-by: Wee Bit <[email protected]> * Bump actions/checkout from 3 to 4 (tj#2012) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Explicitly export factory functions (tj#2013) Co-authored-by: Wee Bit <[email protected]> * Revert factory function reexport (tj#2014) * Replace {any} with {*} as native JSDoc (tj#2015) * Remove default export of global program (tj#2017) * Switch @api private to official JSDoc (tj#2018) * Add more Option and Argument properties to typings (tj#2019) * Refactor type-checking setup (tj#1969) * Refactor type-checking setup * Refactor tsconfig particularly to enable loose check in VSCode, strict checks run separately for type definitions * Simplify includes for tsconfig * Explicitly separate the tsconfig for use with npm run-scripts * Improve comment * Resolved couple of work-in-progress comments * Update tsconfig to recommended node16 lib/module/target * Make checks strict by default and opt-out * Restore broken code to merge later changes * Updates after merge --------- Co-authored-by: Wee Bit <[email protected]> * Drop Node.js 16 (tj#2027) * Exit with non-zero code when subprocess terminated by signal (tj#2023) * Comment out new misuse check until a major version (tj#2026) * Refactor headings (tj#2028) * Update CHANGELOG for 11.1.0 (tj#2025) * Update CHANGELOG for 11.1.0 * add tsconfig refactor to CHANGELOG * Add tentative release date * Add PR reference * Bump version * Restore extra sanity check when enabling storeOptionsAsProperties (tj#2029) * Bump @types/node from 20.2.5 to 20.8.5 (tj#2034) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.2.5 to 20.8.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint from 8.41.0 to 8.51.0 (tj#2033) Bumps [eslint](https://github.com/eslint/eslint) from 8.41.0 to 8.51.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.41.0...v8.51.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/parser from 5.59.7 to 5.62.0 (tj#2030) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.59.7 to 5.62.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.62.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-config-standard from 17.0.0 to 17.1.0 (tj#2031) Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 17.0.0 to 17.1.0. - [Commits](standard/eslint-config-standard@v17.0.0...v17.1.0) --- updated-dependencies: - dependency-name: eslint-config-standard dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/eslint-plugin from 5.59.7 to 6.7.5 (tj#2032) * Bump @typescript-eslint/eslint-plugin from 5.59.7 to 6.7.5 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.59.7 to 6.7.5. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.5/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Fix for `Could not resolve dependency` --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: abetomo <[email protected]> * Add explicit note to only call parse once (tj#2036) * Bump tsd from 0.28.1 to 0.29.0 Bumps [tsd](https://github.com/SamVerschueren/tsd) from 0.28.1 to 0.29.0. - [Release notes](https://github.com/SamVerschueren/tsd/releases) - [Commits](tsdjs/tsd@v0.28.1...v0.29.0) --- updated-dependencies: - dependency-name: tsd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Add migration tips for default import * Bump @types/jest from 29.5.5 to 29.5.6 (tj#2047) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.5 to 29.5.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-plugin-n from 15.7.0 to 16.2.0 (tj#2044) Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 15.7.0 to 16.2.0. - [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases) - [Commits](eslint-community/eslint-plugin-n@15.7.0...16.2.0) --- updated-dependencies: - dependency-name: eslint-plugin-n dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/parser from 6.7.5 to 6.8.0 (tj#2043) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.7.5 to 6.8.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.8.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-plugin-jest from 27.4.2 to 27.4.3 (tj#2045) Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.4.2 to 27.4.3. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](jest-community/eslint-plugin-jest@v27.4.2...v27.4.3) --- updated-dependencies: - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint from 8.51.0 to 8.52.0 (tj#2046) Bumps [eslint](https://github.com/eslint/eslint) from 8.51.0 to 8.52.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.51.0...v8.52.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-plugin-jest from 27.4.3 to 27.6.0 (tj#2049) Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.4.3 to 27.6.0. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](jest-community/eslint-plugin-jest@v27.4.3...v27.6.0) --- updated-dependencies: - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/node from 20.8.6 to 20.8.9 (tj#2052) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.8.6 to 20.8.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/setup-node from 3 to 4 (tj#2054) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/eslint-plugin from 6.7.5 to 6.9.0 (tj#2053) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.7.5 to 6.9.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-plugin-import from 2.28.1 to 2.29.0 (tj#2051) Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.28.1 to 2.29.0. - [Release notes](https://github.com/import-js/eslint-plugin-import/releases) - [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md) - [Commits](import-js/eslint-plugin-import@v2.28.1...v2.29.0) --- updated-dependencies: - dependency-name: eslint-plugin-import dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/parser from 6.8.0 to 6.9.0 (tj#2050) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.8.0 to 6.9.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Change npm package checks in dependabot to monthly (tj#2057) github-actions will remain weekly as it is updated infrequently. * Throw error when add option with clashing flags (tj#2055) * Add check for overlapping command names or aliases (tj#2059) Co-authored-by: aweebit <[email protected]> * Update CHANGELOG for 12.0.0 (tj#2066) * Prepare for prerelease 12.0.0-0 * Bump required version in package-lock * 12.0.0-0 * Bump @types/jest from 29.5.6 to 29.5.7 (tj#2064) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.6 to 29.5.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint from 8.52.0 to 8.53.0 (tj#2061) Bumps [eslint](https://github.com/eslint/eslint) from 8.52.0 to 8.53.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.52.0...v8.53.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/node from 20.8.9 to 20.8.10 (tj#2063) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.8.9 to 20.8.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/eslint-plugin from 6.9.0 to 6.9.1 (tj#2060) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.9.0 to 6.9.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/parser from 6.9.0 to 6.9.1 (tj#2062) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.9.0 to 6.9.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.5.7 to 29.5.8 (tj#2076) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.7 to 29.5.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/node from 20.8.10 to 20.9.0 (tj#2074) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.8.10 to 20.9.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/eslint-plugin from 6.9.1 to 6.10.0 (tj#2072) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.9.1 to 6.10.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.10.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/parser from 6.9.1 to 6.10.0 (tj#2073) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.9.1 to 6.10.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.10.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-plugin-n from 16.2.0 to 16.3.1 (tj#2075) Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 16.2.0 to 16.3.1. - [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases) - [Commits](eslint-community/eslint-plugin-n@16.2.0...16.3.1) --- updated-dependencies: - dependency-name: eslint-plugin-n dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update url per npm advice (tj#2077) * Add Removed section to Deprecated (tj#2078) * Bump eslint from 8.53.0 to 8.54.0 (tj#2082) Bumps [eslint](https://github.com/eslint/eslint) from 8.53.0 to 8.54.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.53.0...v8.54.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-config-standard-with-typescript from 39.1.1 to 40.0.0 (tj#2083) Bumps [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript) from 39.1.1 to 40.0.0. - [Release notes](https://github.com/standard/eslint-config-standard-with-typescript/releases) - [Changelog](https://github.com/standard/eslint-config-standard-with-typescript/blob/master/CHANGELOG.md) - [Commits](mightyiam/eslint-config-love@v39.1.1...v40.0.0) --- updated-dependencies: - dependency-name: eslint-config-standard-with-typescript dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/parser from 6.10.0 to 6.13.1 (tj#2091) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.10.0 to 6.13.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.13.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Rework exitOverride description (tj#2098) * Rework exitOverride description * Fix description to match implementation * Tweak wording again * Take out the first in case people think it is before displaying helper/error. * Improve JSDoc (tj#2103) * Bump github/codeql-action from 2 to 3 (tj#2108) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/eslint-plugin from 6.10.0 to 6.18.0 (tj#2117) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.10.0 to 6.18.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.18.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump typescript from 5.2.2 to 5.3.3 (tj#2100) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.2.2 to 5.3.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v5.2.2...v5.3.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.5.8 to 29.5.11 (tj#2102) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.8 to 29.5.11. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint from 8.54.0 to 8.56.0 (tj#2107) Bumps [eslint](https://github.com/eslint/eslint) from 8.54.0 to 8.56.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.54.0...v8.56.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Refactor help command implementation to hold actual Command (tj#2087) * Refactor help option implementation to hold actual Option (tj#2006) * Add 12.0.0-1 changes to CHANGELOG * 12.0.0-1 * Add links in CHANGELOG * Update dependencies preparing for release (tj#2132) * Update CHANGELOG for v12 (tj#2133) * Bump version to 12.0.0 * Simplify security policy (tj#2150) * Bump @types/node from 20.11.7 to 20.11.16 (tj#2141) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.7 to 20.11.16. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/parser from 6.19.1 to 6.20.0 (tj#2142) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.19.1 to 6.20.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.20.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/eslint-plugin from 6.19.1 to 6.20.0 (tj#2143) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.19.1 to 6.20.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.20.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.5.11 to 29.5.12 (tj#2144) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.11 to 29.5.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use standard import in examples (tj#2168) * ESLint changes preparing for Prettier (tj#2153) Switch from StandardJS to ESLint using flat configuration. Add Prettier and configuration. * Reformat code with Prettier (tj#2180) * Fix: Use `node`-prefixed requires for builtins (tj#2170) Fixes and closes tj#2169 by using Node-prefixed imports. Signed-off-by: Sam Gammon <[email protected]> * Add auto-detection of args when node evaluating script code on command-line (tj#2164) * Wrap all eslint configs in tseslint.config (tj#2182) * Fix some JSDoc lint issues (tj#2181) * Bump typescript from 5.2.2 to 5.4.5 (tj#2189) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.2.2 to 5.4.5. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](microsoft/TypeScript@v5.2.2...v5.4.5) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-plugin-jest from 27.9.0 to 28.3.0 (tj#2188) Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.9.0 to 28.3.0. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](jest-community/eslint-plugin-jest@v27.9.0...v28.3.0) --- updated-dependencies: - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/node from 20.8.9 to 20.12.7 (tj#2187) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.8.9 to 20.12.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/parser from 6.14.0 to 6.21.0 (tj#2179) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.14.0 to 6.21.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.21.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tsd from 0.30.4 to 0.31.0 (tj#2172) Bumps [tsd](https://github.com/tsdjs/tsd) from 0.30.4 to 0.31.0. - [Release notes](https://github.com/tsdjs/tsd/releases) - [Commits](tsdjs/tsd@v0.30.4...v0.31.0) --- updated-dependencies: - dependency-name: tsd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove unimplemented fullDescription from TypeScript (tj#2191) * ci: add 22.x to node-version (tj#2192) * Prepare CHANGELOG for 12.1.0 (tj#2193) * 12.1.0 * disable subcommand execution * disable storeOptionsAsProperties * fork into @exodus/ namespace * chore: disable tests * fixup: remove stray ',' character * chore: update codeql-analysis.yml with exodus branch * chore: pin github actions to hashes, and update dependabot.yml branch * chore: cherry-pick 19fa79f from upstream * chore: ignore unused variables * fixup: lint * fixup: exodus-fork, not exodus-fork-12 --------- Signed-off-by: abetomo <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Sam Gammon <[email protected]> Co-authored-by: John Gee <[email protected]> Co-authored-by: Cynthia <[email protected]> Co-authored-by: Marcelo Shima <[email protected]> Co-authored-by: Dmitry Maganov <[email protected]> Co-authored-by: Mohammed Keyvanzadeh <[email protected]> Co-authored-by: Raine Revere <[email protected]> Co-authored-by: abetomo <[email protected]> Co-authored-by: Александр Шмелев <[email protected]> Co-authored-by: Wee Bit <[email protected]> Co-authored-by: aweebit <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam Gammon <[email protected]> Co-authored-by: Matias Lang <[email protected]>
Problem
opts()
now returns the private_optionValues
object, making changes to it such as property deletion possible, but I don't think they are supposed to be possible. For example, deleting a property would lead to an inconsistent state in which a source is defined in_optionValueSources
for an option value that does not exist anymore.Solution
The PR originally fixed the problem by returning a shallow clone of
_optionValues
fromopts()
(the original #1920 did the same and has only been closed because of a branch rename).However, to still support allowed changes to option values on the object returned from
opts()
and make getting / setting the values through that object consistent with howgetOptionValue()
/setOptionValue()
behave by, for example, setting the source toundefined
when updating the value (but that could also be relevant after #1919 is merged since the way option values are set would differ depending on whether the command is currently being parsed), thus making the change as "non-breaking" as possible and at the same time preventing inconsistencies, a different solution using a proxy with theget()
,set()
,deleteProperty()
anddefineProperty()
traps as the return value ofopts()
has been adopted.It is worth mentioning that no private object is exposed in the current library code when the legacy
storeOptionsAsProperties
mode is enabled. To preserve backwards-compatibility, the return value ofopts()
in that mode is left unchanged.ChangeLog
Changed
opts()
and make getting / setting option values through that object whenstoreOptionsAsProperties
is disabled consistent with how.getOptionValue()
/.setOptionValue()
work