linkedin / linkedin/eyeglass

[bug report] Not all legal package names are legal eyeglass names

Open
#161 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

package:eyeglass
Dominant language
TypeScript
Stars
738
Forks
48
PR merge metrics
No merged PRs in 30d

Description

If I name an eyeglass module `prefix.tool-name` or `prefix_tool-name` both of which are [legal package names](https://docs.npmjs.com/files/package.json) according to the NPM docs, eyeglass can't find my module.

e.g. this breaks
```
{
"name": "prefix.tool-name",
"version": "1.0.0",
"main": "stylesheets/_prefix.tool-name.scss",
"eyeglass": {
"needs": "^1.0.0",
"name": "prefix.tool-name",
"exports": "eyeglass-exports.js"
},
"keywords": [
"eyeglass-module",
"sass"
]
}
```

Changing the module name to `prefix-tool-name` causes the import to work fine.

i.e. this works:

```
{
"name": "prefix.tool-name",
"version": "1.0.0",
"main": "stylesheets/_prefix.tool-name.scss",
"eyeglass": {
"needs": "^1.0.0",
"name": "prefix-tool-name",
"exports": "eyeglass-exports.js"
},
"keywords": [
"eyeglass-module",
"sass"
]
}
```

There doesn't seem to be anything I can see in the docs about requirements for module names

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the package.json examples and reproduce the failing imports for prefix.tool-name and prefix_tool-name, comparing them with the working prefix-tool-name case. Trace eyeglass's module lookup using stylesheets/_prefix.tool-name.scss and eyeglass-exports.js; done means legal package names resolve consistently without requiring a renamed eyeglass name.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sass
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.