Different expectations for paths provided to `defineComponents` and `setInputPath`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 46
- Avg merge
- 10m
- Merged PRs (30d)
- 2
Description
⚠️Disclaimer: I am a JS Noob
defineComponents passes the glob path directly to fast-glob which expects normalized unixy path
setInputPath accepts windows paths just fine (it normalizes internally)
Both seem to be accepting paths which are relative to the current working directory and not relative to the script file where WebC().functionName() is being invoked. Not sure what the standards are in the JS ecosystem regarding this. I am writing code like the following to get my code to work.
// src/server/page-renderer-webc.js
import * as url from 'url'
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
let pageInputPath = path.resolve(__dirname, 'page.webc') // = "full/path/to/src/server/page.webc"
let webC = new WebC({file: pageInputPath})
Is this normal?
Contributor guide
No contributing guide indexed for this repository
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 reading the defineComponents and setInputPath entry points and comparing how each handles relative and Windows paths before passing paths to fast-glob. Determine the intended path base and normalization behavior, then verify that both APIs handle equivalent inputs consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100