koa-classic-server 2.0.0-beta.1 → 2.0.0-beta.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/README.md CHANGED
@@ -282,11 +282,11 @@ See [CHANGELOG.md](./CHANGELOG.md) for detailed information.
282
282
 
283
283
  For complete documentation with all features, examples, troubleshooting, and best practices, see:
284
284
 
285
- - **[DOCUMENTATION.md](./DOCUMENTATION.md)** - Complete API reference and usage guide
286
- - **[INDEX_OPTION_PRIORITY.md](./INDEX_OPTION_PRIORITY.md)** - Detailed priority behavior for `index` option (string, array, RegExp)
287
- - **[EXAMPLES_INDEX_OPTION.md](./EXAMPLES_INDEX_OPTION.md)** - 10 practical examples of `index` option with RegExp
288
- - **[PERFORMANCE_ANALYSIS.md](./PERFORMANCE_ANALYSIS.md)** - Performance optimization analysis
289
- - **[PERFORMANCE_COMPARISON.md](./PERFORMANCE_COMPARISON.md)** - Before/after performance benchmarks
285
+ - **[DOCUMENTATION.md](./docs/DOCUMENTATION.md)** - Complete API reference and usage guide
286
+ - **[INDEX_OPTION_PRIORITY.md](./docs/INDEX_OPTION_PRIORITY.md)** - Detailed priority behavior for `index` option (string, array, RegExp)
287
+ - **[EXAMPLES_INDEX_OPTION.md](./docs/EXAMPLES_INDEX_OPTION.md)** - 10 practical examples of `index` option with RegExp
288
+ - **[PERFORMANCE_ANALYSIS.md](./docs/PERFORMANCE_ANALYSIS.md)** - Performance optimization analysis
289
+ - **[PERFORMANCE_COMPARISON.md](./docs/PERFORMANCE_COMPARISON.md)** - Before/after performance benchmarks
290
290
 
291
291
  ## Contributing
292
292
 
@@ -295,9 +295,8 @@ Contributions are welcome! Please feel free to submit a Pull Request.
295
295
  ## Known Limitations
296
296
 
297
297
  - Reserved URLs only work for first-level directories
298
- - Single index file name (no fallback array)
299
298
 
300
- See [DEBUG_REPORT.md](./DEBUG_REPORT.md) for technical details.
299
+ See [DEBUG_REPORT.md](./docs/DEBUG_REPORT.md) for technical details.
301
300
 
302
301
  ## License
303
302
 
@@ -313,8 +312,8 @@ See [CHANGELOG.md](./CHANGELOG.md)
313
312
 
314
313
  ## Links
315
314
 
316
- - [Full Documentation](./DOCUMENTATION.md)
317
- - [Debug Report](./DEBUG_REPORT.md)
315
+ - [Full Documentation](./docs/DOCUMENTATION.md)
316
+ - [Debug Report](./docs/DEBUG_REPORT.md)
318
317
  - [Changelog](./CHANGELOG.md)
