itty-packager 1.6.8 โ†’ 1.6.10

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/README.md CHANGED
@@ -14,15 +14,16 @@
14
14
 
15
15
  ---
16
16
 
17
- # Single dependency build + publish for TypeScript libraries.
17
+ # Single dependency build + release for TypeScript libraries.
18
18
 
19
- Zero-config build, lint, and publish - letting you deliver packages with minimal files and minimal bytes.
19
+ Zero-config build, lint, prepare, and release - letting you deliver packages with minimal files and minimal bytes.
20
20
 
21
21
  ## Features
22
22
 
23
23
  - **๐Ÿ”จ Build** - TypeScript compilation with Rollup, minification, and snippet generation
24
24
  - **๐Ÿ” Lint** - Built-in ESLint configuration with TypeScript support and smart extending
25
- - **๐Ÿ“ฆ Publish** - Automated version bumping, clean package extraction, and npm publishing
25
+ - **๐Ÿš€ Prepare** - Run lint, test, and build in sequence to verify your package
26
+ - **๐Ÿ“ฆ Release** - Automated version bumping, git operations, and npm publishing with interactive commit messages
26
27
  - **โšก Zero Config** - Works out of the box, customize only what you need
27
28
  - **๐ŸŽฏ Consistent** - Unified tooling across all itty projects
28
29
 
@@ -40,8 +41,9 @@ Add to your `package.json` scripts:
40
41
  {
41
42
  "scripts": {
42
43
  "build": "itty build",
43
- "lint": "itty lint",
44
- "publish": "itty publish"
44
+ "lint": "itty lint",
45
+ "prepare": "itty prepare",
46
+ "release": "itty release"
45
47
  }
46
48
  }
47
49
  ```
@@ -119,11 +121,34 @@ itty lint --fix # Lint and auto-fix issues
119
121
  itty lint --format=json # Output results in JSON format
120
122
  ```
121
123
 
122
- ### `itty publish`
124
+ ### `itty prepare`
125
+
126
+ Run lint, test, and build in sequence to prepare your package for release.
127
+
128
+ **Usage:** `itty prepare [options]`
129
+
130
+ **Options:**
131
+ - `-v, --verbose` - Show all output from underlying commands
132
+ - `-h, --help` - Show help
133
+
134
+ **Default Behavior:**
135
+ - Runs `lint` using package.json script or built-in command
136
+ - Runs `test` using package.json script (skips if not found)
137
+ - Runs `build` using package.json script or built-in command (skips if no src/ directory)
138
+ - Shows only progress messages unless `--verbose` is used
139
+ - Stops on first failure and shows error output
140
+
141
+ **Examples:**
142
+ ```bash
143
+ itty prepare # Run lint, test, build silently (show only failures)
144
+ itty prepare --verbose # Run with full output from all commands
145
+ ```
146
+
147
+ ### `itty release`
123
148
 
124
- Version bump and publish your package to npm with clean, flat package structure.
149
+ Version bump and release your package to npm with git operations and clean, flat package structure.
125
150
 
126
- **Usage:** `itty publish [options]`
151
+ **Usage:** `itty release [options]`
127
152
 
128
153
  **Version Options (default: patch):**
129
154
  - `--major` - Major release X.#.# for breaking changes
@@ -131,20 +156,29 @@ Version bump and publish your package to npm with clean, flat package structure.
131
156
  - `--patch` - Patch release #.#.X for bug fixes (default)
132
157
  - `--type <type>` - Custom release type (alpha, beta, rc, etc.)
133
158
 
134
- **Publish Options:**
135
- - `--src <dir>` - Source directory to publish from (default: `dist`)
136
- - `--dest <dir>` - Temporary directory for publishing (default: `.dist`)
159
+ **Release Options:**
160
+ - `--src <dir>` - Source directory to release from (default: `dist`)
161
+ - `--root` - Release from root directory (equivalent to `--src=.`)
162
+ - `--dest <dir>` - Temporary directory for releasing (default: `.dist`)
137
163
  - `--dry-run` - Build and prepare but do not publish
138
- - `--no-cleanup` - Leave temporary directory after publishing
164
+ - `--no-cleanup` - Leave temporary directory after releasing
139
165
  - `--public` - Publish as public package (`--access=public`)
166
+ - `--prepare` - Run prepare (lint, test, build) before releasing
167
+ - `--silent` - Skip interactive prompts (use default commit message)
140
168
  - `--no-license` - Do not copy LICENSE file to published package
