@sixbell-telco/sdk-tools 0.1.1 → 0.1.2

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 CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.2] - 2026-11-18
11
+
12
+ ### Added
13
+
14
+ - **check**: `MFE_PUBSUB_UNSUBSCRIBE_001` flags `PubSub.unsubscribe(<topic>)` (an `*_EVENTS` member or a string) in app code: pubsub-js removes every MFE's subscriber of that topic, so one child leaving a page left the others without `PERMISSIONS.RESPONSE` (SBP-78, Herald's edit buttons hidden until a reload). Unsubscribe the token `PubSub.subscribe` returns
15
+
10
16
  ## [0.1.1] - 2026-11-13
11
17
 
12
18
  ### Fixed
package/README.md CHANGED
@@ -33,7 +33,7 @@ Test and story files (`*.spec.ts`, `*.stories.ts`) are not linted: their templat
33
33
  | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34
34
  | federation | Child: exposes point at a remote shell that renders `MfeShadowShellComponent`; the stylesheet-href build step. Host: remotes wired, no child-only files. dayjs sharing | `MFE_CHILD_003`..`007`, `MFE_CHILD_FEDERATION_001`..`004`, `MFE_HOST_RUNTIME_002`..`005`, `MFE_FEDERATION_DAYJS_001`/`002` |
35
35
  | harness | The child's standalone harness (`MainLayoutComponent`, no remote shell inside) and the kit shell (`st-app-layout`, `provideLayout`, `provideLayoutAccount`, no local layout copies) | `MFE_CHILD_009`..`011`, `MFE_CHILD_HARNESS_001`/`002`, `MFE_CHILD_ROUTE_001`, `MFE_LAYOUT_001`..`003`, `005`, `006`, `008` |
36
- | wiring | Pubsub (child AUTH, host PERMISSIONS), request bypass by context in a child, the static dev menu, starter identity left behind | `MFE_CHILD_PUBSUB_001`, `MFE_HOST_PUBSUB_001`, `MFE_CHILD_CONFIG_001`, `MFE_MENU_001`/`002`, `MFE_GUAS_MENU_003`/`004`, `MFE_FEATURE_MENU_001`, `MFE_IDENTITY_001` |
36
+ | wiring | Pubsub (child AUTH, host PERMISSIONS, unsubscribing a topic instead of a token), request bypass by context in a child, the static dev menu, starter identity left behind | `MFE_CHILD_PUBSUB_001`, `MFE_HOST_PUBSUB_001`, `MFE_PUBSUB_UNSUBSCRIBE_001`, `MFE_CHILD_CONFIG_001`, `MFE_MENU_001`/`002`, `MFE_GUAS_MENU_003`/`004`, `MFE_FEATURE_MENU_001`, `MFE_IDENTITY_001` |
37
37
  | config | npm scripts against `angular.json` configurations and files, the test target, the showcase script, JSON that does not parse | `MFE_PROJECT_SCRIPT_001`, `MFE_PROJECT_TEST_001`, `MFE_SHOWCASE_001`, `MFE_JSON_001` |
38
38
  | i18n | `translation.json` schema and languages, bundles per language, the SDK bundles served from the installed package (not copied) | `MFE_I18N_001`..`009`, `MFE_CHILD_I18N_001`..`005`, `MFE_CHILD_I18N_WARN_001`, `MFE_TRANSLATIONS_001`, `MFE_ASSET_I18N_001`, `MFE_I18N_SDK_001` |
39
39
  | styles | `src/**/*.css` and the theme catalogs: literal colors outside theme definitions (catalogs, `@plugin "daisyui/theme"`, `@theme`), raw shadows and fonts, theme token overrides, legacy names; `.scss`, `.sass` and `.less` files; component styles (inline `styles`, `styleUrl(s)` files): literal colors and `.st-*`/`st-*` selectors (the Tailwind entry and global stylesheets are not component styles); the status-illustration animations in `styles.css` | `DS_COLOR_LITERAL`, `DS_COLOR_PALETTE`, `DS_SHADOW_RAW`, `DS_FONT_FAMILY`, `DS_THEME_TOKEN_OVERRIDE`, `DS_THEME_DUPLICATE`, `DS_MODIFIER_UNSAFE`, `DS_THEME_STALE_IDENTITY`, `DS_SIXBELL_LEGACY`, `DS_POPPINS_LEGACY`, `DS_SCSS_FILE`, `DS_COMPONENT_COLOR_LITERAL`, `DS_KIT_RESTYLE`, `MFE_STATUS_CSS_001` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixbell-telco/sdk-tools",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI and MCP server for apps built with @sixbell-telco/sdk: check templates, imports and types against the installed SDK, and create or upgrade MFEs from their template repos",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Project wiring step: pubsub, host-owned code in a child, the static dev menu and starter leftovers.
