This project helps you bootstrap a TypeScript-based WME script using the WME SDK.
It provides a clean project setup with build scripts, type checking, and release automation — so you can focus on writing your script!
You can use this project in two ways:
- 🟡 Option 1: using DevContainers (recommended) — no need to install anything globally
- 🟡 Option 2: manual local setup — install Node.js and Rollup yourself
Important: You MUST enable "Allow access to file URLs" for Tampermonkey, as explained here. Without this, Tampermonkey cannot load your local files during development.
If you are using Visual Studio Code and the DevContainers extension:
- Open this folder in VS Code
- When prompted, reopen in Dev Container (or run:
Dev Containers: Reopen in Container) - The container will automatically install all dependencies (
npm install) - You can now run:
npm run watchNo need to install Node.js, npm or Rollup globally — everything is handled inside the container.
If you prefer to run the project directly on your machine:
- Install npm and Node.js
- Allow local file access for the Tampermonkey extension, as explained here
- Install Rollup globally:
npm install --global rollup(This tool bundles your script for use in Tampermonkey.)
- (Optional) Install Git to manage file versions
- Download this repository (as a zip) or clone it via git:
git clone https://github.com/bedo2991/wme-typescript.git- Initialize your own git repo if needed:
git init- Update the details in:
header.jsandheader-dev.js→ update author, script name, etc.main.user.ts→ set your script ID and name
- Install dependencies:
npm install- Open the project in an IDE (e.g. VS Code)
- You will get type checking and autocomplete thanks to the WME SDK typings.
- The
.tsfile containing your script (main.user.ts) needs to be translated to javascript in order to be used by Tampermonkey. ⚠️ Warning: the content of the .out folder is generated, you should never edit anything in here.- During development, run:
npm run watchThis will continuously compile .ts to .js.
When ready to release:
npm run release- Update the version number in
package.json - Run:
npm run releaseA file will be created in the releases/ folder with the version in its name.
You can see all available scripts in package.json:
compile: compiles your script once — usually not needed manuallywatch: continuously compiles when code changes — use this when developingconcat: combines yourheader.jswith compiled.out/main.user.jsbuild: compile + concatrelease: updates version inheader.jsand builds release file
- Uninstall current typings:
npm uninstall wme-sdk-typings- Install desired version:
Production:
npm install --save-dev https://web-assets.waze.com/wme_sdk_docs/production/latest/wme-sdk-typings.tgzBeta:
npm install --save-dev https://web-assets.waze.com/wme_sdk_docs/beta/latest/wme-sdk-typings.tgzFull WME SDK typings documentation here.