Skip to content

Commit 68e7ccf

Browse files
committed
fix: review
1 parent 2843338 commit 68e7ccf

File tree

10 files changed

+22
-20
lines changed

10 files changed

+22
-20
lines changed

docs/tutorialkit.dev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@tutorialkit/react": "workspace:*",
15-
"@webcontainer/api": "1.5.0",
15+
"@webcontainer/api": "1.5.1",
1616
"classnames": "^2.5.1",
1717
"react": "^18.3.1",
1818
"react-dom": "^18.3.1"

docs/tutorialkit.dev/src/content/docs/reference/configuration.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ type TemplateType = "html" | "node" | "angular-cli" | "create-react-app" | "java
413413
```
414414

415415
### `downloadAsZip`
416-
Display a button for downloading the current lesson as `.zip` file.
416+
Display a button for downloading the current lesson as `.zip` file. Defaults to `false`.
417+
The default filename is constructed by concatenating folder names of part, chapter and lesson.
417418
<PropertyTable inherited type="DownloadAsZip" />
418419

419420
The `DownloadAsZip` type has the following shape:

packages/astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@tutorialkit/types": "workspace:*",
4646
"@types/react": "^18.3.3",
4747
"@unocss/reset": "^0.62.2",
48-
"@webcontainer/api": "1.5.0",
48+
"@webcontainer/api": "1.5.1",
4949
"astro": "^4.15.0",
5050
"astro-expressive-code": "^0.35.3",
5151
"chokidar": "3.6.0",

packages/astro/src/default/components/DownloadButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function onClick() {
2525
let filename =
2626
typeof lesson.data.downloadAsZip === 'object'
2727
? lesson.data.downloadAsZip.filename
28-
: `${lesson.part.id}-${lesson.chapter.id}-${lesson.id}.zip`;
28+
: [lesson.part?.id, lesson.chapter?.id, lesson.id].filter(Boolean).join('-');
2929

3030
if (!filename.endsWith('.zip')) {
3131
filename += '.zip';

packages/astro/src/default/utils/content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ async function parseCollection(collection: CollectionEntryTutorial[]) {
161161
tutorialMetaData.template ??= 'default';
162162
tutorialMetaData.i18n = Object.assign({ ...DEFAULT_LOCALIZATION }, tutorialMetaData.i18n);
163163
tutorialMetaData.openInStackBlitz ??= true;
164-
tutorialMetaData.downloadAsZip ??= true;
164+
tutorialMetaData.downloadAsZip ??= false;
165165

166166
tutorial.logoLink = data.logoLink;
167167
} else if (type === 'part') {

packages/cli/overwrites/src/content/tutorial/meta.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ type: tutorial
33
mainCommand: ['npm run dev', 'Starting http server']
44
prepareCommands:
55
- ['npm install', 'Installing dependencies']
6+
downloadAsZip: true
67
---

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"@replit/codemirror-lang-svelte": "^6.0.0",
8686
"@tutorialkit/runtime": "workspace:*",
8787
"@tutorialkit/theme": "workspace:*",
88-
"@webcontainer/api": "1.5.0",
88+
"@webcontainer/api": "1.5.1",
8989
"@xterm/addon-fit": "^0.10.0",
9090
"@xterm/addon-web-links": "^0.11.0",
9191
"@xterm/xterm": "^5.5.0",

packages/runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"dependencies": {
3636
"@tutorialkit/types": "workspace:*",
37-
"@webcontainer/api": "1.5.0",
37+
"@webcontainer/api": "1.5.1",
3838
"nanostores": "^0.10.3",
3939
"picomatch": "^4.0.2"
4040
},

packages/test-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"private": true,
77
"devDependencies": {
8-
"@webcontainer/api": "1.5.0",
8+
"@webcontainer/api": "1.5.1",
99
"typescript": "^5.4.5",
1010
"vitest": "^2.1.1"
1111
}

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)