A pnpm monorepo containing client-side scripts and React components for Webflow University.
TypeScript code that compiles to JavaScript and is served via jsdelivr from GitHub. These scripts power UI functionality on the website.
Usage:
<!-- Use major version (e.g., @2) for auto-updates within same major version -->
<script
defer
src="https://cdn.jsdelivr.net/gh/webflow/webflow-university@2/packages/scripts/dist/index.js"
></script>
<!-- Or pin to specific version (e.g., @2.1.0) -->
<script
defer
src="https://cdn.jsdelivr.net/gh/webflow/webflow-university@2.1.0/packages/scripts/dist/index.js"
></script>A Vite React project for Webflow code components. These components are imported into Webflow using their CLI tool.
Usage:
npx webflow library share- Node.js 20+
- pnpm 10.20.0+
# Install dependencies for all packages
pnpm install# Run scripts package in dev mode (with live reload)
pnpm dev:scripts
# Run code-components in dev mode
pnpm dev:components
# Build all packages
pnpm build
# Build specific package
pnpm build:scripts
pnpm build:components# Lint all packages
pnpm lint
# Fix linting issues
pnpm lint:fix
# Type check all packages
pnpm check
# Format code
pnpm formatThis monorepo uses Changesets for semantic versioning (e.g., 1.0.0, 1.1.0, 2.0.0).
Why semantic versioning?
- Clear versioning scheme (major.minor.patch)
- jsdelivr supports version tags (
@2,@2.1.0,@v2.1.0) - Easy to pin to specific versions or allow minor/patch updates
- Industry standard
When you make changes that should trigger a version bump:
pnpm changesetThis will:
- Ask which packages should be bumped
- Ask what kind of change (major, minor, patch)
- Create a changeset file in
.changeset/
After creating changesets, version the packages:
pnpm changeset:versionThis will:
- Update package versions based on changesets
- Update changelogs
- Remove used changeset files
The release process is automated via GitHub Actions. When you merge to main:
- If there are changesets, a PR will be created to version packages
- Once merged, a GitHub release will be created
- The scripts package will be built and artifacts uploaded
Manual release (if needed):
pnpm release- Create a feature branch
- Make your changes
- Run
pnpm lintandpnpm checkbefore committing - Create a changeset if version bump is needed:
pnpm changeset - Push and create a PR
The scripts package is automatically deployed via jsdelivr when:
- Code is pushed to
mainbranch - A GitHub release is created
To deploy a specific version:
- Create a changeset for the scripts package
- Merge the version PR
- The GitHub Action will create a release
- Use the jsdelivr URL with the commit hash or tag
Get deployment info:
node scripts/deploy-info.js- Make changes in
packages/code-components - Build:
pnpm build:components - Share with Webflow:
npx webflow library share - The built components will be available in Webflow
webflow-university/
βββ packages/
β βββ scripts/ # Client-side scripts (TypeScript β JavaScript)
β β βββ src/ # Source TypeScript files
β β βββ dist/ # Compiled JavaScript (git-ignored)
β β βββ bin/ # Build scripts
β βββ code-components/ # React components for Webflow
β βββ src/ # React component source
β βββ dist/ # Built components (git-ignored)
βββ .github/
β βββ workflows/ # GitHub Actions workflows
βββ .changeset/ # Changeset files
βββ scripts/ # Utility scripts
- Runs on every PR and push to main
- Lints and type-checks all packages
- Builds all packages to ensure they compile
- Runs on push to main
- Creates version PRs if changesets exist
- Publishes packages
- Creates GitHub releases
- Uploads build artifacts
- Runs on changes to scripts package
- Builds and uploads scripts artifacts
pnpm build- Build all packagespnpm build:scripts- Build scripts package onlypnpm build:components- Build code-components onlypnpm dev:scripts- Dev mode for scripts (with live reload)pnpm dev:components- Dev mode for code-componentspnpm lint- Lint all packagespnpm lint:fix- Fix linting issuespnpm check- Type check all packagespnpm format- Format all codepnpm changeset- Create a new changesetpnpm changeset:version- Version packages based on changesetspnpm release- Version and build packagespnpm clean- Clean build artifactspnpm clean:all- Clean everything including node_modules
pnpm --filter scripts dev- Development modepnpm --filter scripts build- Production buildpnpm --filter scripts lint- Lint scripts
pnpm --filter code-components dev- Development serverpnpm --filter code-components build- Production buildpnpm --filter code-components preview- Preview production build
The scripts package is served via jsdelivr. The dist/ folder is committed to git so jsdelivr can serve the files directly from GitHub.
Recommended URL patterns:
By semantic version (recommended):
<!-- Major version - auto-updates for minor/patch releases -->
<script
defer
src="https://cdn.jsdelivr.net/gh/OWNER/REPO@2/packages/scripts/dist/index.js"
></script>
<!-- Specific version - pinned -->
<script
defer
src="https://cdn.jsdelivr.net/gh/OWNER/REPO@2.1.0/packages/scripts/dist/index.js"
></script>
<!-- With 'v' prefix (also works) -->
<script
defer
src="https://cdn.jsdelivr.net/gh/OWNER/REPO@v2.1.0/packages/scripts/dist/index.js"
></script>Other options:
<!-- From branch (for development/testing) -->
<script
defer
src="https://cdn.jsdelivr.net/gh/OWNER/REPO@main/packages/scripts/dist/index.js"
></script>
<!-- Specific commit (for debugging) -->
<script
defer
src="https://cdn.jsdelivr.net/gh/OWNER/REPO@abc1234/packages/scripts/dist/index.js"
></script>Run node scripts/deploy-info.js to get the exact URLs for your current setup.
For a complete step-by-step walkthrough, see DEPLOYMENT_WALKTHROUGH.md.
TL;DR:
- Make changes β
pnpm build:scriptsβpnpm changesetβ commit β PR β merge - Version PR created automatically β merge it
- Release created automatically β use jsdelivr URL with new version
-
Create a branch:
git checkout -b feature/my-feature
-
Make your changes in the appropriate package(s)
-
Test locally:
pnpm build pnpm lint pnpm check
-
Create a changeset if needed:
pnpm changeset
-
Commit and push:
git add . git commit -m "feat: add new feature" git push origin feature/my-feature
-
Create a PR on GitHub
- CI will automatically run linting, type checking, and builds
- Review the changes
- If changesets are included, review the version bump
- Merge when ready
- If changesets exist, a version PR will be created automatically
- Review and merge the version PR
- GitHub Actions will create a release
- Scripts will be available via jsdelivr
# Clean and rebuild
pnpm clean
pnpm install
pnpm build# Clean everything and reinstall
pnpm clean:all
pnpm installIf changesets aren't working:
- Check
.changeset/config.jsonexists - Ensure you're on the
mainbranch when versioning - Check that changeset files are in
.changeset/directory