@smartsoft001-mobilems/claude-plugins 2.107.0 → 2.109.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartsoft001-mobilems/claude-plugins",
3
- "version": "2.107.0",
3
+ "version": "2.109.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "mobilems",
3
3
  "description": "MobilEMS-specific Claude Code skills (MuzaCMS / MobileMS indexer API)",
4
- "version": "2.107.0"
4
+ "version": "2.109.0"
5
5
  }
@@ -57,6 +57,10 @@ list — re-implementing framework code is a defect, not a shortcut:
57
57
 
58
58
  | Do not hand-roll | Use |
59
59
  | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
60
+ | The list page logic (first read from `?filter=`/persisted filter, persistence, sort/limit/page, search tab, read guard, list mode, list SEO) | `ArticlesCatalogBaseComponent` (`super({ defaults, persistKey, listPath, searchTab, seo })`) on `createCatalog`; cycle tags: `createArticleCycleTags(this.catalog)` |
61
+ | The details page logic (SEO + SSR SEO, parent title, scroll, visit counter, widgets, authors, cycle tags) | `ArticleDetailsBaseComponent`; related module: `createArticleRelated(id)` |
62
+ | Card logic (image, authors, tags, `?filter=` links) and `logVisit` / `related` HTTP calls | `ArticleCardBaseComponent`; `ArticlesService.logVisit` / `getRelated` |
63
+ | A `Masonry` `useFactory` in the module | `provideBrowserMasonry()` |
60
64
  | a masonry grid (`new Masonry(...)`, per-page masonry JS/CSS) | `<smart-mobilems-masonry-grid>` (`MasonryGridComponent`) with a `#masonryContentTpl`; the `Masonry` provider only feeds it |
61
65
  | filter state / hand-built `query` arrays | `FiltersBaseComponent<Article>` + its `FiltersContext` accessors (`searchText`, `authors`, `cycles`, `publicationDateFrom/To`, `page`, `sort`, …) |
62
66
  | list/detail plumbing (facade wiring, id-from-route, PDF) | the `ArticlesListComponent` / `ArticlesItemComponent` base classes |
@@ -137,6 +141,6 @@ article-module-specific ones:
137
141
 
138
142
  - One run builds one named article module. Run the skill again — with a different name + template — for
139
143
  each additional content type the project needs.
140
- - Article modules reuse the foundation's generic `IArticle` model and the foundation's news carousel —
144
+ - Article modules reuse the foundation's generic `IArticleListItem` model (`@smartsoft001-mobilems/angular`) and the foundation's news carousel —
141
145
  this skill does not rebuild them.
142
146
  - Bundled `references/` + `scripts/` ship automatically. Do not hand-edit `plugin.json`.
@@ -23,9 +23,9 @@ export * from './<name>-grid-item';
23
23
  export * from './<name>-list-item';
