@opetope/lint 0.15.0 → 0.16.0

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.
@@ -1,2 +1,2 @@
1
- const e={commandLane:'`lane` is now a member of `concurrency`: write `concurrency: lane`, `concurrency: { by, lane }` for a keyed queue, or `concurrency: { lane, pending: "latest" }` where `policy: "latest"` stood beside it. Which of the three this record meant is in what it wrote together, so nothing here is rewritten for you (D387).',commandLatest:'`concurrency: "latest"` is now `concurrency: { pending: "latest" }`, and `{ lane, pending: "latest" }` where the queue is shared. The word named the input that wins and never named what it wins, so the place is written out: one waiting slot at the end of the lane, taken by a newer input while the body in flight is left to finish. Nothing else about the policy moved (D459).',commandInputArgs:"`{{word}}` is no longer published: a wrapper of `runCommand` forwards `...args: {{replacement}}<Input, Keys>` from `@opetope/runtime/testing`, and a wrapper of `CommandHook.run` forwards `...args: Parameters<CommandHook<Input, Output>['run']>` (D510, D517).",commandName:"`{{word}}` is now `{{replacement}}`: one word for a command, everywhere. The primitive was the last place the vocabulary still said `Call`, while the hook was already `useCommand` and the outcome `CommandOutcome`. There is no alias (D385).",commandOnce:"`once` is now `memoize`: it caches a successful result, it does not stop after one run. `addEventListener(type, handler, { once: true })` is what the platform means by the word, and it is not what this option ever did (D389).",commandOutcomeStatus:'`status` is now `kind` on a `CommandOutcome`: one word for the discriminant of a settled answer, the one `ResourceState`, `ResourceOperationOutcome`, `ResourceCommitOutcome`, `PaginationOutcome` and a screen result already carry. The three branches are unchanged \u2014 `{ kind: "ok", value }`, `{ kind: "failed", error }`, `{ kind: "cancelled", reason }` (D411).',commandPolicy:'`policy` is now `concurrency`: one word for the order the runs take, written as `queue`, `parallel`, a lane or `{ pending: "latest" }`. Where `queueBy` or `lane` stood beside it the three collapse into one value \u2014 `{ by }`, `{ by, lane }` or `{ lane, pending: "latest" }` \u2014 so the shape depends on which of them this record wrote, and that is why this rule names the word instead of rewriting it (D387, D459).',commandQueueBy:"`queueBy` is now a member of `concurrency`: write `concurrency: { by: input => key }`, or `concurrency: { by, lane }` where a lane stood beside it (D387).",conditionFrom:"`from` of `defineCondition` is now `source`: write `defineCondition(id, { select, source })`. One word names the dependency a node reads \u2014 `resource.load({ source })` and `attach(source)` already say it, and this node's own refusals said `Condition source` about the field they called `from` (D410, D411).",contextCall:"`call` is now `command`: `ctx.command(run, options?)` in a model, `own.command(within, run, options?)` in a feature. The body takes one argument, its context, and reads the declared input off it as `input` \u2014 and `Input` is inferred from every position of the call except the body, so it is written in the cheapest that fits: the result type of a model factory names it in the literal it returns, an annotated option names it (`dedupe: (deposit: Deposit) => \u2026`), a constant names it (`const refill: Command<Refill, void> = ctx.command(\u2026)`), and the annotation of that context \u2014 `({ input, update }: ModelCommandContext<Deposit>)` in a model, `({ input, source }: FeatureCommandContext<typeof within, Deposit>)` in a feature \u2014 is what is left; a feature has the last two only. `command<Deposit>(\u2026)` is not a position: it pins `Output` to its default (D385, D386, D444, D455).",contextCalls:'`ctx.calls` and `own.calls` are now `ctx.select` and `own.select`: declaring a body and selecting a command a dependency already declares are two mechanisms, so they are two words. `select(source, "name")` answers one command and `select(source, ["a", "b"])` a record of them (D388).',contributionWhen:"`when` of a contribution is now `enabled`: write `slot(target, value, { enabled })`, and the same at `pipe` and `register`. A truth the runtime reads while the node exists is `enabled`, at a contribution and at a Resource alike; `when` names the declared `Condition`s of `defineFeature({ when })` (D378, D411, D517).",deliveryKey:'Inside a delivery record `key` is now `by`: `{ pending: "latest", by }` keeps one waiting place per key instead of one for the whole node (D374).',deliveryKind:'Inside a delivery record `kind` is now `pending`: `kind: "latest"` is `pending: "latest"`, and `kind: "queue"` is `pending: "all"` \u2014 the backlog only an event has. The discriminant moved because with one dimension shared by both nodes, the discriminant is that dimension (D374).',deliveryReject:'`overflow: "reject"` is now `overflow: "drop"`: one word at both nodes for \xABthe new one does not enter and `emit` answers `false`\xBB. `"flush-oldest"` is unchanged and still the default of a keyed delivery (D369, D411).',effectOnDispose:"`onDispose` is now `finalize`: an effect has two releases \u2014 the disposer a run returns, and the one the node itself gets once \u2014 and an `on*` prefix did not tell them apart. No word of the authoring vocabulary carries that prefix any more (D379).",effectSkipInitial:"`skipInitial` is now `initial`, and the polarity is inverted: `skipInitial: true` is `initial: false`, and `initial` defaults to `true`. Both words are booleans, so carrying the value across unchanged compiles and means the opposite \u2014 which is why this rule names it and leaves the rewrite to you (D379).",entryMoved:"At `{{from}}`, {{names}} changed: {{verb}} {{them}} from {{to}}. {{reason}} {{how}} ({{decision}}).",entryRenamed:"At `{{from}}`, {{names}} changed spelling. {{reason}} {{how}} ({{decision}}).",effectWhen:"`when` at an effect is now `filter` or `initial`, and which one depends on what the predicate asks. A predicate that selects values is `filter: (current, previous) => \u2026`; a predicate whose whole job is to refuse the first run \u2014 `(_current, previous) => previous !== undefined` \u2014 is `initial: false`. This rule does not guess between them. `defineFeature.when` still names declared Conditions; at a contribution it is now `enabled` (D379, D411, D517).",eventBackpressure:'`backpressure` is now `delivery`: one word at both nodes that admit a producer. Write `delivery: "latest"` for one waiting place that the newest payload takes, or the record \u2014 `{ pending, by }`, `{ pending, capacity, overflow }` \u2014 for the rest (D374).',featureOwnMember:"`{{word}}` is removed from Feature own. Declare this behavior with `own.model(Model, deps, (ctx, deps) => ({ ... }))`. In that model, {{replacement}} (D501).",reactFeatureDemand:"`{{word}}` is removed from `@opetope/react/integration` until a public producer of feature demand exists. A contribution boundary remains `ContributionBoundary` (D500).",reactUseSelector:"`useSelector` is removed. In a model selection use `read(source, project)`; for a standalone source create `derive(source, project, { equals })` once in a model, at module scope or with `useMemo` by key, then pass it to `useReadable`. Move the old `equals` option to `derive` (D500).",externalPublish:"`publish` on a proven Kit ExternalSource is now `set`, the same write verb as testReadable (D502).",fromExternal:"`externalReadable` is now `fromExternal`: `from*` names where a `Readable` comes from, beside `fromMaybe`. The old name was built from its result, which every word of that module already answers (D380).",linkSourcePending:"`pending` on a proven Navigation LinkSource is now `intent`: it retains the latest value until its generation is acknowledged. Kit Inbox.pending is unchanged (D512).",paginateNextCursor:"`nextCursor` is now `cursor`: `resource.paginate(resource, { cursor, load, merge })`. TypeScript reads the members of one record in the order they are written, and the selector of the cursor has to come before `load`, so it is named to sort first \u2014 the alphabetical order `sort-keys` keeps is the one that infers with no annotation (D486).",navigatorPolicy:"`NavigatorPolicy` is now `NavigatorCatalogue`, and `surface.policy` is now `surface.catalogue`: this is four callbacks a navigator asks, and D291 made a policy data \u2014 a word when it has no parameters, a record when it has them (D411).",resourceActivity:"`ResourceActivity` is retired at both entries that spelled it. From `@opetope/devtools` it is `ResourceNodeActivity`, of `@opetope/devtools/protocol` now (D411, D495). From `@opetope/core` it is gone: a state answers what failed and what is working in two fields of its own, so read `state.failure` and `state.pending` instead of a union that flattened them (D462).",resourceDisposer:"`ResourceDisposer` is now `Disposer`: one name for `() => Awaitable<void>`, which three of them used to spell \u2014 `Disposer`, `ResourceDisposer` and `FeatureDisposer`. It travels on `@opetope/core/internal` beside `Awaitable` (D411).",resourceInvalidate:"`invalidate()` is now `reset()`: it clears the whole cache, drops the current data, opens a new epoch and restarts every configured channel. Everywhere else `invalidate` means \xABmark stale, keep the data\xBB, so the old name promised the opposite of what the verb does; it now names no operation of a Resource at all (D373).",resourceExecutionHold:"`acquire(view)` of a command, effect or event context is now `hold(view)`: it holds the view until that execution ends. Rename it by hand, the destructured name included; public `Resource.acquire()` keeps its name (D514).",resourceFallback:"`initial` in the options of `resource.view` is now `fallback`: it is published whenever the selected Resource has no data, not just at first materialization. `--fix` renames it on a proven model context; a shared options record or an unproven context is renamed by hand (D514).",resourceHold:"`ModelContext.acquire(view)` is now `hold(view)`: the context holds Resource demand for its model; public `Resource.acquire()` still creates a lease and keeps its own name. A destructured member or an unproven context is renamed by hand (D514).",resourceLifetime:"Resource lifetime `'owner'` is now `'model'`: the model owns the Resource while it is active. `--fix` renames the literal on a proven model context; a shared options record or an unproven context is renamed by hand (D514).",resourceLifetimeType:"The Resource lifetime type argument `'owner'` is now `'model'`; the `Owned*` type names remain (D514).",resourcePartition:"`identity.scope` is now `identity.partition`: changing it clears the whole Resource cache; partitions are not kept side by side. `--fix` renames it on a proven model context; a shared options record or an unproven context is renamed by hand (D514).",resourcePagination:"`pagination` is no longer a field of a declaration: apply it to the Resource the declaration answers, `const pages = ctx.resource.paginate(ctx.resource.load({ \u2026 }), { cursor, load, merge })`, in the model that declares it. The one `load` of the pages takes the cursor, `nextCursor` is `cursor`, and a feature that pages holds its Resource in a model it owns (D486).",runtimeInternalEntry:"`{{word}}` is published by `{{replacement}}`: import it from there. Three names were published by both entries and every consumer took the internal copy, so the copies are gone and the names are not (D411, D415).",scopeKeyed:"`scope.keyed(source, open, { key })` is now `scope.each(source, key, open)`: `each` says what the node does, one child per element, and the key is required \u2014 so it stands between the list it identifies and the child it opens. The trailing record is gone, which makes this a move and not only a rename (D378).",scopeWhileWhen:"`when` in `scope.while(source, open, { when })` is now `filter`: it selects source values while one child remains open. `defineFeature.when` still names declared Conditions (D517).",stateActivity:"No `ResourceState` carries `activity` any more: the union said what a channel was doing and what had failed in one word. Read `state.failure` \u2014 `undefined` is \xABnothing failed\xBB, and otherwise `channel` names the channel that died and `error` carries its failure \u2014 and `state.pending` for the channel with work in flight. Both are declared on every member, so neither needs a narrowing by `kind` first (D462).",surfaceView:"`view` on a proven Navigation Surface is now `regions`: it returns the stable record of region targets for one declared screen (D512).",useCommands:"`useCommands` is gone: a record of command consumers comes from `useModel(Declaration, select)`, which has an owner and a lifetime. One command is still `useCommand` (D388)."};export{e as RETIRED_MESSAGES};
1
+ const e={commandLane:'`lane` is now a member of `concurrency`: write `concurrency: lane`, `concurrency: { by, lane }` for a keyed queue, or `concurrency: { lane, pending: "latest" }` where `policy: "latest"` stood beside it. Which of the three this record meant is in what it wrote together, so nothing here is rewritten for you (D387).',commandLatest:'`concurrency: "latest"` is now `concurrency: { pending: "latest" }`, and `{ lane, pending: "latest" }` where the queue is shared. The word named the input that wins and never named what it wins, so the place is written out: one waiting slot at the end of the lane, taken by a newer input while the body in flight is left to finish. Nothing else about the policy moved (D459).',commandInputArgs:"`{{word}}` is no longer published: a wrapper of `runCommand` forwards `...args: {{replacement}}<Input, Keys>` from `@opetope/runtime/testing`, and a wrapper of `CommandHook.run` forwards `...args: Parameters<CommandHook<Input, Output>['run']>` (D510, D517).",commandName:"`{{word}}` is now `{{replacement}}`: one word for a command, everywhere. The primitive was the last place the vocabulary still said `Call`, while the hook was already `useCommand` and the outcome `CommandOutcome`. There is no alias (D385).",commandOnce:"`once` is now `memoize`: it caches a successful result, it does not stop after one run. `addEventListener(type, handler, { once: true })` is what the platform means by the word, and it is not what this option ever did (D389).",commandOutcomeStatus:'`status` is now `kind` on a `CommandOutcome`: one word for the discriminant of a settled answer, the one `ResourceState`, `ResourceOperationOutcome`, `ResourceCommitOutcome`, `PaginationOutcome` and a screen result already carry. The three branches are unchanged \u2014 `{ kind: "ok", value }`, `{ kind: "failed", error }`, `{ kind: "cancelled", reason }` (D411).',commandPolicy:'`policy` is now `concurrency`: one word for the order the runs take, written as `queue`, `parallel`, a lane or `{ pending: "latest" }`. Where `queueBy` or `lane` stood beside it the three collapse into one value \u2014 `{ by }`, `{ by, lane }` or `{ lane, pending: "latest" }` \u2014 so the shape depends on which of them this record wrote, and that is why this rule names the word instead of rewriting it (D387, D459).',commandQueueBy:"`queueBy` is now a member of `concurrency`: write `concurrency: { by: input => key }`, or `concurrency: { by, lane }` where a lane stood beside it (D387).",conditionFrom:"`from` of `defineCondition` is now `source`: write `defineCondition(id, { select, source })`. One word names the dependency a node reads \u2014 `resource.load({ source })` and `attach(source)` already say it, and this node's own refusals said `Condition source` about the field they called `from` (D410, D411).",contextCall:"`call` is now `command`: `ctx.command(run, options?)` in a model, `own.command(within, run, options?)` in a feature. The body takes one argument, its context, and reads the declared input off it as `input` \u2014 and `Input` is inferred from every position of the call except the body, so it is written in the cheapest that fits: the result type of a model factory names it in the literal it returns, an annotated option names it (`dedupe: (deposit: Deposit) => \u2026`), a constant names it (`const refill: Command<Refill, void> = ctx.command(\u2026)`), and the annotation of that context \u2014 `({ input, update }: ModelCommandContext<Deposit>)` in a model, `({ input, source }: FeatureCommandContext<typeof within, Deposit>)` in a feature \u2014 is what is left; a feature has the last two only. `command<Deposit>(\u2026)` is not a position: it pins `Output` to its default (D385, D386, D444, D455).",contextCalls:'`ctx.calls` and `own.calls` are now `ctx.select` and `own.select`: declaring a body and selecting a command a dependency already declares are two mechanisms, so they are two words. `select(source, "name")` answers one command and `select(source, ["a", "b"])` a record of them (D388).',contributionWhen:"`when` of a contribution is now `enabled`: write `slot(target, value, { enabled })`, and the same at `pipe` and `register`. A truth the runtime reads while the node exists is `enabled`, at a contribution and at a Resource alike; `when` names the declared `Condition`s of `defineFeature({ when })` (D378, D411, D517).",deliveryKey:'Inside a delivery record `key` is now `by`: `{ pending: "latest", by }` keeps one waiting place per key instead of one for the whole node (D374).',deliveryKind:'Inside a delivery record `kind` is now `pending`: `kind: "latest"` is `pending: "latest"`, and `kind: "queue"` is `pending: "all"` \u2014 the backlog only an event has. The discriminant moved because with one dimension shared by both nodes, the discriminant is that dimension (D374).',deliveryReject:'`overflow: "reject"` is now `overflow: "drop"`: one word at both nodes for \xABthe new one does not enter and `emit` answers `false`\xBB. `"flush-oldest"` is unchanged and still the default of a keyed delivery (D369, D411).',effectOnDispose:"`onDispose` is now `finalize`: an effect has two releases \u2014 the disposer a run returns, and the one the node itself gets once \u2014 and an `on*` prefix did not tell them apart. No word of the authoring vocabulary carries that prefix any more (D379).",effectSkipInitial:"`skipInitial` is now `initial`, and the polarity is inverted: `skipInitial: true` is `initial: false`, and `initial` defaults to `true`. Both words are booleans, so carrying the value across unchanged compiles and means the opposite \u2014 which is why this rule names it and leaves the rewrite to you (D379).",entryMoved:"At `{{from}}`, {{names}} changed: {{verb}} {{them}} from {{to}}. {{reason}} {{how}} ({{decision}}).",entryRenamed:"At `{{from}}`, {{names}} changed spelling. {{reason}} {{how}} ({{decision}}).",effectWhen:"`when` at an effect is now `filter` or `initial`, and which one depends on what the predicate asks. A predicate that selects values is `filter: (current, previous) => \u2026`; a predicate whose whole job is to refuse the first run \u2014 `(_current, previous) => previous !== undefined` \u2014 is `initial: false`. This rule does not guess between them. `defineFeature.when` still names declared Conditions; at a contribution it is now `enabled` (D379, D411, D517).",eventBackpressure:'`backpressure` is now `delivery`: one word at both nodes that admit a producer. Write `delivery: "latest"` for one waiting place that the newest payload takes, or the record \u2014 `{ pending, by }`, `{ pending, capacity, overflow }` \u2014 for the rest (D374).',featureBodyOf:"`FeatureBodyOf` is retired: write the body as `export default defineFeature.body(header, { own, exports, provides })`, which types each section from the header, in the module the header loads with `body: () => import('./feature.body')`. The header reads its exports from that default export, so no file annotates the body (D542).",featureOwnMember:"`{{word}}` is removed from Feature own. Declare this behavior with `own.model(Model, deps, (ctx, deps) => ({ ... }))`. In that model, {{replacement}} (D501).",reactFeatureDemand:"`{{word}}` is removed from `@opetope/react/integration` until a public producer of feature demand exists. A contribution boundary remains `ContributionBoundary` (D500).",reactUseSelector:"`useSelector` is removed. In a model selection use `read(source, project)`; for a standalone source create `derive(source, project, { equals })` once in a model, at module scope or with `useMemo` by key, then pass it to `useReadable`. Move the old `equals` option to `derive` (D500).",externalPublish:"`publish` on a proven Kit ExternalSource is now `set`, the same write verb as testReadable (D502).",fromExternal:"`externalReadable` is now `fromExternal`: `from*` names where a `Readable` comes from, beside `fromMaybe`. The old name was built from its result, which every word of that module already answers (D380).",linkSourcePending:"`pending` on a proven Navigation LinkSource is now `intent`: it retains the latest value until its generation is acknowledged. Kit Inbox.pending is unchanged (D512).",paginateNextCursor:"`nextCursor` is now `cursor`: `resource.paginate(resource, { cursor, load, merge })`. TypeScript reads the members of one record in the order they are written, and the selector of the cursor has to come before `load`, so it is named to sort first \u2014 the alphabetical order `sort-keys` keeps is the one that infers with no annotation (D486).",navigatorPolicy:"`NavigatorPolicy` is now `NavigatorCatalogue`, and `surface.policy` is now `surface.catalogue`: this is four callbacks a navigator asks, and D291 made a policy data \u2014 a word when it has no parameters, a record when it has them (D411).",resourceActivity:"`ResourceActivity` is retired at both entries that spelled it. From `@opetope/devtools` it is `ResourceNodeActivity`, of `@opetope/devtools/protocol` now (D411, D495). From `@opetope/core` it is gone: a state answers what failed and what is working in two fields of its own, so read `state.failure` and `state.pending` instead of a union that flattened them (D462).",resourceDisposer:"`ResourceDisposer` is now `Disposer`: one name for `() => Awaitable<void>`, which three of them used to spell \u2014 `Disposer`, `ResourceDisposer` and `FeatureDisposer`. It travels on `@opetope/core/internal` beside `Awaitable` (D411).",resourceInvalidate:"`invalidate()` is now `reset()`: it clears the whole cache, drops the current data, opens a new epoch and restarts every configured channel. Everywhere else `invalidate` means \xABmark stale, keep the data\xBB, so the old name promised the opposite of what the verb does; it now names no operation of a Resource at all (D373).",resourceExecutionHold:"`acquire(view)` of a command, effect or event context is now `hold(view)`: it holds the view until that execution ends. Rename it by hand, the destructured name included; public `Resource.acquire()` keeps its name (D514).",resourceFallback:"`initial` in the options of `resource.view` is now `fallback`: it is published whenever the selected Resource has no data, not just at first materialization. `--fix` renames it on a proven model context; a shared options record or an unproven context is renamed by hand (D514).",resourceHold:"`ModelContext.acquire(view)` is now `hold(view)`: the context holds Resource demand for its model; public `Resource.acquire()` still creates a lease and keeps its own name. A destructured member or an unproven context is renamed by hand (D514).",resourceLifetime:"Resource lifetime `'owner'` is now `'model'`: the model owns the Resource while it is active. `--fix` renames the literal on a proven model context; a shared options record or an unproven context is renamed by hand (D514).",resourceLifetimeType:"The Resource lifetime type argument `'owner'` is now `'model'`; the `Owned*` type names remain (D514).",resourcePartition:"`identity.scope` is now `identity.partition`: changing it clears the whole Resource cache; partitions are not kept side by side. `--fix` renames it on a proven model context; a shared options record or an unproven context is renamed by hand (D514).",resourcePagination:"`pagination` is no longer a field of a declaration: apply it to the Resource the declaration answers, `const pages = ctx.resource.paginate(ctx.resource.load({ \u2026 }), { cursor, load, merge })`, in the model that declares it. The one `load` of the pages takes the cursor, `nextCursor` is `cursor`, and a feature that pages holds its Resource in a model it owns (D486).",runtimeInternalEntry:"`{{word}}` is published by `{{replacement}}`: import it from there. Three names were published by both entries and every consumer took the internal copy, so the copies are gone and the names are not (D411, D415).",scopeKeyed:"`scope.keyed(source, open, { key })` is now `scope.each(source, key, open)`: `each` says what the node does, one child per element, and the key is required \u2014 so it stands between the list it identifies and the child it opens. The trailing record is gone, which makes this a move and not only a rename (D378).",scopeWhileWhen:"`when` in `scope.while(source, open, { when })` is now `filter`: it selects source values while one child remains open. `defineFeature.when` still names declared Conditions (D517).",stateActivity:"No `ResourceState` carries `activity` any more: the union said what a channel was doing and what had failed in one word. Read `state.failure` \u2014 `undefined` is \xABnothing failed\xBB, and otherwise `channel` names the channel that died and `error` carries its failure \u2014 and `state.pending` for the channel with work in flight. Both are declared on every member, so neither needs a narrowing by `kind` first (D462).",surfaceView:"`view` on a proven Navigation Surface is now `regions`: it returns the stable record of region targets for one declared screen (D512).",useCommands:"`useCommands` is gone: a record of command consumers comes from `useModel(Declaration, select)`, which has an owner and a lifetime. One command is still `useCommand` (D388)."};export{e as RETIRED_MESSAGES};
2
2
  //# sourceMappingURL=retired-vocabulary-messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"retired-vocabulary-messages.js","sources":["../src/retired-vocabulary-messages.ts"],"sourcesContent":["/** The words `no-retired-vocabulary` names, and what it says about each: the migration a retired word asks for. */\n\nimport type { ResourceMessageId } from './resource-vocabulary';\n\ntype MessageIds =\n | ResourceMessageId\n | 'commandLane'\n | 'commandLatest'\n | 'commandInputArgs'\n | 'commandName'\n | 'commandOnce'\n | 'commandOutcomeStatus'\n | 'commandPolicy'\n | 'commandQueueBy'\n | 'conditionFrom'\n | 'contextCall'\n | 'contextCalls'\n | 'contributionWhen'\n | 'deliveryKey'\n | 'deliveryKind'\n | 'deliveryReject'\n | 'effectOnDispose'\n | 'effectSkipInitial'\n | 'effectWhen'\n | 'entryMoved'\n | 'entryRenamed'\n | 'eventBackpressure'\n | 'externalPublish'\n | 'fromExternal'\n | 'featureOwnMember'\n | 'linkSourcePending'\n | 'reactFeatureDemand'\n | 'reactUseSelector'\n | 'navigatorPolicy'\n | 'paginateNextCursor'\n | 'resourceActivity'\n | 'resourceDisposer'\n | 'resourceInvalidate'\n | 'resourcePagination'\n | 'runtimeInternalEntry'\n | 'scopeKeyed'\n | 'scopeWhileWhen'\n | 'stateActivity'\n | 'surfaceView'\n | 'useCommands';\n\nconst RETIRED_MESSAGES: Readonly<Record<MessageIds, string>> = {\n commandLane:\n '`lane` is now a member of `concurrency`: write `concurrency: lane`, `concurrency: { by, lane }` for a keyed queue, or `concurrency: { lane, pending: \"latest\" }` where `policy: \"latest\"` stood beside it. Which of the three this record meant is in what it wrote together, so nothing here is rewritten for you (D387).',\n commandLatest:\n '`concurrency: \"latest\"` is now `concurrency: { pending: \"latest\" }`, and `{ lane, pending: \"latest\" }` where the queue is shared. The word named the input that wins and never named what it wins, so the place is written out: one waiting slot at the end of the lane, taken by a newer input while the body in flight is left to finish. Nothing else about the policy moved (D459).',\n commandInputArgs:\n \"`{{word}}` is no longer published: a wrapper of `runCommand` forwards `...args: {{replacement}}<Input, Keys>` from `@opetope/runtime/testing`, and a wrapper of `CommandHook.run` forwards `...args: Parameters<CommandHook<Input, Output>['run']>` (D510, D517).\",\n commandName:\n '`{{word}}` is now `{{replacement}}`: one word for a command, everywhere. The primitive was the last place the vocabulary still said `Call`, while the hook was already `useCommand` and the outcome `CommandOutcome`. There is no alias (D385).',\n commandOnce:\n '`once` is now `memoize`: it caches a successful result, it does not stop after one run. `addEventListener(type, handler, { once: true })` is what the platform means by the word, and it is not what this option ever did (D389).',\n commandOutcomeStatus:\n '`status` is now `kind` on a `CommandOutcome`: one word for the discriminant of a settled answer, the one `ResourceState`, `ResourceOperationOutcome`, `ResourceCommitOutcome`, `PaginationOutcome` and a screen result already carry. The three branches are unchanged — `{ kind: \"ok\", value }`, `{ kind: \"failed\", error }`, `{ kind: \"cancelled\", reason }` (D411).',\n commandPolicy:\n '`policy` is now `concurrency`: one word for the order the runs take, written as `queue`, `parallel`, a lane or `{ pending: \"latest\" }`. Where `queueBy` or `lane` stood beside it the three collapse into one value — `{ by }`, `{ by, lane }` or `{ lane, pending: \"latest\" }` — so the shape depends on which of them this record wrote, and that is why this rule names the word instead of rewriting it (D387, D459).',\n commandQueueBy:\n '`queueBy` is now a member of `concurrency`: write `concurrency: { by: input => key }`, or `concurrency: { by, lane }` where a lane stood beside it (D387).',\n conditionFrom:\n \"`from` of `defineCondition` is now `source`: write `defineCondition(id, { select, source })`. One word names the dependency a node reads — `resource.load({ source })` and `attach(source)` already say it, and this node's own refusals said `Condition source` about the field they called `from` (D410, D411).\",\n contextCall:\n '`call` is now `command`: `ctx.command(run, options?)` in a model, `own.command(within, run, options?)` in a feature. The body takes one argument, its context, and reads the declared input off it as `input` — and `Input` is inferred from every position of the call except the body, so it is written in the cheapest that fits: the result type of a model factory names it in the literal it returns, an annotated option names it (`dedupe: (deposit: Deposit) => …`), a constant names it (`const refill: Command<Refill, void> = ctx.command(…)`), and the annotation of that context — `({ input, update }: ModelCommandContext<Deposit>)` in a model, `({ input, source }: FeatureCommandContext<typeof within, Deposit>)` in a feature — is what is left; a feature has the last two only. `command<Deposit>(…)` is not a position: it pins `Output` to its default (D385, D386, D444, D455).',\n contextCalls:\n '`ctx.calls` and `own.calls` are now `ctx.select` and `own.select`: declaring a body and selecting a command a dependency already declares are two mechanisms, so they are two words. `select(source, \"name\")` answers one command and `select(source, [\"a\", \"b\"])` a record of them (D388).',\n contributionWhen:\n '`when` of a contribution is now `enabled`: write `slot(target, value, { enabled })`, and the same at `pipe` and `register`. A truth the runtime reads while the node exists is `enabled`, at a contribution and at a Resource alike; `when` names the declared `Condition`s of `defineFeature({ when })` (D378, D411, D517).',\n deliveryKey:\n 'Inside a delivery record `key` is now `by`: `{ pending: \"latest\", by }` keeps one waiting place per key instead of one for the whole node (D374).',\n deliveryKind:\n 'Inside a delivery record `kind` is now `pending`: `kind: \"latest\"` is `pending: \"latest\"`, and `kind: \"queue\"` is `pending: \"all\"` — the backlog only an event has. The discriminant moved because with one dimension shared by both nodes, the discriminant is that dimension (D374).',\n deliveryReject:\n '`overflow: \"reject\"` is now `overflow: \"drop\"`: one word at both nodes for «the new one does not enter and `emit` answers `false`». `\"flush-oldest\"` is unchanged and still the default of a keyed delivery (D369, D411).',\n effectOnDispose:\n '`onDispose` is now `finalize`: an effect has two releases — the disposer a run returns, and the one the node itself gets once — and an `on*` prefix did not tell them apart. No word of the authoring vocabulary carries that prefix any more (D379).',\n effectSkipInitial:\n '`skipInitial` is now `initial`, and the polarity is inverted: `skipInitial: true` is `initial: false`, and `initial` defaults to `true`. Both words are booleans, so carrying the value across unchanged compiles and means the opposite — which is why this rule names it and leaves the rewrite to you (D379).',\n entryMoved: 'At `{{from}}`, {{names}} changed: {{verb}} {{them}} from {{to}}. {{reason}} {{how}} ({{decision}}).',\n entryRenamed: 'At `{{from}}`, {{names}} changed spelling. {{reason}} {{how}} ({{decision}}).',\n effectWhen:\n '`when` at an effect is now `filter` or `initial`, and which one depends on what the predicate asks. A predicate that selects values is `filter: (current, previous) => …`; a predicate whose whole job is to refuse the first run — `(_current, previous) => previous !== undefined` — is `initial: false`. This rule does not guess between them. `defineFeature.when` still names declared Conditions; at a contribution it is now `enabled` (D379, D411, D517).',\n eventBackpressure:\n '`backpressure` is now `delivery`: one word at both nodes that admit a producer. Write `delivery: \"latest\"` for one waiting place that the newest payload takes, or the record — `{ pending, by }`, `{ pending, capacity, overflow }` — for the rest (D374).',\n featureOwnMember:\n '`{{word}}` is removed from Feature own. Declare this behavior with `own.model(Model, deps, (ctx, deps) => ({ ... }))`. In that model, {{replacement}} (D501).',\n reactFeatureDemand:\n '`{{word}}` is removed from `@opetope/react/integration` until a public producer of feature demand exists. A contribution boundary remains `ContributionBoundary` (D500).',\n reactUseSelector:\n '`useSelector` is removed. In a model selection use `read(source, project)`; for a standalone source create `derive(source, project, { equals })` once in a model, at module scope or with `useMemo` by key, then pass it to `useReadable`. Move the old `equals` option to `derive` (D500).',\n externalPublish: '`publish` on a proven Kit ExternalSource is now `set`, the same write verb as testReadable (D502).',\n fromExternal:\n '`externalReadable` is now `fromExternal`: `from*` names where a `Readable` comes from, beside `fromMaybe`. The old name was built from its result, which every word of that module already answers (D380).',\n linkSourcePending:\n '`pending` on a proven Navigation LinkSource is now `intent`: it retains the latest value until its generation is acknowledged. Kit Inbox.pending is unchanged (D512).',\n paginateNextCursor:\n '`nextCursor` is now `cursor`: `resource.paginate(resource, { cursor, load, merge })`. TypeScript reads the members of one record in the order they are written, and the selector of the cursor has to come before `load`, so it is named to sort first — the alphabetical order `sort-keys` keeps is the one that infers with no annotation (D486).',\n navigatorPolicy:\n '`NavigatorPolicy` is now `NavigatorCatalogue`, and `surface.policy` is now `surface.catalogue`: this is four callbacks a navigator asks, and D291 made a policy data — a word when it has no parameters, a record when it has them (D411).',\n resourceActivity:\n '`ResourceActivity` is retired at both entries that spelled it. From `@opetope/devtools` it is `ResourceNodeActivity`, of `@opetope/devtools/protocol` now (D411, D495). From `@opetope/core` it is gone: a state answers what failed and what is working in two fields of its own, so read `state.failure` and `state.pending` instead of a union that flattened them (D462).',\n resourceDisposer:\n '`ResourceDisposer` is now `Disposer`: one name for `() => Awaitable<void>`, which three of them used to spell — `Disposer`, `ResourceDisposer` and `FeatureDisposer`. It travels on `@opetope/core/internal` beside `Awaitable` (D411).',\n resourceInvalidate:\n '`invalidate()` is now `reset()`: it clears the whole cache, drops the current data, opens a new epoch and restarts every configured channel. Everywhere else `invalidate` means «mark stale, keep the data», so the old name promised the opposite of what the verb does; it now names no operation of a Resource at all (D373).',\n resourceExecutionHold:\n '`acquire(view)` of a command, effect or event context is now `hold(view)`: it holds the view until that execution ends. Rename it by hand, the destructured name included; public `Resource.acquire()` keeps its name (D514).',\n resourceFallback:\n '`initial` in the options of `resource.view` is now `fallback`: it is published whenever the selected Resource has no data, not just at first materialization. `--fix` renames it on a proven model context; a shared options record or an unproven context is renamed by hand (D514).',\n resourceHold:\n '`ModelContext.acquire(view)` is now `hold(view)`: the context holds Resource demand for its model; public `Resource.acquire()` still creates a lease and keeps its own name. A destructured member or an unproven context is renamed by hand (D514).',\n resourceLifetime:\n \"Resource lifetime `'owner'` is now `'model'`: the model owns the Resource while it is active. `--fix` renames the literal on a proven model context; a shared options record or an unproven context is renamed by hand (D514).\",\n resourceLifetimeType:\n \"The Resource lifetime type argument `'owner'` is now `'model'`; the `Owned*` type names remain (D514).\",\n resourcePartition:\n '`identity.scope` is now `identity.partition`: changing it clears the whole Resource cache; partitions are not kept side by side. `--fix` renames it on a proven model context; a shared options record or an unproven context is renamed by hand (D514).',\n resourcePagination:\n '`pagination` is no longer a field of a declaration: apply it to the Resource the declaration answers, `const pages = ctx.resource.paginate(ctx.resource.load({ … }), { cursor, load, merge })`, in the model that declares it. The one `load` of the pages takes the cursor, `nextCursor` is `cursor`, and a feature that pages holds its Resource in a model it owns (D486).',\n runtimeInternalEntry:\n '`{{word}}` is published by `{{replacement}}`: import it from there. Three names were published by both entries and every consumer took the internal copy, so the copies are gone and the names are not (D411, D415).',\n scopeKeyed:\n '`scope.keyed(source, open, { key })` is now `scope.each(source, key, open)`: `each` says what the node does, one child per element, and the key is required — so it stands between the list it identifies and the child it opens. The trailing record is gone, which makes this a move and not only a rename (D378).',\n scopeWhileWhen:\n '`when` in `scope.while(source, open, { when })` is now `filter`: it selects source values while one child remains open. `defineFeature.when` still names declared Conditions (D517).',\n stateActivity:\n 'No `ResourceState` carries `activity` any more: the union said what a channel was doing and what had failed in one word. Read `state.failure` — `undefined` is «nothing failed», and otherwise `channel` names the channel that died and `error` carries its failure — and `state.pending` for the channel with work in flight. Both are declared on every member, so neither needs a narrowing by `kind` first (D462).',\n surfaceView:\n '`view` on a proven Navigation Surface is now `regions`: it returns the stable record of region targets for one declared screen (D512).',\n useCommands:\n '`useCommands` is gone: a record of command consumers comes from `useModel(Declaration, select)`, which has an owner and a lifetime. One command is still `useCommand` (D388).',\n};\n\nexport { RETIRED_MESSAGES };\nexport type { MessageIds };\n"],"names":["RETIRED_MESSAGES"],"mappings":"AA8CA,MAAMA,EAAyD,CAC7D,YACE,6TACF,cACE,0XACF,iBACE,oQACF,YACE,kPACF,YACE,oOACF,qBACE,8WACF,cACE,saACF,eACE,6JACF,cACE,yTACF,YACE,04BACF,aACE,8RACF,iBACE,+TACF,YACE,oJACF,aACE,8RACF,eACE,kOACF,gBACE,kQACF,kBACE,wTACF,WAAY,sGACZ,aAAc,gFACd,WACE,odACF,kBACE,wQACF,iBACE,gKACF,mBACE,2KACF,iBACE,8RACF,gBAAiB,qGACjB,aACE,6MACF,kBACE,wKACF,mBACE,2VACF,gBACE,kPACF,iBACE,gXACF,iBACE,+OACF,mBACE,yUACF,sBACE,gOACF,iBACE,wRACF,aACE,uPACF,iBACE,iOACF,qBACE,yGACF,kBACE,2PACF,mBACE,qXACF,qBACE,uNACF,WACE,4TACF,eACE,uLACF,cACE,0aACF,YACE,yIACF,YACE"}
