@the-portland-company/devnotes 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @the-portland-company/devnotes
2
2
 
3
- Forge-backed DevNotes and bug reporting for server-capable React and Next.js apps.
3
+ Forge-backed DevNotes and bug reporting for server-capable React, Next.js, Express, and Deno apps.
4
4
 
5
- This package is Forge-only. It does not ship a local database, SQL schema, Supabase adapter, or migration path.
5
+ This package is Forge-only. It ships the Focus Forge proxy implementation for supported server runtimes and does not include a local database, SQL schema, Supabase adapter, or fallback persistence layer.
6
6
 
7
7
  ## Install
8
8
 
@@ -35,13 +35,14 @@ Then wire the generated wrapper component to your auth token source and implemen
35
35
  - `@the-portland-company/devnotes`
36
36
  - `@the-portland-company/devnotes/next`
37
37
  - `@the-portland-company/devnotes/express`
38
+ - `@the-portland-company/devnotes/deno`
38
39
  - `@the-portland-company/devnotes/styles.css`
39
40
 
40
41
  ## What this package ships
41
42
 
42
43
  - React UI components for in-app bug reporting and DevNotes overlays
43
44
  - A browser client that talks to your host app at `/api/devnotes`
44
- - Next.js and Express proxy helpers for server-side routing
45
+ - Forge-native server helpers for Next.js, Express, and Deno
45
46
  - A `devnotes-setup` CLI that copies starter integration templates into a host app
46
47
 
47
48
  ## Client usage