24
24
  ```
25
25
 
26
- These render an `Article` (via the foundation's generic `IArticle` model), so they depend on
26
+ These render an `Article` (via the framework's generic `IArticleListItem` model), so they depend on
27
27
  `@smartsoft001-mobilems/articles-domain` — which this skill installs. There is no module-specific
28
- model type to add (contrast `mobilems-objects`, which adds `ISpecificObject` to `objects.model.ts`).
28
+ model type to add.
29
29
 
30
30
  ## Optional: article gallery widget
31
31
 
@@ -67,15 +67,15 @@ README) — never a per-module copy. `scripts/verify-module.sh` fails the run on
67
67
  `apps/web/src/app/app.routes.ts` and a matching child under the `wyszukaj/:text` search route.
68
68
  4. **Objects shared components** — see `references/shared-components.md`: build `objects-grid-item`,
69
69
  `objects-list-item`, and the object gallery widget (`widget/gallery-object`) in the shared lib +
70
- export them; register the object gallery widget in the widget content-type map (`GALLERY_OBJECT`);
71
- and add `ISpecificObject` (extends `MsObject`) to `models/objects.model.ts`.
70
+ export them; and register the object gallery widget in the widget content-type map (`GALLERY_OBJECT`).
71
+ `ISpecificObject` and the filter models come from `@smartsoft001-mobilems/objects-shell-angular`.
72
72
  5. **Translations** — copy the module's translation groups (`OBJECTS`, `DETAILS_PAGE`, `GALLERY`) from the reference
73
73
  repo's `apps/web/public/translations.json` into the app's file, for BOTH `pl` and `en`.
74
74
  Complete group = every reference key present; every key referenced in the module's code
75
75
  must exist in both languages — a raw `GROUP.key` rendered in the UI is a defect.
76
76
  6. **Verify** — run `REF_ROOT=<reference-repo> scripts/verify-module.sh <workspace-root> <PREFIX>`: asserts the lib exists, the
77
77
  `obiekty` route is registered (top-level + search child), the objects shared components are built
78
- and exported, the widget map registers the object gallery widget, and `ISpecificObject` is present.
78
+ and exported, the widget map registers the object gallery widget, and no local `objects.model.ts` exists.
79
79
  Fix and re-run.
80
80
 
81
81
  ## Known pitfalls (fix while copying, not after)
@@ -43,27 +43,15 @@ import { WidgetGalleryObjectComponent } from './gallery-object/widget-gallery-ob
43
43
  The widget container renders sub-widgets via `NgComponentOutlet`, so the gallery widget goes in the
44
44
  type-map only — it does **not** go in the container's `imports` array.
45
45
 
46
- ## 3. Object model type
46
+ ## 3. Object model types — framework
47
47
 
48
- `models/objects.model.ts` holds the foundation model types plus the object-specific `ISpecificObject`,
49
- which extends `MsObject`. Add the import and the **full** interface — copy `ISpecificObject` verbatim
50
- from the reference's `models/objects.model.ts` (it has a real field set; do not leave it as an empty
51
- stub, or the objects `description-container` component won't compile):
52
-
53
- ```ts
54
- import { MsObject } from '@smartsoft001-mobilems/objects-domain';
55
- // …
56
- export interface ISpecificObject extends MsObject {
57
- // …copy the full field set from the reference objects.model.ts…
58
- }
59
- ```
60
-
61
- `ISpecificObject` is consumed by the objects `description-container` component, so it must be present
62
- (with its real fields) before that compiles. Note `verify-module.sh` only checks the interface
63
- exists — it can't tell a stub from the real thing, so copy the fields.
48
+ `ISpecificObject` (extends `MsObject`, used by the `description-container` component) and the filter
49
+ models (`SortType`, `IKeyValue`, `AdvancedFilterType`, `FormFeatureType`, `FileType`,
50
+ `MULTIMEDIA_DICTIONARY`, …) are exported by `@smartsoft001-mobilems/objects-shell-angular`. Import
51
+ them from there; do not create `models/objects.model.ts` (reference repos still have one — re-point its
52
+ imports, and rename `KeyValue` → `IKeyValue`, `MultimediaDictionaryItem` → `IMultimediaDictionaryItem`).
64
53
 
65
54
  ## Verify
66
55
 
67
56
  `scripts/verify-module.sh` checks the two card components + the gallery widget exist and are exported,
68
- the widget map registers `WidgetGalleryObjectComponent`, and `ISpecificObject` is present in
69
- `objects.model.ts`.
57
+ and the widget map registers `WidgetGalleryObjectComponent`.
@@ -3,7 +3,7 @@
3
3
  # verify-module.sh <workspace-root> <PREFIX>
4
4
  #
5
5
  # Post-condition check for mobilems-objects: library created, route registered (top-level + search
6
- # child), objects shared components built + wired into the widget map + objects.model. bash 3.2 safe.
6
+ # child), objects shared components built + wired into the widget map; no local objects.model. bash 3.2 safe.
7
7
  set -eu
8
8
 
9
9
  ROOT="${1:?usage: verify-module.sh <workspace-root> <PREFIX>}"
@@ -40,8 +40,7 @@ echo "== Widget map + object model =="
40
40
  WID="$COMP/widget/widget.component.ts"
41
41
  grep -q "WidgetGalleryObjectComponent" "$WID" && pass "object gallery widget registered in widget map" || bad "object gallery widget not in widget map"
42
42
  OBJM=libs/shared/angular/src/lib/models/objects.model.ts
43
- grep -q "objects-domain" "$OBJM" && pass "objects.model imports MsObject" || bad "objects.model MsObject import missing"
44
- grep -qE "interface ISpecificObject" "$OBJM" && pass "ISpecificObject present" || bad "ISpecificObject missing"
43
+ [ ! -f "$OBJM" ] && pass "no local objects.model.ts (framework objects-shell-angular)" || bad "$OBJM duplicates @smartsoft001-mobilems/objects-shell-angular models — import them from there"
45
44
 
46
45
  echo "== Deps =="
47
46
  grep -q "@smartsoft001-mobilems/objects-domain" package.json && pass "objects-domain dep" || bad "objects-domain dep missing"
@@ -104,8 +104,9 @@ stylesheet is pure CSS — copying it verbatim is safe even before the component
104
104
 
105
105
  ### 5. Runtime env + entry files on the framework
106
106
 
107
- Per `references/server-env.md`: add `multimediaUrl` to `environment.ts`/`.prod.ts` and
108
- `EnvironmentService`, then **overwrite** the three base entry files with the framework-backed ones —
107
+ Per `references/server-env.md`: replace `environment.ts` with `createMobilemsEnvironment()` (delete
108
+ `environment.prod.ts` and its `fileReplacements`), take `EnvironmentService` from the framework
109
+ (`env-init.ts` calls `EnvironmentService.initFromProcessEnv(environment)`), then **overwrite** the three base entry files with the framework-backed ones —
109
110
  `main.ts` (`bootstrapApplication` from `@smartsoft001-mobilems/angular/bootstrap`, registers masonry
110
111
  on `window`), `main.server.ts` (`bootstrapServerApplication` from
111
112
  `@smartsoft001-mobilems/angular/bootstrap/server`; `./env-init` stays the first import) and
@@ -128,10 +129,11 @@ component that depends only on Angular + the framework packages + other foundati
128
129
  Run `python3 scripts/classify-shared-components.py` against the reference's
129
130
  `libs/shared/angular/src/lib/components` to list which shared components are FOUNDATION (build here)
130
131
  vs FEATURE-OWNED (built by a module skill, because they import a feature package). Build the
131
- foundation components (including the home-page carousels) + all services/pipes/directives/tools/models
132
+ foundation components (including the home-page carousels) + the app-only services/pipes/tools
132
133
 
133
134
  - `configs.module.ts`, thread `<PREFIX>`, export them from the barrels, and build the `widget`
134
- container + `models/objects.model.ts` with their foundation parts. A shared component that imports a
135
+ container. Models, the common pipes/directives/services/tools and the objects filter models are
136
+ framework exports (`references/shared-lib.md`) — never copy them. A shared component that imports a
135
137
  feature domain package is feature code — a module skill builds it.
136
138
 
137
139
  ### 8. App shell + static pages + routes
@@ -8,7 +8,7 @@ are overwritten in step 5 (`references/server-env.md` §3).
8
8
  The framework provides the whole provider set (`provideMobilemsCore()`: hydration, zoneless, router,
9
9
  HttpClient + the MobilEMS interceptors, NgRx, Masonry, ngx-translate, `SharedModule.forRoot`) and the app
10
10
  plumbing (`provideMobilemsApp()`: language, translations fetch, config load, SEO constants, skip links,
11
- focus). Only `environment` / `EnvironmentService` come from the shared lib (step 7). Museum-specific
11
+ focus). Only `environment` comes from the shared lib (step 5); `EnvironmentService` is a framework export. Museum-specific
12
12
  interceptors (e.g. a JWT one) go through `provideMobilemsCore({ interceptors: [...] })`.
13
13
 
14
14
  ```ts
