-
Notifications
You must be signed in to change notification settings - Fork 7
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
specify ignore file #4
Comments
Any idea? |
hm, it will use the same rules used to build the package. You can ignore things via .npmignore. Does that help? |
I know that, I use another package manager named spm, and the ignore file is I just want to use .spmignore as ignore file
|
Ok, I see. This isn't quite as simple as it might seem. So // https://github.com/timoxley/pkgfiles/blob/91ffeb90f5653f3b6dca7e5b1035b0464479b642/index.js#L12
resolve('fstream-npm').fromGlobal('npm', … it then uses this version of
The tricky part is that the // package.json files can never be ignored.
if (entry === "package.json") return true
// readme files should never be ignored.
if (entry.match(/^readme(\.[^\.]*)$/i)) return true
// license files should never be ignored.
if (entry.match(/^(license|licence)(\.[^\.]*)?$/i)) return true
// changelogs should never be ignored.
if (entry.match(/^(changes|changelog|history)(\.[^\.]*)?$/i)) return true
// special rules. see below.
if (entry === "node_modules" && this.packageRoot) return true
// some files are *never* allowed under any circumstances
if (entry === ".git" ||
entry === ".lock-wscript" ||
entry.match(/^\.wafpickle-[0-9]+$/) ||
entry === "CVS" ||
entry === ".svn" ||
entry === ".hg" ||
entry.match(/^\..*\.swp$/) ||
entry === ".DS_Store" ||
entry.match(/^\._/) ||
entry === "npm-debug.log"
) {
return false
} This is mirrored in // some files are *never* allowed under any circumstances
if (entry === '.git' ||
entry === '.lock-wscript' ||
entry.match(/^\.wafpickle-[0-9]+$/) ||
entry === 'CVS' ||
entry === '.svn' ||
entry === '.hg' ||
entry.match(/^\..*\.swp$/) ||
entry === '.DS_Store' ||
entry.match(/^\._/)
) {
return false;
}
// package.json should be **allways** included
if (entry === 'package.json') {
return true;
} |
In summary, I could pretty easily allow the ignore file to be configured but pkgfiles is not guaranteed to produce the same set of files which would be included in an spm bundle. |
OK, it doesn't matter. Giving the option is enough. |
If |
i.e. seems like it could be a good idea to use fstream-npm anyway… or if there was an fstream-spm that fulfilled the same role. |
That's a good idea. I will review this old code, it should use |
Can you support this?
The text was updated successfully, but these errors were encountered: