@byline/cli 2.3.3 → 2.4.1

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.
@@ -0,0 +1,3 @@
1
+ import type { SubEdit } from './shared.js';
2
+ export declare const wireBylineLayoutTsx: SubEdit;
3
+ //# sourceMappingURL=byline-layout-tsx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byline-layout-tsx.d.ts","sourceRoot":"","sources":["../../../src/phases/wire/byline-layout-tsx.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAA;AAUzD,eAAO,MAAM,mBAAmB,EAAE,OASjC,CAAA"}
@@ -1,13 +1,14 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { Project } from 'ts-morph';
3
- const REL = 'src/routes/__root.tsx';
4
- const IMPORT_SPECIFIER = '../../byline/admin.config';
5
- const SNIPPET = `// Initialize Byline admin config — must be imported here so it runs in both
6
- // the SSR rendering and client module graphs (see byline/admin.config.ts).
3
+ const REL = 'src/routes/_byline/route.lazy.tsx';
4
+ const IMPORT_SPECIFIER = '../../../byline/admin.config';
5
+ const SNIPPET = `// Initialize Byline admin config — sits in the lazy companion so the
6
+ // Lexical editor module graph only loads when a _byline/* URL matches.
7
+ // See byline/admin.config.ts for the comment on why this is side-effecty.
7
8
  import '${IMPORT_SPECIFIER}'
8
9
  `;
9
- export const wireRootTsx = {
10
- key: 'root-tsx',
10
+ export const wireBylineLayoutTsx = {
11
+ key: 'byline-layout-tsx',
11
12
  title: `Inject side-effect import into ${REL}`,
12
13
  async preview(ctx) {
13
14
  return run(ctx, true);
@@ -19,7 +20,7 @@ export const wireRootTsx = {
19
20
  async function run(ctx, dryRun) {
20
21
  const path = ctx.resolve(REL);
21
22
  if (!existsSync(path)) {
22
- return { status: 'blocked', message: `${REL} not found — host phase should have caught this` };
23
+ return { status: 'blocked', message: `${REL} not found — routes phase should have caught this` };
23
24
  }
24
25
  const text = readFileSync(path, 'utf8');
25
26
  if (hasImport(text, IMPORT_SPECIFIER)) {
@@ -54,4 +55,4 @@ function hasImport(source, specifier) {
54
55
  const re = new RegExp(`import\\s+['"]${escaped}(?:\\.ts|\\.tsx)?['"]`);
55
56
  return re.test(source);
56
57
  }
57
- //# sourceMappingURL=root-tsx.js.map
58
+ //# sourceMappingURL=byline-layout-tsx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byline-layout-tsx.js","sourceRoot":"","sources":["../../../src/phases/wire/byline-layout-tsx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAElD,OAAO,EAAE,OAAO,EAAmB,MAAM,UAAU,CAAA;AAKnD,MAAM,GAAG,GAAG,mCAAmC,CAAA;AAC/C,MAAM,gBAAgB,GAAG,8BAA8B,CAAA;AACvD,MAAM,OAAO,GAAG;;;UAGN,gBAAgB;CACzB,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,GAAG,EAAE,mBAAmB;IACxB,KAAK,EAAE,kCAAkC,GAAG,EAAE;IAC9C,KAAK,CAAC,OAAO,CAAC,GAAG;QACf,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACvB,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,GAAG;QACb,OAAO,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACxB,CAAC;CACF,CAAA;AAED,KAAK,UAAU,GAAG,CAAC,GAAY,EAAE,MAAe;IAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,GAAG,mDAAmD,EAAE,CAAA;IAClG,CAAC;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,EA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I,MAAM,CAAC,iBAAiB,OAAO,uBAAuB,CAAC,CAAA;IACtE,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACxB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { wireRootTsx } from './root-tsx.js';
1
+ import { wireBylineLayoutTsx } from './byline-layout-tsx.js';
2
2
  import { wireServerTs } from './server-ts.js';
3
3
  import { wireServerUploads } from './server-uploads.js';
4
4
  import { wireStartTs } from './start-ts.js';
@@ -13,7 +13,7 @@ const SUB_EDITS = [
13
13
  wireServerTs,
14
14
  wireServerUploads,
15
15
  wireStartTs,
16
- wireRootTsx,
16
+ wireBylineLayoutTsx,
17
17
  wireTsconfig,
18
18
  wireViteConfig,
19
19
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/phases/wire/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIjD,mEAAmE;AACnE,4EAA4E;AAC5E,0EAA0E;AAC1E,sEAAsE;AACtE,oDAAoD;AACpD,MAAM,SAAS,GAAc;IAC3B,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,WAAW;IACX,YAAY;IACZ,cAAc;CACf,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,+DAA+D;IACtE,WAAW,EAAE,SAAS;IAEtB,KAAK,CAAC,MAAM,CAAC,GAAG;QACd,IAAI,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAA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ers Byline's client-side config (collection admin UI configs,
11
11
  * field editors, i18n, routes) in the current module graph. Imported as
