Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing bower.json main as entry-point files, not distribution files #180

Open
desandro opened this issue Apr 13, 2015 · 7 comments
Open

Comments

@desandro
Copy link

Hi there!

Head's up: over in bower/spec#43 we're looking to settle the specification for bower.json main:

The primary acting files necessary to use your package. While Bower does not directly use these files, they are listed with the commands bower list --json and bower list --paths, so they can be used by build tools.

The entry-point files necessary to use your package. Only one file per filetype.

Use source files with module exports and imports over pre-built distribution files.
Do not include minified files.

From my understanding, Wiredep works well when main points to distribution files, not source files. So I wanted to alert you of the issue. And also start a discussion of a proper solution once main specification has changed. Perhaps a files datapoint, that lists all files that get used, in dependency order, or a dist data point that lists distribution files?

@stephenplusplus
Copy link
Member

Thanks for the heads up! If I'm understanding right, is this the general idea for a package:

// bower.json
{
  "name": "my-package",
  "main": "index.js",
  "files": [
    "index.js",
    "css/styles.css",
    "fonts/font.ttf"
  ],
  "dependencies": {
    "jquery": "*"
  }
}
$ bower list --files
{
  js: [
    "jquery/jquery.js",
    "my-package/index.js"
  ],
  css: [
    "my-package/css/styles.css"
  ],
  ttf: [
    "my-package/fonts/font.ttf"
  ]
}

Bower would need the user to define files, otherwise the output from bower list --files would just include the main file? And if the new standard wasn't adopted by a package author (say, main is still an array), would the output include all of those paths?

I know I made some assumptions here, I'm just trying to figure out how the tooling ecosystem could continue to have all of the information needed in relation to ordering/reference injection. Please correct me if I'm going too far off track :)

@desandro
Copy link
Author

You have the basic idea. The Bower team still needs to settle on the files specification. But the idea is that it would contain all the files build tools like Wiredep puts together. I'll reach out again once we're ready.

@stephenplusplus
Copy link
Member

No problem, thanks for keeping us in the loop.

@stephenplusplus
Copy link
Member

@desandro is there any movement on the files spec? The issues linked above show some of the problems users are having now that some larger packages are following the new main spec.

@desandro
Copy link
Author

I'll look to make some moves next week

@desandro
Copy link
Author

@stephenplusplus Opened bower/spec#47 to resolve this issue. Would love to get input on what would work best for Wiredep.

@eddiemonge
Copy link
Contributor

...should probably have decided on/accepted the files issue before finishing main...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants