Skip to content

Commit

Permalink
chore: outsource non-core functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
FWuermse committed Aug 2, 2023
1 parent 050a73f commit 0b13ac0
Show file tree
Hide file tree
Showing 27 changed files with 189 additions and 1,128 deletions.
70 changes: 70 additions & 0 deletions COMMIT-CONVENTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Git Commit Convention

We are using the following convention for writing git-commit messages.
It is based on the one from AngularJS project([doc][angularjs-doc],
[commits][angularjs-git]).

[angularjs-git]: https://github.com/angular/angular.js/commits/master
[angularjs-doc]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#

## Format of the commit message

```xml
<type>: <subject>
<NEWLINE>
<body>
<NEWLINE>
<footer>
```

`<type>` is:

+ feat (feature)
+ fix (bug fix)
+ doc (documentation)
+ style (formatting, missing semicolons, ...)
+ refactor
+ test (when adding missing tests)
+ chore (maintain, ex: travis-ci)
+ perf (performance improvement, optimization, ...)

``<subject>`` has the following constraints:

+ use imperative, present tense: "change" not "changed" nor "changes"
+ do not capitalize the first letter
+ no dot(.) at the end

``<body>`` has the following constraints:

+ just as in ``<subject>``, use imperative, present tense
+ includes motivation for the change and contrasts with previous
behavior

``<footer>`` is optional and may contain two items:

+ Breaking changes: All breaking changes have to be mentioned in
footer with the description of the change, justification and
migration notes
+ Referencing issues: Closed bugs should be listed on a separate line
in the footer prefixed with "Closes" keyword like this:

Closes #123, #456

## Examples

fix: add declarations for operator<<(std::ostream&, expr const&) and operator<<(std::ostream&, context const&) in the kernel

The actual implementation of these two operators is outside of the
kernel. They are implemented in the file 'library/printer.cpp'. We
declare them in the kernel to prevent the following problem. Suppose
there is a file 'foo.cpp' that does not include 'library/printer.h',
but contains

expr a;
...
std::cout << a << "\n";
...

The compiler does not generate an error message. It silently uses the
operator bool() to coerce the expression into a Boolean. This produces
counter-intuitive behavior, and may confuse developers.
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# How to Contribute

+ Always follow the [commit convention](./COMMIT-CONVENTION.md).
+ Follow the [rustfmt styleguide](https://github.com/rust-lang/rustfmt).
+ Make sure your code is documented.
+ New features or bug fixes should come with appropriate tests.
+ Ensure all tests work before submitting a PR.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ crate-type = ["cdylib", "rlib"]
flow-derive = { path = "flow-derive" }
serde = { version = "1.0.166", features = ["derive", "rc"] }
serde_json = "1.0.100"
wasm-bindgen = "0.2.87"
boa_engine = "0.17.0"
getrandom = { version = "0.2", features = ["js"] }
threadpool = "1.8.1"

[dev-dependencies]
Expand Down
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Running the Example

```sh
$ wasm-pack build --target web
$ python3 -m http.server
```

Open the browser at [http://0.0.0.0:8000/](http://0.0.0.0:8000/).

Step through the flow:

![flow example](assets/example.png)

# Executing Tests

All Rust internal test can be executed using:
Expand All @@ -19,8 +6,6 @@ All Rust internal test can be executed using:
$ cargo test
```

while tests that require WASM can be executing using:
# Contributing

```sh
$ wasm-pack test --node
```
Please read our [Contribution Guidelines](./CONTRIBUTING.md) first.
Binary file removed assets/example.png
Binary file not shown.
2 changes: 1 addition & 1 deletion flow-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
quote = "1.0.29"
syn = "2.0.22"
syn = { version = "2.0.28", features = ["full"] }

[lib]
proc-macro = true
205 changes: 0 additions & 205 deletions src/flow/app_state.rs

This file was deleted.

26 changes: 5 additions & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
mod flow;
mod nodes;
mod sched;

pub use self::nodes::add;
pub use self::nodes::basic;
pub use self::nodes::connection;
pub use self::nodes::debug;
pub use self::nodes::node;

pub use self::flow::app_state;
pub use self::flow::scheduler;
pub use self::flow::executor;
pub use self::flow::flow_type;
pub use self::flow::version;


pub use flow_derive::Connectable;

use wasm_bindgen::prelude::wasm_bindgen;

#[wasm_bindgen]
extern "C" {
fn alert(s: &str);
#[wasm_bindgen(js_namespace = console)]
fn log(s: &str);
}
pub use self::sched::executor;
pub use self::sched::flow_type;
pub use self::sched::scheduler;
pub use self::sched::version;
Loading

0 comments on commit 0b13ac0

Please sign in to comment.