Skip to content

Commit 89a95e4

Browse files
authored
Hello breadboard (#1)
* Add .gitignore file for Visual Studio Code, macOS, Linux, Node.js, Windows, and Yarn This commit adds a new .gitignore file with rules generated using the '.gitignore Generator' for Visual Studio Code. The rules include specific exclusions for macOS, Linux, Node.js, Windows, and Yarn. The file was created by the Toptal Gitignore API and can be edited at the provided URL. * Add Hello World It doesn't get much more minimal than this * Add hello-world workflow This commit adds a new GitHub Actions workflow file for the "Hello World" project. The workflow is triggered on push, pull request, and manual dispatch events. It runs on Ubuntu latest and includes a matrix strategy for different Node.js versions (19.x, 20.x, 21.x). The steps include checking out the repository, setting up Node.js with the specified version and caching npm dependencies, installing dependencies, making the index.ts file executable, and running it. * Removed shebang line * Refactor workflow to use npm run start instead of running index.ts directly. * Remove cache config hello-world workflow * Refactor package.json formatting and remove packageManager property * Add specific wiring for message input
1 parent 7f4fbc2 commit 89a95e4

File tree

5 files changed

+316
-0
lines changed

5 files changed

+316
-0
lines changed

.github/workflows/hello-world.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Hello World
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [19.x, 20.x, 21.x]
13+
defaults:
14+
run:
15+
working-directory: "samples/Hello World"
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- run: npm install
23+
- run: npm run start

.gitignore

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
2+
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,linux,node,windows,yarn
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,linux,node,windows,yarn
4+
5+
### Linux ###
6+
*~
7+
8+
# temporary files which can be created if a process still has a handle open of a deleted file
9+
.fuse_hidden*
10+
11+
# KDE directory preferences
12+
.directory
13+
14+
# Linux trash folder which might appear on any partition or disk
15+
.Trash-*
16+
17+
# .nfs files are created when an open file is removed but is still being accessed
18+
.nfs*
19+
20+
### macOS ###
21+
# General
22+
.DS_Store
23+
.AppleDouble
24+
.LSOverride
25+
26+
# Icon must end with two \r
27+
Icon
28+
29+
# Thumbnails
30+
._*
31+
32+
# Files that might appear in the root of a volume
33+
.DocumentRevisions-V100
34+
.fseventsd
35+
.Spotlight-V100
36+
.TemporaryItems
37+
.Trashes
38+
.VolumeIcon.icns
39+
.com.apple.timemachine.donotpresent
40+
41+
# Directories potentially created on remote AFP share
42+
.AppleDB
43+
.AppleDesktop
44+
Network Trash Folder
45+
Temporary Items
46+
.apdisk
47+
48+
### macOS Patch ###
49+
# iCloud generated files
50+
*.icloud
51+
52+
### Node ###
53+
# Logs
54+
logs
55+
*.log
56+
npm-debug.log*
57+
yarn-debug.log*
58+
yarn-error.log*
59+
lerna-debug.log*
60+
.pnpm-debug.log*
61+
62+
# Diagnostic reports (https://nodejs.org/api/report.html)
63+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
64+
65+
# Runtime data
66+
pids
67+
*.pid
68+
*.seed
69+
*.pid.lock
70+
71+
# Directory for instrumented libs generated by jscoverage/JSCover
72+
lib-cov
73+
74+
# Coverage directory used by tools like istanbul
75+
coverage
76+
*.lcov
77+
78+
# nyc test coverage
79+
.nyc_output
80+
81+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
82+
.grunt
83+
84+
# Bower dependency directory (https://bower.io/)
85+
bower_components
86+
87+
# node-waf configuration
88+
.lock-wscript
89+
90+
# Compiled binary addons (https://nodejs.org/api/addons.html)
91+
build/Release
92+
93+
# Dependency directories
94+
node_modules/
95+
jspm_packages/
96+
97+
# Snowpack dependency directory (https://snowpack.dev/)
98+
web_modules/
99+
100+
# TypeScript cache
101+
*.tsbuildinfo
102+
103+
# Optional npm cache directory
104+
.npm
105+
106+
# Optional eslint cache
107+
.eslintcache
108+
109+
# Optional stylelint cache
110+
.stylelintcache
111+
112+
# Microbundle cache
113+
.rpt2_cache/
114+
.rts2_cache_cjs/
115+
.rts2_cache_es/
116+
.rts2_cache_umd/
117+
118+
# Optional REPL history
119+
.node_repl_history
120+
121+
# Output of 'npm pack'
122+
*.tgz
123+
124+
# Yarn Integrity file
125+
.yarn-integrity
126+
127+
# dotenv environment variable files
128+
.env
129+
.env.development.local
130+
.env.test.local
131+
.env.production.local
132+
.env.local
133+
134+
# parcel-bundler cache (https://parceljs.org/)
135+
.cache
136+
.parcel-cache
137+
138+
# Next.js build output
139+
.next
140+
out
141+
142+
# Nuxt.js build / generate output
143+
.nuxt
144+
dist
145+
146+
# Gatsby files
147+
.cache/
148+
# Comment in the public line in if your project uses Gatsby and not Next.js
149+
# https://nextjs.org/blog/next-9-1#public-directory-support
150+
# public
151+
152+
# vuepress build output
153+
.vuepress/dist
154+
155+
# vuepress v2.x temp and cache directory
156+
.temp
157+
158+
# Docusaurus cache and generated files
159+
.docusaurus
160+
161+
# Serverless directories
162+
.serverless/
163+
164+
# FuseBox cache
165+
.fusebox/
166+
167+
# DynamoDB Local files
168+
.dynamodb/
169+
170+
# TernJS port file
171+
.tern-port
172+
173+
# Stores VSCode versions used for testing VSCode extensions
174+
.vscode-test
175+
176+
# yarn v2
177+
.yarn/cache
178+
.yarn/unplugged
179+
.yarn/build-state.yml
180+
.yarn/install-state.gz
181+
.pnp.*
182+
183+
### Node Patch ###
184+
# Serverless Webpack directories
185+
.webpack/
186+
187+
# Optional stylelint cache
188+
189+
# SvelteKit build / generate output
190+
.svelte-kit
191+
192+
### VisualStudioCode ###
193+
.vscode/*
194+
!.vscode/settings.json
195+
!.vscode/tasks.json
196+
!.vscode/launch.json
197+
!.vscode/extensions.json
198+
!.vscode/*.code-snippets
199+
200+
# Local History for Visual Studio Code
201+
.history/
202+
203+
# Built Visual Studio Code Extensions
204+
*.vsix
205+
206+
### VisualStudioCode Patch ###
207+
# Ignore all local history of files
208+
.history
209+
.ionide
210+
211+
### Windows ###
212+
# Windows thumbnail cache files
213+
Thumbs.db
214+
Thumbs.db:encryptable
215+
ehthumbs.db
216+
ehthumbs_vista.db
217+
218+
# Dump file
219+
*.stackdump
220+
221+
# Folder config file
222+
[Dd]esktop.ini
223+
224+
# Recycle Bin used on file shares
225+
$RECYCLE.BIN/
226+
227+
# Windows Installer files
228+
*.cab
229+
*.msi
230+
*.msix
231+
*.msm
232+
*.msp
233+
234+
# Windows shortcuts
235+
*.lnk
236+
237+
### yarn ###
238+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
239+
240+
.yarn/*
241+
!.yarn/releases
242+
!.yarn/patches
243+
!.yarn/plugins
244+
!.yarn/sdks
245+
!.yarn/versions
246+
247+
# if you are NOT using Zero-installs, then:
248+
# comment the following lines
249+
!.yarn/cache
250+
251+
# and uncomment the following lines
252+
# .pnp.*
253+
254+
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,linux,node,windows,yarn
255+
256+
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

samples/Hello World/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Board } from "@google-labs/breadboard";
2+
3+
const board = new Board();
4+
5+
board.input().wire("message", board.output());
6+
7+
(async () => {
8+
console.log(
9+
await board.runOnce({
10+
message: "Hello Breadboard!",
11+
})
12+
);
13+
})();

samples/Hello World/package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"dependencies": {
3+
"@google-labs/breadboard": "^0.5.0"
4+
},
5+
"devDependencies": {
6+
"@types/node": "^20.9.1",
7+
"typescript": "^5.2.2"
8+
},
9+
"engines": {
10+
"node": ">=19"
11+
},
12+
"engineStrict": true,
13+
"name": "hello-breadboard",
14+
"scripts": {
15+
"start": "npx -y tsx index.ts watch"
16+
},
17+
"type": "module"
18+
}

samples/Hello World/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES6",
4+
"moduleResolution": "Node",
5+
}
6+
}

0 commit comments

Comments
 (0)