Text Generation
sentence-transformers
English
rag
retrieval-augmented-generation
fastapi
react
chromadb
banking
document-intelligence
vector-search
Instructions to use thilakx/Bankoflibreo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use thilakx/Bankoflibreo with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("thilakx/Bankoflibreo") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub (part 11)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +1 -0
- LICENSE +21 -0
- README.md +201 -0
- Skill.md/# RAG Workflow.txt +114 -0
- Sound/the sound for caht send.mp3 +0 -0
- System design/flow diagaram.webp +0 -0
- Ui info.md/DESIGN.md +181 -0
- Ui info.md/code.html +208 -0
- Ui info.md/screen.png +3 -0
- frontend/README.md +16 -0
- frontend/node_modules/react-dom/LICENSE +21 -0
- frontend/node_modules/react-dom/README.md +60 -0
- frontend/node_modules/react-dom/client.react-server.js +5 -0
- frontend/node_modules/react-dom/index.js +38 -0
- frontend/node_modules/react-dom/package.json +117 -0
- frontend/node_modules/react-dom/profiling.js +38 -0
- frontend/node_modules/react-dom/profiling.react-server.js +5 -0
- frontend/node_modules/react-dom/react-dom.react-server.js +7 -0
- frontend/node_modules/react-dom/server.browser.js +16 -0
- frontend/node_modules/react-dom/server.bun.js +17 -0
- frontend/node_modules/react-dom/server.edge.js +17 -0
- frontend/node_modules/react-dom/server.js +3 -0
- frontend/node_modules/react-dom/server.node.js +18 -0
- frontend/node_modules/react-dom/server.react-server.js +5 -0
- frontend/node_modules/react-dom/static.browser.js +12 -0
- frontend/node_modules/react-dom/static.edge.js +12 -0
- frontend/node_modules/react-dom/static.js +3 -0
- frontend/node_modules/react-dom/static.node.js +14 -0
- frontend/node_modules/react-dom/static.react-server.js +5 -0
- frontend/node_modules/react-dom/test-utils.js +7 -0
- frontend/node_modules/rolldown/LICENSE +25 -0
- frontend/node_modules/rolldown/README.md +11 -0
- frontend/node_modules/rolldown/THIRD-PARTY-LICENSE +33 -0
- frontend/node_modules/rolldown/bin/cli.mjs +2 -0
- frontend/node_modules/rolldown/dist/cli.d.mts +1 -0
- frontend/node_modules/rolldown/dist/cli.mjs +1208 -0
- frontend/node_modules/rolldown/dist/config.d.mts +26 -0
- frontend/node_modules/rolldown/dist/config.mjs +4 -0
- frontend/node_modules/rolldown/dist/experimental-default-runtime.mjs +116 -0
- frontend/node_modules/rolldown/dist/experimental-index.d.mts +295 -0
- frontend/node_modules/rolldown/dist/experimental-index.mjs +356 -0
- frontend/node_modules/rolldown/dist/experimental-runtime-base.mjs +95 -0
- frontend/node_modules/rolldown/dist/experimental-runtime-types.d.ts +177 -0
- frontend/node_modules/rolldown/dist/experimental-runtime.d.ts +177 -0
- frontend/node_modules/rolldown/dist/experimental-runtime.mjs +257 -0
- frontend/node_modules/rolldown/dist/filter-index.d.mts +196 -0
- frontend/node_modules/rolldown/dist/filter-index.mjs +378 -0
- frontend/node_modules/rolldown/dist/get-log-filter.d.mts +3 -0
- frontend/node_modules/rolldown/dist/get-log-filter.mjs +68 -0
- frontend/node_modules/rolldown/dist/index.d.mts +4 -0
.gitattributes
CHANGED
|
@@ -43,3 +43,4 @@ frontend/node_modules/@rolldown/binding-win32-x64-msvc/rolldown-binding.win32-x6
|
|
| 43 |
frontend/node_modules/@tailwindcss/node/node_modules/lightningcss-win32-x64-msvc/lightningcss.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
|
| 44 |
frontend/node_modules/@tailwindcss/oxide-win32-x64-msvc/tailwindcss-oxide.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
|
| 45 |
frontend/node_modules/lightningcss-win32-x64-msvc/lightningcss.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 43 |
frontend/node_modules/@tailwindcss/node/node_modules/lightningcss-win32-x64-msvc/lightningcss.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
|
| 44 |
frontend/node_modules/@tailwindcss/oxide-win32-x64-msvc/tailwindcss-oxide.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
|
| 45 |
frontend/node_modules/lightningcss-win32-x64-msvc/lightningcss.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
Ui[[:space:]]info.md/screen.png filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 Thilakeswaran B
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
CHANGED
|
@@ -1,3 +1,204 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
title: Bank of Libreo — Intelligent Banking RAG System
|
| 4 |
+
sdk: other
|
| 5 |
+
tags:
|
| 6 |
+
- rag
|
| 7 |
+
- retrieval-augmented-generation
|
| 8 |
+
- fastapi
|
| 9 |
+
- react
|
| 10 |
+
- chromadb
|
| 11 |
+
- banking
|
| 12 |
+
- document-intelligence
|
| 13 |
+
- vector-search
|
| 14 |
+
- sentence-transformers
|
| 15 |
+
language:
|
| 16 |
+
- en
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
---
|
| 19 |
+
|
| 20 |
+
<img src="./assets/bank-of-librio-banner.png" alt="Bank of Librio" width="100%" style="border-radius:8px;" />
|
| 21 |
+
|
| 22 |
+
<div align="center">
|
| 23 |
+
|
| 24 |
+
# Bank of Libreo — Intelligent Banking RAG System
|
| 25 |
+
|
| 26 |
+
**An enterprise-grade Retrieval-Augmented Generation (RAG) system for bank data analysis, document intelligence, and AI-powered query answering.**
|
| 27 |
+
|
| 28 |
+
[](https://fastapi.tiangolo.com/)
|
| 29 |
+
[](https://react.dev/)
|
| 30 |
+
[](https://www.trychroma.com/)
|
| 31 |
+
[](https://www.python.org/)
|
| 32 |
+
[](https://vite.dev/)
|
| 33 |
+
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## 🖥️ Live Preview
|
| 39 |
+
|
| 40 |
+
<p align="center">
|
| 41 |
+
<img src="./docs/app-screenshot.png"
|
| 42 |
+
alt="Bank of Libreo — Oracle Chat UI"
|
| 43 |
+
width="100%" />
|
| 44 |
+
</p>
|
| 45 |
+
|
| 46 |
+
*The Oracle of Libreo — RAG-powered chat interface connected to ChromaDB vector store*
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## 📐 System Architecture & Flow
|
| 51 |
+
|
| 52 |
+
```mermaid
|
| 53 |
+
flowchart TD
|
| 54 |
+
subgraph Frontend["🖥️ Frontend (React + Vite)"]
|
| 55 |
+
UI["User Interface"]
|
| 56 |
+
APIClient["API Service Layer"]
|
| 57 |
+
UI --> APIClient
|
| 58 |
+
end
|
| 59 |
+
|
| 60 |
+
subgraph Backend["⚡ FastAPI Server"]
|
| 61 |
+
API["FastAPI App"]
|
| 62 |
+
DocProc["Document Processor"]
|
| 63 |
+
RAGEngine["RAG Search & Synthesis"]
|
| 64 |
+
end
|
| 65 |
+
|
| 66 |
+
subgraph Database["🗄️ ChromaDB Vector Store"]
|
| 67 |
+
Embeddings["Sentence Transformers"]
|
| 68 |
+
VectorDB["Chroma Vector Database"]
|
| 69 |
+
end
|
| 70 |
+
|
| 71 |
+
APIClient -->|"1. User Query / Upload"| API
|
| 72 |
+
API -->|"2. Document Ingestion"| DocProc
|
| 73 |
+
DocProc -->|"3. Text Chunks & Metadata"| Embeddings
|
| 74 |
+
Embeddings -->|"4. Index Vectors"| VectorDB
|
| 75 |
+
API -->|"5. Search Query"| RAGEngine
|
| 76 |
+
RAGEngine -->|"6. Similarity Search"| VectorDB
|
| 77 |
+
VectorDB -->|"7. Top-K Context"| RAGEngine
|
| 78 |
+
RAGEngine -->|"8. Synthesized Answer"| API
|
| 79 |
+
API -->|"9. JSON Response"| APIClient
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
<details>
|
| 83 |
+
<summary>📊 <strong>View Full Architecture Diagram</strong></summary>
|
| 84 |
+
<br/>
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
|
| 88 |
+
</details>
|
| 89 |
+
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## ✨ Features
|
| 93 |
+
|
| 94 |
+
| Feature | Description |
|
| 95 |
+
|---|---|
|
| 96 |
+
| 📄 **Multi-Format Ingestion** | PDF, CSV, Excel `.xlsx`, Word `.docx`, TXT, Markdown, JSON, HTML |
|
| 97 |
+
| 🔍 **Semantic Vector Search** | ChromaDB + Sentence Transformers for semantically accurate retrieval |
|
| 98 |
+
| 🤖 **AI Answer Synthesis** | Blended, paraphrased answers with cited sources |
|
| 99 |
+
| ⚡ **Auto Dataset Loading** | Background ingestion of banking datasets on server startup |
|
| 100 |
+
| 🧩 **Chunk Inspector** | Drill down into retrieved context chunks per answer |
|
| 101 |
+
| 🎨 **Premium UI** | Classical-themed chat interface with glassmorphism & dark palette |
|
| 102 |
+
| ☁️ **Render Ready** | One-click deployment to Render (backend + frontend) |
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## 🛠️ Technology Stack
|
| 107 |
+
|
| 108 |
+
<div align="center">
|
| 109 |
+
|
| 110 |
+
| Layer | Technology |
|
| 111 |
+
|---|---|
|
| 112 |
+
| **Backend API** | Python 3, FastAPI, Uvicorn |
|
| 113 |
+
| **Vector Store** | ChromaDB, Sentence Transformers |
|
| 114 |
+
| **Document Parsing** | PyPDF2, Pandas, OpenPyXL, Python-Docx |
|
| 115 |
+
| **Frontend** | React 19, Vite 8, Tailwind CSS v4 |
|
| 116 |
+
| **Deployment** | Render (Web Service + Static Site) |
|
| 117 |
+
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
---
|
| 121 |
+
|
| 122 |
+
## 🚀 API Reference
|
| 123 |
+
|
| 124 |
+
| Method | Endpoint | Description |
|
| 125 |
+
| :--- | :--- | :--- |
|
| 126 |
+
| `GET` | `/` | Root health check |
|
| 127 |
+
| `GET` | `/healthz` | Platform health monitoring |
|
| 128 |
+
| `GET` | `/api/health` | Vector store health & document statistics |
|
| 129 |
+
| `GET` | `/api/documents` | List all indexed documents |
|
| 130 |
+
| `POST` | `/api/upload` | Upload & auto-chunk document files |
|
| 131 |
+
| `POST` | `/api/query` | RAG query → synthesized answer + citations |
|
| 132 |
+
| `POST` | `/api/ingest-kaggle` | Auto-download Kaggle bank dataset |
|
| 133 |
+
| `DELETE` | `/api/documents/{filename}` | Remove a document from vector store |
|
| 134 |
+
|
| 135 |
+
---
|
| 136 |
+
|
| 137 |
+
## 💻 Local Development
|
| 138 |
+
|
| 139 |
+
### Prerequisites
|
| 140 |
+
- Python 3.10+
|
| 141 |
+
- Node.js 18+
|
| 142 |
+
|
| 143 |
+
### ⚡ Quick Start (One Command)
|
| 144 |
+
|
| 145 |
+
```powershell
|
| 146 |
+
# From repo root — launches both servers in separate windows
|
| 147 |
+
.\start_dev.ps1
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
### Manual Setup
|
| 151 |
+
|
| 152 |
+
**Terminal 1 — Backend**
|
| 153 |
+
```bash
|
| 154 |
+
cd backend
|
| 155 |
+
pip install -r requirements.txt
|
| 156 |
+
uvicorn app:app --host 127.0.0.1 --port 8000 --reload
|
| 157 |
+
```
|
| 158 |
+
> Backend runs at `http://localhost:8000`
|
| 159 |
+
|
| 160 |
+
**Terminal 2 — Frontend**
|
| 161 |
+
```bash
|
| 162 |
+
cd frontend
|
| 163 |
+
npm install
|
| 164 |
+
npm run dev
|
| 165 |
+
```
|
| 166 |
+
> Frontend runs at `http://localhost:5173`
|
| 167 |
+
|
| 168 |
+
> **Note:** Vite takes ~25s on first start while bundling dependencies. Wait for the `VITE ready` message.
|
| 169 |
+
|
| 170 |
+
---
|
| 171 |
+
|
| 172 |
+
## ☁️ Deployment Guide (Render)
|
| 173 |
+
|
| 174 |
+
<details>
|
| 175 |
+
<summary>🔧 <strong>Backend Service (Web Service)</strong></summary>
|
| 176 |
+
|
| 177 |
+
| Setting | Value |
|
| 178 |
+
|---|---|
|
| 179 |
+
| Environment | Python 3 |
|
| 180 |
+
| Root Directory | `backend` |
|
| 181 |
+
| Build Command | `pip install -r requirements.txt` |
|
| 182 |
+
| Start Command | `uvicorn app:app --host 0.0.0.0 --port $PORT` |
|
| 183 |
+
|
| 184 |
+
</details>
|
| 185 |
+
|
| 186 |
+
<details>
|
| 187 |
+
<summary>🌐 <strong>Frontend Service (Static Site)</strong></summary>
|
| 188 |
+
|
| 189 |
+
| Setting | Value |
|
| 190 |
+
|---|---|
|
| 191 |
+
| Root Directory | `frontend` |
|
| 192 |
+
| Build Command | `npm install && npm run build` |
|
| 193 |
+
| Publish Directory | `dist` |
|
| 194 |
+
| Environment Variable | `VITE_API_BASE_URL` = `https://your-backend-url.onrender.com` |
|
| 195 |
+
|
| 196 |
+
</details>
|
| 197 |
+
|
| 198 |
+
---
|
| 199 |
+
|
| 200 |
+
<div align="center">
|
| 201 |
+
|
| 202 |
+
Built with ⚡ by **Bank of Librio** — *Banking with Strength. Built on Trust.*
|
| 203 |
+
|
| 204 |
+
</div>
|
Skill.md/# RAG Workflow.txt
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Document Processing Flow
|
| 2 |
+
|
| 3 |
+
```
|
| 4 |
+
Documents
|
| 5 |
+
│
|
| 6 |
+
┌──────────────┼──────────────┐
|
| 7 |
+
│ │ │
|
| 8 |
+
▼ ▼ ▼
|
| 9 |
+
PDF Word (.docx) Excel (.xlsx)
|
| 10 |
+
│ │ │
|
| 11 |
+
└──────────────┼──────────────┘
|
| 12 |
+
│
|
| 13 |
+
▼
|
| 14 |
+
Document Loader
|
| 15 |
+
│
|
| 16 |
+
▼
|
| 17 |
+
Extract Raw Text / Tables
|
| 18 |
+
│
|
| 19 |
+
▼
|
| 20 |
+
Clean & Normalize the Content
|
| 21 |
+
│
|
| 22 |
+
▼
|
| 23 |
+
Split Into Small Chunks
|
| 24 |
+
(e.g. 500-1000 characters)
|
| 25 |
+
│
|
| 26 |
+
▼
|
| 27 |
+
Generate Embeddings
|
| 28 |
+
│
|
| 29 |
+
▼
|
| 30 |
+
Store in Vector DB
|
| 31 |
+
│
|
| 32 |
+
▼
|
| 33 |
+
Ready for Semantic Search
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## Supported File Types
|
| 37 |
+
|
| 38 |
+
- PDF
|
| 39 |
+
- DOCX (Microsoft Word)
|
| 40 |
+
- XLSX (Microsoft Excel)
|
| 41 |
+
- CSV
|
| 42 |
+
- TXT
|
| 43 |
+
- Markdown
|
| 44 |
+
- HTML
|
| 45 |
+
- JSON
|
| 46 |
+
|
| 47 |
+
## Chunking Strategy
|
| 48 |
+
|
| 49 |
+
### PDF
|
| 50 |
+
- Split by paragraphs or pages.
|
| 51 |
+
|
| 52 |
+
### Word
|
| 53 |
+
- Split by headings and paragraphs.
|
| 54 |
+
|
| 55 |
+
### Excel
|
| 56 |
+
- Read each sheet.
|
| 57 |
+
- Convert each row or logical table into text.
|
| 58 |
+
- Create chunks per row or group of rows.
|
| 59 |
+
|
| 60 |
+
Example:
|
| 61 |
+
|
| 62 |
+
Sheet: Employees
|
| 63 |
+
|
| 64 |
+
| ID | Name | Department |
|
| 65 |
+
|----|------|------------|
|
| 66 |
+
|101 | John | HR |
|
| 67 |
+
|102 | Alice| IT |
|
| 68 |
+
|
| 69 |
+
becomes
|
| 70 |
+
|
| 71 |
+
```
|
| 72 |
+
Employee ID: 101
|
| 73 |
+
Name: John
|
| 74 |
+
Department: HR
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
```
|
| 78 |
+
Employee ID: 102
|
| 79 |
+
Name: Alice
|
| 80 |
+
Department: IT
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
Each record is embedded separately.
|
| 84 |
+
|
| 85 |
+
## Retrieval Pipeline
|
| 86 |
+
|
| 87 |
+
```
|
| 88 |
+
User Question
|
| 89 |
+
│
|
| 90 |
+
▼
|
| 91 |
+
Embedding
|
| 92 |
+
│
|
| 93 |
+
▼
|
| 94 |
+
Similarity Search
|
| 95 |
+
│
|
| 96 |
+
▼
|
| 97 |
+
Top-K Chunks
|
| 98 |
+
│
|
| 99 |
+
▼
|
| 100 |
+
Build Prompt
|
| 101 |
+
│
|
| 102 |
+
▼
|
| 103 |
+
LLM
|
| 104 |
+
│
|
| 105 |
+
▼
|
| 106 |
+
Final Answer
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
## Best Practices
|
| 110 |
+
|
| 111 |
+
- Preserve metadata (filename, page number, sheet name, row number).
|
| 112 |
+
- Keep chunk sizes between 300–1000 tokens.
|
| 113 |
+
- Add overlap (50–100 tokens) to maintain context.
|
| 114 |
+
- Store metadata alongside embeddings for citations.
|
Sound/the sound for caht send.mp3
ADDED
|
Binary file (65.3 kB). View file
|
|
|
System design/flow diagaram.webp
ADDED
|
Ui info.md/DESIGN.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: Organic Dialogue
|
| 3 |
+
colors:
|
| 4 |
+
surface: '#faf9f4'
|
| 5 |
+
surface-dim: '#dbdad5'
|
| 6 |
+
surface-bright: '#faf9f4'
|
| 7 |
+
surface-container-lowest: '#ffffff'
|
| 8 |
+
surface-container-low: '#f5f4ef'
|
| 9 |
+
surface-container: '#efeee9'
|
| 10 |
+
surface-container-high: '#e9e8e3'
|
| 11 |
+
surface-container-highest: '#e3e3de'
|
| 12 |
+
on-surface: '#1b1c19'
|
| 13 |
+
on-surface-variant: '#454840'
|
| 14 |
+
inverse-surface: '#30312e'
|
| 15 |
+
inverse-on-surface: '#f2f1ec'
|
| 16 |
+
outline: '#75786f'
|
| 17 |
+
outline-variant: '#c5c8bd'
|
| 18 |
+
surface-tint: '#546346'
|
| 19 |
+
primary: '#28351c'
|
| 20 |
+
on-primary: '#ffffff'
|
| 21 |
+
primary-container: '#3e4c31'
|
| 22 |
+
on-primary-container: '#acbc9a'
|
| 23 |
+
inverse-primary: '#bccca9'
|
| 24 |
+
secondary: '#4d6549'
|
| 25 |
+
on-secondary: '#ffffff'
|
| 26 |
+
secondary-container: '#cce7c4'
|
| 27 |
+
on-secondary-container: '#51694d'
|
| 28 |
+
tertiary: '#2c3424'
|
| 29 |
+
on-tertiary: '#ffffff'
|
| 30 |
+
tertiary-container: '#434a39'
|
| 31 |
+
on-tertiary-container: '#b1b9a3'
|
| 32 |
+
error: '#ba1a1a'
|
| 33 |
+
on-error: '#ffffff'
|
| 34 |
+
error-container: '#ffdad6'
|
| 35 |
+
on-error-container: '#93000a'
|
| 36 |
+
primary-fixed: '#d8e8c4'
|
| 37 |
+
primary-fixed-dim: '#bccca9'
|
| 38 |
+
on-primary-fixed: '#131f08'
|
| 39 |
+
on-primary-fixed-variant: '#3d4b30'
|
| 40 |
+
secondary-fixed: '#cfeac7'
|
| 41 |
+
secondary-fixed-dim: '#b3ceac'
|
| 42 |
+
on-secondary-fixed: '#0a200a'
|
| 43 |
+
on-secondary-fixed-variant: '#354c33'
|
| 44 |
+
tertiary-fixed: '#dee6ce'
|
| 45 |
+
tertiary-fixed-dim: '#c2cab3'
|
| 46 |
+
on-tertiary-fixed: '#171e0f'
|
| 47 |
+
on-tertiary-fixed-variant: '#424938'
|
| 48 |
+
background: '#faf9f4'
|
| 49 |
+
on-background: '#1b1c19'
|
| 50 |
+
surface-variant: '#e3e3de'
|
| 51 |
+
typography:
|
| 52 |
+
headline-xl:
|
| 53 |
+
fontFamily: Manrope
|
| 54 |
+
fontSize: 40px
|
| 55 |
+
fontWeight: '700'
|
| 56 |
+
lineHeight: 48px
|
| 57 |
+
letterSpacing: -0.02em
|
| 58 |
+
headline-lg:
|
| 59 |
+
fontFamily: Manrope
|
| 60 |
+
fontSize: 32px
|
| 61 |
+
fontWeight: '600'
|
| 62 |
+
lineHeight: 40px
|
| 63 |
+
letterSpacing: -0.01em
|
| 64 |
+
headline-lg-mobile:
|
| 65 |
+
fontFamily: Manrope
|
| 66 |
+
fontSize: 28px
|
| 67 |
+
fontWeight: '600'
|
| 68 |
+
lineHeight: 36px
|
| 69 |
+
headline-md:
|
| 70 |
+
fontFamily: Manrope
|
| 71 |
+
fontSize: 24px
|
| 72 |
+
fontWeight: '600'
|
| 73 |
+
lineHeight: 32px
|
| 74 |
+
body-lg:
|
| 75 |
+
fontFamily: Manrope
|
| 76 |
+
fontSize: 18px
|
| 77 |
+
fontWeight: '400'
|
| 78 |
+
lineHeight: 28px
|
| 79 |
+
body-md:
|
| 80 |
+
fontFamily: Manrope
|
| 81 |
+
fontSize: 16px
|
| 82 |
+
fontWeight: '400'
|
| 83 |
+
lineHeight: 24px
|
| 84 |
+
label-md:
|
| 85 |
+
fontFamily: Manrope
|
| 86 |
+
fontSize: 14px
|
| 87 |
+
fontWeight: '600'
|
| 88 |
+
lineHeight: 20px
|
| 89 |
+
letterSpacing: 0.01em
|
| 90 |
+
label-sm:
|
| 91 |
+
fontFamily: Manrope
|
| 92 |
+
fontSize: 12px
|
| 93 |
+
fontWeight: '500'
|
| 94 |
+
lineHeight: 16px
|
| 95 |
+
rounded:
|
| 96 |
+
sm: 0.25rem
|
| 97 |
+
DEFAULT: 0.5rem
|
| 98 |
+
md: 0.75rem
|
| 99 |
+
lg: 1rem
|
| 100 |
+
xl: 1.5rem
|
| 101 |
+
full: 9999px
|
| 102 |
+
spacing:
|
| 103 |
+
base: 4px
|
| 104 |
+
xs: 4px
|
| 105 |
+
sm: 8px
|
| 106 |
+
md: 16px
|
| 107 |
+
lg: 24px
|
| 108 |
+
xl: 32px
|
| 109 |
+
container-max: 800px
|
| 110 |
+
gutter: 20px
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## Brand & Style
|
| 114 |
+
|
| 115 |
+
This design system is built for a chatbot experience that feels calm, intelligent, and grounded. Drawing inspiration from the provided botanical impressionist painting, the brand personality is "Sophisticated Naturalism." It avoids the cold, clinical feel of typical AI interfaces in favor of a warm, human-centric aesthetic.
|
| 116 |
+
|
| 117 |
+
The design style is a blend of **Minimalism** and **Modern Corporate**, utilizing a high-quality "cream and greens" palette to evoke a sense of growth and clarity. It prioritizes legibility, generous whitespace, and soft, organic depth to reduce the cognitive load often associated with complex AI interactions. The target audience includes professionals seeking an assistive tool that feels like a refined companion rather than a machine.
|
| 118 |
+
|
| 119 |
+
## Colors
|
| 120 |
+
|
| 121 |
+
The palette is derived directly from the impressionist landscape, focusing on earthy, muted tones that provide excellent contrast without visual fatigue.
|
| 122 |
+
|
| 123 |
+
- **Primary (Deep Olive):** Used for primary actions, heavy headers, and the user's message bubbles. It provides the "anchor" for the visual hierarchy.
|
| 124 |
+
- **Secondary (Sage Green):** Used for supportive elements, iconography, and active states. It bridges the gap between the dark olive and the light background.
|
| 125 |
+
- **Tertiary (Dusty Sage):** A subtle tint for non-critical elements like hover states on secondary buttons or inactive tabs.
|
| 126 |
+
- **Background (Cream/Off-white):** The main canvas. This specific off-white reduces blue-light strain compared to pure white, creating a "paper-like" reading experience.
|
| 127 |
+
- **Surface (Accent Cream):** A slightly brighter version of the background used to lift cards and input containers off the page.
|
| 128 |
+
|
| 129 |
+
## Typography
|
| 130 |
+
|
| 131 |
+
The design system utilizes **Manrope** for its balanced, geometric-yet-humanist qualities. It maintains professional clarity while remaining approachable.
|
| 132 |
+
|
| 133 |
+
- **Headlines:** Use Bold or Semi-Bold weights with tight letter-spacing to create a strong visual impact.
|
| 134 |
+
- **Body Text:** Standardized at 16px for optimal readability. Line height is set to 1.5x (24px) to ensure the chatbot's longer responses remain scannable.
|
| 135 |
+
- **Labels:** Used for metadata, timestamps, and button text. These often use a slightly heavier weight or uppercase styling to distinguish them from prose.
|
| 136 |
+
|
| 137 |
+
## Layout & Spacing
|
| 138 |
+
|
| 139 |
+
The layout follows a **Fixed-Fluid hybrid model** optimized for conversation.
|
| 140 |
+
- **Conversation Thread:** Centered with a maximum width of 800px on desktop to prevent long line lengths that hinder readability.
|
| 141 |
+
- **Grid:** A 12-column grid is used for the dashboard around the chat, but the chat itself relies on safe margins (24px on desktop, 16px on mobile).
|
| 142 |
+
- **Rhythm:** An 8px linear scale (4, 8, 16, 24, 32, 48, 64) ensures consistent vertical rhythm between message bubbles and UI components.
|
| 143 |
+
- **Mobile Adaption:** Sidebars collapse into a "hamburger" menu or bottom-sheet; message bubbles expand to fill 90% of the viewport width.
|
| 144 |
+
|
| 145 |
+
## Elevation & Depth
|
| 146 |
+
|
| 147 |
+
To maintain a "clean and professional" feel, this design system uses **Tonal Layering** combined with **Ambient Shadows**.
|
| 148 |
+
|
| 149 |
+
1. **Level 0 (Base):** The Cream background (`#F9F8F3`).
|
| 150 |
+
2. **Level 1 (Cards/Bubbles):** Surfaces use the Accent Cream (`#FEFDF8`) with a very soft, diffused shadow: `0 4px 20px rgba(62, 76, 49, 0.06)`. Note the slight green tint in the shadow to maintain color harmony.
|
| 151 |
+
3. **Level 2 (Active/Floating):** Interaction elements like the message input field or floating action buttons use a more pronounced shadow: `0 8px 30px rgba(62, 76, 49, 0.12)`.
|
| 152 |
+
4. **Interactions:** Hover states on buttons should not "lift" further but rather darken the background color slightly to maintain a grounded feel.
|
| 153 |
+
|
| 154 |
+
## Shapes
|
| 155 |
+
|
| 156 |
+
The shape language is "Softly Geometric."
|
| 157 |
+
- **Standard Radius:** 0.5rem (8px) is the baseline for input fields and smaller cards.
|
| 158 |
+
- **Message Bubbles:** Use 1rem (16px) for a friendlier, chat-centric feel. Use "asymmetric" rounding for bubbles—the corner pointing toward the avatar should have a smaller radius (4px) to indicate directionality.
|
| 159 |
+
- **Buttons:** Fully rounded (pill-shaped) for primary actions to distinguish them from content containers.
|
| 160 |
+
|
| 161 |
+
## Components
|
| 162 |
+
|
| 163 |
+
### Message Bubbles
|
| 164 |
+
- **User:** Deep Olive (`#3E4C31`) background with White text. Right-aligned.
|
| 165 |
+
- **AI:** Accent Cream (`#FEFDF8`) background with Deep Olive text. Left-aligned. Subtle 1px border of Sage (`#8FA989`) at 20% opacity.
|
| 166 |
+
|
| 167 |
+
### Buttons
|
| 168 |
+
- **Primary:** Deep Olive background, White text, pill-shaped.
|
| 169 |
+
- **Secondary:** Transparent background, Deep Olive border (1px), Sage text on hover.
|
| 170 |
+
|
| 171 |
+
### Input Fields
|
| 172 |
+
- The chat input should be a large, "floating" bar with the Accent Cream background and a soft shadow. Use a Sage Green cursor/caret.
|
| 173 |
+
|
| 174 |
+
### Chips & Tags
|
| 175 |
+
- Used for "Suggested Replies." Light Sage (`#D1D9C2`) background with Deep Olive text. 0.5rem corner radius.
|
| 176 |
+
|
| 177 |
+
### Cards
|
| 178 |
+
- Used for rich-media responses (images, data tables). They should have a 1px border using the Sage color at low opacity and no harsh shadows, appearing "nested" within the conversation.
|
| 179 |
+
|
| 180 |
+
### Avatars
|
| 181 |
+
- Circular. AI avatar should use a Sage/Olive gradient or a botanical icon to reinforce the brand personality.
|
Ui info.md/code.html
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
|
| 3 |
+
<html lang="en"><head>
|
| 4 |
+
<meta charset="utf-8"/>
|
| 5 |
+
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
| 6 |
+
<title>Bank of Libreo</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
|
| 8 |
+
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap" rel="stylesheet"/>
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet"/>
|
| 10 |
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet"/>
|
| 11 |
+
<script id="tailwind-config">
|
| 12 |
+
tailwind.config = {
|
| 13 |
+
darkMode: "class",
|
| 14 |
+
theme: {
|
| 15 |
+
extend: {
|
| 16 |
+
"colors": {
|
| 17 |
+
"tertiary-fixed-dim": "#c2cab3",
|
| 18 |
+
"surface-container-low": "#f5f4ef",
|
| 19 |
+
"on-background": "#1b1c19",
|
| 20 |
+
"on-error-container": "#93000a",
|
| 21 |
+
"on-surface-variant": "#454840",
|
| 22 |
+
"surface-tint": "#546346",
|
| 23 |
+
"on-secondary-fixed": "#0a200a",
|
| 24 |
+
"surface": "#faf9f4",
|
| 25 |
+
"tertiary": "#2c3424",
|
| 26 |
+
"inverse-surface": "#30312e",
|
| 27 |
+
"surface-container-highest": "#e3e3de",
|
| 28 |
+
"on-tertiary": "#ffffff",
|
| 29 |
+
"on-primary-fixed-variant": "#3d4b30",
|
| 30 |
+
"surface-dim": "#dbdad5",
|
| 31 |
+
"surface-bright": "#faf9f4",
|
| 32 |
+
"error": "#ba1a1a",
|
| 33 |
+
"primary": "#28351c",
|
| 34 |
+
"surface-container-lowest": "#ffffff",
|
| 35 |
+
"on-surface": "#1b1c19",
|
| 36 |
+
"surface-variant": "#e3e3de",
|
| 37 |
+
"surface-container-high": "#e9e8e3",
|
| 38 |
+
"on-primary-container": "#acbc9a",
|
| 39 |
+
"surface-container": "#efeee9",
|
| 40 |
+
"inverse-on-surface": "#f2f1ec",
|
| 41 |
+
"on-secondary": "#ffffff",
|
| 42 |
+
"primary-container": "#3e4c31",
|
| 43 |
+
"on-primary": "#ffffff",
|
| 44 |
+
"on-tertiary-fixed-variant": "#424938",
|
| 45 |
+
"secondary-container": "#cce7c4",
|
| 46 |
+
"primary-fixed": "#d8e8c4",
|
| 47 |
+
"secondary-fixed-dim": "#b3ceac",
|
| 48 |
+
"on-tertiary-fixed": "#171e0f",
|
| 49 |
+
"tertiary-container": "#434a39",
|
| 50 |
+
"on-primary-fixed": "#131f08",
|
| 51 |
+
"primary-fixed-dim": "#bccca9",
|
| 52 |
+
"on-secondary-fixed-variant": "#354c33",
|
| 53 |
+
"inverse-primary": "#bccca9",
|
| 54 |
+
"error-container": "#ffdad6",
|
| 55 |
+
"outline-variant": "#c5c8bd",
|
| 56 |
+
"secondary": "#4d6549",
|
| 57 |
+
"on-error": "#ffffff",
|
| 58 |
+
"secondary-fixed": "#cfeac7",
|
| 59 |
+
"on-tertiary-container": "#b1b9a3",
|
| 60 |
+
"outline": "#75786f",
|
| 61 |
+
"background": "#faf9f4",
|
| 62 |
+
"on-secondary-container": "#51694d",
|
| 63 |
+
"tertiary-fixed": "#dee6ce"
|
| 64 |
+
},
|
| 65 |
+
"borderRadius": {
|
| 66 |
+
"DEFAULT": "0.25rem",
|
| 67 |
+
"lg": "0.5rem",
|
| 68 |
+
"xl": "0.75rem",
|
| 69 |
+
"full": "9999px"
|
| 70 |
+
},
|
| 71 |
+
"spacing": {
|
| 72 |
+
"xs": "4px",
|
| 73 |
+
"lg": "24px",
|
| 74 |
+
"sm": "8px",
|
| 75 |
+
"gutter": "20px",
|
| 76 |
+
"container-max": "800px",
|
| 77 |
+
"base": "4px",
|
| 78 |
+
"md": "16px",
|
| 79 |
+
"xl": "32px"
|
| 80 |
+
},
|
| 81 |
+
"fontFamily": {
|
| 82 |
+
"body-md": ["Manrope"],
|
| 83 |
+
"label-md": ["Manrope"],
|
| 84 |
+
"headline-lg": ["Manrope"],
|
| 85 |
+
"label-sm": ["Manrope"],
|
| 86 |
+
"headline-lg-mobile": ["Manrope"],
|
| 87 |
+
"headline-md": ["Manrope"],
|
| 88 |
+
"body-lg": ["Manrope"],
|
| 89 |
+
"headline-xl": ["Manrope"]
|
| 90 |
+
},
|
| 91 |
+
"fontSize": {
|
| 92 |
+
"body-md": ["16px", { "lineHeight": "24px", "fontWeight": "400" }],
|
| 93 |
+
"label-md": ["14px", { "lineHeight": "20px", "letterSpacing": "0.01em", "fontWeight": "600" }],
|
| 94 |
+
"headline-lg": ["32px", { "lineHeight": "40px", "letterSpacing": "-0.01em", "fontWeight": "600" }],
|
| 95 |
+
"label-sm": ["12px", { "lineHeight": "16px", "fontWeight": "500" }],
|
| 96 |
+
"headline-lg-mobile": ["28px", { "lineHeight": "36px", "fontWeight": "600" }],
|
| 97 |
+
"headline-md": ["24px", { "lineHeight": "32px", "fontWeight": "600" }],
|
| 98 |
+
"body-lg": ["18px", { "lineHeight": "28px", "fontWeight": "400" }],
|
| 99 |
+
"headline-xl": ["40px", { "lineHeight": "48px", "letterSpacing": "-0.02em", "fontWeight": "700" }]
|
| 100 |
+
}
|
| 101 |
+
},
|
| 102 |
+
},
|
| 103 |
+
}
|
| 104 |
+
</script>
|
| 105 |
+
<style>
|
| 106 |
+
.custom-shadow-level-1 { box-shadow: 0 4px 20px rgba(62, 76, 49, 0.06); }
|
| 107 |
+
.custom-shadow-level-2 { box-shadow: 0 8px 30px rgba(62, 76, 49, 0.12); }
|
| 108 |
+
.scrollbar-hide::-webkit-scrollbar { display: none; }
|
| 109 |
+
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
|
| 110 |
+
</style>
|
| 111 |
+
</head>
|
| 112 |
+
<body class="bg-surface text-on-surface font-body-md text-body-md h-screen overflow-hidden flex selection:bg-secondary-container selection:text-on-secondary-container">
|
| 113 |
+
<!-- Main Content Area -->
|
| 114 |
+
<main class="flex-1 flex flex-col relative min-w-0 h-full overflow-hidden">
|
| 115 |
+
<!-- Background Image for Chat Area -->
|
| 116 |
+
<div class="absolute inset-0 z-0 opacity-15 pointer-events-none" data-alt="A subtle, impressionistic botanical painting featuring white flowers on delicate vines against a textured, pale sage green background." style="background-image: url('https://lh3.googleusercontent.com/aida-public/AB6AXuCzGzuwaD9lhmUY2NbMs4oP-aSPWswB6wkndCYVcNC818mLV-4hWKiGIGkUJBDqbNH1_Zye8RSAj-8Bnt7TmJxIexRmcLtSq1AcJAWpVnL2HPi-tzaRwJtjfww09byGEP0951jBMVlomZUc13_e8WEFKuiKELgLLT6uMjpwqODxl3xpwv5lXSqBkVHI75AtYuS0iLRSCAgECUkzx5p3qPwvOc-me-x9dUCrPv6CPPBSuAL35_joNYVgXy8-z1MTagooIbY'); background-size: cover; background-position: center;"></div>
|
| 117 |
+
<!-- TopAppBar -->
|
| 118 |
+
<header class="bg-surface/80 backdrop-blur-md shadow-sm full-width top-0 z-50 flex justify-between items-center px-lg h-16 shrink-0 relative">
|
| 119 |
+
<div class="flex items-center gap-md lg:hidden">
|
| 120 |
+
<button class="text-on-surface-variant p-sm rounded-full hover:bg-surface-container-highest/50 transition-colors active:scale-95 duration-200">
|
| 121 |
+
<span class="material-symbols-outlined" data-icon="menu">menu</span>
|
| 122 |
+
</button>
|
| 123 |
+
<h1 class="font-headline-md text-headline-md font-bold text-primary">Botanica AI</h1>
|
| 124 |
+
</div>
|
| 125 |
+
<div class="hidden lg:block">
|
| 126 |
+
<h2 class="font-headline-md text-headline-md font-bold text-primary">Botanica AI</h2>
|
| 127 |
+
</div>
|
| 128 |
+
<div class="flex items-center gap-sm">
|
| 129 |
+
<button class="text-on-surface-variant p-sm rounded-full hover:bg-surface-container-highest/50 transition-colors active:scale-95 duration-200 flex items-center justify-center">
|
| 130 |
+
<span class="material-symbols-outlined" data-icon="settings">settings</span>
|
| 131 |
+
</button>
|
| 132 |
+
<button class="text-on-surface-variant p-sm rounded-full hover:bg-surface-container-highest/50 transition-colors active:scale-95 duration-200 flex items-center justify-center">
|
| 133 |
+
<span class="material-symbols-outlined" data-icon="help">help</span>
|
| 134 |
+
</button>
|
| 135 |
+
<img alt="User profile" class="w-8 h-8 rounded-full border border-outline-variant/30 object-cover ml-xs" data-alt="A minimalist, stylized circular profile avatar depicting a subtle sage green leaf motif." src="https://lh3.googleusercontent.com/aida-public/AB6AXuDq7KbqPiVRMAiIar23aDrOyqf7i3ePKm-Fy5-RBOszg6IJhgPkYgMtRSZ9HhTlWoKxOH0w_joSlwTnbWX_1OXgm1lp9rHbUHZbjhM_MPMYt0GBIdguKS3HxbHT4oYE_Nk1vsha3p8IexasWMnGXDPnbxjkNlEDT0gHrcymmHdTqdFOQigBjWPU2KNE76upjettqtuX1Maizfrvy6p24W0MJBu4DILVlAH1jweltlcw_EssOeBDx4GwGQ"/>
|
| 136 |
+
</div>
|
| 137 |
+
</header>
|
| 138 |
+
<!-- Chat History Area -->
|
| 139 |
+
<div class="flex-1 overflow-y-auto px-md py-lg lg:px-lg z-10 flex justify-center scrollbar-hide">
|
| 140 |
+
<div class="w-full max-w-[800px] flex flex-col gap-xl pb-32 pt-md">
|
| 141 |
+
<!-- Initial Greeting -->
|
| 142 |
+
<div class="flex flex-col items-center justify-center text-center my-xl">
|
| 143 |
+
<div class="w-16 h-16 rounded-full bg-gradient-to-br from-secondary-container to-surface-tint/20 flex items-center justify-center mb-md custom-shadow-level-1">
|
| 144 |
+
<span class="material-symbols-outlined text-primary text-[32px]" data-icon="park">park</span>
|
| 145 |
+
</div>
|
| 146 |
+
<h2 class="font-headline-lg text-headline-lg-mobile md:text-headline-lg text-primary mb-sm">How can I assist your growth today?</h2>
|
| 147 |
+
<p class="text-on-surface-variant font-body-lg text-body-lg max-w-lg">Ask me about your documents, research topics, or natural language tasks.</p>
|
| 148 |
+
</div>
|
| 149 |
+
<!-- Suggested Queries -->
|
| 150 |
+
<div class="flex flex-wrap justify-center gap-sm mb-lg">
|
| 151 |
+
<button class="bg-[#D1D9C2] text-primary-container font-label-sm text-label-sm px-md py-xs rounded-lg hover:bg-secondary-fixed transition-colors">Summarize recent articles</button>
|
| 152 |
+
<button class="bg-[#D1D9C2] text-primary-container font-label-sm text-label-sm px-md py-xs rounded-lg hover:bg-secondary-fixed transition-colors">Extract key findings</button>
|
| 153 |
+
<button class="bg-[#D1D9C2] text-primary-container font-label-sm text-label-sm px-md py-xs rounded-lg hover:bg-secondary-fixed transition-colors">Draft a project outline</button>
|
| 154 |
+
</div>
|
| 155 |
+
<!-- AI Message -->
|
| 156 |
+
<div class="flex gap-md max-w-[90%] md:max-w-[85%] self-start animate-[fadeIn_0.5s_ease-out]">
|
| 157 |
+
<div class="w-8 h-8 rounded-full bg-secondary-container flex items-center justify-center shrink-0 mt-xs">
|
| 158 |
+
<span class="material-symbols-outlined text-on-secondary-container text-[18px]" data-icon="eco">eco</span>
|
| 159 |
+
</div>
|
| 160 |
+
<div class="bg-surface-container-lowest text-primary p-md rounded-2xl rounded-tl-sm border border-secondary/20 custom-shadow-level-1">
|
| 161 |
+
<p class="font-body-md text-body-md">Hello. I am Botanica, your natural guide. I have access to your uploaded knowledge base. What would you like to explore?</p>
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
+
<!-- User Message -->
|
| 165 |
+
<div class="flex gap-md max-w-[90%] md:max-w-[85%] self-end flex-row-reverse animate-[fadeIn_0.5s_ease-out_0.2s_both]">
|
| 166 |
+
<div class="w-8 h-8 rounded-full bg-surface-variant shrink-0 mt-xs overflow-hidden">
|
| 167 |
+
<img class="w-full h-full object-cover" data-alt="A minimalist, stylized circular profile avatar depicting a subtle sage green leaf motif." src="https://lh3.googleusercontent.com/aida-public/AB6AXuBpSi4ZrBW3EVUYCXsihLEB7dCHxW5UKz0Bl1xfjyaV__fMH9JPwOBAR5o7JGjfNQiwKmjwU4Byvp3Odae3XRo2Wxlp4Gr2N3gLTg-YnUyC9hIQOPEjyPXDuGO0FDT2lXL-I-ptv1I2x5c-NEB7-xwBVBZ3dyDO6hVbrBjjhyco_eiK9o2eVKMbTdnD3bRZE0E_kyhy7csw9MouJkfMinM1ujRmFFg8EURhI9553RhO8clZ_FwbEusnFQ"/>
|
| 168 |
+
</div>
|
| 169 |
+
<div class="bg-primary-container text-white p-md rounded-2xl rounded-tr-sm custom-shadow-level-1">
|
| 170 |
+
<p class="font-body-md text-body-md">Can you summarize the methodology section from the latest botanical research paper I uploaded yesterday?</p>
|
| 171 |
+
</div>
|
| 172 |
+
</div>
|
| 173 |
+
<!-- AI Message -->
|
| 174 |
+
<div class="flex gap-md max-w-[90%] md:max-w-[85%] self-start animate-[fadeIn_0.5s_ease-out_0.4s_both]">
|
| 175 |
+
<div class="w-8 h-8 rounded-full bg-secondary-container flex items-center justify-center shrink-0 mt-xs">
|
| 176 |
+
<span class="material-symbols-outlined text-on-secondary-container text-[18px]" data-icon="eco">eco</span>
|
| 177 |
+
</div>
|
| 178 |
+
<div class="bg-surface-container-lowest text-primary p-md rounded-2xl rounded-tl-sm border border-secondary/20 custom-shadow-level-1">
|
| 179 |
+
<p class="font-body-md text-body-md mb-md">Certainly. Based on the document "Phytoremediation_Techniques_2023.pdf", the methodology relies on a three-phase approach:</p>
|
| 180 |
+
<ol class="list-decimal pl-lg space-y-sm font-body-md text-body-md mb-md">
|
| 181 |
+
<li><strong>Soil Inoculation:</strong> Introducing specific mycorrhizal fungi to the contaminated soil samples to enhance root absorption capabilities.</li>
|
| 182 |
+
<li><strong>Controlled Cultivation:</strong> Growing the selected <em>Salix viminalis</em> (Basket Willow) specimens in a greenhouse environment with strict temperature (22°C) and humidity (60%) controls for 90 days.</li>
|
| 183 |
+
<li><strong>Heavy Metal Analysis:</strong> Utilizing atomic absorption spectroscopy (AAS) to measure the concentration of cadmium and lead in both the plant tissues (roots, stems, leaves) and the residual soil.</li>
|
| 184 |
+
</ol>
|
| 185 |
+
<div class="flex items-center gap-xs mt-sm pt-sm border-t border-outline-variant/20">
|
| 186 |
+
<span class="material-symbols-outlined text-on-surface-variant text-[16px]" data-icon="description">description</span>
|
| 187 |
+
<span class="text-xs font-label-sm text-on-surface-variant">Source: Phytoremediation_Techniques_2023.pdf (Pages 4-6)</span>
|
| 188 |
+
</div>
|
| 189 |
+
</div>
|
| 190 |
+
</div>
|
| 191 |
+
</div>
|
| 192 |
+
</div>
|
| 193 |
+
<!-- Input Area (Fixed Bottom) -->
|
| 194 |
+
<div class="absolute bottom-0 left-0 w-full p-md lg:p-lg z-20 flex justify-center bg-gradient-to-t from-surface via-surface/90 to-transparent pt-xl">
|
| 195 |
+
<div class="w-full max-w-[800px] relative">
|
| 196 |
+
<div class="bg-surface-container-lowest rounded-xl custom-shadow-level-2 border border-outline-variant/10 flex items-end p-sm transition-all focus-within:ring-2 focus-within:ring-primary/20">
|
| 197 |
+
<textarea class="w-full bg-transparent border-none focus:ring-0 resize-none max-h-32 min-h-[44px] py-xs px-sm font-body-md text-body-md text-on-surface placeholder-on-surface-variant caret-[#8FA989] scrollbar-hide" oninput="this.style.height = ''; this.style.height = this.scrollHeight + 'px'" placeholder="Ask Botanica..." rows="1"></textarea>
|
| 198 |
+
<button class="bg-primary-container text-white w-10 h-10 rounded-lg flex items-center justify-center hover:bg-primary transition-colors shrink-0 mb-[2px] ml-sm">
|
| 199 |
+
<span class="material-symbols-outlined" data-icon="arrow_upward">arrow_upward</span>
|
| 200 |
+
</button>
|
| 201 |
+
</div>
|
| 202 |
+
<div class="text-center mt-xs">
|
| 203 |
+
<span class="text-[10px] text-on-surface-variant/60 font-body-md">Botanica AI can make mistakes. Consider verifying important information.</span>
|
| 204 |
+
</div>
|
| 205 |
+
</div>
|
| 206 |
+
</div>
|
| 207 |
+
</main>
|
| 208 |
+
</body></html>
|
Ui info.md/screen.png
ADDED
|
Git LFS Details
|
frontend/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# React + Vite
|
| 2 |
+
|
| 3 |
+
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
|
| 4 |
+
|
| 5 |
+
Currently, two official plugins are available:
|
| 6 |
+
|
| 7 |
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
|
| 8 |
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
| 9 |
+
|
| 10 |
+
## React Compiler
|
| 11 |
+
|
| 12 |
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
| 13 |
+
|
| 14 |
+
## Expanding the Oxlint configuration
|
| 15 |
+
|
| 16 |
+
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and Oxlint's TypeScript related rules in your project.
|
frontend/node_modules/react-dom/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
frontend/node_modules/react-dom/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# `react-dom`
|
| 2 |
+
|
| 3 |
+
This package serves as the entry point to the DOM and server renderers for React. It is intended to be paired with the generic React package, which is shipped as `react` to npm.
|
| 4 |
+
|
| 5 |
+
## Installation
|
| 6 |
+
|
| 7 |
+
```sh
|
| 8 |
+
npm install react react-dom
|
| 9 |
+
```
|
| 10 |
+
|
| 11 |
+
## Usage
|
| 12 |
+
|
| 13 |
+
### In the browser
|
| 14 |
+
|
| 15 |
+
```js
|
| 16 |
+
import { createRoot } from 'react-dom/client';
|
| 17 |
+
|
| 18 |
+
function App() {
|
| 19 |
+
return <div>Hello World</div>;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
const root = createRoot(document.getElementById('root'));
|
| 23 |
+
root.render(<App />);
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
### On the server
|
| 27 |
+
|
| 28 |
+
```js
|
| 29 |
+
import { renderToPipeableStream } from 'react-dom/server';
|
| 30 |
+
|
| 31 |
+
function App() {
|
| 32 |
+
return <div>Hello World</div>;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
function handleRequest(res) {
|
| 36 |
+
// ... in your server handler ...
|
| 37 |
+
const stream = renderToPipeableStream(<App />, {
|
| 38 |
+
onShellReady() {
|
| 39 |
+
res.statusCode = 200;
|
| 40 |
+
res.setHeader('Content-type', 'text/html');
|
| 41 |
+
stream.pipe(res);
|
| 42 |
+
},
|
| 43 |
+
// ...
|
| 44 |
+
});
|
| 45 |
+
}
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
## API
|
| 49 |
+
|
| 50 |
+
### `react-dom`
|
| 51 |
+
|
| 52 |
+
See https://react.dev/reference/react-dom
|
| 53 |
+
|
| 54 |
+
### `react-dom/client`
|
| 55 |
+
|
| 56 |
+
See https://react.dev/reference/react-dom/client
|
| 57 |
+
|
| 58 |
+
### `react-dom/server`
|
| 59 |
+
|
| 60 |
+
See https://react.dev/reference/react-dom/server
|
frontend/node_modules/react-dom/client.react-server.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
throw new Error(
|
| 4 |
+
'react-dom/client is not supported in React Server Components.'
|
| 5 |
+
);
|
frontend/node_modules/react-dom/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
function checkDCE() {
|
| 4 |
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
| 5 |
+
if (
|
| 6 |
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
|
| 7 |
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
|
| 8 |
+
) {
|
| 9 |
+
return;
|
| 10 |
+
}
|
| 11 |
+
if (process.env.NODE_ENV !== 'production') {
|
| 12 |
+
// This branch is unreachable because this function is only called
|
| 13 |
+
// in production, but the condition is true only in development.
|
| 14 |
+
// Therefore if the branch is still here, dead code elimination wasn't
|
| 15 |
+
// properly applied.
|
| 16 |
+
// Don't change the message. React DevTools relies on it. Also make sure
|
| 17 |
+
// this message doesn't occur elsewhere in this function, or it will cause
|
| 18 |
+
// a false positive.
|
| 19 |
+
throw new Error('^_^');
|
| 20 |
+
}
|
| 21 |
+
try {
|
| 22 |
+
// Verify that the code above has been dead code eliminated (DCE'd).
|
| 23 |
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
| 24 |
+
} catch (err) {
|
| 25 |
+
// DevTools shouldn't crash React, no matter what.
|
| 26 |
+
// We should still report in case we break this code.
|
| 27 |
+
console.error(err);
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (process.env.NODE_ENV === 'production') {
|
| 32 |
+
// DCE check should happen before ReactDOM bundle executes so that
|
| 33 |
+
// DevTools can report bad minification during injection.
|
| 34 |
+
checkDCE();
|
| 35 |
+
module.exports = require('./cjs/react-dom.production.js');
|
| 36 |
+
} else {
|
| 37 |
+
module.exports = require('./cjs/react-dom.development.js');
|
| 38 |
+
}
|
frontend/node_modules/react-dom/package.json
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "react-dom",
|
| 3 |
+
"version": "19.2.8",
|
| 4 |
+
"description": "React package for working with the DOM.",
|
| 5 |
+
"main": "index.js",
|
| 6 |
+
"repository": {
|
| 7 |
+
"type": "git",
|
| 8 |
+
"url": "https://github.com/react/react.git",
|
| 9 |
+
"directory": "packages/react-dom"
|
| 10 |
+
},
|
| 11 |
+
"keywords": [
|
| 12 |
+
"react"
|
| 13 |
+
],
|
| 14 |
+
"license": "MIT",
|
| 15 |
+
"bugs": {
|
| 16 |
+
"url": "https://github.com/react/react/issues"
|
| 17 |
+
},
|
| 18 |
+
"homepage": "https://react.dev/",
|
| 19 |
+
"dependencies": {
|
| 20 |
+
"scheduler": "^0.27.0"
|
| 21 |
+
},
|
| 22 |
+
"peerDependencies": {
|
| 23 |
+
"react": "^19.2.8"
|
| 24 |
+
},
|
| 25 |
+
"files": [
|
| 26 |
+
"LICENSE",
|
| 27 |
+
"README.md",
|
| 28 |
+
"client.js",
|
| 29 |
+
"client.react-server.js",
|
| 30 |
+
"index.js",
|
| 31 |
+
"profiling.js",
|
| 32 |
+
"profiling.react-server.js",
|
| 33 |
+
"react-dom.react-server.js",
|
| 34 |
+
"server.browser.js",
|
| 35 |
+
"server.bun.js",
|
| 36 |
+
"server.edge.js",
|
| 37 |
+
"server.js",
|
| 38 |
+
"server.node.js",
|
| 39 |
+
"server.react-server.js",
|
| 40 |
+
"static.browser.js",
|
| 41 |
+
"static.edge.js",
|
| 42 |
+
"static.js",
|
| 43 |
+
"static.node.js",
|
| 44 |
+
"static.react-server.js",
|
| 45 |
+
"test-utils.js",
|
| 46 |
+
"cjs/"
|
| 47 |
+
],
|
| 48 |
+
"exports": {
|
| 49 |
+
".": {
|
| 50 |
+
"react-server": "./react-dom.react-server.js",
|
| 51 |
+
"default": "./index.js"
|
| 52 |
+
},
|
| 53 |
+
"./client": {
|
| 54 |
+
"react-server": "./client.react-server.js",
|
| 55 |
+
"default": "./client.js"
|
| 56 |
+
},
|
| 57 |
+
"./server": {
|
| 58 |
+
"react-server": "./server.react-server.js",
|
| 59 |
+
"workerd": "./server.edge.js",
|
| 60 |
+
"bun": "./server.bun.js",
|
| 61 |
+
"deno": "./server.browser.js",
|
| 62 |
+
"worker": "./server.browser.js",
|
| 63 |
+
"node": "./server.node.js",
|
| 64 |
+
"edge-light": "./server.edge.js",
|
| 65 |
+
"browser": "./server.browser.js",
|
| 66 |
+
"default": "./server.node.js"
|
| 67 |
+
},
|
| 68 |
+
"./server.browser": {
|
| 69 |
+
"react-server": "./server.react-server.js",
|
| 70 |
+
"default": "./server.browser.js"
|
| 71 |
+
},
|
| 72 |
+
"./server.bun": {
|
| 73 |
+
"react-server": "./server.react-server.js",
|
| 74 |
+
"default": "./server.bun.js"
|
| 75 |
+
},
|
| 76 |
+
"./server.edge": {
|
| 77 |
+
"react-server": "./server.react-server.js",
|
| 78 |
+
"default": "./server.edge.js"
|
| 79 |
+
},
|
| 80 |
+
"./server.node": {
|
| 81 |
+
"react-server": "./server.react-server.js",
|
| 82 |
+
"default": "./server.node.js"
|
| 83 |
+
},
|
| 84 |
+
"./static": {
|
| 85 |
+
"react-server": "./static.react-server.js",
|
| 86 |
+
"workerd": "./static.edge.js",
|
| 87 |
+
"deno": "./static.browser.js",
|
| 88 |
+
"worker": "./static.browser.js",
|
| 89 |
+
"node": "./static.node.js",
|
| 90 |
+
"edge-light": "./static.edge.js",
|
| 91 |
+
"browser": "./static.browser.js",
|
| 92 |
+
"default": "./static.node.js"
|
| 93 |
+
},
|
| 94 |
+
"./static.browser": {
|
| 95 |
+
"react-server": "./static.react-server.js",
|
| 96 |
+
"default": "./static.browser.js"
|
| 97 |
+
},
|
| 98 |
+
"./static.edge": {
|
| 99 |
+
"react-server": "./static.react-server.js",
|
| 100 |
+
"default": "./static.edge.js"
|
| 101 |
+
},
|
| 102 |
+
"./static.node": {
|
| 103 |
+
"react-server": "./static.react-server.js",
|
| 104 |
+
"default": "./static.node.js"
|
| 105 |
+
},
|
| 106 |
+
"./profiling": {
|
| 107 |
+
"react-server": "./profiling.react-server.js",
|
| 108 |
+
"default": "./profiling.js"
|
| 109 |
+
},
|
| 110 |
+
"./test-utils": "./test-utils.js",
|
| 111 |
+
"./package.json": "./package.json"
|
| 112 |
+
},
|
| 113 |
+
"browser": {
|
| 114 |
+
"./server.js": "./server.browser.js",
|
| 115 |
+
"./static.js": "./static.browser.js"
|
| 116 |
+
}
|
| 117 |
+
}
|
frontend/node_modules/react-dom/profiling.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
function checkDCE() {
|
| 4 |
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
| 5 |
+
if (
|
| 6 |
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
|
| 7 |
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
|
| 8 |
+
) {
|
| 9 |
+
return;
|
| 10 |
+
}
|
| 11 |
+
if (process.env.NODE_ENV !== 'production') {
|
| 12 |
+
// This branch is unreachable because this function is only called
|
| 13 |
+
// in production, but the condition is true only in development.
|
| 14 |
+
// Therefore if the branch is still here, dead code elimination wasn't
|
| 15 |
+
// properly applied.
|
| 16 |
+
// Don't change the message. React DevTools relies on it. Also make sure
|
| 17 |
+
// this message doesn't occur elsewhere in this function, or it will cause
|
| 18 |
+
// a false positive.
|
| 19 |
+
throw new Error('^_^');
|
| 20 |
+
}
|
| 21 |
+
try {
|
| 22 |
+
// Verify that the code above has been dead code eliminated (DCE'd).
|
| 23 |
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
| 24 |
+
} catch (err) {
|
| 25 |
+
// DevTools shouldn't crash React, no matter what.
|
| 26 |
+
// We should still report in case we break this code.
|
| 27 |
+
console.error(err);
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (process.env.NODE_ENV === 'production') {
|
| 32 |
+
// DCE check should happen before ReactDOM bundle executes so that
|
| 33 |
+
// DevTools can report bad minification during injection.
|
| 34 |
+
checkDCE();
|
| 35 |
+
module.exports = require('./cjs/react-dom-profiling.profiling.js');
|
| 36 |
+
} else {
|
| 37 |
+
module.exports = require('./cjs/react-dom-profiling.development.js');
|
| 38 |
+
}
|
frontend/node_modules/react-dom/profiling.react-server.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
throw new Error(
|
| 4 |
+
'react-dom/profiling is not supported in React Server Components.'
|
| 5 |
+
);
|
frontend/node_modules/react-dom/react-dom.react-server.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
if (process.env.NODE_ENV === 'production') {
|
| 4 |
+
module.exports = require('./cjs/react-dom.react-server.production.js');
|
| 5 |
+
} else {
|
| 6 |
+
module.exports = require('./cjs/react-dom.react-server.development.js');
|
| 7 |
+
}
|
frontend/node_modules/react-dom/server.browser.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var l, s;
|
| 4 |
+
if (process.env.NODE_ENV === 'production') {
|
| 5 |
+
l = require('./cjs/react-dom-server-legacy.browser.production.js');
|
| 6 |
+
s = require('./cjs/react-dom-server.browser.production.js');
|
| 7 |
+
} else {
|
| 8 |
+
l = require('./cjs/react-dom-server-legacy.browser.development.js');
|
| 9 |
+
s = require('./cjs/react-dom-server.browser.development.js');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
exports.version = l.version;
|
| 13 |
+
exports.renderToString = l.renderToString;
|
| 14 |
+
exports.renderToStaticMarkup = l.renderToStaticMarkup;
|
| 15 |
+
exports.renderToReadableStream = s.renderToReadableStream;
|
| 16 |
+
exports.resume = s.resume;
|
frontend/node_modules/react-dom/server.bun.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var b;
|
| 4 |
+
var l;
|
| 5 |
+
if (process.env.NODE_ENV === 'production') {
|
| 6 |
+
b = require('./cjs/react-dom-server.bun.production.js');
|
| 7 |
+
l = require('./cjs/react-dom-server-legacy.browser.production.js');
|
| 8 |
+
} else {
|
| 9 |
+
b = require('./cjs/react-dom-server.bun.development.js');
|
| 10 |
+
l = require('./cjs/react-dom-server-legacy.browser.development.js');
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
exports.version = b.version;
|
| 14 |
+
exports.renderToReadableStream = b.renderToReadableStream;
|
| 15 |
+
exports.resume = b.resume;
|
| 16 |
+
exports.renderToString = l.renderToString;
|
| 17 |
+
exports.renderToStaticMarkup = l.renderToStaticMarkup;
|
frontend/node_modules/react-dom/server.edge.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var b;
|
| 4 |
+
var l;
|
| 5 |
+
if (process.env.NODE_ENV === 'production') {
|
| 6 |
+
b = require('./cjs/react-dom-server.edge.production.js');
|
| 7 |
+
l = require('./cjs/react-dom-server-legacy.browser.production.js');
|
| 8 |
+
} else {
|
| 9 |
+
b = require('./cjs/react-dom-server.edge.development.js');
|
| 10 |
+
l = require('./cjs/react-dom-server-legacy.browser.development.js');
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
exports.version = b.version;
|
| 14 |
+
exports.renderToReadableStream = b.renderToReadableStream;
|
| 15 |
+
exports.renderToString = l.renderToString;
|
| 16 |
+
exports.renderToStaticMarkup = l.renderToStaticMarkup;
|
| 17 |
+
exports.resume = b.resume;
|
frontend/node_modules/react-dom/server.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
module.exports = require('./server.node');
|
frontend/node_modules/react-dom/server.node.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var l, s;
|
| 4 |
+
if (process.env.NODE_ENV === 'production') {
|
| 5 |
+
l = require('./cjs/react-dom-server-legacy.node.production.js');
|
| 6 |
+
s = require('./cjs/react-dom-server.node.production.js');
|
| 7 |
+
} else {
|
| 8 |
+
l = require('./cjs/react-dom-server-legacy.node.development.js');
|
| 9 |
+
s = require('./cjs/react-dom-server.node.development.js');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
exports.version = l.version;
|
| 13 |
+
exports.renderToString = l.renderToString;
|
| 14 |
+
exports.renderToStaticMarkup = l.renderToStaticMarkup;
|
| 15 |
+
exports.renderToPipeableStream = s.renderToPipeableStream;
|
| 16 |
+
exports.renderToReadableStream = s.renderToReadableStream;
|
| 17 |
+
exports.resumeToPipeableStream = s.resumeToPipeableStream;
|
| 18 |
+
exports.resume = s.resume;
|
frontend/node_modules/react-dom/server.react-server.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
throw new Error(
|
| 4 |
+
'react-dom/server is not supported in React Server Components.'
|
| 5 |
+
);
|
frontend/node_modules/react-dom/static.browser.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var s;
|
| 4 |
+
if (process.env.NODE_ENV === 'production') {
|
| 5 |
+
s = require('./cjs/react-dom-server.browser.production.js');
|
| 6 |
+
} else {
|
| 7 |
+
s = require('./cjs/react-dom-server.browser.development.js');
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
exports.version = s.version;
|
| 11 |
+
exports.prerender = s.prerender;
|
| 12 |
+
exports.resumeAndPrerender = s.resumeAndPrerender;
|
frontend/node_modules/react-dom/static.edge.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var s;
|
| 4 |
+
if (process.env.NODE_ENV === 'production') {
|
| 5 |
+
s = require('./cjs/react-dom-server.edge.production.js');
|
| 6 |
+
} else {
|
| 7 |
+
s = require('./cjs/react-dom-server.edge.development.js');
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
exports.version = s.version;
|
| 11 |
+
exports.prerender = s.prerender;
|
| 12 |
+
exports.resumeAndPrerender = s.resumeAndPrerender;
|
frontend/node_modules/react-dom/static.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
module.exports = require('./static.node');
|
frontend/node_modules/react-dom/static.node.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var s;
|
| 4 |
+
if (process.env.NODE_ENV === 'production') {
|
| 5 |
+
s = require('./cjs/react-dom-server.node.production.js');
|
| 6 |
+
} else {
|
| 7 |
+
s = require('./cjs/react-dom-server.node.development.js');
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
exports.version = s.version;
|
| 11 |
+
exports.prerenderToNodeStream = s.prerenderToNodeStream;
|
| 12 |
+
exports.prerender = s.prerender;
|
| 13 |
+
exports.resumeAndPrerenderToNodeStream = s.resumeAndPrerenderToNodeStream;
|
| 14 |
+
exports.resumeAndPrerender = s.resumeAndPrerender;
|
frontend/node_modules/react-dom/static.react-server.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
throw new Error(
|
| 4 |
+
'react-dom/static is not supported in React Server Components.'
|
| 5 |
+
);
|
frontend/node_modules/react-dom/test-utils.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
if (process.env.NODE_ENV === 'production') {
|
| 4 |
+
module.exports = require('./cjs/react-dom-test-utils.production.js');
|
| 5 |
+
} else {
|
| 6 |
+
module.exports = require('./cjs/react-dom-test-utils.development.js');
|
| 7 |
+
}
|
frontend/node_modules/rolldown/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2024-present VoidZero Inc. & Contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
| 22 |
+
|
| 23 |
+
end of terms and conditions
|
| 24 |
+
|
| 25 |
+
The licenses of externally maintained libraries from which parts of the Software is derived are listed [here](https://github.com/rolldown/rolldown/blob/main/THIRD-PARTY-LICENSE).
|
frontend/node_modules/rolldown/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Rolldown
|
| 2 |
+
|
| 3 |
+
> Fast Rust-based bundler for JavaScript with Rollup-compatible API
|
| 4 |
+
|
| 5 |
+
- ⚡️ Lightning Fast Performance
|
| 6 |
+
- 🔌 Rollup-Compatible APIs
|
| 7 |
+
- ⏩ esbuild Feature Parity
|
| 8 |
+
|
| 9 |
+
Rolldown is primarily designed to serve as the underlying bundler in [Vite](https://vite.dev/), with the goal to replace esbuild and Rollup with one unified build tool. Although designed for Vite, Rolldown is also fully capable of being used as a standalone, general-purpose bundler. It can serve as a drop-in replacement for Rollup in most cases, and can also be used as an esbuild alternative when better chunking control is needed.
|
| 10 |
+
|
| 11 |
+
[Read the Docs to Learn More](https://rolldown.rs).
|
frontend/node_modules/rolldown/THIRD-PARTY-LICENSE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 6 |
+
|
| 7 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 10 |
+
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
MIT License
|
| 14 |
+
|
| 15 |
+
Copyright (c) 2020 Evan Wallace
|
| 16 |
+
|
| 17 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 18 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 19 |
+
in the Software without restriction, including without limitation the rights
|
| 20 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 21 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 22 |
+
furnished to do so, subject to the following conditions:
|
| 23 |
+
|
| 24 |
+
The above copyright notice and this permission notice shall be included in all
|
| 25 |
+
copies or substantial portions of the Software.
|
| 26 |
+
|
| 27 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 28 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 29 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 30 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 31 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 32 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 33 |
+
SOFTWARE.
|
frontend/node_modules/rolldown/bin/cli.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
import '../dist/cli.mjs';
|
frontend/node_modules/rolldown/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export {}
|
frontend/node_modules/rolldown/dist/cli.mjs
ADDED
|
@@ -0,0 +1,1208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { n as onExit, t as watch } from "./shared/watch-BW4p8Vif.mjs";
|
| 2 |
+
import { D as version, E as description } from "./shared/bindingify-input-options-CMab5gbt.mjs";
|
| 3 |
+
import { t as arraify } from "./shared/misc-DOSKtd97.mjs";
|
| 4 |
+
import { a as getOutputCliKeys, c as styleText, i as getInputCliKeys, n as logger, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/create-bundler-option-BZD-ER-Z.mjs";
|
| 5 |
+
import { t as rolldown } from "./shared/rolldown-I5b6h5Km.mjs";
|
| 6 |
+
import { t as loadConfig } from "./shared/load-config-ChaLPL3M.mjs";
|
| 7 |
+
import path from "node:path";
|
| 8 |
+
import g$1 from "node:process";
|
| 9 |
+
import { performance } from "node:perf_hooks";
|
| 10 |
+
//#region ../../node_modules/.pnpm/cac@7.0.0/node_modules/cac/dist/index.js
|
| 11 |
+
function toArr(any) {
|
| 12 |
+
return any == null ? [] : Array.isArray(any) ? any : [any];
|
| 13 |
+
}
|
| 14 |
+
function toVal(out, key, val, opts) {
|
| 15 |
+
var x, old = out[key], nxt = !!~opts.string.indexOf(key) ? val == null || val === true ? "" : String(val) : typeof val === "boolean" ? val : !!~opts.boolean.indexOf(key) ? val === "false" ? false : val === "true" || (out._.push((x = +val, x * 0 === 0) ? x : val), !!val) : (x = +val, x * 0 === 0) ? x : val;
|
| 16 |
+
out[key] = old == null ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
|
| 17 |
+
}
|
| 18 |
+
function lib_default(args, opts) {
|
| 19 |
+
args = args || [];
|
| 20 |
+
opts = opts || {};
|
| 21 |
+
var k, arr, arg, name, val, out = { _: [] };
|
| 22 |
+
var i = 0, j = 0, idx = 0, len = args.length;
|
| 23 |
+
const alibi = opts.alias !== void 0;
|
| 24 |
+
const strict = opts.unknown !== void 0;
|
| 25 |
+
const defaults = opts.default !== void 0;
|
| 26 |
+
opts.alias = opts.alias || {};
|
| 27 |
+
opts.string = toArr(opts.string);
|
| 28 |
+
opts.boolean = toArr(opts.boolean);
|
| 29 |
+
if (alibi) for (k in opts.alias) {
|
| 30 |
+
arr = opts.alias[k] = toArr(opts.alias[k]);
|
| 31 |
+
for (i = 0; i < arr.length; i++) (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
|
| 32 |
+
}
|
| 33 |
+
for (i = opts.boolean.length; i-- > 0;) {
|
| 34 |
+
arr = opts.alias[opts.boolean[i]] || [];
|
| 35 |
+
for (j = arr.length; j-- > 0;) opts.boolean.push(arr[j]);
|
| 36 |
+
}
|
| 37 |
+
for (i = opts.string.length; i-- > 0;) {
|
| 38 |
+
arr = opts.alias[opts.string[i]] || [];
|
| 39 |
+
for (j = arr.length; j-- > 0;) opts.string.push(arr[j]);
|
| 40 |
+
}
|
| 41 |
+
if (defaults) for (k in opts.default) {
|
| 42 |
+
name = typeof opts.default[k];
|
| 43 |
+
arr = opts.alias[k] = opts.alias[k] || [];
|
| 44 |
+
if (opts[name] !== void 0) {
|
| 45 |
+
opts[name].push(k);
|
| 46 |
+
for (i = 0; i < arr.length; i++) opts[name].push(arr[i]);
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
const keys = strict ? Object.keys(opts.alias) : [];
|
| 50 |
+
for (i = 0; i < len; i++) {
|
| 51 |
+
arg = args[i];
|
| 52 |
+
if (arg === "--") {
|
| 53 |
+
out._ = out._.concat(args.slice(++i));
|
| 54 |
+
break;
|
| 55 |
+
}
|
| 56 |
+
for (j = 0; j < arg.length; j++) if (arg.charCodeAt(j) !== 45) break;
|
| 57 |
+
if (j === 0) out._.push(arg);
|
| 58 |
+
else if (arg.substring(j, j + 3) === "no-") {
|
| 59 |
+
name = arg.substring(j + 3);
|
| 60 |
+
if (strict && !~keys.indexOf(name)) return opts.unknown(arg);
|
| 61 |
+
out[name] = false;
|
| 62 |
+
} else {
|
| 63 |
+
for (idx = j + 1; idx < arg.length; idx++) if (arg.charCodeAt(idx) === 61) break;
|
| 64 |
+
name = arg.substring(j, idx);
|
| 65 |
+
val = arg.substring(++idx) || i + 1 === len || ("" + args[i + 1]).charCodeAt(0) === 45 || args[++i];
|
| 66 |
+
arr = j === 2 ? [name] : name;
|
| 67 |
+
for (idx = 0; idx < arr.length; idx++) {
|
| 68 |
+
name = arr[idx];
|
| 69 |
+
if (strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
|
| 70 |
+
toVal(out, name, idx + 1 < arr.length || val, opts);
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
if (defaults) {
|
| 75 |
+
for (k in opts.default) if (out[k] === void 0) out[k] = opts.default[k];
|
| 76 |
+
}
|
| 77 |
+
if (alibi) for (k in out) {
|
| 78 |
+
arr = opts.alias[k] || [];
|
| 79 |
+
while (arr.length > 0) out[arr.shift()] = out[k];
|
| 80 |
+
}
|
| 81 |
+
return out;
|
| 82 |
+
}
|
| 83 |
+
function removeBrackets(v) {
|
| 84 |
+
return v.replace(/[<[].+/, "").trim();
|
| 85 |
+
}
|
| 86 |
+
function findAllBrackets(v) {
|
| 87 |
+
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
|
| 88 |
+
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
|
| 89 |
+
const res = [];
|
| 90 |
+
const parse = (match) => {
|
| 91 |
+
let variadic = false;
|
| 92 |
+
let value = match[1];
|
| 93 |
+
if (value.startsWith("...")) {
|
| 94 |
+
value = value.slice(3);
|
| 95 |
+
variadic = true;
|
| 96 |
+
}
|
| 97 |
+
return {
|
| 98 |
+
required: match[0].startsWith("<"),
|
| 99 |
+
value,
|
| 100 |
+
variadic
|
| 101 |
+
};
|
| 102 |
+
};
|
| 103 |
+
let angledMatch;
|
| 104 |
+
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) res.push(parse(angledMatch));
|
| 105 |
+
let squareMatch;
|
| 106 |
+
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) res.push(parse(squareMatch));
|
| 107 |
+
return res;
|
| 108 |
+
}
|
| 109 |
+
function getMriOptions(options) {
|
| 110 |
+
const result = {
|
| 111 |
+
alias: {},
|
| 112 |
+
boolean: []
|
| 113 |
+
};
|
| 114 |
+
for (const [index, option] of options.entries()) {
|
| 115 |
+
if (option.names.length > 1) result.alias[option.names[0]] = option.names.slice(1);
|
| 116 |
+
if (option.isBoolean) if (option.negated) {
|
| 117 |
+
if (!options.some((o, i) => {
|
| 118 |
+
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
|
| 119 |
+
})) result.boolean.push(option.names[0]);
|
| 120 |
+
} else result.boolean.push(option.names[0]);
|
| 121 |
+
}
|
| 122 |
+
return result;
|
| 123 |
+
}
|
| 124 |
+
function findLongest(arr) {
|
| 125 |
+
return arr.sort((a, b) => {
|
| 126 |
+
return a.length > b.length ? -1 : 1;
|
| 127 |
+
})[0];
|
| 128 |
+
}
|
| 129 |
+
function padRight(str, length) {
|
| 130 |
+
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
| 131 |
+
}
|
| 132 |
+
function camelcase(input) {
|
| 133 |
+
return input.replaceAll(/([a-z])-([a-z])/g, (_, p1, p2) => {
|
| 134 |
+
return p1 + p2.toUpperCase();
|
| 135 |
+
});
|
| 136 |
+
}
|
| 137 |
+
function setDotProp(obj, keys, val) {
|
| 138 |
+
let current = obj;
|
| 139 |
+
for (let i = 0; i < keys.length; i++) {
|
| 140 |
+
const key = keys[i];
|
| 141 |
+
if (i === keys.length - 1) {
|
| 142 |
+
current[key] = val;
|
| 143 |
+
return;
|
| 144 |
+
}
|
| 145 |
+
if (current[key] == null) {
|
| 146 |
+
const nextKeyIsArrayIndex = +keys[i + 1] > -1;
|
| 147 |
+
current[key] = nextKeyIsArrayIndex ? [] : {};
|
| 148 |
+
}
|
| 149 |
+
current = current[key];
|
| 150 |
+
}
|
| 151 |
+
}
|
| 152 |
+
function setByType(obj, transforms) {
|
| 153 |
+
for (const key of Object.keys(transforms)) {
|
| 154 |
+
const transform = transforms[key];
|
| 155 |
+
if (transform.shouldTransform) {
|
| 156 |
+
obj[key] = [obj[key]].flat();
|
| 157 |
+
if (typeof transform.transformFunction === "function") obj[key] = obj[key].map(transform.transformFunction);
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
function getFileName(input) {
|
| 162 |
+
const m = /([^\\/]+)$/.exec(input);
|
| 163 |
+
return m ? m[1] : "";
|
| 164 |
+
}
|
| 165 |
+
function camelcaseOptionName(name) {
|
| 166 |
+
return name.split(".").map((v, i) => {
|
| 167 |
+
return i === 0 ? camelcase(v) : v;
|
| 168 |
+
}).join(".");
|
| 169 |
+
}
|
| 170 |
+
var CACError = class extends Error {
|
| 171 |
+
constructor(message) {
|
| 172 |
+
super(message);
|
| 173 |
+
this.name = "CACError";
|
| 174 |
+
if (typeof Error.captureStackTrace !== "function") this.stack = new Error(message).stack;
|
| 175 |
+
}
|
| 176 |
+
};
|
| 177 |
+
var Option = class {
|
| 178 |
+
rawName;
|
| 179 |
+
description;
|
| 180 |
+
/** Option name */
|
| 181 |
+
name;
|
| 182 |
+
/** Option name and aliases */
|
| 183 |
+
names;
|
| 184 |
+
isBoolean;
|
| 185 |
+
required;
|
| 186 |
+
config;
|
| 187 |
+
negated;
|
| 188 |
+
constructor(rawName, description, config) {
|
| 189 |
+
this.rawName = rawName;
|
| 190 |
+
this.description = description;
|
| 191 |
+
this.config = Object.assign({}, config);
|
| 192 |
+
rawName = rawName.replaceAll(".*", "");
|
| 193 |
+
this.negated = false;
|
| 194 |
+
this.names = removeBrackets(rawName).split(",").map((v) => {
|
| 195 |
+
let name = v.trim().replace(/^-{1,2}/, "");
|
| 196 |
+
if (name.startsWith("no-")) {
|
| 197 |
+
this.negated = true;
|
| 198 |
+
name = name.replace(/^no-/, "");
|
| 199 |
+
}
|
| 200 |
+
return camelcaseOptionName(name);
|
| 201 |
+
}).sort((a, b) => a.length > b.length ? 1 : -1);
|
| 202 |
+
this.name = this.names.at(-1);
|
| 203 |
+
if (this.negated && this.config.default == null) this.config.default = true;
|
| 204 |
+
if (rawName.includes("<")) this.required = true;
|
| 205 |
+
else if (rawName.includes("[")) this.required = false;
|
| 206 |
+
else this.isBoolean = true;
|
| 207 |
+
}
|
| 208 |
+
};
|
| 209 |
+
let runtimeProcessArgs;
|
| 210 |
+
let runtimeInfo;
|
| 211 |
+
if (typeof process !== "undefined") {
|
| 212 |
+
let runtimeName;
|
| 213 |
+
if (typeof Deno !== "undefined" && typeof Deno.version?.deno === "string") runtimeName = "deno";
|
| 214 |
+
else if (typeof Bun !== "undefined" && typeof Bun.version === "string") runtimeName = "bun";
|
| 215 |
+
else runtimeName = "node";
|
| 216 |
+
runtimeInfo = `${process.platform}-${process.arch} ${runtimeName}-${process.version}`;
|
| 217 |
+
runtimeProcessArgs = process.argv;
|
| 218 |
+
} else if (typeof navigator === "undefined") runtimeInfo = `unknown`;
|
| 219 |
+
else runtimeInfo = `${navigator.platform} ${navigator.userAgent}`;
|
| 220 |
+
var Command = class {
|
| 221 |
+
rawName;
|
| 222 |
+
description;
|
| 223 |
+
config;
|
| 224 |
+
cli;
|
| 225 |
+
options;
|
| 226 |
+
aliasNames;
|
| 227 |
+
name;
|
| 228 |
+
args;
|
| 229 |
+
commandAction;
|
| 230 |
+
usageText;
|
| 231 |
+
versionNumber;
|
| 232 |
+
examples;
|
| 233 |
+
helpCallback;
|
| 234 |
+
globalCommand;
|
| 235 |
+
constructor(rawName, description, config = {}, cli) {
|
| 236 |
+
this.rawName = rawName;
|
| 237 |
+
this.description = description;
|
| 238 |
+
this.config = config;
|
| 239 |
+
this.cli = cli;
|
| 240 |
+
this.options = [];
|
| 241 |
+
this.aliasNames = [];
|
| 242 |
+
this.name = removeBrackets(rawName);
|
| 243 |
+
this.args = findAllBrackets(rawName);
|
| 244 |
+
this.examples = [];
|
| 245 |
+
}
|
| 246 |
+
usage(text) {
|
| 247 |
+
this.usageText = text;
|
| 248 |
+
return this;
|
| 249 |
+
}
|
| 250 |
+
allowUnknownOptions() {
|
| 251 |
+
this.config.allowUnknownOptions = true;
|
| 252 |
+
return this;
|
| 253 |
+
}
|
| 254 |
+
ignoreOptionDefaultValue() {
|
| 255 |
+
this.config.ignoreOptionDefaultValue = true;
|
| 256 |
+
return this;
|
| 257 |
+
}
|
| 258 |
+
version(version, customFlags = "-v, --version") {
|
| 259 |
+
this.versionNumber = version;
|
| 260 |
+
this.option(customFlags, "Display version number");
|
| 261 |
+
return this;
|
| 262 |
+
}
|
| 263 |
+
example(example) {
|
| 264 |
+
this.examples.push(example);
|
| 265 |
+
return this;
|
| 266 |
+
}
|
| 267 |
+
/**
|
| 268 |
+
* Add a option for this command
|
| 269 |
+
* @param rawName Raw option name(s)
|
| 270 |
+
* @param description Option description
|
| 271 |
+
* @param config Option config
|
| 272 |
+
*/
|
| 273 |
+
option(rawName, description, config) {
|
| 274 |
+
const option = new Option(rawName, description, config);
|
| 275 |
+
this.options.push(option);
|
| 276 |
+
return this;
|
| 277 |
+
}
|
| 278 |
+
alias(name) {
|
| 279 |
+
this.aliasNames.push(name);
|
| 280 |
+
return this;
|
| 281 |
+
}
|
| 282 |
+
action(callback) {
|
| 283 |
+
this.commandAction = callback;
|
| 284 |
+
return this;
|
| 285 |
+
}
|
| 286 |
+
/**
|
| 287 |
+
* Check if a command name is matched by this command
|
| 288 |
+
* @param name Command name
|
| 289 |
+
*/
|
| 290 |
+
isMatched(name) {
|
| 291 |
+
return this.name === name || this.aliasNames.includes(name);
|
| 292 |
+
}
|
| 293 |
+
get isDefaultCommand() {
|
| 294 |
+
return this.name === "" || this.aliasNames.includes("!");
|
| 295 |
+
}
|
| 296 |
+
get isGlobalCommand() {
|
| 297 |
+
return this instanceof GlobalCommand;
|
| 298 |
+
}
|
| 299 |
+
/**
|
| 300 |
+
* Check if an option is registered in this command
|
| 301 |
+
* @param name Option name
|
| 302 |
+
*/
|
| 303 |
+
hasOption(name) {
|
| 304 |
+
name = name.split(".")[0];
|
| 305 |
+
return this.options.find((option) => {
|
| 306 |
+
return option.names.includes(name);
|
| 307 |
+
});
|
| 308 |
+
}
|
| 309 |
+
outputHelp() {
|
| 310 |
+
const { name, commands } = this.cli;
|
| 311 |
+
const { versionNumber, options: globalOptions, helpCallback } = this.cli.globalCommand;
|
| 312 |
+
let sections = [{ body: `${name}${versionNumber ? `/${versionNumber}` : ""}` }];
|
| 313 |
+
sections.push({
|
| 314 |
+
title: "Usage",
|
| 315 |
+
body: ` $ ${name} ${this.usageText || this.rawName}`
|
| 316 |
+
});
|
| 317 |
+
if ((this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0) {
|
| 318 |
+
const longestCommandName = findLongest(commands.map((command) => command.rawName));
|
| 319 |
+
sections.push({
|
| 320 |
+
title: "Commands",
|
| 321 |
+
body: commands.map((command) => {
|
| 322 |
+
return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
|
| 323 |
+
}).join("\n")
|
| 324 |
+
}, {
|
| 325 |
+
title: `For more info, run any command with the \`--help\` flag`,
|
| 326 |
+
body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n")
|
| 327 |
+
});
|
| 328 |
+
}
|
| 329 |
+
let options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []];
|
| 330 |
+
if (!this.isGlobalCommand && !this.isDefaultCommand) options = options.filter((option) => option.name !== "version");
|
| 331 |
+
if (options.length > 0) {
|
| 332 |
+
const longestOptionName = findLongest(options.map((option) => option.rawName));
|
| 333 |
+
sections.push({
|
| 334 |
+
title: "Options",
|
| 335 |
+
body: options.map((option) => {
|
| 336 |
+
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`;
|
| 337 |
+
}).join("\n")
|
| 338 |
+
});
|
| 339 |
+
}
|
| 340 |
+
if (this.examples.length > 0) sections.push({
|
| 341 |
+
title: "Examples",
|
| 342 |
+
body: this.examples.map((example) => {
|
| 343 |
+
if (typeof example === "function") return example(name);
|
| 344 |
+
return example;
|
| 345 |
+
}).join("\n")
|
| 346 |
+
});
|
| 347 |
+
if (helpCallback) sections = helpCallback(sections) || sections;
|
| 348 |
+
console.info(sections.map((section) => {
|
| 349 |
+
return section.title ? `${section.title}:\n${section.body}` : section.body;
|
| 350 |
+
}).join("\n\n"));
|
| 351 |
+
}
|
| 352 |
+
outputVersion() {
|
| 353 |
+
const { name } = this.cli;
|
| 354 |
+
const { versionNumber } = this.cli.globalCommand;
|
| 355 |
+
if (versionNumber) console.info(`${name}/${versionNumber} ${runtimeInfo}`);
|
| 356 |
+
}
|
| 357 |
+
checkRequiredArgs() {
|
| 358 |
+
const minimalArgsCount = this.args.filter((arg) => arg.required).length;
|
| 359 |
+
if (this.cli.args.length < minimalArgsCount) throw new CACError(`missing required args for command \`${this.rawName}\``);
|
| 360 |
+
}
|
| 361 |
+
/**
|
| 362 |
+
* Check if the parsed options contain any unknown options
|
| 363 |
+
*
|
| 364 |
+
* Exit and output error when true
|
| 365 |
+
*/
|
| 366 |
+
checkUnknownOptions() {
|
| 367 |
+
const { options, globalCommand } = this.cli;
|
| 368 |
+
if (!this.config.allowUnknownOptions) {
|
| 369 |
+
for (const name of Object.keys(options)) if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
|
| 370 |
+
}
|
| 371 |
+
}
|
| 372 |
+
/**
|
| 373 |
+
* Check if the required string-type options exist
|
| 374 |
+
*/
|
| 375 |
+
checkOptionValue() {
|
| 376 |
+
const { options: parsedOptions, globalCommand } = this.cli;
|
| 377 |
+
const options = [...globalCommand.options, ...this.options];
|
| 378 |
+
for (const option of options) {
|
| 379 |
+
const value = parsedOptions[option.name.split(".")[0]];
|
| 380 |
+
if (option.required) {
|
| 381 |
+
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
|
| 382 |
+
if (value === true || value === false && !hasNegated) throw new CACError(`option \`${option.rawName}\` value is missing`);
|
| 383 |
+
}
|
| 384 |
+
}
|
| 385 |
+
}
|
| 386 |
+
/**
|
| 387 |
+
* Check if the number of args is more than expected
|
| 388 |
+
*/
|
| 389 |
+
checkUnusedArgs() {
|
| 390 |
+
const maximumArgsCount = this.args.some((arg) => arg.variadic) ? Infinity : this.args.length;
|
| 391 |
+
if (maximumArgsCount < this.cli.args.length) throw new CACError(`Unused args: ${this.cli.args.slice(maximumArgsCount).map((arg) => `\`${arg}\``).join(", ")}`);
|
| 392 |
+
}
|
| 393 |
+
};
|
| 394 |
+
var GlobalCommand = class extends Command {
|
| 395 |
+
constructor(cli) {
|
| 396 |
+
super("@@global@@", "", {}, cli);
|
| 397 |
+
}
|
| 398 |
+
};
|
| 399 |
+
var CAC = class extends EventTarget {
|
| 400 |
+
/** The program name to display in help and version message */
|
| 401 |
+
name;
|
| 402 |
+
commands;
|
| 403 |
+
globalCommand;
|
| 404 |
+
matchedCommand;
|
| 405 |
+
matchedCommandName;
|
| 406 |
+
/**
|
| 407 |
+
* Raw CLI arguments
|
| 408 |
+
*/
|
| 409 |
+
rawArgs;
|
| 410 |
+
/**
|
| 411 |
+
* Parsed CLI arguments
|
| 412 |
+
*/
|
| 413 |
+
args;
|
| 414 |
+
/**
|
| 415 |
+
* Parsed CLI options, camelCased
|
| 416 |
+
*/
|
| 417 |
+
options;
|
| 418 |
+
showHelpOnExit;
|
| 419 |
+
showVersionOnExit;
|
| 420 |
+
/**
|
| 421 |
+
* @param name The program name to display in help and version message
|
| 422 |
+
*/
|
| 423 |
+
constructor(name = "") {
|
| 424 |
+
super();
|
| 425 |
+
this.name = name;
|
| 426 |
+
this.commands = [];
|
| 427 |
+
this.rawArgs = [];
|
| 428 |
+
this.args = [];
|
| 429 |
+
this.options = {};
|
| 430 |
+
this.globalCommand = new GlobalCommand(this);
|
| 431 |
+
this.globalCommand.usage("<command> [options]");
|
| 432 |
+
}
|
| 433 |
+
/**
|
| 434 |
+
* Add a global usage text.
|
| 435 |
+
*
|
| 436 |
+
* This is not used by sub-commands.
|
| 437 |
+
*/
|
| 438 |
+
usage(text) {
|
| 439 |
+
this.globalCommand.usage(text);
|
| 440 |
+
return this;
|
| 441 |
+
}
|
| 442 |
+
/**
|
| 443 |
+
* Add a sub-command
|
| 444 |
+
*/
|
| 445 |
+
command(rawName, description, config) {
|
| 446 |
+
const command = new Command(rawName, description || "", config, this);
|
| 447 |
+
command.globalCommand = this.globalCommand;
|
| 448 |
+
this.commands.push(command);
|
| 449 |
+
return command;
|
| 450 |
+
}
|
| 451 |
+
/**
|
| 452 |
+
* Add a global CLI option.
|
| 453 |
+
*
|
| 454 |
+
* Which is also applied to sub-commands.
|
| 455 |
+
*/
|
| 456 |
+
option(rawName, description, config) {
|
| 457 |
+
this.globalCommand.option(rawName, description, config);
|
| 458 |
+
return this;
|
| 459 |
+
}
|
| 460 |
+
/**
|
| 461 |
+
* Show help message when `-h, --help` flags appear.
|
| 462 |
+
*
|
| 463 |
+
*/
|
| 464 |
+
help(callback) {
|
| 465 |
+
this.globalCommand.option("-h, --help", "Display this message");
|
| 466 |
+
this.globalCommand.helpCallback = callback;
|
| 467 |
+
this.showHelpOnExit = true;
|
| 468 |
+
return this;
|
| 469 |
+
}
|
| 470 |
+
/**
|
| 471 |
+
* Show version number when `-v, --version` flags appear.
|
| 472 |
+
*
|
| 473 |
+
*/
|
| 474 |
+
version(version, customFlags = "-v, --version") {
|
| 475 |
+
this.globalCommand.version(version, customFlags);
|
| 476 |
+
this.showVersionOnExit = true;
|
| 477 |
+
return this;
|
| 478 |
+
}
|
| 479 |
+
/**
|
| 480 |
+
* Add a global example.
|
| 481 |
+
*
|
| 482 |
+
* This example added here will not be used by sub-commands.
|
| 483 |
+
*/
|
| 484 |
+
example(example) {
|
| 485 |
+
this.globalCommand.example(example);
|
| 486 |
+
return this;
|
| 487 |
+
}
|
| 488 |
+
/**
|
| 489 |
+
* Output the corresponding help message
|
| 490 |
+
* When a sub-command is matched, output the help message for the command
|
| 491 |
+
* Otherwise output the global one.
|
| 492 |
+
*
|
| 493 |
+
*/
|
| 494 |
+
outputHelp() {
|
| 495 |
+
if (this.matchedCommand) this.matchedCommand.outputHelp();
|
| 496 |
+
else this.globalCommand.outputHelp();
|
| 497 |
+
}
|
| 498 |
+
/**
|
| 499 |
+
* Output the version number.
|
| 500 |
+
*
|
| 501 |
+
*/
|
| 502 |
+
outputVersion() {
|
| 503 |
+
this.globalCommand.outputVersion();
|
| 504 |
+
}
|
| 505 |
+
setParsedInfo({ args, options }, matchedCommand, matchedCommandName) {
|
| 506 |
+
this.args = args;
|
| 507 |
+
this.options = options;
|
| 508 |
+
if (matchedCommand) this.matchedCommand = matchedCommand;
|
| 509 |
+
if (matchedCommandName) this.matchedCommandName = matchedCommandName;
|
| 510 |
+
return this;
|
| 511 |
+
}
|
| 512 |
+
unsetMatchedCommand() {
|
| 513 |
+
this.matchedCommand = void 0;
|
| 514 |
+
this.matchedCommandName = void 0;
|
| 515 |
+
}
|
| 516 |
+
/**
|
| 517 |
+
* Parse argv
|
| 518 |
+
*/
|
| 519 |
+
parse(argv, { run = true } = {}) {
|
| 520 |
+
if (!argv) {
|
| 521 |
+
if (!runtimeProcessArgs) throw new Error("No argv provided and runtime process argv is not available.");
|
| 522 |
+
argv = runtimeProcessArgs;
|
| 523 |
+
}
|
| 524 |
+
this.rawArgs = argv;
|
| 525 |
+
if (!this.name) this.name = argv[1] ? getFileName(argv[1]) : "cli";
|
| 526 |
+
let shouldParse = true;
|
| 527 |
+
for (const command of this.commands) {
|
| 528 |
+
const parsed = this.mri(argv.slice(2), command);
|
| 529 |
+
const commandName = parsed.args[0];
|
| 530 |
+
if (command.isMatched(commandName)) {
|
| 531 |
+
shouldParse = false;
|
| 532 |
+
const parsedInfo = {
|
| 533 |
+
...parsed,
|
| 534 |
+
args: parsed.args.slice(1)
|
| 535 |
+
};
|
| 536 |
+
this.setParsedInfo(parsedInfo, command, commandName);
|
| 537 |
+
this.dispatchEvent(new CustomEvent(`command:${commandName}`, { detail: command }));
|
| 538 |
+
}
|
| 539 |
+
}
|
| 540 |
+
if (shouldParse) {
|
| 541 |
+
for (const command of this.commands) if (command.isDefaultCommand) {
|
| 542 |
+
shouldParse = false;
|
| 543 |
+
const parsed = this.mri(argv.slice(2), command);
|
| 544 |
+
this.setParsedInfo(parsed, command);
|
| 545 |
+
this.dispatchEvent(new CustomEvent("command:!", { detail: command }));
|
| 546 |
+
}
|
| 547 |
+
}
|
| 548 |
+
if (shouldParse) {
|
| 549 |
+
const parsed = this.mri(argv.slice(2));
|
| 550 |
+
this.setParsedInfo(parsed);
|
| 551 |
+
}
|
| 552 |
+
if (this.options.help && this.showHelpOnExit) {
|
| 553 |
+
this.outputHelp();
|
| 554 |
+
run = false;
|
| 555 |
+
this.unsetMatchedCommand();
|
| 556 |
+
}
|
| 557 |
+
if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) {
|
| 558 |
+
this.outputVersion();
|
| 559 |
+
run = false;
|
| 560 |
+
this.unsetMatchedCommand();
|
| 561 |
+
}
|
| 562 |
+
const parsedArgv = {
|
| 563 |
+
args: this.args,
|
| 564 |
+
options: this.options
|
| 565 |
+
};
|
| 566 |
+
if (run) this.runMatchedCommand();
|
| 567 |
+
if (!this.matchedCommand && this.args[0]) this.dispatchEvent(new CustomEvent("command:*", { detail: this.args[0] }));
|
| 568 |
+
return parsedArgv;
|
| 569 |
+
}
|
| 570 |
+
mri(argv, command) {
|
| 571 |
+
const cliOptions = [...this.globalCommand.options, ...command ? command.options : []];
|
| 572 |
+
const mriOptions = getMriOptions(cliOptions);
|
| 573 |
+
let argsAfterDoubleDashes = [];
|
| 574 |
+
const doubleDashesIndex = argv.indexOf("--");
|
| 575 |
+
if (doubleDashesIndex !== -1) {
|
| 576 |
+
argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
|
| 577 |
+
argv = argv.slice(0, doubleDashesIndex);
|
| 578 |
+
}
|
| 579 |
+
let parsed = lib_default(argv, mriOptions);
|
| 580 |
+
parsed = Object.keys(parsed).reduce((res, name) => {
|
| 581 |
+
return {
|
| 582 |
+
...res,
|
| 583 |
+
[camelcaseOptionName(name)]: parsed[name]
|
| 584 |
+
};
|
| 585 |
+
}, { _: [] });
|
| 586 |
+
const args = parsed._;
|
| 587 |
+
const options = { "--": argsAfterDoubleDashes };
|
| 588 |
+
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
|
| 589 |
+
const transforms = Object.create(null);
|
| 590 |
+
for (const cliOption of cliOptions) {
|
| 591 |
+
if (!ignoreDefault && cliOption.config.default !== void 0) for (const name of cliOption.names) options[name] = cliOption.config.default;
|
| 592 |
+
if (Array.isArray(cliOption.config.type) && transforms[cliOption.name] === void 0) {
|
| 593 |
+
transforms[cliOption.name] = Object.create(null);
|
| 594 |
+
transforms[cliOption.name].shouldTransform = true;
|
| 595 |
+
transforms[cliOption.name].transformFunction = cliOption.config.type[0];
|
| 596 |
+
}
|
| 597 |
+
}
|
| 598 |
+
for (const key of Object.keys(parsed)) if (key !== "_") {
|
| 599 |
+
setDotProp(options, key.split("."), parsed[key]);
|
| 600 |
+
setByType(options, transforms);
|
| 601 |
+
}
|
| 602 |
+
return {
|
| 603 |
+
args,
|
| 604 |
+
options
|
| 605 |
+
};
|
| 606 |
+
}
|
| 607 |
+
runMatchedCommand() {
|
| 608 |
+
const { args, options, matchedCommand: command } = this;
|
| 609 |
+
if (!command || !command.commandAction) return;
|
| 610 |
+
command.checkUnknownOptions();
|
| 611 |
+
command.checkOptionValue();
|
| 612 |
+
command.checkRequiredArgs();
|
| 613 |
+
command.checkUnusedArgs();
|
| 614 |
+
const actionArgs = [];
|
| 615 |
+
command.args.forEach((arg, index) => {
|
| 616 |
+
if (arg.variadic) actionArgs.push(args.slice(index));
|
| 617 |
+
else actionArgs.push(args[index]);
|
| 618 |
+
});
|
| 619 |
+
actionArgs.push(options);
|
| 620 |
+
return command.commandAction.apply(this, actionArgs);
|
| 621 |
+
}
|
| 622 |
+
};
|
| 623 |
+
/**
|
| 624 |
+
* @param name The program name to display in help and version message
|
| 625 |
+
*/
|
| 626 |
+
const cac = (name = "") => new CAC(name);
|
| 627 |
+
//#endregion
|
| 628 |
+
//#region src/cli/arguments/alias.ts
|
| 629 |
+
const alias = {
|
| 630 |
+
config: {
|
| 631 |
+
abbreviation: "c",
|
| 632 |
+
hint: "filename"
|
| 633 |
+
},
|
| 634 |
+
configLoader: { hint: "loader" },
|
| 635 |
+
help: { abbreviation: "h" },
|
| 636 |
+
version: { abbreviation: "v" },
|
| 637 |
+
watch: { abbreviation: "w" },
|
| 638 |
+
dir: {
|
| 639 |
+
abbreviation: "d",
|
| 640 |
+
requireValue: true
|
| 641 |
+
},
|
| 642 |
+
file: {
|
| 643 |
+
abbreviation: "o",
|
| 644 |
+
requireValue: true
|
| 645 |
+
},
|
| 646 |
+
external: { abbreviation: "e" },
|
| 647 |
+
format: { abbreviation: "f" },
|
| 648 |
+
name: { abbreviation: "n" },
|
| 649 |
+
globals: { abbreviation: "g" },
|
| 650 |
+
sourcemap: { abbreviation: "s" },
|
| 651 |
+
minify: { abbreviation: "m" },
|
| 652 |
+
platform: { abbreviation: "p" },
|
| 653 |
+
assetFileNames: { hint: "name" },
|
| 654 |
+
chunkFileNames: { hint: "name" },
|
| 655 |
+
entryFileNames: { hint: "name" },
|
| 656 |
+
externalLiveBindings: { reverse: true },
|
| 657 |
+
treeshake: { reverse: true },
|
| 658 |
+
preserveEntrySignatures: { reverse: true },
|
| 659 |
+
moduleTypes: { hint: "types" }
|
| 660 |
+
};
|
| 661 |
+
//#endregion
|
| 662 |
+
//#region src/cli/arguments/utils.ts
|
| 663 |
+
function setNestedProperty(obj, path, value) {
|
| 664 |
+
const keys = path.split(".");
|
| 665 |
+
let current = obj;
|
| 666 |
+
for (let i = 0; i < keys.length - 1; i++) {
|
| 667 |
+
if (!current[keys[i]]) current[keys[i]] = {};
|
| 668 |
+
current = current[keys[i]];
|
| 669 |
+
}
|
| 670 |
+
const finalKey = keys[keys.length - 1];
|
| 671 |
+
Object.defineProperty(current, finalKey, {
|
| 672 |
+
value,
|
| 673 |
+
writable: true,
|
| 674 |
+
enumerable: true,
|
| 675 |
+
configurable: true
|
| 676 |
+
});
|
| 677 |
+
}
|
| 678 |
+
function camelCaseToKebabCase(str) {
|
| 679 |
+
return str.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
| 680 |
+
}
|
| 681 |
+
//#endregion
|
| 682 |
+
//#region src/cli/arguments/normalize.ts
|
| 683 |
+
const reservedKeys = /* @__PURE__ */ new Set([
|
| 684 |
+
"help",
|
| 685 |
+
"version",
|
| 686 |
+
"config",
|
| 687 |
+
"watch",
|
| 688 |
+
"environment",
|
| 689 |
+
"configLoader"
|
| 690 |
+
]);
|
| 691 |
+
function normalizeCliOptions(cliOptions, positionals) {
|
| 692 |
+
const [data, errors] = validateCliOptions(cliOptions);
|
| 693 |
+
if (errors?.length) {
|
| 694 |
+
errors.forEach((error) => {
|
| 695 |
+
logger.error(`${error}. You can use \`rolldown -h\` to see the help.`);
|
| 696 |
+
});
|
| 697 |
+
process.exit(1);
|
| 698 |
+
}
|
| 699 |
+
const options = data ?? {};
|
| 700 |
+
const result = {
|
| 701 |
+
input: {},
|
| 702 |
+
output: {},
|
| 703 |
+
help: options.help ?? false,
|
| 704 |
+
version: options.version ?? false,
|
| 705 |
+
watch: options.watch ?? false
|
| 706 |
+
};
|
| 707 |
+
if (typeof options.config === "string") result.config = options.config;
|
| 708 |
+
else if (options.config === true) result.config = "";
|
| 709 |
+
if (options.environment !== void 0) result.environment = options.environment;
|
| 710 |
+
if (options.configLoader !== void 0) result.configLoader = options.configLoader;
|
| 711 |
+
const keysOfInput = new Set(getInputCliKeys());
|
| 712 |
+
const keysOfOutput = new Set(getOutputCliKeys());
|
| 713 |
+
for (let [key, value] of Object.entries(options)) {
|
| 714 |
+
const [primary] = key.split(".");
|
| 715 |
+
if (keysOfInput.has(primary)) setNestedProperty(result.input, key, value);
|
| 716 |
+
else if (keysOfOutput.has(primary)) setNestedProperty(result.output, key, value);
|
| 717 |
+
else if (!reservedKeys.has(key)) {
|
| 718 |
+
logger.error(`Unknown option: ${key}`);
|
| 719 |
+
process.exit(1);
|
| 720 |
+
}
|
| 721 |
+
}
|
| 722 |
+
if (!result.config && positionals.length > 0) {
|
| 723 |
+
if (Array.isArray(result.input.input)) result.input.input.push(...positionals);
|
| 724 |
+
else result.input.input = positionals;
|
| 725 |
+
}
|
| 726 |
+
return result;
|
| 727 |
+
}
|
| 728 |
+
//#endregion
|
| 729 |
+
//#region src/cli/arguments/index.ts
|
| 730 |
+
const schemaInfo = getCliSchemaInfo();
|
| 731 |
+
const options = Object.fromEntries(Object.entries(schemaInfo).filter(([_key, info]) => info.type !== "never").map(([key, info]) => {
|
| 732 |
+
const config = alias[key];
|
| 733 |
+
let description = info?.description ?? config?.description ?? "";
|
| 734 |
+
if (config?.reverse) {
|
| 735 |
+
if (description.startsWith("enable")) description = description.replace("enable", "disable");
|
| 736 |
+
else if (!description.startsWith("Avoid")) description = `disable ${description}`;
|
| 737 |
+
}
|
| 738 |
+
const result = {
|
| 739 |
+
type: info.type === "boolean" ? "boolean" : "string",
|
| 740 |
+
description
|
| 741 |
+
};
|
| 742 |
+
if (config?.abbreviation) result.short = config.abbreviation;
|
| 743 |
+
if (config?.hint) result.hint = config.hint;
|
| 744 |
+
return [config?.reverse ? `no-${key}` : key, result];
|
| 745 |
+
}));
|
| 746 |
+
const knownKeys = new Set(Object.keys(schemaInfo));
|
| 747 |
+
for (const key of Object.keys(schemaInfo)) {
|
| 748 |
+
const dotIdx = key.indexOf(".");
|
| 749 |
+
if (dotIdx > 0) knownKeys.add(key.substring(0, dotIdx));
|
| 750 |
+
}
|
| 751 |
+
const shortAliases = /* @__PURE__ */ new Set();
|
| 752 |
+
for (const config of Object.values(alias)) if (config?.abbreviation) shortAliases.add(config.abbreviation);
|
| 753 |
+
function kebabToCamelCase(input) {
|
| 754 |
+
return input.replaceAll(/([a-z])-([a-z])/g, (_, p1, p2) => {
|
| 755 |
+
return p1 + p2.toUpperCase();
|
| 756 |
+
});
|
| 757 |
+
}
|
| 758 |
+
function camelizeNestedKeys(value) {
|
| 759 |
+
const result = {};
|
| 760 |
+
for (const [key, nestedValue] of Object.entries(value)) if (Array.isArray(nestedValue)) result[kebabToCamelCase(key)] = nestedValue;
|
| 761 |
+
else if (nestedValue && typeof nestedValue === "object") result[kebabToCamelCase(key)] = camelizeNestedKeys(nestedValue);
|
| 762 |
+
else result[kebabToCamelCase(key)] = nestedValue;
|
| 763 |
+
return result;
|
| 764 |
+
}
|
| 765 |
+
function parseCliArguments() {
|
| 766 |
+
const cli = cac("rolldown");
|
| 767 |
+
for (const [key, info] of Object.entries(schemaInfo)) {
|
| 768 |
+
if (info.type === "never") continue;
|
| 769 |
+
const config = alias[key];
|
| 770 |
+
let rawName = "";
|
| 771 |
+
if (config?.abbreviation) rawName += `-${config.abbreviation}, `;
|
| 772 |
+
if (config?.reverse) rawName += `--no-${key}`;
|
| 773 |
+
else rawName += `--${key}`;
|
| 774 |
+
if (info.type !== "boolean" && !config?.reverse) {
|
| 775 |
+
if (config?.requireValue) rawName += ` <${config?.hint ?? key}>`;
|
| 776 |
+
else rawName += ` [${config?.hint ?? key}]`;
|
| 777 |
+
}
|
| 778 |
+
cli.option(rawName, info.description ?? config?.description ?? "");
|
| 779 |
+
}
|
| 780 |
+
let parsedInput = [];
|
| 781 |
+
let parsedOptions = {};
|
| 782 |
+
const cmd = cli.command("[...input]", "");
|
| 783 |
+
cmd.allowUnknownOptions();
|
| 784 |
+
cmd.ignoreOptionDefaultValue();
|
| 785 |
+
cmd.action((input, opts) => {
|
| 786 |
+
parsedInput = input;
|
| 787 |
+
parsedOptions = opts;
|
| 788 |
+
});
|
| 789 |
+
try {
|
| 790 |
+
cli.parse(process.argv, { run: true });
|
| 791 |
+
} catch (err) {
|
| 792 |
+
if (err?.name === "CACError") {
|
| 793 |
+
const match = err.message.match(/option `(.+?)` value is missing/);
|
| 794 |
+
if (match) {
|
| 795 |
+
const optName = match[1].replace(/ [<[].*/, "").replace(/^-\w, /, "");
|
| 796 |
+
logger.error(`Option \`${optName}\` requires a value but none was provided.`);
|
| 797 |
+
} else logger.error(err.message);
|
| 798 |
+
process.exit(1);
|
| 799 |
+
}
|
| 800 |
+
throw err;
|
| 801 |
+
}
|
| 802 |
+
delete parsedOptions["--"];
|
| 803 |
+
for (const short of shortAliases) delete parsedOptions[short];
|
| 804 |
+
for (const key of Object.keys(parsedOptions)) if (key === "__proto__" || key === "constructor" || key === "prototype" || key.startsWith("__proto__.") || key.startsWith("constructor.") || key.startsWith("prototype.")) delete parsedOptions[key];
|
| 805 |
+
const unknownKeys = Object.keys(parsedOptions).filter((k) => !knownKeys.has(k));
|
| 806 |
+
if (unknownKeys.length > 0) {
|
| 807 |
+
unknownKeys.sort();
|
| 808 |
+
const single = unknownKeys.length === 1;
|
| 809 |
+
logger.warn(`Option \`${unknownKeys.join(",")}\` ${single ? "is" : "are"} unrecognized. We will ignore ${single ? "this" : "those"} option${single ? "" : "s"}.`);
|
| 810 |
+
}
|
| 811 |
+
parsedOptions = camelizeNestedKeys(parsedOptions);
|
| 812 |
+
const rawArgs = { ...parsedOptions };
|
| 813 |
+
for (const key of unknownKeys) delete parsedOptions[key];
|
| 814 |
+
for (const [key, value] of Object.entries(parsedOptions)) {
|
| 815 |
+
const type = schemaInfo[key]?.type;
|
| 816 |
+
if (Array.isArray(value)) {
|
| 817 |
+
if (type !== "array" && type !== "object") parsedOptions[key] = value[value.length - 1];
|
| 818 |
+
} else if (type === "array" && typeof value === "string") parsedOptions[key] = [value];
|
| 819 |
+
}
|
| 820 |
+
for (const [schemaKey, info] of Object.entries(schemaInfo)) {
|
| 821 |
+
if (info.type !== "object") continue;
|
| 822 |
+
const parts = schemaKey.split(".");
|
| 823 |
+
let parent = parsedOptions;
|
| 824 |
+
for (let i = 0; i < parts.length - 1; i++) parent = parent?.[parts[i]];
|
| 825 |
+
const leafKey = parts[parts.length - 1];
|
| 826 |
+
const value = parent?.[leafKey];
|
| 827 |
+
if (value === void 0) continue;
|
| 828 |
+
const values = Array.isArray(value) ? value : [value];
|
| 829 |
+
if (typeof values[0] !== "string") continue;
|
| 830 |
+
let usedDeprecatedSyntax = false;
|
| 831 |
+
const result = {};
|
| 832 |
+
for (const v of values) for (const pair of String(v).split(",")) {
|
| 833 |
+
const colonIdx = pair.indexOf(":");
|
| 834 |
+
const eqIdx = pair.indexOf("=");
|
| 835 |
+
let k;
|
| 836 |
+
let val;
|
| 837 |
+
if (colonIdx > 0 && (eqIdx === -1 || colonIdx < eqIdx)) {
|
| 838 |
+
k = pair.slice(0, colonIdx);
|
| 839 |
+
val = pair.slice(colonIdx + 1);
|
| 840 |
+
} else if (eqIdx > 0) {
|
| 841 |
+
k = pair.slice(0, eqIdx);
|
| 842 |
+
val = pair.slice(eqIdx + 1);
|
| 843 |
+
usedDeprecatedSyntax = true;
|
| 844 |
+
} else continue;
|
| 845 |
+
result[k] = val;
|
| 846 |
+
}
|
| 847 |
+
if (usedDeprecatedSyntax) {
|
| 848 |
+
const optionName = camelCaseToKebabCase(schemaKey);
|
| 849 |
+
logger.warn(`Using \`key=value\` syntax for \`--${optionName}\` is deprecated. Use \`key:value\` instead.`);
|
| 850 |
+
}
|
| 851 |
+
parent[leafKey] = result;
|
| 852 |
+
}
|
| 853 |
+
return {
|
| 854 |
+
...normalizeCliOptions(parsedOptions, parsedInput),
|
| 855 |
+
rawArgs
|
| 856 |
+
};
|
| 857 |
+
}
|
| 858 |
+
//#endregion
|
| 859 |
+
//#region src/utils/clear-screen.ts
|
| 860 |
+
const CLEAR_SCREEN = "\x1Bc";
|
| 861 |
+
function getClearScreenFunction(options) {
|
| 862 |
+
const isTTY = process.stdout.isTTY;
|
| 863 |
+
const isAnyOptionNotAllowingClearScreen = arraify(options).some(({ watch }) => watch === false || watch?.clearScreen === false);
|
| 864 |
+
if (isTTY && !isAnyOptionNotAllowingClearScreen) return () => {
|
| 865 |
+
process.stdout.write(CLEAR_SCREEN);
|
| 866 |
+
};
|
| 867 |
+
}
|
| 868 |
+
//#endregion
|
| 869 |
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/usingCtx.js
|
| 870 |
+
function _usingCtx() {
|
| 871 |
+
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
| 872 |
+
var n = Error();
|
| 873 |
+
return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
|
| 874 |
+
}, e = {}, n = [];
|
| 875 |
+
function using(r, e) {
|
| 876 |
+
if (null != e) {
|
| 877 |
+
if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
| 878 |
+
if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
| 879 |
+
if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
|
| 880 |
+
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
| 881 |
+
t && (o = function o() {
|
| 882 |
+
try {
|
| 883 |
+
t.call(e);
|
| 884 |
+
} catch (r) {
|
| 885 |
+
return Promise.reject(r);
|
| 886 |
+
}
|
| 887 |
+
}), n.push({
|
| 888 |
+
v: e,
|
| 889 |
+
d: o,
|
| 890 |
+
a: r
|
| 891 |
+
});
|
| 892 |
+
} else r && n.push({
|
| 893 |
+
d: e,
|
| 894 |
+
a: r
|
| 895 |
+
});
|
| 896 |
+
return e;
|
| 897 |
+
}
|
| 898 |
+
return {
|
| 899 |
+
e,
|
| 900 |
+
u: using.bind(null, !1),
|
| 901 |
+
a: using.bind(null, !0),
|
| 902 |
+
d: function d() {
|
| 903 |
+
var o, t = this.e, s = 0;
|
| 904 |
+
function next() {
|
| 905 |
+
for (; o = n.pop();) try {
|
| 906 |
+
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
| 907 |
+
if (o.d) {
|
| 908 |
+
var r = o.d.call(o.v);
|
| 909 |
+
if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
|
| 910 |
+
} else s |= 1;
|
| 911 |
+
} catch (r) {
|
| 912 |
+
return err(r);
|
| 913 |
+
}
|
| 914 |
+
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
| 915 |
+
if (t !== e) throw t;
|
| 916 |
+
}
|
| 917 |
+
function err(n) {
|
| 918 |
+
return t = t !== e ? new r(n, t) : n, next();
|
| 919 |
+
}
|
| 920 |
+
return next();
|
| 921 |
+
}
|
| 922 |
+
};
|
| 923 |
+
}
|
| 924 |
+
//#endregion
|
| 925 |
+
//#region src/cli/commands/bundle.ts
|
| 926 |
+
async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
|
| 927 |
+
if (cliOptions.watch) {
|
| 928 |
+
process.env.ROLLUP_WATCH = "true";
|
| 929 |
+
process.env.ROLLDOWN_WATCH = "true";
|
| 930 |
+
}
|
| 931 |
+
const config = await loadConfig(configPath, { configLoader: cliOptions.configLoader });
|
| 932 |
+
const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
|
| 933 |
+
if (typeof resolvedConfig !== "object" || resolvedConfig === null) {
|
| 934 |
+
logger.error(`Invalid configuration from ${configPath}: expected object or array, got ${resolvedConfig}`);
|
| 935 |
+
process.exit(1);
|
| 936 |
+
}
|
| 937 |
+
if (cliOptions.watch) await watchInner(resolvedConfig, cliOptions);
|
| 938 |
+
else await bundleInner(resolvedConfig, cliOptions);
|
| 939 |
+
}
|
| 940 |
+
async function bundleWithCliOptions(cliOptions) {
|
| 941 |
+
try {
|
| 942 |
+
var _usingCtx$1 = _usingCtx();
|
| 943 |
+
if (cliOptions.output.dir || cliOptions.output.file) {
|
| 944 |
+
await (cliOptions.watch ? watchInner : bundleInner)({}, cliOptions);
|
| 945 |
+
return;
|
| 946 |
+
}
|
| 947 |
+
if (cliOptions.watch) {
|
| 948 |
+
logger.error("You must specify `output.dir` to use watch mode");
|
| 949 |
+
process.exit(1);
|
| 950 |
+
}
|
| 951 |
+
const { output: outputs } = await _usingCtx$1.a(await rolldown(cliOptions.input)).generate(cliOptions.output);
|
| 952 |
+
if (outputs.length === 0) {
|
| 953 |
+
logger.error("No output generated");
|
| 954 |
+
process.exitCode = 1;
|
| 955 |
+
return;
|
| 956 |
+
}
|
| 957 |
+
for (const file of outputs) {
|
| 958 |
+
if (outputs.length > 1) logger.log(`\n${styleText(["cyan", "bold"], `|→ ${file.fileName}:`)}\n`);
|
| 959 |
+
console.log(file.type === "asset" ? file.source : file.code);
|
| 960 |
+
}
|
| 961 |
+
} catch (_) {
|
| 962 |
+
_usingCtx$1.e = _;
|
| 963 |
+
} finally {
|
| 964 |
+
await _usingCtx$1.d();
|
| 965 |
+
}
|
| 966 |
+
}
|
| 967 |
+
async function watchInner(config, cliOptions) {
|
| 968 |
+
let normalizedConfig = arraify(config).map((option) => {
|
| 969 |
+
return {
|
| 970 |
+
...option,
|
| 971 |
+
...cliOptions.input,
|
| 972 |
+
output: arraify(option.output || {}).map((output) => {
|
| 973 |
+
return {
|
| 974 |
+
...output,
|
| 975 |
+
...cliOptions.output
|
| 976 |
+
};
|
| 977 |
+
})
|
| 978 |
+
};
|
| 979 |
+
});
|
| 980 |
+
const watcher = watch(normalizedConfig);
|
| 981 |
+
onExit((code) => {
|
| 982 |
+
Promise.resolve(watcher.close()).finally(() => {
|
| 983 |
+
process.exit(typeof code === "number" ? code : 0);
|
| 984 |
+
});
|
| 985 |
+
return true;
|
| 986 |
+
});
|
| 987 |
+
const changedFile = [];
|
| 988 |
+
watcher.on("change", (id, event) => {
|
| 989 |
+
if (event.event === "update") changedFile.push(id);
|
| 990 |
+
});
|
| 991 |
+
const clearScreen = getClearScreenFunction(normalizedConfig);
|
| 992 |
+
watcher.on("event", async (event) => {
|
| 993 |
+
switch (event.code) {
|
| 994 |
+
case "START":
|
| 995 |
+
clearScreen?.();
|
| 996 |
+
break;
|
| 997 |
+
case "BUNDLE_START":
|
| 998 |
+
if (changedFile.length > 0) logger.log(`Found ${styleText("bold", changedFile.map(relativeId).join(", "))} changed, rebuilding...`);
|
| 999 |
+
changedFile.length = 0;
|
| 1000 |
+
break;
|
| 1001 |
+
case "BUNDLE_END":
|
| 1002 |
+
await event.result.close();
|
| 1003 |
+
logger.success(`Rebuilt ${styleText("bold", relativeId(event.output[0]))} in ${styleText("green", ms(event.duration))}.`);
|
| 1004 |
+
break;
|
| 1005 |
+
case "ERROR":
|
| 1006 |
+
await event.result.close();
|
| 1007 |
+
logger.error(event.error);
|
| 1008 |
+
}
|
| 1009 |
+
});
|
| 1010 |
+
logger.log(`Waiting for changes...`);
|
| 1011 |
+
}
|
| 1012 |
+
async function bundleInner(config, cliOptions) {
|
| 1013 |
+
const startTime = performance.now();
|
| 1014 |
+
const result = [];
|
| 1015 |
+
const configList = arraify(config);
|
| 1016 |
+
for (const config of configList) {
|
| 1017 |
+
const outputList = arraify(config.output || {});
|
| 1018 |
+
const build = await rolldown({
|
| 1019 |
+
...config,
|
| 1020 |
+
...cliOptions.input
|
| 1021 |
+
});
|
| 1022 |
+
try {
|
| 1023 |
+
for (const output of outputList) result.push(await build.write({
|
| 1024 |
+
...output,
|
| 1025 |
+
...cliOptions.output
|
| 1026 |
+
}));
|
| 1027 |
+
} finally {
|
| 1028 |
+
await build.close();
|
| 1029 |
+
}
|
| 1030 |
+
}
|
| 1031 |
+
result.forEach(printBundleOutputPretty);
|
| 1032 |
+
logger.log(``);
|
| 1033 |
+
const duration = performance.now() - startTime;
|
| 1034 |
+
logger.success(`rolldown v${version} Finished in ${styleText("green", ms(duration))}`);
|
| 1035 |
+
}
|
| 1036 |
+
function printBundleOutputPretty(output) {
|
| 1037 |
+
const outputEntries = collectOutputEntries(output.output);
|
| 1038 |
+
printOutputEntries(outputEntries, collectOutputLayoutAdjustmentSizes(outputEntries), "<DIR>");
|
| 1039 |
+
}
|
| 1040 |
+
function collectOutputEntries(output) {
|
| 1041 |
+
return output.map((chunk) => ({
|
| 1042 |
+
type: chunk.type,
|
| 1043 |
+
fileName: chunk.fileName,
|
| 1044 |
+
size: chunk.type === "chunk" ? Buffer.byteLength(chunk.code) : Buffer.byteLength(chunk.source)
|
| 1045 |
+
}));
|
| 1046 |
+
}
|
| 1047 |
+
function collectOutputLayoutAdjustmentSizes(entries) {
|
| 1048 |
+
let longest = 0;
|
| 1049 |
+
let biggestSize = 0;
|
| 1050 |
+
for (const entry of entries) {
|
| 1051 |
+
if (entry.fileName.length > longest) longest = entry.fileName.length;
|
| 1052 |
+
if (entry.size > biggestSize) biggestSize = entry.size;
|
| 1053 |
+
}
|
| 1054 |
+
const sizePad = displaySize(biggestSize).length;
|
| 1055 |
+
return {
|
| 1056 |
+
longest,
|
| 1057 |
+
biggestSize,
|
| 1058 |
+
sizePad
|
| 1059 |
+
};
|
| 1060 |
+
}
|
| 1061 |
+
const numberFormatter = new Intl.NumberFormat("en", {
|
| 1062 |
+
maximumFractionDigits: 2,
|
| 1063 |
+
minimumFractionDigits: 2
|
| 1064 |
+
});
|
| 1065 |
+
function displaySize(bytes) {
|
| 1066 |
+
return `${numberFormatter.format(bytes / 1e3)} kB`;
|
| 1067 |
+
}
|
| 1068 |
+
const CHUNK_GROUPS = [{
|
| 1069 |
+
type: "asset",
|
| 1070 |
+
color: "green"
|
| 1071 |
+
}, {
|
| 1072 |
+
type: "chunk",
|
| 1073 |
+
color: "cyan"
|
| 1074 |
+
}];
|
| 1075 |
+
function printOutputEntries(entries, sizeAdjustment, distPath) {
|
| 1076 |
+
for (const group of CHUNK_GROUPS) {
|
| 1077 |
+
const filtered = entries.filter((e) => e.type === group.type);
|
| 1078 |
+
if (!filtered.length) continue;
|
| 1079 |
+
for (const entry of filtered.sort((a, z) => a.size - z.size)) {
|
| 1080 |
+
let log = styleText("dim", withTrailingSlash(distPath));
|
| 1081 |
+
log += styleText(group.color, entry.fileName.padEnd(sizeAdjustment.longest + 2));
|
| 1082 |
+
log += styleText("dim", entry.type);
|
| 1083 |
+
log += styleText("dim", ` │ size: ${displaySize(entry.size).padStart(sizeAdjustment.sizePad)}`);
|
| 1084 |
+
logger.log(log);
|
| 1085 |
+
}
|
| 1086 |
+
}
|
| 1087 |
+
}
|
| 1088 |
+
function withTrailingSlash(path) {
|
| 1089 |
+
if (path[path.length - 1] !== "/") return `${path}/`;
|
| 1090 |
+
return path;
|
| 1091 |
+
}
|
| 1092 |
+
function ms(duration) {
|
| 1093 |
+
return duration < 1e3 ? `${duration.toFixed(2)} ms` : `${(duration / 1e3).toFixed(2)} s`;
|
| 1094 |
+
}
|
| 1095 |
+
function relativeId(id) {
|
| 1096 |
+
if (!path.isAbsolute(id)) return id;
|
| 1097 |
+
return path.relative(path.resolve(), id);
|
| 1098 |
+
}
|
| 1099 |
+
//#endregion
|
| 1100 |
+
//#region src/cli/commands/help.ts
|
| 1101 |
+
const examples = [
|
| 1102 |
+
{
|
| 1103 |
+
title: "Bundle with a config file `rolldown.config.mjs`",
|
| 1104 |
+
command: "rolldown -c rolldown.config.mjs"
|
| 1105 |
+
},
|
| 1106 |
+
{
|
| 1107 |
+
title: "Bundle the `src/main.ts` to `dist` with `cjs` format",
|
| 1108 |
+
command: "rolldown src/main.ts -d dist -f cjs"
|
| 1109 |
+
},
|
| 1110 |
+
{
|
| 1111 |
+
title: "Bundle the `src/main.ts` and handle the `.png` assets to Data URL",
|
| 1112 |
+
command: "rolldown src/main.ts -d dist --moduleTypes .png=dataurl"
|
| 1113 |
+
},
|
| 1114 |
+
{
|
| 1115 |
+
title: "Bundle the `src/main.tsx` and minify the output with sourcemap",
|
| 1116 |
+
command: "rolldown src/main.tsx -d dist -m -s"
|
| 1117 |
+
},
|
| 1118 |
+
{
|
| 1119 |
+
title: "Create self-executing IIFE using external jQuery as `$` and `_`",
|
| 1120 |
+
command: "rolldown src/main.ts -d dist -n bundle -f iife -e jQuery,window._ -g jQuery=$"
|
| 1121 |
+
}
|
| 1122 |
+
];
|
| 1123 |
+
const notes = ["CLI options will override the configuration file.", "For more information, please visit https://rolldown.rs/."];
|
| 1124 |
+
/**
|
| 1125 |
+
* Generates the CLI help text as a string.
|
| 1126 |
+
*/
|
| 1127 |
+
function generateHelpText() {
|
| 1128 |
+
const lines = [];
|
| 1129 |
+
lines.push(`${styleText("gray", `${description} (rolldown v${version})`)}`);
|
| 1130 |
+
lines.push("");
|
| 1131 |
+
lines.push(`${styleText(["bold", "underline"], "USAGE")} ${styleText("cyan", "rolldown -c <config>")} or ${styleText("cyan", "rolldown <input> <options>")}`);
|
| 1132 |
+
lines.push("");
|
| 1133 |
+
lines.push(`${styleText(["bold", "underline"], "OPTIONS")}`);
|
| 1134 |
+
lines.push("");
|
| 1135 |
+
lines.push(Object.entries(options).sort(([a], [b]) => {
|
| 1136 |
+
if (options[a].short && !options[b].short) return -1;
|
| 1137 |
+
if (!options[a].short && options[b].short) return 1;
|
| 1138 |
+
if (options[a].short && options[b].short) return options[a].short.localeCompare(options[b].short);
|
| 1139 |
+
return a.localeCompare(b);
|
| 1140 |
+
}).map(([option, { type, short, hint, description }]) => {
|
| 1141 |
+
let optionStr = ` --${option} `;
|
| 1142 |
+
if (short) optionStr += `-${short}, `;
|
| 1143 |
+
if (type === "string") optionStr += `<${hint ?? option}>`;
|
| 1144 |
+
if (description && description.length > 0) description = description[0].toUpperCase() + description.slice(1);
|
| 1145 |
+
return styleText("cyan", optionStr.padEnd(30)) + description + (description && description?.endsWith(".") ? "" : ".");
|
| 1146 |
+
}).join("\n"));
|
| 1147 |
+
lines.push("");
|
| 1148 |
+
lines.push(`${styleText(["bold", "underline"], "EXAMPLES")}`);
|
| 1149 |
+
lines.push("");
|
| 1150 |
+
examples.forEach(({ title, command }, ord) => {
|
| 1151 |
+
lines.push(` ${ord + 1}. ${title}:`);
|
| 1152 |
+
lines.push(` ${styleText("cyan", command)}`);
|
| 1153 |
+
lines.push("");
|
| 1154 |
+
});
|
| 1155 |
+
lines.push(`${styleText(["bold", "underline"], "NOTES")}`);
|
| 1156 |
+
lines.push("");
|
| 1157 |
+
notes.forEach((note) => {
|
| 1158 |
+
lines.push(` * ${styleText("gray", note)}`);
|
| 1159 |
+
});
|
| 1160 |
+
return lines.join("\n");
|
| 1161 |
+
}
|
| 1162 |
+
function showHelp() {
|
| 1163 |
+
logger.log(generateHelpText());
|
| 1164 |
+
}
|
| 1165 |
+
//#endregion
|
| 1166 |
+
//#region src/cli/version-check.ts
|
| 1167 |
+
function checkNodeVersion(nodeVersion) {
|
| 1168 |
+
const currentVersion = nodeVersion.split(".");
|
| 1169 |
+
const major = parseInt(currentVersion[0], 10);
|
| 1170 |
+
const minor = parseInt(currentVersion[1], 10);
|
| 1171 |
+
return major === 20 && minor >= 19 || major === 22 && minor >= 12 || major > 22;
|
| 1172 |
+
}
|
| 1173 |
+
//#endregion
|
| 1174 |
+
//#region src/cli/index.ts
|
| 1175 |
+
if (!checkNodeVersion(g$1.versions.node)) logger.warn(`You are using Node.js ${g$1.versions.node}. Rolldown requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.`);
|
| 1176 |
+
async function main() {
|
| 1177 |
+
const { rawArgs, ...cliOptions } = parseCliArguments();
|
| 1178 |
+
if (cliOptions.environment) {
|
| 1179 |
+
const environment = Array.isArray(cliOptions.environment) ? cliOptions.environment : [cliOptions.environment];
|
| 1180 |
+
for (const argument of environment) for (const pair of argument.split(",")) {
|
| 1181 |
+
const [key, ...value] = pair.split(":");
|
| 1182 |
+
g$1.env[key] = value.length === 0 ? String(true) : value.join(":");
|
| 1183 |
+
}
|
| 1184 |
+
}
|
| 1185 |
+
if (cliOptions.help) {
|
| 1186 |
+
showHelp();
|
| 1187 |
+
return;
|
| 1188 |
+
}
|
| 1189 |
+
if (cliOptions.version) {
|
| 1190 |
+
logger.log(`rolldown v${version}`);
|
| 1191 |
+
return;
|
| 1192 |
+
}
|
| 1193 |
+
if (cliOptions.config || cliOptions.config === "") {
|
| 1194 |
+
await bundleWithConfig(cliOptions.config, cliOptions, rawArgs);
|
| 1195 |
+
return;
|
| 1196 |
+
}
|
| 1197 |
+
if ("input" in cliOptions.input) {
|
| 1198 |
+
await bundleWithCliOptions(cliOptions);
|
| 1199 |
+
return;
|
| 1200 |
+
}
|
| 1201 |
+
showHelp();
|
| 1202 |
+
}
|
| 1203 |
+
main().catch((err) => {
|
| 1204 |
+
logger.error(err);
|
| 1205 |
+
g$1.exit(1);
|
| 1206 |
+
});
|
| 1207 |
+
//#endregion
|
| 1208 |
+
export {};
|
frontend/node_modules/rolldown/dist/config.d.mts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { R as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-DVsXPNaU.mjs";
|
| 2 |
+
//#region src/utils/load-config.d.ts
|
| 3 |
+
type ConfigLoader = "bundle" | "native";
|
| 4 |
+
interface LoadConfigOptions {
|
| 5 |
+
/**
|
| 6 |
+
* How to load the config file.
|
| 7 |
+
* - `'bundle'` (default): bundle the config with Rolldown, then import it.
|
| 8 |
+
* - `'native'`: import the config directly, delegating TypeScript/loader
|
| 9 |
+
* handling to the runtime. Faster, but requires runtime support.
|
| 10 |
+
*
|
| 11 |
+
* @default 'bundle'
|
| 12 |
+
*/
|
| 13 |
+
configLoader?: ConfigLoader;
|
| 14 |
+
}
|
| 15 |
+
/**
|
| 16 |
+
* Load config from a file in a way that Rolldown does.
|
| 17 |
+
*
|
| 18 |
+
* @param configPath The path to the config file. If empty, it will look for `rolldown.config` with supported extensions in the current working directory.
|
| 19 |
+
* @param options Loading options. `configLoader` selects `'bundle'` (default) or `'native'`.
|
| 20 |
+
* @returns The loaded config export
|
| 21 |
+
*
|
| 22 |
+
* @category Config
|
| 23 |
+
*/
|
| 24 |
+
declare function loadConfig(configPath: string, options?: LoadConfigOptions): Promise<ConfigExport>;
|
| 25 |
+
//#endregion
|
| 26 |
+
export { VERSION, defineConfig, loadConfig };
|
frontend/node_modules/rolldown/dist/config.mjs
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { T as VERSION } from "./shared/bindingify-input-options-CMab5gbt.mjs";
|
| 2 |
+
import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
|
| 3 |
+
import { t as loadConfig } from "./shared/load-config-ChaLPL3M.mjs";
|
| 4 |
+
export { VERSION, defineConfig, loadConfig };
|
frontend/node_modules/rolldown/dist/experimental-default-runtime.mjs
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @ts-check
|
| 2 |
+
|
| 3 |
+
/** @import { DevRuntime } from './runtime-extra-dev-common.js' */
|
| 4 |
+
|
| 5 |
+
/** @type {typeof DevRuntime} */
|
| 6 |
+
// @ts-expect-error -- there's no way to declare a variable by JSDoc
|
| 7 |
+
var BaseDevRuntime = DevRuntime;
|
| 8 |
+
|
| 9 |
+
class ModuleHotContext {
|
| 10 |
+
/**
|
| 11 |
+
* @type {{ deps: [string], fn: (moduleExports: Record<string, any>[]) => void }[]}
|
| 12 |
+
*/
|
| 13 |
+
acceptCallbacks = [];
|
| 14 |
+
/**
|
| 15 |
+
* @param {string} moduleId
|
| 16 |
+
* @param {InstanceType<BaseDevRuntime>} devRuntime
|
| 17 |
+
*/
|
| 18 |
+
constructor(moduleId, devRuntime) {
|
| 19 |
+
this.moduleId = moduleId;
|
| 20 |
+
this.devRuntime = devRuntime;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* @overload
|
| 25 |
+
* @param {(mod: Record<string, any>) => void} cb
|
| 26 |
+
* @returns {void}
|
| 27 |
+
*/
|
| 28 |
+
/**
|
| 29 |
+
* @param {...any} args
|
| 30 |
+
* @returns {void}
|
| 31 |
+
*/
|
| 32 |
+
accept(...args) {
|
| 33 |
+
if (args.length === 1) {
|
| 34 |
+
const [cb] = /** @type {[(mod: Record<string, any>) => void]} */ (args);
|
| 35 |
+
const acceptingPath = this.moduleId;
|
| 36 |
+
this.acceptCallbacks.push({
|
| 37 |
+
deps: [acceptingPath],
|
| 38 |
+
fn: cb,
|
| 39 |
+
});
|
| 40 |
+
} else if (args.length === 0) {}
|
| 41 |
+
else {
|
| 42 |
+
throw new Error('Invalid arguments for `import.meta.hot.accept`');
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
invalidate() {
|
| 47 |
+
socket.send(JSON.stringify({
|
| 48 |
+
type: 'hmr:invalidate',
|
| 49 |
+
moduleId: this.moduleId,
|
| 50 |
+
}));
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
class DefaultDevRuntime extends BaseDevRuntime {
|
| 55 |
+
/**
|
| 56 |
+
* @type {Map<string, ModuleHotContext>}
|
| 57 |
+
*/
|
| 58 |
+
moduleHotContexts = new Map();
|
| 59 |
+
/**
|
| 60 |
+
* @override
|
| 61 |
+
* @param {string} moduleId
|
| 62 |
+
*/
|
| 63 |
+
createModuleHotContext(moduleId) {
|
| 64 |
+
const hotContext = new ModuleHotContext(moduleId, this);
|
| 65 |
+
this.moduleHotContexts.set(moduleId, hotContext);
|
| 66 |
+
return hotContext;
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/** @param {string} url */
|
| 71 |
+
function loadScript(url) {
|
| 72 |
+
var script = document.createElement('script');
|
| 73 |
+
script.src = url;
|
| 74 |
+
script.type = 'module';
|
| 75 |
+
script.onerror = function() {
|
| 76 |
+
console.error('Failed to load script: ' + url);
|
| 77 |
+
};
|
| 78 |
+
document.body.appendChild(script);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
console.debug('HMR runtime loaded', '$ADDR');
|
| 82 |
+
// Generate client ID immediately at runtime initialization
|
| 83 |
+
// This ensures the client ID is available before any lazy imports
|
| 84 |
+
const clientId = crypto.randomUUID();
|
| 85 |
+
const addr = new URL('ws://$ADDR');
|
| 86 |
+
addr.searchParams.set('clientId', clientId);
|
| 87 |
+
|
| 88 |
+
const socket = new WebSocket(addr);
|
| 89 |
+
|
| 90 |
+
(/** @type {any} */ (globalThis)).__rolldown_runtime__ ??=
|
| 91 |
+
new DefaultDevRuntime(clientId);
|
| 92 |
+
|
| 93 |
+
/** @param {MessageEvent} event */
|
| 94 |
+
socket.onmessage = function(event) {
|
| 95 |
+
const data = JSON.parse(event.data);
|
| 96 |
+
console.debug('Received message:', data);
|
| 97 |
+
if (data.type === 'connected') {
|
| 98 |
+
// Server acknowledged the connection
|
| 99 |
+
console.debug('[hmr]: Connection established with server');
|
| 100 |
+
} else if (data.type === 'hmr:update') {
|
| 101 |
+
if (typeof process === 'object') {
|
| 102 |
+
import(data.path);
|
| 103 |
+
console.debug(`[hmr]: Importing HMR patch: ${data.path}`);
|
| 104 |
+
} else {
|
| 105 |
+
console.debug(`[hmr]: Loading HMR patch: ${data.path}`);
|
| 106 |
+
loadScript(data.url);
|
| 107 |
+
}
|
| 108 |
+
} else if (data.type === 'hmr:reload') {
|
| 109 |
+
console.log('[hmr]: Full reload required, reloading page');
|
| 110 |
+
if (typeof location !== 'undefined') {
|
| 111 |
+
location.reload();
|
| 112 |
+
} else {
|
| 113 |
+
console.log('[hmr]: location is undefined, cannot reload page');
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
};
|
frontend/node_modules/rolldown/dist/experimental-index.d.mts
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { H as ResolverFactory, J as moduleRunnerTransform, K as isolatedDeclaration, L as NapiResolveOptions, M as IsolatedDeclarationsOptions, N as IsolatedDeclarationsResult, V as ResolveResult, _ as BindingTsconfigCompilerOptions, i as BindingClientHmrUpdate, k as BindingViteTransformPluginConfig, n as BindingBundleAnalyzerPluginConfig, p as BindingRebuildStrategy, q as isolatedDeclarationSync, r as BindingBundleState, u as BindingLazyChunkOutput, v as BindingTsconfigRawOptions, w as BindingViteManifestPluginConfig } from "./shared/binding-CVtkJvyl.mjs";
|
| 2 |
+
import { $ as defineParallelPlugin, Gt as StringOrRegExp, I as BuiltinPlugin, Qt as freeExternalMemory, Vt as OutputOptions, Xt as RolldownOutput, l as InputOptions, ut as NormalizedOutputOptions } from "./shared/define-config-DVsXPNaU.mjs";
|
| 3 |
+
import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-WmU_cI8e.mjs";
|
| 4 |
+
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-XaIbWpwJ.mjs";
|
| 5 |
+
//#region src/api/dev/dev-options.d.ts
|
| 6 |
+
type DevOnHmrUpdates = (result: Error | {
|
| 7 |
+
updates: BindingClientHmrUpdate[];
|
| 8 |
+
changedFiles: string[];
|
| 9 |
+
}) => void | Promise<void>;
|
| 10 |
+
type DevOnOutput = (result: Error | RolldownOutput) => void | Promise<void>;
|
| 11 |
+
type DevOnAdditionalAssets = (output: RolldownOutput) => void | Promise<void>;
|
| 12 |
+
interface DevWatchOptions {
|
| 13 |
+
/**
|
| 14 |
+
* If `false`, no file system watcher is started, so file changes are never
|
| 15 |
+
* picked up and no rebuild or HMR update is triggered on their own.
|
| 16 |
+
* @default true
|
| 17 |
+
*/
|
| 18 |
+
enabled?: boolean;
|
| 19 |
+
/**
|
| 20 |
+
* If `true`, files are not written to disk.
|
| 21 |
+
* @default false
|
| 22 |
+
*/
|
| 23 |
+
skipWrite?: boolean;
|
| 24 |
+
/**
|
| 25 |
+
* If `true`, use polling instead of native file system events for watching.
|
| 26 |
+
* @default false
|
| 27 |
+
*/
|
| 28 |
+
usePolling?: boolean;
|
| 29 |
+
/**
|
| 30 |
+
* Poll interval in milliseconds (only used when usePolling is true).
|
| 31 |
+
* @default 100
|
| 32 |
+
*/
|
| 33 |
+
pollInterval?: number;
|
| 34 |
+
/**
|
| 35 |
+
* If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
|
| 36 |
+
* @default true
|
| 37 |
+
*/
|
| 38 |
+
useDebounce?: boolean;
|
| 39 |
+
/**
|
| 40 |
+
* Debounce duration in milliseconds (only used when useDebounce is true).
|
| 41 |
+
* @default 10
|
| 42 |
+
*/
|
| 43 |
+
debounceDuration?: number;
|
| 44 |
+
/**
|
| 45 |
+
* Whether to compare file contents for poll-based watchers (only used when usePolling is true).
|
| 46 |
+
* When enabled, poll watchers will check file contents to determine if they actually changed.
|
| 47 |
+
* @default false
|
| 48 |
+
*/
|
| 49 |
+
compareContentsForPolling?: boolean;
|
| 50 |
+
/**
|
| 51 |
+
* Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
|
| 52 |
+
* Controls how frequently the debouncer checks for events to process.
|
| 53 |
+
* When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
|
| 54 |
+
* @default undefined (auto-select)
|
| 55 |
+
*/
|
| 56 |
+
debounceTickRate?: number;
|
| 57 |
+
/**
|
| 58 |
+
* Filter to limit which discovered files are registered with the file watcher.
|
| 59 |
+
*
|
| 60 |
+
* Strings are treated as glob patterns.
|
| 61 |
+
*
|
| 62 |
+
* @default []
|
| 63 |
+
*/
|
| 64 |
+
include?: StringOrRegExp | StringOrRegExp[];
|
| 65 |
+
/**
|
| 66 |
+
* Filter to prevent discovered files from being registered with the file watcher.
|
| 67 |
+
*
|
| 68 |
+
* Strings are treated as glob patterns.
|
| 69 |
+
*
|
| 70 |
+
* @default []
|
| 71 |
+
*/
|
| 72 |
+
exclude?: StringOrRegExp | StringOrRegExp[];
|
| 73 |
+
}
|
| 74 |
+
interface DevOptions {
|
| 75 |
+
onHmrUpdates?: DevOnHmrUpdates;
|
| 76 |
+
onOutput?: DevOnOutput;
|
| 77 |
+
/**
|
| 78 |
+
* Called with assets emitted while generating an HMR patch or compiling a
|
| 79 |
+
* lazy entry (e.g. an image newly imported by the changed/lazy module).
|
| 80 |
+
*
|
| 81 |
+
* These never go through {@link onOutput}, so a consumer that serves built
|
| 82 |
+
* files (e.g. Vite's bundled dev server) must register this to receive them
|
| 83 |
+
* and write them to its in-memory file store before the client requests them.
|
| 84 |
+
*/
|
| 85 |
+
onAdditionalAssets?: DevOnAdditionalAssets;
|
| 86 |
+
/**
|
| 87 |
+
* Strategy for triggering rebuilds after HMR updates.
|
| 88 |
+
* - `'always'`: Always trigger a rebuild after HMR updates
|
| 89 |
+
* - `'never'`: Never trigger rebuild after HMR updates. The server no longer
|
| 90 |
+
* decides full reloads, so there is no `'auto'` upgrade anymore; pull fresh
|
| 91 |
+
* bundle output explicitly (e.g. `ensureLatestBuildOutput`) when needed.
|
| 92 |
+
* @default 'never'
|
| 93 |
+
*/
|
| 94 |
+
rebuildStrategy?: "always" | "never";
|
| 95 |
+
watch?: DevWatchOptions;
|
| 96 |
+
}
|
| 97 |
+
//#endregion
|
| 98 |
+
//#region src/api/dev/dev-engine.d.ts
|
| 99 |
+
declare class DevEngine {
|
| 100 |
+
#private;
|
| 101 |
+
static create(inputOptions: InputOptions, outputOptions?: OutputOptions, devOptions?: DevOptions): Promise<DevEngine>;
|
| 102 |
+
private constructor();
|
| 103 |
+
run(): Promise<void>;
|
| 104 |
+
ensureCurrentBuildFinish(): Promise<void>;
|
| 105 |
+
getBundleState(): Promise<BindingBundleState>;
|
| 106 |
+
ensureLatestBuildOutput(): Promise<void>;
|
| 107 |
+
triggerFullBuild(): void;
|
| 108 |
+
/**
|
| 109 |
+
* Client-connect signal (the clientId hello): creates the per-client session
|
| 110 |
+
* with an empty ship map. Reconnects arrive as fresh clientIds.
|
| 111 |
+
*/
|
| 112 |
+
registerClient(clientId: string): Promise<void>;
|
| 113 |
+
/**
|
| 114 |
+
* Delivery notification from the serving middleware: the response for
|
| 115 |
+
* `filename` completed, so record its modules as shipped to that client.
|
| 116 |
+
*/
|
| 117 |
+
notifyPayloadDelivered(filename: string): Promise<void>;
|
| 118 |
+
removeClient(clientId: string): Promise<void>;
|
| 119 |
+
close(): Promise<void>;
|
| 120 |
+
/**
|
| 121 |
+
* Compile a lazy entry module and return HMR-style patch code.
|
| 122 |
+
*
|
| 123 |
+
* This is called when a dynamically imported module is first requested at runtime.
|
| 124 |
+
* The module was previously stubbed with a proxy, and now we need to compile the
|
| 125 |
+
* actual module and its dependencies.
|
| 126 |
+
*
|
| 127 |
+
* @param moduleId - The absolute file path of the module to compile
|
| 128 |
+
* @param clientId - The client ID requesting this compilation
|
| 129 |
+
* @returns The compiled chunk: its code plus the filename whose delivery the
|
| 130 |
+
* serving middleware reports via {@link notifyPayloadDelivered}
|
| 131 |
+
*/
|
| 132 |
+
compileEntry(moduleId: string, clientId: string): Promise<BindingLazyChunkOutput>;
|
| 133 |
+
}
|
| 134 |
+
//#endregion
|
| 135 |
+
//#region src/api/dev/index.d.ts
|
| 136 |
+
declare const dev: typeof DevEngine.create;
|
| 137 |
+
//#endregion
|
| 138 |
+
//#region src/api/experimental.d.ts
|
| 139 |
+
/**
|
| 140 |
+
* This is an experimental API. Its behavior may change in the future.
|
| 141 |
+
*
|
| 142 |
+
* - Calling this API will only execute the `scan/build` stage of rolldown.
|
| 143 |
+
* - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
|
| 144 |
+
*
|
| 145 |
+
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
|
| 146 |
+
* ```ts
|
| 147 |
+
* import { scan } from 'rolldown/api/experimental';
|
| 148 |
+
*
|
| 149 |
+
* const cleanupPromise = await scan(...);
|
| 150 |
+
* await cleanupPromise;
|
| 151 |
+
* // Now all resources have been cleaned up.
|
| 152 |
+
* ```
|
| 153 |
+
*/
|
| 154 |
+
declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
|
| 155 |
+
//#endregion
|
| 156 |
+
//#region src/builtin-plugin/alias-plugin.d.ts
|
| 157 |
+
type ViteAliasPluginConfig = {
|
| 158 |
+
entries: {
|
| 159 |
+
find: string | RegExp;
|
| 160 |
+
replacement: string;
|
| 161 |
+
}[];
|
| 162 |
+
};
|
| 163 |
+
declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
|
| 164 |
+
//#endregion
|
| 165 |
+
//#region src/builtin-plugin/bundle-analyzer-plugin.d.ts
|
| 166 |
+
/**
|
| 167 |
+
* A plugin that analyzes bundle composition and generates detailed reports.
|
| 168 |
+
*
|
| 169 |
+
* The plugin outputs a file containing detailed information about:
|
| 170 |
+
* - All chunks and their relationships
|
| 171 |
+
* - Modules bundled in each chunk
|
| 172 |
+
* - Import dependencies between chunks
|
| 173 |
+
* - Reachable modules from each entry point
|
| 174 |
+
*
|
| 175 |
+
* @example
|
| 176 |
+
* ```js
|
| 177 |
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
| 178 |
+
*
|
| 179 |
+
* export default {
|
| 180 |
+
* plugins: [
|
| 181 |
+
* bundleAnalyzerPlugin()
|
| 182 |
+
* ]
|
| 183 |
+
* }
|
| 184 |
+
* ```
|
| 185 |
+
*
|
| 186 |
+
* @example
|
| 187 |
+
* **Custom filename**
|
| 188 |
+
* ```js
|
| 189 |
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
| 190 |
+
*
|
| 191 |
+
* export default {
|
| 192 |
+
* plugins: [
|
| 193 |
+
* bundleAnalyzerPlugin({
|
| 194 |
+
* fileName: 'bundle-analysis.json'
|
| 195 |
+
* })
|
| 196 |
+
* ]
|
| 197 |
+
* }
|
| 198 |
+
* ```
|
| 199 |
+
*
|
| 200 |
+
* @example
|
| 201 |
+
* **LLM-friendly markdown output**
|
| 202 |
+
* ```js
|
| 203 |
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
| 204 |
+
*
|
| 205 |
+
* export default {
|
| 206 |
+
* plugins: [
|
| 207 |
+
* bundleAnalyzerPlugin({
|
| 208 |
+
* format: 'md'
|
| 209 |
+
* })
|
| 210 |
+
* ]
|
| 211 |
+
* }
|
| 212 |
+
* ```
|
| 213 |
+
*/
|
| 214 |
+
declare function bundleAnalyzerPlugin(config?: BindingBundleAnalyzerPluginConfig): BuiltinPlugin;
|
| 215 |
+
//#endregion
|
| 216 |
+
//#region src/builtin-plugin/transform-plugin.d.ts
|
| 217 |
+
type TransformPattern = string | RegExp | readonly (RegExp | string)[];
|
| 218 |
+
type TransformPluginConfig = Omit<BindingViteTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude" | "yarnPnp"> & {
|
| 219 |
+
include?: TransformPattern;
|
| 220 |
+
exclude?: TransformPattern;
|
| 221 |
+
jsxRefreshInclude?: TransformPattern;
|
| 222 |
+
jsxRefreshExclude?: TransformPattern;
|
| 223 |
+
};
|
| 224 |
+
declare function viteTransformPlugin(config: TransformPluginConfig): BuiltinPlugin;
|
| 225 |
+
//#endregion
|
| 226 |
+
//#region src/builtin-plugin/vite-manifest-plugin.d.ts
|
| 227 |
+
type ViteManifestPluginConfig = Omit<BindingViteManifestPluginConfig, "isLegacy"> & {
|
| 228 |
+
isOutputOptionsForLegacyChunks?: (outputOptions: NormalizedOutputOptions) => boolean;
|
| 229 |
+
};
|
| 230 |
+
declare function viteManifestPlugin(config: ViteManifestPluginConfig): BuiltinPlugin;
|
| 231 |
+
//#endregion
|
| 232 |
+
//#region src/experimental-index.d.ts
|
| 233 |
+
/**
|
| 234 |
+
* In-memory file system for browser builds.
|
| 235 |
+
*
|
| 236 |
+
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
|
| 237 |
+
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
|
| 238 |
+
*
|
| 239 |
+
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
|
| 240 |
+
* - `volume`: The underlying `Volume` instance that stores the filesystem state
|
| 241 |
+
*
|
| 242 |
+
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
|
| 243 |
+
*
|
| 244 |
+
* @example
|
| 245 |
+
* ```typescript
|
| 246 |
+
* import { memfs } from 'rolldown/experimental';
|
| 247 |
+
*
|
| 248 |
+
* // Write files to virtual filesystem before bundling
|
| 249 |
+
* memfs?.volume.fromJSON({
|
| 250 |
+
* '/src/index.js': 'export const foo = 42;',
|
| 251 |
+
* '/package.json': '{"name": "my-app"}'
|
| 252 |
+
* });
|
| 253 |
+
*
|
| 254 |
+
* // Read files from the virtual filesystem
|
| 255 |
+
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
|
| 256 |
+
* ```
|
| 257 |
+
*
|
| 258 |
+
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
|
| 259 |
+
*/
|
| 260 |
+
declare const memfs: {
|
| 261 |
+
fs: any;
|
| 262 |
+
volume: any;
|
| 263 |
+
} | undefined;
|
| 264 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 265 |
+
declare const parse: typeof parse$1;
|
| 266 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 267 |
+
declare const parseSync: typeof parseSync$1;
|
| 268 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 269 |
+
type ParseResult = ParseResult$1;
|
| 270 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 271 |
+
type ParserOptions = ParserOptions$1;
|
| 272 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 273 |
+
declare const minify: typeof minify$1;
|
| 274 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 275 |
+
declare const minifySync: typeof minifySync$1;
|
| 276 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 277 |
+
type MinifyOptions = MinifyOptions$1;
|
| 278 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 279 |
+
type MinifyResult = MinifyResult$1;
|
| 280 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 281 |
+
declare const transform: typeof transform$1;
|
| 282 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 283 |
+
declare const transformSync: typeof transformSync$1;
|
| 284 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 285 |
+
type TransformOptions = TransformOptions$1;
|
| 286 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 287 |
+
type TransformResult = TransformResult$1;
|
| 288 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 289 |
+
declare const TsconfigCache: typeof TsconfigCache$1;
|
| 290 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 291 |
+
type TsconfigRawOptions = BindingTsconfigRawOptions;
|
| 292 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 293 |
+
type TsconfigCompilerOptions = BindingTsconfigCompilerOptions;
|
| 294 |
+
//#endregion
|
| 295 |
+
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, MinifyOptions, MinifyResult, ParseResult, ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, TransformOptions, TransformResult, TsconfigCache, TsconfigCompilerOptions, TsconfigRawOptions, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin };
|
frontend/node_modules/rolldown/dist/experimental-index.mjs
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { n as __toESM, t as require_binding } from "./shared/binding-CKyeQZen.mjs";
|
| 2 |
+
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-DYjJ67tj.mjs";
|
| 3 |
+
import { u as transformToRollupOutput } from "./shared/bindingify-input-options-CMab5gbt.mjs";
|
| 4 |
+
import { l as PluginDriver, s as validateOption, t as createBundlerOptions } from "./shared/create-bundler-option-BZD-ER-Z.mjs";
|
| 5 |
+
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-BzLGqhSQ.mjs";
|
| 6 |
+
import { n as parseSync$1, t as parse$1 } from "./shared/parse-CWXBoSKb.mjs";
|
| 7 |
+
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-6Zc-JFd7.mjs";
|
| 8 |
+
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-Bcd82vVT.mjs";
|
| 9 |
+
import { pathToFileURL } from "node:url";
|
| 10 |
+
//#region src/api/dev/dev-engine.ts
|
| 11 |
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
| 12 |
+
var DevEngine = class DevEngine {
|
| 13 |
+
#inner;
|
| 14 |
+
#cachedBuildFinishPromise = null;
|
| 15 |
+
#asyncRuntimeReleased = false;
|
| 16 |
+
static async create(inputOptions, outputOptions = {}, devOptions = {}) {
|
| 17 |
+
inputOptions = await PluginDriver.callOptionsHook(inputOptions);
|
| 18 |
+
const options = await createBundlerOptions(inputOptions, outputOptions, false);
|
| 19 |
+
const userOnHmrUpdates = devOptions.onHmrUpdates;
|
| 20 |
+
const bindingOnHmrUpdates = userOnHmrUpdates ? function(rawResult) {
|
| 21 |
+
const result = normalizeBindingResult(rawResult);
|
| 22 |
+
if (result instanceof Error) {
|
| 23 |
+
userOnHmrUpdates(result);
|
| 24 |
+
return;
|
| 25 |
+
}
|
| 26 |
+
const [updates, changedFiles] = result;
|
| 27 |
+
userOnHmrUpdates({
|
| 28 |
+
updates,
|
| 29 |
+
changedFiles
|
| 30 |
+
});
|
| 31 |
+
} : void 0;
|
| 32 |
+
const userOnOutput = devOptions.onOutput;
|
| 33 |
+
const bindingOnOutput = userOnOutput ? function(rawResult) {
|
| 34 |
+
const result = normalizeBindingResult(rawResult);
|
| 35 |
+
if (result instanceof Error) {
|
| 36 |
+
userOnOutput(result);
|
| 37 |
+
return;
|
| 38 |
+
}
|
| 39 |
+
userOnOutput(transformToRollupOutput(result));
|
| 40 |
+
} : void 0;
|
| 41 |
+
const userOnAdditionalAssets = devOptions.onAdditionalAssets;
|
| 42 |
+
const bindingDevOptions = {
|
| 43 |
+
onHmrUpdates: bindingOnHmrUpdates,
|
| 44 |
+
onOutput: bindingOnOutput,
|
| 45 |
+
onAdditionalAssets: userOnAdditionalAssets ? function(output) {
|
| 46 |
+
userOnAdditionalAssets(transformToRollupOutput(output));
|
| 47 |
+
} : void 0,
|
| 48 |
+
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding.BindingRebuildStrategy.Always : import_binding.BindingRebuildStrategy.Never : void 0,
|
| 49 |
+
watch: devOptions.watch && {
|
| 50 |
+
enabled: devOptions.watch.enabled,
|
| 51 |
+
skipWrite: devOptions.watch.skipWrite,
|
| 52 |
+
usePolling: devOptions.watch.usePolling,
|
| 53 |
+
pollInterval: devOptions.watch.pollInterval,
|
| 54 |
+
useDebounce: devOptions.watch.useDebounce,
|
| 55 |
+
debounceDuration: devOptions.watch.debounceDuration,
|
| 56 |
+
compareContentsForPolling: devOptions.watch.compareContentsForPolling,
|
| 57 |
+
debounceTickRate: devOptions.watch.debounceTickRate,
|
| 58 |
+
include: normalizedStringOrRegex(devOptions.watch.include),
|
| 59 |
+
exclude: normalizedStringOrRegex(devOptions.watch.exclude)
|
| 60 |
+
}
|
| 61 |
+
};
|
| 62 |
+
const inner = new import_binding.BindingDevEngine(options.bundlerOptions, bindingDevOptions);
|
| 63 |
+
(0, import_binding.startAsyncRuntime)();
|
| 64 |
+
return new DevEngine(inner);
|
| 65 |
+
}
|
| 66 |
+
constructor(inner) {
|
| 67 |
+
this.#inner = inner;
|
| 68 |
+
}
|
| 69 |
+
async run() {
|
| 70 |
+
await this.#inner.run();
|
| 71 |
+
}
|
| 72 |
+
async ensureCurrentBuildFinish() {
|
| 73 |
+
if (this.#cachedBuildFinishPromise) return this.#cachedBuildFinishPromise;
|
| 74 |
+
const promise = this.#inner.ensureCurrentBuildFinish().then(() => {
|
| 75 |
+
this.#cachedBuildFinishPromise = null;
|
| 76 |
+
});
|
| 77 |
+
this.#cachedBuildFinishPromise = promise;
|
| 78 |
+
return promise;
|
| 79 |
+
}
|
| 80 |
+
async getBundleState() {
|
| 81 |
+
return this.#inner.getBundleState();
|
| 82 |
+
}
|
| 83 |
+
async ensureLatestBuildOutput() {
|
| 84 |
+
unwrapBindingResult(await this.#inner.ensureLatestBuildOutput());
|
| 85 |
+
}
|
| 86 |
+
triggerFullBuild() {
|
| 87 |
+
this.#inner.triggerFullBuild();
|
| 88 |
+
}
|
| 89 |
+
/**
|
| 90 |
+
* Client-connect signal (the clientId hello): creates the per-client session
|
| 91 |
+
* with an empty ship map. Reconnects arrive as fresh clientIds.
|
| 92 |
+
*/
|
| 93 |
+
async registerClient(clientId) {
|
| 94 |
+
await this.#inner.registerClient(clientId);
|
| 95 |
+
}
|
| 96 |
+
/**
|
| 97 |
+
* Delivery notification from the serving middleware: the response for
|
| 98 |
+
* `filename` completed, so record its modules as shipped to that client.
|
| 99 |
+
*/
|
| 100 |
+
async notifyPayloadDelivered(filename) {
|
| 101 |
+
await this.#inner.notifyPayloadDelivered(filename);
|
| 102 |
+
}
|
| 103 |
+
async removeClient(clientId) {
|
| 104 |
+
await this.#inner.removeClient(clientId);
|
| 105 |
+
}
|
| 106 |
+
async close() {
|
| 107 |
+
const shouldRelease = !this.#asyncRuntimeReleased;
|
| 108 |
+
this.#asyncRuntimeReleased = true;
|
| 109 |
+
try {
|
| 110 |
+
await this.#inner.close();
|
| 111 |
+
} finally {
|
| 112 |
+
if (shouldRelease) (0, import_binding.shutdownAsyncRuntime)();
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
/**
|
| 116 |
+
* Compile a lazy entry module and return HMR-style patch code.
|
| 117 |
+
*
|
| 118 |
+
* This is called when a dynamically imported module is first requested at runtime.
|
| 119 |
+
* The module was previously stubbed with a proxy, and now we need to compile the
|
| 120 |
+
* actual module and its dependencies.
|
| 121 |
+
*
|
| 122 |
+
* @param moduleId - The absolute file path of the module to compile
|
| 123 |
+
* @param clientId - The client ID requesting this compilation
|
| 124 |
+
* @returns The compiled chunk: its code plus the filename whose delivery the
|
| 125 |
+
* serving middleware reports via {@link notifyPayloadDelivered}
|
| 126 |
+
*/
|
| 127 |
+
async compileEntry(moduleId, clientId) {
|
| 128 |
+
return this.#inner.compileEntry(moduleId, clientId);
|
| 129 |
+
}
|
| 130 |
+
};
|
| 131 |
+
//#endregion
|
| 132 |
+
//#region src/api/dev/index.ts
|
| 133 |
+
const dev = (...args) => DevEngine.create(...args);
|
| 134 |
+
//#endregion
|
| 135 |
+
//#region src/types/external-memory-handle.ts
|
| 136 |
+
const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
|
| 137 |
+
/**
|
| 138 |
+
* Frees the external memory held by the given handle.
|
| 139 |
+
*
|
| 140 |
+
* This is useful when you want to manually release memory held by Rust objects
|
| 141 |
+
* (like `OutputChunk` or `OutputAsset`) before they are garbage collected.
|
| 142 |
+
*
|
| 143 |
+
* @param handle - The object with external memory to free
|
| 144 |
+
* @param keepDataAlive - If true, evaluates all lazy fields before freeing memory (default: false).
|
| 145 |
+
* This will take time to copy data from Rust to JavaScript, but prevents errors
|
| 146 |
+
* when accessing properties after the memory is freed.
|
| 147 |
+
* @returns Status object with `freed` boolean and optional `reason` string.
|
| 148 |
+
* - `{ freed: true }` if memory was successfully freed
|
| 149 |
+
* - `{ freed: false, reason: "..." }` if memory couldn't be freed (e.g., already freed or other references exist)
|
| 150 |
+
*
|
| 151 |
+
* @example
|
| 152 |
+
* ```typescript
|
| 153 |
+
* import { freeExternalMemory } from 'rolldown/experimental';
|
| 154 |
+
*
|
| 155 |
+
* const output = await bundle.generate();
|
| 156 |
+
* const chunk = output.output[0];
|
| 157 |
+
*
|
| 158 |
+
* // Use the chunk...
|
| 159 |
+
*
|
| 160 |
+
* // Manually free the memory (fast, but accessing properties after will throw)
|
| 161 |
+
* const status = freeExternalMemory(chunk); // { freed: true }
|
| 162 |
+
* const statusAgain = freeExternalMemory(chunk); // { freed: false, reason: "Memory has already been freed" }
|
| 163 |
+
*
|
| 164 |
+
* // Keep data alive before freeing (slower, but data remains accessible)
|
| 165 |
+
* freeExternalMemory(chunk, true); // Evaluates all lazy fields first
|
| 166 |
+
* console.log(chunk.code); // OK - data was copied to JavaScript before freeing
|
| 167 |
+
*
|
| 168 |
+
* // Without keepDataAlive, accessing chunk properties after freeing will throw an error
|
| 169 |
+
* ```
|
| 170 |
+
*/
|
| 171 |
+
function freeExternalMemory(handle, keepDataAlive = false) {
|
| 172 |
+
return handle[symbolForExternalMemoryHandle](keepDataAlive);
|
| 173 |
+
}
|
| 174 |
+
//#endregion
|
| 175 |
+
//#region src/api/experimental.ts
|
| 176 |
+
/**
|
| 177 |
+
* This is an experimental API. Its behavior may change in the future.
|
| 178 |
+
*
|
| 179 |
+
* - Calling this API will only execute the `scan/build` stage of rolldown.
|
| 180 |
+
* - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
|
| 181 |
+
*
|
| 182 |
+
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
|
| 183 |
+
* ```ts
|
| 184 |
+
* import { scan } from 'rolldown/api/experimental';
|
| 185 |
+
*
|
| 186 |
+
* const cleanupPromise = await scan(...);
|
| 187 |
+
* await cleanupPromise;
|
| 188 |
+
* // Now all resources have been cleaned up.
|
| 189 |
+
* ```
|
| 190 |
+
*/
|
| 191 |
+
const scan = async (rawInputOptions, rawOutputOptions = {}) => {
|
| 192 |
+
validateOption("input", rawInputOptions);
|
| 193 |
+
validateOption("output", rawOutputOptions);
|
| 194 |
+
const inputOptions = await PluginDriver.callOptionsHook(rawInputOptions);
|
| 195 |
+
const ret = await createBundlerOptions(inputOptions, rawOutputOptions, false);
|
| 196 |
+
const bundler = new import_binding.BindingBundler();
|
| 197 |
+
(0, import_binding.startAsyncRuntime)();
|
| 198 |
+
let cleanedUp = false;
|
| 199 |
+
async function cleanup() {
|
| 200 |
+
if (cleanedUp) return;
|
| 201 |
+
cleanedUp = true;
|
| 202 |
+
try {
|
| 203 |
+
await bundler.close();
|
| 204 |
+
await ret.stopWorkers?.();
|
| 205 |
+
} finally {
|
| 206 |
+
(0, import_binding.shutdownAsyncRuntime)();
|
| 207 |
+
}
|
| 208 |
+
}
|
| 209 |
+
let cleanupPromise = Promise.resolve();
|
| 210 |
+
try {
|
| 211 |
+
const result = await bundler.scan(ret.bundlerOptions);
|
| 212 |
+
unwrapBindingResult(result);
|
| 213 |
+
} catch (err) {
|
| 214 |
+
await cleanup();
|
| 215 |
+
throw err;
|
| 216 |
+
} finally {
|
| 217 |
+
cleanupPromise = cleanup();
|
| 218 |
+
}
|
| 219 |
+
return cleanupPromise;
|
| 220 |
+
};
|
| 221 |
+
//#endregion
|
| 222 |
+
//#region src/plugin/parallel-plugin.ts
|
| 223 |
+
function defineParallelPlugin(pluginPath) {
|
| 224 |
+
return (options) => {
|
| 225 |
+
return { _parallel: {
|
| 226 |
+
fileUrl: pathToFileURL(pluginPath).href,
|
| 227 |
+
options
|
| 228 |
+
} };
|
| 229 |
+
};
|
| 230 |
+
}
|
| 231 |
+
//#endregion
|
| 232 |
+
//#region src/builtin-plugin/alias-plugin.ts
|
| 233 |
+
function viteAliasPlugin(config) {
|
| 234 |
+
return new BuiltinPlugin("builtin:vite-alias", config);
|
| 235 |
+
}
|
| 236 |
+
//#endregion
|
| 237 |
+
//#region src/builtin-plugin/bundle-analyzer-plugin.ts
|
| 238 |
+
/**
|
| 239 |
+
* A plugin that analyzes bundle composition and generates detailed reports.
|
| 240 |
+
*
|
| 241 |
+
* The plugin outputs a file containing detailed information about:
|
| 242 |
+
* - All chunks and their relationships
|
| 243 |
+
* - Modules bundled in each chunk
|
| 244 |
+
* - Import dependencies between chunks
|
| 245 |
+
* - Reachable modules from each entry point
|
| 246 |
+
*
|
| 247 |
+
* @example
|
| 248 |
+
* ```js
|
| 249 |
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
| 250 |
+
*
|
| 251 |
+
* export default {
|
| 252 |
+
* plugins: [
|
| 253 |
+
* bundleAnalyzerPlugin()
|
| 254 |
+
* ]
|
| 255 |
+
* }
|
| 256 |
+
* ```
|
| 257 |
+
*
|
| 258 |
+
* @example
|
| 259 |
+
* **Custom filename**
|
| 260 |
+
* ```js
|
| 261 |
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
| 262 |
+
*
|
| 263 |
+
* export default {
|
| 264 |
+
* plugins: [
|
| 265 |
+
* bundleAnalyzerPlugin({
|
| 266 |
+
* fileName: 'bundle-analysis.json'
|
| 267 |
+
* })
|
| 268 |
+
* ]
|
| 269 |
+
* }
|
| 270 |
+
* ```
|
| 271 |
+
*
|
| 272 |
+
* @example
|
| 273 |
+
* **LLM-friendly markdown output**
|
| 274 |
+
* ```js
|
| 275 |
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
| 276 |
+
*
|
| 277 |
+
* export default {
|
| 278 |
+
* plugins: [
|
| 279 |
+
* bundleAnalyzerPlugin({
|
| 280 |
+
* format: 'md'
|
| 281 |
+
* })
|
| 282 |
+
* ]
|
| 283 |
+
* }
|
| 284 |
+
* ```
|
| 285 |
+
*/
|
| 286 |
+
function bundleAnalyzerPlugin(config) {
|
| 287 |
+
return new BuiltinPlugin("builtin:bundle-analyzer", config);
|
| 288 |
+
}
|
| 289 |
+
//#endregion
|
| 290 |
+
//#region src/builtin-plugin/transform-plugin.ts
|
| 291 |
+
function viteTransformPlugin(config) {
|
| 292 |
+
return new BuiltinPlugin("builtin:vite-transform", {
|
| 293 |
+
...config,
|
| 294 |
+
include: normalizedStringOrRegex(config.include),
|
| 295 |
+
exclude: normalizedStringOrRegex(config.exclude),
|
| 296 |
+
jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
|
| 297 |
+
jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude),
|
| 298 |
+
yarnPnp: typeof process === "object" && !!process.versions?.pnp
|
| 299 |
+
});
|
| 300 |
+
}
|
| 301 |
+
//#endregion
|
| 302 |
+
//#region src/builtin-plugin/vite-manifest-plugin.ts
|
| 303 |
+
function viteManifestPlugin(config) {
|
| 304 |
+
return new BuiltinPlugin("builtin:vite-manifest", config);
|
| 305 |
+
}
|
| 306 |
+
//#endregion
|
| 307 |
+
//#region src/experimental-index.ts
|
| 308 |
+
/**
|
| 309 |
+
* In-memory file system for browser builds.
|
| 310 |
+
*
|
| 311 |
+
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
|
| 312 |
+
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
|
| 313 |
+
*
|
| 314 |
+
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
|
| 315 |
+
* - `volume`: The underlying `Volume` instance that stores the filesystem state
|
| 316 |
+
*
|
| 317 |
+
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
|
| 318 |
+
*
|
| 319 |
+
* @example
|
| 320 |
+
* ```typescript
|
| 321 |
+
* import { memfs } from 'rolldown/experimental';
|
| 322 |
+
*
|
| 323 |
+
* // Write files to virtual filesystem before bundling
|
| 324 |
+
* memfs?.volume.fromJSON({
|
| 325 |
+
* '/src/index.js': 'export const foo = 42;',
|
| 326 |
+
* '/package.json': '{"name": "my-app"}'
|
| 327 |
+
* });
|
| 328 |
+
*
|
| 329 |
+
* // Read files from the virtual filesystem
|
| 330 |
+
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
|
| 331 |
+
* ```
|
| 332 |
+
*
|
| 333 |
+
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
|
| 334 |
+
*/
|
| 335 |
+
const memfs = void 0;
|
| 336 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 337 |
+
const parse = parse$1;
|
| 338 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 339 |
+
const parseSync = parseSync$1;
|
| 340 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 341 |
+
const minify = minify$1;
|
| 342 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 343 |
+
const minifySync = minifySync$1;
|
| 344 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 345 |
+
const transform = transform$1;
|
| 346 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 347 |
+
const transformSync = transformSync$1;
|
| 348 |
+
/** @deprecated Use from `rolldown/utils` instead. */
|
| 349 |
+
const TsconfigCache = TsconfigCache$1;
|
| 350 |
+
//#endregion
|
| 351 |
+
var BindingRebuildStrategy = import_binding.BindingRebuildStrategy;
|
| 352 |
+
var ResolverFactory = import_binding.ResolverFactory;
|
| 353 |
+
var isolatedDeclaration = import_binding.isolatedDeclaration;
|
| 354 |
+
var isolatedDeclarationSync = import_binding.isolatedDeclarationSync;
|
| 355 |
+
var moduleRunnerTransform = import_binding.moduleRunnerTransform;
|
| 356 |
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, TsconfigCache, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin };
|
frontend/node_modules/rolldown/dist/experimental-runtime-base.mjs
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export var __create = Object.create;
|
| 2 |
+
export var __defProp = Object.defineProperty;
|
| 3 |
+
export var __name = (target, value) => __defProp(target, 'name', { value, configurable: true });
|
| 4 |
+
export var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
export var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
export var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
export var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
export var __esm = (fn, res, err) =>
|
| 9 |
+
function () {
|
| 10 |
+
if (err) throw err[0];
|
| 11 |
+
try {
|
| 12 |
+
return (fn && (res = (0, fn[__getOwnPropNames(fn)[0]])((fn = 0))), res);
|
| 13 |
+
} catch (e) {
|
| 14 |
+
throw ((err = [e]), e);
|
| 15 |
+
}
|
| 16 |
+
};
|
| 17 |
+
export var __esmMin = (fn, res, err) => () => {
|
| 18 |
+
if (err) throw err[0];
|
| 19 |
+
try {
|
| 20 |
+
return (fn && (res = fn((fn = 0))), res);
|
| 21 |
+
} catch (e) {
|
| 22 |
+
throw ((err = [e]), e);
|
| 23 |
+
}
|
| 24 |
+
};
|
| 25 |
+
export var __commonJS = (cb, mod) =>
|
| 26 |
+
function () {
|
| 27 |
+
return (
|
| 28 |
+
mod || ((0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), cb = null), mod.exports
|
| 29 |
+
);
|
| 30 |
+
};
|
| 31 |
+
export var __commonJSMin = (cb, mod) => () => (
|
| 32 |
+
mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports
|
| 33 |
+
);
|
| 34 |
+
export var __exportAll = (all, no_symbols) => {
|
| 35 |
+
let target = {};
|
| 36 |
+
for (var name in all) {
|
| 37 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 38 |
+
}
|
| 39 |
+
if (!no_symbols) {
|
| 40 |
+
__defProp(target, Symbol.toStringTag, { value: 'Module' });
|
| 41 |
+
}
|
| 42 |
+
return target;
|
| 43 |
+
};
|
| 44 |
+
export var __copyProps = (to, from, except, desc) => {
|
| 45 |
+
if ((from && typeof from === 'object') || typeof from === 'function') {
|
| 46 |
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
| 47 |
+
key = keys[i];
|
| 48 |
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
| 49 |
+
__defProp(to, key, {
|
| 50 |
+
get: ((k) => from[k]).bind(null, key),
|
| 51 |
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
|
| 52 |
+
});
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
return to;
|
| 57 |
+
};
|
| 58 |
+
export var __reExport = (target, mod, secondTarget) => (
|
| 59 |
+
__copyProps(target, mod, 'default'), secondTarget && __copyProps(secondTarget, mod, 'default')
|
| 60 |
+
);
|
| 61 |
+
export var __toESM = (mod, isNodeMode, target) => (
|
| 62 |
+
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
| 63 |
+
__copyProps(
|
| 64 |
+
// `__esModule` alone is not enough: the module must own a `default` (#10360).
|
| 65 |
+
isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, 'default')
|
| 66 |
+
? __defProp(target, 'default', { value: mod, enumerable: true })
|
| 67 |
+
: target,
|
| 68 |
+
mod,
|
| 69 |
+
)
|
| 70 |
+
);
|
| 71 |
+
export var __toCommonJS = (mod) =>
|
| 72 |
+
__hasOwnProp.call(mod, 'module.exports')
|
| 73 |
+
? mod['module.exports']
|
| 74 |
+
: __copyProps(__defProp({}, '__esModule', { value: true }), mod);
|
| 75 |
+
export var __toBinaryNode = (base64) => new Uint8Array(Buffer.from(base64, 'base64'));
|
| 76 |
+
export var __toBinary = /* @__PURE__ */ (() => {
|
| 77 |
+
var table = new Uint8Array(128);
|
| 78 |
+
for (var i = 0; i < 64; i++) {
|
| 79 |
+
table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
|
| 80 |
+
}
|
| 81 |
+
return (base64) => {
|
| 82 |
+
var n = base64.length,
|
| 83 |
+
bytes = new Uint8Array((((n - (base64[n - 1] == '=') - (base64[n - 2] == '=')) * 3) / 4) | 0);
|
| 84 |
+
for (var i = 0, j = 0; i < n; ) {
|
| 85 |
+
var c0 = table[base64.charCodeAt(i++)],
|
| 86 |
+
c1 = table[base64.charCodeAt(i++)];
|
| 87 |
+
var c2 = table[base64.charCodeAt(i++)],
|
| 88 |
+
c3 = table[base64.charCodeAt(i++)];
|
| 89 |
+
bytes[j++] = (c0 << 2) | (c1 >> 4);
|
| 90 |
+
bytes[j++] = (c1 << 4) | (c2 >> 2);
|
| 91 |
+
bytes[j++] = (c2 << 6) | c3;
|
| 92 |
+
}
|
| 93 |
+
return bytes;
|
| 94 |
+
};
|
| 95 |
+
})();
|
frontend/node_modules/rolldown/dist/experimental-runtime-types.d.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
|
| 3 |
+
* `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
|
| 4 |
+
* `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
|
| 5 |
+
* @typedef {{ ids: string[], localCount: number, edges: number[][], dynamicEdges?: number[][] }} ModuleGraphDelta
|
| 6 |
+
* @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
|
| 7 |
+
*/
|
| 8 |
+
export class MissingFactoryError {
|
| 9 |
+
/**
|
| 10 |
+
* @param {string} id
|
| 11 |
+
*/
|
| 12 |
+
constructor(id: string);
|
| 13 |
+
id: string;
|
| 14 |
+
}
|
| 15 |
+
export class DevRuntime {
|
| 16 |
+
/**
|
| 17 |
+
* @param {string} clientId
|
| 18 |
+
*/
|
| 19 |
+
constructor(clientId: string);
|
| 20 |
+
/**
|
| 21 |
+
* Client ID generated at runtime initialization, used for lazy compilation requests.
|
| 22 |
+
* @type {string}
|
| 23 |
+
*/
|
| 24 |
+
clientId: string;
|
| 25 |
+
/**
|
| 26 |
+
* Static import edges from `registerGraph` — entries persist across `removeModuleCache`
|
| 27 |
+
* and change only by replacement from a newer payload (last write wins).
|
| 28 |
+
* @type {Map<string, { edges: string[] }>}
|
| 29 |
+
*/
|
| 30 |
+
staticImports: Map<string, {
|
| 31 |
+
edges: string[];
|
| 32 |
+
}>;
|
| 33 |
+
/**
|
| 34 |
+
* Reverse index over the static imports.
|
| 35 |
+
* @type {Map<string, Set<string>>}
|
| 36 |
+
*/
|
| 37 |
+
importers: Map<string, Set<string>>;
|
| 38 |
+
/**
|
| 39 |
+
* Dynamic `import()` edges from `registerGraph`, keyed by importer — mirror of
|
| 40 |
+
* `staticImports` for the dynamic reverse index.
|
| 41 |
+
* @type {Map<string, { edges: string[] }>}
|
| 42 |
+
*/
|
| 43 |
+
dynamicImports: Map<string, {
|
| 44 |
+
edges: string[];
|
| 45 |
+
}>;
|
| 46 |
+
/**
|
| 47 |
+
* Reverse index over the dynamic imports.
|
| 48 |
+
* @type {Map<string, Set<string>>}
|
| 49 |
+
*/
|
| 50 |
+
dynamicImporters: Map<string, Set<string>>;
|
| 51 |
+
/**
|
| 52 |
+
* The module cache. Membership means "this module's side effects ran in this tab" —
|
| 53 |
+
* registration is emitted ahead of every module body, and nothing un-registers on
|
| 54 |
+
* unwind, so a factory that throws mid-body stays registered. A `Map` rather than a
|
| 55 |
+
* plain object: HMR eviction deletes entries, and a `delete` on an object drops V8
|
| 56 |
+
* into dictionary mode, taxing every later lookup on the hottest read path.
|
| 57 |
+
* @type {Map<string, Module>}
|
| 58 |
+
*/
|
| 59 |
+
moduleCache: Map<string, Module>;
|
| 60 |
+
/**
|
| 61 |
+
* Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
|
| 62 |
+
* scope-hoisted and contributes none.
|
| 63 |
+
* @type {Map<string, { kind: 'esm' | 'cjs', fn: (id: string) => void }>}
|
| 64 |
+
*/
|
| 65 |
+
factories: Map<string, {
|
| 66 |
+
kind: "esm" | "cjs";
|
| 67 |
+
fn: (id: string) => void;
|
| 68 |
+
}>;
|
| 69 |
+
/**
|
| 70 |
+
* Installed by the dev client at boot. The runtime is a store + executor and makes
|
| 71 |
+
* no HMR decisions; accepting, disposing, and reloading live behind these hooks.
|
| 72 |
+
* @type {DevRuntimeHooks | null}
|
| 73 |
+
*/
|
| 74 |
+
hooks: DevRuntimeHooks | null;
|
| 75 |
+
/**
|
| 76 |
+
* @param {ModuleGraphDelta} delta
|
| 77 |
+
*/
|
| 78 |
+
registerGraph(delta: ModuleGraphDelta): void;
|
| 79 |
+
/**
|
| 80 |
+
* @param {string} id
|
| 81 |
+
* @param {'esm' | 'cjs'} kind
|
| 82 |
+
* @param {(id: string) => void} fn
|
| 83 |
+
*/
|
| 84 |
+
registerFactory(id: string, kind: "esm" | "cjs", fn: (id: string) => void): void;
|
| 85 |
+
/**
|
| 86 |
+
* @param {string} id
|
| 87 |
+
* @param {{ exports: any }} exportsHolder
|
| 88 |
+
*/
|
| 89 |
+
registerModule(id: string, exportsHolder: {
|
| 90 |
+
exports: any;
|
| 91 |
+
}): void;
|
| 92 |
+
/**
|
| 93 |
+
* @param {string} id
|
| 94 |
+
* @returns {string[]}
|
| 95 |
+
*/
|
| 96 |
+
getImporters(id: string): string[];
|
| 97 |
+
/**
|
| 98 |
+
* @param {string} id
|
| 99 |
+
*/
|
| 100 |
+
isExecuted(id: string): any;
|
| 101 |
+
/**
|
| 102 |
+
* @param {string} id
|
| 103 |
+
*/
|
| 104 |
+
hasFactory(id: string): any;
|
| 105 |
+
/**
|
| 106 |
+
* Module-cache delete only — static imports and factories persist. Removal is what
|
| 107 |
+
* re-arms a cache-gated factory for `initModule`.
|
| 108 |
+
* @param {string} id
|
| 109 |
+
*/
|
| 110 |
+
removeModuleCache(id: string): void;
|
| 111 |
+
/**
|
| 112 |
+
* The one re-execution gate: registered → return the live exports; otherwise run the
|
| 113 |
+
* mapped factory (which registers itself first, then runs the body).
|
| 114 |
+
* @param {string} id
|
| 115 |
+
*/
|
| 116 |
+
initModule(id: string): any;
|
| 117 |
+
/**
|
| 118 |
+
* @param {string} id
|
| 119 |
+
*/
|
| 120 |
+
loadExports(id: string): any;
|
| 121 |
+
/**
|
| 122 |
+
* @param {string} moduleId
|
| 123 |
+
*/
|
| 124 |
+
createModuleHotContext(moduleId: string): any;
|
| 125 |
+
/** @internal */
|
| 126 |
+
__toESM: any;
|
| 127 |
+
/** @internal */
|
| 128 |
+
__toCommonJS: any;
|
| 129 |
+
/** @internal */
|
| 130 |
+
__exportAll: any;
|
| 131 |
+
/**
|
| 132 |
+
* @param {boolean} [isNodeMode]
|
| 133 |
+
* @returns {(mod: any) => any}
|
| 134 |
+
* @internal
|
| 135 |
+
*/
|
| 136 |
+
__toDynamicImportESM: (isNodeMode?: boolean) => (mod: any) => any;
|
| 137 |
+
/** @internal */
|
| 138 |
+
__reExport: any;
|
| 139 |
+
}
|
| 140 |
+
/**
|
| 141 |
+
* Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
|
| 142 |
+
* `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
|
| 143 |
+
* `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
|
| 144 |
+
*/
|
| 145 |
+
export type ModuleGraphDelta = {
|
| 146 |
+
ids: string[];
|
| 147 |
+
localCount: number;
|
| 148 |
+
edges: number[][];
|
| 149 |
+
dynamicEdges?: number[][];
|
| 150 |
+
};
|
| 151 |
+
/**
|
| 152 |
+
* Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
|
| 153 |
+
* `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
|
| 154 |
+
* `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
|
| 155 |
+
*/
|
| 156 |
+
export type DevRuntimeHooks = {
|
| 157 |
+
createModuleHotContext(moduleId: string): any;
|
| 158 |
+
onModuleCacheRemoval(moduleId: string): void;
|
| 159 |
+
};
|
| 160 |
+
declare class Module {
|
| 161 |
+
/**
|
| 162 |
+
* @param {string} id
|
| 163 |
+
*/
|
| 164 |
+
constructor(id: string);
|
| 165 |
+
/**
|
| 166 |
+
* @type {{ exports: any }}
|
| 167 |
+
*/
|
| 168 |
+
exportsHolder: {
|
| 169 |
+
exports: any;
|
| 170 |
+
};
|
| 171 |
+
/**
|
| 172 |
+
* @type {string}
|
| 173 |
+
*/
|
| 174 |
+
id: string;
|
| 175 |
+
get exports(): any;
|
| 176 |
+
}
|
| 177 |
+
export {};
|
frontend/node_modules/rolldown/dist/experimental-runtime.d.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
|
| 3 |
+
* `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
|
| 4 |
+
* `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
|
| 5 |
+
* @typedef {{ ids: string[], localCount: number, edges: number[][], dynamicEdges?: number[][] }} ModuleGraphDelta
|
| 6 |
+
* @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
|
| 7 |
+
*/
|
| 8 |
+
export class MissingFactoryError {
|
| 9 |
+
/**
|
| 10 |
+
* @param {string} id
|
| 11 |
+
*/
|
| 12 |
+
constructor(id: string);
|
| 13 |
+
id: string;
|
| 14 |
+
}
|
| 15 |
+
export class DevRuntime {
|
| 16 |
+
/**
|
| 17 |
+
* @param {string} clientId
|
| 18 |
+
*/
|
| 19 |
+
constructor(clientId: string);
|
| 20 |
+
/**
|
| 21 |
+
* Client ID generated at runtime initialization, used for lazy compilation requests.
|
| 22 |
+
* @type {string}
|
| 23 |
+
*/
|
| 24 |
+
clientId: string;
|
| 25 |
+
/**
|
| 26 |
+
* Static import edges from `registerGraph` — entries persist across `removeModuleCache`
|
| 27 |
+
* and change only by replacement from a newer payload (last write wins).
|
| 28 |
+
* @type {Map<string, { edges: string[] }>}
|
| 29 |
+
*/
|
| 30 |
+
staticImports: Map<string, {
|
| 31 |
+
edges: string[];
|
| 32 |
+
}>;
|
| 33 |
+
/**
|
| 34 |
+
* Reverse index over the static imports.
|
| 35 |
+
* @type {Map<string, Set<string>>}
|
| 36 |
+
*/
|
| 37 |
+
importers: Map<string, Set<string>>;
|
| 38 |
+
/**
|
| 39 |
+
* Dynamic `import()` edges from `registerGraph`, keyed by importer — mirror of
|
| 40 |
+
* `staticImports` for the dynamic reverse index.
|
| 41 |
+
* @type {Map<string, { edges: string[] }>}
|
| 42 |
+
*/
|
| 43 |
+
dynamicImports: Map<string, {
|
| 44 |
+
edges: string[];
|
| 45 |
+
}>;
|
| 46 |
+
/**
|
| 47 |
+
* Reverse index over the dynamic imports.
|
| 48 |
+
* @type {Map<string, Set<string>>}
|
| 49 |
+
*/
|
| 50 |
+
dynamicImporters: Map<string, Set<string>>;
|
| 51 |
+
/**
|
| 52 |
+
* The module cache. Membership means "this module's side effects ran in this tab" —
|
| 53 |
+
* registration is emitted ahead of every module body, and nothing un-registers on
|
| 54 |
+
* unwind, so a factory that throws mid-body stays registered. A `Map` rather than a
|
| 55 |
+
* plain object: HMR eviction deletes entries, and a `delete` on an object drops V8
|
| 56 |
+
* into dictionary mode, taxing every later lookup on the hottest read path.
|
| 57 |
+
* @type {Map<string, Module>}
|
| 58 |
+
*/
|
| 59 |
+
moduleCache: Map<string, Module>;
|
| 60 |
+
/**
|
| 61 |
+
* Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
|
| 62 |
+
* scope-hoisted and contributes none.
|
| 63 |
+
* @type {Map<string, { kind: 'esm' | 'cjs', fn: (id: string) => void }>}
|
| 64 |
+
*/
|
| 65 |
+
factories: Map<string, {
|
| 66 |
+
kind: "esm" | "cjs";
|
| 67 |
+
fn: (id: string) => void;
|
| 68 |
+
}>;
|
| 69 |
+
/**
|
| 70 |
+
* Installed by the dev client at boot. The runtime is a store + executor and makes
|
| 71 |
+
* no HMR decisions; accepting, disposing, and reloading live behind these hooks.
|
| 72 |
+
* @type {DevRuntimeHooks | null}
|
| 73 |
+
*/
|
| 74 |
+
hooks: DevRuntimeHooks | null;
|
| 75 |
+
/**
|
| 76 |
+
* @param {ModuleGraphDelta} delta
|
| 77 |
+
*/
|
| 78 |
+
registerGraph(delta: ModuleGraphDelta): void;
|
| 79 |
+
/**
|
| 80 |
+
* @param {string} id
|
| 81 |
+
* @param {'esm' | 'cjs'} kind
|
| 82 |
+
* @param {(id: string) => void} fn
|
| 83 |
+
*/
|
| 84 |
+
registerFactory(id: string, kind: "esm" | "cjs", fn: (id: string) => void): void;
|
| 85 |
+
/**
|
| 86 |
+
* @param {string} id
|
| 87 |
+
* @param {{ exports: any }} exportsHolder
|
| 88 |
+
*/
|
| 89 |
+
registerModule(id: string, exportsHolder: {
|
| 90 |
+
exports: any;
|
| 91 |
+
}): void;
|
| 92 |
+
/**
|
| 93 |
+
* @param {string} id
|
| 94 |
+
* @returns {string[]}
|
| 95 |
+
*/
|
| 96 |
+
getImporters(id: string): string[];
|
| 97 |
+
/**
|
| 98 |
+
* @param {string} id
|
| 99 |
+
*/
|
| 100 |
+
isExecuted(id: string): any;
|
| 101 |
+
/**
|
| 102 |
+
* @param {string} id
|
| 103 |
+
*/
|
| 104 |
+
hasFactory(id: string): any;
|
| 105 |
+
/**
|
| 106 |
+
* Module-cache delete only — static imports and factories persist. Removal is what
|
| 107 |
+
* re-arms a cache-gated factory for `initModule`.
|
| 108 |
+
* @param {string} id
|
| 109 |
+
*/
|
| 110 |
+
removeModuleCache(id: string): void;
|
| 111 |
+
/**
|
| 112 |
+
* The one re-execution gate: registered → return the live exports; otherwise run the
|
| 113 |
+
* mapped factory (which registers itself first, then runs the body).
|
| 114 |
+
* @param {string} id
|
| 115 |
+
*/
|
| 116 |
+
initModule(id: string): any;
|
| 117 |
+
/**
|
| 118 |
+
* @param {string} id
|
| 119 |
+
*/
|
| 120 |
+
loadExports(id: string): any;
|
| 121 |
+
/**
|
| 122 |
+
* @param {string} moduleId
|
| 123 |
+
*/
|
| 124 |
+
createModuleHotContext(moduleId: string): any;
|
| 125 |
+
/** @internal */
|
| 126 |
+
__toESM: any;
|
| 127 |
+
/** @internal */
|
| 128 |
+
__toCommonJS: any;
|
| 129 |
+
/** @internal */
|
| 130 |
+
__exportAll: any;
|
| 131 |
+
/**
|
| 132 |
+
* @param {boolean} [isNodeMode]
|
| 133 |
+
* @returns {(mod: any) => any}
|
| 134 |
+
* @internal
|
| 135 |
+
*/
|
| 136 |
+
__toDynamicImportESM: (isNodeMode?: boolean) => (mod: any) => any;
|
| 137 |
+
/** @internal */
|
| 138 |
+
__reExport: any;
|
| 139 |
+
}
|
| 140 |
+
/**
|
| 141 |
+
* Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
|
| 142 |
+
* `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
|
| 143 |
+
* `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
|
| 144 |
+
*/
|
| 145 |
+
export type ModuleGraphDelta = {
|
| 146 |
+
ids: string[];
|
| 147 |
+
localCount: number;
|
| 148 |
+
edges: number[][];
|
| 149 |
+
dynamicEdges?: number[][];
|
| 150 |
+
};
|
| 151 |
+
/**
|
| 152 |
+
* Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
|
| 153 |
+
* `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
|
| 154 |
+
* `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
|
| 155 |
+
*/
|
| 156 |
+
export type DevRuntimeHooks = {
|
| 157 |
+
createModuleHotContext(moduleId: string): any;
|
| 158 |
+
onModuleCacheRemoval(moduleId: string): void;
|
| 159 |
+
};
|
| 160 |
+
declare class Module {
|
| 161 |
+
/**
|
| 162 |
+
* @param {string} id
|
| 163 |
+
*/
|
| 164 |
+
constructor(id: string);
|
| 165 |
+
/**
|
| 166 |
+
* @type {{ exports: any }}
|
| 167 |
+
*/
|
| 168 |
+
exportsHolder: {
|
| 169 |
+
exports: any;
|
| 170 |
+
};
|
| 171 |
+
/**
|
| 172 |
+
* @type {string}
|
| 173 |
+
*/
|
| 174 |
+
id: string;
|
| 175 |
+
get exports(): any;
|
| 176 |
+
}
|
| 177 |
+
export {};
|
frontend/node_modules/rolldown/dist/experimental-runtime.mjs
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { __exportAll, __reExport, __toCommonJS, __toESM } from './experimental-runtime-base.mjs';
|
| 2 |
+
// @ts-check
|
| 3 |
+
|
| 4 |
+
class Module {
|
| 5 |
+
/**
|
| 6 |
+
* @type {{ exports: any }}
|
| 7 |
+
*/
|
| 8 |
+
exportsHolder = { exports: null };
|
| 9 |
+
/**
|
| 10 |
+
* @type {string}
|
| 11 |
+
*/
|
| 12 |
+
id;
|
| 13 |
+
|
| 14 |
+
/**
|
| 15 |
+
* @param {string} id
|
| 16 |
+
*/
|
| 17 |
+
constructor(id) {
|
| 18 |
+
this.id = id;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
get exports() {
|
| 22 |
+
return this.exportsHolder.exports;
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
|
| 28 |
+
* `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
|
| 29 |
+
* `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
|
| 30 |
+
* @typedef {{ ids: string[], localCount: number, edges: number[][], dynamicEdges?: number[][] }} ModuleGraphDelta
|
| 31 |
+
* @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
export class MissingFactoryError extends Error {
|
| 35 |
+
/**
|
| 36 |
+
* @param {string} id
|
| 37 |
+
*/
|
| 38 |
+
constructor(id) {
|
| 39 |
+
super(`No factory registered for module ${id}`);
|
| 40 |
+
this.id = id;
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
export class DevRuntime {
|
| 45 |
+
/**
|
| 46 |
+
* Client ID generated at runtime initialization, used for lazy compilation requests.
|
| 47 |
+
* @type {string}
|
| 48 |
+
*/
|
| 49 |
+
clientId;
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* @param {string} clientId
|
| 53 |
+
*/
|
| 54 |
+
constructor(clientId) {
|
| 55 |
+
this.clientId = clientId;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* Static import edges from `registerGraph` — entries persist across `removeModuleCache`
|
| 60 |
+
* and change only by replacement from a newer payload (last write wins).
|
| 61 |
+
* @type {Map<string, { edges: string[] }>}
|
| 62 |
+
*/
|
| 63 |
+
staticImports = new Map();
|
| 64 |
+
/**
|
| 65 |
+
* Reverse index over the static imports.
|
| 66 |
+
* @type {Map<string, Set<string>>}
|
| 67 |
+
*/
|
| 68 |
+
importers = new Map();
|
| 69 |
+
/**
|
| 70 |
+
* Dynamic `import()` edges from `registerGraph`, keyed by importer — mirror of
|
| 71 |
+
* `staticImports` for the dynamic reverse index.
|
| 72 |
+
* @type {Map<string, { edges: string[] }>}
|
| 73 |
+
*/
|
| 74 |
+
dynamicImports = new Map();
|
| 75 |
+
/**
|
| 76 |
+
* Reverse index over the dynamic imports.
|
| 77 |
+
* @type {Map<string, Set<string>>}
|
| 78 |
+
*/
|
| 79 |
+
dynamicImporters = new Map();
|
| 80 |
+
/**
|
| 81 |
+
* The module cache. Membership means "this module's side effects ran in this tab" —
|
| 82 |
+
* registration is emitted ahead of every module body, and nothing un-registers on
|
| 83 |
+
* unwind, so a factory that throws mid-body stays registered. A `Map` rather than a
|
| 84 |
+
* plain object: HMR eviction deletes entries, and a `delete` on an object drops V8
|
| 85 |
+
* into dictionary mode, taxing every later lookup on the hottest read path.
|
| 86 |
+
* @type {Map<string, Module>}
|
| 87 |
+
*/
|
| 88 |
+
moduleCache = new Map();
|
| 89 |
+
/**
|
| 90 |
+
* Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
|
| 91 |
+
* scope-hoisted and contributes none.
|
| 92 |
+
* @type {Map<string, { kind: 'esm' | 'cjs', fn: (id: string) => void }>}
|
| 93 |
+
*/
|
| 94 |
+
factories = new Map();
|
| 95 |
+
/**
|
| 96 |
+
* Installed by the dev client at boot. The runtime is a store + executor and makes
|
| 97 |
+
* no HMR decisions; accepting, disposing, and reloading live behind these hooks.
|
| 98 |
+
* @type {DevRuntimeHooks | null}
|
| 99 |
+
*/
|
| 100 |
+
hooks = null;
|
| 101 |
+
|
| 102 |
+
/**
|
| 103 |
+
* @param {ModuleGraphDelta} delta
|
| 104 |
+
*/
|
| 105 |
+
registerGraph(delta) {
|
| 106 |
+
for (let i = 0; i < delta.localCount; i++) {
|
| 107 |
+
const id = delta.ids[i];
|
| 108 |
+
const edges = delta.edges[i].map((j) => delta.ids[j]);
|
| 109 |
+
for (const target of this.staticImports.get(id)?.edges ?? []) {
|
| 110 |
+
this.importers.get(target)?.delete(id);
|
| 111 |
+
}
|
| 112 |
+
for (const target of edges) {
|
| 113 |
+
let importerSet = this.importers.get(target);
|
| 114 |
+
if (!importerSet) {
|
| 115 |
+
importerSet = new Set();
|
| 116 |
+
this.importers.set(target, importerSet);
|
| 117 |
+
}
|
| 118 |
+
importerSet.add(id);
|
| 119 |
+
}
|
| 120 |
+
this.staticImports.set(id, { edges });
|
| 121 |
+
|
| 122 |
+
// Dynamic `import()` edges are maintained in a parallel reverse index with the same
|
| 123 |
+
// last-write-wins bookkeeping; `getImporters` unions the two.
|
| 124 |
+
const dynamicEdges = (delta.dynamicEdges?.[i] ?? []).map((j) => delta.ids[j]);
|
| 125 |
+
for (const target of this.dynamicImports.get(id)?.edges ?? []) {
|
| 126 |
+
this.dynamicImporters.get(target)?.delete(id);
|
| 127 |
+
}
|
| 128 |
+
for (const target of dynamicEdges) {
|
| 129 |
+
let importerSet = this.dynamicImporters.get(target);
|
| 130 |
+
if (!importerSet) {
|
| 131 |
+
importerSet = new Set();
|
| 132 |
+
this.dynamicImporters.set(target, importerSet);
|
| 133 |
+
}
|
| 134 |
+
importerSet.add(id);
|
| 135 |
+
}
|
| 136 |
+
this.dynamicImports.set(id, { edges: dynamicEdges });
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/**
|
| 141 |
+
* @param {string} id
|
| 142 |
+
* @param {'esm' | 'cjs'} kind
|
| 143 |
+
* @param {(id: string) => void} fn
|
| 144 |
+
*/
|
| 145 |
+
registerFactory(id, kind, fn) {
|
| 146 |
+
this.factories.set(id, { kind, fn });
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
/**
|
| 150 |
+
* @param {string} id
|
| 151 |
+
* @param {{ exports: any }} exportsHolder
|
| 152 |
+
*/
|
| 153 |
+
registerModule(id, exportsHolder) {
|
| 154 |
+
const module = new Module(id);
|
| 155 |
+
module.exportsHolder = exportsHolder;
|
| 156 |
+
this.moduleCache.set(id, module);
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
/**
|
| 160 |
+
* @param {string} id
|
| 161 |
+
* @returns {string[]}
|
| 162 |
+
*/
|
| 163 |
+
getImporters(id) {
|
| 164 |
+
// Static ∪ dynamic importers — the boundary walk treats both kinds the same (parity
|
| 165 |
+
// with Vite `node.importers` / webpack `module.parents`). Deduped so a module that
|
| 166 |
+
// imports `id` both statically and via `import()` appears once.
|
| 167 |
+
const dynamic = this.dynamicImporters.get(id);
|
| 168 |
+
if (!dynamic || dynamic.size === 0) {
|
| 169 |
+
return [...(this.importers.get(id) ?? [])];
|
| 170 |
+
}
|
| 171 |
+
return [...new Set([...(this.importers.get(id) ?? []), ...dynamic])];
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
/**
|
| 175 |
+
* @param {string} id
|
| 176 |
+
*/
|
| 177 |
+
isExecuted(id) {
|
| 178 |
+
return this.moduleCache.has(id);
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
/**
|
| 182 |
+
* @param {string} id
|
| 183 |
+
*/
|
| 184 |
+
hasFactory(id) {
|
| 185 |
+
return this.factories.has(id);
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
/**
|
| 189 |
+
* Module-cache delete only — static imports and factories persist. Removal is what
|
| 190 |
+
* re-arms a cache-gated factory for `initModule`.
|
| 191 |
+
* @param {string} id
|
| 192 |
+
*/
|
| 193 |
+
removeModuleCache(id) {
|
| 194 |
+
this.moduleCache.delete(id);
|
| 195 |
+
this.hooks?.onModuleCacheRemoval(id);
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
/**
|
| 199 |
+
* The one re-execution gate: registered → return the live exports; otherwise run the
|
| 200 |
+
* mapped factory (which registers itself first, then runs the body).
|
| 201 |
+
* @param {string} id
|
| 202 |
+
*/
|
| 203 |
+
initModule(id) {
|
| 204 |
+
if (this.moduleCache.has(id)) {
|
| 205 |
+
return this.loadExports(id);
|
| 206 |
+
}
|
| 207 |
+
const factory = this.factories.get(id);
|
| 208 |
+
if (!factory) {
|
| 209 |
+
throw new MissingFactoryError(id);
|
| 210 |
+
}
|
| 211 |
+
factory.fn(id);
|
| 212 |
+
return this.loadExports(id);
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
/**
|
| 216 |
+
* @param {string} id
|
| 217 |
+
*/
|
| 218 |
+
loadExports(id) {
|
| 219 |
+
const module = this.moduleCache.get(id);
|
| 220 |
+
if (module) {
|
| 221 |
+
return module.exportsHolder.exports;
|
| 222 |
+
} else {
|
| 223 |
+
console.warn(`Module ${id} not found`);
|
| 224 |
+
return {};
|
| 225 |
+
}
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
/**
|
| 229 |
+
* @param {string} moduleId
|
| 230 |
+
*/
|
| 231 |
+
createModuleHotContext(moduleId) {
|
| 232 |
+
if (this.hooks) {
|
| 233 |
+
return this.hooks.createModuleHotContext(moduleId);
|
| 234 |
+
}
|
| 235 |
+
throw new Error('createModuleHotContext requires installed hooks or an override');
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
/** @internal */
|
| 239 |
+
// @ts-expect-error The variable will be injected at build time.
|
| 240 |
+
__toESM = __toESM;
|
| 241 |
+
/** @internal */
|
| 242 |
+
// @ts-expect-error The variable will be injected at build time.
|
| 243 |
+
__toCommonJS = __toCommonJS;
|
| 244 |
+
/** @internal */
|
| 245 |
+
// @ts-expect-error The variable will be injected at build time.
|
| 246 |
+
__exportAll = __exportAll;
|
| 247 |
+
/**
|
| 248 |
+
* @param {boolean} [isNodeMode]
|
| 249 |
+
* @returns {(mod: any) => any}
|
| 250 |
+
* @internal
|
| 251 |
+
*/
|
| 252 |
+
// @ts-expect-error The variable will be injected at build time.
|
| 253 |
+
__toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
|
| 254 |
+
/** @internal */
|
| 255 |
+
// @ts-expect-error The variable will be injected at build time.
|
| 256 |
+
__reExport = __reExport;
|
| 257 |
+
}
|
frontend/node_modules/rolldown/dist/filter-index.d.mts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { F as withFilter } from "./shared/define-config-DVsXPNaU.mjs";
|
| 2 |
+
//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.1/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts
|
| 3 |
+
//#region src/filter/composable-filters.d.ts
|
| 4 |
+
type StringOrRegExp = string | RegExp;
|
| 5 |
+
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
| 6 |
+
type FilterExpressionKind = FilterExpression['kind'];
|
| 7 |
+
type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType | Code | Query;
|
| 8 |
+
type TopLevelFilterExpression = Include | Exclude;
|
| 9 |
+
declare class And {
|
| 10 |
+
kind: 'and';
|
| 11 |
+
args: FilterExpression[];
|
| 12 |
+
constructor(...args: FilterExpression[]);
|
| 13 |
+
}
|
| 14 |
+
declare class Or {
|
| 15 |
+
kind: 'or';
|
| 16 |
+
args: FilterExpression[];
|
| 17 |
+
constructor(...args: FilterExpression[]);
|
| 18 |
+
}
|
| 19 |
+
declare class Not {
|
| 20 |
+
kind: 'not';
|
| 21 |
+
expr: FilterExpression;
|
| 22 |
+
constructor(expr: FilterExpression);
|
| 23 |
+
}
|
| 24 |
+
interface QueryFilterObject {
|
| 25 |
+
[key: string]: StringOrRegExp | boolean;
|
| 26 |
+
}
|
| 27 |
+
interface IdParams {
|
| 28 |
+
cleanUrl?: boolean;
|
| 29 |
+
}
|
| 30 |
+
declare class Id {
|
| 31 |
+
kind: 'id';
|
| 32 |
+
pattern: StringOrRegExp;
|
| 33 |
+
params: IdParams;
|
| 34 |
+
constructor(pattern: StringOrRegExp, params?: IdParams);
|
| 35 |
+
}
|
| 36 |
+
declare class ImporterId {
|
| 37 |
+
kind: 'importerId';
|
| 38 |
+
pattern: StringOrRegExp;
|
| 39 |
+
params: IdParams;
|
| 40 |
+
constructor(pattern: StringOrRegExp, params?: IdParams);
|
| 41 |
+
}
|
| 42 |
+
declare class ModuleType {
|
| 43 |
+
kind: 'moduleType';
|
| 44 |
+
pattern: PluginModuleType;
|
| 45 |
+
constructor(pattern: PluginModuleType);
|
| 46 |
+
}
|
| 47 |
+
declare class Code {
|
| 48 |
+
kind: 'code';
|
| 49 |
+
pattern: StringOrRegExp;
|
| 50 |
+
constructor(expr: StringOrRegExp);
|
| 51 |
+
}
|
| 52 |
+
declare class Query {
|
| 53 |
+
kind: 'query';
|
| 54 |
+
key: string;
|
| 55 |
+
pattern: StringOrRegExp | boolean;
|
| 56 |
+
constructor(key: string, pattern: StringOrRegExp | boolean);
|
| 57 |
+
}
|
| 58 |
+
declare class Include {
|
| 59 |
+
kind: 'include';
|
| 60 |
+
expr: FilterExpression;
|
| 61 |
+
constructor(expr: FilterExpression);
|
| 62 |
+
}
|
| 63 |
+
declare class Exclude {
|
| 64 |
+
kind: 'exclude';
|
| 65 |
+
expr: FilterExpression;
|
| 66 |
+
constructor(expr: FilterExpression);
|
| 67 |
+
}
|
| 68 |
+
declare function and(...args: FilterExpression[]): And;
|
| 69 |
+
declare function or(...args: FilterExpression[]): Or;
|
| 70 |
+
declare function not(expr: FilterExpression): Not;
|
| 71 |
+
declare function id(pattern: StringOrRegExp, params?: IdParams): Id;
|
| 72 |
+
declare function importerId(pattern: StringOrRegExp, params?: IdParams): ImporterId;
|
| 73 |
+
declare function moduleType(pattern: PluginModuleType): ModuleType;
|
| 74 |
+
declare function code(pattern: StringOrRegExp): Code;
|
| 75 |
+
declare function query(key: string, pattern: StringOrRegExp | boolean): Query;
|
| 76 |
+
declare function include(expr: FilterExpression): Include;
|
| 77 |
+
declare function exclude(expr: FilterExpression): Exclude;
|
| 78 |
+
/**
|
| 79 |
+
* convert a queryObject to FilterExpression like
|
| 80 |
+
* ```js
|
| 81 |
+
* and(query(k1, v1), query(k2, v2))
|
| 82 |
+
* ```
|
| 83 |
+
* @param queryFilterObject The query filter object needs to be matched.
|
| 84 |
+
* @returns a `And` FilterExpression
|
| 85 |
+
*/
|
| 86 |
+
declare function queries(queryFilter: QueryFilterObject): And;
|
| 87 |
+
declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string): boolean;
|
| 88 |
+
interface InterpreterCtx {
|
| 89 |
+
urlSearchParamsCache?: URLSearchParams;
|
| 90 |
+
}
|
| 91 |
+
declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
| 92 |
+
declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
| 93 |
+
//#endregion
|
| 94 |
+
//#region src/filter/filter-vite-plugins.d.ts
|
| 95 |
+
/**
|
| 96 |
+
* Filters out Vite plugins that have `apply: 'serve'` set.
|
| 97 |
+
*
|
| 98 |
+
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
|
| 99 |
+
* are intended only for Vite's dev server and should be excluded from the build process.
|
| 100 |
+
*
|
| 101 |
+
* @param plugins - Array of plugins (can include nested arrays)
|
| 102 |
+
* @returns Filtered array with serve-only plugins removed
|
| 103 |
+
*
|
| 104 |
+
* @example
|
| 105 |
+
* ```ts
|
| 106 |
+
* import { defineConfig } from 'rolldown';
|
| 107 |
+
* import { filterVitePlugins } from '@rolldown/pluginutils';
|
| 108 |
+
* import viteReact from '@vitejs/plugin-react';
|
| 109 |
+
*
|
| 110 |
+
* export default defineConfig({
|
| 111 |
+
* plugins: filterVitePlugins([
|
| 112 |
+
* viteReact(),
|
| 113 |
+
* {
|
| 114 |
+
* name: 'dev-only',
|
| 115 |
+
* apply: 'serve', // This will be filtered out
|
| 116 |
+
* // ...
|
| 117 |
+
* }
|
| 118 |
+
* ])
|
| 119 |
+
* });
|
| 120 |
+
* ```
|
| 121 |
+
*/
|
| 122 |
+
declare function filterVitePlugins<T = any>(plugins: T | T[] | null | undefined | false): T[];
|
| 123 |
+
//#endregion
|
| 124 |
+
//#region src/filter/simple-filters.d.ts
|
| 125 |
+
/**
|
| 126 |
+
* Constructs a RegExp that matches the exact string specified.
|
| 127 |
+
*
|
| 128 |
+
* This is useful for plugin hook filters.
|
| 129 |
+
*
|
| 130 |
+
* @param str the string to match.
|
| 131 |
+
* @param flags flags for the RegExp.
|
| 132 |
+
*
|
| 133 |
+
* @example
|
| 134 |
+
* ```ts
|
| 135 |
+
* import { exactRegex } from '@rolldown/pluginutils';
|
| 136 |
+
* const plugin = {
|
| 137 |
+
* name: 'plugin',
|
| 138 |
+
* resolveId: {
|
| 139 |
+
* filter: { id: exactRegex('foo') },
|
| 140 |
+
* handler(id) {} // will only be called for `foo`
|
| 141 |
+
* }
|
| 142 |
+
* }
|
| 143 |
+
* ```
|
| 144 |
+
*/
|
| 145 |
+
declare function exactRegex(str: string, flags?: string): RegExp;
|
| 146 |
+
/**
|
| 147 |
+
* Constructs a RegExp that matches a value that has the specified prefix.
|
| 148 |
+
*
|
| 149 |
+
* This is useful for plugin hook filters.
|
| 150 |
+
*
|
| 151 |
+
* @param str the string to match.
|
| 152 |
+
* @param flags flags for the RegExp.
|
| 153 |
+
*
|
| 154 |
+
* @example
|
| 155 |
+
* ```ts
|
| 156 |
+
* import { prefixRegex } from '@rolldown/pluginutils';
|
| 157 |
+
* const plugin = {
|
| 158 |
+
* name: 'plugin',
|
| 159 |
+
* resolveId: {
|
| 160 |
+
* filter: { id: prefixRegex('foo') },
|
| 161 |
+
* handler(id) {} // will only be called for IDs starting with `foo`
|
| 162 |
+
* }
|
| 163 |
+
* }
|
| 164 |
+
* ```
|
| 165 |
+
*/
|
| 166 |
+
declare function prefixRegex(str: string, flags?: string): RegExp;
|
| 167 |
+
type WidenString<T> = T extends string ? string : T;
|
| 168 |
+
/**
|
| 169 |
+
* Converts a id filter to match with an id with a query.
|
| 170 |
+
*
|
| 171 |
+
* @param input the id filters to convert.
|
| 172 |
+
*
|
| 173 |
+
* @example
|
| 174 |
+
* ```ts
|
| 175 |
+
* import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils';
|
| 176 |
+
* const plugin = {
|
| 177 |
+
* name: 'plugin',
|
| 178 |
+
* transform: {
|
| 179 |
+
* filter: { id: makeIdFiltersToMatchWithQuery(['**' + '/*.js', /\.ts$/]) },
|
| 180 |
+
* // The handler will be called for IDs like:
|
| 181 |
+
* // - foo.js
|
| 182 |
+
* // - foo.js?foo
|
| 183 |
+
* // - foo.txt?foo.js
|
| 184 |
+
* // - foo.ts
|
| 185 |
+
* // - foo.ts?foo
|
| 186 |
+
* // - foo.txt?foo.ts
|
| 187 |
+
* handler(code, id) {}
|
| 188 |
+
* }
|
| 189 |
+
* }
|
| 190 |
+
* ```
|
| 191 |
+
*/
|
| 192 |
+
declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: T): WidenString<T>;
|
| 193 |
+
declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: readonly T[]): WidenString<T>[];
|
| 194 |
+
declare function makeIdFiltersToMatchWithQuery(input: string | RegExp | readonly (string | RegExp)[]): string | RegExp | (string | RegExp)[];
|
| 195 |
+
//#endregion
|
| 196 |
+
export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query, withFilter };
|
frontend/node_modules/rolldown/dist/filter-index.mjs
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { r as isPromiseLike, t as arraify } from "./shared/misc-DOSKtd97.mjs";
|
| 2 |
+
//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.1/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs
|
| 3 |
+
const postfixRE = /[?#].*$/;
|
| 4 |
+
function cleanUrl(url) {
|
| 5 |
+
return url.replace(postfixRE, "");
|
| 6 |
+
}
|
| 7 |
+
function extractQueryWithoutFragment(url) {
|
| 8 |
+
const questionMarkIndex = url.indexOf("?");
|
| 9 |
+
if (questionMarkIndex === -1) return "";
|
| 10 |
+
const fragmentIndex = url.indexOf("#", questionMarkIndex);
|
| 11 |
+
if (fragmentIndex === -1) return url.substring(questionMarkIndex);
|
| 12 |
+
else return url.substring(questionMarkIndex, fragmentIndex);
|
| 13 |
+
}
|
| 14 |
+
var And = class {
|
| 15 |
+
kind;
|
| 16 |
+
args;
|
| 17 |
+
constructor(...args) {
|
| 18 |
+
if (args.length === 0) throw new Error("`And` expects at least one operand");
|
| 19 |
+
this.args = args;
|
| 20 |
+
this.kind = "and";
|
| 21 |
+
}
|
| 22 |
+
};
|
| 23 |
+
var Or = class {
|
| 24 |
+
kind;
|
| 25 |
+
args;
|
| 26 |
+
constructor(...args) {
|
| 27 |
+
if (args.length === 0) throw new Error("`Or` expects at least one operand");
|
| 28 |
+
this.args = args;
|
| 29 |
+
this.kind = "or";
|
| 30 |
+
}
|
| 31 |
+
};
|
| 32 |
+
var Not = class {
|
| 33 |
+
kind;
|
| 34 |
+
expr;
|
| 35 |
+
constructor(expr) {
|
| 36 |
+
this.expr = expr;
|
| 37 |
+
this.kind = "not";
|
| 38 |
+
}
|
| 39 |
+
};
|
| 40 |
+
var Id = class {
|
| 41 |
+
kind;
|
| 42 |
+
pattern;
|
| 43 |
+
params;
|
| 44 |
+
constructor(pattern, params) {
|
| 45 |
+
this.pattern = pattern;
|
| 46 |
+
this.kind = "id";
|
| 47 |
+
this.params = params ?? { cleanUrl: false };
|
| 48 |
+
}
|
| 49 |
+
};
|
| 50 |
+
var ImporterId = class {
|
| 51 |
+
kind;
|
| 52 |
+
pattern;
|
| 53 |
+
params;
|
| 54 |
+
constructor(pattern, params) {
|
| 55 |
+
this.pattern = pattern;
|
| 56 |
+
this.kind = "importerId";
|
| 57 |
+
this.params = params ?? { cleanUrl: false };
|
| 58 |
+
}
|
| 59 |
+
};
|
| 60 |
+
var ModuleType = class {
|
| 61 |
+
kind;
|
| 62 |
+
pattern;
|
| 63 |
+
constructor(pattern) {
|
| 64 |
+
this.pattern = pattern;
|
| 65 |
+
this.kind = "moduleType";
|
| 66 |
+
}
|
| 67 |
+
};
|
| 68 |
+
var Code = class {
|
| 69 |
+
kind;
|
| 70 |
+
pattern;
|
| 71 |
+
constructor(expr) {
|
| 72 |
+
this.pattern = expr;
|
| 73 |
+
this.kind = "code";
|
| 74 |
+
}
|
| 75 |
+
};
|
| 76 |
+
var Query = class {
|
| 77 |
+
kind;
|
| 78 |
+
key;
|
| 79 |
+
pattern;
|
| 80 |
+
constructor(key, pattern) {
|
| 81 |
+
this.pattern = pattern;
|
| 82 |
+
this.key = key;
|
| 83 |
+
this.kind = "query";
|
| 84 |
+
}
|
| 85 |
+
};
|
| 86 |
+
var Include = class {
|
| 87 |
+
kind;
|
| 88 |
+
expr;
|
| 89 |
+
constructor(expr) {
|
| 90 |
+
this.expr = expr;
|
| 91 |
+
this.kind = "include";
|
| 92 |
+
}
|
| 93 |
+
};
|
| 94 |
+
var Exclude = class {
|
| 95 |
+
kind;
|
| 96 |
+
expr;
|
| 97 |
+
constructor(expr) {
|
| 98 |
+
this.expr = expr;
|
| 99 |
+
this.kind = "exclude";
|
| 100 |
+
}
|
| 101 |
+
};
|
| 102 |
+
function and(...args) {
|
| 103 |
+
return new And(...args);
|
| 104 |
+
}
|
| 105 |
+
function or(...args) {
|
| 106 |
+
return new Or(...args);
|
| 107 |
+
}
|
| 108 |
+
function not(expr) {
|
| 109 |
+
return new Not(expr);
|
| 110 |
+
}
|
| 111 |
+
function id(pattern, params) {
|
| 112 |
+
return new Id(pattern, params);
|
| 113 |
+
}
|
| 114 |
+
function importerId(pattern, params) {
|
| 115 |
+
return new ImporterId(pattern, params);
|
| 116 |
+
}
|
| 117 |
+
function moduleType(pattern) {
|
| 118 |
+
return new ModuleType(pattern);
|
| 119 |
+
}
|
| 120 |
+
function code(pattern) {
|
| 121 |
+
return new Code(pattern);
|
| 122 |
+
}
|
| 123 |
+
function query(key, pattern) {
|
| 124 |
+
return new Query(key, pattern);
|
| 125 |
+
}
|
| 126 |
+
function include(expr) {
|
| 127 |
+
return new Include(expr);
|
| 128 |
+
}
|
| 129 |
+
function exclude(expr) {
|
| 130 |
+
return new Exclude(expr);
|
| 131 |
+
}
|
| 132 |
+
/**
|
| 133 |
+
* convert a queryObject to FilterExpression like
|
| 134 |
+
* ```js
|
| 135 |
+
* and(query(k1, v1), query(k2, v2))
|
| 136 |
+
* ```
|
| 137 |
+
* @param queryFilterObject The query filter object needs to be matched.
|
| 138 |
+
* @returns a `And` FilterExpression
|
| 139 |
+
*/
|
| 140 |
+
function queries(queryFilter) {
|
| 141 |
+
return and(...Object.entries(queryFilter).map(([key, value]) => {
|
| 142 |
+
return new Query(key, value);
|
| 143 |
+
}));
|
| 144 |
+
}
|
| 145 |
+
function interpreter(exprs, code, id, moduleType, importerId) {
|
| 146 |
+
let arr = [];
|
| 147 |
+
if (Array.isArray(exprs)) arr = exprs;
|
| 148 |
+
else arr = [exprs];
|
| 149 |
+
return interpreterImpl(arr, code, id, moduleType, importerId);
|
| 150 |
+
}
|
| 151 |
+
function interpreterImpl(expr, code, id, moduleType, importerId, ctx = {}) {
|
| 152 |
+
let hasInclude = false;
|
| 153 |
+
for (const e of expr) switch (e.kind) {
|
| 154 |
+
case "include":
|
| 155 |
+
hasInclude = true;
|
| 156 |
+
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return true;
|
| 157 |
+
break;
|
| 158 |
+
case "exclude":
|
| 159 |
+
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return false;
|
| 160 |
+
break;
|
| 161 |
+
}
|
| 162 |
+
return !hasInclude;
|
| 163 |
+
}
|
| 164 |
+
function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) {
|
| 165 |
+
switch (expr.kind) {
|
| 166 |
+
case "and": return expr.args.every((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
| 167 |
+
case "or": return expr.args.some((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
| 168 |
+
case "not": return !exprInterpreter(expr.expr, code, id, moduleType, importerId, ctx);
|
| 169 |
+
case "id": {
|
| 170 |
+
if (id === void 0) throw new Error("`id` is required for `id` expression");
|
| 171 |
+
let idToMatch = id;
|
| 172 |
+
if (expr.params.cleanUrl) idToMatch = cleanUrl(idToMatch);
|
| 173 |
+
return typeof expr.pattern === "string" ? idToMatch === expr.pattern : expr.pattern.test(idToMatch);
|
| 174 |
+
}
|
| 175 |
+
case "importerId": {
|
| 176 |
+
if (importerId === void 0) return false;
|
| 177 |
+
let importerIdToMatch = importerId;
|
| 178 |
+
if (expr.params.cleanUrl) importerIdToMatch = cleanUrl(importerIdToMatch);
|
| 179 |
+
return typeof expr.pattern === "string" ? importerIdToMatch === expr.pattern : expr.pattern.test(importerIdToMatch);
|
| 180 |
+
}
|
| 181 |
+
case "moduleType":
|
| 182 |
+
if (moduleType === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
|
| 183 |
+
return moduleType === expr.pattern;
|
| 184 |
+
case "code":
|
| 185 |
+
if (code === void 0) throw new Error("`code` is required for `code` expression");
|
| 186 |
+
return typeof expr.pattern === "string" ? code.includes(expr.pattern) : expr.pattern.test(code);
|
| 187 |
+
case "query": {
|
| 188 |
+
if (id === void 0) throw new Error("`id` is required for `Query` expression");
|
| 189 |
+
if (!ctx.urlSearchParamsCache) {
|
| 190 |
+
let queryString = extractQueryWithoutFragment(id);
|
| 191 |
+
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
|
| 192 |
+
}
|
| 193 |
+
let urlParams = ctx.urlSearchParamsCache;
|
| 194 |
+
if (typeof expr.pattern === "boolean") if (expr.pattern) return urlParams.has(expr.key);
|
| 195 |
+
else return !urlParams.has(expr.key);
|
| 196 |
+
else if (typeof expr.pattern === "string") return urlParams.get(expr.key) === expr.pattern;
|
| 197 |
+
else return expr.pattern.test(urlParams.get(expr.key) ?? "");
|
| 198 |
+
}
|
| 199 |
+
default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
/**
|
| 203 |
+
* Filters out Vite plugins that have `apply: 'serve'` set.
|
| 204 |
+
*
|
| 205 |
+
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
|
| 206 |
+
* are intended only for Vite's dev server and should be excluded from the build process.
|
| 207 |
+
*
|
| 208 |
+
* @param plugins - Array of plugins (can include nested arrays)
|
| 209 |
+
* @returns Filtered array with serve-only plugins removed
|
| 210 |
+
*
|
| 211 |
+
* @example
|
| 212 |
+
* ```ts
|
| 213 |
+
* import { defineConfig } from 'rolldown';
|
| 214 |
+
* import { filterVitePlugins } from '@rolldown/pluginutils';
|
| 215 |
+
* import viteReact from '@vitejs/plugin-react';
|
| 216 |
+
*
|
| 217 |
+
* export default defineConfig({
|
| 218 |
+
* plugins: filterVitePlugins([
|
| 219 |
+
* viteReact(),
|
| 220 |
+
* {
|
| 221 |
+
* name: 'dev-only',
|
| 222 |
+
* apply: 'serve', // This will be filtered out
|
| 223 |
+
* // ...
|
| 224 |
+
* }
|
| 225 |
+
* ])
|
| 226 |
+
* });
|
| 227 |
+
* ```
|
| 228 |
+
*/
|
| 229 |
+
function filterVitePlugins(plugins) {
|
| 230 |
+
if (!plugins) return [];
|
| 231 |
+
const pluginArray = Array.isArray(plugins) ? plugins : [plugins];
|
| 232 |
+
const result = [];
|
| 233 |
+
for (const plugin of pluginArray) {
|
| 234 |
+
if (!plugin) continue;
|
| 235 |
+
if (Array.isArray(plugin)) {
|
| 236 |
+
result.push(...filterVitePlugins(plugin));
|
| 237 |
+
continue;
|
| 238 |
+
}
|
| 239 |
+
const pluginWithApply = plugin;
|
| 240 |
+
if ("apply" in pluginWithApply) {
|
| 241 |
+
const applyValue = pluginWithApply.apply;
|
| 242 |
+
if (typeof applyValue === "function") try {
|
| 243 |
+
if (applyValue({}, {
|
| 244 |
+
command: "build",
|
| 245 |
+
mode: "production"
|
| 246 |
+
})) result.push(plugin);
|
| 247 |
+
} catch {
|
| 248 |
+
result.push(plugin);
|
| 249 |
+
}
|
| 250 |
+
else if (applyValue === "serve") continue;
|
| 251 |
+
else result.push(plugin);
|
| 252 |
+
} else result.push(plugin);
|
| 253 |
+
}
|
| 254 |
+
return result;
|
| 255 |
+
}
|
| 256 |
+
/**
|
| 257 |
+
* Constructs a RegExp that matches the exact string specified.
|
| 258 |
+
*
|
| 259 |
+
* This is useful for plugin hook filters.
|
| 260 |
+
*
|
| 261 |
+
* @param str the string to match.
|
| 262 |
+
* @param flags flags for the RegExp.
|
| 263 |
+
*
|
| 264 |
+
* @example
|
| 265 |
+
* ```ts
|
| 266 |
+
* import { exactRegex } from '@rolldown/pluginutils';
|
| 267 |
+
* const plugin = {
|
| 268 |
+
* name: 'plugin',
|
| 269 |
+
* resolveId: {
|
| 270 |
+
* filter: { id: exactRegex('foo') },
|
| 271 |
+
* handler(id) {} // will only be called for `foo`
|
| 272 |
+
* }
|
| 273 |
+
* }
|
| 274 |
+
* ```
|
| 275 |
+
*/
|
| 276 |
+
function exactRegex(str, flags) {
|
| 277 |
+
return new RegExp(`^${escapeRegex(str)}$`, flags);
|
| 278 |
+
}
|
| 279 |
+
/**
|
| 280 |
+
* Constructs a RegExp that matches a value that has the specified prefix.
|
| 281 |
+
*
|
| 282 |
+
* This is useful for plugin hook filters.
|
| 283 |
+
*
|
| 284 |
+
* @param str the string to match.
|
| 285 |
+
* @param flags flags for the RegExp.
|
| 286 |
+
*
|
| 287 |
+
* @example
|
| 288 |
+
* ```ts
|
| 289 |
+
* import { prefixRegex } from '@rolldown/pluginutils';
|
| 290 |
+
* const plugin = {
|
| 291 |
+
* name: 'plugin',
|
| 292 |
+
* resolveId: {
|
| 293 |
+
* filter: { id: prefixRegex('foo') },
|
| 294 |
+
* handler(id) {} // will only be called for IDs starting with `foo`
|
| 295 |
+
* }
|
| 296 |
+
* }
|
| 297 |
+
* ```
|
| 298 |
+
*/
|
| 299 |
+
function prefixRegex(str, flags) {
|
| 300 |
+
return new RegExp(`^${escapeRegex(str)}`, flags);
|
| 301 |
+
}
|
| 302 |
+
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
|
| 303 |
+
function escapeRegex(str) {
|
| 304 |
+
return str.replace(escapeRegexRE, "\\$&");
|
| 305 |
+
}
|
| 306 |
+
function makeIdFiltersToMatchWithQuery(input) {
|
| 307 |
+
if (!Array.isArray(input)) return makeIdFilterToMatchWithQuery(input);
|
| 308 |
+
return input.map((i) => makeIdFilterToMatchWithQuery(i));
|
| 309 |
+
}
|
| 310 |
+
function makeIdFilterToMatchWithQuery(input) {
|
| 311 |
+
if (typeof input === "string") return `${input}{?*,}`;
|
| 312 |
+
return makeRegexIdFilterToMatchWithQuery(input);
|
| 313 |
+
}
|
| 314 |
+
function makeRegexIdFilterToMatchWithQuery(input) {
|
| 315 |
+
return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
|
| 316 |
+
}
|
| 317 |
+
//#endregion
|
| 318 |
+
//#region src/plugin/with-filter.ts
|
| 319 |
+
function withFilterImpl(pluginOption, filterObjectList) {
|
| 320 |
+
if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
|
| 321 |
+
if (pluginOption == false || pluginOption == null) return pluginOption;
|
| 322 |
+
if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
|
| 323 |
+
let plugin = pluginOption;
|
| 324 |
+
let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
|
| 325 |
+
if (filterObjectIndex === -1) return plugin;
|
| 326 |
+
let filterObject = filterObjectList[filterObjectIndex];
|
| 327 |
+
Object.keys(plugin).forEach((key) => {
|
| 328 |
+
switch (key) {
|
| 329 |
+
case "transform":
|
| 330 |
+
case "resolveId":
|
| 331 |
+
case "load":
|
| 332 |
+
if (!plugin[key]) return;
|
| 333 |
+
if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
|
| 334 |
+
else plugin[key] = {
|
| 335 |
+
handler: plugin[key],
|
| 336 |
+
filter: filterObject[key]
|
| 337 |
+
};
|
| 338 |
+
}
|
| 339 |
+
});
|
| 340 |
+
return plugin;
|
| 341 |
+
}
|
| 342 |
+
/**
|
| 343 |
+
* A helper function to add plugin hook filters to a plugin or an array of plugins.
|
| 344 |
+
*
|
| 345 |
+
* @example
|
| 346 |
+
* ```ts
|
| 347 |
+
* import yaml from '@rollup/plugin-yaml';
|
| 348 |
+
* import { defineConfig } from 'rolldown';
|
| 349 |
+
* import { withFilter } from 'rolldown/filter';
|
| 350 |
+
*
|
| 351 |
+
* export default defineConfig({
|
| 352 |
+
* plugins: [
|
| 353 |
+
* // Run the transform hook of the `yaml` plugin
|
| 354 |
+
* // only for modules which end in `.yaml`
|
| 355 |
+
* withFilter(
|
| 356 |
+
* yaml({}),
|
| 357 |
+
* { transform: { id: /\.yaml$/ } },
|
| 358 |
+
* ),
|
| 359 |
+
* ],
|
| 360 |
+
* });
|
| 361 |
+
* ```
|
| 362 |
+
*
|
| 363 |
+
* @category Config
|
| 364 |
+
*/
|
| 365 |
+
function withFilter(pluginOption, filterObject) {
|
| 366 |
+
return withFilterImpl(pluginOption, arraify(filterObject));
|
| 367 |
+
}
|
| 368 |
+
function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
|
| 369 |
+
if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
|
| 370 |
+
for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
|
| 371 |
+
let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
|
| 372 |
+
if (typeof pattern === "string" && pattern === pluginName) return i;
|
| 373 |
+
else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
|
| 374 |
+
}
|
| 375 |
+
return -1;
|
| 376 |
+
}
|
| 377 |
+
//#endregion
|
| 378 |
+
export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query, withFilter };
|
frontend/node_modules/rolldown/dist/get-log-filter.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { a as RolldownLog } from "./shared/logging-xuHO4mAy.mjs";
|
| 2 |
+
import { n as getLogFilter, t as GetLogFilter } from "./shared/get-log-filter-AjBknEEO.mjs";
|
| 3 |
+
export { GetLogFilter, type RolldownLog, type RolldownLog as RollupLog, getLogFilter as default };
|
frontend/node_modules/rolldown/dist/get-log-filter.mjs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/get-log-filter.ts
|
| 2 |
+
/**
|
| 3 |
+
* A helper function to generate log filters using the same syntax as the CLI.
|
| 4 |
+
*
|
| 5 |
+
* @example
|
| 6 |
+
* ```ts
|
| 7 |
+
* import { defineConfig } from 'rolldown';
|
| 8 |
+
* import { getLogFilter } from 'rolldown/getLogFilter';
|
| 9 |
+
*
|
| 10 |
+
* const logFilter = getLogFilter(['code:FOO', 'code:BAR']);
|
| 11 |
+
*
|
| 12 |
+
* export default defineConfig({
|
| 13 |
+
* input: 'main.js',
|
| 14 |
+
* onLog(level, log, handler) {
|
| 15 |
+
* if (logFilter(log)) {
|
| 16 |
+
* handler(level, log);
|
| 17 |
+
* }
|
| 18 |
+
* }
|
| 19 |
+
* });
|
| 20 |
+
* ```
|
| 21 |
+
*
|
| 22 |
+
* @category Config
|
| 23 |
+
*/
|
| 24 |
+
const getLogFilter = (filters) => {
|
| 25 |
+
if (filters.length === 0) return () => true;
|
| 26 |
+
const normalizedFilters = filters.map((filter) => filter.split("&").map((subFilter) => {
|
| 27 |
+
const inverted = subFilter.startsWith("!");
|
| 28 |
+
if (inverted) subFilter = subFilter.slice(1);
|
| 29 |
+
const [key, ...value] = subFilter.split(":");
|
| 30 |
+
return {
|
| 31 |
+
inverted,
|
| 32 |
+
key: key.split("."),
|
| 33 |
+
parts: value.join(":").split("*")
|
| 34 |
+
};
|
| 35 |
+
}));
|
| 36 |
+
return (log) => {
|
| 37 |
+
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
|
| 38 |
+
for (const { inverted, key, parts } of intersectedFilters) {
|
| 39 |
+
const isFilterSatisfied = testFilter(log, key, parts);
|
| 40 |
+
if (inverted ? isFilterSatisfied : !isFilterSatisfied) continue nextIntersectedFilter;
|
| 41 |
+
}
|
| 42 |
+
return true;
|
| 43 |
+
}
|
| 44 |
+
return false;
|
| 45 |
+
};
|
| 46 |
+
};
|
| 47 |
+
const testFilter = (log, key, parts) => {
|
| 48 |
+
let rawValue = log;
|
| 49 |
+
for (let index = 0; index < key.length; index++) {
|
| 50 |
+
if (!rawValue) return false;
|
| 51 |
+
const part = key[index];
|
| 52 |
+
if (!(part in rawValue)) return false;
|
| 53 |
+
rawValue = rawValue[part];
|
| 54 |
+
}
|
| 55 |
+
let value = typeof rawValue === "object" ? JSON.stringify(rawValue) : String(rawValue);
|
| 56 |
+
if (parts.length === 1) return value === parts[0];
|
| 57 |
+
if (!value.startsWith(parts[0])) return false;
|
| 58 |
+
const lastPartIndex = parts.length - 1;
|
| 59 |
+
for (let index = 1; index < lastPartIndex; index++) {
|
| 60 |
+
const part = parts[index];
|
| 61 |
+
const position = value.indexOf(part);
|
| 62 |
+
if (position === -1) return false;
|
| 63 |
+
value = value.slice(position + part.length);
|
| 64 |
+
}
|
| 65 |
+
return value.endsWith(parts[lastPartIndex]);
|
| 66 |
+
};
|
| 67 |
+
//#endregion
|
| 68 |
+
export { getLogFilter as default };
|
frontend/node_modules/rolldown/dist/index.d.mts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-xuHO4mAy.mjs";
|
| 2 |
+
import { B as PreRenderedChunk } from "./shared/binding-CVtkJvyl.mjs";
|
| 3 |
+
import { $t as ModuleInfo, A as ResolvedId, At as ChunkFileNamesFunction, B as ExistingRawSourceMap, Bt as ModuleFormat, C as ParallelPluginHooks, Ct as RolldownBuild, D as ResolveFileUrlArgs, Dt as AdvancedChunksGroup, E as PluginMeta, Et as AddonFunction, Ft as CommentsOptions, G as EmittedAsset, H as OutputBundle, Ht as PreRenderedAsset, It as GeneratedCodeOptions, J as EmittedPrebuiltChunk, Jt as RenderedChunk, K as EmittedChunk, Kt as OutputAsset, L as RUNTIME_MODULE_ID, Lt as GeneratedCodePreset, M as RolldownPluginOption, Mt as CodeSplittingGroup, N as SourceDescription, Nt as CodeSplittingNameFunction, O as ResolveIdExtraOptions, Ot as AdvancedChunksOptions, P as TransformResult, Pt as CodeSplittingOptions, Q as DefineParallelPluginResult, R as VERSION, Rt as GlobalsFunction, S as ObjectHook, St as rolldown, T as Plugin, Tt as build, U as TreeshakingOptions, V as SourceMapInput, Vt as OutputOptions, W as TransformPluginContext, Wt as PartialNull, X as PluginContext, Xt as RolldownOutput, Y as GetModuleInfo, Yt as RenderedModule, Z as PluginContextResolveOptions, Zt as SourceMap, _ as HookFilterExtension, _t as watch, a as ChunkOptimizationOptions, at as BufferEncoding, b as ModuleOptions, bt as RolldownWatcherWatcherEventMap, c as InputOption, ct as RolldownFsModule, d as OptimizationOptions, dt as NormalizedInputOptions, en as SourcemapIgnoreListOption, et as MinimalPluginContext, f as WatcherFileWatcherOptions, ft as TransformOptions, g as FunctionPluginHooks, gt as RolldownMagicString, h as CustomPluginOptions, ht as WarningHandlerWithDefault, i as RolldownOptions, it as ModuleTypeFilter, j as RolldownPlugin, jt as ChunkingContext, k as ResolveIdResult, kt as BuiltinModuleTag, l as InputOptions, lt as InternalModuleFormat, m as AsyncPluginHooks, mt as LoggingFunction, n as RolldownOptionsFunction, nt as GeneralHookFilter, o as ExternalOption, ot as RolldownDirectoryEntry, p as WatcherOptions, pt as ChecksOptions, q as EmittedFile, qt as OutputChunk, r as defineConfig, rt as HookFilter, s as ExternalOptionFunction, st as RolldownFileStats, t as ConfigExport, tt as PluginContextMeta, u as ModuleTypes, ut as NormalizedOutputOptions, v as ImportKind, vt as RolldownWatcher, w as PartialResolvedId, wt as BuildOptions, x as ModuleType, xt as WatchOptions, y as LoadResult, yt as RolldownWatcherEvent, z as BundleError, zt as MinifyOptions } from "./shared/define-config-DVsXPNaU.mjs";
|
| 4 |
+
export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PluginMeta, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveFileUrlArgs, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
|