@byline/cli 2.3.2 → 2.4.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.
@@ -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"}
@@ -0,0 +1,58 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { Project } from 'ts-morph';
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.
8
+ import '${IMPORT_SPECIFIER}'
9
+ `;
10
+ export const wireBylineLayoutTsx = {
11
+ key: 'byline-layout-tsx',
12
+ title: `Inject side-effect import into ${REL}`,
13
+ async preview(ctx) {
14
+ return run(ctx, true);
15
+ },
16
+ async apply(ctx) {
17
+ return run(ctx, false);
18
+ },
19
+ };
20
+ async function run(ctx, dryRun) {
21
+ const path = ctx.resolve(REL);
22
+ if (!existsSync(path)) {
23
+ return { status: 'blocked', message: `${REL} not found — routes phase should have caught this` };
24
+ }
25
+ const text = readFileSync(path, 'utf8');
26
+ if (hasImport(text, IMPORT_SPECIFIER)) {
27
+ return { status: 'skipped', message: `${REL}: admin config import already present` };
28
+ }
29
+ if (dryRun) {
30
+ return { status: 'done', message: `${REL}: will inject \`import '${IMPORT_SPECIFIER}'\`` };
31
+ }
32
+ const project = new Project({ useInMemoryFileSystem: false, skipAddingFilesFromTsConfig: true });
33
+ let source;
34
+ try {
35
+ source = project.addSourceFileAtPath(path);
36
+ }
37
+ catch {
38
+ return {
39
+ status: 'manual',
40
+ message: `${REL}: could not parse — please add the import manually`,
41
+ snippet: SNIPPET,
42
+ };
43
+ }
44
+ // Place after the last existing import — admin config registration only
45
+ // needs to run once at module load; ordering with other side-effect
46
+ // imports doesn't matter as long as it lands in the route module graph.
47
+ const imports = source.getImportDeclarations();
48
+ const insertIndex = imports.length;
49
+ source.insertImportDeclaration(insertIndex, { moduleSpecifier: IMPORT_SPECIFIER });
50
+ source.saveSync();
51
+ return { status: 'done', message: `${REL}: injected \`import '${IMPORT_SPECIFIER}'\`` };
52
+ }
53
+ function hasImport(source, specifier) {
54
+ const escaped = specifier.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
55
+ const re = new RegExp(`import\\s+['"]${escaped}(?:\\.ts|\\.tsx)?['"]`);
56
+ return re.test(source);
57
+ }
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;Q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,MAAM,CAAC,uBAAuB,CAAC,WAAW,EAAE,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC,CAAA;IAClF,MAAM,CAAC,QAAQ,EAAE,CAAA;IAEjB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,wBAAwB,gBAAgB,KAAK,EAAE,CAAA;AACzF,CAAC;AAED,SAAS,SAAS,CAAC,MAAc,EAAE,SAAiB;IAClD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA;IAChE,MAAM,EAAE,GAAG,IAAI,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;A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O,CAAC,CAAA;AACV,CAAC;AAED,SAAS,cAAc,CAAC,OAAwB;IAC9C,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC;QAAE,OAAO,SAAS,CAAA;IACjE,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAA;IAChE,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -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
  * 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
@@ -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.2",
5
+ "version": "2.4.0",
6
6
  "engines": {
7
7
  "node": ">=20.9.0"
8
8
  },