@byline/cli 2.5.2 → 2.6.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.
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { type CollectionAdminConfig, type ColumnDefinition, defineAdmin } from '@byline/core'
10
- import { DateTimeFormatter } from '@byline/ui/react'
10
+ import { DateTimeFormatter } from '@byline/admin/react'
11
11
 
12
12
  import { SummaryLength } from '~/components/summary-length.js'
13
13
 
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { type CollectionAdminConfig, type ColumnDefinition, defineAdmin } from '@byline/core'
10
- import { DateTimeFormatter } from '@byline/ui/react'
10
+ import { DateTimeFormatter } from '@byline/admin/react'
11
11
 
12
12
  import { MediaListView } from './components/media-list-view.js'
13
13
  import { MediaThumbnail } from './components/media-thumbnail.js'
@@ -24,16 +24,8 @@ import { Link, useNavigate, useRouterState } from '@tanstack/react-router'
24
24
  import type { ListViewComponentProps, StoredFileValue, WorkflowStatus } from '@byline/core'
25
25
  import type { AnyCollectionSchemaTypes } from '@byline/core/zod-schemas'
26
26
  import { RouterPager } from '@byline/host-tanstack-start/admin-shell/chrome/router-pager'
27
- import {
28
- Container,
29
- IconButton,
30
- LoaderRing,
31
- LocalDateTime,
32
- PlusIcon,
33
- Search,
34
- Section,
35
- Select,
36
- } from '@byline/ui/react'
27
+ import { Container, IconButton, LoaderRing, PlusIcon, Search, Section, Select } from '@byline/ui/react'
28
+ import { LocalDateTime } from '@byline/admin/react'
37
29
 
38
30
  import styles from './media-list-view.module.css'
39
31
  import { FormatBadge } from './media-thumbnail'
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { type CollectionAdminConfig, type ColumnDefinition, defineAdmin } from '@byline/core'
10
- import { DateTimeFormatter } from '@byline/ui/react'
10
+ import { DateTimeFormatter } from '@byline/admin/react'
11
11
 
12
12
  import { SummaryLength } from '~/components/summary-length.js'
13
13
 
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { type CollectionAdminConfig, type ColumnDefinition, defineAdmin } from '@byline/core'
10
- import { DateTimeFormatter } from '@byline/ui/react'
10
+ import { DateTimeFormatter } from '@byline/admin/react'
11
11
 
12
12
  import { NewsCategories } from './schema.js'
13
13
 
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { type CollectionAdminConfig, type ColumnDefinition, defineAdmin } from '@byline/core'
10
- import { DateTimeFormatter } from '@byline/ui/react'
10
+ import { DateTimeFormatter } from '@byline/admin/react'
11
11
 
12
12
  import { SummaryLength } from '~/components/summary-length.js'
13
13
  import { i18n } from '~/i18n'
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { FieldHelpTextSlotProps, SlotComponent } from '@byline/core'
10
- import { useFieldValue } from '@byline/ui/react'
10
+ import { useFieldValue } from '@byline/admin/react'
11
11
 
12
12
  import { LengthIndicator } from './length-indicator'
13
13
  import styles from './summary-length.module.css'
@@ -10,7 +10,7 @@ import { useCallback } from 'react'
10
10
 
11
11
  import { AiPluginText } from '@byline/ai/plugins/text'
12
12
  import type { FieldAdornmentSlotProps } from '@byline/core'
13
- import { useFormContext } from '@byline/ui/react'
13
+ import { useFormContext } from '@byline/admin/react'
14
14
 
15
15
  import { useAiPanelOpen } from './ai-panel-store.js'
16
16
 
@@ -58,6 +58,7 @@ CREATE TABLE "byline_admin_users" (
58
58
  "is_super_admin" boolean DEFAULT false NOT NULL,
59
59
  "is_enabled" boolean DEFAULT false NOT NULL,
60
60
  "is_email_verified" boolean DEFAULT false NOT NULL,
61
+ "preferred_locale" varchar(16),
61
62
  "created_at" timestamp (6) with time zone DEFAULT now() NOT NULL,
62
63
  "updated_at" timestamp (6) with time zone DEFAULT now() NOT NULL,
63
64
  CONSTRAINT "byline_admin_users_username_unique" UNIQUE("username"),
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "bc48197e-4883-4d43-b721-18d917a04619",
2
+ "id": "2d20cd37-0ecf-467c-86dd-9f880e9d41b4",
3
3
  "prevId": "00000000-0000-0000-0000-000000000000",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
@@ -502,6 +502,12 @@
502
502
  "notNull": true,
503
503
  "default": false
504
504
  },
505
+ "preferred_locale": {
506
+ "name": "preferred_locale",
507
+ "type": "varchar(16)",
508
+ "primaryKey": false,
509
+ "notNull": false
510
+ },
505
511
  "created_at": {
506
512
  "name": "created_at",
507
513
  "type": "timestamp (6) with time zone",
@@ -5,8 +5,8 @@
5
5
  {
6
6
  "idx": 0,
7
7
  "version": "7",
8
- "when": 1779150782562,
9
- "tag": "0000_cold_red_wolf",
8
+ "when": 1779971470037,
9
+ "tag": "0000_black_sabra",
10
10
  "breakpoints": true
11
11
  }
12
12
  ]
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.5.2",
5
+ "version": "2.6.0",
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 wireBylineLayoutTsx: SubEdit;
3
- //# sourceMappingURL=byline-layout-tsx.d.ts.map
@@ -1 +0,0 @@
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,58 +0,0 @@
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
@@ -1 +0,0 @@
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,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