itty-packager 1.6.1 ā 1.6.2
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/lib/commands/publish.js +14 -5
- package/package.json +1 -1
package/lib/commands/publish.js
CHANGED
|
@@ -126,7 +126,7 @@ async function getCommitMessage(newVersion, silent = false) {
|
|
|
126
126
|
if (key === '\r' || key === '\n') {
|
|
127
127
|
if (!placeholderCleared && inputBuffer === '') {
|
|
128
128
|
// Empty input, skip
|
|
129
|
-
process.stdout.write('\r\x1b[Kš¬ Commit message: \x1b[?25h\n')
|
|
129
|
+
process.stdout.write('\r\x1b[Kš¬ Commit message: \x1b[90mskipped\x1b[0m\x1b[?25h\n')
|
|
130
130
|
cleanup()
|
|
131
131
|
resolve(`released v${newVersion}`)
|
|
132
132
|
return
|
|
@@ -139,6 +139,7 @@ async function getCommitMessage(newVersion, silent = false) {
|
|
|
139
139
|
cleanup()
|
|
140
140
|
|
|
141
141
|
if (!customMessage) {
|
|
142
|
+
process.stdout.write('\rš¬ Commit message: \x1b[90mskipped\x1b[0m\n')
|
|
142
143
|
resolve(`released v${newVersion}`)
|
|
143
144
|
} else {
|
|
144
145
|
const escapedMessage = customMessage.replace(/"/g, '\\"')
|
|
@@ -428,6 +429,7 @@ This creates a clean, flat package structure in node_modules.
|
|
|
428
429
|
await fs.ensureDir(tempDir)
|
|
429
430
|
|
|
430
431
|
// Copy source files to temp directory
|
|
432
|
+
console.log(`š Copying files...`)
|
|
431
433
|
if (verbose) console.log(`š Copying ${publishArgs.src}/ to ${path.relative(rootPath, tempDir)}/`)
|
|
432
434
|
|
|
433
435
|
const filter = (src) => {
|
|
@@ -447,6 +449,7 @@ This creates a clean, flat package structure in node_modules.
|
|
|
447
449
|
}
|
|
448
450
|
|
|
449
451
|
await fs.copy(srcDir, tempDir, { filter })
|
|
452
|
+
if (!verbose) console.log(`ā
Files copied`)
|
|
450
453
|
|
|
451
454
|
// Copy root files that should be included in the package (only for non-root publishing)
|
|
452
455
|
if (!isRootPublish) {
|
|
@@ -492,9 +495,11 @@ This creates a clean, flat package structure in node_modules.
|
|
|
492
495
|
// Get commit message (interactive or default)
|
|
493
496
|
const commitMessage = await getCommitMessage(newVersion, silent)
|
|
494
497
|
|
|
495
|
-
|
|
498
|
+
console.log(`š Committing changes...`)
|
|
499
|
+
if (verbose) console.log(`Running: git add . && git commit`)
|
|
496
500
|
await runCommand('git add .', rootPath, verbose)
|
|
497
501
|
await runCommand(`git commit -m "${commitMessage}"`, rootPath, verbose)
|
|
502
|
+
if (!verbose) console.log(`ā
Changes committed`)
|
|
498
503
|
} catch (error) {
|
|
499
504
|
if (error.message.includes('cancelled')) {
|
|
500
505
|
console.log('š Commit cancelled - reverting version and exiting')
|
|
@@ -508,17 +513,20 @@ This creates a clean, flat package structure in node_modules.
|
|
|
508
513
|
}
|
|
509
514
|
|
|
510
515
|
if (shouldTag) {
|
|
511
|
-
|
|
516
|
+
console.log(`š·ļø Creating git tag v${newVersion}`)
|
|
512
517
|
await runCommand(`git tag -a v${newVersion} -m "Release v${newVersion}"`, rootPath, verbose)
|
|
518
|
+
if (!verbose) console.log(`ā
Tag created`)
|
|
513
519
|
}
|
|
514
520
|
|
|
515
521
|
if (shouldPush) {
|
|
516
|
-
|
|
522
|
+
console.log(`š¤ Pushing to remote...`)
|
|
517
523
|
await runCommand('git push', rootPath, verbose)
|
|
524
|
+
if (!verbose) console.log(`ā
Pushed to remote`)
|
|
518
525
|
|
|
519
526
|
if (shouldTag) {
|
|
520
|
-
|
|
527
|
+
console.log(`š¤ Pushing tags...`)
|
|
521
528
|
await runCommand('git push --tags', rootPath, verbose)
|
|
529
|
+
if (!verbose) console.log(`ā
Tags pushed`)
|
|
522
530
|
}
|
|
523
531
|
}
|
|
524
532
|
}
|
|
@@ -538,6 +546,7 @@ This creates a clean, flat package structure in node_modules.
|
|
|
538
546
|
|
|
539
547
|
if (verbose) console.log(`Running: ${publishCmd}`)
|
|
540
548
|
await runCommand(publishCmd, tempDir, verbose)
|
|
549
|
+
if (!verbose) console.log(`ā
Published to npm`)
|
|
541
550
|
}
|
|
542
551
|
|
|
543
552
|
// Cleanup
|