dag-rs 0.2.0 → 0.3.0

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dag-rs
2
2
 
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.
3
+ `dag-rs` (Directed Acyclic Graph) 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
5
 
6
6
  ## Installation
@@ -12,29 +12,148 @@ yarn add dag-rs
12
12
  ```
13
13
 
14
14
  ## Usage
15
+
16
+ ### CommonJS
15
17
  ```
16
- import dag from 'dag';
18
+ const { dag, getAffectedPkg } = require('dag-rs');
17
19
 
18
20
  for (const obj of dag()) {
19
21
  console.log(obj);
20
22
  }
23
+
24
+ for (const obj of getAffectedPkg("@rocket.chat/fuselage")) {
25
+ console.log(obj);
26
+ }
21
27
  ```
22
28
 
23
- ## Example Output `(dependent → dependency)`:
29
+ ### ESM
30
+ ```
31
+ import { dag, getAffectedPkg } from 'dag-rs';
32
+
33
+ for (const obj of dag()) {
34
+ console.log(obj);
35
+ }
36
+
37
+ for (const obj of getAffectedPkg("@rocket.chat/fuselage")) {
38
+ console.log(obj);
39
+ }
40
+ ```
41
+
42
+ ## Example Output :
43
+ ### getAffectedPkg("@rocket.chat/fuselage") → returns all the direct , transitive , circular dependency
44
+ ```
45
+ // dependents of @rocket.chat/fuselage package
46
+
47
+ @rocket.chat/layout
48
+ @rocket.chat/fuselage-toastbar
49
+ @rocket.chat/fuselage-forms
50
+ @rocket.chat/onboarding-ui
51
+
24
52
  ```
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
53
 
54
+ ## Example Output:
55
+ ### dag() → returns all packages in the project
56
+
57
+ ```
58
+ // dependent : dependency
59
+
60
+ { '@rocket.chat/fuselage-monorepo': '@rocket.chat/prettier-config' }
61
+ { '@rocket.chat/fuselage-monorepo': 'update-readme' }
62
+ { '@rocket.chat/css-in-js': '@rocket.chat/css-supports' }
63
+ { '@rocket.chat/css-in-js': '@rocket.chat/memo' }
64
+ {
65
+ '@rocket.chat/css-in-js': '@rocket.chat/stylis-logical-props-middleware'
66
+ }
67
+ { '@rocket.chat/css-in-js': 'lint-all' }
68
+ { '@rocket.chat/css-supports': '@rocket.chat/memo' }
69
+ { '@rocket.chat/css-supports': 'lint-all' }
70
+ { '@rocket.chat/emitter': 'lint-all' }
71
+ { '@rocket.chat/fuselage': '@rocket.chat/css-in-js' }
72
+ { '@rocket.chat/fuselage': '@rocket.chat/css-supports' }
73
+ { '@rocket.chat/fuselage': '@rocket.chat/fuselage-tokens' }
74
+ { '@rocket.chat/fuselage': '@rocket.chat/memo' }
75
+ { '@rocket.chat/fuselage': '@rocket.chat/styled' }
76
+ { '@rocket.chat/fuselage': '@rocket.chat/fuselage-hooks' }
77
+ { '@rocket.chat/fuselage': '@rocket.chat/icons' }
78
+ { '@rocket.chat/fuselage': '@rocket.chat/fuselage-hooks' }
79
+ { '@rocket.chat/fuselage': '@rocket.chat/icons' }
80
+ { '@rocket.chat/fuselage': '@rocket.chat/storybook-dark-mode' }
30
81
  { '@rocket.chat/fuselage': 'lint-all' }
31
82
  { '@rocket.chat/fuselage': 'testing-utils' }
32
-
33
83
  { '@rocket.chat/fuselage-forms': '@rocket.chat/emitter' }
34
84
  { '@rocket.chat/fuselage-forms': '@rocket.chat/fuselage' }
35
85
  { '@rocket.chat/fuselage-forms': '@rocket.chat/fuselage-hooks' }
86
+ { '@rocket.chat/fuselage-forms': '@rocket.chat/fuselage' }
36
87
  { '@rocket.chat/fuselage-forms': '@rocket.chat/fuselage-tokens' }
88
+ { '@rocket.chat/fuselage-forms': '@rocket.chat/storybook-dark-mode' }
37
89
  { '@rocket.chat/fuselage-forms': 'lint-all' }
