@pygmalionjs/pygmalion 0.2.11 → 0.2.12

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.ko.md CHANGED
@@ -37,23 +37,27 @@ npm install --save-dev @pygmalionjs/pygmalion
37
37
  호스트 애플리케이션에 `pygmalion.config.ts`를 만드세요.
38
38
 
39
39
  ```ts
40
- import path from 'node:path';
41
- import { definePygmalionProject } from '@pygmalionjs/pygmalion/vite';
40
+ import path from "node:path";
41
+ import { definePygmalionProject } from "@pygmalionjs/pygmalion/vite";
42
42
 
43
43
  const appRoot = import.meta.dirname;
44
- const projectRoot = path.resolve(appRoot, '..');
44
+ const projectRoot = path.resolve(appRoot, "..");
45
45
 
46
46
  export default definePygmalionProject({
47
47
  configRoot: appRoot,
48
48
  projectRoot,
49
49
  appRoot,
50
- appDirectory: 'frontend',
51
- sourceDirectory: 'src',
52
- source: { remote: 'origin', branch: 'dev' },
53
- mirrorRoot: path.resolve(projectRoot, '..', 'app-dev-view'),
50
+ appDirectory: "frontend",
51
+ sourceDirectory: "src",
52
+ source: { remote: "origin", branch: "dev" },
53
+ mirrorRoot: path.resolve(projectRoot, "..", "app-dev-view"),
54
54
  inventory: {
55
- script: path.join(appRoot, 'scripts', 'generate-pygmalion-inventory.mjs'),
55
+ script: path.join(appRoot, "scripts", "generate-pygmalion-inventory.mjs"),
56
56
  outputRoot: appRoot,
57
+ outputs: [
58
+ "src/generated/design-registry.ts",
59
+ "src/generated/design-inventory.ts",
60
+ ],
57
61
  },
58
62
  inspect: {
59
63
  normalizeValue(property, value) {
@@ -63,11 +67,15 @@ export default definePygmalionProject({
63
67
  });
64
68
  ```
65
69
 
70
+ `inventory.outputs`에는 애플리케이션 루트 기준으로 생성기가 소유하는 경로만
71
+ 등록합니다. Pygmalion은 전용 미러의 리비전을 전환하기 전에 이 경로만
72
+ 복구하며, 그 밖의 변경이 있으면 기존처럼 동기화를 중단합니다.
73
+
66
74
  호스트의 Vite 설정에 통합 플러그인을 추가하세요.
67
75
 
68
76
  ```ts
69
- import { createPygmalionVitePlugins } from '@pygmalionjs/pygmalion/vite';
70
- import pygmalionConfig from './pygmalion.config';
77
+ import { createPygmalionVitePlugins } from "@pygmalionjs/pygmalion/vite";
78
+ import pygmalionConfig from "./pygmalion.config";
71
79
 
72
80
  export default defineConfig({
73
81
  plugins: [react(), ...createPygmalionVitePlugins(pygmalionConfig)],
@@ -97,6 +105,24 @@ export default defineConfig({
97
105
  지원합니다. 각 프레임이 항상 같은 애플리케이션 상태를 재현하도록 결정적인
98
106
  레시피와 assertion을 사용하세요.
99
107
 
108
+ ## 캡처 산출물 생명주기
109
+
110
+ 범용 캡처 기능은 `@pygmalionjs/pygmalion/storyboard`에서 가져옵니다.
111
+ Pygmalion은 격리된 브라우저 컨텍스트, 제한된 병렬 스케줄링, 비활성 DOM
112
+ 스냅샷, 스크린샷, QA 진단, 압축된 버전 산출물, 정확한 리비전 검증, 원자적
113
+ 산출물 교체를 관리합니다. Vite 통합은 현재 에디터의 namespace와 소스
114
+ 리비전에 정확히 일치하는 산출물만 제공합니다.
115
+
116
+ 호스트 애플리케이션은 라우트, 환경 preset, 목 어댑터, 상호작용 recipe,
117
+ assertion만 제공합니다. 도메인별 네트워크 fixture는 호스트 hook에서 설치할
118
+ 수 있지만 브라우저나 산출물 생명주기를 별도로 구현하면 안 됩니다.
119
+
120
+ 산출물 v3는 등록한 모든 프레임을 `ready`,
121
+ `rendered-with-qa-failure`, `capture-error` 중 하나로 보존합니다. QA 실패는
122
+ CI를 실패 상태로 유지하면서 마지막으로 안정화된 DOM과 스크린샷을 남길 수
123
+ 있습니다. 따라서 엄격 캡처가 실패해도 이전 리비전의 산출물이 조용히 계속
124
+ 활성화되지 않습니다.
125
+
100
126
  ## 편집 흐름
101
127
 
102
128
  1. **Screens**를 엽니다. 프레임을 클릭하지 않아도 프리뷰 준비를 시작합니다.
package/README.md CHANGED
@@ -37,23 +37,27 @@ npm install --save-dev @pygmalionjs/pygmalion
37
37
  Create `pygmalion.config.ts` in the host application:
38
38
 
39
39
  ```ts