12
- * a side-effect from `src/routes/__root.tsx` that module runs in both
13
- * the SSR render and client module graphs, so a single import there
14
- * covers both contexts.
12
+ * a side-effect from `src/routes/_byline/route.lazy.tsx` so registration
13
+ * fires only when a `_byline/*` URL matches keeping the Lexical
14
+ * editor module graph out of public-route bundles entirely.
15
15
  *
16
16
  * This is the minimal scaffold: no example collections registered. Add
17
17
  * collection schemas + admin configs to the `collections` and `admin`
@@ -9,9 +9,9 @@
9
9
  /**
10
10
  * Registers Byline's client-side config (collection admin UI configs,
11
11
  * field editors, i18n, routes) in the current module graph. Imported as
12
- * a side-effect from `src/routes/__root.tsx` that module runs in both
13
- * the SSR render and client module graphs, so a single import there
14
- * covers both contexts.
12
+ * a side-effect from `src/routes/_byline/route.lazy.tsx` so registration
13
+ * fires only when a `_byline/*` URL matches keeping the Lexical
14
+ * editor module graph out of public-route bundles entirely.
15
15
  *
16
16
  * In TanStack Start with Vite 6 the server entry (`src/server.ts`) and
17
17
  * the SSR rendering context run in separate Vite environments, so
@@ -44,14 +44,21 @@ const bylineSsrNoExternal = [/^@byline\//]
44
44
  // - sharp + @byline/storage-local — image processing (libvips)
45
45
  // - @byline/storage-s3 — bundles the AWS SDK; keep external for Node resolution
46
46
  // - @byline/db-postgres — depends on `pg` native bindings
47
- // - @byline/admin — re-exports server-only code that imports the above
48
47
  // - pino — CJS entrypoints don't execute under Vite's module runner
48
+ //
49
+ // `@byline/admin` is intentionally NOT externalised: it now hosts
50
+ // React admin UI subpaths (`/admin-users/components/*`, `/services`,
51
+ // `/auth/components/sign-in-form`, etc.) whose compiled JS does
52
+ // `import './foo_module.css'`. Node's ESM loader can't handle `.css`,
53
+ // so admin must flow through Vite's SSR pipeline where the CSS plugin
54
+ // resolves the side-effect imports. Server-only admin subpaths reach
55
+ // db-postgres / storage adapters through composition at runtime, not
56
+ // through `@byline/admin`'s own import graph, so this is safe.
49
57
  const ssrExternal = [
50
58
  'sharp',
51
59
  'pino',
52
60
  '@byline/storage-local',
53
61
  '@byline/storage-s3',
54
- '@byline/admin',
55
62
  '@byline/db-postgres',
56
63
  ]
57
64
 
@@ -143,14 +150,13 @@ const config = defineConfig({
143
150
  devtools(),
144
151
  nitro({
145
152
  preset: 'node',
146
- // @byline/ui ships compiled JS that does `import './foo_module.css'`.
147
- // @byline/host-tanstack-start re-exports route factories from
148
- // @byline/ui at runtime in the SSR graph. Nitro externalizes
149
- // node_modules by default, which sends those imports to Node's
150
- // ESM loader which can't handle .css. Inlining both packages
151
- // through Nitro's pipeline lets Vite's CSS plugin process the
152
- // side-effect imports.
153
- noExternals: ['@byline/ui', '@byline/host-tanstack-start'],
153
+ // @byline/ui, @byline/admin, and @byline/host-tanstack-start all
154
+ // ship compiled JS that does `import './foo_module.css'`. Nitro
155
+ // externalizes node_modules by default, which would send those
156
+ // imports to Node's ESM loader which can't handle .css.
157
+ // Inlining these three packages through Nitro's pipeline lets
158
+ // Vite's CSS plugin process the side-effect imports.
159
+ noExternals: ['@byline/ui', '@byline/admin', '@byline/host-tanstack-start'],
154
160
  // When Nitro inlines `@byline/host-tanstack-start` it pulls in
155
161
  // `@byline/core`, which depends on pino. Pino's CJS entry can't be
156
162
  // bundled, so we externalize it (and other native deps) here at
@@ -179,7 +185,7 @@ const config = defineConfig({
179
185
  'react-dom',
180
186
  'pino',
181
187
  'sharp',
182
- /^@byline\/(admin|db-postgres|storage-local|storage-s3)/,
188
+ /^@byline\/(db-postgres|storage-local|storage-s3)/,
183
189
  ],
184
190
  },
185
191
  }),
@@ -0,0 +1,44 @@
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
+ * Lazy companion to `_byline/route.tsx`. TanStack Router loads this on
11
+ * demand when a `_byline/*` URL matches, so the Byline UI providers,
12
+ * stylesheets, and the admin config side-effect import (which
13
+ * transitively pulls in the Lexical editor module graph) only run when
14
+ * an admin route is actually visited — public routes stay clean.
15
+ *
16
+ * If you also want to use the Byline UI components on your public site,
17
+ * import the same stylesheets from your front-end's pathless layout
18
+ * instead (e.g. `_front-end/route.tsx`).
19
+ */
20
+
21
+ import { createLazyFileRoute, Outlet } from '@tanstack/react-router'
22
+
23
+ import { BreadcrumbsProvider } from '@byline/host-tanstack-start/admin-shell/chrome/breadcrumbs/breadcrumbs-provider'
24
+ import { ToastProvider, ToastViewport } from '@byline/ui/react'
25
+
26
+ import '@byline/ui/reset.css'
27
+ import '@byline/ui/styles.css'
28
+
29
+ export const Route = createLazyFileRoute('/_byline')({
30
+ component: BylineLayout,
31
+ })
32
+
33
+ function BylineLayout() {
34
+ return (
35
+ <div className="byline-ui flex flex-col flex-1 w-full max-w-full h-full">
36
+ <ToastProvider timeout={5000}>
37
+ <BreadcrumbsProvider>
38
+ <Outlet />
39
+ </BreadcrumbsProvider>
40
+ <ToastViewport position="bottom-right" />
41
+ </ToastProvider>
42
+ </div>
43
+ )
44
+ }
@@ -7,44 +7,22 @@
7
7
  */
