@feasibleone/blong-gogo 1.31.2 → 1.32.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/CHANGELOG.md +20 -0
- package/package.json +5 -3
- package/src/AdapterBase.ts +3 -0
- package/src/Gateway.ts +20 -0
- package/src/Mcp.ts +227 -0
- package/src/Registry.ts +39 -0
- package/src/Watch.ts +57 -7
- package/src/cli.ts +209 -0
- package/src/cliHelp.ts +2 -1
- package/src/exit.intent.test.ts +98 -0
- package/src/graceful-shutdown.spawn.test.ts +1 -1
- package/src/load.ts +157 -94
- package/src/loadBrowser.ts +3 -0
- package/src/loadServer.ts +2 -1
- package/src/runServer.ts +7 -2
- package/src/template-files.ts +10 -49
- package/template/browser/test/test/test$Object.flow.ts +14 -4
- package/template/eslint.config.mjs +1 -1
- package/template/server/test/test/test$Object.ts +16 -5
package/src/runServer.ts
CHANGED
|
@@ -135,7 +135,10 @@ export async function runPlatform(
|
|
|
135
135
|
await platform.start!({});
|
|
136
136
|
const shutdown = gracefulShutdown(() => platform.stop!());
|
|
137
137
|
await platform.test!(undefined);
|
|
138
|
-
|
|
138
|
+
// Whether the process outlives its work is a config decision, declared per
|
|
139
|
+
// intent (`cli`/`db` exit, `playwright` does not, `integration` only in CI) —
|
|
140
|
+
// see the synthetic intent config in `load.ts`. No intent-name matching here.
|
|
141
|
+
if (platform.exit) {
|
|
139
142
|
shutdown();
|
|
140
143
|
await platform.stop!();
|
|
141
144
|
}
|
|
@@ -207,7 +210,9 @@ export async function autoRun(options: {
|
|
|
207
210
|
for (const platform of platforms) await platform.stop();
|
|
208
211
|
});
|
|
209
212
|
await platforms[1].test!(undefined);
|
|
210
|
-
|
|
213
|
+
// Both platforms are loaded with the same intents, so either one carries
|
|
214
|
+
// the same resolved flag.
|
|
215
|
+
if (platforms[0].exit) {
|
|
211
216
|
shutdown();
|
|
212
217
|
for (const platform of platforms) await platform.stop();
|
|
213
218
|
}
|
package/src/template-files.ts
CHANGED
|
@@ -1,52 +1,13 @@
|
|
|
1
|
-
import {globSync} from 'tinyglobby';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
* template.
|
|
2
|
+
* Template enumeration is owned by `@feasibleone/blong-lib/template` so that
|
|
3
|
+
* the runtime (`createRealm`), the publish bundler (`scripts/copy-template.mjs`)
|
|
4
|
+
* and `blong-kukum`'s primitive scaffolder all share one definition of "what
|
|
5
|
+
* counts as a template file".
|
|
6
6
|
*
|
|
7
|
-
* This is the
|
|
8
|
-
* is shared by:
|
|
9
|
-
* - `createRealm` (`src/kopi.ts`) — scaffolds a new realm from the template
|
|
10
|
-
* - `scripts/copy-template.mjs` — bundles the template at publish time
|
|
11
|
-
*
|
|
12
|
-
* Keeping the list here (instead of inlined in both consumers) prevents the
|
|
13
|
-
* two from drifting out of sync.
|
|
14
|
-
*/
|
|
15
|
-
export const TEMPLATE_FILES_IGNORE = [
|
|
16
|
-
'**/node_modules/**',
|
|
17
|
-
'**/dist/**',
|
|
18
|
-
'**/.rush/**',
|
|
19
|
-
'**/rush-logs/**',
|
|
20
|
-
'**/.gitignore',
|
|
21
|
-
// Playwright screenshot baselines are generated per realm — a new realm
|
|
22
|
-
// runs `npm run playwright:update` to create its own.
|
|
23
|
-
'**/*-snapshots/**',
|
|
24
|
-
// Dev/CI artifacts (Playwright output, Allure reports) are per-realm too.
|
|
25
|
-
'**/.playwright/**',
|
|
26
|
-
'**/allure-results/**',
|
|
27
|
-
'**/allure-report/**',
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
export interface ListTemplateFilesOptions {
|
|
31
|
-
/**
|
|
32
|
-
* Extra ignore globs appended to {@link TEMPLATE_FILES_IGNORE} for a
|
|
33
|
-
* specific consumer. E.g. `createRealm` also skips `package.json` (it
|
|
34
|
-
* writes its own, with the realm name substituted), while the publish
|
|
35
|
-
* bundle keeps `package.json` (createRealm reads it to name the realm).
|
|
36
|
-
*/
|
|
37
|
-
extraIgnore?: string[];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Enumerate the scaffolding template files under `cwd` (recursive, including
|
|
42
|
-
* dotfiles), excluding {@link TEMPLATE_FILES_IGNORE} plus any
|
|
43
|
-
* {@link ListTemplateFilesOptions.extraIgnore}.
|
|
7
|
+
* This module is kept as the stable import path for the gogo-side consumers.
|
|
44
8
|
*/
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
ignore: [...TEMPLATE_FILES_IGNORE, ...(options.extraIgnore ?? [])],
|
|
51
|
-
});
|
|
52
|
-
}
|
|
9
|
+
export {
|
|
10
|
+
listTemplateFiles,
|
|
11
|
+
TEMPLATE_FILES_IGNORE,
|
|
12
|
+
type ListTemplateFilesOptions,
|
|
13
|
+
} from '@feasibleone/blong-lib/template';
|
|
@@ -72,12 +72,13 @@ export default handler(
|
|
|
72
72
|
{username: 'testAdmin', password: 'testPassword'},
|
|
73
73
|
$meta,
|
|
74
74
|
);
|
|
75
|
+
const $objectName = `ENT-BROWSER-${Date.now()}`;
|
|
75
76
|
const result = await $subject$ObjectAdd<{
|
|
76
|
-
$object: {$objectId: number};
|
|
77
|
+
$object: {$objectId: number; $objectName: string};
|
|
77
78
|
}>(
|
|
78
79
|
{
|
|
79
80
|
$object: {
|
|
80
|
-
$objectName
|
|
81
|
+
$objectName,
|
|
81
82
|
$objectStatus: 'draft',
|
|
82
83
|
},
|
|
83
84
|
line: [{lineName: 'Item', lineQuantity: 1}],
|
|
@@ -86,8 +87,17 @@ export default handler(
|
|
|
86
87
|
);
|
|
87
88
|
assert.ok(result.$object.$objectId, 'authorized $object add succeeds');
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
// Filter by the row this run created instead of paging the
|
|
91
|
+
// whole table: the table keeps growing between runs, so page
|
|
92
|
+
// 1 of an unfiltered find stops containing the new row once
|
|
93
|
+
// there are more rows than pageSize.
|
|
94
|
+
const resultFind = await $subject$ObjectFind<
|
|
95
|
+
Array<{$objectId: number; $objectName: string}>
|
|
96
|
+
>(
|
|
97
|
+
{
|
|
98
|
+
paging: {pageNumber: 1, pageSize: 10},
|
|
99
|
+
filterBy: {$objectName},
|
|
100
|
+
},
|
|
91
101
|
$meta,
|
|
92
102
|
);
|
|
93
103
|
assert.ok(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import config from '
|
|
1
|
+
import config from '../../tools/eslint/config.mjs';
|
|
2
2
|
export default config;
|
|
@@ -35,13 +35,14 @@ export default handler(
|
|
|
35
35
|
// 2. Create a `$object` with its `line` detail rows (sibling
|
|
36
36
|
// arrays) — assert both persist.
|
|
37
37
|
async function add$Object(assert: IAssert, {$meta}: {$meta: IMeta}) {
|
|
38
|
+
const $objectName = `ENT-TEST-${Date.now()}`;
|
|
38
39
|
const result = await $subject$ObjectAdd<{
|
|
39
|
-
$object: {$objectId: number; $objectStatus: string};
|
|
40
|
+
$object: {$objectId: number; $objectStatus: string; $objectName: string};
|
|
40
41
|
line: Array<{lineId: number; lineName: string}>;
|
|
41
42
|
}>(
|
|
42
43
|
{
|
|
43
44
|
$object: {
|
|
44
|
-
$objectName
|
|
45
|
+
$objectName,
|
|
45
46
|
$objectStatus: 'draft',
|
|
46
47
|
},
|
|
47
48
|
line: [
|
|
@@ -54,7 +55,7 @@ export default handler(
|
|
|
54
55
|
assert.ok(result.$object.$objectId, '$object add succeeds');
|
|
55
56
|
assert.equal(result.$object.$objectStatus, 'draft', '$object status is draft');
|
|
56
57
|
assert.equal(result.line?.length, 2, 'two detail rows created');
|
|
57
|
-
return result.$object;
|
|
58
|
+
return {...result.$object, $objectName};
|
|
58
59
|
},
|
|
59
60
|
|
|
60
61
|
// 3. Find `$objects` — the added one must be in the result set.
|
|
@@ -65,13 +66,23 @@ export default handler(
|
|
|
65
66
|
add$Object: created,
|
|
66
67
|
}: {
|
|
67
68
|
$meta: IMeta;
|
|
68
|
-
add$Object: Awaited<{$objectId: number}>;
|
|
69
|
+
add$Object: Awaited<{$objectId: number; $objectName: string}>;
|
|
69
70
|
},
|
|
70
71
|
) {
|
|
71
72
|
const $object = await created;
|
|
73
|
+
// Filter by the row this run created instead of paging the
|
|
74
|
+
// whole table: the table keeps growing between runs, so page
|
|
75
|
+
// 1 of an unfiltered find stops containing the new row once
|
|
76
|
+
// there are more rows than pageSize.
|
|
72
77
|
const result = await $subject$ObjectFind<
|
|
73
78
|
Array<{$objectId: number; $objectName: string}>
|
|
74
|
-
>(
|
|
79
|
+
>(
|
|
80
|
+
{
|
|
81
|
+
paging: {pageNumber: 1, pageSize: 10},
|
|
82
|
+
filterBy: {$objectName: $object.$objectName},
|
|
83
|
+
},
|
|
84
|
+
$meta,
|
|
85
|
+
);
|
|
75
86
|
assert.ok(
|
|
76
87
|
result.some(item => item.$objectId === $object.$objectId),
|
|
77
88
|
'$object find returns the added $object',
|