1
+ {"version":3,"file":"retired-vocabulary-messages.js","sources":["../src/retired-vocabulary-messages.ts"],"sourcesContent":["/** The words `no-retired-vocabulary` names, and what it says about each: the migration a retired word asks for. */\n\nimport type { ResourceMessageId } from './resource-vocabulary';\n\ntype MessageIds =\n | ResourceMessageId\n | 'commandLane'\n | 'commandLatest'\n | 'commandInputArgs'\n | 'commandName'\n | 'commandOnce'\n | 'commandOutcomeStatus'\n | 'commandPolicy'\n | 'commandQueueBy'\n | 'conditionFrom'\n | 'contextCall'\n | 'contextCalls'\n | 'contributionWhen'\n | 'deliveryKey'\n | 'deliveryKind'\n | 'deliveryReject'\n | 'effectOnDispose'\n | 'effectSkipInitial'\n | 'effectWhen'\n | 'entryMoved'\n | 'entryRenamed'\n | 'eventBackpressure'\n | 'externalPublish'\n | 'fromExternal'\n | 'featureBodyOf'\n | 'featureOwnMember'\n | 'linkSourcePending'\n | 'reactFeatureDemand'\n | 'reactUseSelector'\n | 'navigatorPolicy'\n | 'paginateNextCursor'\n | 'resourceActivity'\n | 'resourceDisposer'\n | 'resourceInvalidate'\n | 'resourcePagination'\n | 'runtimeInternalEntry'\n | 'scopeKeyed'\n | 'scopeWhileWhen'\n | 'stateActivity'\n | 'surfaceView'\n | 'useCommands';\n\nconst RETIRED_MESSAGES: Readonly<Record<MessageIds, string>> = {\n commandLane:\n '`lane` is now a member of `concurrency`: write `concurrency: lane`, `concurrency: { by, lane }` for a keyed queue, or `concurrency: { lane, pending: \"latest\" }` where `policy: \"latest\"` stood beside it. Which of the three this record meant is in what it wrote together, so nothing here is rewritten for you (D387).',\n commandLatest:\n '`concurrency: \"latest\"` is now `concurrency: { pending: \"latest\" }`, and `{ lane, pending: \"latest\" }` where the queue is shared. The word named the input that wins and never named what it wins, so the place is written out: one waiting slot at the end of the lane, taken by a newer input while the body in flight is left to finish. Nothing else about the policy moved (D459).',\n commandInputArgs:\n \"`{{word}}` is no longer published: a wrapper of `runCommand` forwards `...args: {{replacement}}<Input, Keys>` from `@opetope/runtime/testing`, and a wrapper of `CommandHook.run` forwards `...args: Parameters<CommandHook<Input, Output>['run']>` (D510, D517).\",\n commandName:\n '`{{word}}` is now `{{replacement}}`: one word for a command, everywhere. The primitive was the last place the vocabulary still said `Call`, while the hook was already `useCommand` and the outcome `CommandOutcome`. There is no alias (D385).',\n commandOnce:\n '`once` is now `memoize`: it caches a successful result, it does not stop after one run. `addEventListener(type, handler, { once: true })` is what the platform means by the word, and it is not what this option ever did (D389).',\n commandOutcomeStatus:\n '`status` is now `kind` on a `CommandOutcome`: one word for the discriminant of a settled answer, the one `ResourceState`, `ResourceOperationOutcome`, `ResourceCommitOutcome`, `PaginationOutcome` and a screen result already carry. The three branches are unchanged — `{ kind: \"ok\", value }`, `{ kind: \"failed\", error }`, `{ kind: \"cancelled\", reason }` (D411).',\n commandPolicy:\n '`policy` is now `concurrency`: one word for the order the runs take, written as `queue`, `parallel`, a lane or `{ pending: \"latest\" }`. Where `queueBy` or `lane` stood beside it the three collapse into one value — `{ by }`, `{ by, lane }` or `{ lane, pending: \"latest\" }` — so the shape depends on which of them this record wrote, and that is why this rule names the word instead of rewriting it (D387, D459).',\n commandQueueBy:\n '`queueBy` is now a member of `concurrency`: write `concurrency: { by: input => key }`, or `concurrency: { by, lane }` where a lane stood beside it (D387).',\n conditionFrom:\n \"`from` of `defineCondition` is now `source`: write `defineCondition(id, { select, source })`. One word names the dependency a node reads — `resource.load({ source })` and `attach(source)` already say it, and this node's own refusals said `Condition source` about the field they called `from` (D410, D411).\",\n contextCall:\n '`call` is now `command`: `ctx.command(run, options?)` in a model, `own.command(within, run, options?)` in a feature. The body takes one argument, its context, and reads the declared input off it as `input` — and `Input` is inferred from every position of the call except the body, so it is written in the cheapest that fits: the result type of a model factory names it in the literal it returns, an annotated option names it (`dedupe: (deposit: Deposit) => …`), a constant names it (`const refill: Command<Refill, void> = ctx.command(…)`), and the annotation of that context — `({ input, update }: ModelCommandContext<Deposit>)` in a model, `({ input, source }: FeatureCommandContext<typeof within, Deposit>)` in a feature — is what is left; a feature has the last two only. `command<Deposit>(…)` is not a position: it pins `Output` to its default (D385, D386, D444, D455).',\n contextCalls:\n '`ctx.calls` and `own.calls` are now `ctx.select` and `own.select`: declaring a body and selecting a command a dependency already declares are two mechanisms, so they are two words. `select(source, \"name\")` answers one command and `select(source, [\"a\", \"b\"])` a record of them (D388).',\n contributionWhen:\n '`when` of a contribution is now `enabled`: write `slot(target, value, { enabled })`, and the same at `pipe` and `register`. A truth the runtime reads while the node exists is `enabled`, at a contribution and at a Resource alike; `when` names the declared `Condition`s of `defineFeature({ when })` (D378, D411, D517).',\n deliveryKey:\n 'Inside a delivery record `key` is now `by`: `{ pending: \"latest\", by }` keeps one waiting place per key instead of one for the whole node (D374).',\n deliveryKind:\n 'Inside a delivery record `kind` is now `pending`: `kind: \"latest\"` is `pending: \"latest\"`, and `kind: \"queue\"` is `pending: \"all\"` — the backlog only an event has. The discriminant moved because with one dimension shared by both nodes, the discriminant is that dimension (D374).',\n deliveryReject:\n '`overflow: \"reject\"` is now `overflow: \"drop\"`: one word at both nodes for «the new one does not enter and `emit` answers `false`». `\"flush-oldest\"` is unchanged and still the default of a keyed delivery (D369, D411).',\n effectOnDispose:\n '`onDispose` is now `finalize`: an effect has two releases — the disposer a run returns, and the one the node itself gets once — and an `on*` prefix did not tell them apart. No word of the authoring vocabulary carries that prefix any more (D379).',\n effectSkipInitial:\n '`skipInitial` is now `initial`, and the polarity is inverted: `skipInitial: true` is `initial: false`, and `initial` defaults to `true`. Both words are booleans, so carrying the value across unchanged compiles and means the opposite — which is why this rule names it and leaves the rewrite to you (D379).',\n entryMoved: 'At `{{from}}`, {{names}} changed: {{verb}} {{them}} from {{to}}. {{reason}} {{how}} ({{decision}}).',\n entryRenamed: 'At `{{from}}`, {{names}} changed spelling. {{reason}} {{how}} ({{decision}}).',\n effectWhen:\n '`when` at an effect is now `filter` or `initial`, and which one depends on what the predicate asks. A predicate that selects values is `filter: (current, previous) => …`; a predicate whose whole job is to refuse the first run — `(_current, previous) => previous !== undefined` — is `initial: false`. This rule does not guess between them. `defineFeature.when` still names declared Conditions; at a contribution it is now `enabled` (D379, D411, D517).',\n eventBackpressure:\n '`backpressure` is now `delivery`: one word at both nodes that admit a producer. Write `delivery: \"latest\"` for one waiting place that the newest payload takes, or the record — `{ pending, by }`, `{ pending, capacity, overflow }` — for the rest (D374).',\n featureBodyOf:\n \"`FeatureBodyOf` is retired: write the body as `export default defineFeature.body(header, { own, exports, provides })`, which types each section from the header, in the module the header loads with `body: () => import('./feature.body')`. The header reads its exports from that default export, so no file annotates the body (D542).\",\n featureOwnMember:\n '`{{word}}` is removed from Feature own. Declare this behavior with `own.model(Model, deps, (ctx, deps) => ({ ... }))`. In that model, {{replacement}} (D501).',\n reactFeatureDemand:\n '`{{word}}` is removed from `@opetope/react/integration` until a public producer of feature demand exists. A contribution boundary remains `ContributionBoundary` (D500).',\n reactUseSelector:\n '`useSelector` is removed. In a model selection use `read(source, project)`; for a standalone source create `derive(source, project, { equals })` once in a model, at module scope or with `useMemo` by key, then pass it to `useReadable`. Move the old `equals` option to `derive` (D500).',\n externalPublish: '`publish` on a proven Kit ExternalSource is now `set`, the same write verb as testReadable (D502).',\n fromExternal:\n '`externalReadable` is now `fromExternal`: `from*` names where a `Readable` comes from, beside `fromMaybe`. The old name was built from its result, which every word of that module already answers (D380).',\n linkSourcePending:\n '`pending` on a proven Navigation LinkSource is now `intent`: it retains the latest value until its generation is acknowledged. Kit Inbox.pending is unchanged (D512).',\n paginateNextCursor:\n '`nextCursor` is now `cursor`: `resource.paginate(resource, { cursor, load, merge })`. TypeScript reads the members of one record in the order they are written, and the selector of the cursor has to come before `load`, so it is named to sort first — the alphabetical order `sort-keys` keeps is the one that infers with no annotation (D486).',\n navigatorPolicy:\n '`NavigatorPolicy` is now `NavigatorCatalogue`, and `surface.policy` is now `surface.catalogue`: this is four callbacks a navigator asks, and D291 made a policy data — a word when it has no parameters, a record when it has them (D411).',\n resourceActivity:\n '`ResourceActivity` is retired at both entries that spelled it. From `@opetope/devtools` it is `ResourceNodeActivity`, of `@opetope/devtools/protocol` now (D411, D495). From `@opetope/core` it is gone: a state answers what failed and what is working in two fields of its own, so read `state.failure` and `state.pending` instead of a union that flattened them (D462).',\n resourceDisposer:\n '`ResourceDisposer` is now `Disposer`: one name for `() => Awaitable<void>`, which three of them used to spell — `Disposer`, `ResourceDisposer` and `FeatureDisposer`. It travels on `@opetope/core/internal` beside `Awaitable` (D411).',\n resourceInvalidate:\n '`invalidate()` is now `reset()`: it clears the whole cache, drops the current data, opens a new epoch and restarts every configured channel. Everywhere else `invalidate` means «mark stale, keep the data», so the old name promised the opposite of what the verb does; it now names no operation of a Resource at all (D373).',\n resourceExecutionHold:\n '`acquire(view)` of a command, effect or event context is now `hold(view)`: it holds the view until that execution ends. Rename it by hand, the destructured name included; public `Resource.acquire()` keeps its name (D514).',\n resourceFallback:\n '`initial` in the options of `resource.view` is now `fallback`: it is published whenever the selected Resource has no data, not just at first materialization. `--fix` renames it on a proven model context; a shared options record or an unproven context is renamed by hand (D514).',\n resourceHold:\n '`ModelContext.acquire(view)` is now `hold(view)`: the context holds Resource demand for its model; public `Resource.acquire()` still creates a lease and keeps its own name. A destructured member or an unproven context is renamed by hand (D514).',\n resourceLifetime:\n \"Resource lifetime `'owner'` is now `'model'`: the model owns the Resource while it is active. `--fix` renames the literal on a proven model context; a shared options record or an unproven context is renamed by hand (D514).\",\n resourceLifetimeType:\n \"The Resource lifetime type argument `'owner'` is now `'model'`; the `Owned*` type names remain (D514).\",\n resourcePartition:\n '`identity.scope` is now `identity.partition`: changing it clears the whole Resource cache; partitions are not kept side by side. `--fix` renames it on a proven model context; a shared options record or an unproven context is renamed by hand (D514).',\n resourcePagination:\n '`pagination` is no longer a field of a declaration: apply it to the Resource the declaration answers, `const pages = ctx.resource.paginate(ctx.resource.load({ … }), { cursor, load, merge })`, in the model that declares it. The one `load` of the pages takes the cursor, `nextCursor` is `cursor`, and a feature that pages holds its Resource in a model it owns (D486).',\n runtimeInternalEntry:\n '`{{word}}` is published by `{{replacement}}`: import it from there. Three names were published by both entries and every consumer took the internal copy, so the copies are gone and the names are not (D411, D415).',\n scopeKeyed:\n '`scope.keyed(source, open, { key })` is now `scope.each(source, key, open)`: `each` says what the node does, one child per element, and the key is required — so it stands between the list it identifies and the child it opens. The trailing record is gone, which makes this a move and not only a rename (D378).',\n scopeWhileWhen:\n '`when` in `scope.while(source, open, { when })` is now `filter`: it selects source values while one child remains open. `defineFeature.when` still names declared Conditions (D517).',\n stateActivity:\n 'No `ResourceState` carries `activity` any more: the union said what a channel was doing and what had failed in one word. Read `state.failure` — `undefined` is «nothing failed», and otherwise `channel` names the channel that died and `error` carries its failure — and `state.pending` for the channel with work in flight. Both are declared on every member, so neither needs a narrowing by `kind` first (D462).',\n surfaceView:\n '`view` on a proven Navigation Surface is now `regions`: it returns the stable record of region targets for one declared screen (D512).',\n useCommands:\n '`useCommands` is gone: a record of command consumers comes from `useModel(Declaration, select)`, which has an owner and a lifetime. One command is still `useCommand` (D388).',\n};\n\nexport { RETIRED_MESSAGES };\nexport type { MessageIds };\n"],"names":["RETIRED_MESSAGES"],"mappings":"AA+CA,MAAMA,EAAyD,CAC7D,YACE,6TACF,cACE,0XACF,iBACE,oQACF,YACE,kPACF,YACE,oOACF,qBACE,8WACF,cACE,saACF,eACE,6JACF,cACE,yTACF,YACE,04BACF,aACE,8RACF,iBACE,+TACF,YACE,oJACF,aACE,8RACF,eACE,kOACF,gBACE,kQACF,kBACE,wTACF,WAAY,sGACZ,aAAc,gFACd,WACE,odACF,kBACE,wQACF,cACE,4UACF,iBACE,gKACF,mBACE,2KACF,iBACE,8RACF,gBAAiB,qGACjB,aACE,6MACF,kBACE,wKACF,mBACE,2VACF,gBACE,kPACF,iBACE,gXACF,iBACE,+OACF,mBACE,yUACF,sBACE,gOACF,iBACE,wRACF,aACE,uPACF,iBACE,iOACF,qBACE,yGACF,kBACE,2PACF,mBACE,qXACF,qBACE,uNACF,WACE,4TACF,eACE,uLACF,cACE,0aACF,YACE,yIACF,YACE"}
@@ -1,2 +1,2 @@
1
- import{AST_NODE_TYPES as f}from"@typescript-eslint/types";import{calleeName as u,propertyName as a}from"../ast.js";import{createRule as m}from"../rule.js";const d=["imports","requires","own","exports","provides","when","body"],l=new Map([["defineFeature",d],["defineFeature.body",["own","exports","provides"]]]);function c(t){const n=a(t);return n===void 0?-1:d.indexOf(n)}function h(t,n){const e=[];for(const r of t){const o=a(r);if(o===void 0||!n.includes(o))return;e.push(d.indexOf(o))}return e}function x(t){let n=-1;for(const[e,r]of t.entries()){if(r<n)return e;n=r}return-1}function y(t,n){return t.getCommentsInside(n).some(e=>!n.properties.some(r=>r.range[0]<=e.range[0]&&e.range[1]<=r.range[1]))}function*g(t,n,e){const r=[...e].sort((o,i)=>c(o)-c(i));for(const[o,i]of e.entries()){const s=r[o];s!==void 0&&s!==i&&(yield t.replaceText(i,n.getText(s)))}}const O=m({create(t){const n=(e,r)=>{const o=h(e.properties,r);if(o===void 0)return;const i=x(o),s=e.properties[i];s!==void 0&&t.report({data:{order:r.join(", ")},fix:y(t.sourceCode,e)?null:p=>[...g(p,t.sourceCode,e.properties)],messageId:"sectionOrder",node:s})};return{CallExpression(e){const[,r]=e.arguments,o=l.get(u(e)??"");o===void 0||r?.type!==f.ObjectExpression||n(r,o)}}},meta:{docs:{description:"The sections of `defineFeature` keep the declaration order of the specification."},fixable:"code",messages:{sectionOrder:"A feature declares its sections in one order: {{order}}. Type inference holds part of it: `exports` and `provides` read the `own` that TypeScript inferred from the sections written above them (spec \xA72.1, D186, D280, D477)."},schema:[],type:"layout"},name:"define-feature-property-order"});export{O as defineFeaturePropertyOrder};
1
+ import{AST_NODE_TYPES as f}from"@typescript-eslint/types";import{calleeName as u,propertyName as a}from"../ast.js";import{createRule as m}from"../rule.js";const d=["imports","requires","own","exports","provides","when","body"],l=new Map([["defineFeature",d],["defineFeature.body",["own","exports","provides"]]]);function p(o){const n=a(o);return n===void 0?-1:d.indexOf(n)}function x(o,n){const e=[];for(const r of o){const t=a(r);if(t===void 0||!n.includes(t))return;e.push(d.indexOf(t))}return e}function y(o){let n=-1;for(const[e,r]of o.entries()){if(r<n)return e;n=r}return-1}function g(o,n){return o.getCommentsInside(n).some(e=>!n.properties.some(r=>r.range[0]<=e.range[0]&&e.range[1]<=r.range[1]))}function*h(o,n,e){const r=[...e].sort((t,s)=>p(t)-p(s));for(const[t,s]of e.entries()){const i=r[t];i!==void 0&&i!==s&&(yield o.replaceText(s,n.getText(i)))}}const O=m({create(o){const n=(e,r)=>{const t=x(e.properties,r);if(t===void 0)return;const s=y(t),i=e.properties[s];i!==void 0&&o.report({data:{order:r.join(", ")},fix:g(o.sourceCode,e)?null:c=>[...h(c,o.sourceCode,e.properties)],messageId:"sectionOrder",node:i})};return{CallExpression(e){const[,r]=e.arguments,t=l.get(u(e)??"");t===void 0||r?.type!==f.ObjectExpression||n(r,t)}}},meta:{docs:{description:"The sections of `defineFeature` keep one declaration order."},fixable:"code",messages:{sectionOrder:"A feature declares its sections in one order: {{order}}. Type inference holds part of it: `exports` and `provides` read the `own` that TypeScript inferred from the sections written above them (D542, D280, D477)."},schema:[],type:"layout"},name:"define-feature-property-order"});export{O as defineFeaturePropertyOrder};
2
2
  //# sourceMappingURL=define-feature-property-order.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-feature-property-order.js","sources":["../../src/rules/define-feature-property-order.ts"],"sourcesContent":["import { AST_NODE_TYPES } from '@typescript-eslint/types';\nimport type { TSESTree } from '@typescript-eslint/types';\n\nimport { calleeName, propertyName } from '../ast';\nimport type { RuleFix, RuleFixer, SourceCode } from '../rule';\nimport { createRule } from '../rule';\n\ntype MessageIds = 'sectionOrder';\ntype Properties = readonly TSESTree.ObjectLiteralElement[];\n\n/**\n * The declaration order of the sections: the edges, the stages, then the lifetime and the loader that replaces the\n * last three stages. The identity is no longer among them — a feature names itself with its first argument (D280).\n * The specification names the sections; the order is the one a key sorter can also be configured to hold, so a host\n * runs one convention instead of two (D186). D477: it is not only a reading order. TypeScript contextually types the\n * sections of one object in the order they are written, so `exports` and `provides` above `own` read an `own` with\n * nothing in it; the type of that empty `own` says so, and this rule says it before the compiler does.\n *\n * D434: sections are written at two callees, not one. A body file writes three of them, and its call was read as\n * some other function's, so the one order held at `defineFeature` and nowhere else. Both are read against the same\n * order — the body's three are a subsequence of it — and each against its own list, because a refusal that\n * enumerates seven where three are taken names four keys the author cannot write there (D207).\n */\nconst SECTIONS = ['imports', 'requires', 'own', 'exports', 'provides', 'when', 'body'];\nconst CALLEE_SECTIONS = new Map([\n ['defineFeature', SECTIONS],\n ['defineFeature.body', ['own', 'exports', 'provides']],\n]);\n\nfunction sectionIndex(property: TSESTree.ObjectLiteralElement): number {\n const name = propertyName(property);\n\n return name === undefined ? -1 : SECTIONS.indexOf(name);\n}\n\n/** The declared sections in source order, or `undefined` when a key is not a section this callee places. */\nfunction sectionOrder(properties: Properties, sections: readonly string[]): readonly number[] | undefined {\n const order: number[] = [];\n\n for (const property of properties) {\n const name = propertyName(property);\n\n if (name === undefined || !sections.includes(name)) return undefined;\n\n order.push(SECTIONS.indexOf(name));\n }\n\n return order;\n}\n\nfunction firstMisplaced(order: readonly number[]): number {\n let previous = -1;\n\n for (const [index, value] of order.entries()) {\n if (value < previous) return index;\n\n previous = value;\n }\n\n return -1;\n}\n\n/**\n * A comment between two sections belongs to neither of them, so reordering would move it away from the line it\n * explains. Such an object is reported without a fix; a comment inside a section travels with it.\n */\nfunction hasSeparatingComment(sourceCode: SourceCode, object: TSESTree.ObjectExpression): boolean {\n return sourceCode\n .getCommentsInside(object)\n .some(\n comment =>\n !object.properties.some(\n property => property.range[0] <= comment.range[0] && comment.range[1] <= property.range[1],\n ),\n );\n}\n\nfunction* reorder(fixer: RuleFixer, sourceCode: SourceCode, properties: Properties): Generator<RuleFix> {\n const sorted = [...properties].sort((left, right) => sectionIndex(left) - sectionIndex(right));\n\n for (const [index, property] of properties.entries()) {\n const replacement = sorted[index];\n\n if (replacement !== undefined && replacement !== property) {\n yield fixer.replaceText(property, sourceCode.getText(replacement));\n }\n }\n}\n\nconst defineFeaturePropertyOrder = createRule<[], MessageIds>({\n create(context) {\n const check = (object: TSESTree.ObjectExpression, sections: readonly string[]): void => {\n const order = sectionOrder(object.properties, sections);\n\n if (order === undefined) return;\n\n const misplaced = firstMisplaced(order);\n const property = object.properties[misplaced];\n\n if (property === undefined) return;\n\n context.report({\n data: { order: sections.join(', ') },\n fix: hasSeparatingComment(context.sourceCode, object)\n ? null\n : fixer => [...reorder(fixer, context.sourceCode, object.properties)],\n messageId: 'sectionOrder',\n node: property,\n });\n };\n\n return {\n CallExpression(node): void {\n // D280, D207: the identity is the first argument of both callees, so the sections are the second.\n const [, sections] = node.arguments;\n const declared = CALLEE_SECTIONS.get(calleeName(node) ?? '');\n\n if (declared === undefined || sections?.type !== AST_NODE_TYPES.ObjectExpression) return;\n\n check(sections, declared);\n },\n };\n },\n meta: {\n docs: {\n description: 'The sections of `defineFeature` keep the declaration order of the specification.',\n },\n fixable: 'code',\n messages: {\n sectionOrder:\n 'A feature declares its sections in one order: {{order}}. Type inference holds part of it: `exports` and ' +\n '`provides` read the `own` that TypeScript inferred from the sections written above them (spec §2.1, D186, ' +\n 'D280, D477).',\n },\n schema: [],\n type: 'layout',\n },\n name: 'define-feature-property-order',\n});\n\nexport { defineFeaturePropertyOrder };\n"],"names":["SECTIONS","CALLEE_SECTIONS","sectionIndex","property","name","propertyName","sectionOrder","properties","sections","order","firstMisplaced","previous","index","value","hasSeparatingComment","sourceCode","object","comment","reorder","fixer","sorted","left","right","replacement","defineFeaturePropertyOrder","createRule","context","check","misplaced","node","declared","calleeName","AST_NODE_TYPES"],"mappings":"2JAuBA,MAAMA,EAAW,CAAC,UAAW,WAAY,MAAO,UAAW,WAAY,OAAQ,MAAM,EAC/EC,EAAkB,IAAI,IAAI,CAC9B,CAAC,gBAAiBD,CAAQ,EAC1B,CAAC,qBAAsB,CAAC,MAAO,UAAW,UAAU,CAAC,CACtD,CAAA,EAED,SAASE,EAAaC,EAAuC,CAC3D,MAAMC,EAAOC,EAAaF,CAAQ,EAElC,OAAOC,IAAS,OAAY,GAAKJ,EAAS,QAAQI,CAAI,CACxD,CAGA,SAASE,EAAaC,EAAwBC,EAA2B,CACvE,MAAMC,EAAkB,CAAA,EAExB,UAAWN,KAAYI,EAAY,CACjC,MAAMH,EAAOC,EAAaF,CAAQ,EAElC,GAAIC,IAAS,QAAa,CAACI,EAAS,SAASJ,CAAI,EAAG,OAEpDK,EAAM,KAAKT,EAAS,QAAQI,CAAI,CAAC,CACnC,CAEA,OAAOK,CACT,CAEA,SAASC,EAAeD,EAAwB,CAC9C,IAAIE,EAAW,GAEf,SAAW,CAACC,EAAOC,CAAK,IAAKJ,EAAM,QAAO,EAAI,CAC5C,GAAII,EAAQF,EAAU,OAAOC,EAE7BD,EAAWE,CACb,CAEA,MAAO,EACT,CAMA,SAASC,EAAqBC,EAAwBC,EAAiC,CACrF,OAAOD,EACJ,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,CAC1B,EAEJ,EACA,KAAM,CACJ,KAAM,CACJ,YAAa,kFACd,EACD,QAAS,OACT,SAAU,CACR,aACE,mOAGH,EACD,OAAQ,CAAA,EACR,KAAM,QACP,EACD,KAAM,+BACP,CAAA"}
