Skip to content

Commit 2f42a2d

Browse files
author
Abdulhakim Ajetunmobi
authored
Simplify packages (#17)
1 parent 9fa3a28 commit 2f42a2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+344
-9083
lines changed

.github/workflows/preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
env:
2626
ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }}
2727
run: |
28-
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "tutorials" | head -n 1)
28+
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "^tutorials/" | grep -v "^tutorials/00" | head -n 1)
2929
top_level_dir=$(echo "$first_file" | cut -d'/' -f1,2)
3030
echo "dir=$top_level_dir" >> "$GITHUB_OUTPUT"
3131
@@ -44,7 +44,7 @@ jobs:
4444
node-version: 22.4
4545

4646
- name: Install dependencies
47-
working-directory: ${{ steps.get-changed-folder.outputs.dir }}
47+
working-directory: ${{ github.workspace }}/tutorials
4848
run: |
4949
node -v
5050
npm -v

.github/workflows/workspace.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
env:
2525
ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }}
2626
run: |
27-
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "tutorials" | head -n 1)
27+
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "^tutorials/" | grep -v "^tutorials/00" | head -n 1)
2828
top_level_dir=$(echo "$first_file" | cut -d'/' -f1,2)
2929
echo "dir=$top_level_dir" >> "$GITHUB_OUTPUT"
3030
@@ -43,7 +43,7 @@ jobs:
4343
node-version: 22.4
4444

4545
- name: Install dependencies
46-
working-directory: ${{ steps.get-changed-folder.outputs.dir }}
46+
working-directory: ${{ github.workspace }}/tutorials
4747
run: |
4848
node -v
4949
npm -v

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
.DS_Store
66
*.drawio
77