3
- * Ids: MFE_CHILD_PUBSUB_001, MFE_HOST_PUBSUB_001, MFE_CHILD_CONFIG_001, MFE_MENU_001/002,
4
- * MFE_GUAS_MENU_003/004, MFE_FEATURE_MENU_001, MFE_IDENTITY_001.
3
+ * Ids: MFE_CHILD_PUBSUB_001, MFE_HOST_PUBSUB_001, MFE_PUBSUB_UNSUBSCRIBE_001, MFE_CHILD_CONFIG_001,
4
+ * MFE_MENU_001/002, MFE_GUAS_MENU_003/004, MFE_FEATURE_MENU_001, MFE_IDENTITY_001.
5
5
  */
6
6
  import { readText, walk } from '../project/project.mjs';
7
- import { finding } from './finding.mjs';
7
+ import { finding, position } from './finding.mjs';
8
8
 
9
9
  /**
10
10
  * @typedef {import('../types.js').Finding} Finding
@@ -59,6 +59,38 @@ function pubsub(project) {
59
59
  return [];
60
60
  }
61
61
 
62
+ /** `PubSub.unsubscribe(<arg>)`; the argument is checked on its own. */
63
+ const UNSUBSCRIBE = /PubSub\.unsubscribe\(\s*([^)]*?)\s*\)/g;
64
+ /** A topic rather than a token: an `*_EVENTS.X` member or a string literal. */
65
+ const TOPIC = /^(?:[A-Z][A-Z0-9_]*_EVENTS\.[A-Z][A-Z0-9_]*|(['"`])[^'"`]*\1)$/;
66
+
67
+ /**
68
+ * MFE_PUBSUB_UNSUBSCRIBE_001: unsubscribe the token `PubSub.subscribe` returned, never a topic. pubsub-js
69
+ * removes every subscriber of a topic, so one child leaving a page deafens the host and every other child
70
+ * (SBP-78: Herald lost PERMISSIONS.RESPONSE and hid its edit buttons until a reload).
71
+ * @param {ProjectInfo} project
72
+ * @returns {Finding[]}
73
+ */
74
+ function pubsubUnsubscribe(project) {
75
+ /** @type {Finding[]} */
76
+ const findings = [];
77
+ for (const file of walk(project.root, 'src', (name) => name.endsWith('.ts') && !name.endsWith('.spec.ts'))) {
78
+ const source = readText(project.root, file) ?? '';
79
+ for (const match of source.matchAll(UNSUBSCRIBE)) {
80
+ if (!TOPIC.test(match[1])) continue;
81
+ findings.push(
82
+ finding(
83
+ 'MFE_PUBSUB_UNSUBSCRIBE_001',
84
+ file,
85
+ `PubSub.unsubscribe(${match[1]}) removes every MFE's subscriber of that topic. Keep the token PubSub.subscribe returns and unsubscribe it.`,
86
+ position(source, match.index ?? 0),
87
+ ),
88
+ );
89
+ }
90
+ }
91
+ return findings;
92
+ }
93
+
62
94
  /**
63
95
  * MFE_CHILD_CONFIG_001: request bypass by context, not by URL, and no host manifest loading in a child.
64
96
  * @param {ProjectInfo} project
@@ -194,5 +226,11 @@ function identity(project) {
194
226
  */
195
227
  export function wiringStep(project) {
196
228
  if (!project.role) return [];
197
- return [...pubsub(project), ...(project.role === 'child' ? childConfig(project) : []), ...staticMenu(project), ...identity(project)];
229
+ return [
230
+ ...pubsub(project),
231
+ ...pubsubUnsubscribe(project),
232
+ ...(project.role === 'child' ? childConfig(project) : []),
233
+ ...staticMenu(project),
234
+ ...identity(project),
235
+ ];
198
236
  }