-
Notifications
You must be signed in to change notification settings - Fork 133
Fix Settings plugin installs registering unloadable directory paths #1428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4426eb8
Fix Settings plugin installs registering unloadable directory paths
gsxdsm 742989c
Merge remote branch updates (workflow-defined custom columns stream +…
gsxdsm 7dde43a
Address PR review feedback (#1428)
gsxdsm 784021e
Tighten plugin install route tests to full entry-resolution contract …
gsxdsm 3bf803e
Extend plugin registration-drift learning with entry-file contract de…
gsxdsm b1ebb22
Merge current main (fast-tests quality-backfill projects) into plugin…
gsxdsm 66f1db1
Fix quality-backfill suites broken by fast-tests x workflow-columns m…
gsxdsm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
57 changes: 57 additions & 0 deletions
57
packages/cli/src/plugins/__tests__/resolve-plugin-entry-path-sync.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /** | ||
| * Drift guard for the intentionally duplicated resolvePluginEntryPath. | ||
| * | ||
| * The CLI keeps a local copy in bundled-plugin-install.ts (so its fs mocks | ||
| * work in tests) while @fusion/core owns the copy used by the dashboard | ||
| * install/enable routes. This test runs both against real on-disk layouts and | ||
| * asserts identical results, so a candidate-list change applied to one copy | ||
| * but not the other fails CI instead of silently diverging. | ||
| * | ||
| * No fs mocks here on purpose — vitest module mocks don't reach the | ||
| * externalized @fusion/core import, so real temp directories are the only | ||
| * seam that exercises both implementations equally. | ||
| */ | ||
| import { describe, it, expect, beforeEach, afterEach } from "vitest"; | ||
| import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs"; | ||
| import { join } from "node:path"; | ||
| import { tmpdir } from "node:os"; | ||
| import { resolvePluginEntryPath as cliResolve } from "../bundled-plugin-install.js"; | ||
| import { resolvePluginEntryPath as coreResolve } from "@fusion/core"; | ||
|
|
||
| describe("resolvePluginEntryPath: CLI copy stays in sync with @fusion/core", () => { | ||
| let dir: string; | ||
|
|
||
| beforeEach(() => { | ||
| dir = mkdtempSync(join(tmpdir(), "entry-path-sync-")); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| rmSync(dir, { recursive: true, force: true }); | ||
| }); | ||
|
|
||
| function touch(relative: string) { | ||
| const full = join(dir, relative); | ||
| mkdirSync(join(full, ".."), { recursive: true }); | ||
| writeFileSync(full, "// entry\n"); | ||
| } | ||
|
|
||
| const layouts: Array<{ name: string; files: string[]; expected: string | null }> = [ | ||
| { name: "bundled.js only", files: ["bundled.js"], expected: "bundled.js" }, | ||
| { name: "dist/index.js only", files: ["dist/index.js"], expected: "dist/index.js" }, | ||
| { name: "src/index.ts only", files: ["src/index.ts"], expected: "src/index.ts" }, | ||
| { name: "bundled.js preferred over src", files: ["bundled.js", "src/index.ts"], expected: "bundled.js" }, | ||
| { name: "dist preferred over src", files: ["dist/index.js", "src/index.ts"], expected: "dist/index.js" }, | ||
| { name: "all three → bundled.js", files: ["bundled.js", "dist/index.js", "src/index.ts"], expected: "bundled.js" }, | ||
| { name: "no entry files", files: ["README.md"], expected: null }, | ||
| ]; | ||
|
|
||
| for (const layout of layouts) { | ||
| it(`resolves identically for: ${layout.name}`, () => { | ||
| for (const f of layout.files) touch(f); | ||
| const expected = layout.expected === null ? null : join(dir, layout.expected); | ||
|
|
||
| expect(cliResolve(dir)).toBe(expected); | ||
| expect(coreResolve(dir)).toBe(expected); | ||
| }); | ||
| } | ||
| }); |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.