Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: ensure reshake fixtures
  • Loading branch information
2heal1 committed Feb 6, 2026
commit c9df6f34c10ea9109cbcb5d72e6e5f733ad60e93
33 changes: 26 additions & 7 deletions packages/enhanced/test/scripts/ensure-reshake-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@ const ensureFixture = (baseDir, pkgName, entryContents) => {
fs.writeFileSync(path.join(pkgDir, 'index.js'), entryContents);
};

const repoRoot =
process.env.GITHUB_WORKSPACE ||
path.resolve(__dirname, '..', '..', '..', '..');

const fixtureRoots = [
const fixtureRelativeRoots = [
path.join(
repoRoot,
'packages',
'enhanced',
'test',
Expand All @@ -39,7 +34,6 @@ const fixtureRoots = [
'node_modules',
),
path.join(
repoRoot,
'packages',
'enhanced',
'test',
Expand All @@ -50,6 +44,31 @@ const fixtureRoots = [
),
];

const workspaceMarker = path.join(
'packages',
'enhanced',
'test',
'configCases',
'tree-shaking-share',
);

const candidateRoots = [
process.env.GITHUB_WORKSPACE,
process.cwd(),
path.resolve(__dirname, '..', '..', '..', '..'),
path.resolve(__dirname, '..', '..', '..', '..', '..'),
].filter(Boolean);

const resolvedRoots = Array.from(new Set(candidateRoots))
.map((candidate) => path.resolve(candidate))
.filter((candidate) => fs.existsSync(path.join(candidate, workspaceMarker)));

const fixtureRoots = (resolvedRoots.length ? resolvedRoots : [process.cwd()])
.map((root) =>
fixtureRelativeRoots.map((relativeRoot) => path.join(root, relativeRoot)),
)
.flat();

const uiLibDepEntry = [
"export const Message = 'Message';",
"export const Spin = 'Spin';",
Expand Down
Loading