retold 4.0.3 → 4.0.4
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/.claude/settings.local.json +26 -1
- package/README.md +20 -0
- package/docs/_sidebar.md +2 -1
- package/docs/architecture/architecture.md +2 -2
- package/docs/architecture/modules.md +3 -4
- package/docs/contributing.md +50 -0
- package/docs/modules/orator.md +0 -7
- package/docs/retold-catalog.json +110 -26
- package/docs/retold-keyword-index.json +15118 -15139
- package/docs/testing.md +122 -0
- package/modules/Include-Retold-Module-List.sh +1 -1
- package/package.json +7 -4
- package/source/retold-manager/package.json +23 -0
- package/source/retold-manager/retold-manager.js +65 -0
- package/source/retold-manager/source/Retold-Manager-App.js +1532 -0
- package/source/retold-manager/source/Retold-Manager-ModuleCatalog.js +75 -0
- package/source/retold-manager/source/Retold-Manager-ProcessRunner.js +706 -0
- package/source/retold-manager/source/views/PictView-TUI-Checkout.js +45 -0
- package/source/retold-manager/source/views/PictView-TUI-Header.js +41 -0
- package/source/retold-manager/source/views/PictView-TUI-Layout.js +53 -0
- package/source/retold-manager/source/views/PictView-TUI-Status.js +45 -0
- package/source/retold-manager/source/views/PictView-TUI-StatusBar.js +41 -0
- package/source/retold-manager/source/views/PictView-TUI-Update.js +45 -0
- package/examples/quickstart/layer1/package-lock.json +0 -344
- package/examples/quickstart/layer2/package-lock.json +0 -4468
- package/examples/quickstart/layer3/package-lock.json +0 -1936
- package/examples/quickstart/layer4/package-lock.json +0 -13206
- package/examples/quickstart/layer5/package-lock.json +0 -345
- package/examples/todo-list/cli-client/package-lock.json +0 -418
- package/examples/todo-list/console-client/package-lock.json +0 -426
- package/examples/todo-list/server/package-lock.json +0 -6113
- package/examples/todo-list/web-client/package-lock.json +0 -12030
package/docs/testing.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Testing
|
|
2
|
+
|
|
3
|
+
Retold modules use [Mocha](https://mochajs.org/) in TDD style with [Chai](https://www.chaijs.com/) assertions. Each module has its own test suite that runs independently.
|
|
4
|
+
|
|
5
|
+
## Running Module Tests
|
|
6
|
+
|
|
7
|
+
From any module directory:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm test # Run the test suite
|
|
11
|
+
npm run coverage # Run with code coverage (if available)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Database Tests (Meadow)
|
|
15
|
+
|
|
16
|
+
The Meadow data access modules (`meadow`, `meadow-connection-mysql`, `meadow-connection-mssql`) require live database servers for their full test suites. Docker scripts in `modules/meadow/meadow/scripts/` manage disposable test containers on non-standard ports so they won't conflict with local database servers.
|
|
17
|
+
|
|
18
|
+
### Prerequisites
|
|
19
|
+
|
|
20
|
+
- [Docker](https://www.docker.com/) installed and running
|
|
21
|
+
|
|
22
|
+
### Ports
|
|
23
|
+
|
|
24
|
+
| Database | Container Name | Host Port | Standard Port |
|
|
25
|
+
|----------|---------------|-----------|---------------|
|
|
26
|
+
| MySQL 8.0 | `meadow-mysql-test` | **33306** | 3306 |
|
|
27
|
+
| MSSQL 2022 | `meadow-mssql-test` | **31433** | 1433 |
|
|
28
|
+
|
|
29
|
+
### Quick Start
|
|
30
|
+
|
|
31
|
+
From `modules/meadow/meadow/`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Start MySQL, seed the bookstore database, and run MySQL tests
|
|
35
|
+
npm run test-mysql
|
|
36
|
+
|
|
37
|
+
# Start MSSQL and run MSSQL tests
|
|
38
|
+
npm run test-mssql
|
|
39
|
+
|
|
40
|
+
# Start both and run the full suite
|
|
41
|
+
npm run test-all-providers
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Managing Containers
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# MySQL
|
|
48
|
+
npm run docker-mysql-start # Start container + seed data
|
|
49
|
+
npm run docker-mysql-stop # Stop and remove container
|
|
50
|
+
npm run docker-mysql-status # Check if container is running
|
|
51
|
+
|
|
52
|
+
# MSSQL
|
|
53
|
+
npm run docker-mssql-start
|
|
54
|
+
npm run docker-mssql-stop
|
|
55
|
+
npm run docker-mssql-status
|
|
56
|
+
|
|
57
|
+
# Both
|
|
58
|
+
npm run docker-cleanup # Stop and remove both containers
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or call the scripts directly:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
./scripts/mysql-test-db.sh start
|
|
65
|
+
./scripts/mssql-test-db.sh start
|
|
66
|
+
./scripts/meadow-test-cleanup.sh
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### What the Scripts Do
|
|
70
|
+
|
|
71
|
+
**MySQL** (`mysql-test-db.sh start`):
|
|
72
|
+
1. Pulls and starts a `mysql:8.0` container on port 33306
|
|
73
|
+
2. Waits for MySQL to accept connections
|
|
74
|
+
3. Creates the `bookstore` database (via Docker `MYSQL_DATABASE` env)
|
|
75
|
+
4. Loads the bookstore schema (Book, Author, BookAuthorJoin, BookPrice, Review tables)
|
|
76
|
+
5. Seeds 20 books and 21 authors from the Retold test dataset
|
|
77
|
+
|
|
78
|
+
**MSSQL** (`mssql-test-db.sh start`):
|
|
79
|
+
1. Pulls and starts an `mcr.microsoft.com/mssql/server:2022-latest` container on port 31433
|
|
80
|
+
2. Waits for MSSQL to accept connections
|
|
81
|
+
3. Creates the `bookstore` database via `sqlcmd`
|
|
82
|
+
|
|
83
|
+
The MSSQL tests create their own tables in `suiteSetup`, so no additional schema loading is needed.
|
|
84
|
+
|
|
85
|
+
### Connection Details
|
|
86
|
+
|
|
87
|
+
**MySQL:**
|
|
88
|
+
- Host: `127.0.0.1`
|
|
89
|
+
- Port: `33306`
|
|
90
|
+
- User: `root`
|
|
91
|
+
- Password: `123456789`
|
|
92
|
+
- Database: `bookstore`
|
|
93
|
+
|
|
94
|
+
**MSSQL:**
|
|
95
|
+
- Host: `127.0.0.1`
|
|
96
|
+
- Port: `31433`
|
|
97
|
+
- User: `sa`
|
|
98
|
+
- Password: `1234567890abc.`
|
|
99
|
+
- Database: `bookstore`
|
|
100
|
+
|
|
101
|
+
### Running Individual Module Tests
|
|
102
|
+
|
|
103
|
+
Once the containers are running, you can also run the connection module tests directly:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# meadow-connection-mysql (requires MySQL container)
|
|
107
|
+
cd modules/meadow/meadow-connection-mysql && npm test
|
|
108
|
+
|
|
109
|
+
# meadow-connection-mssql (requires MSSQL container)
|
|
110
|
+
cd modules/meadow/meadow-connection-mssql && npm test
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Cleanup
|
|
114
|
+
|
|
115
|
+
When you're done testing, remove the containers:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
cd modules/meadow/meadow
|
|
119
|
+
npm run docker-cleanup
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
This stops and removes both the MySQL and MSSQL test containers. The database data is ephemeral and does not persist between container restarts.
|
|
@@ -6,7 +6,7 @@ repositoriesFable=("fable" "fable-log" "fable-settings" "fable-uuid" "fable-serv
|
|
|
6
6
|
|
|
7
7
|
repositoriesMeadow=("stricture" "foxhound" "bibliograph" "meadow" "parime" "meadow-endpoints" "meadow-connection-mysql" "meadow-connection-mssql" "meadow-connection-sqlite" "retold-data-service" "retold-harness" "meadow-integration")
|
|
8
8
|
|
|
9
|
-
repositoriesOrator=("orator" "orator-serviceserver-restify" "orator-static-server" "orator-http-proxy" "tidings" "orator-
|
|
9
|
+
repositoriesOrator=("orator" "orator-serviceserver-restify" "orator-static-server" "orator-http-proxy" "tidings" "orator-conversion")
|
|
10
10
|
|
|
11
11
|
repositoriesPict=("pict" "pict-template" "pict-view" "pict-provider" "pict-application" "pict-panel" "pict-nonlinearconfig" "pict-section-flow" "pict-docuserve" "cryptbrau" "informary" "pict-service-commandlineutility" "pict-section-recordset" "pict-section-content" "pict-section-form" "pict-section-tuigrid" "pict-router" "pict-serviceproviderbase" "pict-terminalui")
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "retold",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "The pict and fable node ecosystem.",
|
|
5
5
|
"main": "source/Retold.cjs",
|
|
6
|
+
"bin": {
|
|
7
|
+
"manager": "./source/retold-manager/retold-manager.js"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"start": "node source/Retold.cjs",
|
|
8
11
|
"coverage": "./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec",
|
|
@@ -25,8 +28,8 @@
|
|
|
25
28
|
},
|
|
26
29
|
"homepage": "https://github.com/stevenvelozo/retold",
|
|
27
30
|
"devDependencies": {
|
|
28
|
-
"indoctrinate": "^1.0.
|
|
29
|
-
"pict-docuserve": "^0.0.
|
|
30
|
-
"quackage": "^1.0.
|
|
31
|
+
"indoctrinate": "^1.0.7",
|
|
32
|
+
"pict-docuserve": "^0.0.16",
|
|
33
|
+
"quackage": "^1.0.51"
|
|
31
34
|
}
|
|
32
35
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "retold-manager",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Terminal UI manager for retold module repositories",
|
|
5
|
+
"main": "retold-manager.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"retold-manager": "./retold-manager.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "node retold-manager.js",
|
|
11
|
+
"test": "echo \"No tests yet\" && exit 0"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"blessed": "^0.1.81",
|
|
16
|
+
"fable": "^3.0.232",
|
|
17
|
+
"fable-serviceproviderbase": "^3.0.16",
|
|
18
|
+
"pict": "^1.0.345",
|
|
19
|
+
"pict-application": "^1.0.28",
|
|
20
|
+
"pict-terminalui": "^0.0.2",
|
|
21
|
+
"pict-view": "^1.0.64"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Retold Manager -- Terminal UI for Module Management
|
|
4
|
+
*
|
|
5
|
+
* A pict-terminalui application for browsing the retold module suite
|
|
6
|
+
* and running common operations (install, test, build, version, diff).
|
|
7
|
+
*
|
|
8
|
+
* Run: node retold-manager.js
|
|
9
|
+
* Quit: Ctrl-C
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// Suppress blessed's Setulc stderr noise before anything loads
|
|
13
|
+
const _origStderrWrite = process.stderr.write;
|
|
14
|
+
process.stderr.write = function (pChunk)
|
|
15
|
+
{
|
|
16
|
+
if (typeof pChunk === 'string' && pChunk.indexOf('Setulc') !== -1)
|
|
17
|
+
{
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return _origStderrWrite.apply(process.stderr, arguments);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const libPict = require('pict');
|
|
24
|
+
const libPictApplication = require('pict-application');
|
|
25
|
+
|
|
26
|
+
const libRetoldManagerApp = require('./source/Retold-Manager-App.js');
|
|
27
|
+
|
|
28
|
+
// ─────────────────────────────────────────────
|
|
29
|
+
// Bootstrap
|
|
30
|
+
// ─────────────────────────────────────────────
|
|
31
|
+
let _Pict = new libPict(
|
|
32
|
+
{
|
|
33
|
+
Product: 'RetoldManager',
|
|
34
|
+
LogNoisiness: 0,
|
|
35
|
+
// Silence the default console log stream so it doesn't corrupt the
|
|
36
|
+
// blessed TUI. File logging is added dynamically via [l] toggle.
|
|
37
|
+
LogStreams:
|
|
38
|
+
[
|
|
39
|
+
{
|
|
40
|
+
loggertype: 'console',
|
|
41
|
+
streamtype: 'console',
|
|
42
|
+
level: 'fatal',
|
|
43
|
+
outputloglinestoconsole: false,
|
|
44
|
+
outputobjectstoconsole: false,
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
let _App = _Pict.addApplication('RetoldManager',
|
|
50
|
+
{
|
|
51
|
+
Name: 'RetoldManager',
|
|
52
|
+
MainViewportViewIdentifier: 'TUI-Layout',
|
|
53
|
+
AutoRenderMainViewportViewAfterInitialize: false,
|
|
54
|
+
AutoSolveAfterInitialize: false,
|
|
55
|
+
}, libRetoldManagerApp);
|
|
56
|
+
|
|
57
|
+
_App.initializeAsync(
|
|
58
|
+
(pError) =>
|
|
59
|
+
{
|
|
60
|
+
if (pError)
|
|
61
|
+
{
|
|
62
|
+
console.error('Application initialization failed:', pError);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
});
|