8
8
 
9
9
  /**
10
- * Pathless layout route for everything Byline-rendered (the admin shell
11
- * and the sign-in page). The `_byline` prefix doesn't contribute to URL
12
- * paths — `/_byline/admin/...` resolves to `/admin/...` and
10
+ * Pathless route definition for everything Byline-rendered (the admin
11
+ * shell and the sign-in page). The `_byline` prefix doesn't contribute
12
+ * to URL paths — `/_byline/admin/...` resolves to `/admin/...` and
13
13
  * `/_byline/sign-in` resolves to `/sign-in`.
14
14
  *
15
- * The single job of this layout is to import the Byline UI kit
16
- * stylesheets so they're scoped to (and only loaded on) Byline-rendered
17
- * pages. Front-end routes outside this layout don't get the byline
18
- * styles unless they import them explicitly.
15
+ * This file is intentionally bare. The router needs the route definition
16
+ * at startup to build the tree for URL matching, so anything declared
17
+ * here ends up in the eager module graph (and Vite will modulepreload
18
+ * its dependencies on every page).
19
19
  *
20
- * If you also want to use the Byline UI components on your public site,
21
- * import the same stylesheets from your front-end's pathless layout
22
- * (e.g. `_front-end/route.tsx` see `_public/route.tsx` here for the
23
- * existing pattern).
20
+ * The component, providers, Byline UI stylesheets, and the admin config
21
+ * side-effect import live in the sibling `route.lazy.tsx` TanStack
22
+ * Router loads that file on demand when a `_byline/*` URL matches, so
23
+ * the editor + admin shell deps stay out of public-route bundles.
24
24
  */
25
25
 
26
- import { ToastProvider, ToastViewport } from '@byline/ui/react'
26
+ import { createFileRoute } from '@tanstack/react-router'
27
27
 
28
- import { createFileRoute, Outlet } from '@tanstack/react-router'
29
-
30
- import { BreadcrumbsProvider } from '@byline/host-tanstack-start/admin-shell/chrome/breadcrumbs/breadcrumbs-provider'
31
-
32
- import '@byline/ui/reset.css'
33
- import '@byline/ui/styles.css'
34
-
35
- export const Route = createFileRoute('/_byline')({
36
- component: BylineLayout,
37
- })
38
-
39
- function BylineLayout() {
40
- return (
41
- <div className="byline-ui flex flex-col flex-1 w-full max-w-full h-full">
42
- <ToastProvider timeout={5000}>
43
- <BreadcrumbsProvider>
44
- <Outlet />
45
- </BreadcrumbsProvider>
46
- <ToastViewport position="bottom-right" />
47
- </ToastProvider>
48
- </div>
49
- )
50
- }
28
+ export const Route = createFileRoute('/_byline')({})
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@byline/cli",
3
3
  "private": false,
4
4
  "license": "MPL-2.0",
5
- "version": "2.3.3",
5
+ "version": "2.4.1",
6
6
  "engines": {
7
7
  "node": ">=20.9.0"
8
8
  },
@@ -1,3 +0,0 @@
1
- import type { SubEdit } from './shared.js';
2
- export declare const wireRootTsx: SubEdit;
3
- //# sourceMappingURL=root-tsx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"root-tsx.d.ts","sourceRoot":"","sources":["../../../src/phases/wire/root-tsx.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAiB,MAA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