@optique/core 1.0.0-dev.1818 → 1.0.0-dev.1827

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,7 +60,9 @@ type ParserValuePlaceholder = {
60
60
  *
61
61
  * Contexts may optionally implement `Disposable` or `AsyncDisposable` for
62
62
  * cleanup. When present, `runWith()` and `runWithSync()` call the dispose
63
- * method in a `finally` block after parsing completes.
63
+ * method after parsing completes. In async runners, cleanup waits for the
64
+ * full `runWith()` Promise to settle, including later asynchronous
65
+ * `complete()` work.
64
66
  *
65
67
  * @template TRequiredOptions Additional options that `runWith()` must provide
66
68
  * when this context is used. Use `void` (the default) for contexts that
@@ -180,12 +182,16 @@ interface SourceContext<TRequiredOptions = void> {
180
182
  finalizeParsed?(parsed: unknown): unknown;
181
183
  /**
182
184
  * Optional synchronous cleanup method. Called by `runWith()` and
183
- * `runWithSync()` in a `finally` block after parsing completes.
185
+ * `runWithSync()` after parsing completes. In `runWith()`, this happens
186
+ * only after the full Promise settles, including any later async
187
+ * `complete()` work.
184
188
  */
185
189
  [Symbol.dispose]?(): void;
186
190
  /**
187
- * Optional asynchronous cleanup method. Called by `runWith()` in a
188
- * `finally` block after parsing completes. Takes precedence over
191
+ * Optional asynchronous cleanup method. Called by `runWith()` after
192
+ * parsing completes. Cleanup starts only after the full `runWith()`
193
+ * Promise settles, including any later async `complete()` work. Takes
194
+ * precedence over
189
195
  * `[Symbol.dispose]` in async runners. `runWithSync()` also calls this
190
196
  * method when `[Symbol.dispose]` is absent, but throws if it returns a
191
197
  * Promise.
package/dist/context.d.ts CHANGED
@@ -60,7 +60,9 @@ type ParserValuePlaceholder = {
60
60
  *
61
61
  * Contexts may optionally implement `Disposable` or `AsyncDisposable` for
62
62
  * cleanup. When present, `runWith()` and `runWithSync()` call the dispose
63
- * method in a `finally` block after parsing completes.
63
+ * method after parsing completes. In async runners, cleanup waits for the
64
+ * full `runWith()` Promise to settle, including later asynchronous
65
+ * `complete()` work.
64
66
  *
65
67
  * @template TRequiredOptions Additional options that `runWith()` must provide
66
68
  * when this context is used. Use `void` (the default) for contexts that
@@ -180,12 +182,16 @@ interface SourceContext<TRequiredOptions = void> {
180
182
  finalizeParsed?(parsed: unknown): unknown;
181
183
  /**
182
184
  * Optional synchronous cleanup method. Called by `runWith()` and
183
- * `runWithSync()` in a `finally` block after parsing completes.
185
+ * `runWithSync()` after parsing completes. In `runWith()`, this happens
186
+ * only after the full Promise settles, including any later async
187
+ * `complete()` work.
184
188
  */
185
189
  [Symbol.dispose]?(): void;
186
190
  /**
187
- * Optional asynchronous cleanup method. Called by `runWith()` in a
188
- * `finally` block after parsing completes. Takes precedence over
191
+ * Optional asynchronous cleanup method. Called by `runWith()` after
192
+ * parsing completes. Cleanup starts only after the full `runWith()`
193
+ * Promise settles, including any later async `complete()` work. Takes
194
+ * precedence over
189
195
  * `[Symbol.dispose]` in async runners. `runWithSync()` also calls this
190
196
  * method when `[Symbol.dispose]` is absent, but throws if it returns a
191
197
  * Promise.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1818+1aa43bd4",
3
+ "version": "1.0.0-dev.1827+582707f5",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",