Skip to content

Commit 427405c

Browse files
committed
Removed .npmignore from template'
1 parent 49b7bcb commit 427405c

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.changeset/gold-stingrays-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codeshift/initializer': patch
3+
---
4+
5+
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

packages/initializer/src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ export function getPackageJson(packageName: string, version: string = '0.0.0') {
3434
);
3535
}
3636

37+
function getNpmIgnore() {
38+
return `src/
39+
**/__test__
40+
**/*.spec.(ts|js)
41+
.vscode
42+
jest.config.js
43+
`;
44+
}
45+
3746
function getConfig(packageName: string, transform?: string, preset?: string) {
3847
return `module.exports = {
3948
maintainers: [],
@@ -123,6 +132,8 @@ export function initDirectory(
123132
path.join(basePath, 'package.json'),
124133
getPackageJson(packageName),
125134
);
135+
136+
fs.writeFileSync(path.join(basePath, '.npmignore'), getNpmIgnore());
126137
}
127138

128139
if (!fs.existsSync(configPath)) {

packages/initializer/template/.npmignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)