How aziontech/lib works
Project type and purpose
• Project type: A monorepo‐style open-source toolkit (NPM packages) for interacting with the Azion Edge platform.
• Purpose: Provide libraries (Storage, SQL, Purge, Applications, Domains, Cookies, JWT, AI, etc.), a unified client façade, build/config presets, and utility modules—usable both inside the Azion Runtime (using internal hooks & polyfills) and outside via REST APIs.
File structure
• Root–level
– CI/CD config (.github/workflows, scripts/)
– Linting & formatting (.eslintrc, .prettierrc, commit hooks)
– tsup.config.json, tsconfig.json for build & TS settings
• packages/
– Core/Facade
• client: exposes createClient() → unifies all services
• config & types: shared configuration processor and TS types
– Service Packages
• storage, sql, purge, domains, applications, ai
– Each has src/services/api (REST wrappers) and src/services/runtime (Azion Runtime hooks)
– Utilities & Plugins
• cookies, jwt, router, utils
– Build & Bundling
• bundler: esbuild & webpack plugin architecture + polyfills for Azion runtime
• presets: preset definitions for frameworks (Next.js, React, Vue, etc.)
• unenv-preset & wasm-image-processor: runtime polyfills & asset processing
Key README insights
• Dual-mode operation: inside Azion Runtime (runtime hooks, polyfills) vs. outside (REST API calls).
• Unified client façade (createClient) on top of individual package functions.
• Config library: defineConfig → validates and composes build/domain/origin/cache/rules/purge/networkList/firewall/WAF.
• Preset/plugin pattern for framework-specific build and handler logic.