Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS cleanups and updates #52

Merged
merged 3 commits into from
Aug 18, 2024
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ serde = { version = "1.0.195", features = ["derive"] }
serde_json = { version = "1.0.111" }
strum = "0.26.1"
strum_macros = "0.26.1"
regex = "1.9.4"

[build-dependencies]
cargo_metadata = "0.18.1"
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@ The following occurrences get replaced to the provided component name, applying

### Testing the examples
The example generation and instructions can be tested with a test [cli app](/src/test/main.rs).
The app also accepts a filter argument, which matches for the example name, eg. to test the go examples use:
The app also accepts a filter argument, which matches for the example name as regular expressions, eg. to test the go examples use:

```shell
cargo run --bin golem-examples-test-cli -- -f go
```

Or to exactly match an example name:

```shell
cargo run --bin golem-examples-test-cli -- -f '^go-default$'
```

The necessary tooling for the specific language is expected to be available.

The test app will instantiate examples and then execute the instructions (all lines starting with ` `).
Expand Down
13 changes: 12 additions & 1 deletion examples/js/INSTRUCTIONS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ See the documentation about installing tooling: https://learn.golem.cloud/docs/e

Compile the JavaScript project with npm:
npm install
npm run build
npm run componentize

The `out/component_name.wasm` file is ready to be uploaded to Golem Cloud!

Other available npm scripts:

- Bundle the JavaScript sources:
npm run build

- Clean the project:
npm run clean

- Componentizing (includes the bundle step too):
npm run componentize
3 changes: 3 additions & 0 deletions examples/js/js-default-minimal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
out/
src/generated/
14 changes: 0 additions & 14 deletions examples/js/js-default-minimal/componentize.js

This file was deleted.

12 changes: 0 additions & 12 deletions examples/js/js-default-minimal/main.js

This file was deleted.

8 changes: 4 additions & 4 deletions examples/js/js-default-minimal/metadata.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"description": "A simple stateful Golem worker in JavaScript with no dependencies on external services",
"requiresAdapter": true,
"description": "A simple stateful Golem worker implemented in JavaScript with no dependencies on external services",
"requiresAdapter": false,
"exclude": [
"out",
"node_modules"
"node_modules",
"out"
]
}
Loading
Loading