@sixbell-telco/sdk-tools 0.1.0 → 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 +12 -0
- package/README.md +1 -1
- package/package.json +7 -2
- package/src/check/wiring.mjs +42 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ 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
|
+
|
|
16
|
+
## [0.1.1] - 2026-11-13
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- `npx @sixbell-telco/sdk-tools` works outside an app (`init` in an empty folder, any command run before the tools are installed): the `@sixbell-telco/sdk` peer is optional, so npx no longer installs an SDK whose Angular peers failed to resolve (ERESOLVE). The tools read the SDK installed in the app, as before
|
|
21
|
+
|
|
10
22
|
## [0.1.0] - 2026-11-13
|
|
11
23
|
|
|
12
24
|
First release. Needs Node 22.12+ or 24, Angular 19 and `@sixbell-telco/sdk` 4.6.0 or later; depends on the exact `@sixbell-telco/eslint-plugin-sdk` version it was tested with.
|
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
|
|
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.
|
|
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": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
31
|
-
"@sixbell-telco/eslint-plugin-sdk": "0.1.
|
|
31
|
+
"@sixbell-telco/eslint-plugin-sdk": "0.1.1",
|
|
32
32
|
"angular-eslint": "^19.0.0",
|
|
33
33
|
"eslint": "^9.0.0",
|
|
34
34
|
"shadcn-lint-angular": "0.1.2",
|
|
@@ -41,5 +41,10 @@
|
|
|
41
41
|
"@angular/compiler-cli": "^19.0.0",
|
|
42
42
|
"@sixbell-telco/sdk": ">=4.6.0",
|
|
43
43
|
"typescript": "^5.5.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@sixbell-telco/sdk": {
|
|
47
|
+
"optional": true
|
|
48
|
+
}
|
|
44
49
|
}
|
|
45
50
|
}
|
package/src/check/wiring.mjs
CHANGED
|
@@ -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,
|
|
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 [
|
|
229
|
+
return [
|
|
230
|
+
...pubsub(project),
|
|
231
|
+
...pubsubUnsubscribe(project),
|
|
232
|
+
...(project.role === 'child' ? childConfig(project) : []),
|
|
233
|
+
...staticMenu(project),
|
|
234
|
+
...identity(project),
|
|
235
|
+
];
|
|
198
236
|
}
|