From 83295789408570ed6f73e0e0527627414d96cb66 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 04:44:46 +0000 Subject: [PATCH 1/2] Initial plan From cb39efec60b32370bc71590a35205aec54818f00 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 04:55:19 +0000 Subject: [PATCH 2/2] Add interactive playground runtime with live TypeScript execution - Create playground/playground-runtime.js: loads TypeScript compiler from CDN and tsb browser bundle, provides editable code blocks with Run/Reset buttons, captures console output for display - Rewrite playground/index-playground.html: convert static code examples to interactive playground blocks with live execution - Add playground/index.html: update Index card to mention Interactive Playground - Create docs/playground.md: document playground page requirements and architecture - Update biome.json: ignore playground JS files from linting Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/3b02a36b-9fe7-4b52-8dc5-311292fa9764 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com> --- biome.json | 2 +- docs/playground.md | 127 +++++++++ playground/index-playground.html | 429 +++++++++++++++++++++++++------ playground/index.html | 2 +- playground/playground-runtime.js | 239 +++++++++++++++++ 5 files changed, 714 insertions(+), 85 deletions(-) create mode 100644 docs/playground.md create mode 100644 playground/playground-runtime.js diff --git a/biome.json b/biome.json index c4eb66c3..f98946cc 100644 --- a/biome.json +++ b/biome.json @@ -7,7 +7,7 @@ }, "files": { "ignoreUnknown": false, - "ignore": ["dist/**", "node_modules/**", "*.d.ts"] + "ignore": ["dist/**", "node_modules/**", "*.d.ts", "playground/**/*.js"] }, "formatter": { "enabled": true, diff --git a/docs/playground.md b/docs/playground.md new file mode 100644 index 00000000..2fa3fed0 --- /dev/null +++ b/docs/playground.md @@ -0,0 +1,127 @@ +# Playground Pages — Design & Requirements + +Every feature in **tsb** ships with an interactive playground page hosted on +GitHub Pages. This document describes the required properties that every +playground page must satisfy. + +## Required Properties + +### 1. Executable Code Blocks + +Each code example on a playground page **must** be executable in the browser. +Users can edit the code, click **▶ Run** (or press **Ctrl+Enter**), and see +real output rendered below the editor. + +- Use ` +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+ +

Properties

-
+    

Inspect size, shape, uniqueness, and monotonicity of an index.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Label Look-up

-
+    

Find positions of labels, check membership, and test inclusion.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Set Operations

-
+    

Combine indexes with union, intersection, difference, and symmetric difference.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Sorting & Aggregation

-
+    

Sort labels and compute aggregates like min, max, and argsort.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Manipulation (immutable — always returns new Index)

-
+    

Append, insert, delete, drop, and rename — each returns a new Index.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Missing Values

-
+    

Detect, drop, and fill null values in an index.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

RangeIndex — Memory Efficient

-
+    

Stores only start/stop/step — values are computed on the fly.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+ + +
+

🧪 Try It Yourself

+

Write your own tsb code below. All exports from tsb are available: + Index, RangeIndex, Series, Dtype, and more.

+
+
+ TypeScript — Scratch Pad +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
-