@byline/cli 5.2.0 → 6.0.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,11 @@
1
+ export interface PgConn {
2
+ host: string;
3
+ port: number;
4
+ user: string;
5
+ password: string;
6
+ database: string;
7
+ }
8
+ export declare function buildPgUrl(c: PgConn): string;
9
+ export declare function parsePgUrl(raw: string): PgConn;
10
+ export declare function withDatabase(c: PgConn, database: string): PgConn;
11
+ //# sourceMappingURL=pg-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pg-url.d.ts","sourceRoot":"","sources":["../../src/lib/pg-url.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAY9C;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE"}
@@ -0,0 +1,22 @@
1
+ export function buildPgUrl(c) {
2
+ const u = encodeURIComponent(c.user);
3
+ const p = encodeURIComponent(c.password);
4
+ return `postgresql://${u}:${p}@${c.host}:${c.port}/${encodeURIComponent(c.database)}`;
5
+ }
6
+ export function parsePgUrl(raw) {
7
+ const url = new URL(raw);
8
+ if (url.protocol !== 'postgresql:' && url.protocol !== 'postgres:') {
9
+ throw new Error(`expected postgresql:// URL, got ${url.protocol}`);
10
+ }
11
+ return {
12
+ host: url.hostname,
13
+ port: url.port ? Number(url.port) : 5432,
14
+ user: decodeURIComponent(url.username),
15
+ password: decodeURIComponent(url.password),
16
+ database: url.pathname.replace(/^\//, '') || 'postgres',
17
+ };
18
+ }
19
+ export function withDatabase(c, database) {
20
+ return { ...c, database };
21
+ }
22
+ //# sourceMappingURL=pg-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pg-url.js","sourceRoot":"","sources":["../../src/lib/pg-url.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,MAAM,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACpC,MAAM,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IACxC,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAA;AACvF,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IACxB,IAAI,GAAG,CAAC,QAAQ,KAAK,aAAa,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAA;IACpE,CAAC;IACD,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,QAAQ;QAClB,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QACxC,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC;QACtC,QAAQ,EAAE,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC1C,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,UAAU;KACxD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAS,EAAE,QAAgB;IACtD,OAAO,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Phase, PhaseId } from '../types.js';
2
+ export declare function stubPhase(id: PhaseId, title: string): Phase;
3
+ //# sourceMappingURL=stub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/phases/stub.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAEjD,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAoB3D"}
@@ -0,0 +1,25 @@
1
+ export function stubPhase(id, title) {
2
+ return {
3
+ id,
4
+ title,
5
+ defaultMode: 'confirm',
6
+ async detect(ctx) {
7
+ return ctx.state.isComplete(id) ? 'done' : 'pending';
8
+ },
9
+ async plan() {
10
+ return {
11
+ writes: [],
12
+ commands: [],
13
+ notes: [`${id}: not yet implemented in @byline/cli ${currentVersion()}`],
14
+ };
15
+ },
16
+ async apply(_plan, ctx) {
17
+ ctx.logger.warn(`${id} — phase is stubbed; please follow the manual instructions in docs`);
18
+ return { state: 'pending' };
19
+ },
20
+ };
21
+ }
22
+ function currentVersion() {
23
+ return '0.1.0';
24
+ }
25
+ //# sourceMappingURL=stub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stub.js","sourceRoot":"","sources":["../../src/phases/stub.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,SAAS,CAAC,EAAW,EAAE,KAAa;IAClD,OAAO;QACL,EAAE;QACF,KAAK;QACL,WAAW,EAAE,SAAS;QACtB,KAAK,CAAC,MAAM,CAAC,GAAY;YACvB,OAAO,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;QACtD,CAAC;QACD,KAAK,CAAC,IAAI;YACR,OAAO;gBACL,MAAM,EAAE,EAAE;gBACV,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,CAAC,GAAG,EAAE,wCAAwC,cAAc,EAAE,EAAE,CAAC;aACzE,CAAA;QACH,CAAC;QACD,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG;YACpB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,oEAAoE,CAAC,CAAA;YAC1F,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -55,11 +55,11 @@ export const LexicalRichTextAi = lexicalEditor((c) => {
55
55
  // registration config so every richtext field keeps the AI assistant AND
56
56
  // the markdown toggle — a schema-side `editorConfig` would override this
57
57
  // baked config and strip the AI extension (it can't carry extensions).
58
- c.settings.options.markdownToggle = true
58
+ c.settings.controls.markdownToggle = true
59
59
  // Inline as-you-type markdown shortcuts (`# ` → H1, `- ` → list, `**x**`
60
60
  // → bold, `| a | b |` → table, `:::note` → admonition, …). Uses the same
61
61
  // BYLINE_TRANSFORMERS set as the source toggle. Remove this line to disable.
62
- c.settings.options.markdownShortcutPlugin = true
62
+ c.settings.markdownShortcuts = true
63
63
  return c
64
64
  }) satisfies (props: RichTextEditorProps) => React.JSX.Element
