storybook-onbook-plugin 0.2.1 → 0.2.3

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.
Files changed (66) hide show
  1. package/dist/cli/index.d.ts +1 -0
  2. package/dist/cli/index.js +395 -0
  3. package/dist/index.d.ts +11 -2
  4. package/dist/index.js +453 -1
  5. package/dist/screenshot-service/index.d.ts +46 -4
  6. package/dist/screenshot-service/index.js +213 -5
  7. package/dist/screenshot-service/utils/browser/index.d.ts +12 -2
  8. package/dist/screenshot-service/utils/browser/index.js +25 -1
  9. package/package.json +28 -9
  10. package/dist/cli/generate-screenshots.d.ts +0 -3
  11. package/dist/cli/generate-screenshots.d.ts.map +0 -1
  12. package/dist/cli/generate-screenshots.js +0 -169
  13. package/dist/component-loc/component-loc.d.ts +0 -7
  14. package/dist/component-loc/component-loc.d.ts.map +0 -1
  15. package/dist/component-loc/component-loc.js +0 -58
  16. package/dist/component-loc/index.d.ts +0 -2
  17. package/dist/component-loc/index.d.ts.map +0 -1
  18. package/dist/component-loc/index.js +0 -1
  19. package/dist/handlers/handleStoryFileChange/handleStoryFileChange.d.ts +0 -3
  20. package/dist/handlers/handleStoryFileChange/handleStoryFileChange.d.ts.map +0 -1
  21. package/dist/handlers/handleStoryFileChange/handleStoryFileChange.js +0 -100
  22. package/dist/handlers/handleStoryFileChange/index.d.ts +0 -2
  23. package/dist/handlers/handleStoryFileChange/index.d.ts.map +0 -1
  24. package/dist/handlers/handleStoryFileChange/index.js +0 -1
  25. package/dist/index.d.ts.map +0 -1
  26. package/dist/screenshot-service/constants.d.ts +0 -8
  27. package/dist/screenshot-service/constants.d.ts.map +0 -1
  28. package/dist/screenshot-service/constants.js +0 -11
  29. package/dist/screenshot-service/index.d.ts.map +0 -1
  30. package/dist/screenshot-service/screenshot-service.d.ts +0 -8
  31. package/dist/screenshot-service/screenshot-service.d.ts.map +0 -1
  32. package/dist/screenshot-service/screenshot-service.js +0 -36
  33. package/dist/screenshot-service/types.d.ts +0 -18
  34. package/dist/screenshot-service/types.d.ts.map +0 -1
  35. package/dist/screenshot-service/types.js +0 -1
  36. package/dist/screenshot-service/utils/browser/browser.d.ts +0 -10
  37. package/dist/screenshot-service/utils/browser/browser.d.ts.map +0 -1
  38. package/dist/screenshot-service/utils/browser/browser.js +0 -29
  39. package/dist/screenshot-service/utils/browser/index.d.ts.map +0 -1
  40. package/dist/screenshot-service/utils/screenshot/index.d.ts +0 -2
  41. package/dist/screenshot-service/utils/screenshot/index.d.ts.map +0 -1
  42. package/dist/screenshot-service/utils/screenshot/index.js +0 -1
  43. package/dist/screenshot-service/utils/screenshot/screenshot.d.ts +0 -26
  44. package/dist/screenshot-service/utils/screenshot/screenshot.d.ts.map +0 -1
  45. package/dist/screenshot-service/utils/screenshot/screenshot.js +0 -128
  46. package/dist/storybook-onlook-plugin.d.ts +0 -9
  47. package/dist/storybook-onlook-plugin.d.ts.map +0 -1
  48. package/dist/storybook-onlook-plugin.js +0 -148
  49. package/dist/utils/fileSystem/fileSystem.d.ts +0 -9
  50. package/dist/utils/fileSystem/fileSystem.d.ts.map +0 -1
  51. package/dist/utils/fileSystem/fileSystem.js +0 -24
  52. package/dist/utils/fileSystem/index.d.ts +0 -2
  53. package/dist/utils/fileSystem/index.d.ts.map +0 -1
  54. package/dist/utils/fileSystem/index.js +0 -1
  55. package/dist/utils/findGitRoot/findGitRoot.d.ts +0 -5
  56. package/dist/utils/findGitRoot/findGitRoot.d.ts.map +0 -1
  57. package/dist/utils/findGitRoot/findGitRoot.js +0 -15
  58. package/dist/utils/findGitRoot/index.d.ts +0 -2
  59. package/dist/utils/findGitRoot/index.d.ts.map +0 -1
  60. package/dist/utils/findGitRoot/index.js +0 -1
  61. package/dist/utils/manifest/index.d.ts +0 -2
  62. package/dist/utils/manifest/index.d.ts.map +0 -1
  63. package/dist/utils/manifest/index.js +0 -1
  64. package/dist/utils/manifest/manifest.d.ts +0 -21
  65. package/dist/utils/manifest/manifest.d.ts.map +0 -1
  66. package/dist/utils/manifest/manifest.js +0 -44
