@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/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
- if (process.env.CI && !intents.includes('playwright')) {
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
- if (process.env.CI && !intents.includes('playwright')) {
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
  }
@@ -1,52 +1,13 @@
1
- import {globSync} from 'tinyglobby';
2
-
3
1
  /**
4
- * Files always excluded from the `@feasibleone/blong-kopi` scaffolding
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 SINGLE source of truth for "what counts as a template file". It
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 function listTemplateFiles(cwd: string, options: ListTemplateFilesOptions = {}): string[] {
46
- return globSync(['**/*'], {
47
- cwd,
48
- dot: true,
49
- onlyFiles: true,
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: `ENT-BROWSER-${Date.now()}`,
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
- const resultFind = await $subject$ObjectFind<Array<{$objectId: number}>>(
90
- {paging: {pageNumber: 1, pageSize: 100}},
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 '../eslint/config.mjs';
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: `ENT-TEST-${Date.now()}`,
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
- >({paging: {pageNumber: 1, pageSize: 100}}, $meta);
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',