1
+ {"version":3,"file":"define-feature-property-order.js","sources":["../../src/rules/define-feature-property-order.ts"],"sourcesContent":["import { AST_NODE_TYPES } from '@typescript-eslint/types';\nimport type { TSESTree } from '@typescript-eslint/types';\n\nimport { calleeName, propertyName } from '../ast';\nimport type { RuleFix, RuleFixer, SourceCode } from '../rule';\nimport { createRule } from '../rule';\n\ntype MessageIds = 'sectionOrder';\ntype Properties = readonly TSESTree.ObjectLiteralElement[];\n\n/**\n * The declaration order of the sections: the edges, the stages, then the lifetime and the loader that replaces the\n * last three stages. The identity is no longer among them — a feature names itself with its first argument (D280).\n * The specification names the sections; the order is the one a key sorter can also be configured to hold, so a host\n * runs one convention instead of two (D542). D477: it is not only a reading order. TypeScript contextually types the\n * sections of one object in the order they are written, so `exports` and `provides` above `own` read an `own` with\n * nothing in it; the type of that empty `own` says so, and this rule says it before the compiler does.\n *\n * D434: sections are written at two callees, not one. A body file writes three of them, and its call was read as\n * some other function's, so the one order held at `defineFeature` and nowhere else. Both are read against the same\n * order — the body's three are a subsequence of it — and each against its own list, because a refusal that\n * enumerates seven where three are taken names four keys the author cannot write there (D207).\n */\nconst SECTIONS = ['imports', 'requires', 'own', 'exports', 'provides', 'when', 'body'];\nconst CALLEE_SECTIONS = new Map([\n ['defineFeature', SECTIONS],\n ['defineFeature.body', ['own', 'exports', 'provides']],\n]);\n\nfunction sectionIndex(property: TSESTree.ObjectLiteralElement): number {\n const name = propertyName(property);\n\n return name === undefined ? -1 : SECTIONS.indexOf(name);\n}\n\n/** The declared sections in source order, or `undefined` when a key is not a section this callee places. */\nfunction sectionOrder(properties: Properties, sections: readonly string[]): readonly number[] | undefined {\n const order: number[] = [];\n\n for (const property of properties) {\n const name = propertyName(property);\n\n if (name === undefined || !sections.includes(name)) return undefined;\n\n order.push(SECTIONS.indexOf(name));\n }\n\n return order;\n}\n\nfunction firstMisplaced(order: readonly number[]): number {\n let previous = -1;\n\n for (const [index, value] of order.entries()) {\n if (value < previous) return index;\n\n previous = value;\n }\n\n return -1;\n}\n\n/**\n * A comment between two sections belongs to neither of them, so reordering would move it away from the line it\n * explains. Such an object is reported without a fix; a comment inside a section travels with it.\n */\nfunction hasSeparatingComment(sourceCode: SourceCode, object: TSESTree.ObjectExpression): boolean {\n return sourceCode\n .getCommentsInside(object)\n .some(\n comment =>\n !object.properties.some(\n property => property.range[0] <= comment.range[0] && comment.range[1] <= property.range[1],\n ),\n );\n}\n\nfunction* reorder(fixer: RuleFixer, sourceCode: SourceCode, properties: Properties): Generator<RuleFix> {\n const sorted = [...properties].sort((left, right) => sectionIndex(left) - sectionIndex(right));\n\n for (const [index, property] of properties.entries()) {\n const replacement = sorted[index];\n\n if (replacement !== undefined && replacement !== property) {\n yield fixer.replaceText(property, sourceCode.getText(replacement));\n }\n }\n}\n\nconst defineFeaturePropertyOrder = createRule<[], MessageIds>({\n create(context) {\n const check = (object: TSESTree.ObjectExpression, sections: readonly string[]): void => {\n const order = sectionOrder(object.properties, sections);\n\n if (order === undefined) return;\n\n const misplaced = firstMisplaced(order);\n const property = object.properties[misplaced];\n\n if (property === undefined) return;\n\n context.report({\n data: { order: sections.join(', ') },\n fix: hasSeparatingComment(context.sourceCode, object)\n ? null\n : fixer => [...reorder(fixer, context.sourceCode, object.properties)],\n messageId: 'sectionOrder',\n node: property,\n });\n };\n\n return {\n CallExpression(node): void {\n // D280, D207: the identity is the first argument of both callees, so the sections are the second.\n const [, sections] = node.arguments;\n const declared = CALLEE_SECTIONS.get(calleeName(node) ?? '');\n\n if (declared === undefined || sections?.type !== AST_NODE_TYPES.ObjectExpression) return;\n\n check(sections, declared);\n },\n };\n },\n meta: {\n docs: {\n description: 'The sections of `defineFeature` keep one declaration order.',\n },\n fixable: 'code',\n messages: {\n sectionOrder:\n 'A feature declares its sections in one order: {{order}}. Type inference holds part of it: `exports` and ' +\n '`provides` read the `own` that TypeScript inferred from the sections written above them (D542, D280, D477).',\n },\n schema: [],\n type: 'layout',\n },\n name: 'define-feature-property-order',\n});\n\nexport { defineFeaturePropertyOrder };\n"],"names":["SECTIONS","CALLEE_SECTIONS","sectionIndex","property","name","propertyName","sectionOrder","properties","sections","order","firstMisplaced","previous","index","value","hasSeparatingComment","sourceCode","object","comment","reorder","fixer","sorted","left","right","replacement","defineFeaturePropertyOrder","createRule","context","check","misplaced","node","declared","calleeName","AST_NODE_TYPES"],"mappings":"2JAuBA,MAAMA,EAAW,CAAC,UAAW,WAAY,MAAO,UAAW,WAAY,OAAQ,MAAM,EAC/EC,EAAkB,IAAI,IAAI,CAC9B,CAAC,gBAAiBD,CAAQ,EAC1B,CAAC,qBAAsB,CAAC,MAAO,UAAW,UAAU,CAAC,CACtD,CAAA,EAED,SAASE,EAAaC,EAAuC,CAC3D,MAAMC,EAAOC,EAAaF,CAAQ,EAElC,OAAOC,IAAS,OAAY,GAAKJ,EAAS,QAAQI,CAAI,CACxD,CAGA,SAASE,EAAaC,EAAwBC,EAA2B,CACvE,MAAMC,EAAkB,CAAA,EAExB,UAAWN,KAAYI,EAAY,CACjC,MAAMH,EAAOC,EAAaF,CAAQ,EAElC,GAAIC,IAAS,QAAa,CAACI,EAAS,SAASJ,CAAI,EAAG,OAEpDK,EAAM,KAAKT,EAAS,QAAQI,CAAI,CAAC,CACnC,CAEA,OAAOK,CACT,CAEA,SAASC,EAAeD,EAAwB,CAC9C,IAAIE,EAAW,GAEf,SAAW,CAACC,EAAOC,CAAK,IAAKJ,EAAM,QAAO,EAAI,CAC5C,GAAII,EAAQF,EAAU,OAAOC,EAE7BD,EAAWE,CACb,CAEA,MAAO,EACT,CAMA,SAASC,EAAqBC,EAAwBC,EAAiC,CACrF,OAAOD,EACJ,kBAAkBC,CAAM,EACxB,KACCC,GACE,CAACD,EAAO,WAAW,KACjBb,GAAYA,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AS,OACT,SAAU,CACR,aACE,qNAEH,EACD,OAAQ,CAAA,EACR,KAAM,QACP,EACD,KAAM,+BACP,CAAA"}
@@ -1,2 +1,2 @@
1
- import{AST_NODE_TYPES as x}from"@typescript-eslint/types";import{isFunctionLike as k}from"../ast.js";import{classifyDeclaration as y,bindingAt as v,usageIn as D,STATUS_MEMBERS as E}from"../command-hooks.js";import{unwrap as h,apiName as I}from"../model-bindings.js";import{createRule as S}from"../rule.js";const T=new Set(["useCallback","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo"]),R=[...E,"run"],M=2;function A(n){const e=n.arguments.at(-1);if(!(n.arguments.length<M||e?.type!==x.ArrayExpression))return{callback:n.arguments.slice(0,-1).findLast(k),deps:e}}function w(n){const e=[];for(const t of R)for(const o of n)o.member===t&&!e.includes(o.text)&&e.push(o.text);return e}function C(n){const[e]=n.accesses;if(!(n.opaque||e?.member!=="run"||e.optional))return n.accesses.every(t=>t.text===e.text)?e.text:void 0}function O(n,e,t){if(e.opaque)return[];const o=w(e.accesses);return n.proved&&!e.accesses.some(c=>c.member==="run")?[...o,`${t}.run`]:o}function P(n,e){const t=n.elements.findIndex(r=>r===e),o=n.elements[t+1]??null,c=n.elements[t-1]??null;return o!==null?[e.range[0],o.range[0]]:c===null?e.range:[c.range[1],e.range[1]]}function g(n,e,t,o){const c=e.elements.some(r=>r!==null&&r!==t&&n.getText(h(r))===o);return r=>c?r.removeRange(P(e,t)):r.replaceText(t,o)}function _(n,e){const t=I(n,e.callee,"react");return t!==void 0&&T.has(t)?A(e):void 0}const j=S({create(n){const e=n.sourceCode,t=new Map,o=[],c=[],r=(s,a,d)=>{const i=e.getText(h(a)),f=D(e,d,s.callback),u=d.record?"commandRecordInDeps":"commandHookInDeps",m=C(f);if(m!==void 0){n.report({data:{name:i},fix:g(e,s.deps,a,m),messageId:u,node:a});return}const l=O(d,f,i).map(p=>({data:{path:p},fix:g(e,s.deps,a,p),messageId:"dependOnMember"}));l.length===0?n.report({data:{name:i},messageId:u,node:a}):n.report({data:{name:i},messageId:u,node:a,suggest:l})},b=s=>{const a=_(e,s);if(a!==void 0)for(const d of a.deps.elements){if(d===null)continue;const i=v(e,t,d);i!==void 0&&r(a,d,i)}};return{CallExpression(s){c.push(s)},VariableDeclarator(s){o.push(s)},"Program:exit"(){for(const s of o)y(e,s,t);for(const s of c)b(s)}}},meta:{docs:{description:"A React dependency array names the stable `run` of a command hook, not the hook object."},fixable:"code",hasSuggestions:!0,messages:{commandHookInDeps:"The hook object of a command is rebuilt on every `inFlight`/`outcome` change, so this dependency re-runs the effect or voids the memo on each of them, and an effect that calls `run` from it loops. Depend on `{{name}}.run` \u2014 stable for the life of the binding \u2014 or on the status field the callback reads (D290).",commandRecordInDeps:"`{{name}}` is the record `useModel` returns for a selection, and it is a new object on every render, so this dependency changes on every render: the effect re-runs, the memo is voided, and an effect that calls `run` from it never settles. Depend on the fields the callback uses, such as `hooks.save.run` (D290).",dependOnMember:"Depend on `{{path}}` instead of the object this element names."},schema:[],type:"problem"},name:"no-command-in-deps"});export{j as noCommandInDeps};
1
+ import{AST_NODE_TYPES as x}from"@typescript-eslint/types";import{isFunctionLike as k}from"../ast.js";import{classifyDeclaration as y,bindingAt as v,usageIn as D,STATUS_MEMBERS as E}from"../command-hooks.js";import{unwrap as h,apiName as I}from"../model-bindings.js";import{createRule as S}from"../rule.js";const T=new Set(["useCallback","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo"]),R=[...E,"dismiss","run"],M=2;function A(n){const e=n.arguments.at(-1);if(!(n.arguments.length<M||e?.type!==x.ArrayExpression))return{callback:n.arguments.slice(0,-1).findLast(k),deps:e}}function w(n){const e=[];for(const t of R)for(const o of n)o.member===t&&!e.includes(o.text)&&e.push(o.text);return e}function C(n){const[e]=n.accesses;if(!(n.opaque||e?.member!=="run"||e.optional))return n.accesses.every(t=>t.text===e.text)?e.text:void 0}function O(n,e,t){if(e.opaque)return[];const o=w(e.accesses);return n.proved&&!e.accesses.some(c=>c.member==="run")?[...o,`${t}.run`]:o}function P(n,e){const t=n.elements.findIndex(r=>r===e),o=n.elements[t+1]??null,c=n.elements[t-1]??null;return o!==null?[e.range[0],o.range[0]]:c===null?e.range:[c.range[1],e.range[1]]}function g(n,e,t,o){const c=e.elements.some(r=>r!==null&&r!==t&&n.getText(h(r))===o);return r=>c?r.removeRange(P(e,t)):r.replaceText(t,o)}function _(n,e){const t=I(n,e.callee,"react");return t!==void 0&&T.has(t)?A(e):void 0}const j=S({create(n){const e=n.sourceCode,t=new Map,o=[],c=[],r=(s,a,i)=>{const d=e.getText(h(a)),f=D(e,i,s.callback),u=i.record?"commandRecordInDeps":"commandHookInDeps",m=C(f);if(m!==void 0){n.report({data:{name:d},fix:g(e,s.deps,a,m),messageId:u,node:a});return}const l=O(i,f,d).map(p=>({data:{path:p},fix:g(e,s.deps,a,p),messageId:"dependOnMember"}));l.length===0?n.report({data:{name:d},messageId:u,node:a}):n.report({data:{name:d},messageId:u,node:a,suggest:l})},b=s=>{const a=_(e,s);if(a!==void 0)for(const i of a.deps.elements){if(i===null)continue;const d=v(e,t,i);d!==void 0&&r(a,i,d)}};return{CallExpression(s){c.push(s)},VariableDeclarator(s){o.push(s)},"Program:exit"(){for(const s of o)y(e,s,t);for(const s of c)b(s)}}},meta:{docs:{description:"A React dependency array names the stable `run` of a command hook, not the hook object."},fixable:"code",hasSuggestions:!0,messages:{commandHookInDeps:"The hook object of a command is rebuilt on every `inFlight`/`outcome` change, so this dependency re-runs the effect or voids the memo on each of them, and an effect that calls `run` from it loops. Depend on `{{name}}.run` \u2014 stable for the life of the binding \u2014 or on the status field the callback reads (D290).",commandRecordInDeps:"`{{name}}` is the record `useModel` returns for a selection, and it is a new object on every render, so this dependency changes on every render: the effect re-runs, the memo is voided, and an effect that calls `run` from it never settles. Depend on the fields the callback uses, such as `hooks.save.run` (D290).",dependOnMember:"Depend on `{{path}}` instead of the object this element names."},schema:[],type:"problem"},name:"no-command-in-deps"});export{j as noCommandInDeps};
2
2
  //# sourceMappingURL=no-command-in-deps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-command-in-deps.js","sources":["../../src/rules/no-command-in-deps.ts"],"sourcesContent":["import { AST_NODE_TYPES } from '@typescript-eslint/types';\nimport type { TSESTree } from '@typescript-eslint/types';\n\nimport { isFunctionLike } from '../ast';\nimport type { Access, Binding, HookKinds, Usage } from '../command-hooks';\nimport { bindingAt, classifyDeclaration, STATUS_MEMBERS, usageIn } from '../command-hooks';\nimport { apiName, unwrap } from '../model-bindings';\nimport type { ReportFixFunction, SourceCode } from '../rule';\nimport { createRule } from '../rule';\n\ntype MessageIds = 'commandHookInDeps' | 'commandRecordInDeps' | 'dependOnMember';\ntype Site = { readonly callback: TSESTree.Node | undefined; readonly deps: TSESTree.ArrayExpression };\n\nconst REACT_HOOKS = new Set([\n 'useCallback',\n 'useEffect',\n 'useImperativeHandle',\n 'useInsertionEffect',\n 'useLayoutEffect',\n 'useMemo',\n]);\n/** The order a suggestion list is read in: what the callback already watches, and the stable member last. */\nconst MEMBERS = [...STATUS_MEMBERS, 'run'];\n/** A dependency array is an argument, and the callback that reads it is the argument before. */\nconst SITE_ARITY = 2;\n\n/** `useEffect(fn, deps)` and `useImperativeHandle(ref, create, deps)`: the array last, the callback before it. */\nfunction dependencySite(node: TSESTree.CallExpression): Site | undefined {\n const deps = node.arguments.at(-1);\n\n if (node.arguments.length < SITE_ARITY || deps?.type !== AST_NODE_TYPES.ArrayExpression) return undefined;\n\n return { callback: node.arguments.slice(0, -1).findLast(isFunctionLike), deps };\n}\n\n/** Each path the callback wrote once, statuses before `run`: what the author already reads comes first. */\nfunction readPaths(accesses: readonly Access[]): readonly string[] {\n const paths: string[] = [];\n\n for (const member of MEMBERS) {\n for (const access of accesses) {\n if (access.member === member && !paths.includes(access.text)) paths.push(access.text);\n }\n }\n\n return paths;\n}\n\n/** One answer and no other: every read of the binding went through the same `run`, written without a `?.`. */\nfunction fixedPath(usage: Usage): string | undefined {\n const [first] = usage.accesses;\n\n if (usage.opaque || first?.member !== 'run' || first.optional) return undefined;\n\n return usage.accesses.every(access => access.text === first.text) ? first.text : undefined;\n}\n\n/**\n * Oxlint applies the first suggestion unattended, so a use no member replaces — the object passed on, destructured,\n * or read past the members named here — carries none: the report says what is wrong, and the author says what the\n * dependency meant. A selection field proved by `run` keeps that offer even where this callback only reads a status.\n */\nfunction suggestedPaths(binding: Binding, usage: Usage, base: string): readonly string[] {\n if (usage.opaque) return [];\n\n const paths = readPaths(usage.accesses);\n\n return binding.proved && !usage.accesses.some(access => access.member === 'run') ? [...paths, `${base}.run`] : paths;\n}\n\n/** The element and one comma with it, for an array that already names the dependency the fix would write. */\nfunction removalRange(deps: TSESTree.ArrayExpression, element: TSESTree.Node): TSESTree.Range {\n const index = deps.elements.findIndex(other => other === element);\n const next = deps.elements[index + 1] ?? null;\n const previous = deps.elements[index - 1] ?? null;\n\n if (next !== null) return [element.range[0], next.range[0]];\n\n return previous === null ? element.range : [previous.range[1], element.range[1]];\n}\n\n/** A dependency already written stays the one written: the element is removed rather than doubled. */\nfunction rewrite(\n source: SourceCode,\n deps: TSESTree.ArrayExpression,\n element: TSESTree.Node,\n path: string,\n): ReportFixFunction {\n const duplicate = deps.elements.some(\n other => other !== null && other !== element && source.getText(unwrap(other)) === path,\n );\n\n return fixer => (duplicate ? fixer.removeRange(removalRange(deps, element)) : fixer.replaceText(element, path));\n}\n\n/** The dependency site of one of React's own hooks, under whatever local name this file gave the import. */\nfunction reactSite(source: SourceCode, node: TSESTree.CallExpression): Site | undefined {\n const name = apiName(source, node.callee, 'react');\n\n return name !== undefined && REACT_HOOKS.has(name) ? dependencySite(node) : undefined;\n}\n\nconst noCommandInDeps = createRule<[], MessageIds>({\n create(context) {\n const source = context.sourceCode;\n const kinds: HookKinds = new Map();\n const declarators: TSESTree.VariableDeclarator[] = [];\n const calls: TSESTree.CallExpression[] = [];\n\n /** The name is read off the unwrapped element, so an `as`, a `satisfies` or a `!` never reaches a fix. */\n const report = (site: Site, element: TSESTree.Node, binding: Binding): void => {\n const base = source.getText(unwrap(element));\n const usage = usageIn(source, binding, site.callback);\n const messageId = binding.record ? 'commandRecordInDeps' : 'commandHookInDeps';\n const path = fixedPath(usage);\n\n if (path !== undefined) {\n context.report({\n data: { name: base },\n fix: rewrite(source, site.deps, element, path),\n messageId,\n node: element,\n });\n\n return;\n }\n\n const suggest = suggestedPaths(binding, usage, base).map(suggestion => ({\n data: { path: suggestion },\n fix: rewrite(source, site.deps, element, suggestion),\n messageId: 'dependOnMember' as const,\n }));\n\n if (suggest.length === 0) context.report({ data: { name: base }, messageId, node: element });\n else context.report({ data: { name: base }, messageId, node: element, suggest });\n };\n\n const check = (call: TSESTree.CallExpression): void => {\n const site = reactSite(source, call);\n\n if (site === undefined) return;\n\n for (const element of site.deps.elements) {\n if (element === null) continue;\n\n const binding = bindingAt(source, kinds, element);\n\n if (binding !== undefined) report(site, element, binding);\n }\n };\n\n return {\n CallExpression(node): void {\n calls.push(node);\n },\n VariableDeclarator(node): void {\n declarators.push(node);\n },\n 'Program:exit'(): void {\n for (const declarator of declarators) classifyDeclaration(source, declarator, kinds);\n for (const call of calls) check(call);\n },\n };\n },\n meta: {\n docs: {\n description: 'A React dependency array names the stable `run` of a command hook, not the hook object.',\n },\n fixable: 'code',\n hasSuggestions: true,\n messages: {\n commandHookInDeps:\n 'The hook object of a command is rebuilt on every `inFlight`/`outcome` change, so this dependency re-runs the effect or voids the memo on each of them, and an effect that calls `run` from it loops. Depend on `{{name}}.run` — stable for the life of the binding — or on the status field the callback reads (D290).',\n commandRecordInDeps:\n '`{{name}}` is the record `useModel` returns for a selection, and it is a new object on every render, so this dependency changes on every render: the effect re-runs, the memo is voided, and an effect that calls `run` from it never settles. Depend on the fields the callback uses, such as `hooks.save.run` (D290).',\n dependOnMember: 'Depend on `{{path}}` instead of the object this element names.',\n },\n schema: [],\n type: 'problem',\n },\n name: 'no-command-in-deps',\n});\n\nexport { noCommandInDeps };\n"],"names":["REACT_HOOKS","MEMBERS","STATUS_MEMBERS","SITE_ARITY","dependencySite","node","deps","AST_NODE_TYPES","isFunctionLike","readPaths","accesses","paths","member","access","fixedPath","usage","first","suggestedPaths","binding","base","removalRange","element","index","other","next","previous","rewrite","source","path","duplicate","unwrap","fixer","reactSite","name","apiName","noCommandInDeps","createRule","context","kinds","declarators","calls","report","site","usageIn","messageId","suggest","suggestion","check","call","bindingAt","declarator","classifyDeclaration"],"mappings":"kTAaA,MAAMA,EAAc,IAAI,IAAI,CAC1B,cACA,YACA,sBACA,qBACA,kBACA,SACD,CAAA,EAEKC,EAAU,CAAC,GAAGC,EAAgB,KAAK,EAEnCC,EAAa,EAGnB,SAASC,EAAeC,EAA6B,CACnD,MAAMC,EAAOD,EAAK,UAAU,GAAG,EAAE,EAEjC,GAAI,EAAAA,EAAK,UAAU,OAASF,GAAcG,GAAM,OAASC,EAAe,iBAExE,MAAO,CAAE,SAAUF,EAAK,UAAU,MAAM,EAAG,EAAE,EAAE,SAASG,CAAc,EAAG,KAAAF,CAAI,CAC/E,CAGA,SAASG,EAAUC,EAA2B,CAC5C,MAAMC,EAAkB,CAAA,EAExB,UAAWC,KAAUX,EACnB,UAAWY,KAAUH,EACfG,EAAO,SAAWD,GAAU,CAACD,EAAM,SAASE,EAAO,IAAI,GAAGF,EAAM,KAAKE,EAAO,IAAI,EAIxF,OAAOF,CACT,CAGA,SAASG,EAAUC,EAAY,CAC7B,KAAM,CAACC,CAAK,EAAID,EAAM,SAEtB,GAAI,EAAAA,EAAM,QAAUC,GAAO,SAAW,OAASA,EAAM,UAErD,OAAOD,EAAM,SAAS,MAAMF,GAAUA,EAAO,OAASG,EAAM,IAAI,EAAIA,EAAM,KAAO,MACnF,CAOA,SAASC,EAAeC,EAAkBH,EAAcI,EAAY,CAClE,GAAIJ,EAAM,OAAQ,MAAO,CAAA,EAEzB,MAAMJ,EAAQF,EAAUM,EAAM,QAAQ,EAEtC,OAAOG,EAAQ,QAAU,CAACH,EAAM,SA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ACE,mUACF,oBACE,0TACF,eAAgB,gEACjB,EACD,OAAQ,CAAA,EACR,KAAM,SACP,EACD,KAAM,oBACP,CAAA"}
