@mks2508/better-logger 0.0.1 → 0.0.2-alpha.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 +4 -1
- package/.github/workflows/ci.yml +307 -0
- package/.github/workflows/release.yml +248 -0
- package/README.md +577 -0
- package/demo.html +840 -0
- package/dist/chunks/Logger-BQhMKy_T.js +2 -0
- package/dist/chunks/Logger-BQhMKy_T.js.map +1 -0
- package/dist/chunks/Logger-BrFKFZcD.js +978 -0
- package/dist/chunks/Logger-BrFKFZcD.js.map +1 -0
- package/dist/chunks/core-2opW4Pi3.js +194 -0
- package/dist/chunks/core-2opW4Pi3.js.map +1 -0
- package/dist/chunks/core-DyugwSYZ.js +4 -0
- package/dist/chunks/core-DyugwSYZ.js.map +1 -0
- package/dist/chunks/exports-BNP3R7dp.js +421 -0
- package/dist/chunks/exports-BNP3R7dp.js.map +1 -0
- package/dist/chunks/exports-U1xLBXrY.js +2 -0
- package/dist/chunks/exports-U1xLBXrY.js.map +1 -0
- package/dist/chunks/styling-DhUDzwlE.js +654 -0
- package/dist/chunks/styling-DhUDzwlE.js.map +1 -0
- package/dist/chunks/styling-tmRDI28D.js +2 -0
- package/dist/chunks/styling-tmRDI28D.js.map +1 -0
- package/dist/core.cjs +2 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.js +244 -0
- package/dist/core.js.map +1 -0
- package/dist/exports.cjs +2 -0
- package/dist/exports.cjs.map +1 -0
- package/dist/exports.js +237 -0
- package/dist/exports.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/styling.cjs +2 -0
- package/dist/styling.cjs.map +1 -0
- package/dist/styling.js +146 -0
- package/dist/styling.js.map +1 -0
- package/dist/types/core.d.ts +211 -0
- package/dist/types/exports.d.ts +600 -0
- package/dist/types/index.d.ts +675 -0
- package/dist/types/styling.d.ts +751 -0
- package/docs/CORE.md +264 -0
- package/docs/EXPORTS.md +467 -0
- package/docs/STYLING.md +405 -0
- package/index.html +28 -4
- package/package.json +26 -3
- package/src/Logger.ts +28 -8
- package/src/cli/CommandProcessor.ts +2 -2
- package/src/cli/commands/ExportCommand.ts +5 -0
- package/src/cli/commands/StatusCommand.ts +11 -10
- package/src/core.ts +320 -0
- package/src/example.ts +184 -62
- package/src/exports-module.ts +311 -0
- package/src/handlers/ExportLogHandler.ts +34 -13
- package/src/index.ts +97 -79
- package/src/main.ts +77 -7
- package/src/styling-module.ts +244 -0
- package/src/utils/stackTrace.ts +39 -10
- package/src/utils/timestamps.ts +1 -1
- package/tsconfig.json +40 -14
- package/vite.config.ts +84 -0
- package/dist/assets/index-DxvJByYN.js +0 -183
- package/dist/index.html +0 -334
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
name: CI/CD Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
tags: [ 'v*' ]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ main, develop ]
|
|
9
|
+
|
|
10
|
+
env:
|
|
11
|
+
NODE_VERSION: '20'
|
|
12
|
+
REGISTRY_URL: 'https://registry.npmjs.org'
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
# ===== BUILD & TEST =====
|
|
16
|
+
build-and-test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
strategy:
|
|
20
|
+
matrix:
|
|
21
|
+
node-version: [18, 20, 21]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- name: 📥 Checkout code
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
with:
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: 📦 Setup Node.js ${{ matrix.node-version }}
|
|
30
|
+
uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version: ${{ matrix.node-version }}
|
|
33
|
+
cache: 'npm'
|
|
34
|
+
registry-url: ${{ env.REGISTRY_URL }}
|
|
35
|
+
|
|
36
|
+
- name: 🔧 Install dependencies
|
|
37
|
+
run: npm run ci:install
|
|
38
|
+
|
|
39
|
+
- name: 🔍 Type checking
|
|
40
|
+
run: npm run type-check
|
|
41
|
+
|
|
42
|
+
- name: 🧹 Lint code
|
|
43
|
+
run: npm run lint
|
|
44
|
+
|
|
45
|
+
- name: 🏗️ Build library
|
|
46
|
+
run: npm run ci:build
|
|
47
|
+
|
|
48
|
+
- name: 🧪 Run tests
|
|
49
|
+
run: npm run ci:test
|
|
50
|
+
|
|
51
|
+
- name: 📊 Check bundle sizes
|
|
52
|
+
run: npm run size-limit
|
|
53
|
+
|
|
54
|
+
- name: 📤 Upload build artifacts
|
|
55
|
+
uses: actions/upload-artifact@v4
|
|
56
|
+
if: matrix.node-version == 20
|
|
57
|
+
with:
|
|
58
|
+
name: dist-files
|
|
59
|
+
path: dist/
|
|
60
|
+
retention-days: 30
|
|
61
|
+
|
|
62
|
+
# ===== VISUAL TESTING =====
|
|
63
|
+
visual-tests:
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
needs: build-and-test
|
|
66
|
+
|
|
67
|
+
steps:
|
|
68
|
+
- name: 📥 Checkout code
|
|
69
|
+
uses: actions/checkout@v4
|
|
70
|
+
|
|
71
|
+
- name: 📦 Setup Node.js
|
|
72
|
+
uses: actions/setup-node@v4
|
|
73
|
+
with:
|
|
74
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
75
|
+
cache: 'npm'
|
|
76
|
+
|
|
77
|
+
- name: 🔧 Install dependencies
|
|
78
|
+
run: npm run ci:install
|
|
79
|
+
|
|
80
|
+
- name: 📥 Download build artifacts
|
|
81
|
+
uses: actions/download-artifact@v4
|
|
82
|
+
with:
|
|
83
|
+
name: dist-files
|
|
84
|
+
path: dist/
|
|
85
|
+
|
|
86
|
+
- name: 🎭 Install Playwright
|
|
87
|
+
run: npx playwright install --with-deps chromium
|
|
88
|
+
|
|
89
|
+
- name: 🖼️ Run visual tests
|
|
90
|
+
run: npm run ci:test:visual
|
|
91
|
+
|
|
92
|
+
- name: 📤 Upload test results
|
|
93
|
+
uses: actions/upload-artifact@v4
|
|
94
|
+
if: always()
|
|
95
|
+
with:
|
|
96
|
+
name: playwright-results
|
|
97
|
+
path: test-results/
|
|
98
|
+
retention-days: 30
|
|
99
|
+
|
|
100
|
+
- name: 📤 Upload screenshots
|
|
101
|
+
uses: actions/upload-artifact@v4
|
|
102
|
+
if: failure()
|
|
103
|
+
with:
|
|
104
|
+
name: failed-screenshots
|
|
105
|
+
path: test-results/
|
|
106
|
+
retention-days: 30
|
|
107
|
+
|
|
108
|
+
# ===== NPM PUBLISH =====
|
|
109
|
+
publish:
|
|
110
|
+
runs-on: ubuntu-latest
|
|
111
|
+
needs: [build-and-test, visual-tests]
|
|
112
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
113
|
+
|
|
114
|
+
steps:
|
|
115
|
+
- name: 📥 Checkout code
|
|
116
|
+
uses: actions/checkout@v4
|
|
117
|
+
|
|
118
|
+
- name: 📦 Setup Node.js
|
|
119
|
+
uses: actions/setup-node@v4
|
|
120
|
+
with:
|
|
121
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
122
|
+
cache: 'npm'
|
|
123
|
+
registry-url: ${{ env.REGISTRY_URL }}
|
|
124
|
+
|
|
125
|
+
- name: 🔧 Install dependencies
|
|
126
|
+
run: npm run ci:install
|
|
127
|
+
|
|
128
|
+
- name: 📥 Download build artifacts
|
|
129
|
+
uses: actions/download-artifact@v4
|
|
130
|
+
with:
|
|
131
|
+
name: dist-files
|
|
132
|
+
path: dist/
|
|
133
|
+
|
|
134
|
+
- name: 🚀 Publish to NPM
|
|
135
|
+
run: npm run ci:publish
|
|
136
|
+
env:
|
|
137
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
138
|
+
|
|
139
|
+
- name: 📝 Extract release notes
|
|
140
|
+
id: extract_release
|
|
141
|
+
run: |
|
|
142
|
+
VERSION=${GITHUB_REF#refs/tags/v}
|
|
143
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
144
|
+
echo "tag_name=v$VERSION" >> $GITHUB_OUTPUT
|
|
145
|
+
|
|
146
|
+
# ===== GITHUB RELEASE =====
|
|
147
|
+
github-release:
|
|
148
|
+
runs-on: ubuntu-latest
|
|
149
|
+
needs: publish
|
|
150
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
151
|
+
|
|
152
|
+
steps:
|
|
153
|
+
- name: 📥 Checkout code
|
|
154
|
+
uses: actions/checkout@v4
|
|
155
|
+
|
|
156
|
+
- name: 📥 Download build artifacts
|
|
157
|
+
uses: actions/download-artifact@v4
|
|
158
|
+
with:
|
|
159
|
+
name: dist-files
|
|
160
|
+
path: dist/
|
|
161
|
+
|
|
162
|
+
- name: 📦 Create release archive
|
|
163
|
+
run: |
|
|
164
|
+
tar -czf better-logger-dist.tar.gz dist/
|
|
165
|
+
zip -r better-logger-dist.zip dist/
|
|
166
|
+
|
|
167
|
+
- name: 🏷️ Create GitHub Release
|
|
168
|
+
uses: softprops/action-gh-release@v1
|
|
169
|
+
with:
|
|
170
|
+
name: Better Logger ${{ github.ref_name }}
|
|
171
|
+
tag_name: ${{ github.ref_name }}
|
|
172
|
+
body: |
|
|
173
|
+
## 🚀 Better Logger ${{ github.ref_name }}
|
|
174
|
+
|
|
175
|
+
### 📦 Installation
|
|
176
|
+
```bash
|
|
177
|
+
npm install @mks2508/better-logger@${{ github.ref_name }}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### 📊 Bundle Sizes
|
|
181
|
+
- **Full library**: ~64KB (13KB gzipped)
|
|
182
|
+
- **Core module**: ~6KB (2KB gzipped)
|
|
183
|
+
- **Styling module**: ~26KB (5KB gzipped)
|
|
184
|
+
- **Exports module**: ~12KB (3KB gzipped)
|
|
185
|
+
|
|
186
|
+
### 🔗 Links
|
|
187
|
+
- [📚 Documentation](https://mks2508.github.io/advanced-logger/)
|
|
188
|
+
- [🧩 Examples](https://github.com/MKS2508/advanced-logger/tree/main/examples)
|
|
189
|
+
- [📋 Changelog](https://github.com/MKS2508/advanced-logger/blob/main/CHANGELOG.md)
|
|
190
|
+
|
|
191
|
+
### 📁 Assets
|
|
192
|
+
- `better-logger-dist.tar.gz` - Distribution files (tar.gz)
|
|
193
|
+
- `better-logger-dist.zip` - Distribution files (zip)
|
|
194
|
+
files: |
|
|
195
|
+
better-logger-dist.tar.gz
|
|
196
|
+
better-logger-dist.zip
|
|
197
|
+
env:
|
|
198
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
199
|
+
|
|
200
|
+
# ===== DEPLOY GITHUB PAGES =====
|
|
201
|
+
deploy-docs:
|
|
202
|
+
runs-on: ubuntu-latest
|
|
203
|
+
needs: build-and-test
|
|
204
|
+
if: github.ref == 'refs/heads/main'
|
|
205
|
+
|
|
206
|
+
permissions:
|
|
207
|
+
contents: read
|
|
208
|
+
pages: write
|
|
209
|
+
id-token: write
|
|
210
|
+
|
|
211
|
+
environment:
|
|
212
|
+
name: github-pages
|
|
213
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
214
|
+
|
|
215
|
+
steps:
|
|
216
|
+
- name: 📥 Checkout code
|
|
217
|
+
uses: actions/checkout@v4
|
|
218
|
+
|
|
219
|
+
- name: 📦 Setup Node.js
|
|
220
|
+
uses: actions/setup-node@v4
|
|
221
|
+
with:
|
|
222
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
223
|
+
cache: 'npm'
|
|
224
|
+
|
|
225
|
+
- name: 🔧 Install dependencies
|
|
226
|
+
run: npm run ci:install
|
|
227
|
+
|
|
228
|
+
- name: 📥 Download build artifacts
|
|
229
|
+
uses: actions/download-artifact@v4
|
|
230
|
+
with:
|
|
231
|
+
name: dist-files
|
|
232
|
+
path: dist/
|
|
233
|
+
|
|
234
|
+
- name: 🏗️ Build documentation site
|
|
235
|
+
run: |
|
|
236
|
+
mkdir -p docs-site
|
|
237
|
+
cp demo.html docs-site/index.html
|
|
238
|
+
cp -r dist/ docs-site/dist/
|
|
239
|
+
cp -r docs/ docs-site/docs/
|
|
240
|
+
cp README.md docs-site/
|
|
241
|
+
|
|
242
|
+
- name: 📤 Setup Pages
|
|
243
|
+
uses: actions/configure-pages@v4
|
|
244
|
+
|
|
245
|
+
- name: 📤 Upload to Pages
|
|
246
|
+
uses: actions/upload-pages-artifact@v3
|
|
247
|
+
with:
|
|
248
|
+
path: docs-site/
|
|
249
|
+
|
|
250
|
+
- name: 🚀 Deploy to GitHub Pages
|
|
251
|
+
id: deployment
|
|
252
|
+
uses: actions/deploy-pages@v4
|
|
253
|
+
|
|
254
|
+
# ===== SECURITY & QUALITY =====
|
|
255
|
+
security-audit:
|
|
256
|
+
runs-on: ubuntu-latest
|
|
257
|
+
|
|
258
|
+
steps:
|
|
259
|
+
- name: 📥 Checkout code
|
|
260
|
+
uses: actions/checkout@v4
|
|
261
|
+
|
|
262
|
+
- name: 📦 Setup Node.js
|
|
263
|
+
uses: actions/setup-node@v4
|
|
264
|
+
with:
|
|
265
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
266
|
+
cache: 'npm'
|
|
267
|
+
|
|
268
|
+
- name: 🔒 Security audit
|
|
269
|
+
run: npm audit --audit-level=high
|
|
270
|
+
|
|
271
|
+
- name: 📊 Check for outdated packages
|
|
272
|
+
run: npm outdated || true
|
|
273
|
+
|
|
274
|
+
# ===== PERFORMANCE TESTING =====
|
|
275
|
+
performance:
|
|
276
|
+
runs-on: ubuntu-latest
|
|
277
|
+
needs: build-and-test
|
|
278
|
+
|
|
279
|
+
steps:
|
|
280
|
+
- name: 📥 Checkout code
|
|
281
|
+
uses: actions/checkout@v4
|
|
282
|
+
|
|
283
|
+
- name: 📦 Setup Node.js
|
|
284
|
+
uses: actions/setup-node@v4
|
|
285
|
+
with:
|
|
286
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
287
|
+
cache: 'npm'
|
|
288
|
+
|
|
289
|
+
- name: 🔧 Install dependencies
|
|
290
|
+
run: npm run ci:install
|
|
291
|
+
|
|
292
|
+
- name: 📥 Download build artifacts
|
|
293
|
+
uses: actions/download-artifact@v4
|
|
294
|
+
with:
|
|
295
|
+
name: dist-files
|
|
296
|
+
path: dist/
|
|
297
|
+
|
|
298
|
+
- name: ⚡ Performance benchmarks
|
|
299
|
+
run: npm run ci:test:performance
|
|
300
|
+
|
|
301
|
+
- name: 📊 Bundle analysis
|
|
302
|
+
run: |
|
|
303
|
+
echo "## Bundle Analysis" >> $GITHUB_STEP_SUMMARY
|
|
304
|
+
echo "### Size Breakdown" >> $GITHUB_STEP_SUMMARY
|
|
305
|
+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
|
306
|
+
ls -la dist/ >> $GITHUB_STEP_SUMMARY
|
|
307
|
+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
release_type:
|
|
7
|
+
description: 'Release type'
|
|
8
|
+
required: true
|
|
9
|
+
default: 'patch'
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- patch
|
|
13
|
+
- minor
|
|
14
|
+
- major
|
|
15
|
+
- alpha
|
|
16
|
+
- beta
|
|
17
|
+
skip_tests:
|
|
18
|
+
description: 'Skip tests (not recommended)'
|
|
19
|
+
required: false
|
|
20
|
+
default: false
|
|
21
|
+
type: boolean
|
|
22
|
+
|
|
23
|
+
env:
|
|
24
|
+
NODE_VERSION: '20'
|
|
25
|
+
REGISTRY_URL: 'https://registry.npmjs.org'
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
# ===== PRE-RELEASE VALIDATION =====
|
|
29
|
+
pre-release:
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
|
|
32
|
+
outputs:
|
|
33
|
+
version: ${{ steps.version.outputs.version }}
|
|
34
|
+
tag: ${{ steps.version.outputs.tag }}
|
|
35
|
+
|
|
36
|
+
steps:
|
|
37
|
+
- name: 📥 Checkout code
|
|
38
|
+
uses: actions/checkout@v4
|
|
39
|
+
with:
|
|
40
|
+
fetch-depth: 0
|
|
41
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
42
|
+
|
|
43
|
+
- name: 📦 Setup Node.js
|
|
44
|
+
uses: actions/setup-node@v4
|
|
45
|
+
with:
|
|
46
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
47
|
+
cache: 'npm'
|
|
48
|
+
registry-url: ${{ env.REGISTRY_URL }}
|
|
49
|
+
|
|
50
|
+
- name: 🔧 Install dependencies
|
|
51
|
+
run: npm ci
|
|
52
|
+
|
|
53
|
+
- name: 🧪 Run tests (unless skipped)
|
|
54
|
+
if: ${{ !inputs.skip_tests }}
|
|
55
|
+
run: |
|
|
56
|
+
npm run type-check
|
|
57
|
+
npm run lint
|
|
58
|
+
npm run test
|
|
59
|
+
npm run build
|
|
60
|
+
|
|
61
|
+
- name: 🏷️ Determine version
|
|
62
|
+
id: version
|
|
63
|
+
run: |
|
|
64
|
+
case "${{ inputs.release_type }}" in
|
|
65
|
+
"patch")
|
|
66
|
+
NEW_VERSION=$(npm version patch --no-git-tag-version)
|
|
67
|
+
;;
|
|
68
|
+
"minor")
|
|
69
|
+
NEW_VERSION=$(npm version minor --no-git-tag-version)
|
|
70
|
+
;;
|
|
71
|
+
"major")
|
|
72
|
+
NEW_VERSION=$(npm version major --no-git-tag-version)
|
|
73
|
+
;;
|
|
74
|
+
"alpha")
|
|
75
|
+
NEW_VERSION=$(npm version prerelease --preid=alpha --no-git-tag-version)
|
|
76
|
+
;;
|
|
77
|
+
"beta")
|
|
78
|
+
NEW_VERSION=$(npm version prerelease --preid=beta --no-git-tag-version)
|
|
79
|
+
;;
|
|
80
|
+
esac
|
|
81
|
+
|
|
82
|
+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
83
|
+
echo "tag=v$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
84
|
+
echo "📦 New version: $NEW_VERSION"
|
|
85
|
+
|
|
86
|
+
- name: 🏗️ Build for release
|
|
87
|
+
run: npm run build
|
|
88
|
+
|
|
89
|
+
- name: 📤 Upload build artifacts
|
|
90
|
+
uses: actions/upload-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: release-dist
|
|
93
|
+
path: dist/
|
|
94
|
+
retention-days: 7
|
|
95
|
+
|
|
96
|
+
# ===== CREATE RELEASE =====
|
|
97
|
+
create-release:
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
needs: pre-release
|
|
100
|
+
|
|
101
|
+
steps:
|
|
102
|
+
- name: 📥 Checkout code
|
|
103
|
+
uses: actions/checkout@v4
|
|
104
|
+
with:
|
|
105
|
+
fetch-depth: 0
|
|
106
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
107
|
+
|
|
108
|
+
- name: 📦 Setup Node.js
|
|
109
|
+
uses: actions/setup-node@v4
|
|
110
|
+
with:
|
|
111
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
112
|
+
cache: 'npm'
|
|
113
|
+
registry-url: ${{ env.REGISTRY_URL }}
|
|
114
|
+
|
|
115
|
+
- name: 📥 Download build artifacts
|
|
116
|
+
uses: actions/download-artifact@v4
|
|
117
|
+
with:
|
|
118
|
+
name: release-dist
|
|
119
|
+
path: dist/
|
|
120
|
+
|
|
121
|
+
- name: 🔄 Update package version
|
|
122
|
+
run: npm version ${{ needs.pre-release.outputs.version }} --no-git-tag-version
|
|
123
|
+
|
|
124
|
+
- name: 📦 Create release archives
|
|
125
|
+
run: |
|
|
126
|
+
# Create distribution archives
|
|
127
|
+
tar -czf better-logger-${{ needs.pre-release.outputs.version }}.tar.gz dist/ docs/ README.md package.json
|
|
128
|
+
zip -r better-logger-${{ needs.pre-release.outputs.version }}.zip dist/ docs/ README.md package.json
|
|
129
|
+
|
|
130
|
+
# Create individual module packages
|
|
131
|
+
cd dist
|
|
132
|
+
tar -czf ../better-logger-core-${{ needs.pre-release.outputs.version }}.tar.gz core.js core.cjs types/core.d.ts
|
|
133
|
+
tar -czf ../better-logger-styling-${{ needs.pre-release.outputs.version }}.tar.gz styling.js styling.cjs types/styling.d.ts
|
|
134
|
+
tar -czf ../better-logger-exports-${{ needs.pre-release.outputs.version }}.tar.gz exports.js exports.cjs types/exports.d.ts
|
|
135
|
+
cd ..
|
|
136
|
+
|
|
137
|
+
- name: 📝 Generate changelog
|
|
138
|
+
id: changelog
|
|
139
|
+
run: |
|
|
140
|
+
# Get commits since last tag
|
|
141
|
+
LAST_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
|
|
142
|
+
if [ -n "$LAST_TAG" ]; then
|
|
143
|
+
echo "## Changes since $LAST_TAG" > RELEASE_NOTES.md
|
|
144
|
+
git log $LAST_TAG..HEAD --pretty=format:"- %s (%h)" >> RELEASE_NOTES.md
|
|
145
|
+
else
|
|
146
|
+
echo "## Initial Release" > RELEASE_NOTES.md
|
|
147
|
+
echo "- Complete Better Logger implementation with all features" >> RELEASE_NOTES.md
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
# Add bundle size info
|
|
151
|
+
echo "" >> RELEASE_NOTES.md
|
|
152
|
+
echo "## 📦 Bundle Sizes" >> RELEASE_NOTES.md
|
|
153
|
+
echo "\`\`\`" >> RELEASE_NOTES.md
|
|
154
|
+
ls -lh dist/*.js dist/*.cjs | grep -E '\.(js|cjs)$' >> RELEASE_NOTES.md
|
|
155
|
+
echo "\`\`\`" >> RELEASE_NOTES.md
|
|
156
|
+
|
|
157
|
+
- name: 🏷️ Create and push tag
|
|
158
|
+
run: |
|
|
159
|
+
git config user.name "github-actions[bot]"
|
|
160
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
161
|
+
git add package.json
|
|
162
|
+
git commit -m "chore: release ${{ needs.pre-release.outputs.version }}"
|
|
163
|
+
git tag -a "${{ needs.pre-release.outputs.tag }}" -m "Release ${{ needs.pre-release.outputs.version }}"
|
|
164
|
+
git push origin main --tags
|
|
165
|
+
|
|
166
|
+
- name: 🚀 Publish to NPM
|
|
167
|
+
run: |
|
|
168
|
+
if [[ "${{ inputs.release_type }}" == "alpha" || "${{ inputs.release_type }}" == "beta" ]]; then
|
|
169
|
+
npm run ci:publish -- --tag ${{ inputs.release_type }}
|
|
170
|
+
else
|
|
171
|
+
npm run ci:publish
|
|
172
|
+
fi
|
|
173
|
+
env:
|
|
174
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
175
|
+
|
|
176
|
+
- name: 🏷️ Create GitHub Release
|
|
177
|
+
uses: softprops/action-gh-release@v1
|
|
178
|
+
with:
|
|
179
|
+
tag_name: ${{ needs.pre-release.outputs.tag }}
|
|
180
|
+
name: Better Logger ${{ needs.pre-release.outputs.version }}
|
|
181
|
+
body_path: RELEASE_NOTES.md
|
|
182
|
+
draft: false
|
|
183
|
+
prerelease: ${{ contains(inputs.release_type, 'alpha') || contains(inputs.release_type, 'beta') }}
|
|
184
|
+
files: |
|
|
185
|
+
better-logger-${{ needs.pre-release.outputs.version }}.tar.gz
|
|
186
|
+
better-logger-${{ needs.pre-release.outputs.version }}.zip
|
|
187
|
+
better-logger-core-${{ needs.pre-release.outputs.version }}.tar.gz
|
|
188
|
+
better-logger-styling-${{ needs.pre-release.outputs.version }}.tar.gz
|
|
189
|
+
better-logger-exports-${{ needs.pre-release.outputs.version }}.tar.gz
|
|
190
|
+
env:
|
|
191
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
192
|
+
|
|
193
|
+
# ===== POST-RELEASE TASKS =====
|
|
194
|
+
post-release:
|
|
195
|
+
runs-on: ubuntu-latest
|
|
196
|
+
needs: [pre-release, create-release]
|
|
197
|
+
|
|
198
|
+
steps:
|
|
199
|
+
- name: 📥 Checkout code
|
|
200
|
+
uses: actions/checkout@v4
|
|
201
|
+
with:
|
|
202
|
+
ref: main
|
|
203
|
+
fetch-depth: 0
|
|
204
|
+
|
|
205
|
+
- name: 📦 Setup Node.js
|
|
206
|
+
uses: actions/setup-node@v4
|
|
207
|
+
with:
|
|
208
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
209
|
+
cache: 'npm'
|
|
210
|
+
|
|
211
|
+
- name: 🔧 Install dependencies
|
|
212
|
+
run: npm ci
|
|
213
|
+
|
|
214
|
+
- name: 📥 Download build artifacts
|
|
215
|
+
uses: actions/download-artifact@v4
|
|
216
|
+
with:
|
|
217
|
+
name: release-dist
|
|
218
|
+
path: dist/
|
|
219
|
+
|
|
220
|
+
- name: 🚀 Deploy documentation
|
|
221
|
+
run: |
|
|
222
|
+
# Build documentation site
|
|
223
|
+
mkdir -p docs-site
|
|
224
|
+
cp demo.html docs-site/index.html
|
|
225
|
+
cp -r dist/ docs-site/dist/
|
|
226
|
+
cp -r docs/ docs-site/docs/
|
|
227
|
+
cp README.md docs-site/
|
|
228
|
+
|
|
229
|
+
- name: 📤 Deploy to GitHub Pages
|
|
230
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
231
|
+
with:
|
|
232
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
233
|
+
publish_dir: ./docs-site
|
|
234
|
+
publish_branch: gh-pages
|
|
235
|
+
commit_message: 'docs: update documentation for ${{ needs.pre-release.outputs.version }}'
|
|
236
|
+
|
|
237
|
+
- name: 📊 Release summary
|
|
238
|
+
run: |
|
|
239
|
+
echo "## 🎉 Release Complete!" >> $GITHUB_STEP_SUMMARY
|
|
240
|
+
echo "- **Version**: ${{ needs.pre-release.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
|
241
|
+
echo "- **NPM**: https://www.npmjs.com/package/@mks2508/better-logger" >> $GITHUB_STEP_SUMMARY
|
|
242
|
+
echo "- **GitHub**: https://github.com/MKS2508/advanced-logger/releases/tag/${{ needs.pre-release.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
|
|
243
|
+
echo "- **Docs**: https://mks2508.github.io/advanced-logger/" >> $GITHUB_STEP_SUMMARY
|
|
244
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
245
|
+
echo "### 📦 Installation" >> $GITHUB_STEP_SUMMARY
|
|
246
|
+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
|
|
247
|
+
echo "npm install @mks2508/better-logger@${{ needs.pre-release.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
|
248
|
+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|