@fynd-design-engineering/fynd-one-v2
v3.4.1
Published
Updated CDN for fynd.com
Keywords
Readme
Fynd one CDN
All custom code used in fynd one project
✨ Features
- 🔧 Modern TypeScript Setup - Full TypeScript support with strict type checking
- ⚡ Lightning Fast Builds - Powered by esbuild for instant compilation
- 🔄 Live Development - Hot reloading for instant feedback during development
- 📦 Optimized Production Builds - Minified, tree-shaken, and ES2020-compatible output
- 🧪 Automated Testing - End-to-end testing with Playwright
- 📏 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 with live reloading:
pnpm devWhat happens:
- 📦 Bundles TypeScript files in real-time
- 🌐 Serves files at
http://localhost:3000 - 🔄 Automatically reloads on file changes
- 🗺️ 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
🧪 Testing & Quality Assurance
Running Tests
Execute end-to-end tests with Playwright:
# Run tests in headless mode
pnpm test
# Interactive test runner with UI
pnpm test:uiCode 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 check📦 Release 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 update📁 Project Architecture
cdn-starter/
├── 📂 src/
│ ├── 📄 index.ts # Main entry point
│ └── 📂 utils/ # Utility functions
│ └── 📄 *.ts # Your utility modules
├── 📂 dist/ # 🏗️ Build output (auto-generated)
├── 📂 tests/ # 🧪 Playwright test files
│ └── 📄 example.spec.ts # Example test file
├── 📂 bin/ # 🔧 Build tools
│ ├── 📄 build.js # esbuild configuration
│ └── 📄 live-reload.js # Development hot reload script
├── 📄 package.json # Project configuration
├── 📄 tsconfig.json # TypeScript settings
├── 📄 eslint.config.js # ESLint rules
├── 📄 playwright.config.ts # Test configuration
└── 📄 README.md # This file🛤️ Advanced 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 test && 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 checkLive reload not working:
- Ensure port 3000 is available
- Check browser console for WebSocket connection errors
- Verify firewall settings
📄 License
This project is licensed under the ISC License.
