`svelte-package` warn about circular dependencies
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
svelte-package has a bunch of very useful built-in health checks like
@sveltejs/package found the following issues while packaging your library:
You have asveltefield in yourpackage.json, but no root export in yourexports. Please align them so that bundlers will resolve consistently to the same file.
Would be great if it could also check for circular dependencies within the /lib folder.
Describe the proposed solution
With this setup, svelte-package should warn about circular dependency between Component and index.
// src/lib/index.ts
export { default as Component, default } from './Component.svelte'
const variable = 42
<script>
// src/lib/Component.svelte
import { variable } from './'
</script>
{variable}
Alternatives considered
No response
Importance
would make my life easier
Additional Information
This would prevent problems like https://github.com/janosh/svelte-multiselect/issues/228 causing packages to break in the REPL and triggering NPM warnings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing health checks used by svelte-package, then review the example files src/lib/index.ts and src/lib/Component.svelte to understand the reported cycle. Done means packaging this setup emits a circular-dependency warning for the /lib folder, with coverage for the example case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100