Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
app manifest for js, ts, python
Browse files Browse the repository at this point in the history
  • Loading branch information
noise64 committed Dec 9, 2024
1 parent 288d0cc commit 17a9847
Show file tree
Hide file tree
Showing 43 changed files with 383 additions and 850 deletions.
26 changes: 26 additions & 0 deletions examples/go/go-default/golem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Schema for IDEA:
# $schema: https://schema.golem.cloud/app/golem/1.1.0-rc3/golem.schema.json
# Schema for vscode-yaml
# yaml-language-server: $schema=https://schema.golem.cloud/app/golem/1.1.0-rc3/golem.schema.json

tempDir: build/golem-temp
components:
pack:name:
sourceWit: wit
generatedWit: wit-generated
componentWasm: build/components/component_name.wasm
linkedWasm: build/linked-components/component_name_linked.wasm
build:
- command: componentize-py bindings bindings
sources:
- wit-generated
targets:
- bindings
- command: componentize-py componentize main -o build/components/component_name.wasm
mkdirs:
- build/components
sources:
- bindings
- main.py
targets:
- build/components/component_name.wasm
9 changes: 9 additions & 0 deletions examples/js/INSTRUCTIONS-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
See the documentation about installing tooling: https://learn.golem.cloud/docs/experimental-languages/js-language-guide/setup

First time node package install:
golem-cli app install

Generate wit and bindings, build and link component:
golem-cli app build

The `out/linked-components/component_name.wasm` file is ready to be uploaded to Golem Cloud!
1 change: 1 addition & 0 deletions examples/js/js-default/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
out/
wit-generated/
31 changes: 31 additions & 0 deletions examples/js/js-default/golem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Schema for IDEA:
# $schema: https://schema.golem.cloud/app/golem/1.1.0-rc3/golem.schema.json
# Schema for vscode-yaml
# yaml-language-server: $schema=https://schema.golem.cloud/app/golem/1.1.0-rc3/golem.schema.json

tempDir: out/golem-temp
components:
pack:name:
sourceWit: wit
generatedWit: wit-generated
componentWasm: out/components/component_name.wasm
linkedWasm: out/linked-components/component_name_linked.wasm
build:
- command: npx rollup --config
sources:
- src
- wit-generated
targets:
- out/main.js
- command: npx jco componentize -w wit-generated -o out/components/component_name.wasm out/main.js
mkdirs:
- out/components
sources:
- out/main.js
targets:
- out/components/component_name.wasm
clean:
- src/generated
customCommands:
install:
- command: npm install
4 changes: 3 additions & 1 deletion examples/js/js-default/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"requiresAdapter": false,
"requiresGolemHostWIT": true,
"requiresWASI": true,
"instructions": "INSTRUCTIONS-app",
"exclude": [
"node_modules",
"out"
"out",
"wit-generated"
]
}
5 changes: 0 additions & 5 deletions examples/js/js-default/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"scripts": {
"build": "rollup --config",
"componentize": "npm run build && jco componentize -w wit -o out/component_name.wasm out/main.js",
"clean": "rm -rf out src/generated"
},
"devDependencies": {
"@golemcloud/componentize-js": "0.10.5-golem.3",
"@golemcloud/golem-ts": "1.1.0",
Expand Down
1 change: 1 addition & 0 deletions examples/python/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bindings
component_name.wasm
wit-generated
__pycache__
6 changes: 6 additions & 0 deletions examples/python/INSTRUCTIONS-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
See the documentation about installing tooling: https://learn.golem.cloud/docs/python-language-guide/setup

Generate wit and bindings, build and link component:
golem-cli app build

The `build/linked-components/component_name_linked.wasm` file is ready to be uploaded to Golem Cloud!
4 changes: 4 additions & 0 deletions examples/python/python-default/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bindings
component_name.wasm
wit-generated
__pycache__
26 changes: 26 additions & 0 deletions examples/python/python-default/golem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Schema for IDEA:
# $schema: https://schema.golem.cloud/app/golem/1.1.0-rc3/golem.schema.json
# Schema for vscode-yaml
# yaml-language-server: $schema=https://schema.golem.cloud/app/golem/1.1.0-rc3/golem.schema.json

tempDir: build/golem-temp
components:
pack:name:
sourceWit: wit
generatedWit: wit-generated
componentWasm: build/components/component_name.wasm
linkedWasm: build/linked-components/component_name_linked.wasm
build:
- command: componentize-py bindings bindings
sources:
- wit-generated
targets:
- bindings
- command: componentize-py componentize main -o build/components/component_name.wasm
mkdirs:
- build/components
sources:
- bindings
- main.py
targets:
- build/components/component_name.wasm
2 changes: 2 additions & 0 deletions examples/python/python-default/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"requiresAdapter": false,
"requiresGolemHostWIT": true,
"requiresWASI": true,
"instructions": "INSTRUCTIONS-app",
"exclude": [
"component_name.wasm",
"bindings",
"wit-generated ",
"__pycache__"
]
}
9 changes: 9 additions & 0 deletions examples/ts/INSTRUCTIONS-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
See the documentation about installing tooling: https://learn.golem.cloud/docs/experimental-languages/ts-language-guide/setup

First time node package install:
golem-cli app install

Generate wit and bindings, build and link component:
golem-cli app build

The `out/linked-components/component_name.wasm` file is ready to be uploaded to Golem Cloud!
7 changes: 3 additions & 4 deletions examples/ts/INSTRUCTIONS-buildts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
See the documentation about installing tooling: https://learn.golem.cloud/docs/go-language-guide/setup
See the documentation about installing tooling: https://learn.golem.cloud/docs/experimental-languages/ts-language-guide/setup
and see more details in the README.md file about other commands.

Before first time build, install dependencies and generate RPC stubs:
Before first time build, install dependencies:
npm install
npm run updateRpcStubs

Generate bindings, compile and compose components:
npm run build
golem-cli app build

Deploy components to default profile:
npm run deploy
Expand Down
1 change: 1 addition & 0 deletions examples/ts/ts-default/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
out/
src/generated/
wit-generated/
36 changes: 36 additions & 0 deletions examples/ts/ts-default/golem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Schema for IDEA:
# $schema: https://schema.golem.cloud/app/golem/1.1.0-rc3/golem.schema.json
# Schema for vscode-yaml
# yaml-language-server: $schema=https://schema.golem.cloud/app/golem/1.1.0-rc3/golem.schema.json

tempDir: out/golem-temp
components:
pack:name:
sourceWit: wit
generatedWit: wit-generated
componentWasm: out/components/component_name.wasm
linkedWasm: out/linked-components/component_name_linked.wasm
build:
- command: npx jco stubgen wit-generated -o src/generated
sources:
- wit-generated
targets:
- src/generated
- command: npx rollup --config
sources:
- src
- wit-generated
targets:
- out/main.js
- command: npx jco componentize -w wit-generated -o out/components/component_name.wasm out/main.js
mkdirs:
- out/components
sources:
- out/main.js
targets:
- out/components/component_name.wasm
clean:
- src/generated
customCommands:
install:
- command: npm install
1 change: 1 addition & 0 deletions examples/ts/ts-default/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"requiresAdapter": false,
"requiresGolemHostWIT": true,
"requiresWASI": true,
"instructions": "INSTRUCTIONS-ap",
"exclude": [
"node_modules",
"out",
Expand Down
6 changes: 4 additions & 2 deletions examples/ts/ts-multi-rpc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/
out/
binding
generated
node_modules
out
wit-generated
Loading

0 comments on commit 17a9847

Please sign in to comment.