@@ -21,12 +21,13 @@ import {
21
21
  import { provideStoreDevtools } from '@ngrx/store-devtools';
22
22
  import {
23
23
  ISearchData,
24
+ EnvironmentService,
24
25
  provideMobilemsApp,
25
26
  provideMobilemsCore,
26
27
  SEARCH_CONFIG_TOKEN,
27
28
  } from '@smartsoft001-mobilems/angular';
28
29
 
29
- import { environment, EnvironmentService } from '@<PREFIX>/angular';
30
+ import { environment } from '@<PREFIX>/angular';
30
31
 
31
32
  import { appRoutes } from './app.routes';
32
33
 
@@ -42,7 +43,7 @@ export const appConfig: ApplicationConfig = {
42
43
  },
43
44
  }),
44
45
  provideMobilemsApp({
45
- version: environment.version,
46
+ environment, // provides MOBILEMS_ENVIRONMENT; `version` defaults to environment.version
46
47
  languages: { available: ['pl', 'en'], default: 'pl' },
47
48
  skipLinks: {
48
49
  home: [
@@ -1,30 +1,44 @@
1
1
  # Runtime env delta — multimediaUrl + framework entry files
2
2
 
3
3
  The base shipped `environment.{ts,prod.ts}`, `EnvironmentService`, a `server.ts` with `/env.js`, and
4
- the SSRF allowed-hosts list — all keyed on `API_URL` / `SITE_URL` / `APP_VERSION` only. MobilEMS adds
5
- a **`multimediaUrl`** key (media/CDN host), and replaces the three entry files (`main.ts`,
4
+ the SSRF allowed-hosts list — all keyed on `API_URL` / `SITE_URL` / `APP_VERSION` only. MobilEMS swaps
5
+ the environment for the framework one (which adds the **`multimediaUrl`** media/CDN key), and replaces the three entry files (`main.ts`,
6
6
  `main.server.ts`, `server.ts`) with thin wrappers over the framework entry points (section 3).
7
7
 
8
- ## 1. `libs/shared/angular/src/lib/environments/environment.ts` + `environment.prod.ts`
8
+ ## 1. `libs/shared/angular/src/lib/environments/environment.ts` — `createMobilemsEnvironment`
9
9
 
10
- Add the `multimediaUrl` field to **both** files, mirroring the existing keys:
10
+ Replace the base `environment.ts` with the framework factory and **delete `environment.prod.ts`** plus
11
+ its `fileReplacements` entry in `apps/web/project.json` (`production` is `!isDevMode()`):
11
12
 
12
13
  ```ts
13
- multimediaUrl:
14
- typeof window !== 'undefined' && (window as any)['env']
15
- ? (window as any)['env']['multimediaUrl']
16
- : process.env['MULTIMEDIA_URL'],
14
+ import { createMobilemsEnvironment } from '@smartsoft001-mobilems/angular';
15
+
16
+ /** Runtime config: `window.env` in the browser, `process.env` on the server. */
17
+ export const environment = createMobilemsEnvironment();
17
18
  ```
18
19
 
19
- (Append after `siteUrl`. In reference mode the copied shared lib already carries this — verify it's
20
- present rather than duplicating.)
20
+ It carries `production`, `version` (`APP_VERSION`, then `VERSION`), `apiUrl`, `siteUrl`,
21
+ `multimediaUrl` and `useLocalTranslations` — the same keys `/env.js` serves. A museum-specific key goes
22
+ in the type argument and the definition map, e.g.
23
+ `createMobilemsEnvironment<{ gtmId: string }>({ gtmId: { env: 'GTM_ID' } })` (mirror it in
24
+ `createMobilemsServer({ env })`, section 3c).
25
+
26
+ ## 2. `EnvironmentService` — from the framework
21
27
 
22
- ## 2. `EnvironmentService` (shared lib)
28
+ Delete the base `EnvironmentService` from the shared lib and import it from
29
+ `@smartsoft001-mobilems/angular`. `apps/web/src/env-init.ts` becomes:
30
+
31
+ ```ts
32
+ import { EnvironmentService } from '@smartsoft001-mobilems/angular';
33
+
34
+ import { environment } from '@<PREFIX>/angular';
35
+
36
+ EnvironmentService.initFromProcessEnv(environment);
37
+ ```
23
38
 
24
- In `EnvironmentService.initFromProcessEnv()` and `init()`, propagate `multimediaUrl` alongside
25
- `apiUrl`/`siteUrl`/`version` (set from `process.env['MULTIMEDIA_URL']` on the server; copy from the
26
- transfer-state / `window.env` on the client). In reference mode this comes with the copied service —
27
- just confirm it.
39
+ `provideMobilemsApp({ environment, … })` provides `MOBILEMS_ENVIRONMENT`, which `init()` (the app
40
+ initializer in `app.config.ts`) and the framework services read. The shared lib keeps exporting only
41
+ `environment`.
28
42
 
29
43
  ## 3. Entry files — replace the base versions with the framework ones
30
44
 
@@ -10,8 +10,8 @@ Filter components are **not** on that list. Each module builds its own by extend
10
10
  `FiltersBaseComponent<T>` (see `SKILL.md` → "Framework first"); the shared lib holds no filter
11
11
  implementation to copy.
12
12
 
13
- The library starts as the base shell that exports only `environment` + `EnvironmentService` with
14
- empty `lib/` placeholder dirs — fill those dirs with the **foundation shared components**.
13
+ The library starts as the base shell that exports only `environment` (built with the framework's
14
+ `createMobilemsEnvironment`, see `server-env.md`) with empty `lib/` placeholder dirs — fill those dirs with the **foundation shared components**.
15
15
 
16
16
  ## Foundation shared components vs feature shared components
17
17
 
@@ -29,8 +29,8 @@ The shared library contains two kinds of shared component, separated by a simple
29
29
 
30
30
  This rule keeps the layering clean and lets the foundation library build on its own. The home-page
31
31
  carousels (`new-objects-carousel`, `news-carousel`, `partners-carousel`) and the home page are
32
- **foundation** shared components — they take `IObject` / `IArticle` / `IPartner` from the shared
33
- `models/data.interface.ts` and never import a feature package, so build them here.
32
+ **foundation** shared components — they take `IObject` / `IArticleListItem` / `IPartner` from
33
+ `@smartsoft001-mobilems/angular` and never import a feature package, so build them here.
34
34
 
35
35
  ## Identify the foundation set
36
36
 
@@ -74,22 +74,22 @@ Build it registering only the **foundation widgets** — `text`, `image`, `video
74
74
  and type-map entries when they build those widgets. Build the widget barrel
75
75
  (`components/widget/index.ts`) exporting the foundation widgets only.
76
76
 
77
- ## models/objects.model.ts
77
+ ## Models — framework, not the lib
78
78
 
79
- This file holds foundation model types the shared components use (`SortType`, `KeyValue` → `dropdown`,
80
- `AdvancedFilterType` → `filter-dictionary-input`, `FileType`, `MULTIMEDIA_DICTIONARY`,
81
- `IModel3DObject`, `IAnimationObject`, …). Build it with those types. The one object-specific type,
82
- `ISpecificObject extends MsObject`, is a feature type — the `mobilems-objects` skill adds it (with
83
- the `MsObject` import) when it builds the objects module. Keep `models/index.ts` exporting
84
- `./objects.model`.
79
+ The museum API models (`IObject`, `IImage`, `IDictionary`, `IDictionaryEntry`, `IArticleListItem`,
80
+ `IAuthorDetails`, `IPartner`, …, `IHomePage`, `PARENT_TITLE_TOKEN`) come from
81
+ `@smartsoft001-mobilems/angular`; the objects filter models (`SortType`, `IKeyValue`,
82
+ `AdvancedFilterType`, `FormFeatureType`, `FileType`, `MULTIMEDIA_DICTIONARY`, `ISpecificObject`,
83
+ `IModel3DObject`, `IAnimationObject`) from `@smartsoft001-mobilems/objects-shell-angular`. Do **not**
84
+ create `models/data.interface.ts`, `models/home-page.interface.ts` or `models/objects.model.ts`.
85
+ Reference repos still carry them under the old names `IDictionaryItem`, `IArticle`, `IAuthor` — use
86
+ the framework names.
85
87
 
86
88
  ## The rest of the lib
87
89
 
88
- Build `services/`, `pipes/`, `directives/`, `tools/`, `models/` (incl. `data.interface.ts` with
89
- `IObject`/`IArticle`/`IPartner`), `interceptors/`, `environments/` (with the `multimediaUrl` field —
90
- see `server-env.md`), and `configs.module.ts`. These are foundation code. Confirm with the
91
- build-safety grep below; if any of these files imports a feature package on your reference, it is
92
- feature code and belongs to a module skill — leave it out.
90
+ Build the app-only `services/`, `pipes/`, `tools/`, `models/`, and `configs.module.ts`. These are
91
+ foundation code. Confirm with the build-safety grep below; if any of these files imports a feature
92
+ package on your reference, it is feature code and belongs to a module skill — leave it out.
93
93
 
94
94
  **Build each of these ONCE here — module skills reuse them and must never re-create a local copy.**
95
95
  Check the framework catalog (`node_modules/@smartsoft001-mobilems/angular/README.md`, in-repo
@@ -99,30 +99,32 @@ first: if the framework already exports it — `MasonryGridComponent` and `Filte
99
99
  `SearchService`, `WcagService`, `ContrastService`, `StyleService`, `ModalService`,
100
100
  `ClickOutsideDirective`, `HoverDirective`, `ScrollableDirective`, … — import it instead of copying
101
101
  the reference's version. The reference repo predates parts of the framework, so several of its shared
102
- components duplicate exports that now exist; copying those is the single most common defect in this
103
- step. The app-level set the framework does **not** provide, and that the module skills expect to find
104
- here:
102
+ files duplicate exports that now exist; copying those is the single most common defect in this step.
105
103
 
106
- | Kind | Expected members |
107
- | ------------ | ----------------------------------------------------------------------------------------------------------------- |
108
- | pipes | `altText`, `fileUrl`, `truncateHtml` (`capitalize` is a framework pipe) |
109
- | tools | `isInternalLink`, `normalizeUrl`, `stripHtml` (+ the shared `tools.ts` helpers) |
110
- | directives | `externalLink` |
111
- | interceptors | none — `LanguageInterceptor`, `PreviewAuthInterceptor`, `SsrTimeoutInterceptor`, `DedupeRequestInterceptor` are framework classes |
112
- | services | `filter-persistence`, `orientation`, `confirmation-modal`, `contact`, `data`, `environment`, `wcag` (`museum-seo` is the framework `MuseumSeoService`) |
104
+ Framework now — do **not** generate (import from `@smartsoft001-mobilems/angular`):
113
105
 
114
- `local-storage`, `configs-cache`, `museum-seo`, `not-found-content`, the interceptors and `decode-html-entities` are gone: language lives in the framework `TranslationService`
115
- (`setLanguage()` for the header switcher, `currentLanguage` for `museum-seo`), the config cache in
116
- `ConfigsFacade.init()`.
106
+ | Kind | Framework exports |
107
+ | ------------ | ------------------------------------------------------------------------------------------------------------------ |
108
+ | environment | `createMobilemsEnvironment`, `MOBILEMS_ENVIRONMENT`, `EnvironmentService` |
109
+ | pipes | `altText`, `fileUrl`, `backgroundUrl`, `plainText`, `stripAnchors`, `capitalize` |
110
+ | tools | `classifyLink`, `isInternalLink`, `normalizeUrl`, `stripHtml`, `formatNamedEntries`, `normalizeSearchText`, `newTabText`, `pageToOffset`, `decodeHtmlEntities` |
111
+ | directives | `a[smartExternalLink]`, `[smartExternalLinks]`, `[smartFocusTrap]`, `[smartTruncatedTitle]` (references use `app…` — rename the attributes) |
112
+ | services | `ConfirmationModalService`, `ExternalLinkConfirmationService`, `FilterPersistenceService`, `OrientationService`, `WcagChangesService`, `ContactService`, `DataService`, `MuseumSeoService` |
113
+ | interceptors | `LanguageInterceptor`, `PreviewAuthInterceptor`, `SsrTimeoutInterceptor`, `DedupeRequestInterceptor` |
117
114
 
118
- Adjust to what the reference actually ships, but keep the rule: one implementation, in this lib,
119
- exported from the barrel, documented in the app's own README so the module skills can find it.
115
+ What stays in the app lib: the confirmation-modal **component** (markup; it reads
116
+ `ConfirmationModalService`), `truncateHtml`, the `line-height` service of the WCAG panel and any
117
+ museum-only tools. `local-storage`, `configs-cache`, `not-found-content` are gone: language lives in
118
+ the framework `TranslationService`, the config cache in `ConfigsFacade.init()`.
119
+
120
+ Adjust to what the reference actually ships, but keep the rule: one implementation, exported from the
121
+ barrel, documented in the app's own README so the module skills can find it.
120
122
 
121
123
  ## Barrels
122
124
 
123
125
  - `src/index.ts` — the full barrel: re-export `./lib/components`, `./lib/services`,
124
- `./lib/configs.module`, `./lib/models`, `./lib/pipes`, `./lib/tools`, `./lib/interceptors`,
125
- `./lib/directives`, `./lib/environments`.
126
+ `./lib/configs.module`, `./lib/models`, `./lib/pipes`, `./lib/tools`, `./lib/environments` (only
127
+ the folders that still have files).
126
128
  - `components/index.ts` — export the foundation shared components (and keep the `COMPONENTS` array,
127
129
  which holds `AppComponent`/`FooterComponent`/`HeaderComponent`). Module skills add their feature
128
130
  shared components' exports when they build them.
@@ -147,8 +149,8 @@ grep -rlnE "from '@[^']*/(objects|articles|public-collections)-(domain|shell-ang
147
149
  libs/shared/angular/src
148
150
  ```
149
151
 
150
- `verify-init.sh` runs it, plus checks the `widget` container imports no gallery-object/article and
151
- `objects.model.ts` carries no `MsObject` import.
152
+ `verify-init.sh` runs it, plus checks the `widget` container imports no gallery-object/article and that
153
+ no local copy of a framework model/service exists.
152
154
 
153
155
  ## project.json / build config
154
156
 
@@ -25,7 +25,10 @@ grep -q "@smartsoft001-mobilems/angular" package.json && pass "mobilems framewor
25
25
  grep -q "@ngrx/store" package.json && pass "ngrx dep" || bad "@ngrx/store in package.json"
26
26
  grep -q "SharedModule.forRoot" apps/web/src/app/app.config.ts && pass "SharedModule.forRoot in app.config" || bad "SharedModule.forRoot in app.config.ts"
27
27
  grep -q "SEARCH_CONFIG_TOKEN" apps/web/src/app/app.config.ts && pass "SEARCH_CONFIG_TOKEN" || bad "SEARCH_CONFIG_TOKEN in app.config.ts"
28
- grep -q "multimediaUrl" libs/shared/angular/src/lib/environments/environment.ts && pass "multimediaUrl in environment.ts" || bad "multimediaUrl in libs/shared/angular/src/lib/environments/environment.ts"
28
+ ENVF=libs/shared/angular/src/lib/environments/environment.ts
29
+ grep -q "createMobilemsEnvironment" "$ENVF" && pass "environment.ts uses createMobilemsEnvironment" || bad "$ENVF must export createMobilemsEnvironment(...) (references/server-env.md §1)"
30
+ [ ! -f libs/shared/angular/src/lib/environments/environment.prod.ts ] && pass "no environment.prod.ts" || bad "delete environment.prod.ts and its fileReplacements (production = !isDevMode())"
31
+ grep -q "initFromProcessEnv(environment)" apps/web/src/env-init.ts && pass "env-init passes environment to EnvironmentService" || bad "apps/web/src/env-init.ts must call EnvironmentService.initFromProcessEnv(environment)"
29
32
  # the three entry files are thin wrappers over the framework entry points (references/server-env.md §3)
30
33
  grep -q "@smartsoft001-mobilems/angular/bootstrap'" apps/web/src/main.ts && pass "main.ts uses bootstrapApplication from @smartsoft001-mobilems/angular/bootstrap" || bad "main.ts must import bootstrapApplication from @smartsoft001-mobilems/angular/bootstrap (registers masonry on window)"
31
34
  grep -q "@smartsoft001-mobilems/angular/bootstrap/server" apps/web/src/main.server.ts && pass "main.server.ts uses bootstrapServerApplication" || bad "main.server.ts must import bootstrapServerApplication from @smartsoft001-mobilems/angular/bootstrap/server"
@@ -102,12 +105,18 @@ if [ -f "$WID" ]; then
102
105
  else
103
106
  bad "widget container missing"
104
107
  fi
105
- # objects.model holds only the foundation model types (the object-specific ISpecificObject is feature code)
106
- OBJMODEL=libs/shared/angular/src/lib/models/objects.model.ts
107
- if [ -f "$OBJMODEL" ]; then
108
- grep -qE "from '[^']*objects-domain'" "$OBJMODEL" && bad "objects.model imports MsObject — foundation holds only the generic types" || pass "objects.model holds foundation types only"
109
- grep -qE "AdvancedFilterType|KeyValue" "$OBJMODEL" && pass "foundation model types present" || bad "foundation model types missing from objects.model.ts"
110
- fi
108
+ # models, common pipes/directives/services are framework exports — no local copies (references/shared-lib.md)
109
+ LIB=libs/shared/angular/src/lib
110
+ for f in objects.model.ts data.interface.ts home-page.interface.ts environment.service.ts \
111
+ data.service.ts confirmation-modal.service.ts external-link-confirmation.service.ts \
112
+ filter-persistence.service.ts orientation.service.ts contact.service.ts \
113
+ external-link.directive.ts external-links.directive.ts focus-trap.directive.ts \
114
+ alt-text.pipe.ts file-url.pipe.ts; do
115
+ # flat (services/x.ts) or foldered (services/x/x.ts) — any location in the lib
116
+ dup=$(find "$LIB" -name "$f" -not -name '*.spec.ts' 2>/dev/null | head -1)
117
+ [ -n "$dup" ] && bad "$dup duplicates a framework export — import it from @smartsoft001-mobilems/*" || true
118
+ done
119
+ pass "no local copies of framework models/services checked"
111
120
 
112
121
  echo "== Build-safety invariant: shared lib imports no feature package =="
113
122
  LEAK="$(grep -rlnE "from '@[^']*/(objects|articles|public-collections)-(domain|shell-angular|shell-dtos)'" libs/shared/angular/src 2>/dev/null || true)"