@@ -1 +0,0 @@
1
- export { computeFileHash, ensureCacheDirectories } from './fileSystem.js';
@@ -1,5 +0,0 @@
1
- /**
2
- * Find the git repository root by walking up the directory tree
3
- */
4
- export declare function findGitRoot(startPath: string): string | null;
5
- //# sourceMappingURL=findGitRoot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findGitRoot.d.ts","sourceRoot":"","sources":["../../../src/utils/findGitRoot/findGitRoot.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW5D"}
@@ -1,15 +0,0 @@
1
- import { existsSync } from 'node:fs';
2
- import { dirname, join } from 'node:path';
3
- /**
4
- * Find the git repository root by walking up the directory tree
5
- */
6
- export function findGitRoot(startPath) {
7
- let currentPath = startPath;
8
- while (currentPath !== dirname(currentPath)) {
9
- if (existsSync(join(currentPath, '.git'))) {
10
- return currentPath;
11
- }
12
- currentPath = dirname(currentPath);
13
- }
14
- return null;
15
- }
@@ -1,2 +0,0 @@
1
- export { findGitRoot } from './findGitRoot.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/findGitRoot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- export { findGitRoot } from './findGitRoot.js';
@@ -1,2 +0,0 @@
1
- export { getManifestEntry, loadManifest, saveManifest, updateManifest, } from './manifest.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAC"}
@@ -1 +0,0 @@
1
- export { getManifestEntry, loadManifest, saveManifest, updateManifest, } from './manifest.js';
@@ -1,21 +0,0 @@
1
- import type { Manifest, ScreenshotMetadata } from '../../screenshot-service/types.js';
2
- /**
3
- * Load manifest from disk
4
- */
5
- export declare function loadManifest(): Manifest;
6
- /**
7
- * Save manifest to disk
8
- */
9
- export declare function saveManifest(manifest: Manifest): void;
10
- /**
11
- * Get manifest entry for a story
12
- */
13
- export declare function getManifestEntry(storyId: string): ScreenshotMetadata | null;
14
- /**
15
- * Update manifest for a story
16
- */
17
- export declare function updateManifest(storyId: string, sourcePath: string, fileHash: string, boundingBox?: {
18
- width: number;
19
- height: number;
20
- } | null): void;
21
- //# sourceMappingURL=manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/utils/manifest/manifest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGtF;;GAEG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAMvC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,QAG9C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAG3E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,QAgBvD"}
@@ -1,44 +0,0 @@
1
- import fs from 'node:fs';
2
- import { MANIFEST_PATH } from '../../screenshot-service/constants.js';
3
- import { ensureCacheDirectories } from '../fileSystem/index.js';
4
- /**
5
- * Load manifest from disk
6
- */
7
- export function loadManifest() {
8
- if (fs.existsSync(MANIFEST_PATH)) {
9
- const content = fs.readFileSync(MANIFEST_PATH, 'utf-8');
10
- return JSON.parse(content);
11
- }
12
- return { stories: {} };
13
- }
14
- /**
15
- * Save manifest to disk
16
- */
17
- export function saveManifest(manifest) {
18
- ensureCacheDirectories();
19
- fs.writeFileSync(MANIFEST_PATH, JSON.stringify(manifest, null, 2));
20
- }
21
- /**
22
- * Get manifest entry for a story
23
- */
24
- export function getManifestEntry(storyId) {
25
- const manifest = loadManifest();
26
- return manifest.stories[storyId] || null;
27
- }
28
- /**
29
- * Update manifest for a story
30
- */
31
- export function updateManifest(storyId, sourcePath, fileHash, boundingBox) {
32
- const manifest = loadManifest();
33
- manifest.stories[storyId] = {
34
- fileHash,
35
- lastGenerated: new Date().toISOString(),
36
- sourcePath,
37
- screenshots: {
38
- light: `screenshots/${storyId}/light.png`,
39
- dark: `screenshots/${storyId}/dark.png`,
40
- },
41
- boundingBox: boundingBox ?? undefined,
42
- };
43
- saveManifest(manifest);
44
- }