Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
env:
ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }}
run: |
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "tutorials" | head -n 1)
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "^tutorials/" | grep -v "^tutorials/00" | head -n 1)
top_level_dir=$(echo "$first_file" | cut -d'/' -f1,2)
echo "dir=$top_level_dir" >> "$GITHUB_OUTPUT"

Expand All @@ -44,7 +44,7 @@ jobs:
node-version: 22.4

- name: Install dependencies
working-directory: ${{ steps.get-changed-folder.outputs.dir }}
working-directory: ${{ github.workspace }}/tutorials
run: |
node -v
npm -v
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
env:
ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }}
run: |
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "tutorials" | head -n 1)
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "^tutorials/" | grep -v "^tutorials/00" | head -n 1)
top_level_dir=$(echo "$first_file" | cut -d'/' -f1,2)
echo "dir=$top_level_dir" >> "$GITHUB_OUTPUT"

Expand All @@ -43,7 +43,7 @@ jobs:
node-version: 22.4

- name: Install dependencies
working-directory: ${{ steps.get-changed-folder.outputs.dir }}
working-directory: ${{ github.workspace }}/tutorials
run: |
node -v
npm -v
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.DS_Store
*.drawio

tutorials/**/vonage-toolbar/

### Node ###
# Logs
logs
Expand Down
224 changes: 0 additions & 224 deletions tutorials/00_Starter-Tutorial/.astro/astro/content.d.ts
Original file line number Diff line number Diff line change
@@ -1,224 +0,0 @@
declare module 'astro:content' {
interface Render {
'.mdoc': Promise<{
Content(props: Record<string, any>): import('astro').MarkdownInstance<{}>['Content'];
headings: import('astro').MarkdownHeading[];
}>;
}
}

declare module 'astro:content' {
interface Render {
'.mdx': Promise<{
Content: import('astro').MarkdownInstance<{}>['Content'];
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
components: import('astro').MDXInstance<{}>['components'];
}>;
}
}

declare module 'astro:content' {
interface RenderResult {
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}
interface Render {
'.md': Promise<RenderResult>;
}

export interface RenderedContent {
html: string;
metadata?: {
imagePaths: Array<string>;
[key: string]: unknown;
};
}
}

declare module 'astro:content' {
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;

export type CollectionKey = keyof AnyEntryMap;
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;

export type ContentCollectionKey = keyof ContentEntryMap;
export type DataCollectionKey = keyof DataEntryMap;

type AllValuesOf<T> = T extends any ? T[keyof T] : never;
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
ContentEntryMap[C]
>['slug'];

/** @deprecated Use `getEntry` instead. */
export function getEntryBySlug<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
entrySlug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;

/** @deprecated Use `getEntry` instead. */
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
collection: C,
entryId: E,
): Promise<CollectionEntry<C>>;

export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
collection: C,
filter?: (entry: CollectionEntry<C>) => entry is E,
): Promise<E[]>;
export function getCollection<C extends keyof AnyEntryMap>(
collection: C,
filter?: (entry: CollectionEntry<C>) => unknown,
): Promise<CollectionEntry<C>[]>;

export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(entry: {
collection: C;
slug: E;
}): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(entry: {
collection: C;
id: E;
}): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
slug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(
collection: C,
id: E,
): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;

/** Resolve an array of entry references from the same collection */
export function getEntries<C extends keyof ContentEntryMap>(
entries: {
collection: C;
slug: ValidContentEntrySlug<C>;
}[],
): Promise<CollectionEntry<C>[]>;
export function getEntries<C extends keyof DataEntryMap>(
entries: {
collection: C;
id: keyof DataEntryMap[C];
}[],
): Promise<CollectionEntry<C>[]>;

export function render<C extends keyof AnyEntryMap>(
entry: AnyEntryMap[C][string],
): Promise<RenderResult>;

export function reference<C extends keyof AnyEntryMap>(
collection: C,
): import('astro/zod').ZodEffects<
import('astro/zod').ZodString,
C extends keyof ContentEntryMap
? {
collection: C;
slug: ValidContentEntrySlug<C>;
}
: {
collection: C;
id: keyof DataEntryMap[C];
}
>;
// Allow generic `string` to avoid excessive type errors in the config
// if `dev` is not running to update as you edit.
// Invalid collection names will be caught at build time.
export function reference<C extends string>(
collection: C,
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;

type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
>;

type ContentEntryMap = {
"docs": {
"01-welcome.md": {
id: "01-welcome.md";
slug: "01-welcome";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"02-install-server-sdk.md": {
id: "02-install-server-sdk.md";
slug: "02-install-server-sdk";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"03-initialize-client.md": {
id: "03-initialize-client.md";
slug: "03-initialize-client";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"04-send-sms-code.md": {
id: "04-send-sms-code.md";
slug: "04-send-sms-code";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"05-run-code.md": {
id: "05-run-code.md";
slug: "05-run-code";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"06-whats-next.md": {
id: "06-whats-next.md";
slug: "06-whats-next";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"index.mdx": {
id: "index.mdx";
slug: "index";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".mdx"] };
};

};

type DataEntryMap = {

};

type AnyEntryMap = ContentEntryMap & DataEntryMap;

export type ContentConfig = typeof import("../../src/content/config.js");
}
2 changes: 1 addition & 1 deletion tutorials/00_Starter-Tutorial/.astro/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1732190170983
"lastUpdateCheck": 1736170580536
}
}
7 changes: 7 additions & 0 deletions tutorials/00_Starter-Tutorial/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ export default defineConfig({
}),
markdoc({ allowHTML: true })
],
vite: {
server: {
fs: {
strict: false
}
}
}
});
15 changes: 2 additions & 13 deletions tutorials/00_Starter-Tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@
"type": "module",
"version": "1.0.0",
"scripts": {
"astro": "astro",
"dev": "astro dev",
"build": "astro build",
"postinstall": "node download-toolbar.js"
},
"dependencies": {
"@astrojs/markdoc": "^0.11.5",
"@astrojs/starlight": "^0.28.6",
"@astrojs/starlight-markdoc": "^0.1.0",
"astro": "^4.15.3",
"astro-relative-links": "^0.4.0",
"sharp": "^0.32.5",
"adm-zip": "^0.5.16"
"dev": "node ../download-toolbar.js && astro dev",
"build": "astro build"
}
}
Loading
Loading