8+
tutorials/**/vonage-toolbar/
9+
810
### Node ###
911
# Logs
1012
logs
Lines changed: 0 additions & 224 deletions
Original file line numberDiff line numberDiff line change
@@ -1,224 +0,0 @@
1-
declare module 'astro:content' {
2-
interface Render {
3-
'.mdoc': Promise<{
4-
Content(props: Record<string, any>): import('astro').MarkdownInstance<{}>['Content'];
5-
headings: import('astro').MarkdownHeading[];
6-
}>;
7-
}
8-
}
9-
10-
declare module 'astro:content' {
11-
interface Render {
12-
'.mdx': Promise<{
13-
Content: import('astro').MarkdownInstance<{}>['Content'];
14-
headings: import('astro').MarkdownHeading[];
15-
remarkPluginFrontmatter: Record<string, any>;
16-
components: import('astro').MDXInstance<{}>['components'];
17-
}>;
18-
}
19-
}
20-
21-
declare module 'astro:content' {
22-
interface RenderResult {
23-
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
24-
headings: import('astro').MarkdownHeading[];
25-
remarkPluginFrontmatter: Record<string, any>;
26-
}
27-
interface Render {
28-
'.md': Promise<RenderResult>;
29-
}
30-
31-
export interface RenderedContent {
32-
html: string;
33-
metadata?: {
34-
imagePaths: Array<string>;
35-
[key: string]: unknown;
36-
};
37-
}
38-
}
39-
40-
declare module 'astro:content' {
41-
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
42-
43-
export type CollectionKey = keyof AnyEntryMap;
44-
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
45-
46-
export type ContentCollectionKey = keyof ContentEntryMap;
47-
export type DataCollectionKey = keyof DataEntryMap;
48-
49-
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
50-
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
51-
ContentEntryMap[C]
52-
>['slug'];
53-
54-
/** @deprecated Use `getEntry` instead. */
55-
export function getEntryBySlug<
56-
C extends keyof ContentEntryMap,
57-
E extends ValidContentEntrySlug<C> | (string & {}),
58-
>(
59-
collection: C,
60-
// Note that this has to accept a regular string too, for SSR
61-
entrySlug: E,
62-
): E extends ValidContentEntrySlug<C>
63-
? Promise<CollectionEntry<C>>
64-
: Promise<CollectionEntry<C> | undefined>;
65-
66-
/** @deprecated Use `getEntry` instead. */
67-
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
68-
collection: C,
69-
entryId: E,
70-
): Promise<CollectionEntry<C>>;
71-
72-
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
73-
collection: C,
74-
filter?: (entry: CollectionEntry<C>) => entry is E,
75-
): Promise<E[]>;
76-
export function getCollection<C extends keyof AnyEntryMap>(
77-
collection: C,
78-
filter?: (entry: CollectionEntry<C>) => unknown,
79-
): Promise<CollectionEntry<C>[]>;
80-
81-
export function getEntry<
82-
C extends keyof ContentEntryMap,
83-
E extends ValidContentEntrySlug<C> | (string & {}),
84-
>(entry: {
85-
collection: C;
86-
slug: E;
87-
}): E extends ValidContentEntrySlug<C>
88-
? Promise<CollectionEntry<C>>
89-
: Promise<CollectionEntry<C> | undefined>;
90-
export function getEntry<
91-
C extends keyof DataEntryMap,
92-
E extends keyof DataEntryMap[C] | (string & {}),
93-
>(entry: {
94-
collection: C;
95-
id: E;
96-
}): E extends keyof DataEntryMap[C]
97-
? Promise<DataEntryMap[C][E]>
98-
: Promise<CollectionEntry<C> | undefined>;
99-
export function getEntry<
100-
C extends keyof ContentEntryMap,
101-
E extends ValidContentEntrySlug<C> | (string & {}),
102-
>(
103-
collection: C,
104-
slug: E,
105-
): E extends ValidContentEntrySlug<C>
106-
? Promise<CollectionEntry<C>>
107-
: Promise<CollectionEntry<C> | undefined>;
108-
export function getEntry<
109-
C extends keyof DataEntryMap,
110-
E extends keyof DataEntryMap[C] | (string & {}),
111-
>(
112-
collection: C,
113-
id: E,
114-
): E extends keyof DataEntryMap[C]
115-
? Promise<DataEntryMap[C][E]>
116-
: Promise<CollectionEntry<C> | undefined>;
117-
118-
/** Resolve an array of entry references from the same collection */
119-
export function getEntries<C extends keyof ContentEntryMap>(
120-
entries: {
121-
collection: C;
122-
slug: ValidContentEntrySlug<C>;
123-
}[],
124-
): Promise<CollectionEntry<C>[]>;
125-
export function getEntries<C extends keyof DataEntryMap>(
126-
entries: {
127-
collection: C;
128-
id: keyof DataEntryMap[C];
129-
}[],
130-
): Promise<CollectionEntry<C>[]>;
131-
132-
export function render<C extends keyof AnyEntryMap>(
133-
entry: AnyEntryMap[C][string],
134-
): Promise<RenderResult>;
135-
136-
export function reference<C extends keyof AnyEntryMap>(
137-
collection: C,
138-
): import('astro/zod').ZodEffects<
139-
import('astro/zod').ZodString,
140-
C extends keyof ContentEntryMap
141-
? {
142-
collection: C;
143-
slug: ValidContentEntrySlug<C>;
144-
}
145-
: {
146-
collection: C;
147-
id: keyof DataEntryMap[C];
148-
}
149-
>;
150-
// Allow generic `string` to avoid excessive type errors in the config
151-
// if `dev` is not running to update as you edit.
152-
// Invalid collection names will be caught at build time.
153-
export function reference<C extends string>(
154-
collection: C,
155-
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
156-
157-
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
158-
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
159-
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
160-
>;
161-
162-
type ContentEntryMap = {
163-
"docs": {
164-
"01-welcome.md": {
165-
id: "01-welcome.md";
166-
slug: "01-welcome";
167-
body: string;
168-
collection: "docs";
169-
data: InferEntrySchema<"docs">
170-
} & { render(): Render[".md"] };
171-
"02-install-server-sdk.md": {
172-
id: "02-install-server-sdk.md";
173-
slug: "02-install-server-sdk";
174-
body: string;
175-
collection: "docs";
176-
data: InferEntrySchema<"docs">
177-
} & { render(): Render[".md"] };
178-
"03-initialize-client.md": {
179-
id: "03-initialize-client.md";
180-
slug: "03-initialize-client";
181-
body: string;
182-
collection: "docs";
183-
data: InferEntrySchema<"docs">
184-
} & { render(): Render[".md"] };
185-
"04-send-sms-code.md": {
186-
id: "04-send-sms-code.md";
187-
slug: "04-send-sms-code";
188-
body: string;
189-
collection: "docs";
190-
data: InferEntrySchema<"docs">
191-
} & { render(): Render[".md"] };
192-
"05-run-code.md": {
193-
id: "05-run-code.md";
194-
slug: "05-run-code";
195-
body: string;
196-
collection: "docs";
197-
data: InferEntrySchema<"docs">
198-
} & { render(): Render[".md"] };
199-
"06-whats-next.md": {
200-
id: "06-whats-next.md";
201-
slug: "06-whats-next";
202-
body: string;
203-
collection: "docs";
204-
data: InferEntrySchema<"docs">
205-
} & { render(): Render[".md"] };
206-
"index.mdx": {
207-
id: "index.mdx";
208-
slug: "index";
209-
body: string;
210-
collection: "docs";
211-
data: InferEntrySchema<"docs">
212-
} & { render(): Render[".mdx"] };
213-
};
214-
215-
};
216-
217-
type DataEntryMap = {
218-
219-
};
220-
221-
type AnyEntryMap = ContentEntryMap & DataEntryMap;
222-
223-
export type ContentConfig = typeof import("../../src/content/config.js");
224-
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"_variables": {
3-
"lastUpdateCheck": 1732190170983
3+
"lastUpdateCheck": 1736170580536
44
}
55
}

tutorials/00_Starter-Tutorial/astro.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ export default defineConfig({
1717
}),
1818
markdoc({ allowHTML: true })
1919
],
20+
vite: {
21+
server: {
22+
fs: {
23+
strict: false
24+
}
25+
}
26+
}
2027
});

tutorials/00_Starter-Tutorial/package.json

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,7 @@
33
"type": "module",
44
"version": "1.0.0",
55
"scripts": {
6-
"astro": "astro",
7-
"dev": "astro dev",
8-
"build": "astro build",
9-
"postinstall": "node download-toolbar.js"
10-
},
11-
"dependencies": {
12-
"@astrojs/markdoc": "^0.11.5",
13-
"@astrojs/starlight": "^0.28.6",
14-
"@astrojs/starlight-markdoc": "^0.1.0",
15-
"astro": "^4.15.3",
16-
"astro-relative-links": "^0.4.0",
17-
"sharp": "^0.32.5",
18-
"adm-zip": "^0.5.16"
6+
"dev": "node ../download-toolbar.js && astro dev",
7+
"build": "astro build"
198
}
209
}
File renamed without changes.

0 commit comments

Comments
 (0)