90
+ { '@rocket.chat/fuselage-hooks': '@rocket.chat/emitter' }
91
+ { '@rocket.chat/fuselage-hooks': '@rocket.chat/fuselage-tokens' }
92
+ { '@rocket.chat/fuselage-hooks': '@rocket.chat/emitter' }
93
+ { '@rocket.chat/fuselage-hooks': '@rocket.chat/fuselage-tokens' }
94
+ { '@rocket.chat/fuselage-hooks': 'lint-all' }
95
+ { '@rocket.chat/fuselage-hooks': 'testing-utils' }
96
+ { '@rocket.chat/fuselage-toastbar': '@rocket.chat/fuselage' }
97
+ { '@rocket.chat/fuselage-toastbar': '@rocket.chat/fuselage-hooks' }
98
+ { '@rocket.chat/fuselage-toastbar': '@rocket.chat/styled' }
99
+ { '@rocket.chat/fuselage-toastbar': '@rocket.chat/fuselage' }
100
+ { '@rocket.chat/fuselage-toastbar': '@rocket.chat/fuselage-hooks' }
101
+ { '@rocket.chat/fuselage-toastbar': '@rocket.chat/fuselage-tokens' }
102
+ { '@rocket.chat/fuselage-toastbar': '@rocket.chat/layout' }
103
+ {
104
+ '@rocket.chat/fuselage-toastbar': '@rocket.chat/storybook-dark-mode'
105
+ }
106
+ { '@rocket.chat/fuselage-toastbar': '@rocket.chat/styled' }
107
+ { '@rocket.chat/fuselage-toastbar': 'lint-all' }
108
+ { '@rocket.chat/fuselage-tokens': 'build-design-tokens' }
109
+ { '@rocket.chat/fuselage-tokens': 'lint-all' }
110
+ { '@rocket.chat/icons': 'build-icons' }
111
+ { '@rocket.chat/icons': 'lint-all' }
112
+ { '@rocket.chat/layout': '@rocket.chat/fuselage' }
113
+ { '@rocket.chat/layout': '@rocket.chat/fuselage' }
114
+ { '@rocket.chat/layout': '@rocket.chat/fuselage-tokens' }
115
+ { '@rocket.chat/layout': '@rocket.chat/storybook-dark-mode' }
116
+ { '@rocket.chat/layout': 'lint-all' }
117
+ { '@rocket.chat/logo': '@rocket.chat/fuselage-hooks' }
118
+ { '@rocket.chat/logo': '@rocket.chat/styled' }
119
+ { '@rocket.chat/logo': '@rocket.chat/fuselage-tokens' }
120
+ { '@rocket.chat/logo': 'build-logo' }
121
+ { '@rocket.chat/logo': 'lint-all' }
122
+ { '@rocket.chat/memo': 'lint-all' }
123
+ { '@rocket.chat/mp3-encoder': 'lint-all' }
124
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/fuselage' }
125
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/fuselage-hooks' }
126
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/icons' }
127
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/layout' }
128
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/logo' }
129
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/styled' }
130
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/fuselage' }
131
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/fuselage-hooks' }
132
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/fuselage-tokens' }
133
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/icons' }
134
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/layout' }
135
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/logo' }
136
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/storybook-dark-mode' }
137
+ { '@rocket.chat/onboarding-ui': '@rocket.chat/styled' }
138
+ { '@rocket.chat/onboarding-ui': 'lint-all' }
139
+ { '@rocket.chat/prettier-config': 'lint-all' }
140
+ { '@rocket.chat/storybook-dark-mode': 'lint-all' }
141
+ { '@rocket.chat/string-helpers': 'lint-all' }
142
+ { '@rocket.chat/styled': '@rocket.chat/css-in-js' }
143
+ { '@rocket.chat/styled': 'lint-all' }
144
+ {
145
+ '@rocket.chat/stylis-logical-props-middleware': '@rocket.chat/css-supports'
146
+ }
147
+ { '@rocket.chat/stylis-logical-props-middleware': 'lint-all' }
148
+ { 'build-design-tokens': 'tools-utils' }
149
+ { 'build-design-tokens': 'lint-all' }
150
+ { 'build-icons': 'tools-utils' }
151
+ { 'build-icons': 'lint-all' }
152
+ { 'build-logo': 'lint-all' }
153
+ { 'build-logo': 'tools-utils' }
154
+ { 'testing-utils': 'lint-all' }
155
+ { 'tools-utils': 'lint-all' }
156
+ { 'update-readme': 'lint-all' }
38
157
  ```
39
158
 
40
159
  ## Building dag-rs
@@ -50,19 +169,6 @@ $ yarn build
50
169
 
51
170
  ## Project Layout
52
171
 
53
- The directory structure of this project is:
54
-
55
- ```
56
- dag/
57
- ├── Cargo.toml
58
- ├── README.md
59
- ├── src/
60
- | └── lib.rs
61
- ├── index.node
62
- ├── package.json
63
- └── target/
64
- ```
65
-
66
172
  | Entry | Purpose |
67
173
  |----------------|------------------------------------------------------------------------------------------------------------------------------------------|
68
174
  | `Cargo.toml` | The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. |
@@ -73,4 +179,5 @@ dag/
73
179
  | `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. |
74
180
  | `target/` | Binary artifacts generated by the Rust build. |
75
181
 
76
-
182
+ ## Contribution
183
+ All forms of contribution are welcome!
package/index.node CHANGED
Binary file
package/lib/index.cjs ADDED
@@ -0,0 +1,6 @@
1
+ const native = require('../index.node');
2
+
3
+ module.exports = {
4
+ dag: native.dag,
5
+ getAffectedPkg: native.getAffectedPkg
6
+ };
package/lib/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ import cjs from './index.cjs';
2
+
3
+ export const dag = cjs.dag;
4
+ export const getAffectedPkg = cjs.getAffectedPkg;
5
+
6
+ export default cjs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dag-rs",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "publishConfig": {
@@ -10,6 +10,12 @@
10
10
  "lib",
11
11
  "*.node"
12
12
  ],
13
+ "exports": {
14
+ ".": {
15
+ "require": "./lib/index.cjs",
16
+ "import": "./lib/index.mjs"
17
+ }
18
+ },
13
19
  "scripts": {
14
20
  "test": "cargo test",
15
21
  "cargo-build": "cargo build --message-format=json-render-diagnostics > cargo.log",
package/lib/index.js DELETED
@@ -1,3 +0,0 @@
1
- const native = require('../index.node');
2
-
3
- module.exports = native.dag;