TypeScript Palantir Compute Module demo that scrapes Milwaukee product data and returns structured tool metadata.
- Exposes compute-module functions for Milwaukee scraping workflows.
- Scrapes product title, description, specs, features, included items, and image URLs.
- Provides both structured JSON output and formatted text output.
- Includes a local smoke test script for a known MPN (
2880-20).
src/scrapers/MilwaukeeScraper.tsuses Playwright to load Milwaukee product pages and extract fields.src/index.tsregisters compute module handlers:addOne,scrapeMilwaukee,scrapeMilwaukeeFormatted.src/utils/formatProductData.tsrenders scraped records into a readable text block.
| Function | Input | Output | Notes |
|---|---|---|---|
addOne |
{ value: number } |
{ value: number } |
Basic sample handler. |
scrapeMilwaukee |
{ mpn: string } |
structured product object | Returns success: false with empty fields on scrape failure. |
scrapeMilwaukeeFormatted |
{ mpn: string } |
string |
Formatted product summary text. |
./startup.sh
source startup.sh
npm install
npm run build
npm startRun local smoke test:
npm test| Layer | Present | Tooling | Runs in CI |
|---|---|---|---|
| unit | no | none | no |
| integration | yes | npm test (ts-node src/test.ts) |
no |
| e2e api | no | none | no |
| e2e web | no | none | no |
No CI workflow is currently configured in this repository.
- Containerized runtime is provided via
Dockerfile. - Scraping depends on public Milwaukee product pages at
https://www.milwaukeetool.com/products/<mpn>.
MIT (LICENSE).