Skip to content

Commit f7744e6

Browse files
authored
Merge pull request #60 from mi-examples/develop
🚀 Release v0.12.3: Node.js 22 Compatibility & Infrastructure Improvements
2 parents 0aefb9a + 46439e1 commit f7744e6

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"files": [
2020
"index.js",
2121
"template-*/**",
22-
"mi-custom-rules",
22+
"mi-cursor-rules/**",
2323
"dist",
2424
"CHANGELOG.md"
2525
],

src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url';
55
import spawn from 'cross-spawn';
66
import minimist from 'minimist';
77
import * as p from '@clack/prompts';
8-
import { blue, cyan, magenta, red, reset, yellow } from 'kolorist';
8+
import { blue, cyan, magenta, yellow } from 'kolorist';
99

1010
// Avoids autoconversion to number of the project name by defining that the args
1111
// non associated with an option ( _ ) needs to be parsed as a string. See #4606
@@ -83,9 +83,9 @@ const defaultTargetDir = 'pp-project';
8383

8484
async function init() {
8585
const argTargetDir = formatTargetDir(argv._[0]);
86-
const argTemplate = argv.template || argv.t;
86+
const argTemplate = argv.template ?? argv.t;
8787

88-
let targetDir = argTargetDir || defaultTargetDir;
88+
let targetDir = argTargetDir ?? defaultTargetDir;
8989
const getProjectName = () => (targetDir === '.' ? path.basename(path.resolve()) : targetDir);
9090

9191
p.intro('Create PP Dev Project');
@@ -110,7 +110,7 @@ async function init() {
110110
process.exit(0);
111111
}
112112

113-
targetDir = formatTargetDir(projectName) || defaultTargetDir;
113+
targetDir = formatTargetDir(projectName) ?? defaultTargetDir;
114114
}
115115

116116
if (fs.existsSync(targetDir) && !isEmpty(targetDir)) {
@@ -197,7 +197,7 @@ async function init() {
197197
}
198198

199199
// determine template
200-
const template = selectedVariant || framework.name || argTemplate || 'vanilla';
200+
const template = selectedVariant ?? framework.name ?? argTemplate ?? 'vanilla';
201201

202202
const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
203203
const pkgManager = pkgInfo ? pkgInfo.name : 'npm';
@@ -258,14 +258,14 @@ async function init() {
258258
write(file);
259259
}
260260

261-
const pkg = JSON.parse(fs.readFileSync(path.join(templateDir, `package.json`), 'utf-8'));
261+
const pkg = JSON.parse(fs.readFileSync(path.join(templateDir, 'package.json'), 'utf-8'));
262262

263263
pkg.name = packageName || getProjectName();
264264

265265
write('package.json', JSON.stringify(pkg, null, 2) + '\n');
266266

267267
const addCursorRules = await p.confirm({
268-
message: 'Add cursor rules?',
268+
message: 'Add Cursor rules?',
269269
});
270270

271271
const cdProjectName = path.relative(cwd, root);
@@ -315,7 +315,7 @@ async function init() {
315315

316316
p.outro('Project created successfully! 🎉');
317317

318-
console.log(`\nNext steps:\n`);
318+
console.log('\nNext steps:\n');
319319

320320
if (root !== cwd) {
321321
console.log(` cd ${cdProjectName.includes(' ') ? `"${cdProjectName}"` : cdProjectName}`);

0 commit comments

Comments
 (0)