Skip to content

Commit

Permalink
Removed .npmignore from template'
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldelcore committed Jan 28, 2022
1 parent 49b7bcb commit 427405c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-stingrays-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@codeshift/initializer': patch
---

Fixed a bug where npmignore in the template directory was being ignored my npm (hehe). This has now been moved into a static string as part of the main pacakge
11 changes: 11 additions & 0 deletions packages/initializer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ export function getPackageJson(packageName: string, version: string = '0.0.0') {
);
}

function getNpmIgnore() {
return `src/
**/__test__
**/*.spec.(ts|js)
.vscode
jest.config.js
`;
}

function getConfig(packageName: string, transform?: string, preset?: string) {
return `module.exports = {
maintainers: [],
Expand Down Expand Up @@ -123,6 +132,8 @@ export function initDirectory(
path.join(basePath, 'package.json'),
getPackageJson(packageName),
);

fs.writeFileSync(path.join(basePath, '.npmignore'), getNpmIgnore());
}

if (!fs.existsSync(configPath)) {
Expand Down
5 changes: 0 additions & 5 deletions packages/initializer/template/.npmignore

This file was deleted.

0 comments on commit 427405c

Please sign in to comment.