ADORSYS-GIS / ADORSYS-GIS/converse-frontends

[Ticket]: cratestack — --relative-specifier-style emit option

オープン
#296 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
ticket
主要言語
TypeScript
スター
0
フォーク
0
平均マージ
1時間 49分
マージ済み PR(30日)
253

説明

## Type

Technical debt

## Summary

We need the `cratestack` CLI to add a `--relative-specifier-style` emit option because the
generated NodeNext `.js` import specifiers currently block Turbopack, forcing a normalization
workaround script. Expected result: `cratestack generate-typescript` can emit specifiers Turbopack
accepts natively, without a post-generation rewrite step.

**The console cannot resolve this.** The specifier emit format is controlled by the `cratestack`
CLI itself (`@cratestack/cli`), a dependency the console consumes but does not own. This ticket
exists to track the request and its console-side workaround.

## Intent

Give the `cratestack` maintainers a concrete, scoped feature ask, and give the console-side
workaround script a paper trail so it is understood as temporary rather than a permanent part of
the codegen pipeline. Confirmed not yet in the 0.8.13 pin the console is currently on.

## Source of truth (links)

- https://github.com/ADORSYS-GIS/converse-frontends/blob/main/packages/authz-rpc/scripts/normalize-generated-specifiers.mjs
- https://github.com/ADORSYS-GIS/converse-frontends/blob/main/packages/authz-rpc/README.md
- https://github.com/ADORSYS-GIS/converse-frontends/pull/257

## Current Behavior

`cratestack generate-typescript` emits NodeNext-style `.js` import specifiers in the generated
client under `packages/authz-rpc/generated/`. Turbopack (used by the Next.js console's dev/build
pipeline) does not resolve these the way `tsc`/Node does, so
`packages/authz-rpc/scripts/normalize-generated-specifiers.mjs` runs as a post-codegen step to
rewrite them into a form Turbopack accepts. This workaround is not present in cratestack 0.8.13,
the version currently pinned (see Ticket 1 in this epic).

## Expected Behavior

`cratestack generate-typescript` accepts a `--relative-specifier-style` (or equivalently named)
option that emits specifiers Turbopack can resolve directly, making
`normalize-generated-specifiers.mjs` unnecessary.

## Acceptance Criteria

- [ ] Given a future `cratestack` CLI release, when `--relative-specifier-style` (or equivalent) is
passed to `generate-typescript`, then the emitted specifiers resolve correctly under Turbopack
without post-processing.
- [ ] Given this lands and is adopted, when `packages/authz-rpc/scripts/normalize-generated-specifiers.mjs`
is reviewed, then it is deleted and the codegen pipeline (`codegen:all`) no longer invokes it.
- [ ] Error cases are handled safely: N/A — no runtime path depends on this, only the build-time
codegen step.
- [ ] Existing behavior is not broken: the current normalization workaround continues to function
until the new option is adopted.
- [ ] Relevant tests are added or updated: the codegen pipeline's existing build verification
(`pnpm build`) continues to pass once the workaround is removed.
- [ ] Verification evidence is provided (see below).

## Out of Scope

- Implementing the `--relative-specifier-style` option — that is the `cratestack` CLI's own repo.
- Removing `normalize-generated-specifiers.mjs` before the new option is confirmed available and
adopted in the console's cratestack pin.
- Any change to the wire-format/version-pin lockstep contract tracked separately in Ticket 1.

## Technical Context

- `packages/authz-rpc/scripts/normalize-generated-specifiers.mjs` — the existing workaround,
invoked as part of the `codegen:all` chain.
- `packages/authz-rpc/README.md` — documents the codegen pipeline this workaround is part of.
- Confirmed not present in the 0.8.13 pin adopted in #257; this is a forward-looking feature
request, not a regression.

## Risks

| Risk | Mitigation |
| --- | --- |
| `cratestack` team deprioritizes a niche build-tooling request | Low impact — the existing workaround script is stable and low-maintenance; P2 reflects that |
| Someone removes the workaround script prematurely, before the new CLI option is actually adopted | AC explicitly gates deletion on the option being available and adopted, not merely announced |

## Test Plan

Not applicable directly — verification is that `pnpm build` (or the equivalent Turbopack build)
succeeds without `normalize-generated-specifiers.mjs` once the new CLI option is adopted.

## Verification evidence

Pending `cratestack` maintainer response. To close this ticket: link the `cratestack` CLI release
that adds `--relative-specifier-style` (or equivalent), confirm it has been adopted in this repo's
pin, and confirm `normalize-generated-specifiers.mjs` has been deleted with `pnpm build` still
green.

## Human accountable owner

@stephane-segning

## AI Usage Declaration

Ticket decomposition

## Human verification completed

- [ ] I understood the intent
- [ ] I checked the source of truth
- [ ] I reviewed all AI-generated text/code
- [ ] I verified the implementation manually
- [ ] I verified the tests
- [ ] I checked for hallucinated assumptions
- [ ] I documented remaining risks
- [ ] I am the accountable owner and accept responsibility for this ticket.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。