@rtstic.dev/pulse
v0.0.15
Published
pulse website
Readme
CDN-Starter
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.
Features
- 🔧 Modern TypeScript Setup - Full TypeScript support with strict type checking
- ⚡ Lightning Fast Builds - Powered by esbuild for instant compilation
- 📦 Optimized Production Builds - Minified, tree-shaken, and ES2020-compatible output
- 📏 Code Quality - ESLint, Prettier, and TypeScript integration
- 🎯 Path Aliases - Clean imports with custom path mappings
- 📋 Changesets - Automated versioning and changelog generation
- 🌐 Webflow Ready - Optimized for Webflow custom code integration
Quick Start
Prerequisites
Ensure you have the following installed:
- Node.js (v18.0.0 or higher) - Download here
- pnpm (v10.0.0 or higher) - Install guide
Installation
Create a new repository from this template
Note: You must be authenticated with a Fynd Design Engineering GitHub account
Clone and install dependencies After creating a project with above template install all dependencies using pnpm
pnpm installStart developing
pnpm devOpen http://localhost:3000 to see your project in action!
Development Workflow
Development Mode
Launch the development server:
pnpm devWhat happens:
- 📦 Bundles TypeScript files in real-time
- 🌐 Serves files at
http://localhost:3000 - 🗺️ Generates source maps for debugging
- 📊 Displays a helpful table of served files with import suggestions
Production Build
Create an optimized build for deployment:
pnpm buildBuild optimizations:
- 🗜️ Code minification and compression
- 🌳 Tree shaking to remove unused code
- 🎯 ES2020 target for broad browser compatibility
- 📁 Clean output in the
dist/directory
Code Quality
Code Linting
Maintain code quality with ESLint:
# Check for issues
pnpm lint
# Auto-fix common problems
pnpm lint:fixCode Formatting
Keep code consistent with Prettier:
pnpm formatType Checking
Verify TypeScript types:
pnpm checkRelease Management
This project uses Changesets for professional version management.
Creating a Release
Work on your feature branch (never commit directly to
main)git checkout -b feature/your-feature-nameMake your changes and build
pnpm buildCreate a changeset
pnpm changesetFollow the prompts to:
- Select which packages changed
- Choose the semantic version bump (patch/minor/major)
- Write a clear summary of changes
Commit your changes
git add . git commit -m "feat: add your feature description"Publish the release
pnpm release
Dependency Management
Keep dependencies up-to-date:
pnpm updateProject Architecture
cdn-starter/
├── 📂 src/
│ ├── 📄 index.ts # Main entry point
│ └── 📂 utils/ # Utility functions
│ └── 📄 *.ts # Your utility modules
├── 📂 dist/ # 🏗️ Build output (auto-generated)
├── 📂 bin/ # 🔧 Build tools
│ └── 📄 build.js # esbuild configuration
├── 📄 package.json # Project configuration
├── 📄 tsconfig.json # TypeScript settings
├── 📄 eslint.config.js # ESLint rules
└── 📄 README.md # This fileAdvanced Configuration
Multiple Entry Points
Build multiple files by updating bin/build.js:
const ENTRY_POINTS = [
"src/home/index.ts", // → dist/home/index.js
"src/contact/form.ts", // → dist/contact/form.js
"src/shared/utils.ts", // → dist/shared/utils.js
];Path Aliases
Use clean imports with pre-configured aliases:
// ❌ Avoid relative paths
import { helper } from "../../utils/helper";
// ✅ Use clean path aliases
import { helper } from "$utils/helper";Available aliases:
$utils/*→src/utils/*
Add more in tsconfig.json:
{
"compilerOptions": {
"paths": {
"$utils/*": ["src/utils/*"],
"$components/*": ["src/components/*"],
"$types/*": ["src/types/*"]
}
}
}Webflow Integration
Development Integration
For testing in Webflow during development:
- Start the dev server:
pnpm dev - Use the development URLs in Webflow:
<script defer src="http://localhost:3000/index.js"></script>
Production Deployment
Build your project
pnpm buildUpload to your CDN Upload files from the
dist/directory to your preferred CDN (Cloudflare, AWS CloudFront, etc.)Include in Webflow Run this to get the generated cdn links with the latest version available
pnpm cdn
Best Practices for Webflow
- Use
deferfor non-critical scripts - Minimize HTTP requests by bundling related functionality
- Test thoroughly across different Webflow templates
- Use semantic versioning for cache busting
Contributing
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature - Make your changes following our code standards
- Run quality checks
pnpm lint && pnpm check - Add a changeset
pnpm changeset - Commit with conventional commits
git commit -m "feat: add amazing feature" - Push and create a Pull Request
Commit Convention
We follow Conventional Commits:
feat:New featuresfix:Bug fixesdocs:Documentation changesstyle:Code style changesrefactor:Code refactoringtest:Test additions or changeschore:Maintenance tasks
Performance Tips
- Bundle analysis: Use esbuild's metafile option for bundle analysis
- Code splitting: Consider splitting large applications into multiple entry points
- Tree shaking: Write ES modules to enable automatic dead code elimination
- Compression: Enable gzip/brotli compression on your CDN
Troubleshooting
Common Issues
Build failures:
# Clear node_modules and reinstall
rm -rf node_modules pnpm-lock.yaml
pnpm installTypeScript errors:
# Check your tsconfig.json configuration
pnpm checkLicense
This project is licensed under the ISC License.
