@histoire/cli 0.0.0-stage → 1.0.0-beta.2
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/LICENSE +21 -0
- package/README.md +8 -2
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +88 -0
- package/dist/commands/dev.d.ts +44 -0
- package/dist/commands/dev.js +115 -0
- package/dist/commands/host.d.ts +66 -0
- package/dist/commands/host.js +1 -0
- package/dist/commands/screenshot-setup-args.d.ts +4 -0
- package/dist/commands/screenshot-setup-args.js +35 -0
- package/dist/commands/signal-guard.d.ts +29 -0
- package/dist/commands/signal-guard.js +52 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/terminal/actions.d.ts +51 -0
- package/dist/terminal/actions.js +60 -0
- package/dist/terminal/banner.d.ts +19 -0
- package/dist/terminal/banner.js +48 -0
- package/dist/terminal/bridge.d.ts +58 -0
- package/dist/terminal/bridge.js +103 -0
- package/dist/terminal/clipboard.d.ts +46 -0
- package/dist/terminal/clipboard.js +85 -0
- package/dist/terminal/diagnostics/attach.d.ts +9 -0
- package/dist/terminal/diagnostics/attach.js +46 -0
- package/dist/terminal/diagnostics/client.d.ts +12 -0
- package/dist/terminal/diagnostics/client.js +19 -0
- package/dist/terminal/diagnostics/lines.d.ts +17 -0
- package/dist/terminal/diagnostics/lines.js +61 -0
- package/dist/terminal/dispatch.d.ts +28 -0
- package/dist/terminal/dispatch.js +52 -0
- package/dist/terminal/feedback.d.ts +14 -0
- package/dist/terminal/feedback.js +27 -0
- package/dist/terminal/history/bounded.d.ts +37 -0
- package/dist/terminal/history/bounded.js +54 -0
- package/dist/terminal/host-extras.d.ts +14 -0
- package/dist/terminal/host-extras.js +26 -0
- package/dist/terminal/info/client.d.ts +20 -0
- package/dist/terminal/info/client.js +25 -0
- package/dist/terminal/info/generation-client.d.ts +33 -0
- package/dist/terminal/info/generation-client.js +32 -0
- package/dist/terminal/info/lines.d.ts +19 -0
- package/dist/terminal/info/lines.js +33 -0
- package/dist/terminal/info/network.d.ts +17 -0
- package/dist/terminal/info/network.js +48 -0
- package/dist/terminal/info/qr.d.ts +7 -0
- package/dist/terminal/info/qr.js +14 -0
- package/dist/terminal/keys.d.ts +44 -0
- package/dist/terminal/keys.js +60 -0
- package/dist/terminal/logs/browser-options.d.ts +9 -0
- package/dist/terminal/logs/browser-options.js +19 -0
- package/dist/terminal/navigation/browser.d.ts +69 -0
- package/dist/terminal/navigation/browser.js +193 -0
- package/dist/terminal/navigation/list.d.ts +53 -0
- package/dist/terminal/navigation/list.js +104 -0
- package/dist/terminal/navigation/search.d.ts +22 -0
- package/dist/terminal/navigation/search.js +44 -0
- package/dist/terminal/output/decoder.d.ts +24 -0
- package/dist/terminal/output/decoder.js +63 -0
- package/dist/terminal/output/history.d.ts +43 -0
- package/dist/terminal/output/history.js +21 -0
- package/dist/terminal/output/pipeline.d.ts +33 -0
- package/dist/terminal/output/pipeline.js +59 -0
- package/dist/terminal/output/sanitize.d.ts +32 -0
- package/dist/terminal/output/sanitize.js +142 -0
- package/dist/terminal/panel-model.d.ts +20 -0
- package/dist/terminal/panel-model.js +38 -0
- package/dist/terminal/panel.d.ts +30 -0
- package/dist/terminal/panel.js +53 -0
- package/dist/terminal/plain.d.ts +29 -0
- package/dist/terminal/plain.js +68 -0
- package/dist/terminal/progress/format.d.ts +28 -0
- package/dist/terminal/progress/format.js +77 -0
- package/dist/terminal/progress/state.d.ts +71 -0
- package/dist/terminal/progress/state.js +150 -0
- package/dist/terminal/protocol/catalog.d.ts +143 -0
- package/dist/terminal/protocol/catalog.js +61 -0
- package/dist/terminal/protocol/core.d.ts +117 -0
- package/dist/terminal/protocol/core.js +98 -0
- package/dist/terminal/protocol/diagnostics.d.ts +79 -0
- package/dist/terminal/protocol/diagnostics.js +31 -0
- package/dist/terminal/protocol/index.d.ts +22 -0
- package/dist/terminal/protocol/index.js +1 -0
- package/dist/terminal/protocol/progress.d.ts +67 -0
- package/dist/terminal/protocol/progress.js +52 -0
- package/dist/terminal/protocol/requests.d.ts +30 -0
- package/dist/terminal/protocol/requests.js +13 -0
- package/dist/terminal/protocol/session.d.ts +55 -0
- package/dist/terminal/protocol/session.js +28 -0
- package/dist/terminal/protocol/tests.d.ts +212 -0
- package/dist/terminal/protocol/tests.js +87 -0
- package/dist/terminal/protocol/watch.d.ts +60 -0
- package/dist/terminal/protocol/watch.js +40 -0
- package/dist/terminal/requests/browser-options.d.ts +8 -0
- package/dist/terminal/requests/browser-options.js +24 -0
- package/dist/terminal/requests/history.d.ts +30 -0
- package/dist/terminal/requests/history.js +53 -0
- package/dist/terminal/retained.d.ts +27 -0
- package/dist/terminal/retained.js +21 -0
- package/dist/terminal/session-types.d.ts +76 -0
- package/dist/terminal/session-types.js +1 -0
- package/dist/terminal/session.d.ts +8 -0
- package/dist/terminal/session.js +282 -0
- package/dist/terminal/shutdown.d.ts +12 -0
- package/dist/terminal/shutdown.js +30 -0
- package/dist/terminal/stories/client.d.ts +26 -0
- package/dist/terminal/stories/client.js +28 -0
- package/dist/terminal/stories/handoff.d.ts +39 -0
- package/dist/terminal/stories/handoff.js +40 -0
- package/dist/terminal/stories/paged.d.ts +70 -0
- package/dist/terminal/stories/paged.js +137 -0
- package/dist/terminal/stories/render.d.ts +39 -0
- package/dist/terminal/stories/render.js +94 -0
- package/dist/terminal/stories/state.d.ts +93 -0
- package/dist/terminal/stories/state.js +191 -0
- package/dist/terminal/stories/target.d.ts +24 -0
- package/dist/terminal/stories/target.js +29 -0
- package/dist/terminal/style.d.ts +45 -0
- package/dist/terminal/style.js +82 -0
- package/dist/terminal/support.d.ts +53 -0
- package/dist/terminal/support.js +66 -0
- package/dist/terminal/surface.d.ts +41 -0
- package/dist/terminal/surface.js +200 -0
- package/dist/terminal/tests/client.d.ts +21 -0
- package/dist/terminal/tests/client.js +12 -0
- package/dist/terminal/tests/console.d.ts +95 -0
- package/dist/terminal/tests/console.js +202 -0
- package/dist/terminal/tests/format.d.ts +18 -0
- package/dist/terminal/tests/format.js +55 -0
- package/dist/terminal/tests/header.d.ts +16 -0
- package/dist/terminal/tests/header.js +90 -0
- package/dist/terminal/tests/reporter.d.ts +17 -0
- package/dist/terminal/tests/reporter.js +99 -0
- package/dist/terminal/tests/results.d.ts +44 -0
- package/dist/terminal/tests/results.js +104 -0
- package/dist/terminal/tests/scope.d.ts +25 -0
- package/dist/terminal/tests/scope.js +25 -0
- package/dist/terminal/tests/session.d.ts +11 -0
- package/dist/terminal/tests/session.js +24 -0
- package/dist/terminal/tests/state.d.ts +57 -0
- package/dist/terminal/tests/state.js +134 -0
- package/dist/terminal/views/clear-history.d.ts +6 -0
- package/dist/terminal/views/clear-history.js +10 -0
- package/dist/terminal/views/error.d.ts +8 -0
- package/dist/terminal/views/error.js +24 -0
- package/dist/terminal/views/frame.d.ts +20 -0
- package/dist/terminal/views/frame.js +23 -0
- package/dist/terminal/views/help.d.ts +3 -0
- package/dist/terminal/views/help.js +32 -0
- package/dist/terminal/views/index.d.ts +6 -0
- package/dist/terminal/views/index.js +13 -0
- package/dist/terminal/views/logs.d.ts +3 -0
- package/dist/terminal/views/logs.js +7 -0
- package/dist/terminal/views/registry.d.ts +114 -0
- package/dist/terminal/views/registry.js +40 -0
- package/dist/terminal/views/requests.d.ts +8 -0
- package/dist/terminal/views/requests.js +15 -0
- package/dist/terminal/views/session.d.ts +9 -0
- package/dist/terminal/views/session.js +133 -0
- package/dist/terminal/views/stories.d.ts +9 -0
- package/dist/terminal/views/stories.js +172 -0
- package/dist/terminal/views/tests.d.ts +9 -0
- package/dist/terminal/views/tests.js +105 -0
- package/dist/terminal/watch/client.d.ts +12 -0
- package/dist/terminal/watch/client.js +7 -0
- package/dist/terminal/watch/controller.d.ts +30 -0
- package/dist/terminal/watch/controller.js +157 -0
- package/dist/terminal/watch/format.d.ts +15 -0
- package/dist/terminal/watch/format.js +37 -0
- package/dist/terminal/watch/session.d.ts +17 -0
- package/dist/terminal/watch/session.js +12 -0
- package/dist/terminal/width.d.ts +24 -0
- package/dist/terminal/width.js +171 -0
- package/dist/workbench-url.d.ts +30 -0
- package/dist/workbench-url.js +55 -0
- package/package.json +54 -3
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* eslint-disable no-control-regex -- terminal escape sequences are the subject of this module */
|
|
2
|
+
/** Terminal cell widths without a dependency: SGR-aware, East Asian wide and emoji aware. */
|
|
3
|
+
/** Matches one SGR sequence (the only escape kind panels and views emit) or one code point. */
|
|
4
|
+
const TOKEN = /\u001B\[[0-9;]*m|[\s\S]/gu;
|
|
5
|
+
/** Inclusive code point ranges that occupy two cells. */
|
|
6
|
+
const WIDE = [
|
|
7
|
+
[0x1100, 0x115F],
|
|
8
|
+
// Default emoji presentation inside the symbol blocks (the rest of those blocks is narrow).
|
|
9
|
+
[0x231A, 0x231B],
|
|
10
|
+
[0x23E9, 0x23EC],
|
|
11
|
+
[0x23F0, 0x23F0],
|
|
12
|
+
[0x23F3, 0x23F3],
|
|
13
|
+
[0x25FD, 0x25FE],
|
|
14
|
+
[0x2614, 0x2615],
|
|
15
|
+
[0x2648, 0x2653],
|
|
16
|
+
[0x267F, 0x267F],
|
|
17
|
+
[0x2693, 0x2693],
|
|
18
|
+
[0x26A1, 0x26A1],
|
|
19
|
+
[0x26AA, 0x26AB],
|
|
20
|
+
[0x26BD, 0x26BE],
|
|
21
|
+
[0x26C4, 0x26C5],
|
|
22
|
+
[0x26CE, 0x26CE],
|
|
23
|
+
[0x26D4, 0x26D4],
|
|
24
|
+
[0x26EA, 0x26EA],
|
|
25
|
+
[0x26F2, 0x26F3],
|
|
26
|
+
[0x26F5, 0x26F5],
|
|
27
|
+
[0x26FA, 0x26FA],
|
|
28
|
+
[0x26FD, 0x26FD],
|
|
29
|
+
[0x2705, 0x2705],
|
|
30
|
+
[0x270A, 0x270B],
|
|
31
|
+
[0x2728, 0x2728],
|
|
32
|
+
[0x274C, 0x274C],
|
|
33
|
+
[0x274E, 0x274E],
|
|
34
|
+
[0x2753, 0x2755],
|
|
35
|
+
[0x2757, 0x2757],
|
|
36
|
+
[0x2795, 0x2797],
|
|
37
|
+
[0x27B0, 0x27B0],
|
|
38
|
+
[0x27BF, 0x27BF],
|
|
39
|
+
[0x2B1B, 0x2B1C],
|
|
40
|
+
[0x2B50, 0x2B50],
|
|
41
|
+
[0x2B55, 0x2B55],
|
|
42
|
+
[0x2E80, 0x303E],
|
|
43
|
+
[0x3041, 0x33FF],
|
|
44
|
+
[0x3400, 0x4DBF],
|
|
45
|
+
[0x4E00, 0x9FFF],
|
|
46
|
+
[0xA000, 0xA4CF],
|
|
47
|
+
[0xAC00, 0xD7A3],
|
|
48
|
+
[0xF900, 0xFAFF],
|
|
49
|
+
[0xFE30, 0xFE6F],
|
|
50
|
+
[0xFF00, 0xFF60],
|
|
51
|
+
[0xFFE0, 0xFFE6],
|
|
52
|
+
[0x1F300, 0x1F64F],
|
|
53
|
+
[0x1F680, 0x1F6FF],
|
|
54
|
+
[0x1F7E0, 0x1F7EB],
|
|
55
|
+
[0x1F900, 0x1F9FF],
|
|
56
|
+
[0x1FA70, 0x1FAFF],
|
|
57
|
+
[0x20000, 0x3FFFD],
|
|
58
|
+
];
|
|
59
|
+
/** Inclusive code point ranges that occupy no cell (combining marks, joiners, variation selectors). */
|
|
60
|
+
const ZERO = [
|
|
61
|
+
[0x0300, 0x036F],
|
|
62
|
+
[0x1AB0, 0x1AFF],
|
|
63
|
+
[0x1DC0, 0x1DFF],
|
|
64
|
+
[0x200B, 0x200F],
|
|
65
|
+
[0x20D0, 0x20FF],
|
|
66
|
+
[0xFE00, 0xFE0F],
|
|
67
|
+
[0xFE20, 0xFE2F],
|
|
68
|
+
// Emoji skin-tone modifiers color the previous glyph.
|
|
69
|
+
[0x1F3FB, 0x1F3FF],
|
|
70
|
+
[0xE0100, 0xE01EF],
|
|
71
|
+
];
|
|
72
|
+
/** Zero width joiner: the code point after it joins the previous glyph. */
|
|
73
|
+
const JOINER = 0x200D;
|
|
74
|
+
/** Reset appended after a truncated styled line so styling cannot leak. */
|
|
75
|
+
const RESET = '\u001B[0m';
|
|
76
|
+
/** Whether a code point is inside one of the ranges. */
|
|
77
|
+
function within(code, ranges) {
|
|
78
|
+
return ranges.some(([from, to]) => code >= from && code <= to);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Number of terminal cells one code point occupies.
|
|
82
|
+
* @param code Unicode code point.
|
|
83
|
+
*/
|
|
84
|
+
export function codePointWidth(code) {
|
|
85
|
+
if (code < 0x20 || (code >= 0x7F && code < 0xA0))
|
|
86
|
+
return 0;
|
|
87
|
+
if (within(code, ZERO))
|
|
88
|
+
return 0;
|
|
89
|
+
return within(code, WIDE) ? 2 : 1;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Splits text into SGR sequences (zero cells) and code points with their widths.
|
|
93
|
+
* @param text Text, possibly styled with SGR sequences.
|
|
94
|
+
*/
|
|
95
|
+
function* cells(text) {
|
|
96
|
+
let joined = false;
|
|
97
|
+
for (const [token] of text.matchAll(TOKEN)) {
|
|
98
|
+
if (token.length > 1 && token.startsWith('\u001B')) {
|
|
99
|
+
yield { token, width: 0 };
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const code = token.codePointAt(0);
|
|
103
|
+
yield { token, width: joined ? 0 : codePointWidth(code) };
|
|
104
|
+
joined = code === JOINER;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Display width of text in terminal cells, ignoring SGR styling.
|
|
109
|
+
* @param text Text without cursor-moving controls.
|
|
110
|
+
*/
|
|
111
|
+
export function displayWidth(text) {
|
|
112
|
+
let width = 0;
|
|
113
|
+
for (const cell of cells(text))
|
|
114
|
+
width += cell.width;
|
|
115
|
+
return width;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Truncates text to at most `columns` cells, marking the cut with an ellipsis.
|
|
119
|
+
* Styling stays balanced when a styled line is cut.
|
|
120
|
+
* @param text Single line of text.
|
|
121
|
+
* @param columns Cell budget.
|
|
122
|
+
*/
|
|
123
|
+
export function fitWidth(text, columns) {
|
|
124
|
+
if (columns <= 0)
|
|
125
|
+
return '';
|
|
126
|
+
if (displayWidth(text) <= columns)
|
|
127
|
+
return text;
|
|
128
|
+
let result = '';
|
|
129
|
+
let width = 0;
|
|
130
|
+
let styled = false;
|
|
131
|
+
for (const cell of cells(text)) {
|
|
132
|
+
if (cell.width === 0) {
|
|
133
|
+
if (cell.token.startsWith('\u001B'))
|
|
134
|
+
styled = true;
|
|
135
|
+
result += cell.token;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
// One cell stays reserved for the ellipsis.
|
|
139
|
+
if (width + cell.width > columns - 1)
|
|
140
|
+
break;
|
|
141
|
+
result += cell.token;
|
|
142
|
+
width += cell.width;
|
|
143
|
+
}
|
|
144
|
+
return `${result}…${styled ? RESET : ''}`;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Wraps text into lines of at most `columns` cells, breaking mid-word only when needed.
|
|
148
|
+
* @param text Text that may contain newlines.
|
|
149
|
+
* @param columns Cell budget per line.
|
|
150
|
+
*/
|
|
151
|
+
export function wrapWidth(text, columns) {
|
|
152
|
+
if (columns <= 0)
|
|
153
|
+
return [];
|
|
154
|
+
const lines = [];
|
|
155
|
+
for (const source of text.split('\n')) {
|
|
156
|
+
let line = '';
|
|
157
|
+
let width = 0;
|
|
158
|
+
for (const cell of cells(source)) {
|
|
159
|
+
// An empty line keeps even a glyph wider than the budget, so no blank line is emitted before it.
|
|
160
|
+
if (cell.width > 0 && width > 0 && width + cell.width > columns) {
|
|
161
|
+
lines.push(line);
|
|
162
|
+
line = '';
|
|
163
|
+
width = 0;
|
|
164
|
+
}
|
|
165
|
+
line += cell.token;
|
|
166
|
+
width += cell.width;
|
|
167
|
+
}
|
|
168
|
+
lines.push(line);
|
|
169
|
+
}
|
|
170
|
+
return lines;
|
|
171
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Inputs of a workbench story route; trusted server configuration plus exact collected identities. */
|
|
2
|
+
export interface StoryRouteOptions {
|
|
3
|
+
/** Actual listened UI origin or configured public origin. */
|
|
4
|
+
origin: string;
|
|
5
|
+
/** Browser deployment base. */
|
|
6
|
+
base: string;
|
|
7
|
+
/** Actual UI router mode. */
|
|
8
|
+
routerMode: 'hash' | 'history';
|
|
9
|
+
/** Exact collected story identity. */
|
|
10
|
+
storyId: string;
|
|
11
|
+
/** Exact scoped variant identity; omitted for the story route itself (no variant is invented). */
|
|
12
|
+
variantId?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Why a route could not be built. */
|
|
15
|
+
export declare class StoryRouteError extends Error {
|
|
16
|
+
/** Which input was unusable. */
|
|
17
|
+
readonly reason: 'origin' | 'base';
|
|
18
|
+
/** Creates a failure naming the unusable input. */
|
|
19
|
+
constructor(reason: 'origin' | 'base', message: string);
|
|
20
|
+
}
|
|
21
|
+
/** Encodes an exact ID as one RFC 3986 segment; dot-only segments never undergo URL normalization. */
|
|
22
|
+
export declare function encodeUriSegment(value: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Builds the workbench URL of a story, or of one of its variants.
|
|
25
|
+
* Transport neutral and dependency free (no MCP, runtime or Vite graph), so the
|
|
26
|
+
* terminal parent and the MCP facade share one implementation.
|
|
27
|
+
* @param options Origin, base, router mode and exact identities.
|
|
28
|
+
* @throws StoryRouteError for a credential-bearing/non-HTTP origin or a base leaving the origin.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createStoryUrl(options: StoryRouteOptions): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { normalizePreviewBase } from '@histoire/protocol';
|
|
2
|
+
/** Why a route could not be built. */
|
|
3
|
+
export class StoryRouteError extends Error {
|
|
4
|
+
/** Which input was unusable. */
|
|
5
|
+
reason;
|
|
6
|
+
/** Creates a failure naming the unusable input. */
|
|
7
|
+
constructor(reason, message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = 'StoryRouteError';
|
|
10
|
+
this.reason = reason;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Encodes an exact ID as one RFC 3986 segment; dot-only segments never undergo URL normalization. */
|
|
14
|
+
export function encodeUriSegment(value) {
|
|
15
|
+
const encoded = encodeURIComponent(value).replace(/[!'()*]/g, char => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
16
|
+
return /^\.+$/.test(value) ? encoded.replace(/\./g, '%2E') : encoded;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds the workbench URL of a story, or of one of its variants.
|
|
20
|
+
* Transport neutral and dependency free (no MCP, runtime or Vite graph), so the
|
|
21
|
+
* terminal parent and the MCP facade share one implementation.
|
|
22
|
+
* @param options Origin, base, router mode and exact identities.
|
|
23
|
+
* @throws StoryRouteError for a credential-bearing/non-HTTP origin or a base leaving the origin.
|
|
24
|
+
*/
|
|
25
|
+
export function createStoryUrl(options) {
|
|
26
|
+
const origin = new URL(options.origin);
|
|
27
|
+
if (!['http:', 'https:'].includes(origin.protocol) || origin.username || origin.password) {
|
|
28
|
+
throw new StoryRouteError('origin', 'Origin is unavailable');
|
|
29
|
+
}
|
|
30
|
+
let base;
|
|
31
|
+
try {
|
|
32
|
+
base = normalizePreviewBase(options.base);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
throw new StoryRouteError('base', 'Base must be a same-origin absolute path');
|
|
36
|
+
}
|
|
37
|
+
const storyUrl = new URL(base, origin.origin);
|
|
38
|
+
const query = new URLSearchParams(options.variantId === undefined ? {} : { variantId: options.variantId });
|
|
39
|
+
const storyPath = `story/${encodeUriSegment(options.storyId)}`;
|
|
40
|
+
if (options.routerMode === 'hash') {
|
|
41
|
+
storyUrl.hash = `/${storyPath}${query.size ? `?${query}` : ''}`;
|
|
42
|
+
}
|
|
43
|
+
else if (/^\.+$/.test(options.storyId)) {
|
|
44
|
+
// URL parsing normalizes even percent-encoded dot-only path segments.
|
|
45
|
+
// The UI's query route preserves these identities without path parsing.
|
|
46
|
+
storyUrl.pathname += 'story';
|
|
47
|
+
query.set('storyId', options.storyId);
|
|
48
|
+
storyUrl.search = query.toString();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
storyUrl.pathname += storyPath;
|
|
52
|
+
storyUrl.search = query.toString();
|
|
53
|
+
}
|
|
54
|
+
return storyUrl.href;
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/cli",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0-beta.2",
|
|
5
|
+
"description": "Command line parsing and the development terminal for Histoire",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/Akryum/histoire.git",
|
|
10
|
+
"directory": "packages/histoire-cli"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./protocol/*": {
|
|
21
|
+
"types": "./dist/terminal/protocol/*.d.ts",
|
|
22
|
+
"default": "./dist/terminal/protocol/*.js"
|
|
23
|
+
},
|
|
24
|
+
"./sanitize": {
|
|
25
|
+
"types": "./dist/terminal/output/sanitize.d.ts",
|
|
26
|
+
"default": "./dist/terminal/output/sanitize.js"
|
|
27
|
+
},
|
|
28
|
+
"./workbench-url": {
|
|
29
|
+
"types": "./dist/workbench-url.d.ts",
|
|
30
|
+
"default": "./dist/workbench-url.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=22.12.0"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"sade": "^1.8.1",
|
|
41
|
+
"uqr": "^0.1.2",
|
|
42
|
+
"@histoire/dev-proxy": "^1.0.0-beta.2",
|
|
43
|
+
"@histoire/protocol": "^1.0.0-beta.2"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^22.10.1",
|
|
47
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
48
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
49
|
+
"vitest": "5.1.1",
|
|
50
|
+
"@histoire/vendors": "^1.0.0-beta.2"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "rimraf dist && tsc",
|
|
54
|
+
"watch": "tsc -w",
|
|
55
|
+
"test": "vitest run"
|
|
56
|
+
}
|
|
6
57
|
}
|