jell-utils 0.0.17 โ 0.1.0
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/.claude/settings.local.json +16 -0
- package/.releaserc.json +115 -0
- package/CLAUDE.md +139 -0
- package/DEPLOYMENT.md +351 -0
- package/README.md +2 -0
- package/TEST_RESULTS.md +153 -0
- package/TEST_SIMULATION.md +27 -0
- package/coverage/clover.xml +300 -0
- package/coverage/coverage-final.json +2 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +116 -0
- package/coverage/lcov-report/index.js.html +2059 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +689 -0
- package/lib/index.d.ts +142 -38
- package/lib/index.js +497 -116
- package/package.json +45 -16
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(npm run semantic-release:*)",
|
|
5
|
+
"Bash(npm version:*)",
|
|
6
|
+
"Bash(git add:*)",
|
|
7
|
+
"Bash(git checkout:*)",
|
|
8
|
+
"Bash(git merge:*)",
|
|
9
|
+
"Bash(echo:*)",
|
|
10
|
+
"Bash(git push:*)",
|
|
11
|
+
"Bash(npm run build:*)",
|
|
12
|
+
"Bash(npm run lint)"
|
|
13
|
+
],
|
|
14
|
+
"deny": []
|
|
15
|
+
}
|
|
16
|
+
}
|
package/.releaserc.json
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"main",
|
|
4
|
+
"master",
|
|
5
|
+
{
|
|
6
|
+
"name": "beta",
|
|
7
|
+
"prerelease": true
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "alpha",
|
|
11
|
+
"prerelease": true
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"plugins": [
|
|
15
|
+
[
|
|
16
|
+
"@semantic-release/commit-analyzer",
|
|
17
|
+
{
|
|
18
|
+
"preset": "conventionalcommits",
|
|
19
|
+
"releaseRules": [
|
|
20
|
+
{ "type": "feat", "release": "minor" },
|
|
21
|
+
{ "type": "fix", "release": "patch" },
|
|
22
|
+
{ "type": "perf", "release": "patch" },
|
|
23
|
+
{ "type": "revert", "release": "patch" },
|
|
24
|
+
{ "type": "docs", "release": "patch" },
|
|
25
|
+
{ "type": "style", "release": false },
|
|
26
|
+
{ "type": "refactor", "release": "patch" },
|
|
27
|
+
{ "type": "test", "release": false },
|
|
28
|
+
{ "type": "build", "release": false },
|
|
29
|
+
{ "type": "ci", "release": false },
|
|
30
|
+
{ "scope": "no-release", "release": false },
|
|
31
|
+
{ "breaking": true, "release": "major" }
|
|
32
|
+
],
|
|
33
|
+
"parserOpts": {
|
|
34
|
+
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"@semantic-release/release-notes-generator",
|
|
40
|
+
{
|
|
41
|
+
"preset": "conventionalcommits",
|
|
42
|
+
"presetConfig": {
|
|
43
|
+
"types": [
|
|
44
|
+
{ "type": "feat", "section": "โจ Features", "hidden": false },
|
|
45
|
+
{ "type": "fix", "section": "๐ Bug Fixes", "hidden": false },
|
|
46
|
+
{ "type": "perf", "section": "โก Performance", "hidden": false },
|
|
47
|
+
{ "type": "revert", "section": "โช Reverts", "hidden": false },
|
|
48
|
+
{ "type": "docs", "section": "๐ Documentation", "hidden": false },
|
|
49
|
+
{ "type": "style", "section": "๐ Styles", "hidden": false },
|
|
50
|
+
{
|
|
51
|
+
"type": "refactor",
|
|
52
|
+
"section": "โป๏ธ Refactoring",
|
|
53
|
+
"hidden": false
|
|
54
|
+
},
|
|
55
|
+
{ "type": "test", "section": "๐งช Tests", "hidden": false },
|
|
56
|
+
{ "type": "build", "section": "๐ฆ Build", "hidden": false },
|
|
57
|
+
{ "type": "ci", "section": "๐ท CI/CD", "hidden": false }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"writerOpts": {
|
|
61
|
+
"commitsSort": ["subject", "scope"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"@semantic-release/changelog",
|
|
67
|
+
{
|
|
68
|
+
"changelogFile": "CHANGELOG.md",
|
|
69
|
+
"changelogTitle": "# ๐ Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines."
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"@semantic-release/npm",
|
|
74
|
+
{
|
|
75
|
+
"npmPublish": true,
|
|
76
|
+
"tarballDir": "dist"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
"@semantic-release/github",
|
|
81
|
+
{
|
|
82
|
+
"successComment": "๐ This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version [${nextRelease.version}](${releases.filter(release => !!release.name)[0].url}) which has been released! ๐\n\n๐ฆ Install the latest version:\n```bash\nnpm install jell-utils@${nextRelease.version}\n```",
|
|
83
|
+
"failTitle": "โ The automated release is failing ๐จ",
|
|
84
|
+
"failComment": "The automated release from the `${branch.name}` branch failed. ๐\n\n๐ Full changelog: ${nextRelease.notes}\n๐ [Workflow run](${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID})",
|
|
85
|
+
"labels": ["released"],
|
|
86
|
+
"releasedLabels": [
|
|
87
|
+
"released<%= nextRelease.type === 'prerelease' ? `-${nextRelease.prerelease}` : '' %>"
|
|
88
|
+
],
|
|
89
|
+
"addReleases": "bottom",
|
|
90
|
+
"assets": [
|
|
91
|
+
{
|
|
92
|
+
"path": "lib/**/*",
|
|
93
|
+
"label": "Compiled JavaScript (${nextRelease.version})"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"path": "dist/*.tgz",
|
|
97
|
+
"label": "NPM Package (${nextRelease.version})"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
[
|
|
103
|
+
"@semantic-release/git",
|
|
104
|
+
{
|
|
105
|
+
"assets": [
|
|
106
|
+
"package.json",
|
|
107
|
+
"package-lock.json",
|
|
108
|
+
"CHANGELOG.md",
|
|
109
|
+
"lib/**/*"
|
|
110
|
+
],
|
|
111
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
]
|
|
115
|
+
}
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
This is a TypeScript utility library (`jell-utils`) containing utility functions primarily focused on:
|
|
8
|
+
- Korean text processing and detection
|
|
9
|
+
- Date/time manipulation and formatting
|
|
10
|
+
- String transformations (camelCase, snake_case, title case)
|
|
11
|
+
- HTML/text parsing and cleaning
|
|
12
|
+
- Array comparison utilities
|
|
13
|
+
- iOS device detection
|
|
14
|
+
|
|
15
|
+
The library is designed for both browser and Node.js environments, with compiled output in CommonJS format.
|
|
16
|
+
|
|
17
|
+
## Development Commands
|
|
18
|
+
|
|
19
|
+
### Build & Compilation
|
|
20
|
+
```bash
|
|
21
|
+
# Build TypeScript to JavaScript (outputs to lib/ directory)
|
|
22
|
+
yarn build
|
|
23
|
+
# or
|
|
24
|
+
npm run build
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Testing
|
|
28
|
+
```bash
|
|
29
|
+
# Run all tests using Jest
|
|
30
|
+
yarn test
|
|
31
|
+
# or
|
|
32
|
+
npm test
|
|
33
|
+
|
|
34
|
+
# Test files are in __tests__/ directory
|
|
35
|
+
# Tests are written for TypeScript but run against compiled JS in lib/
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Code Quality
|
|
39
|
+
```bash
|
|
40
|
+
# Lint TypeScript files
|
|
41
|
+
yarn lint
|
|
42
|
+
# or
|
|
43
|
+
npm run lint
|
|
44
|
+
|
|
45
|
+
# Auto-fix linting issues
|
|
46
|
+
yarn lint:fix
|
|
47
|
+
# or
|
|
48
|
+
npm run lint:fix
|
|
49
|
+
|
|
50
|
+
# Format code with Prettier
|
|
51
|
+
yarn format
|
|
52
|
+
# or
|
|
53
|
+
npm run format
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Publishing Workflow
|
|
57
|
+
```bash
|
|
58
|
+
# Pre-publish checks (runs test, lint, and lint:fix)
|
|
59
|
+
yarn prepublishOnly
|
|
60
|
+
|
|
61
|
+
# Version management (includes linting and formatting)
|
|
62
|
+
yarn preversion # lint check
|
|
63
|
+
yarn version # format and git add
|
|
64
|
+
yarn postversion # git push with tags
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Architecture & Structure
|
|
68
|
+
|
|
69
|
+
### Core Module Structure
|
|
70
|
+
- **Source**: `src/index.ts` - Single file containing all utility functions as a default export object
|
|
71
|
+
- **Compiled Output**: `lib/index.js` + `lib/index.d.ts` - ES5 CommonJS with TypeScript declarations
|
|
72
|
+
- **Tests**: `__tests__/korean.test.ts` - Jest tests importing from compiled lib directory
|
|
73
|
+
|
|
74
|
+
### Key Design Patterns
|
|
75
|
+
- **Single Object Export**: All utilities are methods on a single `util` object
|
|
76
|
+
- **Pure Functions**: All utility functions are stateless and side-effect free (except `clearTag` which uses DOM)
|
|
77
|
+
- **Defensive Programming**: Functions include type checking and fallback values
|
|
78
|
+
- **Browser Compatibility**: Uses DOM APIs for `clearTag` and `navigator` for `isiOS`
|
|
79
|
+
|
|
80
|
+
### Function Categories
|
|
81
|
+
|
|
82
|
+
1. **Korean Text Processing**:
|
|
83
|
+
- `isKorean()` - Detects Korean characters using Unicode ranges
|
|
84
|
+
|
|
85
|
+
2. **Date/Time Utilities**:
|
|
86
|
+
- `getNowDate()` - Current datetime in local timezone
|
|
87
|
+
- `getKoreanDate()` - Korean date format ("์์ผ" format)
|
|
88
|
+
- `formatDate()` - yyyy-mm-dd formatting
|
|
89
|
+
- `calDDay()` - D-day calculator
|
|
90
|
+
- `parseTime()` - Parse time strings to milliseconds
|
|
91
|
+
|
|
92
|
+
3. **String Transformations**:
|
|
93
|
+
- `toCamelCase()` - Convert to camelCase
|
|
94
|
+
- `toSnakeCase()` - Convert to snake_case
|
|
95
|
+
- `toTitleCase()` - Convert to Title Case with space handling
|
|
96
|
+
- `replaceBetween()` - Replace substring at specific indices
|
|
97
|
+
|
|
98
|
+
4. **HTML/Text Processing**:
|
|
99
|
+
- `parseTag()` - Decode HTML entities (< to <)
|
|
100
|
+
- `toText()` - Convert <br> tags to newlines
|
|
101
|
+
- `toHtml()` - Convert newlines to <br> tags
|
|
102
|
+
- `clearTag()` - Remove HTML tags (browser only)
|
|
103
|
+
|
|
104
|
+
5. **Data Utilities**:
|
|
105
|
+
- `clone()` - Shallow object cloning
|
|
106
|
+
- `equalArrays()` - Array comparison
|
|
107
|
+
- `parseNumber()` - Safe number parsing with defaults
|
|
108
|
+
|
|
109
|
+
6. **Browser Detection**:
|
|
110
|
+
- `isiOS()` - Detect iOS devices via user agent
|
|
111
|
+
|
|
112
|
+
## Development Notes
|
|
113
|
+
|
|
114
|
+
### Build Process
|
|
115
|
+
- TypeScript compiles to ES5 for broad compatibility
|
|
116
|
+
- Outputs both JavaScript and TypeScript declaration files
|
|
117
|
+
- Uses strict TypeScript configuration with proper module resolution
|
|
118
|
+
|
|
119
|
+
### Testing Strategy
|
|
120
|
+
- Tests run against compiled JavaScript in `lib/` directory, not source TypeScript
|
|
121
|
+
- Jest configuration supports both .ts and .js files
|
|
122
|
+
- Tests focus on core functionality rather than edge cases
|
|
123
|
+
|
|
124
|
+
### Type Safety Considerations
|
|
125
|
+
- Uses `Record<string, unknown>` for generic object types
|
|
126
|
+
- TODO comment indicates need to improve object typing
|
|
127
|
+
- Functions include runtime type checking for safety
|
|
128
|
+
|
|
129
|
+
### Browser Dependencies
|
|
130
|
+
- `clearTag()` function requires DOM environment (uses `document.createElement`)
|
|
131
|
+
- `isiOS()` function requires browser environment (uses `navigator.userAgent`)
|
|
132
|
+
- Other functions are environment-agnostic
|
|
133
|
+
|
|
134
|
+
When adding new utilities:
|
|
135
|
+
1. Add to the main util object in `src/index.ts`
|
|
136
|
+
2. Follow existing patterns for type safety and error handling
|
|
137
|
+
3. Add comprehensive JSDoc documentation
|
|
138
|
+
4. Write tests in `__tests__/` directory
|
|
139
|
+
5. Test against compiled output, not source
|
package/DEPLOYMENT.md
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
# ๐ Deployment Guide - jell-utils
|
|
2
|
+
|
|
3
|
+
## ๐ Overview
|
|
4
|
+
|
|
5
|
+
This project uses a **modern automated CI/CD pipeline** with semantic versioning, conventional commits, and automatic NPM publishing.
|
|
6
|
+
|
|
7
|
+
### ๐ฏ Key Features
|
|
8
|
+
|
|
9
|
+
- โ
**Automatic versioning** based on conventional commits
|
|
10
|
+
- โ
**Semantic Release** with changelog generation
|
|
11
|
+
- โ
**Multi-Node.js version testing** (18.x, 20.x, 21.x)
|
|
12
|
+
- โ
**Cross-platform testing** (Ubuntu, Windows, macOS)
|
|
13
|
+
- โ
**Security scanning** and vulnerability checks
|
|
14
|
+
- โ
**Supply chain security** with provenance attestation
|
|
15
|
+
- โ
**Automated NPM publishing** to registry
|
|
16
|
+
- โ
**GitHub releases** with assets and notes
|
|
17
|
+
- โ
**Slack notifications** (if configured)
|
|
18
|
+
- โ
**Rollback capabilities** for failed releases
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## ๐ Workflow Overview
|
|
23
|
+
|
|
24
|
+
### 1. ๐ Development Workflow
|
|
25
|
+
|
|
26
|
+
```mermaid
|
|
27
|
+
graph LR
|
|
28
|
+
A[Code Changes] --> B[Conventional Commit]
|
|
29
|
+
B --> C[Push to Feature Branch]
|
|
30
|
+
C --> D[Create PR to main]
|
|
31
|
+
D --> E[CI Tests Run]
|
|
32
|
+
E --> F[Merge to main]
|
|
33
|
+
F --> G[Auto Release & Deploy]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. ๐ค Automated Pipeline
|
|
37
|
+
|
|
38
|
+
1. **Quality Gate**: Builds, tests, and lints across multiple environments
|
|
39
|
+
2. **Security Audit**: Vulnerability scanning and dependency analysis
|
|
40
|
+
3. **Release Check**: Semantic analysis of commits for version calculation
|
|
41
|
+
4. **Automated Release**: Version bump, changelog, GitHub release, NPM publish
|
|
42
|
+
5. **Notifications**: Success/failure alerts via Slack and GitHub issues
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## ๐จ Commit Message Format
|
|
47
|
+
|
|
48
|
+
This project uses **[Conventional Commits](https://conventionalcommits.org/)** specification.
|
|
49
|
+
|
|
50
|
+
### Format
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
<type>[optional scope]: <description>
|
|
54
|
+
|
|
55
|
+
[optional body]
|
|
56
|
+
|
|
57
|
+
[optional footer(s)]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Supported Types
|
|
61
|
+
|
|
62
|
+
| Type | Release | Description | Example |
|
|
63
|
+
| ---------- | -------------- | ----------------------- | -------------------------------------- |
|
|
64
|
+
| `feat` | **minor** | New feature | `feat: add Korean text detection` |
|
|
65
|
+
| `fix` | **patch** | Bug fix | `fix: resolve parseTime radix issue` |
|
|
66
|
+
| `perf` | **patch** | Performance improvement | `perf: optimize toTitleCase algorithm` |
|
|
67
|
+
| `docs` | **patch** | Documentation changes | `docs: update API documentation` |
|
|
68
|
+
| `refactor` | **patch** | Code refactoring | `refactor: simplify isiOS function` |
|
|
69
|
+
| `test` | **no release** | Test additions | `test: add parseNumber edge cases` |
|
|
70
|
+
| `ci` | **no release** | CI configuration | `ci: update GitHub Actions workflow` |
|
|
71
|
+
| `style` | **no release** | Code formatting | `style: fix indentation` |
|
|
72
|
+
|
|
73
|
+
### Breaking Changes
|
|
74
|
+
|
|
75
|
+
Add `BREAKING CHANGE:` in footer or `!` after type for **major** version bump:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
feat!: remove deprecated clone function
|
|
79
|
+
|
|
80
|
+
BREAKING CHANGE: clone function now requires explicit type parameter
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### ๐ ๏ธ Easy Commit Tool
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Interactive commit message builder
|
|
87
|
+
npm run commit
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## ๐ฆ Branch Strategy
|
|
93
|
+
|
|
94
|
+
### Main Branches
|
|
95
|
+
|
|
96
|
+
- **`main`/`master`**: Production-ready code, auto-deploys to NPM
|
|
97
|
+
- **`beta`**: Beta releases with `-beta` prerelease tag
|
|
98
|
+
- **`alpha`**: Alpha releases with `-alpha` prerelease tag
|
|
99
|
+
|
|
100
|
+
### Feature Development
|
|
101
|
+
|
|
102
|
+
1. Create feature branch from `main`
|
|
103
|
+
2. Make changes with conventional commits
|
|
104
|
+
3. Create PR to `main`
|
|
105
|
+
4. Auto-merge after CI passes
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## โ๏ธ Setup Instructions
|
|
110
|
+
|
|
111
|
+
### 1. ๐ฆ Install Dependencies
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm install
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 2. ๐ฃ Initialize Git Hooks
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx husky install
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 3. ๐ Configure Secrets (Repository Admin)
|
|
124
|
+
|
|
125
|
+
#### Required GitHub Secrets:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# NPM Publishing Token (https://npmjs.com/settings/tokens)
|
|
129
|
+
NPM_TOKEN=npm_xxxxxxxxxxxxxxxx
|
|
130
|
+
|
|
131
|
+
# Optional: Slack notifications
|
|
132
|
+
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...
|
|
133
|
+
|
|
134
|
+
# Optional: Code coverage
|
|
135
|
+
CODECOV_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### Setting Secrets:
|
|
139
|
+
|
|
140
|
+
1. Go to repository **Settings** โ **Secrets and variables** โ **Actions**
|
|
141
|
+
2. Click **New repository secret**
|
|
142
|
+
3. Add each secret above
|
|
143
|
+
|
|
144
|
+
### 4. ๐ Branch Protection Rules
|
|
145
|
+
|
|
146
|
+
Configure branch protection for `main`:
|
|
147
|
+
|
|
148
|
+
1. **Settings** โ **Branches** โ **Add rule**
|
|
149
|
+
2. Branch name pattern: `main`
|
|
150
|
+
3. Enable:
|
|
151
|
+
- โ
Require a pull request before merging
|
|
152
|
+
- โ
Require status checks to pass before merging
|
|
153
|
+
- โ
Require up-to-date branches before merging
|
|
154
|
+
- โ
Include administrators
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## ๐ฎ Usage Commands
|
|
159
|
+
|
|
160
|
+
### Development
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Build project
|
|
164
|
+
npm run build
|
|
165
|
+
|
|
166
|
+
# Run tests with coverage
|
|
167
|
+
npm run test:coverage
|
|
168
|
+
|
|
169
|
+
# Lint and fix code
|
|
170
|
+
npm run lint:fix
|
|
171
|
+
|
|
172
|
+
# Format code
|
|
173
|
+
npm run format
|
|
174
|
+
|
|
175
|
+
# Interactive commit (recommended)
|
|
176
|
+
npm run commit
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Release Management
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Test semantic release (dry run)
|
|
183
|
+
npm run semantic-release:dry-run
|
|
184
|
+
|
|
185
|
+
# Manual version bump (emergency only)
|
|
186
|
+
npm run release:patch # x.x.X
|
|
187
|
+
npm run release:minor # x.X.0
|
|
188
|
+
npm run release:major # X.0.0
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### CI Commands
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Full CI pipeline locally
|
|
195
|
+
npm run ci:install
|
|
196
|
+
npm run ci:build
|
|
197
|
+
npm run ci:test
|
|
198
|
+
npm run ci:lint
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## ๐ง Configuration Files
|
|
204
|
+
|
|
205
|
+
### Core Configuration
|
|
206
|
+
|
|
207
|
+
- **`.releaserc.json`**: Semantic release configuration
|
|
208
|
+
- **`package.json`**: NPM scripts and dependencies
|
|
209
|
+
- **`.github/workflows/`**: GitHub Actions workflows
|
|
210
|
+
|
|
211
|
+
### Code Quality
|
|
212
|
+
|
|
213
|
+
- **`.husky/`**: Git hooks for commit validation
|
|
214
|
+
- **`commitlint.config.js`**: Commit message linting
|
|
215
|
+
- **`lint-staged`**: Pre-commit code formatting
|
|
216
|
+
- **`.eslintrc`**: Code linting rules
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## ๐จ Troubleshooting
|
|
221
|
+
|
|
222
|
+
### Common Issues
|
|
223
|
+
|
|
224
|
+
#### 1. โ Commit Message Rejected
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
Error: Commit message does not follow Conventional Commits format
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Solution**: Use `npm run commit` or follow the format above.
|
|
231
|
+
|
|
232
|
+
#### 2. โ NPM Publish Failed
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
Error: 401 Unauthorized - PUT https://registry.npmjs.org/jell-utils
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Solution**: Check `NPM_TOKEN` in repository secrets.
|
|
239
|
+
|
|
240
|
+
#### 3. โ No Release Created
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
No new version is released
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Solution**: Ensure commits follow conventional format and have appropriate types.
|
|
247
|
+
|
|
248
|
+
#### 4. โ Tests Failing in CI
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
Tests are failing on multiple Node.js versions
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Solution**: Run tests locally on Node.js 18+ and fix compatibility issues.
|
|
255
|
+
|
|
256
|
+
### ๐ Manual Recovery
|
|
257
|
+
|
|
258
|
+
#### Emergency Release
|
|
259
|
+
|
|
260
|
+
If automated release fails:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
# 1. Create manual release
|
|
264
|
+
npm version patch # or minor/major
|
|
265
|
+
git push origin main --tags
|
|
266
|
+
|
|
267
|
+
# 2. Publish to NPM
|
|
268
|
+
npm publish
|
|
269
|
+
|
|
270
|
+
# 3. Create GitHub release manually
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
#### Rollback Release
|
|
274
|
+
|
|
275
|
+
If release has issues:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# 1. Deprecate NPM version
|
|
279
|
+
npm deprecate jell-utils@X.X.X "Version withdrawn due to issues"
|
|
280
|
+
|
|
281
|
+
# 2. Revert git commits
|
|
282
|
+
git revert <commit-hash>
|
|
283
|
+
git push origin main
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## ๐ Monitoring & Analytics
|
|
289
|
+
|
|
290
|
+
### Release Notifications
|
|
291
|
+
|
|
292
|
+
- โ
**Slack alerts** for successful/failed releases
|
|
293
|
+
- โ
**GitHub issues** created for failed deployments
|
|
294
|
+
- โ
**Email notifications** via GitHub settings
|
|
295
|
+
|
|
296
|
+
### Package Analytics
|
|
297
|
+
|
|
298
|
+
- ๐ **NPM download stats**: https://npm-stat.com/charts.html?package=jell-utils
|
|
299
|
+
- ๐ **Bundle size analysis**: Automated in CI pipeline
|
|
300
|
+
- ๐ **Test coverage reports**: Generated with each release
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## ๐ค Contributing
|
|
305
|
+
|
|
306
|
+
### Quick Start for Contributors
|
|
307
|
+
|
|
308
|
+
1. Fork the repository
|
|
309
|
+
2. Create feature branch: `git checkout -b feat/amazing-feature`
|
|
310
|
+
3. Make changes with conventional commits
|
|
311
|
+
4. Push and create PR
|
|
312
|
+
5. Wait for CI to pass
|
|
313
|
+
6. Merge and automatic release!
|
|
314
|
+
|
|
315
|
+
### Commit Examples
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# New feature
|
|
319
|
+
git commit -m "feat: add parseTime millisecond support"
|
|
320
|
+
|
|
321
|
+
# Bug fix
|
|
322
|
+
git commit -m "fix: handle null values in clone function"
|
|
323
|
+
|
|
324
|
+
# Documentation
|
|
325
|
+
git commit -m "docs: add deployment guide"
|
|
326
|
+
|
|
327
|
+
# Breaking change
|
|
328
|
+
git commit -m "feat!: remove deprecated API methods
|
|
329
|
+
|
|
330
|
+
BREAKING CHANGE: parseOldFormat() has been removed, use parseTime() instead"
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## ๐ Useful Links
|
|
336
|
+
|
|
337
|
+
- ๐ **[Conventional Commits](https://conventionalcommits.org/)**
|
|
338
|
+
- ๐ **[Semantic Release](https://semantic-release.gitbook.io/)**
|
|
339
|
+
- ๐ **[GitHub Actions](https://docs.github.com/en/actions)**
|
|
340
|
+
- ๐ฆ **[NPM Package](https://www.npmjs.com/package/jell-utils)**
|
|
341
|
+
- ๐ **[Repository](https://github.com/jellive/jell-utils.js)**
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## ๐ Support
|
|
346
|
+
|
|
347
|
+
- ๐ **Bug reports**: [Create GitHub Issue](https://github.com/jellive/jell-utils.js/issues/new?template=bug_report.md)
|
|
348
|
+
- ๐ก **Feature requests**: [Create GitHub Issue](https://github.com/jellive/jell-utils.js/issues/new?template=feature_request.md)
|
|
349
|
+
- ๐ฌ **Questions**: [GitHub Discussions](https://github.com/jellive/jell-utils.js/discussions)
|
|
350
|
+
|
|
351
|
+
_Last updated: $(date)_
|