Skip to content

Repository files navigation

cs_script

TypeScript libraries and type definitions for scripting in Counter-Strike 2.

This repository is a pnpm workspace. Each package is published independently to npm under the @s2ze scope but shares a single fixed version across the workspace.

Packages

PackageDescription
@s2ze/typesValve-provided type definitions for CS2 scripting
@s2ze/mathMath utilities (vectors, matrices, etc.) for scripts.
@s2ze/schedulerScheduling helpers, setTimeout, setInterval.
@s2ze/debugDebugging helpers.
@s2ze/tsconfigShared TypeScript configuration consumed by the other packages.

Requirements

  • Node.js (LTS recommended)
  • pnpm11.2.2 (the version is pinned via the packageManager field — run corepack enable to have the correct version selected automatically)

Getting started

pnpm install # install all dependencies and link workspace packages
pnpm build # compile every package (runs `build` in each package)
pnpm test# run the test suites

Common root scripts (see package.json):

ScriptWhat it does
pnpm buildpnpm -r run build — builds every package.
pnpm testpnpm -r run test — tests every package.
pnpm lintRun ESLint across the workspace.
pnpm formateslint . --fix — autofix lint/formatting.

Development workflow

Each package compiles its TypeScript source in src/ down to JavaScript in a build/ directory:

When one package imports another (e.g. @s2ze/debug importing @s2ze/math), pnpm symlinks the dependency into node_modules, but Node/TypeScript resolve the import through that package's main/exports fields — which point at build/, not src/, editing packages/math/src/... does not change what @s2ze/debug sees until @s2ze/math is rebuilt and its build/ output is regenerated. The consumer reads the compiled artifact, so stale build/ output means stale behavior.

After changing a library package, you need to rebuild it for the changes to be reflected with pnpm build in the root.

License

MIT © Source2ZE

About

A monorepo of @s2ze packages

Resources

Stars

16 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages