Skip to content

Codebook export secondary entry points#177

Open
jurei733 wants to merge 8 commits into
masterfrom
codebook-secondary-entry-points
Open

Codebook export secondary entry points#177
jurei733 wants to merge 8 commits into
masterfrom
codebook-secondary-entry-points

Conversation

@jurei733

Copy link
Copy Markdown
Collaborator

Replaces #129.\n\n## Summary\n- move the codebook UI, generator, and shared models into dedicated secondary entry points\n- keep docx/cheerio/buffer out of the top-level package entry point\n- add provider-based export handling, generator tests, and shared model exports\n\n## Validation\n- npm run build_cc\n- npm run lint\n- CI=true npm run test:coverage\n- GitHub CI: https://github.com/iqb-berlin/coding-components/actions/runs/27618697101

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38e31242d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Missing,
UnitPropertiesForCodebook
} from '@iqb/ngx-coding-components/codebook-models';
import { CodebookDocxGenerator } from './codebook-docx-generator.class';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep JSON exports from requiring DOCX dependencies

Because docx, cheerio, and buffer are declared optional peers, a consumer can install this package for JSON-only generation without them. This top-level import evaluates the DOCX generator, which imports docx/cheerio, as soon as @iqb/ngx-coding-components/codebook-generator is imported, so even generateCodebook(..., { exportFormat: 'json' }) fails module resolution before the exportFormat branch runs. Lazy-load the DOCX generator only in the DOCX path or make those peers required.

Useful? React with 👍 / 👎.

Comment on lines +469 to +472
this.codebookPollingSubscription = interval(1500)
.pipe(
takeUntil(this.destroy$),
switchMap(() => provider.getJobStatus!(jobId))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid cancelling slow status polls

With HTTP-backed providers whose getJobStatus call takes longer than the 1.5s interval, switchMap unsubscribes from the in-flight request on every tick before it can emit. In that environment the UI can remain pending forever and never reach the completed/failed handlers even after the job finishes; use exhaustMap, concatMap, or otherwise wait for each poll to complete before starting the next one.

Useful? React with 👍 / 👎.

@jurei733 jurei733 force-pushed the codebook-secondary-entry-points branch from a534ef6 to 2ee07c1 Compare June 16, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant