dev-annotate 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -38,7 +38,7 @@ injected DOM and listeners.
38
38
 
39
39
  ```ts
40
40
  import { createSaveAnnotationHandler } from 'dev-annotate/server'
41
- export default createSaveAnnotationHandler({ dir: '.playwright-mcp/design-review' })
41
+ export default createSaveAnnotationHandler({ dir: '.dev-annotations' })
42
42
  ```
43
43
 
44
44
  Or use the pure writer directly:
package/dist/cli.js CHANGED
@@ -25,7 +25,7 @@ function latestAnnotation(dir) {
25
25
  // src/server/save.ts
26
26
  import { mkdirSync, writeFileSync } from "fs";
27
27
  import { resolve } from "path";
28
- var DEFAULT_DIR = ".playwright-mcp/design-review";
28
+ var DEFAULT_DIR = ".dev-annotations";
29
29
 
30
30
  // src/cli/index.ts
31
31
  function parseFlags(args) {
@@ -13,11 +13,11 @@ var DEFAULTS = {
13
13
 
14
14
  // src/core/client.ts
15
15
  function initDevAnnotation(options = {}) {
16
- const endpoint = options.endpoint ?? DEFAULTS.endpoint;
17
- const colors = options.colors ?? DEFAULTS.colors;
18
- const sizePresets = options.sizes ?? DEFAULTS.sizes;
19
- const shortcutKey = (options.shortcutKey ?? DEFAULTS.shortcutKey).toLowerCase();
20
- const z = options.zIndexBase ?? DEFAULTS.zIndexBase;
16
+ const endpoint = typeof options.endpoint === "string" && options.endpoint ? options.endpoint : DEFAULTS.endpoint;
17
+ const colors = Array.isArray(options.colors) && options.colors.length ? options.colors : DEFAULTS.colors;
18
+ const sizePresets = Array.isArray(options.sizes) && options.sizes.length ? options.sizes : DEFAULTS.sizes;
19
+ const shortcutKey = (typeof options.shortcutKey === "string" && options.shortcutKey ? options.shortcutKey : DEFAULTS.shortcutKey).toLowerCase();
20
+ const z = typeof options.zIndexBase === "number" ? options.zIndexBase : DEFAULTS.zIndexBase;
21
21
  const nodes = [];
22
22
  const cleanups = [];
23
23
  const track = (n) => {
@@ -1,7 +1,7 @@
1
1
  import { D as DevAnnotationOptions } from '../types-BzKl2hyk.js';
2
2
 
3
3
  interface ModuleOptions extends DevAnnotationOptions {
4
- /** Server-side save directory. Default '.playwright-mcp/design-review'. */
4
+ /** Server-side save directory. Default '.dev-annotations'. */
5
5
  dir?: string;
6
6
  }
7
7
  declare const _default: NuxtModule<TOptions, TOptions, false>;
@@ -6,15 +6,15 @@ var module_default = defineNuxtModule({
6
6
  setup(options, nuxt) {
7
7
  if (!nuxt.options.dev) return;
8
8
  const resolver = createResolver(import.meta.url);
9
+ const publicConfig = {};
10
+ if (options.endpoint !== void 0) publicConfig.endpoint = options.endpoint;
11
+ if (options.colors !== void 0) publicConfig.colors = options.colors;
12
+ if (options.sizes !== void 0) publicConfig.sizes = options.sizes;
13
+ if (options.shortcutKey !== void 0) publicConfig.shortcutKey = options.shortcutKey;
14
+ if (options.zIndexBase !== void 0) publicConfig.zIndexBase = options.zIndexBase;
9
15
  nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public ?? {};
10
- nuxt.options.runtimeConfig.public.devAnnotate = {
11
- endpoint: options.endpoint,
12
- colors: options.colors,
13
- sizes: options.sizes,
14
- shortcutKey: options.shortcutKey,
15
- zIndexBase: options.zIndexBase
16
- };
17
- nuxt.options.runtimeConfig.devAnnotate = { dir: options.dir };
16
+ nuxt.options.runtimeConfig.public.devAnnotate = publicConfig;
17
+ nuxt.options.runtimeConfig.devAnnotate = options.dir !== void 0 ? { dir: options.dir } : {};
18
18
  addPlugin({ src: resolver.resolve("./runtime/plugin.client.js"), mode: "client" });
19
19
  addServerHandler({
20
20
  route: options.endpoint ?? "/api/dev/save-annotation",
@@ -16,11 +16,11 @@ var DEFAULTS = {
16
16
 
17
17
  // src/core/client.ts
18
18
  function initDevAnnotation(options = {}) {
19
- const endpoint = options.endpoint ?? DEFAULTS.endpoint;
20
- const colors = options.colors ?? DEFAULTS.colors;
21
- const sizePresets = options.sizes ?? DEFAULTS.sizes;
22
- const shortcutKey = (options.shortcutKey ?? DEFAULTS.shortcutKey).toLowerCase();
23
- const z = options.zIndexBase ?? DEFAULTS.zIndexBase;
19
+ const endpoint = typeof options.endpoint === "string" && options.endpoint ? options.endpoint : DEFAULTS.endpoint;
20
+ const colors = Array.isArray(options.colors) && options.colors.length ? options.colors : DEFAULTS.colors;
21
+ const sizePresets = Array.isArray(options.sizes) && options.sizes.length ? options.sizes : DEFAULTS.sizes;
22
+ const shortcutKey = (typeof options.shortcutKey === "string" && options.shortcutKey ? options.shortcutKey : DEFAULTS.shortcutKey).toLowerCase();
23
+ const z = typeof options.zIndexBase === "number" ? options.zIndexBase : DEFAULTS.zIndexBase;
24
24
  const nodes = [];
25
25
  const cleanups = [];
26
26
  const track = (n) => {
@@ -12,7 +12,7 @@ function resolveExt(input) {
12
12
  // src/server/save.ts
13
13
  import { mkdirSync, writeFileSync } from "fs";
14
14
  import { resolve } from "path";
15
- var DEFAULT_DIR = ".playwright-mcp/design-review";
15
+ var DEFAULT_DIR = ".dev-annotations";
16
16
  function saveAnnotationBytes(data, opts = {}) {
17
17
  const dir = resolve(process.cwd(), opts.dir ?? DEFAULT_DIR);
18
18
  mkdirSync(dir, { recursive: true });
@@ -14,7 +14,7 @@ interface SaveAnnotationResult {
14
14
  path: string;
15
15
  bytes: number;
16
16
  }
17
- declare const DEFAULT_DIR = ".playwright-mcp/design-review";
17
+ declare const DEFAULT_DIR = ".dev-annotations";
18
18
  declare function saveAnnotationBytes(data: Uint8Array, opts?: SaveAnnotationOptions): SaveAnnotationResult;
19
19
 
20
20
  interface SaveHandlerOptions {
@@ -9,7 +9,7 @@ function resolveExt(input) {
9
9
  // src/server/save.ts
10
10
  import { mkdirSync, writeFileSync } from "fs";
11
11
  import { resolve } from "path";
12
- var DEFAULT_DIR = ".playwright-mcp/design-review";
12
+ var DEFAULT_DIR = ".dev-annotations";
13
13
  function saveAnnotationBytes(data, opts = {}) {
14
14
  const dir = resolve(process.cwd(), opts.dir ?? DEFAULT_DIR);
15
15
  mkdirSync(dir, { recursive: true });
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
- {
2
- "name": "dev-annotate",
3
- "version": "0.1.0",
4
- "description": "Dev-only on-screen annotation tool: scribble on the live page, take an OS screenshot, upload it for an AI agent to read.",
5
- "type": "module",
6
- "license": "MIT",
7
- "keywords": ["annotation", "screenshot", "dev-tool", "design-review", "ai", "nuxt"],
8
- "engines": { "node": ">=20" },
9
- "bin": { "dev-annotate": "dist/cli.js" },
10
- "exports": {
11
- ".": { "import": "./dist/core/client.js", "types": "./dist/core/client.d.ts" },
12
- "./server": { "import": "./dist/server/index.js", "types": "./dist/server/index.d.ts" },
13
- "./nuxt": { "import": "./dist/nuxt/module.js", "types": "./dist/nuxt/module.d.ts" }
14
- },
15
- "files": ["dist", "templates", "README.md", "LICENSE"],
16
- "scripts": {
17
- "build": "tsup",
18
- "typecheck": "tsc --noEmit",
19
- "test": "vitest run",
20
- "prepublishOnly": "tsup"
21
- },
22
- "peerDependencies": { "h3": "*", "@nuxt/kit": "*" },
23
- "peerDependenciesMeta": {
24
- "h3": { "optional": true },
25
- "@nuxt/kit": { "optional": true }
26
- },
27
- "devDependencies": {
28
- "@types/node": "^22.10.2",
29
- "tsup": "^8.5.1",
30
- "typescript": "^5.7.3",
31
- "vitest": "^3.2.4",
32
- "jsdom": "^25.0.0",
33
- "h3": "^1.13.0",
34
- "@nuxt/kit": "^3.14.0"
35
- }
36
- }
1
+ {
2
+ "name": "dev-annotate",
3
+ "version": "0.2.1",
4
+ "description": "Dev-only on-screen annotation tool: scribble on the live page, take an OS screenshot, upload it for an AI agent to read.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "keywords": ["annotation", "screenshot", "dev-tool", "design-review", "ai", "nuxt"],
8
+ "engines": { "node": ">=20" },
9
+ "bin": { "dev-annotate": "dist/cli.js" },
10
+ "exports": {
11
+ ".": { "import": "./dist/core/client.js", "types": "./dist/core/client.d.ts" },
12
+ "./server": { "import": "./dist/server/index.js", "types": "./dist/server/index.d.ts" },
13
+ "./nuxt": { "import": "./dist/nuxt/module.js", "types": "./dist/nuxt/module.d.ts" }
14
+ },
15
+ "files": ["dist", "templates", "README.md", "LICENSE"],
16
+ "scripts": {
17
+ "build": "tsup",
18
+ "typecheck": "tsc --noEmit",
19
+ "test": "vitest run",
20
+ "prepublishOnly": "tsup"
21
+ },
22
+ "peerDependencies": { "h3": "*", "@nuxt/kit": "*" },
23
+ "peerDependenciesMeta": {
24
+ "h3": { "optional": true },
25
+ "@nuxt/kit": { "optional": true }
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^22.10.2",
29
+ "tsup": "^8.5.1",
30
+ "typescript": "^5.7.3",
31
+ "vitest": "^3.2.4",
32
+ "jsdom": "^25.0.0",
33
+ "h3": "^1.13.0",
34
+ "@nuxt/kit": "^3.14.0"
35
+ }
36
+ }
@@ -25,7 +25,7 @@ annotated screenshot and act on it.
25
25
  ```
26
26
 
27
27
  ## Notes
28
- - Screenshots live under `.playwright-mcp/design-review/annotated-*.{png,jpg,webp}`
28
+ - Screenshots live under `.dev-annotations/annotated-*.{png,jpg,webp}`
29
29
  by default (override with `--dir`).
30
30
  - Treat an annotation as intent, not pixels: confirm the underlying cause
31
31
  before changing how something looks.