cloudflare/kumo

Public

mirrored fromhttps://github.com/cloudflare/kumoAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
5260f1a5703bb69e6c7f7cf0ce8033a561cac8b5

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

packages/kumo-figma/src/build.sh

38lines · modecode

1#!/bin/bash
2# Build script for Kumo Figma Plugin
3#
4# Figma's plugin runtime uses an older JavaScript engine that doesn't support:
5# - Nullish coalescing (??)
6# - Optional chaining (?.)
7# - Some ES2020+ features
8#
9# We target ES2017 to ensure compatibility.
10
11set -e
12
13SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14FIGMA_PKG_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
15
16echo "Building Kumo Figma Plugin..."
17
18# Generate theme data from CSS source files (MUST run first)
19echo "🎨 Generating theme data from CSS..."
20cd "$SCRIPT_DIR"
21npx tsx build-theme-data.ts
22
23# Generate icon and loader data from source files
24echo "📖 Generating icon data..."
25npx tsx build-icon-data.ts 2>/dev/null || echo "⚠️ Icon data generation skipped (may already exist)"
26
27echo "📖 Generating loader data..."
28npx tsx build-loader-data.ts 2>/dev/null || echo "⚠️ Loader data generation skipped (may already exist)"
29
30cd "$FIGMA_PKG_DIR"
31pnpm exec esbuild "$SCRIPT_DIR/code.ts" \
32 --bundle \
33 --outfile="$SCRIPT_DIR/code.js" \
34 --format=iife \
35 --target=es2017 \
36 --log-level=info
37
38echo "✅ Build complete: $SCRIPT_DIR/code.js"
39