@vitrinka/web 0.1.4 → 0.1.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @vitrinka/web
2
2
 
3
+ ## 0.1.5
4
+
5
+ - **A `project` prop.** `VitrinkaRecorderRoot` takes `project`. A
6
+ device-linked session then files into that project instead of the one the
7
+ host's rule picks. One origin that serves several apps by path can now send
8
+ each app's sessions to its own project. A recorder key's pin still wins.
9
+
3
10
  ## 0.1.4
4
11
 
5
12
  - **Annotate works by finger.** On a phone or tablet, a drag in annotate
package/README.md CHANGED
@@ -82,6 +82,11 @@ Vite and plain React work the same way — pass `url` / `recorderKey` from
82
82
  `import.meta.env` (the `NEXT_PUBLIC_*` fallback only applies where a
83
83
  bundler inlines `process.env`).
84
84
 
85
+ One origin serving several apps by path (`/portal/`, `/designer/`, …)
86
+ can file each app's sessions into its own project: pass `project` per app.
87
+ Without it, the host's project rule decides; a recorder key's project pin
88
+ always wins, and a different `project` is refused.
89
+
85
90
  ### Env vars
86
91
 
87
92
  | Var | What |
@@ -19,6 +19,12 @@ export interface RecorderConfig {
19
19
  appVersion?: string;
20
20
  /** Explicit server lane; omitted = the key's project rule decides. */
21
21
  environment?: string;
22
+ /**
23
+ * Explicit project for a device-linked session — one origin serving several
24
+ * apps (by path) files each into its own project. Omitted = the host's
25
+ * project rule decides; an admin key's pin always wins (a mismatch is 403).
26
+ */
27
+ project?: string;
22
28
  /** Device-link label; defaults to `<browser> on <os> · <host>`. */
23
29
  label?: string;
24
30
  }
@@ -6,6 +6,7 @@ export function configureRecorder(next) {
6
6
  config.key = next.key ?? '';
7
7
  config.appVersion = next.appVersion;
8
8
  config.environment = next.environment;
9
+ config.project = next.project;
9
10
  config.label = next.label;
10
11
  }
11
12
  export function recorderConfig() {
@@ -28,6 +28,8 @@ export interface VitrinkaRecorderRootProps {
28
28
  appVersion?: string;
29
29
  /** Explicit server lane; omitted = the key's project rule decides. */
30
30
  environment?: string;
31
+ /** Explicit project; omitted = the host's project rule decides. */
32
+ project?: string;
31
33
  /** A router's pathname, when the History wrap is not enough. */
32
34
  route?: string | null;
33
35
  children?: ReactNode;
@@ -25,7 +25,14 @@ export function VitrinkaRecorderRoot(props) {
25
25
  if (!url)
26
26
  return createElement(Fragment, null, props.children);
27
27
  return createElement(RecorderProvider, {
28
- config: { url, key, appVersion: props.appVersion, environment: props.environment, label: props.label },
28
+ config: {
29
+ url,
30
+ key,
31
+ appVersion: props.appVersion,
32
+ environment: props.environment,
33
+ project: props.project,
34
+ label: props.label,
35
+ },
29
36
  }, createElement(RouteFeed, { route: props.route }), props.children);
30
37
  }
31
38
  function RouteFeed({ route }) {
@@ -17,8 +17,8 @@ import { type SessionState } from './queue';
17
17
  export { currentRoute, notify, subscribe } from './state';
18
18
  export type { SessionDone } from '../protocol';
19
19
  /** Sent as `meta.recorder`; bumped with the package version. */
20
- export declare const RECORDER_VERSION = "0.1.4";
21
- export declare const RECORDER_ID = "web/0.1.4";
20
+ export declare const RECORDER_VERSION = "0.1.5";
21
+ export declare const RECORDER_ID = "web/0.1.5";
22
22
  /** What `POST /api/v1/sessions` answers (the fields this recorder keeps). */
23
23
  export interface SessionOut {
24
24
  id: string;
@@ -5,7 +5,7 @@ import { armReconcile, capturesSettled, disarmReconcile, drainBuffer, getState,
5
5
  import { currentRoute, notify } from './state';
6
6
  export { currentRoute, notify, subscribe } from './state';
7
7
  /** Sent as `meta.recorder`; bumped with the package version. */
8
- export const RECORDER_VERSION = '0.1.4';
8
+ export const RECORDER_VERSION = '0.1.5';
9
9
  export const RECORDER_ID = `web/${RECORDER_VERSION}`;
10
10
  /**
11
11
  * Re-apply a RECOVERED session's redaction policy after a reload — and
@@ -64,6 +64,7 @@ export async function startSession(opts = {}) {
64
64
  const ses = await api('POST', '/api/v1/sessions', {
65
65
  host: pageHost(),
66
66
  title: opts.title || '',
67
+ ...(cfg.project ? { project: cfg.project } : {}),
67
68
  ...(environment ? { environment } : {}),
68
69
  meta: {
69
70
  recorder: RECORDER_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrinka/web",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "vitrinka toolkit for React DOM apps — the journey recorder: capture manual-testing sessions (rrweb DOM stream, clicks, navigation, network, console, notes) straight into vitrinka boards.",
5
5
  "license": "Elastic-2.0",
6
6
  "repository": {