Skip to content

Commit be5c819

Browse files
authored
Merge pull request #139 from mi-examples/develop
Release: merge develop into main (0.18.1-beta.1 and accumulated work)
2 parents 003238b + 50c3359 commit be5c819

105 files changed

Lines changed: 2988 additions & 2698 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/dependabot.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
3+
- package-ecosystem: 'npm'
4+
directory: '/'
55
schedule:
6-
interval: "daily"
7-
- package-ecosystem: "docker"
8-
directory: "/"
6+
interval: 'daily'
7+
- package-ecosystem: 'docker'
8+
directory: '/'
99
schedule:
10-
interval: "daily"
10+
interval: 'daily'

‎.prettierignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
dist-zip
4+
coverage
5+
*.tgz
6+
tests/test-nextjs/.next

‎.prettierrc.cjs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
semi: true,
4+
singleQuote: true,
5+
trailingComma: 'all',
6+
printWidth: 120,
7+
};

‎BUILD_IMPROVEMENTS.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,53 @@ This document outlines the improvements made to the pp-dev package build system
55
## 🚀 Build Performance Improvements
66

77
### 1. Parallel Builds
8+
89
- **Before**: Sequential builds (ESM → CJS → Client)
910
- **After**: Parallel builds using `npm run build:parallel`
1011
- **Benefit**: ~40-60% faster build times
1112

1213
### 2. Enhanced Tree-Shaking
14+
1315
- Improved module side effects detection
1416
- Better property read side effects handling
1517
- Strict entry signature preservation
1618

1719
### 3. Optimized TypeScript Compilation
20+
1821
- Incremental compilation enabled
1922
- Build info caching with `.tsbuildinfo`
2023
- Optimized dependency change detection
2124

2225
## 📦 Build Outputs
2326

2427
### ESM Build (`dist/esm/`)
28+
2529
- Modern ES modules format
2630
- Optimized for tree-shaking
2731
- Source maps included
2832

2933
### CJS Build (`dist/cjs/`)
34+
3035
- CommonJS format for Node.js compatibility
3136
- Optimized for server-side usage
3237
- Source maps included
3338

3439
### Type Definitions (`dist/types/`)
40+
3541
- Full TypeScript declarations
3642
- Declaration maps for better IDE support
3743
- Clean, optimized type output
3844

3945
### Client Build (`dist/client/`)
46+
4047
- Optimized CSS with SCSS compilation
4148
- Asset handling with proper public paths
4249
- Source maps for debugging
4350

4451
## 🛠️ Build Scripts
4552

4653
### Production Builds
54+
4755
```bash
4856
# Standard build (parallel)
4957
npm run build
@@ -56,6 +64,7 @@ npm run clean && npm run build
5664
```
5765

5866
### Development Builds
67+
5968
```bash
6069
# Fast build (parallel)
6170
npm run build:fast
@@ -68,6 +77,7 @@ npm run build:analyze
6877
```
6978

7079
### Optimization
80+
7181
```bash
7282
# Run build optimizations
7383
npm run build:optimize
@@ -79,12 +89,14 @@ npm run build:optimize
7989
## ⚡ Build Tools
8090

8191
### Rollup (Primary)
92+
8293
- Advanced tree-shaking
8394
- Plugin ecosystem
8495
- Source map generation
8596
- Bundle analysis support
8697

8798
### Rollup (Primary)
99+
88100
- Advanced tree-shaking
89101
- Plugin ecosystem
90102
- Source map generation
@@ -101,17 +113,20 @@ The build system includes bundle analysis capabilities:
101113
## 🔧 Configuration Files
102114

103115
### Rollup Config (`rollup.config.ts`)
116+
104117
- Multi-format builds (ESM, CJS, Types)
105118
- Optimized external dependency handling
106119
- Enhanced terser configuration
107120
- Better source map generation
108121

109122
### Esbuild Config (`esbuild.config.ts`)
123+
110124
- Alternative build system for experimentation
111125
- Simplified TypeScript builds
112126
- Build metadata generation
113127

114128
### TypeScript Configs
129+
115130
- `tsconfig.json` - Base configuration
116131
- `tsconfig.esm.json` - ESM-specific settings
117132
- `tsconfig.cjs.json` - CJS-specific settings
@@ -120,40 +135,47 @@ The build system includes bundle analysis capabilities:
120135
## 📈 Performance Metrics
121136

122137
### Build Times (approximate)
138+
123139
- **Before**: ~15-20 seconds
124140
- **After (Rollup)**: ~8-12 seconds
125141
- **After (Parallel)**: ~5-8 seconds
126142

127143
### Bundle Sizes
144+
128145
- Optimized tree-shaking reduces bundle size by 15-25%
129146
- Better external dependency handling
130147
- Improved code splitting
131148

132149
## 🎯 Best Practices
133150

134151
### For Development
152+
135153
1. Use `npm run build:fast` for quick iterations
136154
2. Use `npm run build:watch` for continuous builds
137155
3. Run `npm run build:optimize` to apply optimizations
138156

139157
### For Production
158+
140159
1. Use `npm run build` for full builds
141160
2. Run `npm run build:analyze` to check bundle sizes
142161
3. Verify all formats are generated correctly
143162

144163
### For CI/CD
164+
145165
1. Use `npm run build:parallel` for faster CI builds
146166
2. Include bundle analysis in release process
147167
3. Monitor build performance metrics
148168

149169
## 🔍 Troubleshooting
150170

151171
### Common Issues
172+
152173
1. **Build failures**: Check TypeScript configuration
153174
2. **Slow builds**: Ensure parallel builds are enabled
154175
3. **Large bundles**: Run bundle analysis to identify issues
155176

156177
### Performance Issues
178+
157179
1. **Memory usage**: Monitor Node.js memory limits
158180
2. **CPU usage**: Check for unnecessary TypeScript compilation
159181
3. **Disk I/O**: Ensure SSD storage for faster builds

0 commit comments

Comments
 (0)