1
+ {"version":3,"file":"no-command-in-deps.js","sources":["../../src/rules/no-command-in-deps.ts"],"sourcesContent":["import { AST_NODE_TYPES } from '@typescript-eslint/types';\nimport type { TSESTree } from '@typescript-eslint/types';\n\nimport { isFunctionLike } from '../ast';\nimport type { Access, Binding, HookKinds, Usage } from '../command-hooks';\nimport { bindingAt, classifyDeclaration, STATUS_MEMBERS, usageIn } from '../command-hooks';\nimport { apiName, unwrap } from '../model-bindings';\nimport type { ReportFixFunction, SourceCode } from '../rule';\nimport { createRule } from '../rule';\n\ntype MessageIds = 'commandHookInDeps' | 'commandRecordInDeps' | 'dependOnMember';\ntype Site = { readonly callback: TSESTree.Node | undefined; readonly deps: TSESTree.ArrayExpression };\n\nconst REACT_HOOKS = new Set([\n 'useCallback',\n 'useEffect',\n 'useImperativeHandle',\n 'useInsertionEffect',\n 'useLayoutEffect',\n 'useMemo',\n]);\n/** The order a suggestion list is read in: what the callback already watches, and the stable member last. */\nconst MEMBERS = [...STATUS_MEMBERS, 'dismiss', 'run'];\n/** A dependency array is an argument, and the callback that reads it is the argument before. */\nconst SITE_ARITY = 2;\n\n/** `useEffect(fn, deps)` and `useImperativeHandle(ref, create, deps)`: the array last, the callback before it. */\nfunction dependencySite(node: TSESTree.CallExpression): Site | undefined {\n const deps = node.arguments.at(-1);\n\n if (node.arguments.length < SITE_ARITY || deps?.type !== AST_NODE_TYPES.ArrayExpression) return undefined;\n\n return { callback: node.arguments.slice(0, -1).findLast(isFunctionLike), deps };\n}\n\n/** Each path the callback wrote once, statuses before `run`: what the author already reads comes first. */\nfunction readPaths(accesses: readonly Access[]): readonly string[] {\n const paths: string[] = [];\n\n for (const member of MEMBERS) {\n for (const access of accesses) {\n if (access.member === member && !paths.includes(access.text)) paths.push(access.text);\n }\n }\n\n return paths;\n}\n\n/** One answer and no other: every read of the binding went through the same `run`, written without a `?.`. */\nfunction fixedPath(usage: Usage): string | undefined {\n const [first] = usage.accesses;\n\n if (usage.opaque || first?.member !== 'run' || first.optional) return undefined;\n\n return usage.accesses.every(access => access.text === first.text) ? first.text : undefined;\n}\n\n/**\n * Oxlint applies the first suggestion unattended, so a use no member replaces — the object passed on, destructured,\n * or read past the members named here — carries none: the report says what is wrong, and the author says what the\n * dependency meant. A selection field proved by `run` keeps that offer even where this callback only reads a status.\n */\nfunction suggestedPaths(binding: Binding, usage: Usage, base: string): readonly string[] {\n if (usage.opaque) return [];\n\n const paths = readPaths(usage.accesses);\n\n return binding.proved && !usage.accesses.some(access => access.member === 'run') ? [...paths, `${base}.run`] : paths;\n}\n\n/** The element and one comma with it, for an array that already names the dependency the fix would write. */\nfunction removalRange(deps: TSESTree.ArrayExpression, element: TSESTree.Node): TSESTree.Range {\n const index = deps.elements.findIndex(other => other === element);\n const next = deps.elements[index + 1] ?? null;\n const previous = deps.elements[index - 1] ?? null;\n\n if (next !== null) return [element.range[0], next.range[0]];\n\n return previous === null ? element.range : [previous.range[1], element.range[1]];\n}\n\n/** A dependency already written stays the one written: the element is removed rather than doubled. */\nfunction rewrite(\n source: SourceCode,\n deps: TSESTree.ArrayExpression,\n element: TSESTree.Node,\n path: string,\n): ReportFixFunction {\n const duplicate = deps.elements.some(\n other => other !== null && other !== element && source.getText(unwrap(other)) === path,\n );\n\n return fixer => (duplicate ? fixer.removeRange(removalRange(deps, element)) : fixer.replaceText(element, path));\n}\n\n/** The dependency site of one of React's own hooks, under whatever local name this file gave the import. */\nfunction reactSite(source: SourceCode, node: TSESTree.CallExpression): Site | undefined {\n const name = apiName(source, node.callee, 'react');\n\n return name !== undefined && REACT_HOOKS.has(name) ? dependencySite(node) : undefined;\n}\n\nconst noCommandInDeps = createRule<[], MessageIds>({\n create(context) {\n const source = context.sourceCode;\n const kinds: HookKinds = new Map();\n const declarators: TSESTree.VariableDeclarator[] = [];\n const calls: TSESTree.CallExpression[] = [];\n\n /** The name is read off the unwrapped element, so an `as`, a `satisfies` or a `!` never reaches a fix. */\n const report = (site: Site, element: TSESTree.Node, binding: Binding): void => {\n const base = source.getText(unwrap(element));\n const usage = usageIn(source, binding, site.callback);\n const messageId = binding.record ? 'commandRecordInDeps' : 'commandHookInDeps';\n const path = fixedPath(usage);\n\n if (path !== undefined) {\n context.report({\n data: { name: base },\n fix: rewrite(source, site.deps, element, path),\n messageId,\n node: element,\n });\n\n return;\n }\n\n const suggest = suggestedPaths(binding, usage, base).map(suggestion => ({\n data: { path: suggestion },\n fix: rewrite(source, site.deps, element, suggestion),\n messageId: 'dependOnMember' as const,\n }));\n\n if (suggest.length === 0) context.report({ data: { name: base }, messageId, node: element });\n else context.report({ data: { name: base }, messageId, node: element, suggest });\n };\n\n const check = (call: TSESTree.CallExpression): void => {\n const site = reactSite(source, call);\n\n if (site === undefined) return;\n\n for (const element of site.deps.elements) {\n if (element === null) continue;\n\n const binding = bindingAt(source, kinds, element);\n\n if (binding !== undefined) report(site, element, binding);\n }\n };\n\n return {\n CallExpression(node): void {\n calls.push(node);\n },\n VariableDeclarator(node): void {\n declarators.push(node);\n },\n 'Program:exit'(): void {\n for (const declarator of declarators) classifyDeclaration(source, declarator, kinds);\n for (const call of calls) check(call);\n },\n };\n },\n meta: {\n docs: {\n description: 'A React dependency array names the stable `run` of a command hook, not the hook object.',\n },\n fixable: 'code',\n hasSuggestions: true,\n messages: {\n commandHookInDeps:\n 'The hook object of a command is rebuilt on every `inFlight`/`outcome` change, so this dependency re-runs the effect or voids the memo on each of them, and an effect that calls `run` from it loops. Depend on `{{name}}.run` — stable for the life of the binding — or on the status field the callback reads (D290).',\n commandRecordInDeps:\n '`{{name}}` is the record `useModel` returns for a selection, and it is a new object on every render, so this dependency changes on every render: the effect re-runs, the memo is voided, and an effect that calls `run` from it never settles. Depend on the fields the callback uses, such as `hooks.save.run` (D290).',\n dependOnMember: 'Depend on `{{path}}` instead of the object this element names.',\n },\n schema: [],\n type: 'problem',\n },\n name: 'no-command-in-deps',\n});\n\nexport { noCommandInDeps };\n"],"names":["REACT_HOOKS","MEMBERS","STATUS_MEMBERS","SITE_ARITY","dependencySite","node","deps","AST_NODE_TYPES","isFunctionLike","readPaths","accesses","paths","member","access","fixedPath","usage","first","suggestedPaths","binding","base","removalRange","element","index","other","next","previous","rewrite","source","path","duplicate","unwrap","fixer","reactSite","name","apiName","noCommandInDeps","createRule","context","kinds","declarators","calls","report","site","usageIn","messageId","suggest","suggestion","check","call","bindingAt","declarator","classifyDeclaration"],"mappings":"kTAaA,MAAMA,EAAc,IAAI,IAAI,CAC1B,cACA,YACA,sBACA,qBACA,kBACA,SACD,CAAA,EAEKC,EAAU,CAAC,GAAGC,EAAgB,UAAW,KAAK,EAE9CC,EAAa,EAGnB,SAASC,EAAeC,EAA6B,CACnD,MAAMC,EAAOD,EAAK,UAAU,GAAG,EAAE,EAEjC,GAAI,EAAAA,EAAK,UAAU,OAASF,GAAcG,GAAM,OAASC,EAAe,iBAExE,MAAO,CAAE,SAAUF,EAAK,UAAU,MAAM,EAAG,EAAE,EAAE,SAASG,CAAc,EAAG,KAAAF,CAAI,CAC/E,CAGA,SAASG,EAAUC,EAA2B,CAC5C,MAAMC,EAAkB,CAAA,EAExB,UAAWC,KAAUX,EACnB,UAAWY,KAAUH,EACfG,EAAO,SAAWD,GAAU,CAACD,EAAM,SAASE,EAAO,IAAI,GAAGF,EAAM,KAAKE,EAAO,IAAI,EAIxF,OAAOF,CACT,CAGA,SAASG,EAAUC,EAAY,CAC7B,KAAM,CAACC,CAAK,EAAID,EAAM,SAEtB,GAAI,EAAAA,EAAM,QAAUC,GAAO,SAAW,OAASA,EAAM,UAErD,OAAOD,EAAM,SAAS,MAAMF,GAAUA,EAAO,OAASG,EAAM,IAAI,EAAIA,EAAM,KAAO,MACnF,CAOA,SAASC,EAAeC,EAAkBH,EAAcI,EAAY,CAClE,GAAIJ,EAAM,OAAQ,MAAO,CAAA,EAEzB,MAAMJ,EAAQF,EAAUM,EA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AAa,yFACd,EACD,QAAS,OACT,eAAgB,GAChB,SAAU,CACR,kBACE,mUACF,oBACE,0TACF,eAAgB,gEACjB,EACD,OAAQ,CAAA,EACR,KAAM,SACP,EACD,KAAM,oBACP,CAAA"}
@@ -1,2 +1,2 @@
1
- import{DefinitionType as H}from"@typescript-eslint/scope-manager";import{AST_NODE_TYPES as o}from"@typescript-eslint/types";import{propertyName as p,findProperty as Q}from"../ast.js";import{methodPath as g,isContextFunction as q}from"../declaration-ingress.js";import{namespaceTypeMove as z,typeImportMove as J,namespaceMemberMove as X,staticMemberName as Z,dynamicMove as ee,reexportMove as re,starMove as te,importMove as ne}from"../entry-moves.js";import{importName as ie,isFeatureSection as D,isApi as S,localValue as l,hasWritesBeyondDefinition as oe}from"../model-bindings.js";import{isResourceValue as ae,isResourceHook as se,isStateActivity as ce,isSurfaceValue as C,isLinkSourceValue as de,isCommandOutcome as ue}from"../retired-vocabulary.js";import{RETIRED_MESSAGES as pe}from"../retired-vocabulary-messages.js";import{createResourceVocabulary as le}from"../resource-vocabulary.js";import{createRule as me,findVariable as fe}from"../rule.js";const m=new Map([["lane","commandLane"],["once","commandOnce"],["policy","commandPolicy"],["queueBy","commandQueueBy"]]),f=new Map([["concurrency",new Map([["latest","commandLatest"]])]]),ye=new Map([["onDispose","effectOnDispose"],["skipInitial","effectSkipInitial"],["when","effectWhen"]]),ge=new Map([["when","scopeWhileWhen"]]),Ee=new Map([["backpressure","eventBackpressure"]]),Ie=new Map([["key","deliveryKey"],["kind","deliveryKind"]]),x=new Map([["pagination","resourcePagination"]]),we=new Map([["nextCursor","paginateNextCursor"]]),O=["backpressure","delivery"],ve=new Map([["overflow",new Map([["reject","deliveryReject"]])]]),E=new Map([["when","contributionWhen"]]),Re=new Map([["pipe",{at:[2],carries:[],words:E}],["register",{at:[2],carries:[],words:E}],["slot",{at:[2],carries:[],words:E}]]),be=new Map([["from","conditionFrom"]]),Me=new Map([["call",{at:[1,2],carries:[],values:f,words:m}],["calls",{at:[2],carries:[],values:f,words:m}],["command",{at:[1,2],carries:[],values:f,words:m}],["effect",{at:[2],carries:[],words:ye}],["event",{at:[3],carries:O,words:Ee}],["resource.live",{at:[0],carriedValues:ve,carries:O,words:x}],["resource.load",{at:[0],carries:[],words:x}],["resource.paginate",{at:[1],carries:[],words:we}],["select",{at:[2],carries:[],values:f,words:m}],["scope.while",{at:[2],carries:[],words:ge}]]),De=new Map([["activity","stateActivity"],["invalidate","resourceInvalidate"],["pending","linkSourcePending"],["policy","navigatorPolicy"],["status","commandOutcomeStatus"],["view","surfaceView"]]),Se=new Map([["call","contextCall"],["calls","contextCalls"],["scope.keyed","scopeKeyed"]]),Ce=new Map([["effect","write `ctx.effect(...)`"],["event","write `ctx.event(...)`"],["resource","write `ctx.resource.load(...)` or `ctx.resource.live(...)`"],["scope","write `ctx.scope.switch(...)`, `ctx.scope.while(...)` or `ctx.scope.each(...)`"],["lane","declare a lane and use `ctx.command(\u2026, { concurrency: lane })`"]]),xe=["@opetope/core/testing","@opetope/react/testing","@opetope/runtime/testing"],Oe=new Map([["useSelector",{messageId:"reactUseSelector",module:"@opetope/react",replacement:"useReadable"}],...["FeatureBoundary","FeatureBoundaryError","useFeature","useFeatureRetry","FeatureBoundaryProps","FeatureDemandLease","FeatureDemandResult","FeatureDemandSource","FeatureDemandState"].map(a=>[a,{messageId:"reactFeatureDemand",module:"@opetope/react/integration",replacement:"ContributionBoundary"}]),["ApplicationConditionBinding",{messageId:"runtimeInternalEntry",module:"@opetope/runtime/internal",replacement:"@opetope/runtime"}],["ApplicationExecution",{messageId:"runtimeInternalEntry",module:"@opetope/runtime/internal",replacement:"@opetope/runtime"}],["ApplicationImportBinding",{messageId:"runtimeInternalEntry",module:"@opetope/runtime/internal",replacement:"@opetope/runtime"}],["Call",{messageId:"commandName",replacement:"Command"}],["CallError",{messageId:"commandName",replacement:"CommandError"}],["CallInputArgs",{messageId:"commandInputArgs",replacement:"RunCommandArgs"}],["CommandInputArgs",{messageId:"commandInputArgs",module:xe,replacement:"RunCommandArgs"}],["CallTimeoutError",{messageId:"commandName",replacement:"CommandTimeoutError"}],["NavigatorPolicy",{messageId:"navigatorPolicy",replacement:"NavigatorCatalogue"}],["ResourceActivity",{messageId:"resourceActivity",replacement:"ResourceNodeActivity"}],["ResourceDisposer",{messageId:"resourceDisposer",replacement:"Disposer"}],["RunCallOptions",{messageId:"commandName",replacement:"RunCommandOptions"}],["externalReadable",{messageId:"fromExternal",replacement:"fromExternal"}],["runCall",{messageId:"commandName",replacement:"runCommand"}],["useCommands",{messageId:"useCommands",replacement:"useModel"}]]);function Te(a,i){const u=Oe.get(a),d=u?.module;return d===void 0||d===i||typeof d!="string"&&d.includes(i)?u:void 0}function he(a){return a.type===o.MemberExpression?a.property:a}const Ae=me({create(a){const i=a.sourceCode,u=le(i,(e,r,t)=>{a.report({...t===void 0?{}:{fix:t},messageId:r,node:e})}),d=e=>{const r=g(i,e.callee);if(r===void 0)return;const t={modifiers:Me.get(r.method),word:Se.get(r.method)};if(!(t.modifiers===void 0&&t.word===void 0))return q(i,r.fn)?t:void 0},I=(e,r)=>{const t=e.arguments[r];if(t===void 0||t.type===o.SpreadElement)return;const n=l(i,t);return n.type===o.ObjectExpression?n:void 0},T=e=>{const r=g(i,e.callee),t=r===void 0?void 0:Re.get(r.method);if(!(r===void 0||t===void 0))return D(i,r.fn,"provides",!0)?t:void 0},h=e=>{if(S(i,e.callee,"@opetope/runtime","defineCondition",!0))return I(e,1)},A=(e,r)=>{if(!r||e.computed)return;if(e.shorthand)return i.getCommentsInside(e).length>0?void 0:s=>s.replaceText(e,`filter: ${i.getText(e.value)}`);const t=i.getText(e.key),n=e.key.type===o.Literal?`${t.charAt(0)}filter${t.charAt(0)}`:"filter";return s=>s.replaceText(e.key,n)},N=(e,r,t)=>{const n=p(e);if(n===void 0)return;const s=r.get(n);if(s===void 0)return;const M=s==="scopeWhileWhen"?A(e,t):void 0;M===void 0?a.report({messageId:s,node:e.key}):a.report({fix:M,messageId:s,node:e.key})},y=(e,r,t=!1)=>{for(const n of e.properties)n.type===o.Property&&N(n,r,t)},k=(e,r)=>{const t=p(e),n=t===void 0?void 0:r.get(t);if(n===void 0)return;const s=l(i,e.value);return s.type===o.Literal&&typeof s.value=="string"?n.get(s.value):void 0},w=(e,r)=>{for(const t of e.properties){if(t.type!==o.Property)continue;const n=k(t,r);n!==void 0&&a.report({messageId:n,node:t.value})}},V=(e,r,t)=>{const n=Q(e,r),s=n===void 0?void 0:l(i,n.value);s?.type===o.ObjectExpression&&(y(s,Ie),t.carriedValues!==void 0&&w(s,t.carriedValues))},v=(e,r)=>{for(const t of r.at){const n=I(e,t);if(n!==void 0){y(n,r.words,e.arguments[t]===n),r.values!==void 0&&w(n,r.values);for(const s of r.carries)V(n,s,r)}}},R=e=>ae(i,e)||se(i,e),P=(e,r)=>r==="resourceInvalidate"?R(e.object):r==="stateActivity"?ce(i,e):r==="navigatorPolicy"?C(i,e.object):r==="surfaceView"?C(i,e.object):r==="linkSourcePending"?de(i,e.object):ue(i,e.object),_=(e,r)=>{const t=De.get(r);return t!==void 0&&P(e,t)?t:void 0},W=(e,r)=>{if(e.computed)return;const t=r==="surfaceView"?"regions":r==="linkSourcePending"?"intent":void 0;return t===void 0?void 0:n=>n.replaceText(e.property,t)},c=e=>{if(e===void 0)return;const r=e.data.to===`\`${e.data.from}\``;a.report({data:e.data,fix:e.fix,messageId:r?"entryRenamed":"entryMoved",node:e.node})},F=(e,r)=>{let t=e;for(;t.type===o.MemberExpression&&t.property.type===o.Identifier&&t.property.name!==r;)t=t.object;return t.type===o.MemberExpression?t.property:t},L=e=>{const r=g(i,e.callee);if(r===void 0)return!1;const t=r.method.split(".")[0];if(t===void 0)return!1;const n=Ce.get(t);return n===void 0||!D(i,r.fn,"own",!0)?!1:(a.report({data:{replacement:n,word:`own.${t}`},messageId:"featureOwnMember",node:F(e.callee,t)}),!0)},B=e=>{const r=fe(i.getScope(e),e);if(r===null)return;const[t]=r.defs;if(!(r.defs.length!==1||t?.type!==H.Variable)&&t.node.id.type===o.Identifier)return{definition:t,variable:r}},j=e=>{const r=B(e);if(r===void 0)return;const{definition:t,variable:n}=r;if(!oe(n,t))return{binding:t.parent.kind==="const"?"fix":"report",candidate:t.node.init??e}},b=e=>{const r=e.type===o.Identifier?j(e):{binding:"report",candidate:e};if(r===void 0)return;const t=l(i,r.candidate);return t.type===o.CallExpression&&S(i,t.callee,"@opetope/kit","createExternalSource",!0)?r.binding==="fix"&&t===r.candidate?"fix":"report":void 0},U=e=>e.parent.type===o.AssignmentExpression&&e.parent.left===e||e.parent.type===o.UpdateExpression&&e.parent.argument===e||e.parent.type===o.UnaryExpression&&e.parent.operator==="delete",K=(e,r)=>{if(r!=="publish")return!1;const t=b(e.object);return t===void 0?!1:(a.report({...t==="fix"&&!e.computed&&!U(e)?{fix:n=>n.replaceText(e.property,"set")}:{},messageId:"externalPublish",node:e.property}),!0)},$=e=>e.computed&&e.key.type===o.Literal&&typeof e.key.value=="string"?e.key.value:p(e),Y=e=>{if($(e)!=="publish"||e.parent.type!==o.ObjectPattern)return;const r=e.parent.parent;r.type!==o.VariableDeclarator||r.init===null||b(r.init)!==void 0&&a.report({messageId:"externalPublish",node:e.key})},G=e=>{if(p(e)!=="invalidate"||e.parent.type!==o.ObjectPattern)return;const r=e.parent.parent;r.type!==o.VariableDeclarator||r.init===null||R(r.init)&&a.report({messageId:"resourceInvalidate",node:e.key})};return{CallExpression(e){if(u.visitCall(e),L(e))return;const r=T(e);r!==void 0&&v(e,r);const t=h(e);t!==void 0&&y(t,be);const n=d(e);n!==void 0&&(n.word!==void 0&&a.report({messageId:n.word,node:he(e.callee)}),n.modifiers!==void 0&&v(e,n.modifiers))},ImportDeclaration(e){if(e.source.value.startsWith("@opetope/")){c(ne(i,e));for(const r of e.specifiers){if(r.type!==o.ImportSpecifier)continue;const t=ie(r),n=Te(t,e.source.value);n!==void 0&&a.report({data:{replacement:n.replacement,word:t},messageId:n.messageId,node:r.imported})}}},ExportAllDeclaration(e){c(te(e))},ExportNamedDeclaration(e){c(re(i,e))},ImportExpression(e){c(ee(i,e))},MemberExpression(e){c(X(i,e));const r=Z(e);if(r===void 0||K(e,r))return;const t=_(e,r);if(t!==void 0){const n=W(e,t);a.report({...n===void 0?{}:{fix:n},messageId:t,node:e.property})}},Property(e){Y(e),G(e)},TSImportType(e){c(J(e))},TSQualifiedName(e){c(z(i,e))},TSTypeReference(e){u.visitType(e)}}},meta:{docs:{description:"A retired word is named with its replacement; entry moves and locally proven Resource spellings are rewritten."},fixable:"code",messages:pe,schema:[],type:"problem"},name:"no-retired-vocabulary"});export{Ae as noRetiredVocabulary};
1
+ import{DefinitionType as H}from"@typescript-eslint/scope-manager";import{AST_NODE_TYPES as o}from"@typescript-eslint/types";import{propertyName as p,findProperty as Q}from"../ast.js";import{methodPath as g,isContextFunction as q}from"../declaration-ingress.js";import{namespaceTypeMove as z,typeImportMove as J,namespaceMemberMove as X,staticMemberName as Z,dynamicMove as ee,reexportMove as re,starMove as te,importMove as ne}from"../entry-moves.js";import{importName as ie,isFeatureSection as D,isApi as S,localValue as l,hasWritesBeyondDefinition as oe}from"../model-bindings.js";import{isResourceValue as ae,isResourceHook as se,isStateActivity as ce,isSurfaceValue as C,isLinkSourceValue as de,isCommandOutcome as ue}from"../retired-vocabulary.js";import{RETIRED_MESSAGES as pe}from"../retired-vocabulary-messages.js";import{createResourceVocabulary as le}from"../resource-vocabulary.js";import{createRule as me,findVariable as fe}from"../rule.js";const m=new Map([["lane","commandLane"],["once","commandOnce"],["policy","commandPolicy"],["queueBy","commandQueueBy"]]),f=new Map([["concurrency",new Map([["latest","commandLatest"]])]]),ye=new Map([["onDispose","effectOnDispose"],["skipInitial","effectSkipInitial"],["when","effectWhen"]]),ge=new Map([["when","scopeWhileWhen"]]),Ie=new Map([["backpressure","eventBackpressure"]]),Ee=new Map([["key","deliveryKey"],["kind","deliveryKind"]]),x=new Map([["pagination","resourcePagination"]]),we=new Map([["nextCursor","paginateNextCursor"]]),O=["backpressure","delivery"],ve=new Map([["overflow",new Map([["reject","deliveryReject"]])]]),I=new Map([["when","contributionWhen"]]),Re=new Map([["pipe",{at:[2],carries:[],words:I}],["register",{at:[2],carries:[],words:I}],["slot",{at:[2],carries:[],words:I}]]),be=new Map([["from","conditionFrom"]]),Me=new Map([["call",{at:[1,2],carries:[],values:f,words:m}],["calls",{at:[2],carries:[],values:f,words:m}],["command",{at:[1,2],carries:[],values:f,words:m}],["effect",{at:[2],carries:[],words:ye}],["event",{at:[3],carries:O,words:Ie}],["resource.live",{at:[0],carriedValues:ve,carries:O,words:x}],["resource.load",{at:[0],carries:[],words:x}],["resource.paginate",{at:[1],carries:[],words:we}],["select",{at:[2],carries:[],values:f,words:m}],["scope.while",{at:[2],carries:[],words:ge}]]),De=new Map([["activity","stateActivity"],["invalidate","resourceInvalidate"],["pending","linkSourcePending"],["policy","navigatorPolicy"],["status","commandOutcomeStatus"],["view","surfaceView"]]),Se=new Map([["call","contextCall"],["calls","contextCalls"],["scope.keyed","scopeKeyed"]]),Ce=new Map([["effect","write `ctx.effect(...)`"],["event","write `ctx.event(...)`"],["resource","write `ctx.resource.load(...)` or `ctx.resource.live(...)`"],["scope","write `ctx.scope.switch(...)`, `ctx.scope.while(...)` or `ctx.scope.each(...)`"],["lane","declare a lane and use `ctx.command(\u2026, { concurrency: lane })`"]]),xe=["@opetope/core/testing","@opetope/react/testing","@opetope/runtime/testing"],Oe=new Map([["useSelector",{messageId:"reactUseSelector",module:"@opetope/react",replacement:"useReadable"}],["FeatureBodyOf",{messageId:"featureBodyOf",module:"@opetope/runtime",replacement:"defineFeature.body"}],...["FeatureBoundary","FeatureBoundaryError","useFeature","useFeatureRetry","FeatureBoundaryProps","FeatureDemandLease","FeatureDemandResult","FeatureDemandSource","FeatureDemandState"].map(a=>[a,{messageId:"reactFeatureDemand",module:"@opetope/react/integration",replacement:"ContributionBoundary"}]),["ApplicationConditionBinding",{messageId:"runtimeInternalEntry",module:"@opetope/runtime/internal",replacement:"@opetope/runtime"}],["ApplicationExecution",{messageId:"runtimeInternalEntry",module:"@opetope/runtime/internal",replacement:"@opetope/runtime"}],["ApplicationImportBinding",{messageId:"runtimeInternalEntry",module:"@opetope/runtime/internal",replacement:"@opetope/runtime"}],["Call",{messageId:"commandName",replacement:"Command"}],["CallError",{messageId:"commandName",replacement:"CommandError"}],["CallInputArgs",{messageId:"commandInputArgs",replacement:"RunCommandArgs"}],["CommandInputArgs",{messageId:"commandInputArgs",module:xe,replacement:"RunCommandArgs"}],["CallTimeoutError",{messageId:"commandName",replacement:"CommandTimeoutError"}],["NavigatorPolicy",{messageId:"navigatorPolicy",replacement:"NavigatorCatalogue"}],["ResourceActivity",{messageId:"resourceActivity",replacement:"ResourceNodeActivity"}],["ResourceDisposer",{messageId:"resourceDisposer",replacement:"Disposer"}],["RunCallOptions",{messageId:"commandName",replacement:"RunCommandOptions"}],["externalReadable",{messageId:"fromExternal",replacement:"fromExternal"}],["runCall",{messageId:"commandName",replacement:"runCommand"}],["useCommands",{messageId:"useCommands",replacement:"useModel"}]]);function Te(a,i){const u=Oe.get(a),d=u?.module;return d===void 0||d===i||typeof d!="string"&&d.includes(i)?u:void 0}function he(a){return a.type===o.MemberExpression?a.property:a}const Ae=me({create(a){const i=a.sourceCode,u=le(i,(e,r,t)=>{a.report({...t===void 0?{}:{fix:t},messageId:r,node:e})}),d=e=>{const r=g(i,e.callee);if(r===void 0)return;const t={modifiers:Me.get(r.method),word:Se.get(r.method)};if(!(t.modifiers===void 0&&t.word===void 0))return q(i,r.fn)?t:void 0},E=(e,r)=>{const t=e.arguments[r];if(t===void 0||t.type===o.SpreadElement)return;const n=l(i,t);return n.type===o.ObjectExpression?n:void 0},T=e=>{const r=g(i,e.callee),t=r===void 0?void 0:Re.get(r.method);if(!(r===void 0||t===void 0))return D(i,r.fn,"provides",!0)?t:void 0},h=e=>{if(S(i,e.callee,"@opetope/runtime","defineCondition",!0))return E(e,1)},A=(e,r)=>{if(!r||e.computed)return;if(e.shorthand)return i.getCommentsInside(e).length>0?void 0:s=>s.replaceText(e,`filter: ${i.getText(e.value)}`);const t=i.getText(e.key),n=e.key.type===o.Literal?`${t.charAt(0)}filter${t.charAt(0)}`:"filter";return s=>s.replaceText(e.key,n)},N=(e,r,t)=>{const n=p(e);if(n===void 0)return;const s=r.get(n);if(s===void 0)return;const M=s==="scopeWhileWhen"?A(e,t):void 0;M===void 0?a.report({messageId:s,node:e.key}):a.report({fix:M,messageId:s,node:e.key})},y=(e,r,t=!1)=>{for(const n of e.properties)n.type===o.Property&&N(n,r,t)},k=(e,r)=>{const t=p(e),n=t===void 0?void 0:r.get(t);if(n===void 0)return;const s=l(i,e.value);return s.type===o.Literal&&typeof s.value=="string"?n.get(s.value):void 0},w=(e,r)=>{for(const t of e.properties){if(t.type!==o.Property)continue;const n=k(t,r);n!==void 0&&a.report({messageId:n,node:t.value})}},V=(e,r,t)=>{const n=Q(e,r),s=n===void 0?void 0:l(i,n.value);s?.type===o.ObjectExpression&&(y(s,Ee),t.carriedValues!==void 0&&w(s,t.carriedValues))},v=(e,r)=>{for(const t of r.at){const n=E(e,t);if(n!==void 0){y(n,r.words,e.arguments[t]===n),r.values!==void 0&&w(n,r.values);for(const s of r.carries)V(n,s,r)}}},R=e=>ae(i,e)||se(i,e),P=(e,r)=>r==="resourceInvalidate"?R(e.object):r==="stateActivity"?ce(i,e):r==="navigatorPolicy"?C(i,e.object):r==="surfaceView"?C(i,e.object):r==="linkSourcePending"?de(i,e.object):ue(i,e.object),_=(e,r)=>{const t=De.get(r);return t!==void 0&&P(e,t)?t:void 0},W=(e,r)=>{if(e.computed)return;const t=r==="surfaceView"?"regions":r==="linkSourcePending"?"intent":void 0;return t===void 0?void 0:n=>n.replaceText(e.property,t)},c=e=>{if(e===void 0)return;const r=e.data.to===`\`${e.data.from}\``;a.report({data:e.data,fix:e.fix,messageId:r?"entryRenamed":"entryMoved",node:e.node})},F=(e,r)=>{let t=e;for(;t.type===o.MemberExpression&&t.property.type===o.Identifier&&t.property.name!==r;)t=t.object;return t.type===o.MemberExpression?t.property:t},B=e=>{const r=g(i,e.callee);if(r===void 0)return!1;const t=r.method.split(".")[0];if(t===void 0)return!1;const n=Ce.get(t);return n===void 0||!D(i,r.fn,"own",!0)?!1:(a.report({data:{replacement:n,word:`own.${t}`},messageId:"featureOwnMember",node:F(e.callee,t)}),!0)},L=e=>{const r=fe(i.getScope(e),e);if(r===null)return;const[t]=r.defs;if(!(r.defs.length!==1||t?.type!==H.Variable)&&t.node.id.type===o.Identifier)return{definition:t,variable:r}},j=e=>{const r=L(e);if(r===void 0)return;const{definition:t,variable:n}=r;if(!oe(n,t))return{binding:t.parent.kind==="const"?"fix":"report",candidate:t.node.init??e}},b=e=>{const r=e.type===o.Identifier?j(e):{binding:"report",candidate:e};if(r===void 0)return;const t=l(i,r.candidate);return t.type===o.CallExpression&&S(i,t.callee,"@opetope/kit","createExternalSource",!0)?r.binding==="fix"&&t===r.candidate?"fix":"report":void 0},U=e=>e.parent.type===o.AssignmentExpression&&e.parent.left===e||e.parent.type===o.UpdateExpression&&e.parent.argument===e||e.parent.type===o.UnaryExpression&&e.parent.operator==="delete",K=(e,r)=>{if(r!=="publish")return!1;const t=b(e.object);return t===void 0?!1:(a.report({...t==="fix"&&!e.computed&&!U(e)?{fix:n=>n.replaceText(e.property,"set")}:{},messageId:"externalPublish",node:e.property}),!0)},$=e=>e.computed&&e.key.type===o.Literal&&typeof e.key.value=="string"?e.key.value:p(e),Y=e=>{if($(e)!=="publish"||e.parent.type!==o.ObjectPattern)return;const r=e.parent.parent;r.type!==o.VariableDeclarator||r.init===null||b(r.init)!==void 0&&a.report({messageId:"externalPublish",node:e.key})},G=e=>{if(p(e)!=="invalidate"||e.parent.type!==o.ObjectPattern)return;const r=e.parent.parent;r.type!==o.VariableDeclarator||r.init===null||R(r.init)&&a.report({messageId:"resourceInvalidate",node:e.key})};return{CallExpression(e){if(u.visitCall(e),B(e))return;const r=T(e);r!==void 0&&v(e,r);const t=h(e);t!==void 0&&y(t,be);const n=d(e);n!==void 0&&(n.word!==void 0&&a.report({messageId:n.word,node:he(e.callee)}),n.modifiers!==void 0&&v(e,n.modifiers))},ImportDeclaration(e){if(e.source.value.startsWith("@opetope/")){c(ne(i,e));for(const r of e.specifiers){if(r.type!==o.ImportSpecifier)continue;const t=ie(r),n=Te(t,e.source.value);n!==void 0&&a.report({data:{replacement:n.replacement,word:t},messageId:n.messageId,node:r.imported})}}},ExportAllDeclaration(e){c(te(e))},ExportNamedDeclaration(e){c(re(i,e))},ImportExpression(e){c(ee(i,e))},MemberExpression(e){c(X(i,e));const r=Z(e);if(r===void 0||K(e,r))return;const t=_(e,r);if(t!==void 0){const n=W(e,t);a.report({...n===void 0?{}:{fix:n},messageId:t,node:e.property})}},Property(e){Y(e),G(e)},TSImportType(e){c(J(e))},TSQualifiedName(e){c(z(i,e))},TSTypeReference(e){u.visitType(e)}}},meta:{docs:{description:"A retired word is named with its replacement; entry moves and locally proven Resource spellings are rewritten."},fixable:"code",messages:pe,schema:[],type:"problem"},name:"no-retired-vocabulary"});export{Ae as noRetiredVocabulary};
2
2
  //# sourceMappingURL=no-retired-vocabulary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-retired-vocabulary.js","sources":["../../src/rules/no-retired-vocabulary.ts"],"sourcesContent":["import { DefinitionType } from '@typescript-eslint/scope-manager';\nimport { AST_NODE_TYPES } from '@typescript-eslint/types';\nimport type { TSESTree } from '@typescript-eslint/types';\n\nimport { findProperty, propertyName } from '../ast';\nimport { isContextFunction, methodPath } from '../declaration-ingress';\nimport type { EntryMove } from '../entry-moves';\nimport {\n dynamicMove,\n importMove,\n namespaceMemberMove,\n namespaceTypeMove,\n reexportMove,\n starMove,\n staticMemberName,\n typeImportMove,\n} from '../entry-moves';\nimport { hasWritesBeyondDefinition, importName, isApi, isFeatureSection, localValue } from '../model-bindings';\nimport {\n isCommandOutcome,\n isLinkSourceValue,\n isResourceHook,\n isResourceValue,\n isStateActivity,\n isSurfaceValue,\n} from '../retired-vocabulary';\nimport { RETIRED_MESSAGES } from '../retired-vocabulary-messages';\nimport type { MessageIds } from '../retired-vocabulary-messages';\nimport { createResourceVocabulary } from '../resource-vocabulary';\nimport { createRule, findVariable } from '../rule';\nimport type { ReportFixFunction } from '../rule';\n\n/**\n * One name a package no longer exports, and the word that carries its meaning now. D411: `module` is written where\n * the name is retired at one entry and live at another — `ApplicationConditionBinding` is still the name, on the\n * entry an author is meant to take it from. D462 took the scope off `ResourceActivity`: the name is now retired at\n * both entries it was ever written from, so asking the module would only let one of them through.\n */\ntype Retired = { readonly messageId: MessageIds; readonly module?: Modules; readonly replacement: string };\ntype Modules = string | readonly string[];\n/**\n * Where one node keeps its modifiers, and which retired words live there. `at` holds every position the record is\n * written in across the two surfaces — `ctx.command(run, options)` and `own.command(within, run, options)` — and\n * nothing else at those positions is an object literal, so one list answers both. `carries` names the members whose\n * own record is read in turn: a delivery policy is a record inside a record.\n */\ntype Modifiers = {\n readonly at: readonly number[];\n readonly carries: readonly string[];\n /** D411: a word of a carried record whose **value** was retired, not its key: `overflow: 'reject'` is one. */\n readonly carriedValues?: ReadonlyMap<string, ReadonlyMap<string, MessageIds>>;\n /** D459: the same fact one record higher — a word retired as the **value** of a field of this record itself. */\n readonly values?: ReadonlyMap<string, ReadonlyMap<string, MessageIds>>;\n readonly words: ReadonlyMap<string, MessageIds>;\n};\n\n/** D387, D389: the four words the options record of a command declaration and of a selection retired. */\nconst COMMAND_WORDS = new Map<string, MessageIds>([\n ['lane', 'commandLane'],\n ['once', 'commandOnce'],\n ['policy', 'commandPolicy'],\n ['queueBy', 'commandQueueBy'],\n]);\n/** D459: the one value of that record that moved — the waiting place is written as the record that names it. */\nconst COMMAND_VALUES = new Map<string, ReadonlyMap<string, MessageIds>>([\n ['concurrency', new Map<string, MessageIds>([['latest', 'commandLatest']])],\n]);\n/** D379: the three modifiers of an effect run. */\nconst EFFECT_WORDS = new Map<string, MessageIds>([\n ['onDispose', 'effectOnDispose'],\n ['skipInitial', 'effectSkipInitial'],\n ['when', 'effectWhen'],\n]);\nconst WHILE_WORDS = new Map<string, MessageIds>([['when', 'scopeWhileWhen']]);\nconst EVENT_WORDS = new Map<string, MessageIds>([['backpressure', 'eventBackpressure']]);\n/** D374: the two fields inside the record, whichever of the two words the record itself is still written under. */\nconst DELIVERY_WORDS = new Map<string, MessageIds>([\n ['key', 'deliveryKey'],\n ['kind', 'deliveryKind'],\n]);\n/** D486: pagination left the declaration record; it is `resource.paginate(resource, { cursor, load, merge })`. */\nconst DECLARATION_WORDS = new Map<string, MessageIds>([['pagination', 'resourcePagination']]);\n/** D486: the selector of the next cursor is `cursor`, so alphabetical order is the order TypeScript infers in. */\nconst PAGINATE_WORDS = new Map<string, MessageIds>([['nextCursor', 'paginateNextCursor']]);\nconst DELIVERY = ['backpressure', 'delivery'];\n/** D411: the one field of a delivery whose value moved: a full keyed capacity answers `drop`, not `reject`. */\nconst LIVE_DELIVERY_VALUES = new Map<string, ReadonlyMap<string, MessageIds>>([\n ['overflow', new Map<string, MessageIds>([['reject', 'deliveryReject']])],\n]);\n/** D411: the words a contribution writes beside its value, on the `provides` section that declares it. */\nconst CONTRIBUTION_WORDS = new Map<string, MessageIds>([['when', 'contributionWhen']]);\nconst CONTRIBUTION_RECORDS = new Map<string, Modifiers>([\n ['pipe', { at: [2], carries: [], words: CONTRIBUTION_WORDS }],\n ['register', { at: [2], carries: [], words: CONTRIBUTION_WORDS }],\n ['slot', { at: [2], carries: [], words: CONTRIBUTION_WORDS }],\n]);\n/** D411: the record `defineCondition` takes second; the word it named its source by is the one that moved. */\nconst CONDITION_WORDS = new Map<string, MessageIds>([['from', 'conditionFrom']]);\n\nconst OPTION_RECORDS = new Map<string, Modifiers>([\n ['call', { at: [1, 2], carries: [], values: COMMAND_VALUES, words: COMMAND_WORDS }],\n ['calls', { at: [2], carries: [], values: COMMAND_VALUES, words: COMMAND_WORDS }],\n ['command', { at: [1, 2], carries: [], values: COMMAND_VALUES, words: COMMAND_WORDS }],\n ['effect', { at: [2], carries: [], words: EFFECT_WORDS }],\n ['event', { at: [3], carries: DELIVERY, words: EVENT_WORDS }],\n ['resource.live', { at: [0], carriedValues: LIVE_DELIVERY_VALUES, carries: DELIVERY, words: DECLARATION_WORDS }],\n ['resource.load', { at: [0], carries: [], words: DECLARATION_WORDS }],\n ['resource.paginate', { at: [1], carries: [], words: PAGINATE_WORDS }],\n ['select', { at: [2], carries: [], values: COMMAND_VALUES, words: COMMAND_WORDS }],\n ['scope.while', { at: [2], carries: [], words: WHILE_WORDS }],\n]);\n\n/** D411, D415, D462: the members whose name is retired, each with the object it has to have been read on. */\nconst RETIRED_MEMBERS = new Map<string, MessageIds>([\n ['activity', 'stateActivity'],\n ['invalidate', 'resourceInvalidate'],\n ['pending', 'linkSourcePending'],\n ['policy', 'navigatorPolicy'],\n ['status', 'commandOutcomeStatus'],\n ['view', 'surfaceView'],\n]);\n\n/** D378, D385, D388: the methods themselves, named on a declaring context of this library. */\nconst RETIRED_METHODS = new Map<string, MessageIds>([\n ['call', 'contextCall'],\n ['calls', 'contextCalls'],\n ['scope.keyed', 'scopeKeyed'],\n]);\n\n/** D380, D385, D388: the names an `@opetope/*` entry no longer exports. The module itself is the proof. */\nconst FEATURE_OWN_REMOVED = new Map<string, string>([\n ['effect', 'write `ctx.effect(...)`'],\n ['event', 'write `ctx.event(...)`'],\n ['resource', 'write `ctx.resource.load(...)` or `ctx.resource.live(...)`'],\n ['scope', 'write `ctx.scope.switch(...)`, `ctx.scope.while(...)` or `ctx.scope.each(...)`'],\n ['lane', 'declare a lane and use `ctx.command(…, { concurrency: lane })`'],\n]);\n\n/** D517: the entries `CommandInputArgs` left; `@opetope/core/internal` still names it for the library itself. */\nconst TESTING_ENTRIES = ['@opetope/core/testing', '@opetope/react/testing', '@opetope/runtime/testing'];\nconst RETIRED_IMPORTS = new Map<string, Retired>([\n ['useSelector', { messageId: 'reactUseSelector', module: '@opetope/react', replacement: 'useReadable' }],\n ...[\n 'FeatureBoundary',\n 'FeatureBoundaryError',\n 'useFeature',\n 'useFeatureRetry',\n 'FeatureBoundaryProps',\n 'FeatureDemandLease',\n 'FeatureDemandResult',\n 'FeatureDemandSource',\n 'FeatureDemandState',\n ].map(\n name =>\n [\n name,\n {\n messageId: 'reactFeatureDemand' as const,\n module: '@opetope/react/integration',\n replacement: 'ContributionBoundary',\n },\n ] as const,\n ),\n [\n 'ApplicationConditionBinding',\n { messageId: 'runtimeInternalEntry', module: '@opetope/runtime/internal', replacement: '@opetope/runtime' },\n ],\n /** D411, D415: the entry retired three copies, and a table that held one left two migrations unnamed. */\n [\n 'ApplicationExecution',\n { messageId: 'runtimeInternalEntry', module: '@opetope/runtime/internal', replacement: '@opetope/runtime' },\n ],\n [\n 'ApplicationImportBinding',\n { messageId: 'runtimeInternalEntry', module: '@opetope/runtime/internal', replacement: '@opetope/runtime' },\n ],\n ['Call', { messageId: 'commandName', replacement: 'Command' }],\n ['CallError', { messageId: 'commandName', replacement: 'CommandError' }],\n /** D517: the input tuple of a command execution left the testing entries; the wrappers it served name others. */\n ['CallInputArgs', { messageId: 'commandInputArgs', replacement: 'RunCommandArgs' }],\n ['CommandInputArgs', { messageId: 'commandInputArgs', module: TESTING_ENTRIES, replacement: 'RunCommandArgs' }],\n ['CallTimeoutError', { messageId: 'commandName', replacement: 'CommandTimeoutError' }],\n ['NavigatorPolicy', { messageId: 'navigatorPolicy', replacement: 'NavigatorCatalogue' }],\n ['ResourceActivity', { messageId: 'resourceActivity', replacement: 'ResourceNodeActivity' }],\n ['ResourceDisposer', { messageId: 'resourceDisposer', replacement: 'Disposer' }],\n ['RunCallOptions', { messageId: 'commandName', replacement: 'RunCommandOptions' }],\n ['externalReadable', { messageId: 'fromExternal', replacement: 'fromExternal' }],\n ['runCall', { messageId: 'commandName', replacement: 'runCommand' }],\n ['useCommands', { messageId: 'useCommands', replacement: 'useModel' }],\n]);\n\n/** The retired entry of a name imported from `from`, when the name is retired at that entry. */\nfunction retiredImport(word: string, from: string): Retired | undefined {\n const retired = RETIRED_IMPORTS.get(word);\n const module = retired?.module;\n\n return module === undefined || module === from || (typeof module !== 'string' && module.includes(from))\n ? retired\n : undefined;\n}\n\n/** What one call of a declaring context is, as far as this rule reads it: a retired word, retired modifiers, both. */\ntype Declared = { readonly modifiers: Modifiers | undefined; readonly word: MessageIds | undefined };\n\n/** The word a callee ends in: `keyed` of `own.scope.keyed`, or the plain name a destructured member is called by. */\nfunction calleeWord(callee: TSESTree.Node): TSESTree.Node {\n return callee.type === AST_NODE_TYPES.MemberExpression ? callee.property : callee;\n}\n\nconst noRetiredVocabulary = createRule<[], MessageIds>({\n create(context) {\n const source = context.sourceCode;\n const resourceVocabulary = createResourceVocabulary(source, (node, messageId, fix) => {\n context.report({ ...(fix === undefined ? {} : { fix }), messageId, node });\n });\n\n /**\n * The shape decides first and the context second: a call whose method this rule has nothing to say about never\n * pays for resolving the parameter it was written on (D309, D323).\n */\n const declaredCall = (node: TSESTree.CallExpression): Declared | undefined => {\n const named = methodPath(source, node.callee);\n\n if (named === undefined) return undefined;\n\n const declared: Declared = {\n modifiers: OPTION_RECORDS.get(named.method),\n word: RETIRED_METHODS.get(named.method),\n };\n\n if (declared.modifiers === undefined && declared.word === undefined) return undefined;\n\n return isContextFunction(source, named.fn) ? declared : undefined;\n };\n /** The record written at one of the positions this node takes its modifiers in, past the name it was given. */\n const recordAt = (node: TSESTree.CallExpression, position: number): TSESTree.ObjectExpression | undefined => {\n const argument = node.arguments[position];\n\n if (argument === undefined || argument.type === AST_NODE_TYPES.SpreadElement) return undefined;\n\n const value = localValue(source, argument);\n\n return value.type === AST_NODE_TYPES.ObjectExpression ? value : undefined;\n };\n /**\n * D411: a contribution is declared on `provides`, not on `own`, so the section that proves it is its own. The\n * shape decides first here too: nothing resolves a section for a method this rule has nothing to say about.\n */\n const contributionCall = (node: TSESTree.CallExpression): Modifiers | undefined => {\n const named = methodPath(source, node.callee);\n const modifiers = named === undefined ? undefined : CONTRIBUTION_RECORDS.get(named.method);\n\n if (named === undefined || modifiers === undefined) return undefined;\n\n return isFeatureSection(source, named.fn, 'provides', true) ? modifiers : undefined;\n };\n /** D411: `defineCondition(id, options)` is a name this package exports, so the import is what proves it. */\n const conditionRecord = (node: TSESTree.CallExpression): TSESTree.ObjectExpression | undefined => {\n if (!isApi(source, node.callee, '@opetope/runtime', 'defineCondition', true)) return undefined;\n\n return recordAt(node, 1);\n };\n const whileFix = (property: TSESTree.Property, direct: boolean): ReportFixFunction | undefined => {\n if (!direct || property.computed) return undefined;\n if (property.shorthand) {\n if (source.getCommentsInside(property).length > 0) return undefined;\n return fixer => fixer.replaceText(property, `filter: ${source.getText(property.value)}`);\n }\n const written = source.getText(property.key);\n const next =\n property.key.type === AST_NODE_TYPES.Literal ? `${written.charAt(0)}filter${written.charAt(0)}` : 'filter';\n return fixer => fixer.replaceText(property.key, next);\n };\n const reportProperty = (\n property: TSESTree.Property,\n words: ReadonlyMap<string, MessageIds>,\n direct: boolean,\n ): void => {\n const name = propertyName(property);\n if (name === undefined) return;\n const messageId = words.get(name);\n if (messageId === undefined) return;\n const fix = messageId === 'scopeWhileWhen' ? whileFix(property, direct) : undefined;\n if (fix === undefined) context.report({ messageId, node: property.key });\n else context.report({ fix, messageId, node: property.key });\n };\n const reportRecord = (\n record: TSESTree.ObjectExpression,\n words: ReadonlyMap<string, MessageIds>,\n direct = false,\n ): void => {\n for (const property of record.properties)\n if (property.type === AST_NODE_TYPES.Property) reportProperty(property, words, direct);\n };\n /** D411: the word this property was written with, where that word is a retired value of a known field. */\n const retiredValue = (\n property: TSESTree.Property,\n values: ReadonlyMap<string, ReadonlyMap<string, MessageIds>>,\n ): MessageIds | undefined => {\n const name = propertyName(property);\n const written = name === undefined ? undefined : values.get(name);\n\n if (written === undefined) return undefined;\n\n const value = localValue(source, property.value);\n\n return value.type === AST_NODE_TYPES.Literal && typeof value.value === 'string'\n ? written.get(value.value)\n : undefined;\n };\n /** D411: the value a field of a carried record was written with, where that value is the retired word. */\n const reportValues = (\n record: TSESTree.ObjectExpression,\n values: ReadonlyMap<string, ReadonlyMap<string, MessageIds>>,\n ): void => {\n for (const property of record.properties) {\n if (property.type !== AST_NODE_TYPES.Property) continue;\n\n const messageId = retiredValue(property, values);\n\n if (messageId !== undefined) context.report({ messageId, node: property.value });\n }\n };\n const reportCarried = (record: TSESTree.ObjectExpression, carrier: string, modifiers: Modifiers): void => {\n const property = findProperty(record, carrier);\n const carried = property === undefined ? undefined : localValue(source, property.value);\n\n if (carried?.type !== AST_NODE_TYPES.ObjectExpression) return;\n\n reportRecord(carried, DELIVERY_WORDS);\n\n if (modifiers.carriedValues !== undefined) reportValues(carried, modifiers.carriedValues);\n };\n const reportModifiers = (node: TSESTree.CallExpression, modifiers: Modifiers): void => {\n for (const position of modifiers.at) {\n const record = recordAt(node, position);\n\n if (record === undefined) continue;\n\n reportRecord(record, modifiers.words, node.arguments[position] === record);\n\n if (modifiers.values !== undefined) reportValues(record, modifiers.values);\n\n for (const carrier of modifiers.carries) reportCarried(record, carrier, modifiers);\n }\n };\n /** Both objects that used to answer `invalidate`: the Resource itself, and the record `useResource` builds. */\n const holdsVerbs = (node: TSESTree.Node): boolean => isResourceValue(source, node) || isResourceHook(source, node);\n /** The object each retired member has to be read on, asked only once the name has already matched. */\n const memberOwner = (node: TSESTree.MemberExpression, messageId: MessageIds): boolean => {\n if (messageId === 'resourceInvalidate') return holdsVerbs(node.object);\n\n if (messageId === 'stateActivity') return isStateActivity(source, node);\n\n if (messageId === 'navigatorPolicy') return isSurfaceValue(source, node.object);\n\n if (messageId === 'surfaceView') return isSurfaceValue(source, node.object);\n\n if (messageId === 'linkSourcePending') return isLinkSourceValue(source, node.object);\n\n return isCommandOutcome(source, node.object);\n };\n /**\n * The four members this rule reads off a value it can resolve (D415 added `surface.policy`, which the message\n * of `NavigatorPolicy` already named and the rule did not report). The name decides first and the resolution\n * second, so a member this rule has nothing to say about never pays for the object it was read on (D309, D323).\n */\n const retiredMember = (node: TSESTree.MemberExpression, name: string): MessageIds | undefined => {\n const messageId = RETIRED_MEMBERS.get(name);\n\n return messageId !== undefined && memberOwner(node, messageId) ? messageId : undefined;\n };\n const retiredMemberFix = (\n node: TSESTree.MemberExpression,\n messageId: MessageIds,\n ): ReportFixFunction | undefined => {\n if (node.computed) return undefined;\n\n const replacement =\n messageId === 'surfaceView' ? 'regions' : messageId === 'linkSourcePending' ? 'intent' : undefined;\n\n return replacement === undefined ? undefined : fixer => fixer.replaceText(node.property, replacement);\n };\n\n /** Each migration report has a local edit; no fix reaches into later references or across another rule's span. */\n const reportMove = (move: EntryMove | undefined): void => {\n if (move === undefined) return;\n const sameEntry = move.data['to'] === `\\`${move.data['from']}\\``;\n context.report({\n data: move.data,\n fix: move.fix,\n messageId: sameEntry ? 'entryRenamed' : 'entryMoved',\n node: move.node,\n });\n };\n\n const featureWord = (callee: TSESTree.Node, root: string): TSESTree.Node => {\n let word = callee;\n while (\n word.type === AST_NODE_TYPES.MemberExpression &&\n word.property.type === AST_NODE_TYPES.Identifier &&\n word.property.name !== root\n )\n word = word.object;\n return word.type === AST_NODE_TYPES.MemberExpression ? word.property : word;\n };\n /** D501: report only a removed method of Opetope Feature own, including destructured aliases. */\n const reportRemovedFeatureOwn = (node: TSESTree.CallExpression): boolean => {\n const named = methodPath(source, node.callee);\n if (named === undefined) return false;\n const root = named.method.split('.')[0];\n if (root === undefined) return false;\n const replacement = FEATURE_OWN_REMOVED.get(root);\n if (replacement === undefined || !isFeatureSection(source, named.fn, 'own', true)) return false;\n context.report({\n data: { replacement, word: `own.${root}` },\n messageId: 'featureOwnMember',\n node: featureWord(node.callee, root),\n });\n return true;\n };\n\n /** Resolve one lexical variable definition before considering its creator. */\n const kitVariable = (node: TSESTree.Identifier) => {\n const variable = findVariable(source.getScope(node), node);\n if (variable === null) return undefined;\n const [definition] = variable.defs;\n if (variable.defs.length !== 1 || definition?.type !== DefinitionType.Variable) return undefined;\n if (definition.node.id.type !== AST_NODE_TYPES.Identifier) return undefined;\n return { definition, variable };\n };\n\n /** A later write makes even a diagnostic speculative: the receiver may no longer be a Kit source. */\n const kitBinding = (node: TSESTree.Identifier) => {\n const resolved = kitVariable(node);\n if (resolved === undefined) return undefined;\n const { definition, variable } = resolved;\n if (hasWritesBeyondDefinition(variable, definition)) return undefined;\n return {\n binding: definition.parent.kind === 'const' ? 'fix' : 'report',\n candidate: definition.node.init ?? node,\n } as const;\n };\n\n /** Same-file creator provenance determines whether `publish` is safe to rewrite or only worth reporting. */\n const kitSource = (node: TSESTree.Node): 'fix' | 'report' | undefined => {\n const resolved =\n node.type === AST_NODE_TYPES.Identifier ? kitBinding(node) : { binding: 'report', candidate: node };\n if (resolved === undefined) return undefined;\n const creator = localValue(source, resolved.candidate);\n return creator.type === AST_NODE_TYPES.CallExpression &&\n isApi(source, creator.callee, '@opetope/kit', 'createExternalSource', true)\n ? resolved.binding === 'fix' && creator === resolved.candidate\n ? 'fix'\n : 'report'\n : undefined;\n };\n\n const isKitWrite = (node: TSESTree.MemberExpression): boolean =>\n (node.parent.type === AST_NODE_TYPES.AssignmentExpression && node.parent.left === node) ||\n (node.parent.type === AST_NODE_TYPES.UpdateExpression && node.parent.argument === node) ||\n (node.parent.type === AST_NODE_TYPES.UnaryExpression && node.parent.operator === 'delete');\n\n const reportKitMember = (node: TSESTree.MemberExpression, name: string): boolean => {\n if (name !== 'publish') return false;\n const kit = kitSource(node.object);\n if (kit === undefined) return false;\n context.report({\n ...(kit === 'fix' && !node.computed && !isKitWrite(node)\n ? { fix: (fixer: Parameters<ReportFixFunction>[0]) => fixer.replaceText(node.property, 'set') }\n : {}),\n messageId: 'externalPublish',\n node: node.property,\n });\n return true;\n };\n\n const patternKey = (node: TSESTree.Property): string | undefined =>\n node.computed && node.key.type === AST_NODE_TYPES.Literal && typeof node.key.value === 'string'\n ? node.key.value\n : propertyName(node);\n\n const reportKitDestructure = (node: TSESTree.Property): void => {\n if (patternKey(node) !== 'publish' || node.parent.type !== AST_NODE_TYPES.ObjectPattern) return;\n const declarator = node.parent.parent;\n if (declarator.type !== AST_NODE_TYPES.VariableDeclarator || declarator.init === null) return;\n if (kitSource(declarator.init) !== undefined) context.report({ messageId: 'externalPublish', node: node.key });\n };\n\n const reportResourceDestructure = (node: TSESTree.Property): void => {\n if (propertyName(node) !== 'invalidate' || node.parent.type !== AST_NODE_TYPES.ObjectPattern) return;\n const declarator = node.parent.parent;\n if (declarator.type !== AST_NODE_TYPES.VariableDeclarator || declarator.init === null) return;\n if (holdsVerbs(declarator.init)) context.report({ messageId: 'resourceInvalidate', node: node.key });\n };\n\n return {\n CallExpression(node): void {\n resourceVocabulary.visitCall(node);\n if (reportRemovedFeatureOwn(node)) return;\n const contribution = contributionCall(node);\n\n if (contribution !== undefined) reportModifiers(node, contribution);\n\n const condition = conditionRecord(node);\n\n if (condition !== undefined) reportRecord(condition, CONDITION_WORDS);\n\n const declared = declaredCall(node);\n\n if (declared === undefined) return;\n\n if (declared.word !== undefined) context.report({ messageId: declared.word, node: calleeWord(node.callee) });\n\n if (declared.modifiers !== undefined) reportModifiers(node, declared.modifiers);\n },\n ImportDeclaration(node): void {\n if (!node.source.value.startsWith('@opetope/')) return;\n\n reportMove(importMove(source, node));\n\n for (const specifier of node.specifiers) {\n if (specifier.type !== AST_NODE_TYPES.ImportSpecifier) continue;\n\n const word = importName(specifier);\n const retired = retiredImport(word, node.source.value);\n\n if (retired !== undefined) {\n context.report({\n data: { replacement: retired.replacement, word },\n messageId: retired.messageId,\n node: specifier.imported,\n });\n }\n }\n },\n ExportAllDeclaration(node): void {\n reportMove(starMove(node));\n },\n ExportNamedDeclaration(node): void {\n reportMove(reexportMove(source, node));\n },\n ImportExpression(node): void {\n reportMove(dynamicMove(source, node));\n },\n MemberExpression(node): void {\n reportMove(namespaceMemberMove(source, node));\n const name = staticMemberName(node);\n if (name === undefined || reportKitMember(node, name)) return;\n const messageId = retiredMember(node, name);\n\n if (messageId !== undefined) {\n const fix = retiredMemberFix(node, messageId);\n context.report({\n ...(fix === undefined ? {} : { fix }),\n messageId,\n node: node.property,\n });\n }\n },\n Property(node): void {\n reportKitDestructure(node);\n reportResourceDestructure(node);\n },\n TSImportType(node): void {\n reportMove(typeImportMove(node));\n },\n TSQualifiedName(node): void {\n reportMove(namespaceTypeMove(source, node));\n },\n TSTypeReference(node): void {\n resourceVocabulary.visitType(node);\n },\n };\n },\n meta: {\n docs: {\n description:\n 'A retired word is named with its replacement; entry moves and locally proven Resource spellings are rewritten.',\n },\n fixable: 'code',\n messages: RETIRED_MESSAGES,\n schema: [],\n type: 'problem',\n },\n name: 'no-retired-vocabulary',\n});\n\nexport { noRetiredVocabulary };\n"],"names":["COMMAND_WORDS","COMMAND_VALUES","EFFECT_WORDS","WHILE_WORDS","EVENT_WORDS","DELIVERY_WORDS","DECLARATION_WORDS","PAGINATE_WORDS","DELIVERY","LIVE_DELIVERY_VALUES","CONTRIBUTION_WORDS","CONTRIBUTION_RECORDS","CONDITION_WORDS","OPTION_RECORDS","RETIRED_MEMBERS","RETIRED_METHODS","FEATURE_OWN_REMOVED","TESTING_ENTRIES","RETIRED_IMPORTS","name","retiredImport","word","from","retired","module","calleeWord","callee","AST_NODE_TYPES","noRetiredVocabulary","createRule","context","source","resourceVocabulary","createResourceVocabulary","node","messageId","fix","declaredCall","named","methodPath","declared","isContextFunction","recordAt","position","argument","value","localValue","contributionCall","modifiers","isFeatureSection","conditionRecord","isApi","whileFix","property","direct","fixer","written","next","reportProperty","words","propertyName","reportRecord","record","retiredValue","values","reportValues","reportCarried","carrier","findProperty","carried","reportModifiers","holdsVerbs","isResourceValue","isResourceHook","memberOwner","isStateActivity","isSurfaceValue","isLinkSourceValue","isCommandOutcome","retiredMember","retiredMemberFix","replacement","reportMove","move","sameEntry","featureWord","root","reportRemovedFeatureOwn","kitVariable","variable","findVariable","definition","DefinitionType","kitBinding","resolved","hasWritesBeyondDefinition","kitSource","creator","isKitWrite","reportKitMember","kit","patternKey","reportKitDestructure","declarator","reportResourceDestructure","contribution","condition","importMove","specifier","importName","starMove","reexportMove","dynamicMove","namespaceMemberMove","staticMemberName","typeImportMove","namespaceTypeMove","RETIRED_MESSAGES"],"mappings":"y7BAyDA,MAAMA,EAAgB,IAAI,IAAwB,CAChD,CAAC,OAAQ,aAAa,EACtB,CAAC,OAAQ,aAAa,EACtB,CAAC,SAAU,eAAe,EAC1B,CAAC,UAAW,gBAAgB,CAC7B,CAAA,EAEKC,EAAiB,IAAI,IAA6C,CACtE,CAAC,cAAe,IAAI,IAAwB,CAAC,CAAC,SAAU,eAAe,CAAC,CAAC,CAAC,CAC3E,CAAA,EAEKC,GAAe,IAAI,IAAwB,CAC/C,CAAC,YAAa,iBAAiB,EAC/B,CAAC,cAAe,mBAAmB,EACnC,CAAC,OAAQ,YAAY,CACtB,CAAA,EACKC,GAAc,IAAI,IAAwB,CAAC,CAAC,OAAQ,gBAAgB,CAAC,CAAC,EACtEC,GAAc,IAAI,IAAwB,CAAC,CAAC,eAAgB,mBAAmB,CAAC,CAAC,EAEjFC,GAAiB,IAAI,IAAwB,CACjD,CAAC,MAAO,aAAa,EACrB,CAAC,OAAQ,cAAc,CACxB,CAAA,EAEKC,EAAoB,IAAI,IAAwB,CAAC,CAAC,aAAc,oBAAoB,CAAC,CAAC,EAEtFC,GAAiB,IAAI,IAAwB,CAAC,CAAC,aAAc,oBAAoB,CAAC,CAAC,EACnFC,EAAW,CAAC,eAAgB,UAAU,EAEtCC,GAAuB,IAAI,IAA6C,CAC5E,CAAC,WAAY,IAAI,IAAwB,CAAC,CAAC,SAAU,gBAAgB,CAAC,CAAC,CAAC,CACzE,CAAA,EAEKC,EAAqB,IAAI,IAAwB,CAAC,CAAC,OAAQ,kBAAkB,CAAC,CAAC,EAC/EC,GAAuB,IAAI,IAAuB,CACtD,CAAC,OAAQ,CAAE,GAAI,CAAC,CAAC,EAAG,QAAS,CAAA,EAAI,MAAOD,EAAoB,EAC5D,CAAC,WAAY,CAAE,GAAI,CAAC,CAAC,EAAG,QAAS,CAAA,E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OAAO,KAAK,EAEjDX,IAAY,QACdO,EAAQ,OAAO,CACb,KAAM,CAAE,YAAaP,EAAQ,YAAa,KAAAF,CAAI,EAC9C,UAAWE,EAAQ,UACnB,KAAMqF,EAAU,QACjB,CAAA,CAEL,EACF,EACA,qBAAqB1E,EAAI,CACvBgD,EAAW4B,GAAS5E,CAAI,CAAC,CAC3B,EACA,uBAAuBA,EAAI,CACzBgD,EAAW6B,GAAahF,EAAQG,CAAI,CAAC,CACvC,EACA,iBAAiBA,EAAI,CACnBgD,EAAW8B,GAAYjF,EAAQG,CAAI,CAAC,CACtC,EACA,iBAAiBA,EAAI,CACnBgD,EAAW+B,EAAoBlF,EAAQG,CAAI,CAAC,EAC5C,MAAMf,EAAO+F,EAAiBhF,CAAI,EAClC,GAAIf,IAAS,QAAagF,EAAgBjE,EAAMf,CAAI,EAAG,OACvD,MAAMgB,EAAY4C,EAAc7C,EAAMf,CAAI,EAE1C,GAAIgB,IAAc,OAAW,CAC3B,MAAMC,EAAM4C,EAAiB9C,EAAMC,CAAS,EAC5CL,EAAQ,OAAO,CACb,GAAIM,IAAQ,OAAY,GAAK,CAAE,IAAAA,CAAG,EAClC,UAAAD,EACA,KAAMD,EAAK,QACZ,CAAA,CACH,CACF,EACA,SAASA,EAAI,CACXoE,EAAqBpE,CAAI,EACzBsE,EAA0BtE,CAAI,CAChC,EACA,aAAaA,EAAI,CACfgD,EAAWiC,EAAejF,CAAI,CAAC,CACjC,EACA,gBAAgBA,EAAI,CAClBgD,EAAWkC,EAAkBrF,EAAQG,CAAI,CAAC,CAC5C,EACA,gBAAgBA,EAAI,CAClBF,EAAmB,UAAUE,CAAI,CACnC,EAEJ,EACA,KAAM,CACJ,KAAM,CACJ,YACE,gHACH,EACD,QAAS,OACT,SAAUmF,GACV,OAAQ,CAAA,EACR,KAAM,SACP,EACD,KAAM,uBACP,CAAA"}
