demo refresh
This commit is contained in:
parent
20a52fe655
commit
e996b02688
@ -202,8 +202,8 @@
|
||||
<Cell><Data ss:Type="String">C</Data></Cell>
|
||||
<Cell ss:StyleID="s16"><Data ss:Type="String">✔</Data></Cell>
|
||||
<Cell ss:StyleID="s16"><Data ss:Type="String">✔</Data></Cell>
|
||||
<Cell ss:StyleID="s16"><Data ss:Type="String">✱</Data></Cell>
|
||||
<Cell ss:StyleID="s16"><Data ss:Type="String">✱</Data></Cell>
|
||||
<Cell ss:StyleID="s16"><Data ss:Type="String">✔</Data></Cell>
|
||||
<Cell ss:StyleID="s16"><Data ss:Type="String">✔</Data></Cell>
|
||||
<Cell ss:StyleID="s16"><Data ss:Type="String">✔</Data></Cell>
|
||||
<Cell ss:StyleID="s16"><Data ss:Type="String">✔</Data></Cell>
|
||||
</Row>
|
||||
|
||||
@ -33,52 +33,53 @@ SheetJS Loader to answer questions based on data from a XLS workbook.
|
||||
|
||||
This demo was tested in the following configurations:
|
||||
|
||||
| Platform | Architecture | Date |
|
||||
|:------------------------------------------------------------------|:-------------|:-----------|
|
||||
| NVIDIA RTX PRO 6000 (96 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `win11-x64` | 2025-11-15 |
|
||||
| NVIDIA RTX PRO 6000 (96 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | 2025-11-15 |
|
||||
| NVIDIA RTX 5090 (32 GB VRAM) + Ryzen Z2 (32 GB RAM) | `win11-x64` | 2026-01-25 |
|
||||
| NVIDIA RTX 5090 (32 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | 2025-11-15 |
|
||||
| AMD AI PRO R9700 (32 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | 2026-01-17 |
|
||||
| AMD AI PRO R9700 (32 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `linux-x64` | 2026-01-17 |
|
||||
| AMD RX 9070 XT (16 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `win11-x64` | 2026-01-17 |
|
||||
| AMD RX 9070 XT (16 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | 2026-01-17 |
|
||||
| AMD RX 7900 XTX (24 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | 2025-11-15 |
|
||||
| AMD RX 7900 XTX (24 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `linux-x64` | 2025-11-15 |
|
||||
| Intel Arc B580 (12 GB VRAM) + Ryzen Z1 Extreme (24 GB RAM) | `win11-x64` | 2025-11-15 |
|
||||
| Intel Arc B580 (12 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `linux-x64` | 2025-11-15 |
|
||||
| AMD RYZEN AI MAX+ 395 + Radeon 8060S (128 GB unified memory) | `linux-x64` | 2025-11-15 |
|
||||
| AMD RYZEN AI MAX+ 395 + Radeon 8060S (128 GB unified memory) | `win11-x64` | 2025-11-15 |
|
||||
| Apple M4 Max 16-Core CPU + 40-Core GPU (48 GB unified memory) | `darwin-arm` | 2025-11-15 |
|
||||
| Platform | Architecture | Backend | Date |
|
||||
|:---------------------------------------------------------------------|:-------------|:------------|:-----------|
|
||||
| NVIDIA RTX PRO 6000 (96 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `win11-x64` | Ollama | 2025-11-15 |
|
||||
| NVIDIA RTX PRO 6000 (96 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | Ollama | 2025-11-15 |
|
||||
| NVIDIA RTX 5090 (32 GB VRAM) + Ryzen AI Z2 Extreme (24 GB RAM) | `win11-x64` | `llama.cpp` | 2026-05-05 |
|
||||
| NVIDIA RTX 5090 (32 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | Ollama | 2025-11-15 |
|
||||
| AMD AI PRO R9700 (32 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | Ollama | 2026-01-17 |
|
||||
| AMD AI PRO R9700 (32 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `linux-x64` | Ollama | 2026-01-17 |
|
||||
| AMD RX 9070 XT (16 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `win11-x64` | Ollama | 2026-01-17 |
|
||||
| AMD RX 9070 XT (16 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | Ollama | 2026-01-17 |
|
||||
| AMD RX 7900 XTX (24 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | Ollama | 2025-11-15 |
|
||||
| AMD RX 7900 XTX (24 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `linux-x64` | Ollama | 2025-11-15 |
|
||||
| Intel Arc B580 (12 GB VRAM) + Ryzen Z1 Extreme (24 GB RAM) | `win11-x64` | Ollama | 2025-11-15 |
|
||||
| Intel Arc B580 (12 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `linux-x64` | Ollama | 2025-11-15 |
|
||||
| AMD RYZEN AI MAX+ 395 + Radeon 8060S (128 GB unified memory) | `linux-x64` | Ollama | 2025-11-15 |
|
||||
| AMD RYZEN AI MAX+ 395 + Radeon 8060S (128 GB unified memory) | `win11-x64` | Ollama | 2025-11-15 |
|
||||
| Apple M4 Max 16-Core CPU + 40-Core GPU (48 GB unified memory) | `darwin-arm` | Ollama | 2025-11-15 |
|
||||
|
||||
SheetJS users have verified this demo in other configurations:
|
||||
|
||||
<details>
|
||||
<summary><b>Other tested configurations</b> (click to show)</summary>
|
||||
|
||||
| Platform | Architecture | Demo |
|
||||
| Platform | Architecture | Backend |
|
||||
|:---------------------------------------------------------------------|:-------------|:------------|
|
||||
| NVIDIA L40 (48 GB VRAM) + i9-13900K (32 GB RAM) | `linux-x64` | LangChainJS |
|
||||
| NVIDIA RTX 4090 (24 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| NVIDIA RTX 4090 (24 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | LangChainJS |
|
||||
| NVIDIA RTX 4080 SUPER (16 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| NVIDIA RTX 4080 SUPER (16 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | LangChainJS |
|
||||
| NVIDIA RTX 4070 Ti SUPER (16 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| NVIDIA RTX 4070 Ti (12 GB VRAM) + Ryzen 7 5800x (64 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| NVIDIA RTX 4060 (8 GB VRAM) + Ryzen 7 5700g (32 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| NVIDIA RTX 3090 (24 GB VRAM) + Ryzen 9 3900XT (128 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| NVIDIA RTX 3080 (12 GB VRAM) + Ryzen 7 5800X (32 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| NVIDIA RTX 3070 (8 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| NVIDIA RTX 3060 (12 GB VRAM) + i5-11400 (32 GB RAM) | `win10-x64` | LangChainJS |
|
||||
| NVIDIA RTX 2080 (12 GB VRAM) + i7-9700K (16 GB RAM) | `win10-x64` | LangChainJS |
|
||||
| NVIDIA RTX 2070 (8 GB VRAM) + Ryzen 7 3700x (80 GB RAM) | `linux-x64` | LangChainJS |
|
||||
| NVIDIA RTX 2060 (6 GB VRAM) + Ryzen 5 3600 (32 GB RAM) | `win10-x64` | LangChainJS |
|
||||
| NVIDIA GTX 1080 (8 GB VRAM) + Ryzen 7 5800x (64 GB RAM) | `win10-x64` | LangChainJS |
|
||||
| NVIDIA GTX 1070 (8 GB VRAM) + Ryzen 7 7700x (32 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| AMD RX 6800 XT (16 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | LangChainJS |
|
||||
| Apple M4 10-Core CPU + 10-Core GPU (24 GB unified memory) | `darwin-arm` | LangChainJS |
|
||||
| Apple M3 Ultra 28-Core CPU + 60-Core GPU (96 GB unified memory) | `darwin-arm` | LangChainJS |
|
||||
| Apple M2 Max 12-Core CPU + 30-Core GPU (32 GB unified memory) | `darwin-arm` | LangChainJS |
|
||||
| NVIDIA L40 (48 GB VRAM) + i9-13900K (32 GB RAM) | `linux-x64` | Ollama |
|
||||
| NVIDIA RTX 5090 (32 GB VRAM) + Ryzen AI Z2 Extreme (24 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 4090 (24 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 4090 (24 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | Ollama |
|
||||
| NVIDIA RTX 4080 SUPER (16 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 4080 SUPER (16 GB VRAM) + Ryzen Z2 Go (32 GB RAM) | `linux-x64` | Ollama |
|
||||
| NVIDIA RTX 4070 Ti SUPER (16 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 4070 Ti (12 GB VRAM) + Ryzen 7 5800x (64 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 4060 (8 GB VRAM) + Ryzen 7 5700g (32 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 3090 (24 GB VRAM) + Ryzen 9 3900XT (128 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 3080 (12 GB VRAM) + Ryzen 7 5800X (32 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 3070 (8 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | Ollama |
|
||||
| NVIDIA RTX 3060 (12 GB VRAM) + i5-11400 (32 GB RAM) | `win10-x64` | Ollama |
|
||||
| NVIDIA RTX 2080 (12 GB VRAM) + i7-9700K (16 GB RAM) | `win10-x64` | Ollama |
|
||||
| NVIDIA RTX 2070 (8 GB VRAM) + Ryzen 7 3700x (80 GB RAM) | `linux-x64` | Ollama |
|
||||
| NVIDIA RTX 2060 (6 GB VRAM) + Ryzen 5 3600 (32 GB RAM) | `win10-x64` | Ollama |
|
||||
| NVIDIA GTX 1080 (8 GB VRAM) + Ryzen 7 5800x (64 GB RAM) | `win10-x64` | Ollama |
|
||||
| NVIDIA GTX 1070 (8 GB VRAM) + Ryzen 7 7700x (32 GB RAM) | `win11-x64` | Ollama |
|
||||
| AMD RX 6800 XT (16 GB VRAM) + Ryzen Z1 Extreme (16 GB RAM) | `win11-x64` | Ollama |
|
||||
| Apple M4 10-Core CPU + 10-Core GPU (24 GB unified memory) | `darwin-arm` | Ollama |
|
||||
| Apple M3 Ultra 28-Core CPU + 60-Core GPU (96 GB unified memory) | `darwin-arm` | Ollama |
|
||||
| Apple M2 Max 12-Core CPU + 30-Core GPU (32 GB unified memory) | `darwin-arm` | Ollama |
|
||||
|
||||
</details>
|
||||
|
||||
@ -86,7 +87,6 @@ Special thanks to the following users for testing with multiple configurations:
|
||||
|
||||
- [Asadbek Karimov](https://asadk.dev/)
|
||||
- [Rasmus Tengstedt](https://tengstedt.dev/)
|
||||
- [Joban Dhillon](https://dhillon.dev/)
|
||||
|
||||
:::
|
||||
|
||||
@ -735,26 +735,42 @@ a [sample cars dataset](pathname:///cd.xls) and displays the results.
|
||||
|
||||
:::caution pass
|
||||
|
||||
This demo was tested using the Phi-4[^9] in Ollama.
|
||||
This demo was tested with the Phi-4[^9] open model, using up to 10GB VRAM.
|
||||
|
||||
The tested model used up to 10GB VRAM. It is strongly recommended to run the
|
||||
demo on a GPU with at least 12GB VRAM or a newer Apple Silicon Mac with at least
|
||||
32GB unified memory.
|
||||
It is strongly recommended to run the demo on a GPU with at least 12GB VRAM or a
|
||||
computer with at least 32GB memory.
|
||||
|
||||
:::
|
||||
|
||||
0) Install pre-requisites:
|
||||
0) Install prerequisites:
|
||||
|
||||
- [NodeJS LTS (version 20+)](https://nodejs.org/)
|
||||
- [Ollama](https://ollama.com/download)
|
||||
- [NodeJS LTS (version 24+)](https://nodejs.org/)
|
||||
- LLM Server
|
||||
|
||||
:::note pass
|
||||
:::info pass
|
||||
|
||||
Ollama should be installed on the same platform as NodeJS. If NodeJS is run
|
||||
within WSL, Ollama should also be installed within WSL.
|
||||
The LLM server should be installed on the same platform as NodeJS. If NodeJS is
|
||||
run within WSL, the LLM server should also be installed within WSL.
|
||||
|
||||
:::
|
||||
|
||||
:::note Recommendation
|
||||
|
||||
`llama.cpp` is strongly recommended for new deployments, as it supports exotic
|
||||
deployments. The learning curve has flattened in recent years.
|
||||
|
||||
Previous iterations of this demo used Ollama. It is easier to deploy Ollama in
|
||||
common scenarios including Apple Silicon Macs, but support for newer hardware
|
||||
and models typically lags `llama.cpp`.
|
||||
|
||||
:::
|
||||
|
||||
<Tabs groupId="llm">
|
||||
<TabItem value="ollama" label="Ollama">
|
||||
|
||||
Binary packages are available at https://ollama.com/download . They generally
|
||||
work for Apple Silicon Macs and for Windows and Linux machines with NVIDIA GPUs.
|
||||
|
||||
:::danger pass
|
||||
|
||||
Intel ARC GPUs require the Intel Extension for PyTorch (IPEX) and a special
|
||||
@ -896,6 +912,61 @@ separate terminal window.
|
||||
|
||||
:::
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="llama-cpp" label="llama.cpp">
|
||||
|
||||
[The "Quick Start" section](https://github.com/ggml-org/llama.cpp#quick-start)
|
||||
of the `llama.cpp` documentation recommends pre-built binaries.
|
||||
|
||||
Package managers typically include generic versions that support CPU inference
|
||||
and Vulkan. They do not typically support CUDA, ROCm/HIP, or SYCL. It is
|
||||
strongly recommended to manually download and run a specific release:
|
||||
|
||||
<details>
|
||||
<summary><b>NVIDIA Instructions on Windows</b> (click to show)</summary>
|
||||
|
||||
In a new PowerShell window, run `nvidia-smi` and look for "CUDA version". It
|
||||
will be in the first row of the table:
|
||||
|
||||
```text title="Sample output when last tested"
|
||||
+-----------------------------------------------------------------------------------------+
|
||||
| NVIDIA-SMI 596.36 Driver Version: 596.36 CUDA Version: 13.2 |
|
||||
+-----------------------------------------+------------------------+----------------------+
|
||||
```
|
||||
|
||||
In [the "Releases" section](https://github.com/ggml-org/llama.cpp/releases),
|
||||
download the "Windows x64 (CUDA)" and "CUDA DLLs" for the matching CUDA version.
|
||||
|
||||
For example, when this demo was last tested, `nvidia-smi` listed CUDA 13.2. This
|
||||
corresponds to the "Windows x64 (CUDA 13)" release and the "CUDA 13.1 DLLs":
|
||||
|
||||
```pwsh
|
||||
cd ~/Downloads
|
||||
mkdir llama
|
||||
cd llama
|
||||
curl.exe -LO https://github.com/ggml-org/llama.cpp/releases/download/b9012/llama-b9012-bin-win-cuda-13.1-x64.zip
|
||||
Expand-Archive llama-*.zip -DestinationPath "."
|
||||
curl.exe -LO https://github.com/ggml-org/llama.cpp/releases/download/b9033/cudart-llama-bin-win-cuda-13.1-x64.zip
|
||||
Expand-Archive cudart-*.zip -DestinationPath "."
|
||||
```
|
||||
|
||||
If `llama.cpp` can detect relevant GPUs, `./llama-cli.exe --list-devices` will
|
||||
list a CUDA device under "Available devices". The following output was captured
|
||||
on a machine with a RTX 5090:
|
||||
|
||||
```text title="Devices detected by llama.cpp"
|
||||
> ./llama-cli.exe --list-devices
|
||||
...
|
||||
Available devices:
|
||||
// highlight-next-line
|
||||
CUDA0: NVIDIA GeForce RTX 5090 (32606 MiB, 30994 MiB free)
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
After installing dependencies, start a new terminal session.
|
||||
|
||||
1) Create a new project:
|
||||
@ -942,7 +1013,7 @@ npm i --save https://sheet.lol/balls/xlsx-${current}.tgz`}
|
||||
4) Install dependencies:
|
||||
|
||||
```bash
|
||||
npm i --save @langchain/core@1.1.15 langchain@1.2.10 @langchain/classic@1.0.9 @langchain/ollama@1.2.0 peggy@5.0.6
|
||||
npm i --save @langchain/core@1.1.15 langchain@1.2.10 @langchain/classic@1.0.9 @langchain/ollama@1.2.0 @langchain/openai@1.2.0 peggy@5.0.6
|
||||
```
|
||||
|
||||
:::note pass
|
||||
@ -951,7 +1022,7 @@ In some test runs, there were error messages relating to dependency and peer
|
||||
dependency versions. The `--force` flag will suppress version mismatch errors:
|
||||
|
||||
```bash
|
||||
npm i --save @langchain/core@1.1.15 langchain@1.2.10 @langchain/classic@1.0.9 @langchain/ollama@1.2.0 peggy@5.0.6 --force
|
||||
npm i --save @langchain/core@1.1.15 langchain@1.2.10 @langchain/classic@1.0.9 @langchain/ollama@1.2.0 @langchain/openai@1.2.0 peggy@5.0.6 --force
|
||||
```
|
||||
|
||||
:::
|
||||
@ -978,7 +1049,10 @@ curl.exe -LO https://docs.sheetjs.com/cd.xls
|
||||
|
||||
:::
|
||||
|
||||
6) Install the `phi4:14b` model using Ollama:
|
||||
6) Install the `phi4:14b` model:
|
||||
|
||||
<Tabs groupId="llm">
|
||||
<TabItem value="ollama" label="Ollama">
|
||||
|
||||
```bash
|
||||
ollama pull phi4:14b
|
||||
@ -987,7 +1061,7 @@ ollama pull phi4:14b
|
||||
<details>
|
||||
<summary><b>Additional steps for Intel GPUs and AMD Strix Halo</b> (click to show)</summary>
|
||||
|
||||
A different embedding model must be used on Intel GPUs:
|
||||
A different embedding model must be used on Intel GPUs and AMD Strix Halo:
|
||||
|
||||
A) Install the `nomic-embed-text:latest` model through Ollama:
|
||||
|
||||
@ -1005,7 +1079,80 @@ const embeddings = new OllamaEmbeddings({ baseUrl: "http://127.0.0.1:11434", mod
|
||||
|
||||
</details>
|
||||
|
||||
7) Run the demo script
|
||||
7) Run the demo script:
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="llama-cpp" label="llama.cpp">
|
||||
|
||||
[The official `phi-4-gguf` repo](https://huggingface.co/microsoft/phi-4-gguf)
|
||||
includes `llama.cpp`-compatible weights. `Q4_K` weights should be downloaded to
|
||||
the same folder as the `llama.cpp` package.
|
||||
|
||||
[`nomic-embed-text`](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF)
|
||||
is the recommended embedding model. The `Q8_0` weights should be downloaded.
|
||||
|
||||
```bash
|
||||
cd ~/Downloads/llama
|
||||
curl -LO https://huggingface.co/microsoft/phi-4-gguf/resolve/main/phi-4-Q4_K.gguf
|
||||
curl -LO https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.Q8_0.gguf
|
||||
```
|
||||
|
||||
:::note pass
|
||||
|
||||
In PowerShell, the command may fail with a parameter error:
|
||||
|
||||
```
|
||||
Invoke-WebRequest : A parameter cannot be found that matches parameter name 'LO'.
|
||||
```
|
||||
|
||||
`curl.exe` must be invoked directly:
|
||||
|
||||
```pwsh
|
||||
cd ~/Downloads/llama
|
||||
curl.exe -LO https://huggingface.co/microsoft/phi-4-gguf/resolve/main/phi-4-Q4_K.gguf
|
||||
curl.exe -LO https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.Q8_0.gguf
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
7) Serve the generation model with `llama-server` in a separate window:
|
||||
|
||||
```bash title="Serve Phi4 (in a new window)"
|
||||
cd ~/Downloads/llama
|
||||
./llama-server -m ./phi-4-Q4_K.gguf -ngl 99 --host 0.0.0.0 --port 11434
|
||||
```
|
||||
|
||||
8) Serve the embedding model with `llama-server` in a new window:
|
||||
|
||||
```bash title="Serve nomic-embed-text (in a new window)"
|
||||
cd ~/Downloads/llama
|
||||
./llama-server -m ./nomic-embed-text-v1.5.Q8_0.gguf -ngl 99 --host 0.0.0.0 --port 11433 --embeddings
|
||||
```
|
||||
|
||||
8) Edit `query.mjs` to use the local OpenAI-compatible servers:
|
||||
|
||||
```js title="query.mjs (snippet, edit highlighted line)"
|
||||
// highlight-start
|
||||
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai";
|
||||
// highlight-end
|
||||
import { MemoryVectorStore } from "@langchain/classic/vectorstores/memory";
|
||||
|
||||
// ...
|
||||
|
||||
console.log(`Using model ${model}`);
|
||||
|
||||
// highlight-start
|
||||
const llm = new ChatOpenAI({ apiKey: "not-needed", configuration: { baseURL: "http://127.0.0.1:11434/v1" }, model });
|
||||
const embeddings = new OpenAIEmbeddings({ apiKey: "not-needed", configuration: { baseURL: "http://127.0.0.1:11433/v1" }, model: "nomic-embed-text:latest"});
|
||||
// highlight-end
|
||||
|
||||
// ...
|
||||
```
|
||||
|
||||
9) Run the demo script:
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
```bash
|
||||
node query.mjs
|
||||
|
||||
@ -40,7 +40,7 @@ This demo was tested in the following deployments:
|
||||
| `darwin-x64` | `5.0.0-beta.4` | `14.15.3` | Pre-built | 2026-01-21 |
|
||||
| `darwin-arm` | `5.0.0-beta.4` | `20.18.0` | Compiled | 2026-03-07 |
|
||||
| `win11-x64` | `5.0.0-beta.4` | `14.15.3` | Pre-built | 2026-03-08 |
|
||||
| `win11-arm` | `4.0.0-rc.6` | `22.14.0` | Compiled | 2025-02-23 |
|
||||
| `win11-arm` | `5.0.0-beta.4` | `22.14.0` | Compiled | 2026-05-05 |
|
||||
| `linux-x64` | `5.0.0-beta.4` | `14.15.3` | Pre-built | 2026-01-18 |
|
||||
| `linux-arm` | `5.0.0-beta.4` | `24.14.0` | Compiled | 2026-03-07 |
|
||||
|
||||
@ -144,6 +144,16 @@ npx -y nexe xlsx-cli.js --build --make="-j8" --target=windows-arm64-22.14.0 --ve
|
||||
|
||||
Common error messages:
|
||||
|
||||
_MSB4126_
|
||||
|
||||
```
|
||||
error MSB4126: The specified solution configuration "Release|x64" is invalid.
|
||||
```
|
||||
|
||||
`nexe` will not detect the correct platform from PowerShell. To ensure the build
|
||||
targets ARM64, run from "ARM64 Native Tools Command Prompt".
|
||||
|
||||
|
||||
_"Python was not found"_
|
||||
|
||||
```
|
||||
|
||||
@ -40,7 +40,7 @@ This demo was tested in the following deployments:
|
||||
| `darwin-x64` | `5.8.1` | `18.5.0` | 2026-01-21 |
|
||||
| `darwin-arm` | `5.8.1` | `18.5.0` | 2026-03-07 |
|
||||
| `win11-x64` | `5.8.1` | `18.5.0` | 2026-03-08 |
|
||||
| `win11-arm` | `5.8.1` | `18.5.0` | 2025-02-23 |
|
||||
| `win11-arm` | `5.8.1` | `18.5.0` | 2026-05-05 |
|
||||
| `linux-x64` | `5.8.1` | `18.5.0` | 2026-01-18 |
|
||||
| `linux-arm` | `5.8.1` | `18.5.0` | 2026-03-07 |
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ This demo was tested in the following deployments:
|
||||
| `darwin-x64` | `24.13.0` | 2026-01-21 |
|
||||
| `darwin-arm` | `20.18.0` | 2026-03-13 |
|
||||
| `win11-x64` | `24.13.0` | 2026-03-08 |
|
||||
| `win11-arm` | `22.14.0` | 2025-02-23 |
|
||||
| `win11-arm` | `22.14.0` | 2026-05-05 |
|
||||
| `linux-x64` | `24.11.0` | 2026-03-08 |
|
||||
| `linux-arm` | `24.14.0` | 2026-03-07 |
|
||||
|
||||
@ -289,7 +289,7 @@ codesign --remove-signature ./sheet2csv
|
||||
In PowerShell, the `Get-Command` command displays the location to `node.exe`:
|
||||
|
||||
```powershell
|
||||
PS C:\sheetjs-sea> get-command node
|
||||
PS C:\sheetjs-sea> Get-Command node
|
||||
|
||||
CommandType Name Version Source
|
||||
----------- ---- ------- ------
|
||||
@ -300,7 +300,7 @@ Application node.exe 20.12.0.0 C:
|
||||
Copy the program (listed in the "Source" column) to `sheet2csv.exe`:
|
||||
|
||||
```powershell
|
||||
copy "C:\Program Files\nodejs\node.exe" sheet2csv.exe
|
||||
copy "$((Get-Command node).Source)" sheet2csv.exe
|
||||
```
|
||||
|
||||
9) Remove the code signature.
|
||||
@ -433,6 +433,8 @@ If the Windows SDK is installed but the command fails, run the comand in the
|
||||
|
||||
:::
|
||||
|
||||
:::note pass
|
||||
|
||||
If the certificate is self-signed, there may be an error:
|
||||
|
||||
```
|
||||
@ -442,6 +444,8 @@ SignTool Error: A certificate chain processed, but terminated in a root
|
||||
|
||||
This error is expected.
|
||||
|
||||
:::
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="linux-x64" label="Linux">
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ This demo was last tested in the following deployments:
|
||||
| `darwin-x64` | `1.3.6` | 2026-01-21 |
|
||||
| `darwin-arm` | `1.3.10` | 2026-03-07 |
|
||||
| `win11-x64` | `1.3.10` | 2026-03-08 |
|
||||
| `win11-arm` | `1.2.3` | 2025-02-23 |
|
||||
| `win11-arm` | `1.3.11` | 2026-05-05 |
|
||||
| `linux-x64` | `1.3.10` | 2026-03-08 |
|
||||
| `linux-arm` | `1.3.10` | 2026-03-07 |
|
||||
|
||||
|
||||
@ -105,7 +105,7 @@ This demo was last tested in the following deployments:
|
||||
| `darwin-x64` | `2.6.5` | 2026-01-21 |
|
||||
| `darwin-arm` | `2.7.4` | 2026-03-07 |
|
||||
| `win11-x64` | `2.7.4` | 2026-03-08 |
|
||||
| `win11-arm` | `2.2.1` | 2025-02-23 |
|
||||
| `win11-arm` | `2.7.11` | 2026-05-05 |
|
||||
| `linux-x64` | `2.7.4` | 2026-03-08 |
|
||||
| `linux-arm` | `2.7.4` | 2026-03-07 |
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ This demo was tested in the following deployments:
|
||||
|
||||
| Lightning API | Date |
|
||||
|:--------------|:-----------|
|
||||
| `62.0` | 2025-05-27 |
|
||||
| `66.0` | 2026-05-05 |
|
||||
|
||||
:::
|
||||
|
||||
@ -43,7 +43,7 @@ The Salesforce developer tools embed telemetry. It can be disabled by setting
|
||||
the environment variable `SF_DISABLE_TELEMETRY` to `true` or running a command:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli config set disable-telemetry=true --global
|
||||
npx -y @salesforce/cli config set disable-telemetry=true --global
|
||||
```
|
||||
|
||||
:::
|
||||
@ -317,13 +317,13 @@ This demo was built on a "Developer Edition" account. At the time of writing, an
|
||||
2) Disable telemetry:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli config set disable-telemetry=true --global
|
||||
npx -y @salesforce/cli config set disable-telemetry=true --global
|
||||
```
|
||||
|
||||
3) Confirm the CLI tool works by checking version information:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli --version
|
||||
npx -y @salesforce/cli --version
|
||||
```
|
||||
|
||||
:::note pass
|
||||
@ -331,7 +331,7 @@ npx @salesforce/cli --version
|
||||
When the demo was last tested, the command printed
|
||||
|
||||
```
|
||||
@salesforce/cli/2.89.8 win32-x64 node-v24.1.0
|
||||
@salesforce/cli/2.129.8 darwin-arm64 node-v24.11.1
|
||||
```
|
||||
|
||||
:::
|
||||
@ -339,17 +339,39 @@ When the demo was last tested, the command printed
|
||||
4) Log into the org from the CLI tool:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli org login web
|
||||
npx -y @salesforce/cli org login web
|
||||
```
|
||||
|
||||
This will open a web browser. Sign in and authorize the application.
|
||||
|
||||
After authorizing the app, the terminal window will show a confirmation:
|
||||
|
||||
```
|
||||
Successfully authorized USERNAME with org ID ORGID
|
||||
```
|
||||
|
||||
:::note pass
|
||||
|
||||
The "Developer Edition" account username is not the same as the email used to
|
||||
register for the free account!
|
||||
|
||||
The correct username can be found in the email authorization flow:
|
||||
|
||||
1) Access the mail Salesforce gateway at https://login.salesforce.com/
|
||||
|
||||
2) Click "Log In with Email" and enter the original email address and password.
|
||||
|
||||
3) Wait for a verification email from `noreply@salesforce.com`. The correct
|
||||
username will be included in the message body.
|
||||
|
||||
:::
|
||||
|
||||
### Create Project
|
||||
|
||||
5) Create the "SheetForce" sample project with the `project generate` command:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli project generate -n SheetForce
|
||||
npx -y @salesforce/cli template generate project -n SheetForce
|
||||
```
|
||||
|
||||
Enter the project directory:
|
||||
@ -361,7 +383,7 @@ cd SheetForce
|
||||
6) Create a LWC component with the `lightning generate component` command:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli lightning generate component --type lwc -n sheetComponent -d force-app/main/default/lwc
|
||||
npx -y @salesforce/cli template generate lightning component --type lwc -n sheetComponent -d force-app/main/default/lwc
|
||||
```
|
||||
|
||||
7) Replace `force-app\main\default\lwc\sheetComponent\sheetComponent.html` with
|
||||
@ -380,7 +402,7 @@ with the following XML:
|
||||
```xml title="force-app\main\default\lwc\sheetComponent\sheetComponent.js-meta.xml (replace highlighted lines)"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>62.0</apiVersion>
|
||||
<apiVersion>66.0</apiVersion>
|
||||
<!-- highlight-start -->
|
||||
<isExposed>true</isExposed>
|
||||
<masterLabel>SheetForce</masterLabel>
|
||||
@ -398,7 +420,7 @@ with the following XML:
|
||||
Username. For example, if the Username was `SF@USER.NAME`, the command is:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
npx -y @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
```
|
||||
|
||||
10) Find the new component:
|
||||
@ -499,6 +521,18 @@ builder main view to add it to the page.
|
||||
|
||||
Click "Save".
|
||||
|
||||
:::note pass
|
||||
|
||||
In some test runs, there was a warning popup when "SheetForce" was selected.
|
||||
|
||||
> Select an insertion point for the component, either in an empty region, or
|
||||
> before or after another component.
|
||||
|
||||
Click "Add Component(s) Here" in the main panel. The button will be replaced
|
||||
with a blue bar. Click "SheetForce" once and it will be added to the page.
|
||||
|
||||
:::
|
||||
|
||||
13) Activate the page.
|
||||
|
||||
When the "Page Saved" modal is displayed, click "Activate".
|
||||
@ -567,7 +601,7 @@ mv xlsx.full.min.js force-app/main/default/staticresources/sheetjs.js
|
||||
18) Deploy the project again with the same command from step 9:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
npx -y @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
```
|
||||
|
||||
Replace `SF@USER.NAME` with the unique Username.
|
||||
@ -580,7 +614,8 @@ npx @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
A) In the Salesforce site, click on the gear icon in the top-right corner of the
|
||||
page and select "Setup" (Setup for current app).
|
||||
|
||||
B) Type "Static" in the left sidebar search box. Click "Static Resources"
|
||||
B) Type "Static" in the left sidebar search box. Click "Static Resources" in the
|
||||
"Custom Code" section.
|
||||
|
||||
:::caution pass
|
||||
|
||||
@ -643,7 +678,7 @@ This template references the `version` property.
|
||||
22) Deploy the project again with the same command from step 9:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
npx -y @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
```
|
||||
|
||||
Replace `SF@USER.NAME` with the unique Username.
|
||||
@ -714,7 +749,7 @@ export default class SheetComponent extends LightningElement {
|
||||
26) Deploy the project again with the same command from step 9:
|
||||
|
||||
```bash
|
||||
npx @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
npx -y @salesforce/cli project deploy start -d force-app -o SF@USER.NAME
|
||||
```
|
||||
|
||||
Replace `SF@USER.NAME` with the unique Username.
|
||||
|
||||
@ -40,7 +40,7 @@ This demo was tested in the following deployments:
|
||||
| OS and Version | Architecture | Excel | Date |
|
||||
|:---------------|:-------------|:-----------|:-----------|
|
||||
| macOS 15.3 | `darwin-x64` | 16.95.4 | 2025-04-17 |
|
||||
| macOS 14.5 | `darwin-arm` | 16.96.1 | 2025-04-24 |
|
||||
| macOS 14.5 | `darwin-arm` | 16.106.3 | 2026-05-05 |
|
||||
| Windows 11 | `win11-x64` | 365 (2506) | 2025-06-17 |
|
||||
| Windows 11 | `win11-arm` | 365 (2503) | 2025-04-24 |
|
||||
|
||||
@ -129,12 +129,24 @@ export async function extern(url) {
|
||||
|
||||
## Complete Demo
|
||||
|
||||
0) Clear the functions cache. For the tested version of Excel for Windows:
|
||||
0) Clear the functions cache.
|
||||
|
||||
For the tested version of Excel for Windows:
|
||||
|
||||
- Open File Explorer
|
||||
- Select the address bar and enter `%LOCALAPPDATA%\Microsoft\Office\16.0\Wef`
|
||||
- Delete the `CustomFunctions` folder (if it exists) and empty Recycle Bin.
|
||||
|
||||
For the tested version of Excel for Mac:
|
||||
|
||||
- Open the Terminal app
|
||||
- Run the following command to open the `Wef` folder:
|
||||
|
||||
```bash
|
||||
open ~/Library/Containers/com.microsoft.Excel/Data/Library/Application\ Support/Microsoft/Office/16.0/Wef
|
||||
```
|
||||
- Delete the `CustomFunctions` folder (if it exists) and empty Trash.
|
||||
|
||||
:::caution pass
|
||||
|
||||
**This will delete all custom functions associated with the user account!**
|
||||
@ -241,6 +253,19 @@ npm run stop
|
||||
npm start
|
||||
```
|
||||
|
||||
:::note pass
|
||||
|
||||
In some test runs, the stop command failed with an error:
|
||||
|
||||
```
|
||||
Debugging is being stopped...
|
||||
Unable to kill process id 69420: Error: kill ESRCH
|
||||
```
|
||||
|
||||
The error can be ignored.
|
||||
|
||||
:::
|
||||
|
||||
### Integrating the SheetJS Library
|
||||
|
||||
10) Install the SheetJS library in the project:
|
||||
@ -305,6 +330,42 @@ npm start
|
||||
|
||||
6) Click "Clear Web Cache" and wait a few moments.
|
||||
|
||||
---
|
||||
|
||||
If the previous steps fail, the `CustomFunctions` folders should be wiped:
|
||||
|
||||
7) Stop the development process:
|
||||
|
||||
```bash
|
||||
npm run stop
|
||||
```
|
||||
|
||||
8) Close the Excel app by right-clicking Excel in the Dock and selecting "Quit".
|
||||
|
||||
9) Stop the development process one more time:
|
||||
|
||||
```bash
|
||||
npm run stop
|
||||
```
|
||||
|
||||
10) Kill any errant `webpack` processes:
|
||||
|
||||
```bash
|
||||
pkill webpack
|
||||
```
|
||||
|
||||
11) Remove the `CustomFunctions` folder:
|
||||
|
||||
```bash
|
||||
rm -rf ~/Library/Containers/com.microsoft.Excel/Data/Library/Application\ Support/Microsoft/Office/16.0/Wef/CustomFunctions
|
||||
```
|
||||
|
||||
12) Restart the development process:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
### Fetching Files from the Internet
|
||||
|
||||
@ -165,7 +165,7 @@ This demo was tested in the following deployments:
|
||||
|:-------------|:--------|:-----------|
|
||||
| `darwin-x64` | `4.5.0` | 2026-01-21 |
|
||||
| `darwin-arm` | `4.6.3` | 2026-03-22 |
|
||||
| `win11-x64` | `4.2.2` | 2026-04-28 |
|
||||
| `win11-x64` | `4.6.3` | 2026-05-05 |
|
||||
| `win11-arm` | `4.6.3` | 2026-03-22 |
|
||||
| `linux-x64` | `4.2.2` | 2025-06-16 |
|
||||
| `linux-arm` | `4.5.0` | 2026-03-07 |
|
||||
|
||||
@ -324,27 +324,44 @@ This demo was tested in the following deployments:
|
||||
|:-------------|:--------|:-----------|
|
||||
| `darwin-x64` | `1.3.8` | 2026-01-20 |
|
||||
| `darwin-arm` | `1.3.8` | 2026-01-20 |
|
||||
| `win11-x64` | `1.3.8` | 2026-03-08 |
|
||||
| `win11-arm` | `1.3.5` | 2025-02-23 |
|
||||
| `win11-x64` | `1.3.8` | 2026-05-05 |
|
||||
| `win11-arm` | `1.3.8` | 2026-05-05 |
|
||||
| `linux-x64` | `1.3.8` | 2026-03-07 |
|
||||
| `linux-arm` | `1.3.8` | 2026-01-10 |
|
||||
|
||||
:::
|
||||
|
||||
:::caution pass
|
||||
0) Install development dependencies.
|
||||
|
||||
MuJS distributions do not include native Windows projects. The `win11-x64` and
|
||||
`win11-arm` tests were run entirely within Windows Subsystem for Linux.
|
||||
<Tabs groupId="os">
|
||||
<TabItem value="unix" label="Linux/MacOS">
|
||||
|
||||
When building in Debian Linux or WSL, `libreadline-dev` and `build-essential`
|
||||
must be installed:
|
||||
On Debian and Ubuntu, `libreadline-dev` and `build-essential` must be installed:
|
||||
|
||||
```bash
|
||||
sudo apt-get install libreadline-dev build-essential
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="win" label="Windows">
|
||||
|
||||
Visual Studio with "Desktop development with C++" workload must be installed.
|
||||
|
||||
:::info pass
|
||||
|
||||
**This demo must be run in PowerShell within a "Native Tools Command Prompt"!**
|
||||
|
||||
In Windows for ARM, after launching "ARM64 Native Tools Command Prompt", run
|
||||
`powershell` to enter a session with access to Visual Studio compiler tools.
|
||||
|
||||
In x64 Windows, after launching "x64 Native Tools Command Prompt for VS", run
|
||||
`powershell` to enter a session with access to Visual Studio compiler tools.
|
||||
|
||||
:::
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
1) Make a project directory:
|
||||
|
||||
```bash
|
||||
@ -354,6 +371,9 @@ cd sheetjs-mu
|
||||
|
||||
2) Build the MuJS shared library from source:
|
||||
|
||||
<Tabs groupId="os">
|
||||
<TabItem value="unix" label="Linux/MacOS">
|
||||
|
||||
```bash
|
||||
curl -LO https://mujs.com/downloads/mujs-1.3.8.zip
|
||||
unzip mujs-1.3.8.zip
|
||||
@ -362,24 +382,83 @@ make release
|
||||
cd ..
|
||||
```
|
||||
|
||||
3) Copy the `mujs.h` header file and `libmujs.a` library to the project folder:
|
||||
</TabItem>
|
||||
<TabItem value="win" label="Windows">
|
||||
|
||||
The `Makefile` in the MuJS distribution is not compatible with MSVC tools. The
|
||||
included `one.c` amalgamation can be compiled:
|
||||
|
||||
```powershell
|
||||
Invoke-WebRequest -Uri "https://mujs.com/downloads/mujs-1.3.8.zip" -OutFile "mujs-1.3.8.zip"
|
||||
Expand-Archive -Path "mujs-1.3.8.zip" -DestinationPath "." -Force
|
||||
cd mujs-1.3.8
|
||||
cl /O2 /W3 /I. /c one.c /Fo:mujs.obj
|
||||
lib /OUT:libmujs.lib mujs.obj
|
||||
cd ..
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
3) Copy the `mujs.h` header file and library to the project folder:
|
||||
|
||||
<Tabs groupId="os">
|
||||
<TabItem value="unix" label="Linux/MacOS">
|
||||
|
||||
```bash
|
||||
cp mujs-1.3.8/build/release/libmujs.a mujs-1.3.8/mujs.h .
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="win" label="Windows">
|
||||
|
||||
```powershell
|
||||
cd mujs-1.3.8
|
||||
Copy-Item libmujs.lib, mujs.h -Destination ..
|
||||
cd ..
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
4) Download [`SheetJSMu.c`](pathname:///mujs/SheetJSMu.c):
|
||||
|
||||
<Tabs groupId="os">
|
||||
<TabItem value="unix" label="Linux/MacOS">
|
||||
|
||||
```bash
|
||||
curl -LO https://docs.sheetjs.com/mujs/SheetJSMu.c
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="win" label="Windows">
|
||||
|
||||
```powershell
|
||||
Invoke-WebRequest -Uri "https://docs.sheetjs.com/mujs/SheetJSMu.c" -OutFile "SheetJSMu.c"
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
5) Build the application:
|
||||
|
||||
<Tabs groupId="os">
|
||||
<TabItem value="unix" label="Linux/MacOS">
|
||||
|
||||
```bash
|
||||
gcc -o SheetJSMu SheetJSMu.c -L. -lmujs -lm -lc -std=c89 -Wall
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="win" label="Windows">
|
||||
|
||||
```powershell
|
||||
cl /O2 /W3 /Fe:SheetJSMu.exe SheetJSMu.c libmujs.lib
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
6) Download the SheetJS Standalone script, shim script and test file. Move all
|
||||
three files to the project directory:
|
||||
|
||||
@ -389,12 +468,27 @@ three files to the project directory:
|
||||
<li><a href="https://docs.sheetjs.com/pres.xlsb">pres.xlsb</a></li>
|
||||
</ul>
|
||||
|
||||
<Tabs groupId="os">
|
||||
<TabItem value="unix" label="Linux/MacOS">
|
||||
|
||||
<CodeBlock language="bash">{`\
|
||||
curl -LO https://cdn.sheetjs.com/xlsx-${current}/package/dist/shim.min.js
|
||||
curl -LO https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js
|
||||
curl -LO https://docs.sheetjs.com/pres.xlsb`}
|
||||
</CodeBlock>
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="win" label="Windows">
|
||||
|
||||
```powershell
|
||||
Invoke-WebRequest -Uri "https://cdn.sheetjs.com/xlsx-latest/package/dist/shim.min.js" -OutFile "shim.min.js"
|
||||
Invoke-WebRequest -Uri "https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js" -OutFile "xlsx.full.min.js"
|
||||
Invoke-WebRequest -Uri "https://sheetjs.com/pres.xlsb" -OutFile "pres.xlsb"
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
7) Run the application:
|
||||
|
||||
```bash
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# https://docs.sheetjs.com/docs/demos/cli/nexe
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$oldDir = Get-Location
|
||||
$tempDir = Join-Path -Path $env:TEMP -ChildPath "sheetjs-nexe"
|
||||
if (Test-Path -Path $tempDir) { Remove-Item -Path $tempDir -Recurse -Force }
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# https://docs.sheetjs.com/docs/demos/cli/pkg
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$oldDir = Get-Location
|
||||
$tempDir = Join-Path -Path $env:TEMP -ChildPath "sheetjs-pkg"
|
||||
if (Test-Path -Path $tempDir) { Remove-Item -Path $tempDir -Recurse -Force }
|
||||
|
||||
76
tests/engines/mujs.ps1
Executable file
76
tests/engines/mujs.ps1
Executable file
@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# https://docs.sheetjs.com/docs/demos/engines/mujs
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ARCH = $env:PROCESSOR_ARCHITECTURE
|
||||
|
||||
switch ($ARCH) {
|
||||
"AMD64" { $batFile = "vcvars64.bat" }
|
||||
"ARM64" { $batFile = "vcvarsarm64.bat" }
|
||||
default { Write-Error "Unsupported architecture: $ARCH"; exit 1 }
|
||||
}
|
||||
|
||||
$oldDir = Get-Location
|
||||
$tempDir = Join-Path -Path $env:TEMP -ChildPath "sheetjs-mujs"
|
||||
if (Test-Path -Path $tempDir) { Remove-Item -Path $tempDir -Recurse -Force }
|
||||
New-Item -ItemType Directory -Path $tempDir | Out-Null
|
||||
Set-Location -Path $tempDir
|
||||
|
||||
# NOTE: This effectuates "Native Tools Command Prompt" for CMake/MSVC
|
||||
$vsVersions = @("2022", "2019", "18")
|
||||
$vsEditions = @("Community", "Professional", "Enterprise", "BuildTools")
|
||||
|
||||
foreach ($vsVersion in $vsVersions) {
|
||||
foreach ($vsEdition in $vsEditions) {
|
||||
$vcbasePath = "${env:ProgramFiles}\Microsoft Visual Studio\$vsVersion\$vsEdition"
|
||||
$vcvarsPath = Join-Path $vcbasePath "VC\Auxiliary\Build\$batFile"
|
||||
if (Test-Path -Path $vcvarsPath) { break }
|
||||
}
|
||||
if (Test-Path -Path $vcvarsPath) { break }
|
||||
}
|
||||
|
||||
Push-Location "$vcbasePath"
|
||||
cmd.exe /c "`"$vcvarsPath`" && set" | ForEach-Object { if ($_ -match '^([^=]+)=(.*)$') {
|
||||
$name = $matches[1]
|
||||
$value = $matches[2]
|
||||
|
||||
if ($name -ne 'PATH') {
|
||||
Set-Item -Path "Env:$name" -Value $value
|
||||
} else {
|
||||
$env:PATH = "$value;$env:PATH"
|
||||
}
|
||||
} }
|
||||
Pop-Location
|
||||
|
||||
# Download and extract MuJS
|
||||
Invoke-WebRequest -Uri "https://mujs.com/downloads/mujs-1.3.8.zip" -OutFile "mujs-1.3.8.zip"
|
||||
Expand-Archive -Path "mujs-1.3.8.zip" -DestinationPath "." -Force
|
||||
Remove-Item "mujs-1.3.8.zip"
|
||||
|
||||
# Build MuJS library
|
||||
Push-Location (Get-ChildItem -Directory -Filter "mujs-*" | Select-Object -First 1).FullName
|
||||
cl /O2 /W3 /I. /c one.c /Fo:mujs.obj
|
||||
lib /OUT:libmujs.lib mujs.obj
|
||||
Copy-Item libmujs.lib, mujs.h -Destination $tempDir
|
||||
Pop-Location
|
||||
|
||||
# Download SheetJSMu.c
|
||||
Invoke-WebRequest -Uri "https://docs.sheetjs.com/mujs/SheetJSMu.c" -OutFile "SheetJSMu.c"
|
||||
|
||||
# Build SheetJSMu application
|
||||
cl /O2 /W3 /Fe:SheetJSMu.exe SheetJSMu.c libmujs.lib
|
||||
|
||||
# Download SheetJS scripts and test file
|
||||
Invoke-WebRequest -Uri "https://cdn.sheetjs.com/xlsx-latest/package/dist/shim.min.js" -OutFile "shim.min.js"
|
||||
Invoke-WebRequest -Uri "https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js" -OutFile "xlsx.full.min.js"
|
||||
Invoke-WebRequest -Uri "https://sheetjs.com/pres.xlsb" -OutFile "pres.xlsb"
|
||||
|
||||
# Run the application
|
||||
.\SheetJSMu.exe pres.xlsb
|
||||
if ($LASTEXITCODE -ne 0) { throw "Execution failed" }
|
||||
|
||||
# Wait for process to fully exit and file handles to release
|
||||
Start-Sleep -Milliseconds 1000
|
||||
|
||||
Set-Location $oldDir
|
||||
Remove-Item -Path $tempDir -Recurse -Force
|
||||
Loading…
Reference in New Issue
Block a user