319
318
  - [Repository](https://github.com/italopaesano/koa-classic-server)
320
319
  - [npm Package](https://www.npmjs.com/package/koa-classic-server)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koa-classic-server",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "High-performance Koa middleware for serving static files with Apache-like directory listing, HTTP caching, template engine support, and comprehensive security fixes",
5
5
  "main": "index.cjs",
6
6
  "exports": {
@@ -12,10 +12,10 @@
12
12
  "test": "jest",
13
13
  "test:security": "jest __tests__/security.test.js",
14
14
  "test:performance": "jest __tests__/performance.test.js --runInBand",
15
- "benchmark": "node benchmark.js",
16
- "benchmark:save": "node benchmark.js --save",
17
- "benchmark:setup": "node scripts/setup-benchmark.js",
18
- "loadConfig": "node ./customTest/loadConfig.util.js"
15
+ "benchmark": "node __tests__/benchmark.js",
16
+ "benchmark:save": "node __tests__/benchmark.js --save",
17
+ "benchmark:setup": "node __tests__/setup-benchmark.js",
18
+ "loadConfig": "node __tests__/customTest/loadConfig.util.js"
19
19
  },
20
20
  "keywords": [
21
21
  "koa",
package/CREATE_RELEASE.sh DELETED
@@ -1,53 +0,0 @@
1
- #!/bin/bash
2
- # Script per creare la release v1.2.0
3
-
4
- echo "🏷️ Creazione Release v1.2.0..."
5
-
6
- # Assicurati di essere sul branch principale
7
- echo "📥 Fetch delle ultime modifiche..."
8
- git fetch origin
9
-
10
- # Checkout al branch principale (prova main, poi master)
11
- if git show-ref --verify --quiet refs/remotes/origin/main; then
12
- echo "✅ Checkout a main..."
13
- git checkout main
14
- git pull origin main
15
- elif git show-ref --verify --quiet refs/remotes/origin/master; then
16
- echo "✅ Checkout a master..."
17
- git checkout master
18
- git pull origin master
19
- else
20
- echo "❌ Branch principale non trovato. Usa l'interfaccia GitHub."
21
- exit 1
22
- fi
23
-
24
- # Crea il tag
25
- echo "🏷️ Creazione tag v1.2.0..."
26
- git tag -a v1.2.0 -m "Release v1.2.0 - Critical Security Update
27
-
28
- ⚠️ CRITICAL SECURITY FIXES
29
-
30
- Security Fixes:
31
- - Fixed Path Traversal Vulnerability (CRITICAL)
32
- - Fixed Template Rendering Crash (CRITICAL)
33
-
34
- Bug Fixes:
35
- - HTTP Status Code 404 (HIGH)
36
- - Race Condition File Access (HIGH)
37
- - File Extension Extraction (HIGH)
38
- - Directory Read Errors (MEDIUM)
39
- - Content-Disposition Header (MEDIUM)
40
- - Code Quality & XSS Protection
41
-
42
- Statistics:
43
- - Security vulnerabilities: 2 critical fixed
44
- - Bugs fixed: 6
45
- - Tests: 71 passing
46
- - Documentation: 2000+ lines added"
47
-
48
- # Push del tag
49
- echo "📤 Push del tag a GitHub..."
50
- git push origin v1.2.0
51
-
52
- echo "✅ Tag creato! Ora vai su GitHub per creare la release:"
53
- echo " https://github.com/italopaesano/koa-classic-server/releases/new?tag=v1.2.0"
package/publish-to-npm.sh DELETED
@@ -1,65 +0,0 @@
1
- #!/bin/bash
2
- # Script per pubblicare koa-classic-server v1.2.0 su npm
3
-
4
- set -e # Exit on error
5
-
6
- echo "📦 Publishing koa-classic-server v1.2.0 to npm"
7
- echo ""
8
-
9
- # Verifica login
10
- echo "🔐 Verifying npm login..."
11
- if ! npm whoami > /dev/null 2>&1; then
12
- echo "❌ Not logged in to npm. Please run: npm login"
13
- exit 1
14
- fi
15
-
16
- echo "✅ Logged in as: $(npm whoami)"
17
- echo ""
18
-
19
- # Verifica versione
20
- echo "📋 Package info:"
21
- echo " Name: $(node -p "require('./package.json').name")"
22
- echo " Version: $(node -p "require('./package.json').version")"
23
- echo ""
24
-
25
- # Verifica che non ci siano modifiche non committate
26
- if [ -n "$(git status --porcelain)" ]; then
27
- echo "⚠️ Warning: You have uncommitted changes"
28
- git status --short
29
- read -p "Continue anyway? (y/N) " -n 1 -r
30
- echo
31
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
32
- exit 1
33
- fi
34
- fi
35
-
36
- # Dry run per vedere cosa verrà pubblicato
37
- echo "🔍 Files that will be published:"
38
- npm pack --dry-run | tail -20
39
- echo ""
40
-
41
- # Chiedi conferma
42
- read -p "🚀 Publish to npm? (y/N) " -n 1 -r
43
- echo
44
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
45
- echo "❌ Publish cancelled"
46
- exit 0
47
- fi
48
-
49
- # Pubblica
50
- echo "📤 Publishing to npm..."
51
- npm publish
52
-
53
- if [ $? -eq 0 ]; then
54
- echo ""
55
- echo "✅ Successfully published koa-classic-server@1.2.0!"
56
- echo ""
57
- echo "🔗 View on npm: https://www.npmjs.com/package/koa-classic-server"
58
- echo ""
59
- echo "📝 Users can now install with:"
60
- echo " npm install koa-classic-server@1.2.0"
61
- echo " npm install koa-classic-server@latest"
62
- else
63
- echo "❌ Publish failed"
64
- exit 1
65
- fi
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes