How vapor/design works
Project type and purpose
• This is a design-system + static-site generation project. It bundles:
• A CSS/JS asset pipeline (Sass, Webpack, NPM scripts)
• A Swift library (VaporDesign) of Publish components for generating HTML
• A demo/design site that uses both pipelines, and finally deploys assets to a CDN
File structure
• Top-level build/config files:
• .github/workflows/ci.yml, deploy.yml – GitHub Actions for CI, build and deploy
• webpack.config.js, package.json/package-lock.json, stack.yml – NPM and Webpack config
• Package.swift, Sources/ – Swift package for the VaporDesign library and demo site
• Content directories:
• src/ – source SCSS, JS, images for the asset pipeline
• static/ – prebuilt static files (zip packages, favicons, additional JS)
• Content/ – placeholder for Publish content (demo markdown)
• Output directory (implicit, usually Output/) is generated by the pipelines
README insights
• Two main build steps:
1. npm install && npm run build – compiles SCSS to CSS, bundles JS, copies static files
2. swift run && npm start – generates HTML via Publish + VaporDesign, then rebuilds assets
• Final site is hosted at https://design.vapor.codes on a CDN
Elements
• Commit → CI
• CI → Asset Builder → Output/assets
• CI → Swift Generator → Output/html
• Output → Deploy → CDN
• Browser → CDN (fetch assets + HTML)
• Blue for code repositories & source folders
• Green for build processes (NPM, Webpack, Swift)
• Orange for outputs (compiled files, HTML)
• Purple for deployment target (CDN)