Skip to content

fix: move paraglide:compile to prepare hook to resolve generated imports#68

Draft
Copilot wants to merge 3 commits intofeat/i18nfrom
copilot/sub-pr-64
Draft

fix: move paraglide:compile to prepare hook to resolve generated imports#68
Copilot wants to merge 3 commits intofeat/i18nfrom
copilot/sub-pr-64

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 15, 2026

What

  • Added pnpm paraglide:compile to the prepare lifecycle hook so generated/paraglide/ is created once after pnpm install
  • Reverted knip script back to just knip (no per-script pre-compile prefix needed)
  • Removed the redundant pnpm paraglide:compile && prefix from check and fix scripts (linting does not require freshly generated output)
  • build and typecheck retain their explicit pnpm paraglide:compile && prefix since they need up-to-date generated code when message files change

Why

generated/paraglide/ is git-ignored and only exists after compilation. Knip was reporting unresolved imports for #paraglide/runtime.js and #paraglide/messages.js because the generated files didn't exist when it ran.

paraglide-js compile has no input-level caching in one-shot mode — each invocation re-reads the project and regenerates all output. Running it as a prefix on every individual script adds unnecessary overhead on each call. Moving it to prepare means the cost is paid once per pnpm install, after which all scripts (knip, check, fix, etc.) can rely on the already-present generated files without redundant recompilation.

Ref


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 15, 2026

⚠️ No Changeset found

Latest commit: d523897

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Co-authored-by: nyatinte <104000239+nyatinte@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 15, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.jsdelivr.net
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/prw/prw/node_modules/.bin/../@inlang/paraglide-js/bin/run.js compile --project ./project.inlang --outdir ./generated/paraglide --silent (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/prw/prw/node_modules/.bin/../@inlang/paraglide-js/bin/run.js compile --project ./project.inlang --outdir ./generated/paraglide --silent ame (dns block)
  • eu.posthog.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/prw/prw/node_modules/.bin/../@inlang/paraglide-js/bin/run.js compile --project ./project.inlang --outdir ./generated/paraglide --silent (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/prw/prw/node_modules/.bin/../@inlang/paraglide-js/bin/run.js compile --project ./project.inlang --outdir ./generated/paraglide --silent ame (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add Paraglide.js i18n with English and Japanese support fix: run paraglide:compile before knip to resolve generated imports Mar 15, 2026
Copilot AI requested a review from nyatinte March 15, 2026 16:39
@nyatinte
Copy link
Copy Markdown
Owner

@copilot このままだとほとんどのscriptでparaglideが行われますが、キャッシュや増分検知などの機構はparaglideに含まれますか?

Co-authored-by: nyatinte <104000239+nyatinte@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 15, 2026

@copilot このままだとほとんどのscriptでparaglideが行われますが、キャッシュや増分検知などの機構はparaglideに含まれますか?

paraglide-js の one-shot compile(--watch なし)にはキャッシュ機能がありません。呼び出すたびにプロジェクトを再読み込みして全ファイルを再生成します(previousOutputHashes は watch モード専用です)。

そのため、pnpm paraglide:compile && を各スクリプトのプレフィックスとして置くのではなく、prepare フックで一度だけ実行するよう変更しました(d523897)。

  • prepare: lefthook install && pnpm paraglide:compilepnpm install のたびに一度だけ生成
  • knip, check, fix: プレフィックス不要(prepare で生成済みのファイルを使用)
  • build, typecheck: メッセージファイル変更時に最新の生成コードが必要なため、引き続き明示的に pnpm paraglide:compile && を維持

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.jsdelivr.net
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/prw/prw/node_modules/.bin/../@inlang/paraglide-js/bin/run.js compile --project ./project.inlang --outdir ./generated/paraglide --silent ../../../../nan@2.25.0/node_modules/nan --64 -o Release/obj.target/pty/src/unix/pty.o (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/prw/prw/node_modules/.bin/../@inlang/paraglide-js/bin/run.js compile --project ./project.inlang --outdir ./generated/paraglide --silent (dns block)
  • eu.posthog.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/prw/prw/node_modules/.bin/../@inlang/paraglide-js/bin/run.js compile --project ./project.inlang --outdir ./generated/paraglide --silent ../../../../nan@2.25.0/node_modules/nan --64 -o Release/obj.target/pty/src/unix/pty.o (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/prw/prw/node_modules/.bin/../@inlang/paraglide-js/bin/run.js compile --project ./project.inlang --outdir ./generated/paraglide --silent (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title fix: run paraglide:compile before knip to resolve generated imports fix: move paraglide:compile to prepare hook to resolve generated imports Mar 15, 2026
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.

2 participants