ripplo 0.14.0 → 0.15.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/dist/{chunk-BQ25IGJS.js → chunk-5JXP37ET.js} +1 -1
- package/dist/{chunk-3ZQRLG7C.js → chunk-5PICILBD.js} +1 -1
- package/dist/{chunk-U4LFIMDP.js → chunk-ANAQCK5G.js} +1 -1
- package/dist/{chunk-ULIHURY6.js → chunk-AUXGLJ3J.js} +1 -1
- package/dist/{chunk-GTB7NYDE.js → chunk-BTIQ5H3K.js} +1 -1
- package/dist/{chunk-R3FZ2JEW.js → chunk-EVEITUJH.js} +1 -1
- package/dist/{chunk-PWDBRLJP.js → chunk-EYILCSW6.js} +1 -1
- package/dist/chunk-F4UCCW7Q.js +83 -0
- package/dist/chunk-IRT6UHD3.js +61 -0
- package/dist/{chunk-AVBTPZUU.js → chunk-IVW5DUE4.js} +1 -1
- package/dist/{chunk-B5HDXHPI.js → chunk-JPXTGKSB.js} +2 -2
- package/dist/{chunk-ZGWV564Y.js → chunk-KL6TIUNF.js} +1 -1
- package/dist/{chunk-NXKOUVSC.js → chunk-KOZTQJBB.js} +18 -18
- package/dist/{chunk-75T33SK5.js → chunk-NUBMOTH6.js} +1 -1
- package/dist/{chunk-6JXOIP2T.js → chunk-O4A5UISQ.js} +1 -1
- package/dist/{chunk-LEYSGMW2.js → chunk-QQ6VKZ6A.js} +1 -1
- package/dist/{chunk-56MARCN3.js → chunk-QSKOYBDO.js} +1 -1
- package/dist/{chunk-EOBWMMVC.js → chunk-RXLDAR2J.js} +1 -1
- package/dist/{chunk-Q7FIZGKZ.js → chunk-XPOOWIRL.js} +1 -1
- package/dist/{cli-error-N7X2CREI.js → cli-error-7LCAN3Z5.js} +1 -1
- package/dist/{compile-write-XMVD5PX2.js → compile-write-Y5III4OM.js} +1 -1
- package/dist/daemon-6UYMYGPI.js +175 -0
- package/dist/{daemon-DARMT5AV.js → daemon-EITBDEP7.js} +1 -1
- package/dist/{dsl-loader-SSXMC5EE.js → dsl-loader-ASNZDV7E.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{plan-reminder-K7HOFGJN.js → plan-reminder-6VWOS6HD.js} +1 -1
- package/dist/{post-edit-OI6DDU25.js → post-edit-A5Y26UH5.js} +1 -1
- package/dist/post-edit-analyze-2SBNWX6Y.js +4 -0
- package/dist/{post-edit-flag-stubs-IKIH5DAH.js → post-edit-flag-stubs-I43B5QPO.js} +1 -1
- package/dist/{pre-edit-IOWNUOZY.js → pre-edit-HJVNM7U5.js} +1 -1
- package/dist/{pre-edit-watch-gate-N7FI5HBA.js → pre-edit-watch-gate-G6BVWIDL.js} +1 -1
- package/dist/{prompt-submit-ZU466ET5.js → prompt-submit-OXYVNXHK.js} +1 -1
- package/dist/status-XUIBJXNP.js +4 -0
- package/dist/{stop-enforce-4UUK36YU.js → stop-enforce-BP6IIW3D.js} +1 -1
- package/package.json +5 -5
- package/dist/chunk-NIC2DOQW.js +0 -51
- package/dist/chunk-PVRM4YWS.js +0 -83
- package/dist/daemon-ZUDQ7ERI.js +0 -152
- package/dist/post-edit-analyze-6V5YI3CR.js +0 -4
- package/dist/status-OSHZ3JGU.js +0 -4
package/dist/chunk-NIC2DOQW.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __ripploCreateRequire } from "node:module";
|
|
3
|
-
const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
|
|
4
|
-
import{c as R}from"./chunk-JS3DLVVI.js";import{f as I,j as v,m as x}from"./chunk-BQ25IGJS.js";import{Ka as k,Ma as P,U as h,sa as w}from"./chunk-NXKOUVSC.js";import{a as S,f as m}from"./chunk-KH4QH23U.js";import{d as a,f}from"./chunk-C7SV6AR2.js";import y from"fs";import p from"path";function D(e){try{let n=C(e);if(n==null)return;let t=p.join(n,"HEAD"),o=y.readFileSync(t,"utf8").trim(),r="ref: refs/heads/";return o.startsWith(r)?o.slice(r.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function C(e){let n=p.join(e,".git");if(y.statSync(n).isDirectory())return n;let o=y.readFileSync(n,"utf8").trim(),r="gitdir:";if(!o.startsWith(r))return;let i=o.slice(r.length).trim();if(i.length!==0)return p.resolve(e,i)}import T from"crypto";import{readFile as j}from"fs/promises";import $ from"path";import{graphql as g}from"gql.tada";import{err as F,ok as W}from"neverthrow";var O=g(`
|
|
5
|
-
mutation SyncDevSession(
|
|
6
|
-
$projectId: String!
|
|
7
|
-
$cwd: String!
|
|
8
|
-
$branch: String
|
|
9
|
-
$lockfileContent: String
|
|
10
|
-
$fixtures: [SyncDevFixtureInput!]
|
|
11
|
-
$workflows: [SyncDevWorkflowInput!]!
|
|
12
|
-
) {
|
|
13
|
-
syncDevSession(
|
|
14
|
-
projectId: $projectId
|
|
15
|
-
cwd: $cwd
|
|
16
|
-
branch: $branch
|
|
17
|
-
lockfileContent: $lockfileContent
|
|
18
|
-
fixtures: $fixtures
|
|
19
|
-
workflows: $workflows
|
|
20
|
-
) {
|
|
21
|
-
id
|
|
22
|
-
hooksPaused
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
`);async function ae(e,n){let t=await x(e);if(t.isErr())return F({error:t.error,kind:"compilation-failed"});let o=await u({config:n,cwd:e,lockfile:t.value});return W({devSessionId:o.devSessionId,lockfile:t.value})}async function u(e){let n=k(e.lockfile);return B({config:e.config,cwd:e.cwd,fixtures:e.lockfile.fixtures,payload:n})}var H=g(`
|
|
26
|
-
query DevSessionSyncState($projectId: String!, $cwd: String!) {
|
|
27
|
-
project(id: $projectId) {
|
|
28
|
-
devSession(cwd: $cwd) {
|
|
29
|
-
id
|
|
30
|
-
hooksPaused
|
|
31
|
-
lockfileHash
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`),_=g(`
|
|
36
|
-
mutation AnnounceDevSessionActive($projectId: String!, $cwd: String!) {
|
|
37
|
-
announceDevSessionActive(projectId: $projectId, cwd: $cwd)
|
|
38
|
-
}
|
|
39
|
-
`);async function le(e){let n=await q(e.cwd);if(n!=null){let o=(await a({config:e.config,document:H,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null))?.project?.devSession;if(o!=null&&o.lockfileHash===n)return await a({config:e.config,document:_,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null),{devSessionId:o.id,hooksPaused:o.hooksPaused}}return u(e)}async function q(e){let n=await A(e);return n==null?null:b(n)}function de(e){return b(h(w,e))}function b(e){return T.createHash("sha256").update(e).digest("hex")}async function B({config:e,cwd:n,fixtures:t,payload:o}){let r=D(n),i=await A(n),l=await M(n,t),s=await a({config:e,document:O,variables:{branch:r??null,cwd:n,fixtures:l,lockfileContent:i,projectId:e.projectId,workflows:o.workflows.map(c=>({expectedOutcome:c.expectedOutcome,name:c.name,slug:c.slug,sourcePath:c.sourcePath,spec:JSON.stringify(c.spec)}))}});if(s.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:s.syncDevSession.id,hooksPaused:s.syncDevSession.hooksPaused}}async function M(e,n){let t=Object.entries(n);return Promise.all(t.map(async([o,r])=>({contentBase64:(await j($.join(e,I,o))).toString("base64"),sha256:r.sha256})))}async function A(e){try{return await j($.join(e,v),"utf8")}catch{return null}}import{graphql as G}from"gql.tada";var X=G(`
|
|
40
|
-
mutation AutoScopeAddDirty($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
|
|
41
|
-
addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
|
|
42
|
-
__typename
|
|
43
|
-
... on MutationAddDirtyTestsToScopeSuccess {
|
|
44
|
-
data {
|
|
45
|
-
id
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
`);async function we({cwd:e,editedPath:n,lockfile:t,requireHooks:o,syncFirst:r}){if(o&&!m(e))return{addedSlugs:[]};let i=new Set(U(e)),l=t.workflows.filter(d=>d.sourcePath!=null&&N({dirtySet:i,editedPath:n,sourcePath:d.sourcePath})).map(d=>P(d.name));if(l.length===0)return{addedSlugs:[]};let s=R(e).unwrapOr(void 0);return s==null?{addedSlugs:[]}:r&&!await J({cfg:s,cwd:e,lockfile:t})?{addedSlugs:[]}:{addedSlugs:await K({cfg:s,slugs:l})?l:[]}}async function J({cfg:e,cwd:n,lockfile:t}){return await u({config:e,cwd:n,lockfile:t}).catch(r=>(f.warn("auto-sync failed: %s",r instanceof Error?r.message:String(r)),null))!=null}async function K({cfg:e,slugs:n}){let o=(await a({config:e,document:X,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:[...n]}}).catch(r=>(f.warn("auto-scope failed: %s",r instanceof Error?r.message:String(r)),null)))?.addDirtyTestsToScope;return o?.__typename!=="MutationAddDirtyTestsToScopeSuccess"?!1:o.data.length>0}function N({dirtySet:e,editedPath:n,sourcePath:t}){return e.has(t)||n!=null&&n.endsWith(t)}var E=".ripplo/workflows/",L=" -> ";function U(e){let n;try{n=S(["status","--porcelain","-uall","--",".ripplo/workflows"],e)}catch{return[]}return n.split(`
|
|
51
|
-
`).map(t=>t.slice(3).trim()).map(t=>t.includes(L)?t.split(L)[1]:t).filter(t=>t!=null).filter(t=>t.startsWith(E)&&t.endsWith(".ts")).map(t=>t.slice(E.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}export{D as a,ae as b,u as c,le as d,q as e,de as f,we as g};
|