@pygmalionjs/pygmalion 0.2.16 → 0.2.17
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 +20 -0
- package/dist-lib/pygmalion.js +974 -899
- package/node/dev-mirror.mjs +44 -0
- package/package.json +1 -1
- package/types.d.ts +37 -0
package/README.md
CHANGED
|
@@ -116,6 +116,26 @@ mirror.sourceRef; // what it is tracking now
|
|
|
116
116
|
to a throwaway commit, leaving your branch, HEAD, and index untouched. It covers
|
|
117
117
|
tracked changes only; untracked files raise a warning on the returned status.
|
|
118
118
|
|
|
119
|
+
To offer a choice instead of asking for a ref string, list the revisions and
|
|
120
|
+
render the shipped control in your toolbar:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
const { sourceRefs, switchSource, mirror } = usePygmalionProject();
|
|
124
|
+
|
|
125
|
+
<SourceRefControl
|
|
126
|
+
value={mirror.sourceRef}
|
|
127
|
+
refs={sourceRefs.refs}
|
|
128
|
+
defaultRef={sourceRefs.defaultRef}
|
|
129
|
+
worktreeRef={sourceRefs.worktreeRef}
|
|
130
|
+
busy={mirror.state === 'syncing'}
|
|
131
|
+
onChange={(ref) => void switchSource(ref)}
|
|
132
|
+
/>;
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`GET /__pygmalion-dev-control/refs` backs this list with local branches, remote
|
|
136
|
+
tracking branches, the default revision, and the worktree ref. `loadSourceRefs()`
|
|
137
|
+
reloads it after branches change.
|
|
138
|
+
|
|
119
139
|
Preview artifacts are cached per source SHA, so switching invalidates that cache
|
|
120
140
|
and the next capture runs again from scratch. A capture already running for the
|
|
121
141
|
previous revision is discarded instead of published, so it cannot overwrite the
|