141
169
  - `-v, --verbose` - Show detailed output including npm and git command details
142
170
 
143
171
  **Git Options:**
144
172
  - `--tag` - Create git tag for release
145
- - `--push` - Push changes and tags to git remote
173
+ - `--push` - Push changes and tags to git remote (prompts for commit message)
146
174
  - `--no-git` - Skip all git operations
147
175
 
176
+ **Interactive Features:**
177
+ - When using `--push`, you'll be prompted for an optional commit message
178
+ - Press Enter to skip, Escape or Ctrl+C to cancel and revert version
179
+ - Multi-line commit messages supported
180
+ - Git tag uses the same message as the commit
181
+
148
182
  **Default Behavior:**
149
183
  - Defaults to patch version bump if no type specified
150
184
  - Extracts build artifacts to temporary directory
@@ -154,17 +188,19 @@ Version bump and publish your package to npm with clean, flat package structure.
154
188
 
155
189
  **Examples:**
156
190
  ```bash
157
- itty publish # Patch bump and publish from dist/ (default)
158
- itty publish --minor --tag # Minor bump, publish, and create git tag
159
- itty publish --type=alpha # Pre-release alpha version
160
- itty publish --dry-run # Test the publish process
161
- itty publish --verbose # Show detailed output during publish
162
- itty publish --no-license # Publish without copying LICENSE file
191
+ itty release # Patch bump and release from dist/ (default)
192
+ itty release --minor --tag # Minor bump, release, and create git tag
193
+ itty release --type=alpha # Pre-release alpha version
194
+ itty release --root # Release from root directory
195
+ itty release --prepare --push # Run prepare, then release with git operations
196
+ itty release --dry-run # Test the release process
197
+ itty release --verbose # Show detailed output during release
198
+ itty release --silent --push # Release with git operations, no interactive prompts
163
199
  ```
164
200
 
165
201
  ## Package Structure
166
202
 
167
- The publish command creates a clean package structure by:
203
+ The release command creates a clean package structure by:
168
204
 
169
205
  1. **Extracting build artifacts** from your `dist/` directory to package root
170
206
  2. **Copying essential files** like README, LICENSE
@@ -208,7 +244,8 @@ Add itty-packager to your scripts for easy access:
208
244
  "scripts": {
209
245
  "build": "itty build --snippet=mylib --hybrid",
210
246
  "lint": "itty lint",
211
- "publish": "itty publish --tag --push"
247
+ "prepare": "itty prepare",
248
+ "release": "itty release --prepare --tag --push"
212
249
  }
213
250
  }
214
251
  ```
@@ -509,7 +509,7 @@ This creates a clean, flat package structure in node_modules.
509
509
  await runCommand(`git commit -m "${commitMessage}"`, rootPath, verbose)
510
510
  } catch (error) {
511
511
  if (error.message.includes('cancelled')) {
512
- console.log('๐Ÿ“‹ Commit cancelled - reverting version and exiting')
512
+ console.log('โŒ Commit cancelled - reverting version and exiting')
513
513
  // Revert the version we just updated
514
514
  await fs.writeJSON(pkgPath, originalPkg, { spaces: 2 })
515
515
  // Don't rethrow - exit cleanly since this is user-initiated
@@ -537,7 +537,7 @@ This creates a clean, flat package structure in node_modules.
537
537
 
538
538
  // NPM publish as final step
539
539
  if (dryRun) {
540
- console.log('๐Ÿงช Dry run - skipping publish')
540
+ console.log('๐Ÿธ Dry run - skipping publish')
541
541
  } else {
542
542
  // Publish from temp directory
543
543
  console.log(`๐Ÿš€ Publishing to npm...`)
@@ -559,7 +559,7 @@ This creates a clean, flat package structure in node_modules.
559
559
  await fs.remove(tempDir)
560
560
  }
561
561
 
562
- console.log(`โœ… Successfully released ${originalPkg.name}@${newVersion}`)
562
+ console.log(`๐ŸŽ‰ Successfully released ${originalPkg.name}@${newVersion}`)
563
563
 
564
564
  } catch (error) {
565
565
  console.error(`โŒ Release failed: ${error.message}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itty-packager",
3
- "version": "1.6.8",
3
+ "version": "1.6.10",
4
4
  "description": "Universal build tool for itty libraries",
5
5
  "type": "module",
6
6
  "bin": {