Skip to content
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7b3221f
Add "Hacker-Typer" Typing Mode for Fast Demo Coding (#2)
Copilot Jul 11, 2025
a85464a
Delete docs/hacker-typer-mode.md
bennycode Jul 11, 2025
10447b4
Delete examples/hacker-typer-demo.json
bennycode Jul 11, 2025
414c948
#204 open terminal
estruyf Jul 11, 2025
b0301d8
#release
estruyf Jul 11, 2025
965442d
#199 - Enhance slide readiness handling in preview components
estruyf Jul 11, 2025
bef3985
#release
estruyf Jul 11, 2025
bf3d2c1
#209 - The `path` property is not required anymore for the `unselect`…
estruyf Jul 12, 2025
96e0a81
[Feature] Make the message property for GitHub Copilot actions option…
estruyf Jul 12, 2025
354dbcc
#208 - Updated changelog
estruyf Jul 12, 2025
ffd6a31
#release
estruyf Jul 12, 2025
892ba3d
[Feature] Make the description on the demo file optional
estruyf Jul 13, 2025
d657ad7
[Bug] Ampersand Issue in dt-list
estruyf Jul 14, 2025
5afa3eb
#release
estruyf Jul 14, 2025
d3b3b82
move demo time to nx
MaxKless Jul 14, 2025
dc3fa9c
move nx start-ci-run to after node setup
MaxKless Jul 14, 2025
8fc29f9
Merge pull request #213 from MaxKless/add-nx
estruyf Jul 15, 2025
73a65b4
regenerate package-lock.json
MaxKless Jul 15, 2025
bab7c37
disable nx agents for now
MaxKless Jul 15, 2025
eeea0cb
Merge pull request #214 from MaxKless/fix-package-lock
estruyf Jul 15, 2025
2e5e667
Update CHANGELOG and improve code documentation in DemoRunner class #…
estruyf Jul 24, 2025
349685c
Merge branch 'main' of github.com:estruyf/vscode-demo-time
estruyf Jul 25, 2025
d1cb9bb
[Feature] Create an API that returns all demo groups (files) and demos
estruyf Jul 26, 2025
787130e
#release
estruyf Jul 26, 2025
f9adffc
Merge branch 'main' of github.com:bennycode/vscode-demo-time into ben…
estruyf Jul 28, 2025
11833d0
Add Hacker Typer functionality with next chunk command and context key
estruyf Jul 28, 2025
b8364ae
Merge branch 'bennycode-main' into dev
estruyf Jul 28, 2025
9e9ec7d
Update CHANGELOG.md to include hacker-typer typing mode in actions
estruyf Jul 28, 2025
902b06e
#release
estruyf Jul 28, 2025
1f3c81e
Add Hacker Typer mode toggle functionality to DemoStatusBar and TextT…
estruyf Jul 28, 2025
5836c26
Fix command title casing for Hacker Typer next chunk in package.json …
estruyf Jul 29, 2025
37be7e7
Update release date for version 1.8.0 in CHANGELOG.md
estruyf Aug 2, 2025
f2a446a
1.8.0
estruyf Aug 2, 2025
4e917ee
Refactor DemoApi and TextTypingService to use optional chaining for s…
estruyf Aug 2, 2025
058fb1f
Refactor DemoApi and TextTypingService for improved code clarity and …
estruyf Aug 2, 2025
389a37f
Register TerminalService to manage terminal closures and improve reso…
estruyf Aug 2, 2025
d041158
Refactor TextTypingService to improve type clarity for crntHackerType…
estruyf Aug 2, 2025
f0cc4cd
Implement TerminalService disposal in deactivate function for resourc…
estruyf Aug 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copilot Instructions for vscode-demo-time

## Project Overview

- **Purpose:** Script, automate, and present coding demos and slides inside Visual Studio Code. Used
for live presentations, workshops, and technical walkthroughs.
- **Core Concept:** Demos are defined in `.demo/demo.json` or `.demo/demo.yaml` files. Each demo
contains steps (actions) that automate editor operations, code highlighting, slide presentation,
and more.
- **Major Components:**
- `src/services/`: Core logic for demo execution, file manipulation, slide parsing, and
integration with VS Code APIs.
- `src/panels/`: Webview panels for UI (e.g., slides, welcome, presenter view).
- `src/models/`: TypeScript types for demos, steps, actions, and configuration.
- `src/utils/`: Utility functions for file operations, patching, and action templates.
- `snippets/`: Reusable demo step templates (see `snippets/README.md`).

## Key Patterns & Conventions

- **Demo File Format:**
- JSON or YAML, with a schema at the top-level (`$schema`).
- `demos` is an array; each demo has `title`, `description`, `steps`, and optional `icons`.
- Steps use a defined set of actions (see `src/utils/getActionOptions.ts`).
- **Actions:**
- Each step's `action` field maps to a handler in `src/services/`.
- Common actions: `insert`, `highlight`, `openSlide`, `setTheme`, `snippet`, etc.
- Snippet actions reference files in `snippets/` and support argument substitution.
- **Initialization:**
- Run the "Initialize" command from the Demo Time view to scaffold `.demo/` and default demo
files.
- **Testing:**
- Unit tests use Jest (`npm test`).
- For extension/VS Code API tests, use `@vscode/test-cli` and Mocha (see README for details).
- **PowerPoint Integration:**
- Supported via dedicated add-in (see docs and `packages/powerpoint-addin/`).

## Developer Workflows

- **Build:** Standard Node.js/TypeScript build (`npm install`, `npm run build`).
- **Lint/Test:** `npm run lint` and `npm test`.
- **Extension Packaging:** Use VSCE or `npm run package` (if configured).
- **Debugging:** Launch the extension in a VS Code Extension Development Host.
- **Adding Actions:**
- Define new actions in `src/models/Action.ts` and add handling logic in `src/services/`.
- Update `src/utils/getActionOptions.ts` and `src/utils/getActionTemplate.ts` for UI integration.

## Integration & Data Flow

- **Demo execution** flows from the demo file → parsed by services → actions dispatched to VS
Code/editor APIs.
- **Panels** (webviews) communicate with the extension via message passing (see `WebViewMessages` in
`constants`).
- **Snippets** are loaded and parameterized at runtime for reusable demo logic.

## Examples

- See `README.md` for a full demo file example.
- See `snippets/README.md` for snippet usage and configuration.

---

For more, see [https://demotime.show](https://demotime.show) and the in-repo documentation. If you
add new actions or demo file features, update the schema and documentation accordingly.
35 changes: 35 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PR Checks

on:
push:
branches:
- main
pull_request:

permissions:
actions: read
contents: read

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
filter: tree:0
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- run: npm ci --legacy-peer-deps
- uses: nrwl/nx-set-shas@v4

# - run: npx nx start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"

- run: npx nx-cloud record -- npx nx format:check
- run: npx nx affected -t lint test
- run: npx nx fix-ci
if: always()
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ node_modules
*.vsix
.DS_STORE
coverage

.nx/cache
.nx/workspace-data
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Change Log

## [1.8.0] - 2025-08-02

- [#199](https://github.com/estruyf/vscode-demo-time/issues/199): Improve loading the slides when
switching between demo and slides
- [#204](https://github.com/estruyf/vscode-demo-time/issues/204): Added the `openTerminal` action to
open a the terminal
- [#205](https://github.com/estruyf/vscode-demo-time/issues/205): Added the `hacker-typer` typing mode to the `insert`, `replace`, and `patch` actions
- [#207](https://github.com/estruyf/vscode-demo-time/issues/207): Made the `message` property
optional for the GitHub Copilot chat actions
- [#208](https://github.com/estruyf/vscode-demo-time/issues/208): The JSON schema has been
refactored to have intellisense per action on which properties are required and optional
- [#209](https://github.com/estruyf/vscode-demo-time/issues/209): The `path` property is not
required anymore for the `unselect` action
- [#211](https://github.com/estruyf/vscode-demo-time/issues/211): Make the description property
optional on the demo root
- [#212](https://github.com/estruyf/vscode-demo-time/issues/212): Fix encoding issue with ampersands
in the `dt-list` component
- [#217](https://github.com/estruyf/vscode-demo-time/issues/217): Fix highlighting whole line when line number and
character positioning is used
- [#218](https://github.com/estruyf/vscode-demo-time/issues/218): Added a new `/api/demos` endpoint to
retrieve the list of demos in the workspace

## [1.7.1] - 2025-07-10

- [#202](https://github.com/estruyf/vscode-demo-time/issues/202): Fix an issue with the demo parsing
Expand Down
98 changes: 96 additions & 2 deletions assets/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,100 @@ <h4 class="font-semibold text-blue-900 mb-1">Tip</h4>
<div class="space-y-8">
<h2 class="text-2xl font-semibold text-slate-900 mb-6">API Endpoints</h2>

<!-- Demos Endpoint -->
<div class="bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<div class="p-6">
<div class="flex items-start justify-between mb-4">
<div class="flex items-center gap-3">
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800">
GET
</span>
<div>
<h3 class="text-xl font-semibold text-slate-900">List Demos</h3>
<p class="text-slate-600 mt-1">Returns all demo files, the next demo, and the currently executing demo file</p>
</div>
</div>
</div>
<!-- Endpoint Path -->
<div class="mb-6">
<div class="flex items-center gap-2 mb-2">
<svg class="w-4 h-4 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
</svg>
<span class="text-sm font-medium text-slate-700">Endpoint</span>
</div>
<div class="bg-slate-50 rounded-lg p-4 font-mono text-sm border border-slate-200">
<div class="flex items-center justify-between">
<span class="text-slate-800">/api/demos</span>
<button onclick="copyToClipboard('/api/demos', this)" class="flex items-center gap-1 px-2 py-1 text-xs bg-slate-700 hover:bg-slate-600 rounded transition-colors text-slate-300">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
</svg>
Copy
</button>
</div>
</div>
</div>
<!-- Response -->
<div class="mb-6">
<div class="flex items-center gap-2 mb-3">
<span class="text-sm font-medium text-slate-700">Response</span>
</div>
<div class="bg-slate-100 rounded-lg p-4 font-mono text-xs border border-slate-200 overflow-x-auto">
<pre>{
"demoFiles": [{
"filePath": "/absolute/path/to/demo.json",
"demos": [
{ "id": "demo1", "title": "Demo 1" },
{ "id": "demo2", "title": "Demo 2" }
]
}],
"nextDemo": { "id": "demo2", "title": "Demo 2" },
"currentDemoFile": {
"filePath": "/absolute/path/to/demo.json",
"demo": [
{ "id": "demo1", "title": "Demo 1" }
]
}
}</pre>
</div>
</div>
<div class="mb-6">
<div class="flex items-center gap-2 mb-3">
<span class="text-sm font-medium text-slate-700">Description</span>
</div>
<ul class="list-disc ml-6 text-sm text-slate-700">
<li><code>demoFiles</code>: Array of demo files, each with its file path and contained demos (id and title).</li>
<li><code>nextDemo</code>: The next demo to be executed (id and title), if available.</li>
<li><code>currentDemoFile</code>: The currently executing demo file, with its file path and demos.</li>
</ul>
</div>

<!-- Examples -->
<div>
<div class="flex items-center gap-2 mb-3">
<svg class="w-4 h-4 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path>
</svg>
<span class="text-sm font-medium text-slate-700">Usage Examples</span>
</div>
<div class="space-y-2">
<div class="bg-slate-900 rounded-lg p-4 font-mono text-sm">
<div class="flex items-center justify-between">
<span class="text-green-400">{{API_URL}}/api/demos</span>
<button onclick="copyToClipboard('/api/demos', this)" class="flex items-center gap-1 px-2 py-1 text-xs bg-slate-700 hover:bg-slate-600 rounded transition-colors text-slate-300">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
</svg>
Copy
</button>
</div>
</div>
</div>
</div>
</div>
</div>

<!-- Next Demo Endpoint -->
<div class="bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<div class="p-6">
Expand Down Expand Up @@ -299,7 +393,7 @@ <h3 class="text-xl font-semibold text-slate-900">Run Demo by ID</h3>
fallbackCopy(text, button);
}
}

function fallbackCopy(text, button) {
const textarea = document.createElement('textarea');
textarea.value = text;
Expand All @@ -316,7 +410,7 @@ <h3 class="text-xl font-semibold text-slate-900">Run Demo by ID</h3>
}
document.body.removeChild(textarea);
}

function showCopied(button) {
const originalContent = button.innerHTML;
button.innerHTML = `
Expand Down
58 changes: 58 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"compile:ext": {
"outputs": ["{projectRoot}/out/extension"],
"cache": true
},
"compile:wc": {
"outputs": ["{projectRoot}/out/webcomponents"],
"cache": true
},
"compile:wv": {
"outputs": ["{projectRoot}/out/presenter"],
"cache": true
},
"compile:preview": {
"outputs": ["{projectRoot}/out/preview"],
"cache": true
},
"compile:copy": {
"outputs": ["{projectRoot}/assets/styles/themes"],
"cache": true
},
"vscode:prepublish": {
"cache": true
},
"compile": {
"cache": true
},
"lint": {
"cache": true
},
"test": {
"cache": true
}
},
"nxCloudId": "68753044874bdb115b711fe8",
"includedScripts": [
"vscode:prepublish",
"compile",
"compile:ext",
"compile:wc",
"compile:wv",
"compile:preview",
"compile:copy",
"lint",
"test",
"watch",
"watch:ext",
"watch:wc",
"watch:wv",
"watch:preview"
],
"namedInputs": {
"sharedGlobals": ["{workspaceRoot}/.github/workflows/pr-checks.yml"],
"default": ["sharedGlobals"]
}
}
Loading
Loading