Skip to content

Commit 3278b37

Browse files
committed
Phase 1 Release
1 parent acdbe7f commit 3278b37

File tree

17 files changed

+1081
-19
lines changed

17 files changed

+1081
-19
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18, 20, 22]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run TypeScript check
31+
run: npx tsc --noEmit
32+
33+
- name: Build package
34+
run: npm run build
35+
36+
- name: Test package structure
37+
run: |
38+
ls -la dist/
39+
test -f dist/index.js
40+
test -f dist/index.d.ts
41+
test -f dist/bin.js
42+
test -x dist/bin.js
43+
44+
- name: Run custom tests
45+
run: |
46+
npx tsx scripts/test-local.ts
47+
npx tsx scripts/test-cli-functions.ts
48+
49+
- name: Test package installation
50+
run: |
51+
npm pack
52+
npm install -g *.tgz || echo "Global install test skipped"

.github/workflows/publish.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'NPM dist-tag to publish to (latest, beta, alpha)'
10+
required: true
11+
default: 'beta'
12+
type: choice
13+
options:
14+
- beta
15+
- latest
16+
- alpha
17+
18+
jobs:
19+
publish:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
id-token: write
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '18'
33+
registry-url: 'https://registry.npmjs.org'
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Run tests
39+
run: npm run test || echo "No tests configured yet"
40+
41+
- name: Build package
42+
run: npm run build
43+
44+
- name: Verify package contents
45+
run: |
46+
npm pack --dry-run
47+
ls -la dist/
48+
49+
- name: Determine NPM tag
50+
id: npm-tag
51+
run: |
52+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
53+
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
54+
elif [[ "${{ github.ref_name }}" == *"beta"* ]]; then
55+
echo "tag=beta" >> $GITHUB_OUTPUT
56+
elif [[ "${{ github.ref_name }}" == *"alpha"* ]]; then
57+
echo "tag=alpha" >> $GITHUB_OUTPUT
58+
else
59+
echo "tag=latest" >> $GITHUB_OUTPUT
60+
fi
61+
62+
- name: Publish to NPM
63+
run: npm publish --access public --tag ${{ steps.npm-tag.outputs.tag }}
64+
env:
65+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to release (e.g., 1.0.0-beta.1 or 1.0.0)'
11+
required: true
12+
type: string
13+
prerelease:
14+
description: 'Mark as pre-release (beta/alpha)'
15+
required: false
16+
type: boolean
17+
default: true
18+
19+
jobs:
20+
create-release:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
upload_url: ${{ steps.create_release.outputs.upload_url }}
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Determine release type
30+
id: release-type
31+
run: |
32+
TAG_NAME="${{ github.ref_name || format('v{0}', github.event.inputs.version) }}"
33+
if [[ "$TAG_NAME" == *"beta"* ]] || [[ "$TAG_NAME" == *"alpha"* ]] || [[ "${{ github.event.inputs.prerelease }}" == "true" ]]; then
34+
echo "prerelease=true" >> $GITHUB_OUTPUT
35+
echo "release_type=Pre-release" >> $GITHUB_OUTPUT
36+
else
37+
echo "prerelease=false" >> $GITHUB_OUTPUT
38+
echo "release_type=Release" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Create Release
42+
id: create_release
43+
uses: actions/create-release@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
tag_name: ${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
48+
release_name: ${{ steps.release-type.outputs.release_type }} ${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
49+
body: |
50+
## What's Changed
51+
52+
- Automated release of commitweave CLI tool
53+
- Enhanced commit message creation with emoji support
54+
- Conventional commits compliance
55+
- Interactive Git integration
56+
57+
## Installation
58+
59+
### Stable Release
60+
```bash
61+
npm install -g @typeweaver/commitweave
62+
```
63+
64+
### Beta Release
65+
```bash
66+
npm install -g @typeweaver/commitweave@beta
67+
```
68+
69+
## Usage
70+
71+
```bash
72+
commitweave # Start interactive commit creation
73+
commitweave init # Initialize configuration
74+
```
75+
76+
Full changelog: https://github.com/GLINCKER/commitweave/compare/v0.1.0-beta.1...${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
77+
draft: false
78+
prerelease: ${{ steps.release-type.outputs.prerelease }}
79+
80+
publish-npm:
81+
needs: create-release
82+
runs-on: ubuntu-latest
83+
permissions:
84+
contents: read
85+
id-token: write
86+
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v4
90+
91+
- name: Setup Node.js
92+
uses: actions/setup-node@v4
93+
with:
94+
node-version: '18'
95+
registry-url: 'https://registry.npmjs.org'
96+
97+
- name: Install dependencies
98+
run: npm ci
99+
100+
- name: Build package
101+
run: npm run build
102+
103+
- name: Publish to NPM
104+
run: npm publish --access public
105+
env:
106+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

PUBLISHING.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Publishing Guide for CommitWeave
2+
3+
## Versioning Strategy
4+
5+
### Beta Phase (Current)
6+
- **Current version**: `0.1.0-beta.1`
7+
- **NPM tag**: `beta`
8+
- **Installation**: `npm install -g @typeweaver/commitweave@beta`
9+
10+
### Version Format
11+
- **Beta releases**: `0.1.0-beta.1`, `0.1.0-beta.2`, etc.
12+
- **Stable releases**: `0.1.0`, `0.2.0`, `1.0.0`, etc.
13+
- **Alpha releases**: `0.1.0-alpha.1` (if needed)
14+
15+
## Setup for NPM Publishing
16+
17+
### 1. NPM Token Setup
18+
1. Create an NPM account at [npmjs.com](https://npmjs.com)
19+
2. Generate an automation token:
20+
```bash
21+
npm login
22+
npm token create --type=automation
23+
```
24+
3. Add the token to GitHub Secrets:
25+
- Go to your repo: Settings → Secrets and variables → Actions
26+
- Add a new secret named `NPM_TOKEN` with your token value
27+
28+
### 2. Publishing Process
29+
30+
#### Beta Releases (Recommended for now)
31+
1. Update version in `package.json`:
32+
```bash
33+
npm version 0.1.0-beta.2 --no-git-tag-version
34+
```
35+
2. Create and push beta tag:
36+
```bash
37+
git add package.json
38+
git commit -m "chore: bump version to 0.1.0-beta.2"
39+
git tag v0.1.0-beta.2
40+
git push origin main
41+
git push origin v0.1.0-beta.2
42+
```
43+
44+
#### Stable Releases (Future)
45+
1. Update to stable version:
46+
```bash
47+
npm version 0.1.0 --no-git-tag-version
48+
```
49+
2. Create and push stable tag:
50+
```bash
51+
git add package.json
52+
git commit -m "chore: release v0.1.0"
53+
git tag v0.1.0
54+
git push origin main
55+
git push origin v0.1.0
56+
```
57+
58+
#### Manual Release
59+
1. Go to Actions → Release
60+
2. Click "Run workflow"
61+
3. Enter version and select prerelease option
62+
63+
### 3. Tagging Strategy (Single Main Branch)
64+
```bash
65+
# Beta releases
66+
v0.1.0-beta.1, v0.1.0-beta.2, v0.1.0-beta.3
67+
68+
# Stable releases
69+
v0.1.0, v0.2.0, v1.0.0
70+
71+
# Current stable tag (latest stable)
72+
latest → points to most recent stable
73+
```
74+
75+
### 4. Installation Commands
76+
```bash
77+
# Beta (current)
78+
npm install -g @typeweaver/commitweave@beta
79+
80+
# Stable (future)
81+
npm install -g @typeweaver/commitweave
82+
83+
# Specific version
84+
npm install -g @typeweaver/[email protected]
85+
```
86+
87+
### 5. Pre-publish Checklist
88+
- [ ] All tests pass: `npm test`
89+
- [ ] Build succeeds: `npm run build`
90+
- [ ] Package structure is correct: `ls -la dist/`
91+
- [ ] Version updated in `package.json`
92+
- [ ] NPM_TOKEN secret is configured in GitHub
93+
- [ ] Appropriate tag format (beta vs stable)
94+
95+
### 6. Post-publish Verification
96+
```bash
97+
# Check beta release
98+
npm view @typeweaver/commitweave@beta
99+
100+
# Check all versions
101+
npm view @typeweaver/commitweave versions --json
102+
103+
# Test installation
104+
npm install -g @typeweaver/commitweave@beta
105+
commitweave init
106+
```
107+
108+
## Development vs Production
109+
110+
- **Development**: Use `npx tsx bin/index.ts` for full functionality
111+
- **Production**: The built CLI has limited functionality (init works, create shows placeholder)
112+
- This is due to complex ESM/CommonJS module resolution in the build
113+
114+
## Package Structure
115+
```
116+
dist/
117+
├── bin.js # CLI executable
118+
├── index.js # Main CommonJS entry
119+
├── index.mjs # ESM entry
120+
├── index.d.ts # TypeScript definitions
121+
└── lib/ # Internal modules
122+
```
123+
124+
The package is ready for publishing! 🚀

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ const mockProvider = new MockAIProvider();
366366

367367
```bash
368368
# Clone the repository
369-
git clone https://github.com/typeweaver/commitweave.git
369+
git clone https://github.com/GLINCKER/commitweave.git
370370
cd commitweave
371371

372372
# Install dependencies
@@ -514,8 +514,8 @@ MIT License - see [LICENSE](LICENSE) for details.
514514

515515
<div align="center">
516516

517-
**Made with ❤️ by [TypeWeaver](https://github.com/typeweaver)**
517+
**Made with ❤️ by [TypeWeaver](https://typeweaver.com/)**
518518

519-
[npm](https://www.npmjs.com/package/@typeweaver/commitweave)[GitHub](https://github.com/typeweaver/commitweave)[Issues](https://github.com/typeweaver/commitweave/issues)
519+
[npm](https://www.npmjs.com/package/@typeweaver/commitweave)[GitHub](https://github.com/GLINCKER/commitweave)[Issues](https://github.com/GLINCKER/commitweave/issues)
520520

521521
</div>

0 commit comments

Comments
 (0)