vending-mocha 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +33 -0
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -232,6 +232,39 @@ async function handleNew(projectName, options) {
|
|
|
232
232
|
updatePackageJson(projectDir, config);
|
|
233
233
|
console.log(chalk.green('✔ package.json updated'));
|
|
234
234
|
|
|
235
|
+
// 3. Create .gitignore (since npm pack ignores it)
|
|
236
|
+
const gitignorePath = path.join(projectDir, '.gitignore');
|
|
237
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
238
|
+
const gitignoreContent = `# Logs
|
|
239
|
+
logs
|
|
240
|
+
*.log
|
|
241
|
+
npm-debug.log*
|
|
242
|
+
yarn-debug.log*
|
|
243
|
+
yarn-error.log*
|
|
244
|
+
pnpm-debug.log*
|
|
245
|
+
lerna-debug.log*
|
|
246
|
+
|
|
247
|
+
node_modules
|
|
248
|
+
dist
|
|
249
|
+
dist-ssr
|
|
250
|
+
docs
|
|
251
|
+
*.local
|
|
252
|
+
|
|
253
|
+
# Editor directories and files
|
|
254
|
+
.vscode/*
|
|
255
|
+
!.vscode/extensions.json
|
|
256
|
+
.idea
|
|
257
|
+
.DS_Store
|
|
258
|
+
*.suo
|
|
259
|
+
*.ntvs*
|
|
260
|
+
*.njsproj
|
|
261
|
+
*.sln
|
|
262
|
+
*.sw?
|
|
263
|
+
`;
|
|
264
|
+
fs.writeFileSync(gitignorePath, gitignoreContent);
|
|
265
|
+
console.log(chalk.green('✔ .gitignore created'));
|
|
266
|
+
}
|
|
267
|
+
|
|
235
268
|
console.log(chalk.green(`\nSuccess! Created ${config.projectName} at ${projectDir}`));
|
|
236
269
|
console.log('\nInside that directory, you can run:');
|
|
237
270
|
console.log(chalk.cyan(` cd ${config.projectName}`));
|