65
65
 
@@ -0,0 +1,87 @@
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
+ * **Admin-side half of the compact editor.** Pair with the
11
+ * `lexicalRichTextCompact()` schema helper, which carries the JSON-safe
12
+ * toolbar preferences; this file carries the extension set, which is not
13
+ * JSON-safe and so cannot live in a schema.
14
+ *
15
+ * Compact sits between a strictly inline field and the full editor: no
16
+ * block structures, but links and inline images survive, because a
17
+ * caption or a credit line usually wants both. Adjust the removals below
18
+ * to suit your own fields — this is an example, not a fixed policy.
19
+ *
20
+ * Removing an extension decides what the field ACCEPTS as well as what
21
+ * it offers, since each extension owns its node classes. Without this
22
+ * half, a compact field hid the block-format dropdown while still
23
+ * storing a heading that arrived by paste.
24
+ *
25
+ * Bold, italic and inline code cannot be constrained here: they are
26
+ * `TextNode` formats rather than node types, so they have no node to
27
+ * unregister and still arrive by paste.
28
+ */
29
+
30
+ import type { FieldAdminConfig, RichTextEditorProps } from '@byline/core'
31
+ import { builtInExtensions, lexicalEditor } from '@byline/richtext-lexical/config'
32
+
33
+ /**
34
+ * The extension narrowing, exported separately from the component.
35
+ *
36
+ * `lexicalEditor()` closes over its callback inside a lazy component, so
37
+ * the resolved list is not reachable from the outside. Naming the
38
+ * callback lets a test assert which extensions this preset removes —
39
+ * which is the whole of its contract now that removal decides what a
40
+ * field accepts.
41
+ */
42
+ export function configureCompactEditor<T extends { extensions?: any }>(c: T): T {
43
+ c.extensions
44
+ // Block structures — a caption is not a place for a heading, a
45
+ // quote, a list or a table.
46
+ .remove(builtInExtensions.Heading)
47
+ .remove(builtInExtensions.Quote)
48
+ .remove(builtInExtensions.List)
49
+ .remove(builtInExtensions.CheckList)
50
+ .remove(builtInExtensions.Table)
51
+ .remove(builtInExtensions.Layout)
52
+ .remove(builtInExtensions.Admonition)
53
+ .remove(builtInExtensions.HorizontalRule)
54
+ .remove(builtInExtensions.CodeHighlight)
55
+ // Embeds — a compact field is not a place to drop a video.
56
+ .remove(builtInExtensions.AutoEmbed)
57
+ .remove(builtInExtensions.YouTube)
58
+ .remove(builtInExtensions.Vimeo)
59
+ // Link, AutoLink and InlineImage stay on purpose: captions carry
60
+ // credits, and credits carry links.
61
+ return c
62
+ }
63
+
64
+ export const LexicalRichTextCompact = lexicalEditor(configureCompactEditor) satisfies (
65
+ props: RichTextEditorProps
66
+ ) => React.JSX.Element
67
+
68
+ /**
69
+ * Returns a `FieldAdminConfig` that opts a single richText field into the
70
+ * compact editor. Drop into a `CollectionAdminConfig.fields` map, keyed
71
+ * by the schema field's name.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * // byline/collections/<collection>/admin.tsx
76
+ * import { compactRichTextAdmin } from '../../fields/lexical-richtext-compact-admin.jsx'
77
+ *
78
+ * fields: {
79
+ * caption: compactRichTextAdmin(),
80
+ * }
81
+ * ```
82
+ */
83
+ export function compactRichTextAdmin(): FieldAdminConfig {
84
+ return {
85
+ editor: LexicalRichTextCompact,
86
+ }
87
+ }
@@ -52,19 +52,29 @@ type Options = Partial<Omit<RichTextField, 'type' | 'editorConfig'>> & {
52
52
  * captions, byline strap-lines, or compact form fields. Bold / italic /
53
53
  * link editing remain on.
54
54
  *
55
- * To narrow the *extension* set per-field — drop tables, lists, embeds,
56
- * the floating format toolbar, the table action menu — register a
57
- * `LexicalRichTextCompact` wrapper component via `FieldAdminConfig.editor`
58
- * (same pattern as `aiRichTextAdmin()`). Extension references aren't safe
59
- * to bake into schemas, and floating UIs are now extension-presence
60
- * controlled rather than settings-controlled.
55
+ * This half hides CONTROLS and nothing more. It does not decide what the
56
+ * field accepts: a heading can still arrive by paste, by Markdown, or
57
+ * from storage, and `controls.blockFormat = false` only removes the
58
+ * dropdown that would have offered one.
59
+ *
60
+ * To narrow what the field ACCEPTS, pair this with
61
+ * `compactRichTextAdmin()` (`./lexical-richtext-compact-admin.js`), which
62
+ * removes the extensions owning those node classes — removing an
63
+ * extension removes its node registration along with its controls.
64
+ * Extension references are not JSON-safe, so they cannot be baked into a
65
+ * schema and must travel through `FieldAdminConfig.editor`, the same
66
+ * pattern as `aiRichTextAdmin()`.
67
+ *
68
+ * Neither half can constrain bold, italic or inline code: they are
69
+ * `TextNode` formats rather than node types, so there is no node to
70
+ * unregister and they still arrive by paste.
61
71
  */
62
72
  function applyCompactPreset(config: EditorConfig): EditorConfig {
63
- const o = config.settings.options
64
- o.textAlignment = false
65
- o.textStyle = false
66
- o.inlineCode = false
67
- o.undoRedo = false
73
+ const c = config.settings.controls
74
+ c.textAlignment = false
75
+ c.blockFormat = false
76
+ c.inlineCode = false
77
+ c.undoRedo = false
68
78
  return config
69
79
  }
70
80
 
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=templates-editor-api-drift.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates-editor-api-drift.test.d.ts","sourceRoot":"","sources":["../src/templates-editor-api-drift.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,87 @@
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
+ * Shipped examples must not use editor APIs that no longer exist.
10
+ *
11
+ * `tsconfig.json` excludes `src/templates` from typechecking — templates
12
+ * are source for a generated app, not for this package, and their
13
+ * imports only resolve once scaffolded. That exclusion is reasonable and
14
+ * it has a cost: nothing tells you when an example drifts away from the
15
+ * API it demonstrates. It is how `settings.options` survived in two
16
+ * templates through the 6.0 rename, where it would have generated a
17
+ * broken install.
18
+ *
19
+ * This is a blunt guard rather than a typecheck, but it catches the
20
+ * class of drift that matters: an example calling into a surface that
21
+ * was removed.
22
+ */
23
+ import { readdirSync, readFileSync, statSync } from 'node:fs';
24
+ import { dirname, join, resolve } from 'node:path';
25
+ import { fileURLToPath } from 'node:url';
26
+ import { describe, expect, it } from 'vitest';
27
+ const here = dirname(fileURLToPath(import.meta.url));
28
+ const templatesRoot = resolve(here, 'templates');
29
+ /**
30
+ * Editor APIs removed in 6.0, with what replaced them.
31
+ *
32
+ * `textStyle` is deliberately absent: it is also the name of a property
33
+ * on serialized Lexical text nodes, which the seed and Markdown-import
34
+ * templates legitimately set. Matching it here would fail on those.
35
+ */
36
+ const REMOVED = [
37
+ {
38
+ pattern: /settings\.options\b/,
39
+ was: 'EditorSettings.options',
40
+ now: 'settings.mode / settings.markdownShortcuts / settings.controls / settings.debug',
41
+ },
42
+ {
43
+ pattern: /\bmarkdownShortcutPlugin\b/,
44
+ was: 'options.markdownShortcutPlugin',
45
+ now: 'settings.markdownShortcuts',
46
+ },
47
+ {
48
+ pattern: /\bshowTreeView\b/,
49
+ was: 'options.showTreeView',
50
+ now: 'settings.controls.treeView',
51
+ },
52
+ {
53
+ pattern: /\bfrom '@byline\/richtext-lexical'[\s\S]{0,80}\bNodes\b/,
54
+ was: 'the Nodes export',
55
+ now: 'READABLE_NODES, which is a read vocabulary rather than a registration list',
56
+ },
57
+ ];
58
+ function sourceFiles(dir) {
59
+ const found = [];
60
+ for (const entry of readdirSync(dir)) {
61
+ const full = join(dir, entry);
62
+ if (statSync(full).isDirectory()) {
63
+ found.push(...sourceFiles(full));
64
+ }
65
+ else if (/\.tsx?$/.test(entry)) {
66
+ found.push(full);
67
+ }
68
+ }
69
+ return found;
70
+ }
71
+ describe('shipped templates track the editor API', () => {
72
+ const files = sourceFiles(templatesRoot);
73
+ it('finds templates to check', () => {
74
+ // Guards the guard: a walk that silently returns nothing would make
75
+ // every assertion below vacuous.
76
+ expect(files.length).toBeGreaterThan(20);
77
+ });
78
+ for (const { pattern, was, now } of REMOVED) {
79
+ it(`uses no ${was}`, () => {
80
+ const offenders = files
81
+ .filter((file) => pattern.test(readFileSync(file, 'utf8')))
82
+ .map((file) => file.slice(templatesRoot.length + 1));
83
+ expect(offenders, `${was} was removed in 6.0 — use ${now}`).toEqual([]);
84
+ });
85
+ }
86
+ });
87
+ //# sourceMappingURL=templates-editor-api-drift.test.js.map
@@ -0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@@
1
+ {"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/ui/snippet.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,CAI5E"}
@@ -0,0 +1,7 @@
1
+ import pc from 'picocolors';
2
+ export function renderSnippet(title, body, lang = '') {
3
+ const header = pc.dim(`--- ${title}${lang ? ` (${lang})` : ''} ---`);
4
+ const footer = pc.dim('---');
5
+ return `${header}\n${body}\n${footer}`;
6
+ }
7
+ //# sourceMappingURL=snippet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../src/ui/snippet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,IAAY,EAAE,IAAI,GAAG,EAAE;IAClE,MAAM,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IACpE,MAAM,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC5B,OAAO,GAAG,MAAM,KAAK,IAAI,KAAK,MAAM,EAAE,CAAA;AACxC,CAAC"}
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": "5.2.0",
5
+ "version": "6.0.1",
6
6
  "engines": {
7
7
  "node": ">=20.9.0"
8
8
  },
@@ -61,7 +61,7 @@
61
61
  "typescript": "^7.0.2",
62
62
  "unified": "^11.0.5",
63
63
  "vitest": "^5.0.0",
64
- "@byline/core": "5.2.0"
64
+ "@byline/core": "6.0.1"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public",