Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
fix: correctly detect conflicting function names consistently (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Nov 7, 2022
1 parent a7517a7 commit e7e3eb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/runtimes/node/finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const getMainFile = async function (srcPath: string, filename: string, stat: Sta
if (stat.isDirectory()) {
return await locatePath(
[
// The order of these declarations is important, so that we always bundle the same way
// even if multiple files are found
join(srcPath, `${filename}.js`),
join(srcPath, 'index.js'),
join(srcPath, `${filename}.ts`),
Expand All @@ -89,7 +91,7 @@ const getMainFile = async function (srcPath: string, filename: string, stat: Sta
join(srcPath, `${filename}.cts`),
join(srcPath, 'index.cts'),
],
{ type: 'file', preserveOrder: false },
{ type: 'file' },
)
}

Expand Down
2 changes: 2 additions & 0 deletions tests/helpers/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export const zipFixture = async function (
const bundlerString = getBundlerNameFromConfig(config) || 'default'
const { path: tmpDir } = await getTmpDir({
prefix: `zip-it-test-bundler-${bundlerString}`,
// Cleanup the folder on process exit even if there are still files in them
unsafeCleanup: true,
})

if (env.ZISI_KEEP_TEMP_DIRS !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/test_many.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const makeTestMany = <M extends string>(
const testFns = ['fails', 'only', 'concurrent', 'skip', 'todo']

testFns.forEach((fn) => {
testBundlers[fn] = ((...args) => testBundlers(...args, test[fn])) as TestMany<M>
testBundlers[fn] = ((...args) => testBundlers(...args, testAPI[fn])) as TestMany<M>
})

return testBundlers as TestManyAPI<M | `todo:${M}`>
Expand Down

1 comment on commit e7e3eb5

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

⏱ Benchmark results

largeDepsEsbuild: 2.5s

largeDepsNft: 12s

largeDepsZisi: 18.4s

Please sign in to comment.