@rtstic.dev/pulse 0.0.1
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 +330 -0
- package/dist/index.js +8290 -0
- package/dist/index.js.map +7 -0
- package/dist/lenis.js +1 -0
- package/dist/lenis.js.map +7 -0
- package/dist/scroll.js +43 -0
- package/dist/scroll.js.map +7 -0
- package/dist/spline.js +8250 -0
- package/dist/spline.js.map +7 -0
- package/dist/styles.css +1 -0
- package/dist/styles.css.map +7 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# CDN-Starter
|
|
2
|
+
|
|
3
|
+
A modern, production-ready starter template for building custom JavaScript/TypeScript code for Webflow projects. Streamline your development workflow with TypeScript, automated builds, and comprehensive code quality tools.
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/ISC)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://pnpm.io/)
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **π§ Modern TypeScript Setup** - Full TypeScript support with strict type checking
|
|
12
|
+
- **β‘ Lightning Fast Builds** - Powered by esbuild for instant compilation
|
|
13
|
+
- **π¦ Optimized Production Builds** - Minified, tree-shaken, and ES2020-compatible output
|
|
14
|
+
- **π Code Quality** - ESLint, Prettier, and TypeScript integration
|
|
15
|
+
- **π― Path Aliases** - Clean imports with custom path mappings
|
|
16
|
+
- **π Changesets** - Automated versioning and changelog generation
|
|
17
|
+
- **π Webflow Ready** - Optimized for Webflow custom code integration
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### Prerequisites
|
|
22
|
+
|
|
23
|
+
Ensure you have the following installed:
|
|
24
|
+
|
|
25
|
+
- **Node.js** (v18.0.0 or higher) - [Download here](https://nodejs.org/)
|
|
26
|
+
- **pnpm** (v10.0.0 or higher) - [Install guide](https://pnpm.io/installation)
|
|
27
|
+
|
|
28
|
+
### Installation
|
|
29
|
+
|
|
30
|
+
1. **Create a new repository from this template**
|
|
31
|
+
|
|
32
|
+
[π Use this template](https://github.com/Fynd-Design-Engineering/CDN-Starter)
|
|
33
|
+
|
|
34
|
+
> **Note:** You must be authenticated with a Fynd Design Engineering GitHub account
|
|
35
|
+
|
|
36
|
+
2. **Clone and install dependencies**
|
|
37
|
+
After creating a project with above template install all dependencies using pnpm
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3. **Start developing**
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm dev
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Open [http://localhost:3000](http://localhost:3000) to see your project in action!
|
|
50
|
+
|
|
51
|
+
## Development Workflow
|
|
52
|
+
|
|
53
|
+
### Development Mode
|
|
54
|
+
|
|
55
|
+
Launch the development server:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pnpm dev
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**What happens:**
|
|
62
|
+
|
|
63
|
+
- π¦ Bundles TypeScript files in real-time
|
|
64
|
+
- π Serves files at `http://localhost:3000`
|
|
65
|
+
- πΊοΈ Generates source maps for debugging
|
|
66
|
+
- π Displays a helpful table of served files with import suggestions
|
|
67
|
+
|
|
68
|
+
### Production Build
|
|
69
|
+
|
|
70
|
+
Create an optimized build for deployment:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pnpm build
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Build optimizations:**
|
|
77
|
+
|
|
78
|
+
- ποΈ Code minification and compression
|
|
79
|
+
- π³ Tree shaking to remove unused code
|
|
80
|
+
- π― ES2020 target for broad browser compatibility
|
|
81
|
+
- π Clean output in the `dist/` directory
|
|
82
|
+
|
|
83
|
+
## Code Quality
|
|
84
|
+
|
|
85
|
+
### Code Linting
|
|
86
|
+
|
|
87
|
+
Maintain code quality with ESLint:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Check for issues
|
|
91
|
+
pnpm lint
|
|
92
|
+
|
|
93
|
+
# Auto-fix common problems
|
|
94
|
+
pnpm lint:fix
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Code Formatting
|
|
98
|
+
|
|
99
|
+
Keep code consistent with Prettier:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
pnpm format
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Type Checking
|
|
106
|
+
|
|
107
|
+
Verify TypeScript types:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pnpm check
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Release Management
|
|
114
|
+
|
|
115
|
+
This project uses [Changesets](https://github.com/changesets/changesets) for professional version management.
|
|
116
|
+
|
|
117
|
+
### Creating a Release
|
|
118
|
+
|
|
119
|
+
1. **Work on your feature branch** (never commit directly to `main`)
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
git checkout -b feature/your-feature-name
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
2. **Make your changes and build**
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
pnpm build
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
3. **Create a changeset**
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pnpm changeset
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Follow the prompts to:
|
|
138
|
+
|
|
139
|
+
- Select which packages changed
|
|
140
|
+
- Choose the semantic version bump (patch/minor/major)
|
|
141
|
+
- Write a clear summary of changes
|
|
142
|
+
|
|
143
|
+
4. **Commit your changes**
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
git add .
|
|
147
|
+
git commit -m "feat: add your feature description"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
5. **Publish the release**
|
|
151
|
+
```bash
|
|
152
|
+
pnpm release
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Dependency Management
|
|
156
|
+
|
|
157
|
+
Keep dependencies up-to-date:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
pnpm update
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Project Architecture
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
cdn-starter/
|
|
167
|
+
βββ π src/
|
|
168
|
+
β βββ π index.ts # Main entry point
|
|
169
|
+
β βββ π utils/ # Utility functions
|
|
170
|
+
β βββ π *.ts # Your utility modules
|
|
171
|
+
βββ π dist/ # ποΈ Build output (auto-generated)
|
|
172
|
+
βββ π bin/ # π§ Build tools
|
|
173
|
+
β βββ π build.js # esbuild configuration
|
|
174
|
+
βββ π package.json # Project configuration
|
|
175
|
+
βββ π tsconfig.json # TypeScript settings
|
|
176
|
+
βββ π eslint.config.js # ESLint rules
|
|
177
|
+
βββ π README.md # This file
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Advanced Configuration
|
|
181
|
+
|
|
182
|
+
### Multiple Entry Points
|
|
183
|
+
|
|
184
|
+
Build multiple files by updating `bin/build.js`:
|
|
185
|
+
|
|
186
|
+
```javascript
|
|
187
|
+
const ENTRY_POINTS = [
|
|
188
|
+
"src/home/index.ts", // β dist/home/index.js
|
|
189
|
+
"src/contact/form.ts", // β dist/contact/form.js
|
|
190
|
+
"src/shared/utils.ts", // β dist/shared/utils.js
|
|
191
|
+
];
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Path Aliases
|
|
195
|
+
|
|
196
|
+
Use clean imports with pre-configured aliases:
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
// β Avoid relative paths
|
|
200
|
+
import { helper } from "../../utils/helper";
|
|
201
|
+
|
|
202
|
+
// β
Use clean path aliases
|
|
203
|
+
import { helper } from "$utils/helper";
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Available aliases:**
|
|
207
|
+
|
|
208
|
+
- `$utils/*` β `src/utils/*`
|
|
209
|
+
|
|
210
|
+
Add more in `tsconfig.json`:
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"compilerOptions": {
|
|
215
|
+
"paths": {
|
|
216
|
+
"$utils/*": ["src/utils/*"],
|
|
217
|
+
"$components/*": ["src/components/*"],
|
|
218
|
+
"$types/*": ["src/types/*"]
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Webflow Integration
|
|
225
|
+
|
|
226
|
+
### Development Integration
|
|
227
|
+
|
|
228
|
+
For testing in Webflow during development:
|
|
229
|
+
|
|
230
|
+
1. Start the dev server: `pnpm dev`
|
|
231
|
+
2. Use the development URLs in Webflow:
|
|
232
|
+
```html
|
|
233
|
+
<script defer src="http://localhost:3000/index.js"></script>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Production Deployment
|
|
237
|
+
|
|
238
|
+
1. **Build your project**
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
pnpm build
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
2. **Upload to your CDN**
|
|
245
|
+
Upload files from the `dist/` directory to your preferred CDN (Cloudflare, AWS CloudFront, etc.)
|
|
246
|
+
|
|
247
|
+
3. **Include in Webflow**
|
|
248
|
+
Run this to get the generated cdn links with the latest version available
|
|
249
|
+
```bash
|
|
250
|
+
pnpm cdn
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Best Practices for Webflow
|
|
254
|
+
|
|
255
|
+
- **Use `defer`** for non-critical scripts
|
|
256
|
+
- **Minimize HTTP requests** by bundling related functionality
|
|
257
|
+
- **Test thoroughly** across different Webflow templates
|
|
258
|
+
- **Use semantic versioning** for cache busting
|
|
259
|
+
|
|
260
|
+
## Contributing
|
|
261
|
+
|
|
262
|
+
We welcome contributions! Please follow these guidelines:
|
|
263
|
+
|
|
264
|
+
1. **Fork the repository**
|
|
265
|
+
2. **Create a feature branch**
|
|
266
|
+
```bash
|
|
267
|
+
git checkout -b feature/amazing-feature
|
|
268
|
+
```
|
|
269
|
+
3. **Make your changes** following our code standards
|
|
270
|
+
4. **Run quality checks**
|
|
271
|
+
```bash
|
|
272
|
+
pnpm lint && pnpm check
|
|
273
|
+
```
|
|
274
|
+
5. **Add a changeset**
|
|
275
|
+
```bash
|
|
276
|
+
pnpm changeset
|
|
277
|
+
```
|
|
278
|
+
6. **Commit with conventional commits**
|
|
279
|
+
```bash
|
|
280
|
+
git commit -m "feat: add amazing feature"
|
|
281
|
+
```
|
|
282
|
+
7. **Push and create a Pull Request**
|
|
283
|
+
|
|
284
|
+
### Commit Convention
|
|
285
|
+
|
|
286
|
+
We follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
287
|
+
|
|
288
|
+
- `feat:` New features
|
|
289
|
+
- `fix:` Bug fixes
|
|
290
|
+
- `docs:` Documentation changes
|
|
291
|
+
- `style:` Code style changes
|
|
292
|
+
- `refactor:` Code refactoring
|
|
293
|
+
- `test:` Test additions or changes
|
|
294
|
+
- `chore:` Maintenance tasks
|
|
295
|
+
|
|
296
|
+
## Performance Tips
|
|
297
|
+
|
|
298
|
+
- **Bundle analysis**: Use esbuild's metafile option for bundle analysis
|
|
299
|
+
- **Code splitting**: Consider splitting large applications into multiple entry points
|
|
300
|
+
- **Tree shaking**: Write ES modules to enable automatic dead code elimination
|
|
301
|
+
- **Compression**: Enable gzip/brotli compression on your CDN
|
|
302
|
+
|
|
303
|
+
## Troubleshooting
|
|
304
|
+
|
|
305
|
+
### Common Issues
|
|
306
|
+
|
|
307
|
+
**Build failures:**
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Clear node_modules and reinstall
|
|
311
|
+
rm -rf node_modules pnpm-lock.yaml
|
|
312
|
+
pnpm install
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**TypeScript errors:**
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# Check your tsconfig.json configuration
|
|
319
|
+
pnpm check
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
## License
|
|
323
|
+
|
|
324
|
+
This project is licensed under the [ISC License](https://opensource.org/licenses/ISC).
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
<div align="center">
|
|
329
|
+
<sub>Built with β€οΈ by Raimon at Fynd</sub>
|
|
330
|
+
</div>
|