@byline/cli 4.0.0 → 4.2.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/dist/manifest/deps.d.ts.map +1 -1
- package/dist/manifest/deps.js +6 -0
- package/dist/manifest/deps.js.map +1 -1
- package/dist/phases/scaffold-smoke.test.js +10 -3
- package/dist/phases/scaffold-smoke.test.js.map +1 -1
- package/dist/templates/byline/collection-types.contract.ts +1 -1
- package/dist/templates/byline/collections/index.ts +1 -1
- package/dist/templates/byline/generated/collection-types.ts +14 -6
- package/dist/templates/byline/server.config.ts +8 -1
- package/dist/templates/byline-examples/collection-types.contract.ts +1 -1
- package/dist/templates/byline-examples/collections/docs/hooks.ts +2 -2
- package/dist/templates/byline-examples/collections/docs/schema.ts +1 -1
- package/dist/templates/byline-examples/collections/index.ts +1 -1
- package/dist/templates/byline-examples/generated/collection-types.ts +138 -130
- package/dist/templates/byline-examples/scripts/import-docs.ts +4 -4
- package/dist/templates/byline-examples/scripts/regenerate-media-operation.ts +112 -0
- package/dist/templates/byline-examples/scripts/regenerate-media.ts +126 -90
- package/dist/templates/byline-examples/server.config.ts +11 -4
- package/dist/templates/ui-byline/blocks/richtext-block/index.tsx +1 -1
- package/dist/templates/ui-byline/components/link/link-lexical.tsx +1 -1
- package/dist/templates/ui-byline/types/content.ts +1 -1
- package/dist/ui-template-contract.test.js +27 -7
- package/dist/ui-template-contract.test.js.map +1 -1
- package/dist/workspace-root.test.js +5 -1
- package/dist/workspace-root.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/templates/byline/clients.server.ts +0 -77
- package/dist/templates/byline-examples/clients.server.ts +0 -77
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
3
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Infonomic Company Limited
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Typed, server-only access to this application's Byline clients.
|
|
11
|
-
*
|
|
12
|
-
* ```text
|
|
13
|
-
* generated/collection-types.ts
|
|
14
|
-
* `CollectionFieldsByPath`
|
|
15
|
-
* |
|
|
16
|
-
* v
|
|
17
|
-
* collections/index.ts --------------------.
|
|
18
|
-
* `BylineCollections` |
|
|
19
|
-
* v
|
|
20
|
-
* @byline/host-tanstack-start ------> clients.server.ts
|
|
21
|
-
* runtime client getters |
|
|
22
|
-
* v
|
|
23
|
-
* typed `get*BylineClient()` getters
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* Why this boundary exists:
|
|
27
|
-
*
|
|
28
|
-
* The TanStack host owns the runtime admin, public, system, and viewer client
|
|
29
|
-
* singletons. It intentionally knows nothing about an application's collection
|
|
30
|
-
* schemas, so its getters cannot provide application-specific collection paths
|
|
31
|
-
* and field shapes. The generated `CollectionFieldsByPath` registry is exported
|
|
32
|
-
* as `BylineCollections` by `collections/index.ts`; this module joins the host
|
|
33
|
-
* getters and app registry once instead of repeating a type assertion at every
|
|
34
|
-
* server call site.
|
|
35
|
-
*
|
|
36
|
-
* Typical server usage:
|
|
37
|
-
*
|
|
38
|
-
* ```ts
|
|
39
|
-
* const publicClient = getPublicBylineClient() // anonymous published reads
|
|
40
|
-
* const viewerClient = getViewerBylineClient() // public or admin-preview reads
|
|
41
|
-
* const adminClient = getAdminBylineClient() // current admin request authority
|
|
42
|
-
* const systemClient = getSystemBylineClient() // trusted hooks and maintenance
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* Calls to `client.collection('<collection-path>')` are therefore checked
|
|
46
|
-
* against this application's generated registry and return that collection's
|
|
47
|
-
* canonical generated field shape. `collection-types.contract.ts` separately
|
|
48
|
-
* proves that those generated shapes match the runtime schemas exactly.
|
|
49
|
-
*
|
|
50
|
-
* The `.server.ts` suffix is intentional. Import these getters only from server
|
|
51
|
-
* routes, loaders, actions, scripts, or lifecycle-hook modules; browser code
|
|
52
|
-
* must not cross this boundary.
|
|
53
|
-
*
|
|
54
|
-
* This module does not create client singletons, generate collection types, or
|
|
55
|
-
* configure the host. It only applies the app-specific client type and
|
|
56
|
-
* re-exports the host-owned getters (plus the viewer preview-state helper).
|
|
57
|
-
*/
|
|
58
|
-
import type { BylineClient } from '@byline/client'
|
|
59
|
-
import {
|
|
60
|
-
getAdminBylineClient as getHostAdminBylineClient,
|
|
61
|
-
getSystemBylineClient as getHostSystemBylineClient,
|
|
62
|
-
} from '@byline/host-tanstack-start/integrations/byline-client'
|
|
63
|
-
import { getPublicBylineClient as getHostPublicBylineClient } from '@byline/host-tanstack-start/integrations/byline-public-client'
|
|
64
|
-
import {
|
|
65
|
-
getViewerBylineClient as getHostViewerBylineClient,
|
|
66
|
-
isPreviewActive,
|
|
67
|
-
} from '@byline/host-tanstack-start/integrations/byline-viewer-client'
|
|
68
|
-
|
|
69
|
-
import type { BylineCollections } from './collections/index.js'
|
|
70
|
-
|
|
71
|
-
type AppBylineClient = BylineClient<BylineCollections>
|
|
72
|
-
|
|
73
|
-
export const getAdminBylineClient = getHostAdminBylineClient as () => AppBylineClient
|
|
74
|
-
export const getPublicBylineClient = getHostPublicBylineClient as () => AppBylineClient
|
|
75
|
-
export const getSystemBylineClient = getHostSystemBylineClient as () => AppBylineClient
|
|
76
|
-
export const getViewerBylineClient = getHostViewerBylineClient as () => AppBylineClient
|
|
77
|
-
export { isPreviewActive }
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
3
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Infonomic Company Limited
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Typed, server-only access to this application's Byline clients.
|
|
11
|
-
*
|
|
12
|
-
* ```text
|
|
13
|
-
* generated/collection-types.ts
|
|
14
|
-
* `CollectionFieldsByPath`
|
|
15
|
-
* |
|
|
16
|
-
* v
|
|
17
|
-
* collections/index.ts --------------------.
|
|
18
|
-
* `BylineCollections` |
|
|
19
|
-
* v
|
|
20
|
-
* @byline/host-tanstack-start ------> clients.server.ts
|
|
21
|
-
* runtime client getters |
|
|
22
|
-
* v
|
|
23
|
-
* typed `get*BylineClient()` getters
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* Why this boundary exists:
|
|
27
|
-
*
|
|
28
|
-
* The TanStack host owns the runtime admin, public, system, and viewer client
|
|
29
|
-
* singletons. It intentionally knows nothing about an application's collection
|
|
30
|
-
* schemas, so its getters cannot provide application-specific collection paths
|
|
31
|
-
* and field shapes. The generated `CollectionFieldsByPath` registry is exported
|
|
32
|
-
* as `BylineCollections` by `collections/index.ts`; this module joins the host
|
|
33
|
-
* getters and app registry once instead of repeating a type assertion at every
|
|
34
|
-
* server call site.
|
|
35
|
-
*
|
|
36
|
-
* Typical server usage:
|
|
37
|
-
*
|
|
38
|
-
* ```ts
|
|
39
|
-
* const publicClient = getPublicBylineClient() // anonymous published reads
|
|
40
|
-
* const viewerClient = getViewerBylineClient() // public or admin-preview reads
|
|
41
|
-
* const adminClient = getAdminBylineClient() // current admin request authority
|
|
42
|
-
* const systemClient = getSystemBylineClient() // trusted hooks and maintenance
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* Calls such as `systemClient.collection('docs')` are therefore checked against
|
|
46
|
-
* this application's generated registry and return the canonical generated
|
|
47
|
-
* field shape for `docs`. `collection-types.contract.ts` separately proves that
|
|
48
|
-
* those generated shapes still match the runtime collection schemas exactly.
|
|
49
|
-
*
|
|
50
|
-
* The `.server.ts` suffix is intentional. Import these getters only from server
|
|
51
|
-
* routes, loaders, actions, scripts, or lifecycle-hook modules; browser code
|
|
52
|
-
* must not cross this boundary.
|
|
53
|
-
*
|
|
54
|
-
* This module does not create client singletons, generate collection types, or
|
|
55
|
-
* configure the host. It only applies the app-specific client type and
|
|
56
|
-
* re-exports the host-owned getters (plus the viewer preview-state helper).
|
|
57
|
-
*/
|
|
58
|
-
import type { BylineClient } from '@byline/client'
|
|
59
|
-
import {
|
|
60
|
-
getAdminBylineClient as getHostAdminBylineClient,
|
|
61
|
-
getSystemBylineClient as getHostSystemBylineClient,
|
|
62
|
-
} from '@byline/host-tanstack-start/integrations/byline-client'
|
|
63
|
-
import { getPublicBylineClient as getHostPublicBylineClient } from '@byline/host-tanstack-start/integrations/byline-public-client'
|
|
64
|
-
import {
|
|
65
|
-
getViewerBylineClient as getHostViewerBylineClient,
|
|
66
|
-
isPreviewActive,
|
|
67
|
-
} from '@byline/host-tanstack-start/integrations/byline-viewer-client'
|
|
68
|
-
|
|
69
|
-
import type { BylineCollections } from './collections/index.js'
|
|
70
|
-
|
|
71
|
-
type AppBylineClient = BylineClient<BylineCollections>
|
|
72
|
-
|
|
73
|
-
export const getAdminBylineClient = getHostAdminBylineClient as () => AppBylineClient
|
|
74
|
-
export const getPublicBylineClient = getHostPublicBylineClient as () => AppBylineClient
|
|
75
|
-
export const getSystemBylineClient = getHostSystemBylineClient as () => AppBylineClient
|
|
76
|
-
export const getViewerBylineClient = getHostViewerBylineClient as () => AppBylineClient
|
|
77
|
-
export { isPreviewActive }
|