1
+ {"version":3,"file":"no-retired-vocabulary.js","sources":["../../src/rules/no-retired-vocabulary.ts"],"sourcesContent":["import { DefinitionType } from '@typescript-eslint/scope-manager';\nimport { AST_NODE_TYPES } from '@typescript-eslint/types';\nimport type { TSESTree } from '@typescript-eslint/types';\n\nimport { findProperty, propertyName } from '../ast';\nimport { isContextFunction, methodPath } from '../declaration-ingress';\nimport type { EntryMove } from '../entry-moves';\nimport {\n dynamicMove,\n importMove,\n namespaceMemberMove,\n namespaceTypeMove,\n reexportMove,\n starMove,\n staticMemberName,\n typeImportMove,\n} from '../entry-moves';\nimport { hasWritesBeyondDefinition, importName, isApi, isFeatureSection, localValue } from '../model-bindings';\nimport {\n isCommandOutcome,\n isLinkSourceValue,\n isResourceHook,\n isResourceValue,\n isStateActivity,\n isSurfaceValue,\n} from '../retired-vocabulary';\nimport { RETIRED_MESSAGES } from '../retired-vocabulary-messages';\nimport type { MessageIds } from '../retired-vocabulary-messages';\nimport { createResourceVocabulary } from '../resource-vocabulary';\nimport { createRule, findVariable } from '../rule';\nimport type { ReportFixFunction } from '../rule';\n\n/**\n * One name a package no longer exports, and the word that carries its meaning now. D411: `module` is written where\n * the name is retired at one entry and live at another — `ApplicationConditionBinding` is still the name, on the\n * entry an author is meant to take it from. D462 took the scope off `ResourceActivity`: the name is now retired at\n * both entries it was ever written from, so asking the module would only let one of them through.\n */\ntype Retired = { readonly messageId: MessageIds; readonly module?: Modules; readonly replacement: string };\ntype Modules = string | readonly string[];\n/**\n * Where one node keeps its modifiers, and which retired words live there. `at` holds every position the record is\n * written in across the two surfaces — `ctx.command(run, options)` and `own.command(within, run, options)` — and\n * nothing else at those positions is an object literal, so one list answers both. `carries` names the members whose\n * own record is read in turn: a delivery policy is a record inside a record.\n */\ntype Modifiers = {\n readonly at: readonly number[];\n readonly carries: readonly string[];\n /** D411: a word of a carried record whose **value** was retired, not its key: `overflow: 'reject'` is one. */\n readonly carriedValues?: ReadonlyMap<string, ReadonlyMap<string, MessageIds>>;\n /** D459: the same fact one record higher — a word retired as the **value** of a field of this record itself. */\n readonly values?: ReadonlyMap<string, ReadonlyMap<string, MessageIds>>;\n readonly words: ReadonlyMap<string, MessageIds>;\n};\n\n/** D387, D389: the four words the options record of a command declaration and of a selection retired. */\nconst COMMAND_WORDS = new Map<string, MessageIds>([\n ['lane', 'commandLane'],\n ['once', 'commandOnce'],\n ['policy', 'commandPolicy'],\n ['queueBy', 'commandQueueBy'],\n]);\n/** D459: the one value of that record that moved — the waiting place is written as the record that names it. */\nconst COMMAND_VALUES = new Map<string, ReadonlyMap<string, MessageIds>>([\n ['concurrency', new Map<string, MessageIds>([['latest', 'commandLatest']])],\n]);\n/** D379: the three modifiers of an effect run. */\nconst EFFECT_WORDS = new Map<string, MessageIds>([\n ['onDispose', 'effectOnDispose'],\n ['skipInitial', 'effectSkipInitial'],\n ['when', 'effectWhen'],\n]);\nconst WHILE_WORDS = new Map<string, MessageIds>([['when', 'scopeWhileWhen']]);\nconst EVENT_WORDS = new Map<string, MessageIds>([['backpressure', 'eventBackpressure']]);\n/** D374: the two fields inside the record, whichever of the two words the record itself is still written under. */\nconst DELIVERY_WORDS = new Map<string, MessageIds>([\n ['key', 'deliveryKey'],\n ['kind', 'deliveryKind'],\n]);\n/** D486: pagination left the declaration record; it is `resource.paginate(resource, { cursor, load, merge })`. */\nconst DECLARATION_WORDS = new Map<string, MessageIds>([['pagination', 'resourcePagination']]);\n/** D486: the selector of the next cursor is `cursor`, so alphabetical order is the order TypeScript infers in. */\nconst PAGINATE_WORDS = new Map<string, MessageIds>([['nextCursor', 'paginateNextCursor']]);\nconst DELIVERY = ['backpressure', 'delivery'];\n/** D411: the one field of a delivery whose value moved: a full keyed capacity answers `drop`, not `reject`. */\nconst LIVE_DELIVERY_VALUES = new Map<string, ReadonlyMap<string, MessageIds>>([\n ['overflow', new Map<string, MessageIds>([['reject', 'deliveryReject']])],\n]);\n/** D411: the words a contribution writes beside its value, on the `provides` section that declares it. */\nconst CONTRIBUTION_WORDS = new Map<string, MessageIds>([['when', 'contributionWhen']]);\nconst CONTRIBUTION_RECORDS = new Map<string, Modifiers>([\n ['pipe', { at: [2], carries: [], words: CONTRIBUTION_WORDS }],\n ['register', { at: [2], carries: [], words: CONTRIBUTION_WORDS }],\n ['slot', { at: [2], carries: [], words: CONTRIBUTION_WORDS }],\n]);\n/** D411: the record `defineCondition` takes second; the word it named its source by is the one that moved. */\nconst CONDITION_WORDS = new Map<string, MessageIds>([['from', 'conditionFrom']]);\n\nconst OPTION_RECORDS = new Map<string, Modifiers>([\n ['call', { at: [1, 2], carries: [], values: COMMAND_VALUES, words: COMMAND_WORDS }],\n ['calls', { at: [2], carries: [], values: COMMAND_VALUES, words: COMMAND_WORDS }],\n ['command', { at: [1, 2], carries: [], values: COMMAND_VALUES, words: COMMAND_WORDS }],\n ['effect', { at: [2], carries: [], words: EFFECT_WORDS }],\n ['event', { at: [3], carries: DELIVERY, words: EVENT_WORDS }],\n ['resource.live', { at: [0], carriedValues: LIVE_DELIVERY_VALUES, carries: DELIVERY, words: DECLARATION_WORDS }],\n ['resource.load', { at: [0], carries: [], words: DECLARATION_WORDS }],\n ['resource.paginate', { at: [1], carries: [], words: PAGINATE_WORDS }],\n ['select', { at: [2], carries: [], values: COMMAND_VALUES, words: COMMAND_WORDS }],\n ['scope.while', { at: [2], carries: [], words: WHILE_WORDS }],\n]);\n\n/** D411, D415, D462: the members whose name is retired, each with the object it has to have been read on. */\nconst RETIRED_MEMBERS = new Map<string, MessageIds>([\n ['activity', 'stateActivity'],\n ['invalidate', 'resourceInvalidate'],\n ['pending', 'linkSourcePending'],\n ['policy', 'navigatorPolicy'],\n ['status', 'commandOutcomeStatus'],\n ['view', 'surfaceView'],\n]);\n\n/** D378, D385, D388: the methods themselves, named on a declaring context of this library. */\nconst RETIRED_METHODS = new Map<string, MessageIds>([\n ['call', 'contextCall'],\n ['calls', 'contextCalls'],\n ['scope.keyed', 'scopeKeyed'],\n]);\n\n/** D380, D385, D388: the names an `@opetope/*` entry no longer exports. The module itself is the proof. */\nconst FEATURE_OWN_REMOVED = new Map<string, string>([\n ['effect', 'write `ctx.effect(...)`'],\n ['event', 'write `ctx.event(...)`'],\n ['resource', 'write `ctx.resource.load(...)` or `ctx.resource.live(...)`'],\n ['scope', 'write `ctx.scope.switch(...)`, `ctx.scope.while(...)` or `ctx.scope.each(...)`'],\n ['lane', 'declare a lane and use `ctx.command(…, { concurrency: lane })`'],\n]);\n\n/** D517: the entries `CommandInputArgs` left; `@opetope/core/internal` still names it for the library itself. */\nconst TESTING_ENTRIES = ['@opetope/core/testing', '@opetope/react/testing', '@opetope/runtime/testing'];\nconst RETIRED_IMPORTS = new Map<string, Retired>([\n ['useSelector', { messageId: 'reactUseSelector', module: '@opetope/react', replacement: 'useReadable' }],\n /** D542: a body written through `defineFeature.body` is typed from its header and needs no annotation. */\n ['FeatureBodyOf', { messageId: 'featureBodyOf', module: '@opetope/runtime', replacement: 'defineFeature.body' }],\n ...[\n 'FeatureBoundary',\n 'FeatureBoundaryError',\n 'useFeature',\n 'useFeatureRetry',\n 'FeatureBoundaryProps',\n 'FeatureDemandLease',\n 'FeatureDemandResult',\n 'FeatureDemandSource',\n 'FeatureDemandState',\n ].map(\n name =>\n [\n name,\n {\n messageId: 'reactFeatureDemand' as const,\n module: '@opetope/react/integration',\n replacement: 'ContributionBoundary',\n },\n ] as const,\n ),\n [\n 'ApplicationConditionBinding',\n { messageId: 'runtimeInternalEntry', module: '@opetope/runtime/internal', replacement: '@opetope/runtime' },\n ],\n /** D411, D415: the entry retired three copies, and a table that held one left two migrations unnamed. */\n [\n 'ApplicationExecution',\n { messageId: 'runtimeInternalEntry', module: '@opetope/runtime/internal', replacement: '@opetope/runtime' },\n ],\n [\n 'ApplicationImportBinding',\n { messageId: 'runtimeInternalEntry', module: '@opetope/runtime/internal', replacement: '@opetope/runtime' },\n ],\n ['Call', { messageId: 'commandName', replacement: 'Command' }],\n ['CallError', { messageId: 'commandName', replacement: 'CommandError' }],\n /** D517: the input tuple of a command execution left the testing entries; the wrappers it served name others. */\n ['CallInputArgs', { messageId: 'commandInputArgs', replacement: 'RunCommandArgs' }],\n ['CommandInputArgs', { messageId: 'commandInputArgs', module: TESTING_ENTRIES, replacement: 'RunCommandArgs' }],\n ['CallTimeoutError', { messageId: 'commandName', replacement: 'CommandTimeoutError' }],\n ['NavigatorPolicy', { messageId: 'navigatorPolicy', replacement: 'NavigatorCatalogue' }],\n ['ResourceActivity', { messageId: 'resourceActivity', replacement: 'ResourceNodeActivity' }],\n ['ResourceDisposer', { messageId: 'resourceDisposer', replacement: 'Disposer' }],\n ['RunCallOptions', { messageId: 'commandName', replacement: 'RunCommandOptions' }],\n ['externalReadable', { messageId: 'fromExternal', replacement: 'fromExternal' }],\n ['runCall', { messageId: 'commandName', replacement: 'runCommand' }],\n ['useCommands', { messageId: 'useCommands', replacement: 'useModel' }],\n]);\n\n/** The retired entry of a name imported from `from`, when the name is retired at that entry. */\nfunction retiredImport(word: string, from: string): Retired | undefined {\n const retired = RETIRED_IMPORTS.get(word);\n const module = retired?.module;\n\n return module === undefined || module === from || (typeof module !== 'string' && module.includes(from))\n ? retired\n : undefined;\n}\n\n/** What one call of a declaring context is, as far as this rule reads it: a retired word, retired modifiers, both. */\ntype Declared = { readonly modifiers: Modifiers | undefined; readonly word: MessageIds | undefined };\n\n/** The word a callee ends in: `keyed` of `own.scope.keyed`, or the plain name a destructured member is called by. */\nfunction calleeWord(callee: TSESTree.Node): TSESTree.Node {\n return callee.type === AST_NODE_TYPES.MemberExpression ? callee.property : callee;\n}\n\nconst noRetiredVocabulary = createRule<[], MessageIds>({\n create(context) {\n const source = context.sourceCode;\n const resourceVocabulary = createResourceVocabulary(source, (node, messageId, fix) => {\n context.report({ ...(fix === undefined ? {} : { fix }), messageId, node });\n });\n\n /**\n * The shape decides first and the context second: a call whose method this rule has nothing to say about never\n * pays for resolving the parameter it was written on (D309, D323).\n */\n const declaredCall = (node: TSESTree.CallExpression): Declared | undefined => {\n const named = methodPath(source, node.callee);\n\n if (named === undefined) return undefined;\n\n const declared: Declared = {\n modifiers: OPTION_RECORDS.get(named.method),\n word: RETIRED_METHODS.get(named.method),\n };\n\n if (declared.modifiers === undefined && declared.word === undefined) return undefined;\n\n return isContextFunction(source, named.fn) ? declared : undefined;\n };\n /** The record written at one of the positions this node takes its modifiers in, past the name it was given. */\n const recordAt = (node: TSESTree.CallExpression, position: number): TSESTree.ObjectExpression | undefined => {\n const argument = node.arguments[position];\n\n if (argument === undefined || argument.type === AST_NODE_TYPES.SpreadElement) return undefined;\n\n const value = localValue(source, argument);\n\n return value.type === AST_NODE_TYPES.ObjectExpression ? value : undefined;\n };\n /**\n * D411: a contribution is declared on `provides`, not on `own`, so the section that proves it is its own. The\n * shape decides first here too: nothing resolves a section for a method this rule has nothing to say about.\n */\n const contributionCall = (node: TSESTree.CallExpression): Modifiers | undefined => {\n const named = methodPath(source, node.callee);\n const modifiers = named === undefined ? undefined : CONTRIBUTION_RECORDS.get(named.method);\n\n if (named === undefined || modifiers === undefined) return undefined;\n\n return isFeatureSection(source, named.fn, 'provides', true) ? modifiers : undefined;\n };\n /** D411: `defineCondition(id, options)` is a name this package exports, so the import is what proves it. */\n const conditionRecord = (node: TSESTree.CallExpression): TSESTree.ObjectExpression | undefined => {\n if (!isApi(source, node.callee, '@opetope/runtime', 'defineCondition', true)) return undefined;\n\n return recordAt(node, 1);\n };\n const whileFix = (property: TSESTree.Property, direct: boolean): ReportFixFunction | undefined => {\n if (!direct || property.computed) return undefined;\n if (property.shorthand) {\n if (source.getCommentsInside(property).length > 0) return undefined;\n return fixer => fixer.replaceText(property, `filter: ${source.getText(property.value)}`);\n }\n const written = source.getText(property.key);\n const next =\n property.key.type === AST_NODE_TYPES.Literal ? `${written.charAt(0)}filter${written.charAt(0)}` : 'filter';\n return fixer => fixer.replaceText(property.key, next);\n };\n const reportProperty = (\n property: TSESTree.Property,\n words: ReadonlyMap<string, MessageIds>,\n direct: boolean,\n ): void => {\n const name = propertyName(property);\n if (name === undefined) return;\n const messageId = words.get(name);\n if (messageId === undefined) return;\n const fix = messageId === 'scopeWhileWhen' ? whileFix(property, direct) : undefined;\n if (fix === undefined) context.report({ messageId, node: property.key });\n else context.report({ fix, messageId, node: property.key });\n };\n const reportRecord = (\n record: TSESTree.ObjectExpression,\n words: ReadonlyMap<string, MessageIds>,\n direct = false,\n ): void => {\n for (const property of record.properties)\n if (property.type === AST_NODE_TYPES.Property) reportProperty(property, words, direct);\n };\n /** D411: the word this property was written with, where that word is a retired value of a known field. */\n const retiredValue = (\n property: TSESTree.Property,\n values: ReadonlyMap<string, ReadonlyMap<string, MessageIds>>,\n ): MessageIds | undefined => {\n const name = propertyName(property);\n const written = name === undefined ? undefined : values.get(name);\n\n if (written === undefined) return undefined;\n\n const value = localValue(source, property.value);\n\n return value.type === AST_NODE_TYPES.Literal && typeof value.value === 'string'\n ? written.get(value.value)\n : undefined;\n };\n /** D411: the value a field of a carried record was written with, where that value is the retired word. */\n const reportValues = (\n record: TSESTree.ObjectExpression,\n values: ReadonlyMap<string, ReadonlyMap<string, MessageIds>>,\n ): void => {\n for (const property of record.properties) {\n if (property.type !== AST_NODE_TYPES.Property) continue;\n\n const messageId = retiredValue(property, values);\n\n if (messageId !== undefined) context.report({ messageId, node: property.value });\n }\n };\n const reportCarried = (record: TSESTree.ObjectExpression, carrier: string, modifiers: Modifiers): void => {\n const property = findProperty(record, carrier);\n const carried = property === undefined ? undefined : localValue(source, property.value);\n\n if (carried?.type !== AST_NODE_TYPES.ObjectExpression) return;\n\n reportRecord(carried, DELIVERY_WORDS);\n\n if (modifiers.carriedValues !== undefined) reportValues(carried, modifiers.carriedValues);\n };\n const reportModifiers = (node: TSESTree.CallExpression, modifiers: Modifiers): void => {\n for (const position of modifiers.at) {\n const record = recordAt(node, position);\n\n if (record === undefined) continue;\n\n reportRecord(record, modifiers.words, node.arguments[position] === record);\n\n if (modifiers.values !== undefined) reportValues(record, modifiers.values);\n\n for (const carrier of modifiers.carries) reportCarried(record, carrier, modifiers);\n }\n };\n /** Both objects that used to answer `invalidate`: the Resource itself, and the record `useResource` builds. */\n const holdsVerbs = (node: TSESTree.Node): boolean => isResourceValue(source, node) || isResourceHook(source, node);\n /** The object each retired member has to be read on, asked only once the name has already matched. */\n const memberOwner = (node: TSESTree.MemberExpression, messageId: MessageIds): boolean => {\n if (messageId === 'resourceInvalidate') return holdsVerbs(node.object);\n\n if (messageId === 'stateActivity') return isStateActivity(source, node);\n\n if (messageId === 'navigatorPolicy') return isSurfaceValue(source, node.object);\n\n if (messageId === 'surfaceView') return isSurfaceValue(source, node.object);\n\n if (messageId === 'linkSourcePending') return isLinkSourceValue(source, node.object);\n\n return isCommandOutcome(source, node.object);\n };\n /**\n * The four members this rule reads off a value it can resolve (D415 added `surface.policy`, which the message\n * of `NavigatorPolicy` already named and the rule did not report). The name decides first and the resolution\n * second, so a member this rule has nothing to say about never pays for the object it was read on (D309, D323).\n */\n const retiredMember = (node: TSESTree.MemberExpression, name: string): MessageIds | undefined => {\n const messageId = RETIRED_MEMBERS.get(name);\n\n return messageId !== undefined && memberOwner(node, messageId) ? messageId : undefined;\n };\n const retiredMemberFix = (\n node: TSESTree.MemberExpression,\n messageId: MessageIds,\n ): ReportFixFunction | undefined => {\n if (node.computed) return undefined;\n\n const replacement =\n messageId === 'surfaceView' ? 'regions' : messageId === 'linkSourcePending' ? 'intent' : undefined;\n\n return replacement === undefined ? undefined : fixer => fixer.replaceText(node.property, replacement);\n };\n\n /** Each migration report has a local edit; no fix reaches into later references or across another rule's span. */\n const reportMove = (move: EntryMove | undefined): void => {\n if (move === undefined) return;\n const sameEntry = move.data['to'] === `\\`${move.data['from']}\\``;\n context.report({\n data: move.data,\n fix: move.fix,\n messageId: sameEntry ? 'entryRenamed' : 'entryMoved',\n node: move.node,\n });\n };\n\n const featureWord = (callee: TSESTree.Node, root: string): TSESTree.Node => {\n let word = callee;\n while (\n word.type === AST_NODE_TYPES.MemberExpression &&\n word.property.type === AST_NODE_TYPES.Identifier &&\n word.property.name !== root\n )\n word = word.object;\n return word.type === AST_NODE_TYPES.MemberExpression ? word.property : word;\n };\n /** D501: report only a removed method of Opetope Feature own, including destructured aliases. */\n const reportRemovedFeatureOwn = (node: TSESTree.CallExpression): boolean => {\n const named = methodPath(source, node.callee);\n if (named === undefined) return false;\n const root = named.method.split('.')[0];\n if (root === undefined) return false;\n const replacement = FEATURE_OWN_REMOVED.get(root);\n if (replacement === undefined || !isFeatureSection(source, named.fn, 'own', true)) return false;\n context.report({\n data: { replacement, word: `own.${root}` },\n messageId: 'featureOwnMember',\n node: featureWord(node.callee, root),\n });\n return true;\n };\n\n /** Resolve one lexical variable definition before considering its creator. */\n const kitVariable = (node: TSESTree.Identifier) => {\n const variable = findVariable(source.getScope(node), node);\n if (variable === null) return undefined;\n const [definition] = variable.defs;\n if (variable.defs.length !== 1 || definition?.type !== DefinitionType.Variable) return undefined;\n if (definition.node.id.type !== AST_NODE_TYPES.Identifier) return undefined;\n return { definition, variable };\n };\n\n /** A later write makes even a diagnostic speculative: the receiver may no longer be a Kit source. */\n const kitBinding = (node: TSESTree.Identifier) => {\n const resolved = kitVariable(node);\n if (resolved === undefined) return undefined;\n const { definition, variable } = resolved;\n if (hasWritesBeyondDefinition(variable, definition)) return undefined;\n return {\n binding: definition.parent.kind === 'const' ? 'fix' : 'report',\n candidate: definition.node.init ?? node,\n } as const;\n };\n\n /** Same-file creator provenance determines whether `publish` is safe to rewrite or only worth reporting. */\n const kitSource = (node: TSESTree.Node): 'fix' | 'report' | undefined => {\n const resolved =\n node.type === AST_NODE_TYPES.Identifier ? kitBinding(node) : { binding: 'report', candidate: node };\n if (resolved === undefined) return undefined;\n const creator = localValue(source, resolved.candidate);\n return creator.type === AST_NODE_TYPES.CallExpression &&\n isApi(source, creator.callee, '@opetope/kit', 'createExternalSource', true)\n ? resolved.binding === 'fix' && creator === resolved.candidate\n ? 'fix'\n : 'report'\n : undefined;\n };\n\n const isKitWrite = (node: TSESTree.MemberExpression): boolean =>\n (node.parent.type === AST_NODE_TYPES.AssignmentExpression && node.parent.left === node) ||\n (node.parent.type === AST_NODE_TYPES.UpdateExpression && node.parent.argument === node) ||\n (node.parent.type === AST_NODE_TYPES.UnaryExpression && node.parent.operator === 'delete');\n\n const reportKitMember = (node: TSESTree.MemberExpression, name: string): boolean => {\n if (name !== 'publish') return false;\n const kit = kitSource(node.object);\n if (kit === undefined) return false;\n context.report({\n ...(kit === 'fix' && !node.computed && !isKitWrite(node)\n ? { fix: (fixer: Parameters<ReportFixFunction>[0]) => fixer.replaceText(node.property, 'set') }\n : {}),\n messageId: 'externalPublish',\n node: node.property,\n });\n return true;\n };\n\n const patternKey = (node: TSESTree.Property): string | undefined =>\n node.computed && node.key.type === AST_NODE_TYPES.Literal && typeof node.key.value === 'string'\n ? node.key.value\n : propertyName(node);\n\n const reportKitDestructure = (node: TSESTree.Property): void => {\n if (patternKey(node) !== 'publish' || node.parent.type !== AST_NODE_TYPES.ObjectPattern) return;\n const declarator = node.parent.parent;\n if (declarator.type !== AST_NODE_TYPES.VariableDeclarator || declarator.init === null) return;\n if (kitSource(declarator.init) !== undefined) context.report({ messageId: 'externalPublish', node: node.key });\n };\n\n const reportResourceDestructure = (node: TSESTree.Property): void => {\n if (propertyName(node) !== 'invalidate' || node.parent.type !== AST_NODE_TYPES.ObjectPattern) return;\n const declarator = node.parent.parent;\n if (declarator.type !== AST_NODE_TYPES.VariableDeclarator || declarator.init === null) return;\n if (holdsVerbs(declarator.init)) context.report({ messageId: 'resourceInvalidate', node: node.key });\n };\n\n return {\n CallExpression(node): void {\n resourceVocabulary.visitCall(node);\n if (reportRemovedFeatureOwn(node)) return;\n const contribution = contributionCall(node);\n\n if (contribution !== undefined) reportModifiers(node, contribution);\n\n const condition = conditionRecord(node);\n\n if (condition !== undefined) reportRecord(condition, CONDITION_WORDS);\n\n const declared = declaredCall(node);\n\n if (declared === undefined) return;\n\n if (declared.word !== undefined) context.report({ messageId: declared.word, node: calleeWord(node.callee) });\n\n if (declared.modifiers !== undefined) reportModifiers(node, declared.modifiers);\n },\n ImportDeclaration(node): void {\n if (!node.source.value.startsWith('@opetope/')) return;\n\n reportMove(importMove(source, node));\n\n for (const specifier of node.specifiers) {\n if (specifier.type !== AST_NODE_TYPES.ImportSpecifier) continue;\n\n const word = importName(specifier);\n const retired = retiredImport(word, node.source.value);\n\n if (retired !== undefined) {\n context.report({\n data: { replacement: retired.replacement, word },\n messageId: retired.messageId,\n node: specifier.imported,\n });\n }\n }\n },\n ExportAllDeclaration(node): void {\n reportMove(starMove(node));\n },\n ExportNamedDeclaration(node): void {\n reportMove(reexportMove(source, node));\n },\n ImportExpression(node): void {\n reportMove(dynamicMove(source, node));\n },\n MemberExpression(node): void {\n reportMove(namespaceMemberMove(source, node));\n const name = staticMemberName(node);\n if (name === undefined || reportKitMember(node, name)) return;\n const messageId = retiredMember(node, name);\n\n if (messageId !== undefined) {\n const fix = retiredMemberFix(node, messageId);\n context.report({\n ...(fix === undefined ? {} : { fix }),\n messageId,\n node: node.property,\n });\n }\n },\n Property(node): void {\n reportKitDestructure(node);\n reportResourceDestructure(node);\n },\n TSImportType(node): void {\n reportMove(typeImportMove(node));\n },\n TSQualifiedName(node): void {\n reportMove(namespaceTypeMove(source, node));\n },\n TSTypeReference(node): void {\n resourceVocabulary.visitType(node);\n },\n };\n },\n meta: {\n docs: {\n description:\n 'A retired word is named with its replacement; entry moves and locally proven Resource spellings are rewritten.',\n },\n fixable: 'code',\n messages: RETIRED_MESSAGES,\n schema: [],\n type: 'problem',\n },\n name: 'no-retired-vocabulary',\n});\n\nexport { noRetiredVocabulary };\n"],"names":["COMMAND_WORDS","COMMAND_VALUES","EFFECT_WORDS","WHILE_WORDS","EVENT_WORDS","DELIVERY_WORDS","DECLARATION_WORDS","PAGINATE_WORDS","DELIVERY","LIVE_DELIVERY_VALUES","CONTRIBUTION_WORDS","CONTRIBUTION_RECORDS","CONDITION_WORDS","OPTION_RECORDS","RETIRED_MEMBERS","RETIRED_METHODS","FEATURE_OWN_REMOVED","TESTING_ENTRIES","RETIRED_IMPORTS","name","retiredImport","word","from","retired","module","calleeWord","callee","AST_NODE_TYPES","noRetiredVocabulary","createRule","context","source","resourceVocabulary","createResourceVocabulary","node","messageId","fix","declaredCall","named","methodPath","declared","isContextFunction","recordAt","position","argument","value","localValue","contributionCall","modifiers","isFeatureSection","conditionRecord","isApi","whileFix","property","direct","fixer","written","next","reportProperty","words","propertyName","reportRecord","record","retiredValue","values","reportValues","reportCarried","carrier","findProperty","carried","reportModifiers","holdsVerbs","isResourceValue","isResourceHook","memberOwner","isStateActivity","isSurfaceValue","isLinkSourceValue","isCommandOutcome","retiredMember","retiredMemberFix","replacement","reportMove","move","sameEntry","featureWord","root","reportRemovedFeatureOwn","kitVariable","variable","findVariable","definition","DefinitionType","kitBinding","resolved","hasWritesBeyondDefinition","kitSource","creator","isKitWrite","reportKitMember","kit","patternKey","reportKitDestructure","declarator","reportResourceDestructure","contribution","condition","importMove","specifier","importName","starMove","reexportMove","dynamicMove","namespaceMemberMove","staticMemberName","typeImportMove","namespaceTypeMove","RETIRED_MESSAGES"],"mappings":"y7BAyDA,MAAMA,EAAgB,IAAI,IAAwB,CAChD,CAAC,OAAQ,aAAa,EACtB,CAAC,OAAQ,aAAa,EACtB,CAAC,SAAU,eAAe,EAC1B,CAAC,UAAW,gBAAgB,CAC7B,CAAA,EAEKC,EAAiB,IAAI,IAA6C,CACtE,CAAC,cAAe,IAAI,IAAwB,CAAC,CAAC,SAAU,eAAe,CAAC,CAAC,CAAC,CAC3E,CAAA,EAEKC,GAAe,IAAI,IAAwB,CAC/C,CAAC,YAAa,iBAAiB,EAC/B,CAAC,cAAe,mBAAmB,EACnC,CAAC,OAAQ,YAAY,CACtB,CAAA,EACKC,GAAc,IAAI,IAAwB,CAAC,CAAC,OAAQ,gBAAgB,CAAC,CAAC,EACtEC,GAAc,IAAI,IAAwB,CAAC,CAAC,eAAgB,mBAAmB,CAAC,CAAC,EAEjFC,GAAiB,IAAI,IAAwB,CACjD,CAAC,MAAO,aAAa,EACrB,CAAC,OAAQ,cAAc,CACxB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