@vit-foundation/ui 0.18.0 → 0.20.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/README.md CHANGED
@@ -31,6 +31,7 @@ Everything exports flat from the root, and again grouped by role:
31
31
  | [`/community`](./docs/components/community.md) | AuthPageShell, LoginForm, SignupForm, GoogleAuthForm, AccountPanel, NewsletterSignup, CommentSection, ReactionBar, ContactForm |
32
32
  | [`/edit`](./docs/edit-mode.md) | Editable, setEditAdapter/getEditAdapter, descriptors and helpers, collectionEditing, LocalizedText |
33
33
  | [`/config`](./docs/getting-started.md#wiring-an-app-uiprovider) | UiProvider, UiConfig, the locale set, the default Catalan messages |
34
+ | `/contract` | The component-free half: LOCALES, BASE_LOCALE, localize, REACTIONS and the edit-descriptor types — the one subpath a host may import from SERVER code |
34
35
  | `/testing` | createRemoteFormMock — the remote-form stand-in for stories and tests |
35
36
 
36
37
  Every component renders standalone (Catalan copy, identity hrefs); an app
@@ -83,5 +84,8 @@ diffable against history. The public structure is the semantic entry points
83
84
  above, assembled in `src/lib/{primitives,chrome,content-components,community}.ts`
84
85
  and `src/lib/forms/index.ts`.
85
86
 
86
- Releases: bump with `npm version`, push the `v*` tag, and the release
87
- workflow publishes to npm (requires the `NPM_TOKEN` secret).
87
+ Releases are MANUAL: bump with `npm version`, then `npm publish`. The
88
+ workflow this paragraph used to describe fired on every `v*` tag, had no
89
+ `NPM_TOKEN` and no lint, check or test step, so it failed every time and was
90
+ deleted; `prepublishOnly` (lint, check, unit tests) is the only publish gate
91
+ now. Push the tag by all means — nothing reads it.
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The contract, without the components: the vocabularies and the one reading
3
+ * rule a host needs on the SERVER, where a `.svelte` import cannot go.
4
+ *
5
+ * Every other subpath mixes the two. `./edit` exports `localize` beside
6
+ * `Editable.svelte`; `./config` exports `LOCALES` and `BASE_LOCALE` beside
7
+ * `UiProvider.svelte`; `./content` exports `REACTIONS` beside the cards. A
8
+ * host whose server code wants those VALUES has to import the barrel that
9
+ * drags a component graph into a server bundle, so vit-brain imported the
10
+ * types only and restated the values: `WEBSITE_LOCALES`, `CANONICAL_LOCALE`,
11
+ * its own `REACTIONS`, and a `hasLocalizedText` re-derived from `localize`'s
12
+ * body — four facts this package owns, one of them (the canonical locale)
13
+ * with no binding at all.
14
+ *
15
+ * So this subpath is the seam that restatement was standing in for. It is
16
+ * component-free BY TEST (`contract.test.ts` walks its import graph), which
17
+ * is what makes it a promise rather than a description: adding a `.svelte`
18
+ * anywhere beneath it fails here rather than in a consumer's server build.
19
+ *
20
+ * It adds nothing. Every name below is already exported from a semantic
21
+ * subpath and stays there — this is a second door into the same rooms, not a
22
+ * new floor, and the barrel remains the surface a component host reads.
23
+ */
24
+ export { LOCALES, BASE_LOCALE } from './config/types.js';
25
+ export type { Locale, NotParameterized, ParameterizedKey, ParameterlessKey, SiteLink, UiMessages } from './config/types.js';
26
+ export { localize } from './edit/types.js';
27
+ export type { CollectionRef, ContentRef, EditableEntity, EditDescriptor, EntityOp, LocalizedText, PropertyDescriptor, PropertyOption, PropertyType, PropertyValue } from './edit/types.js';
28
+ export { REACTIONS } from './content/types.js';
29
+ export type { Reaction, ReactionSummary, SortDirection } from './content/types.js';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The contract, without the components: the vocabularies and the one reading
3
+ * rule a host needs on the SERVER, where a `.svelte` import cannot go.
4
+ *
5
+ * Every other subpath mixes the two. `./edit` exports `localize` beside
6
+ * `Editable.svelte`; `./config` exports `LOCALES` and `BASE_LOCALE` beside
7
+ * `UiProvider.svelte`; `./content` exports `REACTIONS` beside the cards. A
8
+ * host whose server code wants those VALUES has to import the barrel that
9
+ * drags a component graph into a server bundle, so vit-brain imported the
10
+ * types only and restated the values: `WEBSITE_LOCALES`, `CANONICAL_LOCALE`,
11
+ * its own `REACTIONS`, and a `hasLocalizedText` re-derived from `localize`'s
12
+ * body — four facts this package owns, one of them (the canonical locale)
13
+ * with no binding at all.
14
+ *
15
+ * So this subpath is the seam that restatement was standing in for. It is
16
+ * component-free BY TEST (`contract.test.ts` walks its import graph), which
17
+ * is what makes it a promise rather than a description: adding a `.svelte`
18
+ * anywhere beneath it fails here rather than in a consumer's server build.
19
+ *
20
+ * It adds nothing. Every name below is already exported from a semantic
21
+ * subpath and stays there — this is a second door into the same rooms, not a
22
+ * new floor, and the barrel remains the surface a component host reads.
23
+ */
24
+ export { LOCALES, BASE_LOCALE } from './config/types.js';
25
+ export { localize } from './edit/types.js';
26
+ export { REACTIONS } from './content/types.js';
package/dist/index.d.ts CHANGED
@@ -6,4 +6,4 @@ export * from './admin.js';
6
6
  export * from './forms/index.js';
7
7
  export * from './config/index.js';
8
8
  export * from './edit/index.js';
9
- export { buildQueryString, isExternalUrl, isInternalPath, isPathUnder } from './utils/paths.js';
9
+ export { buildQueryString } from './utils/paths.js';
package/dist/index.js CHANGED
@@ -12,5 +12,13 @@ export * from './forms/index.js';
12
12
  // App wiring: configuration context and the edit-mode contract.
13
13
  export * from './config/index.js';
14
14
  export * from './edit/index.js';
15
- // Path utilities shared with host apps.
16
- export { buildQueryString, isExternalUrl, isInternalPath, isPathUnder } from './utils/paths.js';
15
+ // The one path utility a host actually reads: fndvit-website re-exports
16
+ // `buildQueryString` from its own `utils/nav.ts`, so the URL a list mirrors
17
+ // and the hrefs it renders are spelled by this function in both codebases.
18
+ // The other three are NOT exported. `isInternalPath` and `isExternalUrl` are
19
+ // the destination classifiers `Link` and `TimelineMilestone` branch on, and
20
+ // `isPathUnder` is the prefix match `Nav` and `Sidebar` highlight the current
21
+ // section with — all four in-package readers reach them by deep import, and
22
+ // no host imports any of the three. Exporting them would pin their behaviour
23
+ // into semver for no reader; `paths.test.ts` is what holds them instead.
24
+ export { buildQueryString } from './utils/paths.js';
@@ -5,10 +5,21 @@ import type { SortDirection, WeeklyCardData } from '../content/types.js';
5
5
  * absent. Both halves of the URL contract — this module omitting a default,
6
6
  * the host's query schema supplying one — must name the same values, so a
7
7
  * host derives its schema defaults from here rather than restating them.
8
+ *
9
+ * `pageSize` is here for the same reason one step further out. It is not a
10
+ * URL param: it is what a page of this list HOLDS, which the grid this
11
+ * package renders decides. Every host was spelling its own — fndvit-website
12
+ * as `WEEKLIES_PAGE_SIZE`, vit-brain's mirror as a bare `12` in markup — and
13
+ * the two must agree, because the mirror exists to page the same corpus the
14
+ * site pages. Two repositories that cannot import each other were each
15
+ * holding half of one number. `createWeeklyList` still READS the size from
16
+ * `config.server().pageSize`, so a host may still answer something else; this
17
+ * is the value it should answer unless it means to differ.
8
18
  */
9
19
  export declare const WEEKLY_LIST_DEFAULTS: {
10
20
  readonly sort: "desc";
11
21
  readonly page: 1;
22
+ readonly pageSize: 12;
12
23
  };
13
24
  /** A type alias, not an interface: createUrlFilters needs an index signature. */
14
25
  export type WeeklyListFilters = {
@@ -5,8 +5,18 @@ import { createUrlFilters } from './url-filters.svelte.js';
5
5
  * absent. Both halves of the URL contract — this module omitting a default,
6
6
  * the host's query schema supplying one — must name the same values, so a
7
7
  * host derives its schema defaults from here rather than restating them.
8
+ *
9
+ * `pageSize` is here for the same reason one step further out. It is not a
10
+ * URL param: it is what a page of this list HOLDS, which the grid this
11
+ * package renders decides. Every host was spelling its own — fndvit-website
12
+ * as `WEEKLIES_PAGE_SIZE`, vit-brain's mirror as a bare `12` in markup — and
13
+ * the two must agree, because the mirror exists to page the same corpus the
14
+ * site pages. Two repositories that cannot import each other were each
15
+ * holding half of one number. `createWeeklyList` still READS the size from
16
+ * `config.server().pageSize`, so a host may still answer something else; this
17
+ * is the value it should answer unless it means to differ.
8
18
  */
9
- export const WEEKLY_LIST_DEFAULTS = { sort: 'desc', page: 1 };
19
+ export const WEEKLY_LIST_DEFAULTS = { sort: 'desc', page: 1, pageSize: 12 };
10
20
  /** The index's path, shared by the mirrored URL and the paging hrefs. */
11
21
  const WEEKLIES_PATH = '/weeklies';
12
22
  /**
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@vit-foundation/ui",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
7
7
  "preview": "vite preview",
8
8
  "prepare": "svelte-kit sync || echo ''",
9
9
  "prepack": "svelte-kit sync && svelte-package && publint",
10
- "_comment:prepublishOnly": "Publishing is MANUAL (the release workflow has no NPM_TOKEN and fails on every tag), so the gate belongs on the command that actually publishes. npm runs this before prepack.",
10
+ "_comment:prepublishOnly": "Publishing is MANUAL — the release workflow that fired on every v* tag had no NPM_TOKEN, failed every time, and was deleted, so this is the ONLY publish gate. npm runs it before prepack.",
11
11
  "prepublishOnly": "npm run lint && npm run check && npm run test:unit -- --run",
12
12
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
13
13
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
@@ -69,6 +69,11 @@
69
69
  "svelte": "./dist/edit/index.js",
70
70
  "default": "./dist/edit/index.js"
71
71
  },
72
+ "./contract": {
73
+ "types": "./dist/contract.d.ts",
74
+ "svelte": "./dist/contract.js",
75
+ "default": "./dist/contract.js"
76
+ },
72
77
  "./config": {
73
78
  "types": "./dist/config/index.d.ts",
74
79
  "svelte": "./dist/config/index.js",