Skip to content

Commit

Permalink
fix: template gitignore (#410)
Browse files Browse the repository at this point in the history
* fix: Gitignore files apparently cannot be published
(npm/npm#7252 (comment))
so the solution was to rename the file after project scaffold

* docs: Adding changeset

* revert: Undoing gitignore renaming, now just dealing with
the .npmignore conversion instead

* fix: PR comments, changing .gitignore name
  • Loading branch information
rschristian authored Mar 9, 2021
1 parent d2681fd commit 621fbd2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shy-ligers-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-wmr': patch
---

Fix for .gitignore in newly scaffolded projects
6 changes: 5 additions & 1 deletion packages/create-wmr/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ sade('create-wmr [dir]', true)
.parse(process.argv);

async function scaffold({ cwd, fields }) {
await templateDir(resolve(__dirname, '../tpl'), resolve(cwd || '.'), fields);
const to = resolve(cwd || '.');
await templateDir(resolve(__dirname, '../tpl'), to, fields);
// Publishing to npm renames the .gitignore to .npmignore
// https://github.com/npm/npm/issues/7252#issuecomment-253339460
await fs.rename(resolve(to, '_gitignore'), resolve(to, '.gitignore'));
}

async function templateDir(from, to, fields) {
Expand Down
File renamed without changes.

0 comments on commit 621fbd2

Please sign in to comment.