systemview 1.0.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 ADDED
@@ -0,0 +1,56 @@
1
+ # Establishing a connection between SystemView and the Test Services
2
+
3
+ ## SystemView Plugin
4
+
5
+ ```javascript
6
+ const SystemView = require("systemView")({
7
+ SystemViewConnection: "http://localhost:3300", //default
8
+ SystemViewDocumentation: "./SystemView", //default
9
+ projectCode: "ProjectName", //optional. Used to conveniently load multiple services as one project
10
+ serviceId: "ServiceName", //required. If not included
11
+ });
12
+
13
+ App.use(SystemView);
14
+ ```
15
+
16
+ Every time the app reload the plugin will load the SystemView Service using the `SystemViewConnection` value provided. It also adds a local module called `SystemView` to the test Service with the following methods and event:
17
+
18
+ - `SystemView.saveDoc`
19
+ - `SystemView.getDoc`
20
+ - `SystemView.emit("specs-updated")`
21
+
22
+ Once the test Service is ready the plugin will send the `system` data to the SystemView Service via the following method call.
23
+
24
+ ```javascript
25
+ SystemView.connect({
26
+ system,
27
+ projectCode,
28
+ serviceId,
29
+ });
30
+ ```
31
+
32
+ The SystemView Service will Store the `system` data in memory. When the SystemView app makes a request for a connection (`SystemView.getConnection`), then the it will return the data from memory or from the service directly
33
+
34
+ > Normally it's not a good idea to hold data in memory or maintain state with in a service but since this is a local project it won't be an issue.
35
+
36
+ ## Loading One or More Services
37
+
38
+ 1. User enters a `projectCode` or a `serviceUrl` in the search input
39
+ 2. The `SystemView.api.getConnection(projectCode || servicerUrl)` method will be called. This method will facilitate the process of retrieving the `connectionData` for the Service or Services being searched.
40
+
41
+ - if a url is passed it will first check for a `system` in memory with that url and return that, or make a request for the `connectionData` and return that
42
+ - if a `projectCode` is passed the service will check for a `system` in memory with the same `projectCode` and return that data to the app, or a 404 error
43
+ > It's ok to use memory as this is a local project
44
+
45
+ ## Saving Tests and Documentation
46
+
47
+ 1. SystemView plugin creates a SystemView module in the test Service
48
+ - `SystemView.saveDoc`
49
+ - `SystemView.getDoc`
50
+ 2. The plugin also adds the SystemView service and calls `SystemView.connect` when the app is read
51
+ 3. The users enters a project code in the search input
52
+ 4.
53
+
54
+ ## Quick Testing Random Services (Without the plugin)
55
+
56
+ 1. User enters a service url in the search input
package/README.old.md ADDED
@@ -0,0 +1 @@
1
+ # SystemView-f1
package/cli/index.js ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * SystemView
5
+ * A documentation and testing suite for SystemLynx
6
+ *
7
+ * @author Odion Edwards <none>
8
+ */
9
+
10
+ const init = require('./utils/init');
11
+ const cli = require('./utils/cli');
12
+ const log = require('./utils/log');
13
+
14
+ const input = cli.input;
15
+ const flags = cli.flags;
16
+ const { clear, debug } = flags;
17
+
18
+ (async () => {
19
+ init({ clear });
20
+ input.includes(`help`) && cli.showHelp(0);
21
+
22
+ debug && log(flags);
23
+ })();
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "systemview",
3
+ "description": "A documentation and testing suite for SystemLynx",
4
+ "version": "1.0.0",
5
+ "license": "UNLICENSED",
6
+ "bin": {
7
+ "SystemView": "cli/index.js"
8
+ },
9
+ "dependencies": {
10
+ "@babel/preset-react": "^7.18.6",
11
+ "@testing-library/react": "^11.1.0",
12
+ "@testing-library/user-event": "^12.1.10",
13
+ "chalk": "^4.1.2",
14
+ "cli-alerts": "^1.2.2",
15
+ "cli-handle-error": "^4.4.0",
16
+ "cli-handle-unhandled": "^1.1.1",
17
+ "cli-meow-help": "^3.1.0",
18
+ "cli-welcome": "^2.2.2",
19
+ "meow": "^9.0.0",
20
+ "moment": "^2.29.1",
21
+ "node-sass": "^4.14.1",
22
+ "react": "17.0.1",
23
+ "react-dom": "17.0.1",
24
+ "react-dropdown-input": "^0.1.11",
25
+ "react-json-view": "^1.21.3",
26
+ "react-markdown": "^8.0.3",
27
+ "react-router-dom": "^5.2.0",
28
+ "react-scripts": "^4.0.0",
29
+ "react-syntax-highlighter": "^15.5.0",
30
+ "remark-gfm": "^3.0.1",
31
+ "systemlynx": "^1.8.3",
32
+ "web-vitals": "^0.2.4"
33
+ },
34
+ "scripts": {
35
+ "start": "nodemon api & react-scripts start",
36
+ "build": "react-scripts build",
37
+ "test": "react-scripts test",
38
+ "eject": "react-scripts eject"
39
+ },
40
+ "eslintConfig": {
41
+ "extends": [
42
+ "react-app",
43
+ "react-app/jest"
44
+ ]
45
+ },
46
+ "browserslist": {
47
+ "production": [
48
+ ">0.2%",
49
+ "not dead",
50
+ "not op_mini all"
51
+ ],
52
+ "development": [
53
+ "last 1 chrome version",
54
+ "last 1 firefox version",
55
+ "last 1 safari version"
56
+ ]
57
+ },
58
+ "devDependencies": {
59
+ "@testing-library/jest-dom": "^5.16.4",
60
+ "chai": "^4.2.0",
61
+ "cz-conventional-changelog": "^3.3.0",
62
+ "enzyme": "^3.11.0",
63
+ "enzyme-adapter-react-16": "^1.15.5",
64
+ "react-test-renderer": "17.0.1"
65
+ },
66
+ "config": {
67
+ "commitizen": {
68
+ "path": "./node_modules/cz-conventional-changelog"
69
+ }
70
+ },
71
+ "author": {
72
+ "name": "Odion Edwards",
73
+ "email": "odionedwards@gmail.com",
74
+ "url": "none"
75
+ },
76
+ "keywords": [
77
+ "SystemView",
78
+ "Odion Edwards"
79
+ ],
80
+ "files": [
81
+ "index.js",
82
+ "utils"
83
+ ]
84
+ }