Skip to content

Commit 64def8a

Browse files
committed
Update version to 0.0.4 in package files, enhance sidebar functionality with new commands, and add ZenML tutorial view. Adjust Dockerfile and .vscodeignore for new versioning. Improve logging for extension activation.
1 parent b18d433 commit 64def8a

File tree

13 files changed

+177
-21
lines changed

13 files changed

+177
-21
lines changed

.claude/settings.local.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"Bash(npm run compile:*)",
77
"Bash(npm run lint)",
88
"Bash(rm:*)",
9-
"Bash(npm run buildExtension:*)"
9+
"Bash(npm run buildExtension:*)",
10+
"Bash(find:*)",
11+
"mcp__ide__getDiagnostics",
12+
"Bash(code --version)"
1013
],
1114
"deny": []
1215
}

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"workbench.startupEditor": "none"
1111
},
1212
"extensions": [
13-
"zenml-io.zenml-codespace-tutorial"
13+
"zenml-io.zenml-tutorial"
1414
]
1515
}
1616
},

.github/workflows/build-extensions.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Build theme extension
4242
run: |
4343
echo "Building theme extension..."
44-
cd themes && npx @vscode/vsce package --out ./zenml-color-theme-0.0.3.vsix
44+
cd themes && npx @vscode/vsce package --out ./zenml-color-theme-0.0.4.vsix
4545
4646
- name: Verify extensions were builts
4747
run: |
@@ -54,11 +54,11 @@ jobs:
5454
exit 1
5555
fi
5656
57-
if [ -f "themes/zenml-color-theme-0.0.3.vsix" ]; then
57+
if [ -f "themes/zenml-color-theme-0.0.4.vsix" ]; then
5858
echo "Theme extension built successfully:"
59-
ls -la themes/zenml-color-theme-0.0.3.vsix
59+
ls -la themes/zenml-color-theme-0.0.4.vsix
6060
else
61-
echo "ERROR: zenml-color-theme-0.0.3.vsix not found"
61+
echo "ERROR: zenml-color-theme-0.0.4.vsix not found"
6262
exit 1
6363
fi
6464
@@ -72,7 +72,7 @@ jobs:
7272
uses: actions/upload-artifact@v4
7373
with:
7474
name: theme-extension
75-
path: themes/zenml-color-theme-0.0.3.vsix
75+
path: themes/zenml-color-theme-0.0.4.vsix
7676

7777
- name: Commit and push built extensions
7878
# Only commit on push to main/develop branches, not on PRs
@@ -83,7 +83,7 @@ jobs:
8383
8484
# Add the built extensions to git
8585
git add .devcontainer/extensions/zenml-tutorial-*.vsix
86-
git add themes/zenml-color-theme-0.0.3.vsix
86+
git add themes/zenml-color-theme-0.0.4.vsix
8787
8888
# Check if there are any changes to commit
8989
if git diff --staged --quiet; then

.vscodeignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ vsc-extension-quickstart.md
1010
**/*.ts
1111
**/.vscode-test.*
1212
pipelinesBackup/
13-
node_modules/
13+
node_modules/
14+
.mypy_cache/

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"url": "https://github.com/zenml-io/vscode-tutorial-extension"
77
},
88
"description": "Interactive ZenML pipeline tutorials",
9-
"version": "0.0.3",
9+
"version": "0.0.4",
1010
"publisher": "zenml-io",
1111
"engines": {
1212
"vscode": "^1.90.0"
@@ -36,7 +36,7 @@
3636
"pretest": "npm run compile && npm run lint",
3737
"lint": "eslint src --ext ts",
3838
"test": "vscode-test",
39-
"buildExtension": "vsce package && mkdir -p .devcontainer/extensions && rm -f .devcontainer/extensions/zenml-codespace-tutorial* && mv zenml-codespace-tutorial* .devcontainer/extensions"
39+
"buildExtension": "vsce package && mkdir -p .devcontainer/extensions && rm -f .devcontainer/extensions/zenml-tutorial* && mv zenml-tutorial* .devcontainer/extensions"
4040
},
4141
"devDependencies": {
4242
"@types/mocha": "^10.0.7",
@@ -59,9 +59,47 @@
5959
{
6060
"command": "zenml.startTutorial",
6161
"title": "Start ZenML Tutorial",
62-
"category": "ZenML"
62+
"category": "ZenML",
63+
"icon": "$(play)"
64+
},
65+
{
66+
"command": "zenml.openHomepage",
67+
"title": "Open ZenML Tutorial Homepage",
68+
"category": "ZenML",
69+
"icon": "$(home)"
6370
}
6471
],
72+
"menus": {
73+
"commandPalette": [
74+
{
75+
"command": "zenml.startTutorial",
76+
"when": "true"
77+
},
78+
{
79+
"command": "zenml.openHomepage",
80+
"when": "true"
81+
}
82+
]
83+
},
84+
"viewsContainers": {
85+
"activitybar": [
86+
{
87+
"id": "zenmlTutorial",
88+
"title": "ZenML Tutorial",
89+
"icon": "$(book)"
90+
}
91+
]
92+
},
93+
"views": {
94+
"zenmlTutorial": [
95+
{
96+
"id": "zenmlTutorialView",
97+
"name": "Tutorial",
98+
"when": "true"
99+
}
100+
]
101+
},
102+
65103
"configuration": {
66104
"title": "ZenML",
67105
"properties": {

project.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FROM zenmldocker/zenml-codespace:${ZENML_VERSION}
77
ARG PROJECT_DIR_NAME
88

99
# Set the working directory for the project
10-
WORKDIR /home/coder/extensions/zenml-io.zenml-tutorial-0.0.3/pipelines
10+
WORKDIR /home/coder/extensions/zenml-io.zenml-tutorial-0.0.4/pipelines
1111

1212
# Copy the specific project's requirements file
1313
COPY ./${PROJECT_DIR_NAME}/requirements.txt /tmp/requirements.txt

src/extension.ts

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,80 @@ import TutorialOrchestrator from "./tutorialOrchestrator";
77
import createPipelineBackup from "./utils/createPipelineBackup";
88
import getExtensionUri from "./utils/getExtensionUri";
99
import setDirectory from "./utils/setExtensionDirectory";
10+
import { ZenmlSidebarProvider } from "./zenmlSidebarProvider";
1011

1112
export async function activate(context: vscode.ExtensionContext) {
13+
console.log("ZenML Tutorial extension is being activated");
14+
1215
try {
1316
const extensionUri = getExtensionUri(context);
17+
console.log("Extension URI:", extensionUri.toString());
18+
1419
// Only set the directory if running in devcontainer
1520
if (vscode.env.remoteName) {
1621
setDirectory(extensionUri);
22+
console.log("Set directory for remote environment");
1723
}
1824

1925
createPipelineBackup(extensionUri);
26+
console.log("Created pipeline backup");
2027

2128
const tutorial = new Tutorial(tutorialMetadata, context);
2229
const orchestrator = new TutorialOrchestrator(context, tutorial);
30+
console.log("Created tutorial and orchestrator instances");
31+
32+
// Register sidebar provider
33+
const sidebarProvider = new ZenmlSidebarProvider(orchestrator);
34+
const treeView = vscode.window.createTreeView('zenmlTutorialView', {
35+
treeDataProvider: sidebarProvider
36+
});
37+
context.subscriptions.push(treeView);
38+
console.log("Registered sidebar provider");
2339

2440
// Register command to start tutorial
2541
const startCommand = vscode.commands.registerCommand("zenml.startTutorial", () => {
42+
console.log("zenml.startTutorial command triggered");
43+
vscode.window.showInformationMessage("Starting ZenML Tutorial...");
2644
orchestrator.start();
2745
});
2846

29-
context.subscriptions.push(startCommand);
47+
// Register command to open homepage (welcome screen)
48+
const homepageCommand = vscode.commands.registerCommand("zenml.openHomepage", () => {
49+
console.log("zenml.openHomepage command triggered");
50+
vscode.window.showInformationMessage("Opening ZenML Homepage...");
51+
orchestrator.openSection(0); // Open welcome screen
52+
});
53+
54+
context.subscriptions.push(startCommand, homepageCommand);
55+
console.log("Registered commands:", ["zenml.startTutorial", "zenml.openHomepage"]);
56+
57+
// Check if this is the first time the extension is being activated
58+
const isFirstTime = !context.globalState.get<boolean>("zenml.hasBeenActivated", false);
59+
const isCodespace = process.env.CODESPACES === "true";
60+
const isTutorialEnabled = process.env.ZENML_ENABLE_TUTORIAL === "true";
3061

31-
// Auto-start the tutorial
32-
orchestrator.start();
62+
console.log("Environment check:", {
63+
isFirstTime,
64+
isCodespace,
65+
isTutorialEnabled
66+
});
67+
68+
// Auto-start the tutorial only on first installation or in codespaces
69+
if (isFirstTime || isCodespace || isTutorialEnabled) {
70+
console.log("Auto-starting tutorial");
71+
orchestrator.start();
72+
73+
// Mark as activated for future sessions
74+
if (isFirstTime) {
75+
await context.globalState.update("zenml.hasBeenActivated", true);
76+
console.log("Marked extension as activated");
77+
}
78+
} else {
79+
console.log("Not auto-starting tutorial");
80+
}
81+
console.log("ZenML Tutorial extension activation completed successfully");
3382
} catch (error) {
83+
console.error("ZenML Tutorial activation error:", error);
3484
vscode.window.showErrorMessage(`Failed to activate ZenML Tutorial: ${error}`);
3585
}
3686
}

src/tutorialOrchestrator.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ export default class TutorialOrchestrator {
316316
if (this._webviewPanel) {
317317
this._webviewPanel.title = title;
318318
this._webviewPanel.webview.html = this._generateHTML(docContent);
319+
// Ensure the webview is visible
320+
this._webviewPanel.reveal(vscode.ViewColumn.One);
319321
}
320322
}
321323

src/utils/getExtensionUri.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ export default function getExtensionUri(context: vscode.ExtensionContext) {
99
if (isTutorialEnabled) {
1010
// Use the codespace container extension path when tutorial is enabled
1111
return vscode.Uri.file(
12-
"/home/coder/extensions/zenml-io.zenml-tutorial-0.0.3"
12+
"/home/coder/extensions/zenml-io.zenml-tutorial-0.0.4"
1313
);
1414
} else {
1515
// Use the original logic for other environments
1616
return vscode.Uri.file(
1717
`/root/${
1818
isCodespace ? ".vscode-remote" : ".vscode-server"
19-
}/extensions/zenml-io.zenml-tutorial-0.0.3`
19+
}/extensions/zenml-io.zenml-tutorial-0.0.4`
2020
);
2121
}
2222
} else {

0 commit comments

Comments
 (0)