Skip to content

Commit a7eb31d

Browse files
authored
fix: support inheritance for editor/focus and fix bug with logo (stackblitz#67)
1 parent eb6cf09 commit a7eb31d

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

packages/astro/src/default/components/Header.astro

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ const LOGO_EXTENSIONS = [
1414
1515
let logo;
1616
17-
for (const logoFilename of LOGO_EXTENSIONS) {
18-
const exists = fs.existsSync(path.join('public', `logo.${logoFilename}`));
17+
for (const logoExt of LOGO_EXTENSIONS) {
18+
const logoFilename = `logo.${logoExt}`;
19+
const exists = fs.existsSync(path.join('public', logoFilename));
1920
2021
if (exists) {
2122
logo = `/${logoFilename}`;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export async function getTutorial(): Promise<Tutorial> {
116116
lesson.data = {
117117
...pick(
118118
[lesson.data, chapterMetadata, partMetadata, tutorialMetaData],
119-
['mainCommand', 'prepareCommands', 'previews', 'autoReload', 'template', 'terminal'],
119+
['mainCommand', 'prepareCommands', 'previews', 'autoReload', 'template', 'terminal', 'editor', 'focus'],
120120
),
121121
...lesson.data,
122122
};

packages/types/src/schemas/common.ts

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const webcontainerSchema = commandsSchema.extend({
114114
autoReload: z.boolean().optional(),
115115
template: z.string().optional(),
116116
terminal: terminalSchema.optional(),
117+
focus: z.string().optional(),
117118
editor: z.union([
118119
// can either be completely removed by setting it to `false`
119120
z.boolean().optional(),

packages/types/src/schemas/lesson.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { baseSchema } from './common.js';
33

44
export const lessonSchema = baseSchema.extend({
55
type: z.literal('lesson'),
6-
focus: z.string().optional(),
76
scope: z.string().optional(),
87
hideRoot: z.boolean().optional(),
98
});

0 commit comments

Comments
 (0)