@@ -72,16 +73,94 @@ export function AppDevNotes({ children }) {
72
73
 
73
74
  - `@the-portland-company/devnotes/next`
74
75
  - `@the-portland-company/devnotes/express`
76
+ - `@the-portland-company/devnotes/deno`
75
77
 
76
- These provide request-routing helpers for a host proxy. They do not implement Forge access for you; your app backend remains responsible for the Forge integration.
78
+ These helpers implement the DevNotes-to-Forge proxy path for you. Your app provides the authenticated host user and Forge configuration; the package owns the DevNotes routing, project discovery, and Forge API integration.
77
79
 
78
80
  ## Host app requirements
79
81
 
80
82
  - Expose a server-side proxy at `/api/devnotes`
81
83
  - Authenticate the current user in the host app
82
- - Return a bearer token from `getAuthToken()`
84
+ - Return a bearer token from `getAuthToken()` on the browser side
85
+ - Resolve the current user server-side with `getCurrentUser(request)`
83
86
  - Keep Forge credentials server-side only
84
- - Translate DevNotes operations into real Forge API requests
87
+
88
+ ## Deno usage
89
+
90
+ ```ts
91
+ import { createDenoDevNotesHandler } from '@the-portland-company/devnotes/deno';
92
+
93
+ const devNotesHandler = createDenoDevNotesHandler({
94
+ basePath: '/api/devnotes',
95
+ forge: {
96
+ baseUrl: Deno.env.get('FOCUS_FORGE_BASE_URL')!,
97
+ pat: Deno.env.get('FOCUS_FORGE_PAT')!,
98
+ projectName: Deno.env.get('FOCUS_FORGE_PROJECT_NAME') || null,
99
+ },
100
+ corsHeaders: {
101
+ 'Access-Control-Allow-Origin': '*',
102
+ 'Access-Control-Allow-Headers': 'authorization, content-type',
103
+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, PATCH, DELETE, OPTIONS',
104
+ },
105
+ async getCurrentUser(request) {
106
+ const authHeader = request.headers.get('authorization');
107
+ if (!authHeader) return null;
108
+ return { id: 'user-id', email: 'person@example.com', fullName: 'Person Example' };
109
+ },
110
+ });
111
+
112
+ Deno.serve((request) => {
113
+ if (new URL(request.url).pathname.startsWith('/api/devnotes')) {
114
+ return devNotesHandler(request);
115
+ }
116
+ return new Response('Not found', { status: 404 });
117
+ });
118
+ ```
119
+
120
+ ## Next.js usage
121
+
122
+ ```ts
123
+ import { createNextDevNotesHandler } from '@the-portland-company/devnotes/next';
124
+
125
+ const handler = createNextDevNotesHandler({
126
+ forge: {
127
+ baseUrl: process.env.FOCUS_FORGE_BASE_URL!,
128
+ pat: process.env.FOCUS_FORGE_PAT!,
129
+ projectName: process.env.FOCUS_FORGE_PROJECT_NAME || null,
130
+ },
131
+ async getCurrentUser(request) {
132
+ const authHeader = request.headers.get('authorization');
133
+ if (!authHeader) return null;
134
+ return { id: 'user-id', email: 'person@example.com' };
135
+ },
136
+ });
137
+
138
+ export const GET = handler;
139
+ export const POST = handler;
140
+ export const PATCH = handler;
141
+ export const DELETE = handler;
142
+ export const PUT = handler;
143
+ export const OPTIONS = handler;
144
+ ```
145
+
146
+ ## Express usage
147
+
148
+ ```ts
149
+ import { createExpressDevNotesHandler } from '@the-portland-company/devnotes/express';
150
+
151
+ export const devNotesProxy = createExpressDevNotesHandler({
152
+ forge: {
153
+ baseUrl: process.env.FOCUS_FORGE_BASE_URL!,
154
+ pat: process.env.FOCUS_FORGE_PAT!,
155
+ projectName: process.env.FOCUS_FORGE_PROJECT_NAME || null,
156
+ },
157
+ async getCurrentUser(request) {
158
+ const authHeader = request.headers.get('authorization');
159
+ if (!authHeader) return null;
160
+ return { id: 'user-id', email: 'person@example.com' };
161
+ },
162
+ });
163
+ ```
85
164
 
86
165
  ## Storage model
87
166
 
package/dist/index.d.mts CHANGED
@@ -1,7 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { D as DevNotesClientAdapter, a as DevNotesUser, b as DevNotesConfig, B as BugReport, c as BugReportType, T as TaskList, d as BugReportCreator, e as DevNotesCapabilities, f as DevNotesAppLinkStatus, N as NotifyEvent, A as AiProvider, g as DevNotesRole, h as DevNotesClientOptions, i as BugCaptureContext } from './types-xqGNcAbZ.mjs';
4
- export { j as AiAssistResult, k as AiConversationMessage, l as BugReportCreateData, m as BugReportMessage, n as DevNotesLinkAppInput } from './types-xqGNcAbZ.mjs';
3
+ import { D as DevNotesClientAdapter, a as DevNotesUser, b as DevNotesConfig, B as BugReport, c as BugReportType, T as TaskList, d as BugReportCreator, N as NotifyEvent, A as AiProvider, e as DevNotesRole, f as BugCaptureContext } from './types-CBHExs2F.mjs';
4
+ export { g as AiAssistResult, h as AiConversationMessage, i as BugReportCreateData, j as BugReportMessage } from './types-CBHExs2F.mjs';
5
+ import { D as DevNotesCapabilities, a as DevNotesAppLinkStatus, b as DevNotesClientOptions } from './types-CrmObeqp.mjs';
6
+ export { c as DevNotesLinkAppInput } from './types-CrmObeqp.mjs';
5
7
 
6
8
  type DevNotesContextValue = {
7
9
  isEnabled: boolean;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { D as DevNotesClientAdapter, a as DevNotesUser, b as DevNotesConfig, B as BugReport, c as BugReportType, T as TaskList, d as BugReportCreator, e as DevNotesCapabilities, f as DevNotesAppLinkStatus, N as NotifyEvent, A as AiProvider, g as DevNotesRole, h as DevNotesClientOptions, i as BugCaptureContext } from './types-xqGNcAbZ.js';
4
- export { j as AiAssistResult, k as AiConversationMessage, l as BugReportCreateData, m as BugReportMessage, n as DevNotesLinkAppInput } from './types-xqGNcAbZ.js';
3
+ import { D as DevNotesClientAdapter, a as DevNotesUser, b as DevNotesConfig, B as BugReport, c as BugReportType, T as TaskList, d as BugReportCreator, N as NotifyEvent, A as AiProvider, e as DevNotesRole, f as BugCaptureContext } from './types-DqIxvo5g.js';
4
+ export { g as AiAssistResult, h as AiConversationMessage, i as BugReportCreateData, j as BugReportMessage } from './types-DqIxvo5g.js';
5
+ import { D as DevNotesCapabilities, a as DevNotesAppLinkStatus, b as DevNotesClientOptions } from './types-CrmObeqp.js';
6
+ export { c as DevNotesLinkAppInput } from './types-CrmObeqp.js';
5
7
 
6
8
  type DevNotesContextValue = {
7
9
  isEnabled: boolean;
@@ -1,4 +1,5 @@
1
- import { e as DevNotesCapabilities, f as DevNotesAppLinkStatus, n as DevNotesLinkAppInput, B as BugReport, l as BugReportCreateData, c as BugReportType, T as TaskList, m as BugReportMessage, d as BugReportCreator, k as AiConversationMessage, i as BugCaptureContext, j as AiAssistResult } from './types-xqGNcAbZ.js';
1
+ import { D as DevNotesCapabilities, a as DevNotesAppLinkStatus, c as DevNotesLinkAppInput } from './types-CrmObeqp.js';
2
+ import { B as BugReport, i as BugReportCreateData, c as BugReportType, T as TaskList, j as BugReportMessage, d as BugReportCreator, h as AiConversationMessage, f as BugCaptureContext, g as AiAssistResult } from './types-DqIxvo5g.js';
2
3
 
3
4
  type DevNotesProxyRequest = {
4
5
  method: string;
@@ -1,4 +1,5 @@
1
- import { e as DevNotesCapabilities, f as DevNotesAppLinkStatus, n as DevNotesLinkAppInput, B as BugReport, l as BugReportCreateData, c as BugReportType, T as TaskList, m as BugReportMessage, d as BugReportCreator, k as AiConversationMessage, i as BugCaptureContext, j as AiAssistResult } from './types-xqGNcAbZ.mjs';
1
+ import { D as DevNotesCapabilities, a as DevNotesAppLinkStatus, c as DevNotesLinkAppInput } from './types-CrmObeqp.mjs';
2
+ import { B as BugReport, i as BugReportCreateData, c as BugReportType, T as TaskList, j as BugReportMessage, d as BugReportCreator, h as AiConversationMessage, f as BugCaptureContext, g as AiAssistResult } from './types-CBHExs2F.mjs';
2
3
 
3
4
  type DevNotesProxyRequest = {
4
5
  method: string;
@@ -0,0 +1,5 @@
1
+ import { d as DevNotesServerOptions } from '../types-CrmObeqp.mjs';
2
+
3
+ declare function createDenoDevNotesHandler(options: DevNotesServerOptions): (request: Request) => Promise<Response>;
4
+
5
+ export { createDenoDevNotesHandler };
@@ -0,0 +1,5 @@
1
+ import { d as DevNotesServerOptions } from '../types-CrmObeqp.js';
2
+
3
+ declare function createDenoDevNotesHandler(options: DevNotesServerOptions): (request: Request) => Promise<Response>;
4
+
5
+ export { createDenoDevNotesHandler };