40
- import path from 'node:path';
41
- import { definePygmalionProject } from '@pygmalionjs/pygmalion/vite';
40
+ import path from "node:path";
41
+ import { definePygmalionProject } from "@pygmalionjs/pygmalion/vite";
42
42
 
43
43
  const appRoot = import.meta.dirname;
44
- const projectRoot = path.resolve(appRoot, '..');
44
+ const projectRoot = path.resolve(appRoot, "..");
45
45
 
46
46
  export default definePygmalionProject({
47
47
  configRoot: appRoot,
48
48
  projectRoot,
49
49
  appRoot,
50
- appDirectory: 'frontend',
51
- sourceDirectory: 'src',
52
- source: { remote: 'origin', branch: 'dev' },
53
- mirrorRoot: path.resolve(projectRoot, '..', 'app-dev-view'),
50
+ appDirectory: "frontend",
51
+ sourceDirectory: "src",
52
+ source: { remote: "origin", branch: "dev" },
53
+ mirrorRoot: path.resolve(projectRoot, "..", "app-dev-view"),
54
54
  inventory: {
55
- script: path.join(appRoot, 'scripts', 'generate-pygmalion-inventory.mjs'),
55
+ script: path.join(appRoot, "scripts", "generate-pygmalion-inventory.mjs"),
56
56
  outputRoot: appRoot,
57
+ outputs: [
58
+ "src/generated/design-registry.ts",
59
+ "src/generated/design-inventory.ts",
60
+ ],
57
61
  },
58
62
  inspect: {
59
63
  normalizeValue(property, value) {
@@ -63,11 +67,15 @@ export default definePygmalionProject({
63
67
  });
64
68
  ```
65
69
 
70
+ `inventory.outputs` lists generator-owned paths relative to the application root. Pygmalion
71
+ restores only these paths in its dedicated mirror before switching revisions, while any other
72
+ mirror change still stops synchronization.
73
+
66
74
  Add the integration plugins to the host Vite configuration:
67
75
 
68
76
  ```ts
69
- import { createPygmalionVitePlugins } from '@pygmalionjs/pygmalion/vite';
70
- import pygmalionConfig from './pygmalion.config';
77
+ import { createPygmalionVitePlugins } from "@pygmalionjs/pygmalion/vite";
78
+ import pygmalionConfig from "./pygmalion.config";
71
79
 
72
80
  export default defineConfig({
73
81
  plugins: [react(), ...createPygmalionVitePlugins(pygmalionConfig)],
@@ -97,6 +105,24 @@ Screen recipes support `click`, `fill`, `check`, `press`, `wait`, and `storage`
97
105
  steps. Use deterministic recipes and assertions so each frame represents a
98
106
  repeatable application state.
99
107
 
108
+ ## Capture artifact lifecycle
109
+
110
+ Import the reusable capture primitives from
111
+ `@pygmalionjs/pygmalion/storyboard`. Pygmalion owns isolated browser contexts,
112
+ bounded scheduling, inert DOM snapshots, screenshots, QA diagnostics, compact
113
+ versioned artifacts, exact revision validation, and atomic artifact
114
+ publication. The Vite integration serves only an artifact whose namespace and
115
+ source revision match the active editor.
116
+
117
+ The host application supplies routes, environment presets, mock adapters,
118
+ interaction recipes, and assertions. A host hook may install domain-specific
119
+ network fixtures, but it must not fork the browser or artifact lifecycle.
120
+
121
+ Artifact v3 preserves every registered frame with one explicit outcome:
122
+ `ready`, `rendered-with-qa-failure`, or `capture-error`. QA failures can retain
123
+ their last stable DOM and screenshot while CI remains red. A failed strict
124
+ capture therefore cannot silently leave an older artifact active.
125
+
100
126
  ## Editing workflow
101
127
 
102
128
  1. Open **Screens**. Preview warm-up starts without requiring frame clicks.