Xdpm vs .gitignore

xdpm has a problem, using .gitignore blindly as one of its to-ignore files (using the ignore-walk package).

The problem is that you might well have things in .gitignore that you still need packaging in a plugin. In our case, we have a folder of images that we generate from another source, and don’t want them tracked in git.

So there should be an option to not include .gitignore in the

    const files = ignoreWalk
     .sync({
        path: sourcePath,
        ignoreFiles: ['.gitignore', '.xdignore', '.npmignore'],
        includeEmpty: false,
     })
     .filter(filterAlwaysIgnoredFile)

lines in both install.js and package.js.

For now I’ve just commented them out in my local copy.

(BTW, I think there’s a bug in there, in that I see .DS_Store being copied even when it’s supposedly filtered out by the filterAlwaysIgnoredFile.)

While I agree that having this as a configurable parameter would be great, I’d first suggest putting a compiled version in a dist (or whatever one names it) folder. This allows to run xdpm watch dist etc., meaning one has full control over what aspects get used in the plugin. Personally (this, however, is just my opinion), I find it to be bad practice to mix “used” and “unused” contents in the same directory. It also means a lot of maintainance work when something in the structure changes (or a file that shouldn’t get deployed gets added to the project).

Besides that, however, I think that this is better suited as an issue in the xdpm repo, as it is specifically about xdpm, and not about plugin development in general :wink:

Good point re xdpm, will mark as solved.

1 Like

Also note: PRs welcome! :slight_smile:

1 Like