From c02b09c4223e2213113920049e79f4e71bb1e8cb Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 30 Mar 2015 18:13:31 -0400 Subject: [PATCH 1/2] Define main as the entry-point files, one-per-filetype --- README.md | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c9d46bd..73cc3b6 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,40 @@ The package's semantic version number. *Recommended* Type: `String` or `Array` of `String` -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. + +Entry-point files have module exports and may use module imports. While Bower does not directly use `main` files, they are listed with the commands `bower list --json` and `bower list --paths`, so they can be used by build tools. + +Let's say your package looks like this: + + package + js/ + motion.js + run.js + walk.js + sass/ + motion.scss + run.scss + walk.scss + img/ + motion.png + walk.png + run.png + +`motion.js` has module imports for `run.js` and `walk.js`. `motion.scss` has module imports for `run.scss` and `walk.scss`. `main` would be + +``` +"main": [ + "js/motion.js", + "sass/motion.scss", +] +``` + +The image files may be used or referenced within the JS or Sass files, but are not `main` files as they are not entry-points. -* Preprocessor files like CoffeeScript should be compiled. * Do not include minified files. -* Filenames should not be versioned (Bad: package.1.1.0.js; Good: package.js). +* Filenames should not be versioned (Bad: `package.1.1.0.js`; Good: `package.js`). +* Use source files with module exports and imports over pre-built distribution files. ### moduleType From da21ba9c64428c471109aa4781b6824f28cfe645 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Fri, 10 Apr 2015 08:26:48 -0400 Subject: [PATCH 2/2] main: add font & dist files, disallow globs; Ref #43 --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 73cc3b6..58f9ec7 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,14 @@ Let's say your package looks like this: motion.png walk.png run.png + fonts/ + icons.woff2 + icons.woff + dist/ + movement.js + movement.min.js + movement.css + movement.min.css `motion.js` has module imports for `run.js` and `walk.js`. `motion.scss` has module imports for `run.scss` and `walk.scss`. `main` would be @@ -76,11 +84,12 @@ Let's say your package looks like this: ] ``` -The image files may be used or referenced within the JS or Sass files, but are not `main` files as they are not entry-points. +Image and font files may be used or referenced within the JS or Sass files, but are not `main` files as they are not entry-points. +* Use source files with module exports and imports over pre-built distribution files. * Do not include minified files. * Filenames should not be versioned (Bad: `package.1.1.0.js`; Good: `package.js`). -* Use source files with module exports and imports over pre-built distribution files. +* Globs like `js/*.js` are not allowed. ### moduleType