Skip to content

Commit f3605e1

Browse files
Merge pull request #5 from cloudflare/fix/worker-build
fix(worker-build): fixed the worker build script, renamed samples to examples consistently
2 parents 7b7b164 + fe5e6e3 commit f3605e1

File tree

72 files changed

+217
-218
lines changed

Some content is hidden

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

72 files changed

+217
-218
lines changed

.github/ISSUE_TEMPLATE/new-ui-design-app-clone.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: New UI Design/App Clone
3-
about: Suggest an idea for this Sample App repo
3+
about: Suggest an idea for this Example App repo
44
title: ''
55
labels: ''
66
assignees: ''

.github/ISSUE_TEMPLATE/ui-update-to-existing-sample.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
name: UI Update to Existing Sample
3-
about: Suggest an idea for upgrading the current UI/UX of one of the current samples
2+
name: UI Update to Existing Example
3+
about: Suggest an idea for upgrading the current UI/UX of one of the current examples
44
title: ''
55
labels: hacktoberfest
66
assignees: ''
77

88
---
99

10-
**Is your UI update related to a current sample app? Please describe.**
10+
**Is your UI update related to a current example app? Please describe.**
1111
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1212

1313
**Describe the update/upgrade you'd like**

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ This project uses [pnpm](https://pnpm.io/) as a package manager. You can install
5959

6060
1. Clone the repository
6161
```sh
62-
git clone https://github.com/cloudflare/realtimekit-web-samples.git
62+
git clone https://github.com/cloudflare/realtimekit-web-examples.git
6363
```
6464

6565
2. Navigate to the project directory
6666
```sh
67-
cd realtimekit-web-samples
67+
cd realtimekit-web-examples
6868
```
6969

7070
3. Install dependencies from the root of the monorepo
7171
```sh
7272
pnpm install
7373
```
7474

75-
<!-- RUNNING THE SAMPLES -->
75+
<!-- RUNNING THE EXAMPLES -->
7676
## Running the Examples
7777

7878
Each example is a self-contained application. To run a specific example:

angular-examples/examples/create-your-own-ui/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Create Your Own UI
22

3-
This sample showcases how to create your own UI using Cloudflare RealtimeKit's Angular UI Kit and other packages.
3+
This example showcases how to create your own UI using Cloudflare RealtimeKit's Angular UI Kit and other packages.
44

55
## How to run?
66

@@ -12,7 +12,7 @@ To learn more, refer to [the source code](./src/app/app.component.ts)
1212

1313
## Architecture
1414

15-
This Angular sample is equivalent to the Cloudflare RealtimeKit `create-your-own-ui` sample and includes:
15+
This Angular example is equivalent to the Cloudflare RealtimeKit `create-your-own-ui` example and includes:
1616

1717
### Components
1818
- **CustomRtkMeetingComponent**: Main meeting component that handles different meeting states

angular-examples/examples/default-meeting-ui/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Default Meeting UI Sample
1+
# Default Meeting UI Example
22

3-
This sample showcases the simplest way to integrate Cloudflare RealtimeKit's UI Kit in your app!
3+
This example showcases the simplest way to integrate Cloudflare RealtimeKit's UI Kit in your app!
44

55
---
66

angular-examples/examples/with-video-transformer/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# With Background Transformer UI Sample
1+
# With Background Transformer UI Example
22

3-
This sample showcases how you can modify your background while in a Cloudflare RealtimeKit video call
3+
This example showcases how you can modify your background while in a Cloudflare RealtimeKit video call
44
with the [`@cloudflare/realtimekit-ui-add-ons`](https://www.npmjs.com/package/@cloudflare/realtimekit-ui-addons) package.
55

66
---

angular-examples/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>Angular Samples - Cloudflare RealtimeKit</title>
6+
<title>Angular Examples - Cloudflare RealtimeKit</title>
77
<style>
88
body {
99
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
@@ -76,11 +76,11 @@
7676
</head>
7777
<body>
7878
<div id="root">
79-
<h1>Cloudflare RealtimeKit Angular Samples</h1>
79+
<h1>Cloudflare RealtimeKit Angular Examples</h1>
8080
<ul>
81-
<li><a href="/samples/create-your-own-ui/dist">Create Your Own UI</a></li>
82-
<li><a href="/samples/default-meeting-ui/dist">Default Meeting UI</a></li>
83-
<li><a href="/samples/with-video-transformer/dist">With Video Transformer</a></li>
81+
<li><a href="/examples/create-your-own-ui/dist">Create Your Own UI</a></li>
82+
<li><a href="/examples/default-meeting-ui/dist">Default Meeting UI</a></li>
83+
<li><a href="/examples/with-video-transformer/dist">With Video Transformer</a></li>
8484
</ul>
8585
</div>
8686
</body>

angular-examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"workspaces": [
4-
"samples/*"
4+
"examples/*"
55
],
66
"scripts": {
77
"update-cloudflare-realtime-deps": "./update-cloudflare-realtime-deps.sh",

angular-examples/postbuild.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Exit immediately if a command exits with a non-zero status.
44
set -e
55

6-
# Define the root directory for output and source samples
6+
# Define the root directory for output and source examples
77
OUTPUT_DIR="dist"
8-
SAMPLES_DIR="samples"
8+
EXAMPLES_DIR="examples"
99

1010
echo "Starting postbuild script..."
1111

@@ -14,21 +14,21 @@ echo "Preparing output directory: $OUTPUT_DIR"
1414
rm -rf "$OUTPUT_DIR"
1515
mkdir -p "$OUTPUT_DIR"
1616

17-
# Loop through each directory in the samples directory
17+
# Loop through each directory in the examples directory
1818
# Using find to be more robust with names and ensure we only get directories
19-
find "$SAMPLES_DIR" -mindepth 1 -maxdepth 1 -type d | while read sample_dir_path; do
20-
sample_name=$(basename "$sample_dir_path")
21-
source_dist_path="$sample_dir_path/dist"
22-
destination_sample_path="$OUTPUT_DIR/$sample_name"
19+
find "$EXAMPLES_DIR" -mindepth 1 -maxdepth 1 -type d | while read example_dir_path; do
20+
example_name=$(basename "$example_dir_path")
21+
source_dist_path="$example_dir_path/dist"
22+
destination_example_path="$OUTPUT_DIR/$example_name"
2323

24-
# Check if the dist subdirectory exists within the sample directory
24+
# Check if the dist subdirectory exists within the example directory
2525
if [ -d "$source_dist_path" ]; then
26-
echo "Found $source_dist_path for sample: $sample_name"
27-
echo "Moving $source_dist_path to $destination_sample_path"
28-
# Move the samples/sample_name/dist directory to dist/sample_name
29-
cp -r "$source_dist_path" "$destination_sample_path"
26+
echo "Found $source_dist_path for example: $example_name"
27+
echo "Moving $source_dist_path to $destination_example_path"
28+
# Move the examples/example_name/dist directory to dist/example_name
29+
cp -r "$source_dist_path" "$destination_example_path"
3030
else
31-
echo "No dist directory found in $sample_dir_path (for sample $sample_name). Skipping."
31+
echo "No dist directory found in $example_dir_path (for example $example_name). Skipping."
3232
fi
3333
done
3434

@@ -41,9 +41,9 @@ if [ -f "$ROOT_INDEX_HTML_SOURCE" ]; then
4141
cp "$ROOT_INDEX_HTML_SOURCE" "$ROOT_INDEX_HTML_DEST"
4242

4343
echo "Updating links in $ROOT_INDEX_HTML_DEST"
44-
# Modify links from href="/samples/sample-name/dist" to href="/sample-name/"
44+
# Modify links from href="/examples/example-name/dist" to href="/example-name/"
4545
# Using a temporary file for sed in-place editing for compatibility (e.g. macOS sed)
46-
sed -i.bak 's|href="/samples/\([^/"]*\)/dist"|href="/\1/"|g' "$ROOT_INDEX_HTML_DEST"
46+
sed -i.bak 's|href="/examples/\([^/"]*\)/dist"|href="/\1/"|g' "$ROOT_INDEX_HTML_DEST"
4747
rm -f "${ROOT_INDEX_HTML_DEST}.bak" # Remove backup file created by sed -i
4848
echo "Links updated in $ROOT_INDEX_HTML_DEST"
4949
else

angular-examples/update-cloudflare-realtime-deps.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Script to install dependencies and update RealtimeKit packages in all samples
3+
# Script to install dependencies and update RealtimeKit packages in all examples
44
# Exits on first error to prevent cascading failures
55

66
set -e # Exit on any error
@@ -37,7 +37,7 @@ fi
3737

3838
# Get script directory
3939
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
40-
SAMPLES_DIR="$SCRIPT_DIR/samples"
40+
EXAMPLES_DIR="$SCRIPT_DIR/examples"
4141

4242
# Get latest package versions
4343
print_info "Fetching latest package versions..."
@@ -58,26 +58,26 @@ rm -rf node_modules package-lock.json
5858
print_info "Nuking NPM Cache due to trust issues..."
5959
npm cache clean --force
6060

61-
print_info "Installing dependencies in all sample repositories..."
61+
print_info "Installing dependencies in all example repositories..."
6262

63-
# Process each sample directory
64-
for sample_dir in "$SAMPLES_DIR"/*; do
65-
if [ -d "$sample_dir" ] && [ -f "$sample_dir/package.json" ]; then
66-
sample_name=$(basename "$sample_dir")
63+
# Process each example directory
64+
for example_dir in "$EXAMPLES_DIR"/*; do
65+
if [ -d "$example_dir" ] && [ -f "$example_dir/package.json" ]; then
66+
example_name=$(basename "$example_dir")
6767
echo ""
68-
print_info "=== Processing $sample_name ==="
68+
print_info "=== Processing $example_name ==="
6969

70-
cd "$sample_dir" || {
71-
print_error "Failed to enter directory $sample_dir"
70+
cd "$example_dir" || {
71+
print_error "Failed to enter directory $example_dir"
7272
exit 1
7373
}
7474

7575
# Clean install - remove node_modules
76-
print_info "Cleaning node_modules in $sample_name..."
76+
print_info "Cleaning node_modules in $example_name..."
7777
rm -rf node_modules
7878

7979
# Ensure all required RealtimeKit packages are present in package.json
80-
print_info "Ensuring all RealtimeKit packages are present in $sample_name..."
80+
print_info "Ensuring all RealtimeKit packages are present in $example_name..."
8181

8282
# Function to add package if not present
8383
add_package_if_missing() {
@@ -96,7 +96,7 @@ for sample_dir in "$SAMPLES_DIR"/*; do
9696
add_package_if_missing "@cloudflare/realtimekit-ui-addons" "$REALTIMEKIT_UI_ADDONS_VERSION"
9797

9898
# Update package.json versions
99-
print_info "Updating package.json versions in $sample_name..."
99+
print_info "Updating package.json versions in $example_name..."
100100

101101
# Update RealtimeKit packages in package.json
102102
if grep -q "@cloudflare/realtimekit\"" package.json; then
@@ -120,16 +120,16 @@ for sample_dir in "$SAMPLES_DIR"/*; do
120120
fi
121121

122122
# Single npm install after updating all versions
123-
print_info "Installing all dependencies in $sample_name..."
123+
print_info "Installing all dependencies in $example_name..."
124124
if ! npm install --legacy-peer-deps --no-workspaces; then
125-
print_error "Failed to install dependencies in $sample_name"
125+
print_error "Failed to install dependencies in $example_name"
126126
exit 1
127127
fi
128128

129129
cd - > /dev/null
130-
print_success "✓ Completed $sample_name"
130+
print_success "✓ Completed $example_name"
131131
fi
132132
done
133133

134134
echo ""
135-
print_success "🎉 All samples processed successfully!"
135+
print_success "🎉 All examples processed successfully!"

0 commit comments

Comments
 (0)