[mirror] Fix @fedify/nuxt runtime packaging and fedify init scaffolding edge cases#5
Open
yashwant86 wants to merge 14 commits intomm-base-717from
Open
[mirror] Fix @fedify/nuxt runtime packaging and fedify init scaffolding edge cases#5yashwant86 wants to merge 14 commits intomm-base-717from
@fedify/nuxt runtime packaging and fedify init scaffolding edge cases#5yashwant86 wants to merge 14 commits intomm-base-717from
Conversation
Build the Nuxt server runtime files as tsdown entry points and point the Nuxt module at the generated JavaScript under dist. This keeps installed consumers from feeding TypeScript runtime sources into Nitro's Rollup pipeline. Add a package-level self-import test so the Node test path exercises @fedify/nuxt through the package exports and catches missing built runtime files before publishing. Fixes fedify-dev#716 Assisted-by: Codex:gpt-5.4
Generated projects now use the Biome 2 configuration shape for import organization, matching the @biomejs/biome version installed by fedify init. Add a scaffold-level regression test that creates an npm project and checks the generated Biome schema version against the exact installed Biome package version. fedify-dev#716 Assisted-by: Codex:gpt-5.4
Treat a target directory that only contains a freshly initialized Git repository as empty, while still rejecting repositories whose HEAD resolves to a commit or whose .git metadata shows existing refs. Add regression coverage for unborn repositories, committed repositories, packed refs, detached HEADs, .git files, and additional project files. fedify-dev#716 Assisted-by: Codex:gpt-5.4
Allow fedify init to run in non-empty directories when explicitly requested, but check the files Fedify would generate before running any framework scaffolding command. The command now fails before making changes if a generated file already exists, so unrelated files can coexist without accidental merges or appends. Document the option and add regression coverage for the conflict checks. fedify-dev#716 Assisted-by: Codex:gpt-5.4
Parallelize generated-file conflict checks while preserving path splitting for Windows-compatible path joins. Treat any existing Git ref as evidence that a .git-only directory is not fresh, including refs outside the current HEAD branch and any packed ref. References fedify-dev#717 (comment) References fedify-dev#717 (comment) Assisted-by: Codex:gpt-5.4
Clarify the changelog wording for Git refs in freshly initialized repositories, simplify HEAD ref validation to a boolean predicate, and use path.join() directly when checking generated-file conflicts. References fedify-dev#717 (comment) References fedify-dev#717 (comment) References fedify-dev#717 (comment) Assisted-by: Codex:gpt-5.4
Treat an unborn Git repository as empty only when it has no refs, stored objects, index, reflogs, or other common state paths. This keeps fedify init from skipping the non-empty-directory safeguard for repositories with deleted refs but remaining Git state. References fedify-dev#717 (comment) Assisted-by: Codex:gpt-5.4
Move `@nuxt/schema` to peerDependencies in `@fedify/nuxt` and align the lockfiles so tsdown no longer inlines the full Nuxt schema types into `mod.d.(c)ts`. References fedify-dev#717 (comment) Assisted-by: Codex:gpt-5.4
Explain that `--allow-non-empty` only bypasses Fedify's own directory check, that some framework scaffolders still reject unrelated files, and that the generated-file conflict preflight only covers files written by Fedify itself. References fedify-dev#717 (comment) References fedify-dev#717 (comment) Assisted-by: Codex:gpt-5.4
Move Nuxt peers onto the pnpm catalog and keep `pretest` scoped to `build:self` so package-local tests only rebuild `@fedify/nuxt` itself. References fedify-dev#717 (comment) References fedify-dev#717 (comment) Assisted-by: Codex:gpt-5.4
Cache the generated JSON config payloads per init run so the conflict preflight and patching steps reuse the same loaded data instead of re-reading configuration files. References fedify-dev#717 (comment) Assisted-by: Codex:gpt-5.4
Wait for PostgreSQL LISTEN cleanup before returning from queue shutdown, and add an async Redis disposal path so Deno leak checks do not trip over I/O timers left behind by ioredis disconnect. Assisted-by: Codex:gpt-5.4
Use a stable cache key for generated JSON configs so the cache survives `set()`-created data clones between the non-empty preflight and the patch pipeline. Add a regression test that verifies the cache key stays unchanged across those pipeline clones. fedify-dev#717 (comment) Assisted-by: Codex:gpt-5.4
⚡ Risk Assessment —
|
| Files | Summary |
|---|---|
Redis Message Queue Graceful Shutdownpackages/redis/src/mq.ts, mq.test.ts, mq.race.test.ts |
Implements graceful Redis connection shutdown with asyncDispose support. Adds error handling for already-closed connections and unified test cleanup helper to properly await async disposal. |
PostgreSQL Message Queue Listen Cleanuppackages/postgres/src/mq.ts |
Fixes listen cleanup logic to properly unlisten and clear timeouts on abort signal. Adds connection destroyed error detection and ensures cleanup runs in finally block. |
Fedify Init Allow Non-Empty Directorypackages/init/src/action/mod.tspackages/init/src/action/patch.tspackages/init/src/action/patch.test.tspackages/init/src/ask/dir.tspackages/init/src/command.tspackages/init/src/lib.tspackages/init/src/lib.test.ts |
Adds `--allow-non-empty` flag to allow initialization in non-empty directories. Implements conflict detection for generated files and enhanced directory emptiness check that recognizes unborn Git repositories as safe targets. |
Init Config and Package Testspackages/init/src/action/configs.test.tspackages/init/src/package.test.ts |
Adds comprehensive tests for Biome config schema matching and npm initialization flow. Updates test data to include allowNonEmpty field. |
Nuxt Runtime File Resolutionpackages/nuxt/src/module.tspackages/nuxt/src/module.test.tspackages/nuxt/src/package.test.tspackages/nuxt/package.jsonpackages/nuxt/tsdown.config.ts |
Fixes Nuxt module to resolve runtime server files to compiled dist output instead of source TypeScript. Adds resolveRuntimeServerPath function and updates build config to compile runtime files. Removes src/runtime from package files list. |
Fedify Test Message Queue Disposalpackages/fedify/src/federation/mq.test.ts |
Adds unified disposeMessageQueue helper function to properly handle both sync and async disposal in tests, replacing inline disposal logic. |
Documentation and ConfigurationCHANGES.mddocs/cli.mddeno.lock |
Documents new `--allow-non-empty` option and updates lock file dependencies. |
Sequence Diagram
sequenceDiagram
participant User
participant CLI as fedify init
participant DirCheck as isDirectoryEmpty
participant GitCheck as isUnbornGitRepository
participant ConflictCheck as assertNoGeneratedFileConflicts
participant Scaffold as patchFiles
User->>CLI: run with --allow-non-empty
CLI->>DirCheck: check if dir is safe
DirCheck->>GitCheck: verify .git is unborn
GitCheck-->>DirCheck: true/false
DirCheck-->>CLI: safe to proceed
CLI->>ConflictCheck: verify no conflicts
ConflictCheck-->>CLI: conflicts found or clear
alt conflicts exist
CLI-->>User: error: remove files or choose directory
else no conflicts
CLI->>Scaffold: create project files
Scaffold-->>CLI: done
CLI-->>User: success
end
Dig Deeper With Commands
/review <file-path> <function-optional>/chat <file-path> "<question>"/roast <file-path>
Runs only when explicitly triggered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirror of upstream fedify-dev#717 for benchmark. Do not merge.
Summary by MergeMonkey