dag-rs 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +34 -48
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,60 +1,52 @@
1
- # dag
1
+ # dag-rs
2
2
 
3
- This project was bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon).
3
+ `dag-rs` parses workspace and constructs a Directed Acyclic Graph (DAG) of local package dependencies within a monorepo or similar setups. Each edge in the graph represents a `dependent → dependency` relationship.
4
4
 
5
- ## Building dag
6
5
 
7
- Building dag requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support).
8
-
9
- To run the build, run:
6
+ ## Installation
10
7
 
11
- ```sh
12
- $ npm run build
13
8
  ```
14
-
15
- This command uses the [@neon-rs/cli](https://www.npmjs.com/package/@neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`.
16
-
17
- ## Exploring dag
18
-
19
- After building dag, you can explore its exports at the Node console:
20
-
21
- ```sh
22
- $ npm i
23
- $ npm run build
24
- $ node
25
- > require('.').hello('node')
26
- 'hello node'
9
+ npm install dag-rs
10
+ # or
11
+ yarn add dag-rs
27
12
  ```
28
13
 
29
- ## Available Scripts
30
-
31
- In the project directory, you can run:
32
-
33
- #### `npm install`
34
-
35
- Installs the project, including running `npm run build`.
36
-
37
- #### `npm run build`
38
-
39
- Builds the Node addon (`index.node`) from source, generating a release build with `cargo --release`.
14
+ ## Usage
15
+ ```
16
+ import dag from 'dag-rs';
40
17
 
41
- Additional [`cargo build`](https://doc.rust-lang.org/cargo/commands/cargo-build.html) arguments may be passed to `npm run build` and similar commands. For example, to enable a [cargo feature](https://doc.rust-lang.org/cargo/reference/features.html):
18
+ for (const obj of dag()) {
19
+ console.log(obj);
20
+ }
21
+ ```
42
22
 
23
+ ## Example Output `(dependent → dependency)`:
43
24
  ```
44
- npm run build -- --feature=beetle
25
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/fuselage' }
26
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/fuselage-hooks' }
27
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/icons' }
28
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/layout' }
29
+
30
+ { '@rocket.chat/fuselage': 'lint-all' }
31
+ { '@rocket.chat/fuselage': 'testing-utils' }
32
+
33
+ { '@rocket.chat/fuselage-forms': '@rocket.chat/emitter' }
34
+ { '@rocket.chat/fuselage-forms': '@rocket.chat/fuselage' }
35
+ { '@rocket.chat/fuselage-forms': '@rocket.chat/fuselage-hooks' }
36
+ { '@rocket.chat/fuselage-forms': '@rocket.chat/fuselage-tokens' }
37
+ { '@rocket.chat/fuselage-forms': 'lint-all' }
45
38
  ```
46
39
 
47
- #### `npm run debug`
48
-
49
- Similar to `npm run build` but generates a debug build with `cargo`.
50
-
51
- #### `npm run cross`
40
+ ## Building dag-rs
52
41
 
53
- Similar to `npm run build` but uses [cross-rs](https://github.com/cross-rs/cross) to cross-compile for another platform. Use the [`CARGO_BUILD_TARGET`](https://doc.rust-lang.org/cargo/reference/config.html#buildtarget) environment variable to select the build target.
42
+ Building dag requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support).
54
43
 
55
- #### `npm test`
44
+ To run the build, run:
56
45
 
57
- Runs the unit tests by calling `cargo test`. You can learn more about [adding tests to your Rust code](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) from the [Rust book](https://doc.rust-lang.org/book/).
46
+ ```sh
47
+ $ yarn install
48
+ $ yarn build
49
+ ```
58
50
 
59
51
  ## Project Layout
60
52
 
@@ -81,10 +73,4 @@ dag/
81
73
  | `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. |
82
74
  | `target/` | Binary artifacts generated by the Rust build. |
83
75
 
84
- ## Learn More
85
-
86
- Learn more about:
87
76
 
88
- - [Neon](https://neon-bindings.com).
89
- - [Rust](https://www.rust-lang.org).
90
- - [Node](https://nodejs.org).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dag-rs",
3
- "version": "0.1.4",
3
+ "version": "0.2.1",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "publishConfig": {