@gadgetinc/ggt 1.3.0 → 1.3.2
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/{add-VYOF3CRL.js → add-OTQMXZUR.js} +2 -2
- package/dist/{chunk-LQDBD3BI.js → chunk-3HRT72TB.js} +4 -4
- package/dist/{chunk-LQDBD3BI.js.map → chunk-3HRT72TB.js.map} +2 -2
- package/dist/{chunk-3B5DKR5D.js → chunk-AGRDDZFS.js} +2 -2
- package/dist/{chunk-VE2URKOG.js → chunk-BKO2TX4J.js} +2 -2
- package/dist/{chunk-JU6IEBE5.js → chunk-GIAIN3IJ.js} +10 -10
- package/dist/{chunk-JU6IEBE5.js.map → chunk-GIAIN3IJ.js.map} +4 -4
- package/dist/{chunk-ENT5WEIR.js → chunk-HCQR6OPH.js} +2 -2
- package/dist/{chunk-CQH5IRAO.js → chunk-O2K4B6AL.js} +3 -3
- package/dist/{chunk-J5XIQ6N4.js → chunk-PC6ANBC6.js} +3 -3
- package/dist/{chunk-J5XIQ6N4.js.map → chunk-PC6ANBC6.js.map} +1 -1
- package/dist/{chunk-ZHG3WLFU.js → chunk-W4IVYUHW.js} +2 -2
- package/dist/{chunk-WBESFPTY.js → chunk-W5JAWOQQ.js} +2 -2
- package/dist/{chunk-YQO2R55C.js → chunk-XB3JTJT6.js} +2 -2
- package/dist/deploy-RK5PRQ4T.js +25 -0
- package/dist/deploy-RK5PRQ4T.js.map +7 -0
- package/dist/{dev-G77WSGIC.js → dev-J6QHZMPR.js} +2 -2
- package/dist/{esm-3OYJEC4Z.js → esm-46TFUFSK.js} +22 -22
- package/dist/{esm-3OYJEC4Z.js.map → esm-46TFUFSK.js.map} +3 -3
- package/dist/{list-3AI2FD3F.js → list-A7LFGUXG.js} +2 -2
- package/dist/login-BP4XIHLA.js +2 -0
- package/dist/{logout-CN5DL7Z2.js → logout-PPA6JCDY.js} +2 -2
- package/dist/main.js +1 -1
- package/dist/{open-PM56SR6Z.js → open-OZDKOY6V.js} +2 -2
- package/dist/{pull-TAW6KHZO.js → pull-YLUFPDDX.js} +4 -4
- package/dist/{pull-TAW6KHZO.js.map → pull-YLUFPDDX.js.map} +2 -2
- package/dist/push-FFLXHGFG.js +2 -0
- package/dist/{status-WDYI4EOU.js → status-MP45HWIM.js} +2 -2
- package/dist/{version-3FBGIVXT.js → version-CXGPMLMK.js} +2 -2
- package/dist/{whoami-UALRX2FT.js → whoami-PPXXBHUR.js} +2 -2
- package/package.json +3 -3
- package/dist/deploy-EEJCK2MG.js +0 -25
- package/dist/deploy-EEJCK2MG.js.map +0 -7
- package/dist/login-UGTNK3B3.js +0 -2
- package/dist/push-2NCJSDGS.js +0 -2
- /package/dist/{add-VYOF3CRL.js.map → add-OTQMXZUR.js.map} +0 -0
- /package/dist/{chunk-3B5DKR5D.js.map → chunk-AGRDDZFS.js.map} +0 -0
- /package/dist/{chunk-VE2URKOG.js.map → chunk-BKO2TX4J.js.map} +0 -0
- /package/dist/{chunk-ENT5WEIR.js.map → chunk-HCQR6OPH.js.map} +0 -0
- /package/dist/{chunk-CQH5IRAO.js.map → chunk-O2K4B6AL.js.map} +0 -0
- /package/dist/{chunk-ZHG3WLFU.js.map → chunk-W4IVYUHW.js.map} +0 -0
- /package/dist/{chunk-WBESFPTY.js.map → chunk-W5JAWOQQ.js.map} +0 -0
- /package/dist/{chunk-YQO2R55C.js.map → chunk-XB3JTJT6.js.map} +0 -0
- /package/dist/{dev-G77WSGIC.js.map → dev-J6QHZMPR.js.map} +0 -0
- /package/dist/{list-3AI2FD3F.js.map → list-A7LFGUXG.js.map} +0 -0
- /package/dist/{login-UGTNK3B3.js.map → login-BP4XIHLA.js.map} +0 -0
- /package/dist/{logout-CN5DL7Z2.js.map → logout-PPA6JCDY.js.map} +0 -0
- /package/dist/{open-PM56SR6Z.js.map → open-OZDKOY6V.js.map} +0 -0
- /package/dist/{push-2NCJSDGS.js.map → push-FFLXHGFG.js.map} +0 -0
- /package/dist/{status-WDYI4EOU.js.map → status-MP45HWIM.js.map} +0 -0
- /package/dist/{version-3FBGIVXT.js.map → version-CXGPMLMK.js.map} +0 -0
- /package/dist/{whoami-UALRX2FT.js.map → whoami-PPXXBHUR.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as U,g as L,h as S,i as O,j as R,o as P}from"./chunk-
|
|
1
|
+
import{f as U,g as L,h as S,i as O,j as R,o as P}from"./chunk-PC6ANBC6.js";import{g as F,l as j,m as M,n as N,o as k}from"./chunk-BKO2TX4J.js";import"./chunk-HCQR6OPH.js";import"./chunk-W5JAWOQQ.js";import{c as f}from"./chunk-W4IVYUHW.js";import"./chunk-FQ2LR3BI.js";import"./chunk-XB3JTJT6.js";import{a as T,f as v,g as E,j as y,n as $,p as u,x as C,y as B}from"./chunk-O2K4B6AL.js";import"./chunk-AGRDDZFS.js";import{$ as p,Z as r,b as m,m as b}from"./chunk-GIAIN3IJ.js";import"./chunk-B6XQEEUK.js";import{g as _}from"./chunk-SGMPMYEU.js";_();var h=class extends E{isBug=v.NO;constructor(t){let n="";if(b(t.cause)){let a=$(t.cause.map(e=>e.message));n=r` • ${a.map(e=>e.split(`
|
|
2
2
|
`).join(`
|
|
3
3
|
\u200E \u2022 `)).join(`
|
|
4
4
|
`)}`}else n=r`${t.cause}`;super(n)}render(){return`${m.redBright(y.cross)} Failed to add:
|
|
@@ -75,4 +75,4 @@ import{f as U,g as L,h as S,i as O,j as R,o as P}from"./chunk-J5XIQ6N4.js";impor
|
|
|
75
75
|
|
|
76
76
|
{gray Usage}
|
|
77
77
|
{cyanBright ggt add field ${e[0]}/<field_name>:<field_type>}`);try{let i=(await a.edit.mutate({mutation:O,variables:{path:e[0],fields:s.map(d=>({name:d.name,fieldType:d.fieldType}))}})).createModelFields;await n.writeToLocalFilesystem(o,{filesVersion:i.remoteFilesVersion,files:i.changed,delete:[]})}catch(i){throw i instanceof u?new h(i):i}p({ensureEmptyLineAbove:!0,content:`Field ${m.cyanBright(s[0]?.name)} added successfully.`})};export{h as AddClientError,ce as args,me as run,I as usage};
|
|
78
|
-
//# sourceMappingURL=add-
|
|
78
|
+
//# sourceMappingURL=add-OTQMXZUR.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as p}from"./chunk-
|
|
1
|
+
import{o as p}from"./chunk-PC6ANBC6.js";import{m as c,n as g,o as h}from"./chunk-BKO2TX4J.js";import{c as i}from"./chunk-W4IVYUHW.js";import{$ as r,Z as s}from"./chunk-GIAIN3IJ.js";import{g as a}from"./chunk-SGMPMYEU.js";a();var v={...c,"--force":{type:Boolean,alias:"-f"}},P=e=>s`
|
|
2
2
|
Pushes your local files to your environment directory.
|
|
3
3
|
|
|
4
4
|
This command first tracks changes in your environment directory since the last sync.
|
|
@@ -17,10 +17,10 @@ import{o as p}from"./chunk-J5XIQ6N4.js";import{m as c,n as g,o as h}from"./chunk
|
|
|
17
17
|
{gray Examples}
|
|
18
18
|
Push all local changes to the main environment by discarding any changes made on main
|
|
19
19
|
{cyanBright $ ggt push --env main --force}
|
|
20
|
-
`,A=async(e,
|
|
20
|
+
`,A=async(e,o)=>{if(o._.length>0)throw new i(s`
|
|
21
21
|
"ggt push" does not take any positional arguments.
|
|
22
22
|
|
|
23
23
|
If you are trying to push changes from a specific directory,
|
|
24
24
|
you must "cd" to that directory and then run "ggt push".
|
|
25
|
-
`);let y=await h(process.cwd()),m=await g.loadOrInit(e,{command:"push",args:
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
`);let y=await h(process.cwd()),m=await g.loadOrInit(e,{command:"push",args:o,directory:y}),t=new p(m),n=await t.hashes(e);if(n.localChangesToPush.size===0){r({ensureEmptyLineAbove:!0,content:"Nothing to push."});return}n.environmentChangesToPull.size>0&&!n.onlyDotGadgetFilesChanged&&await t.print(e,{hashes:n}),await t.push(e,{command:"push",hashes:n,force:o["--force"]})};export{v as a,P as b,A as c};
|
|
26
|
+
//# sourceMappingURL=chunk-3HRT72TB.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/commands/push.ts"],
|
|
4
|
-
"sourcesContent": ["import { ArgError, type ArgsDefinition } from \"../services/command/arg.js\";\nimport type { Run, Usage } from \"../services/command/command.js\";\nimport { FileSync } from \"../services/filesync/filesync.js\";\nimport { SyncJson, SyncJsonArgs, loadSyncJsonDirectory } from \"../services/filesync/sync-json.js\";\nimport { println } from \"../services/output/print.js\";\nimport { sprint } from \"../services/output/sprint.js\";\n\nexport type PushArgs = typeof args;\n\nexport const args = {\n ...SyncJsonArgs,\n \"--force\": { type: Boolean, alias: \"-f\" },\n} satisfies ArgsDefinition;\n\nexport const usage: Usage = (_ctx) => {\n return sprint`\n Pushes your local files to your environment directory.\n\n This command first tracks changes in your environment directory since the last sync.\n If changes are detected, you will be prompted to discard them or abort the push.\n\n {gray Usage}\n ggt push [options]\n\n {gray Options}\n -a, --app <app_name> Selects the app to push local changes to. Default set on \".gadget/sync.json\"\n --from, -e, --env <env_name> Selects the environment to push local changes to. Default set on \".gadget/sync.json\"\n --force Forces a push by discarding any changes made on your environment directory since last sync\n --allow-different-directory Pushes changes from any local directory with existing files, even if the \".gadget/sync.json\" file is missing\n --allow-different-app Pushes changes to an app using --app command, instead of the one in the \u201C.gadget/sync.json\u201D file\n\n {gray Examples}\n Push all local changes to the main environment by discarding any changes made on main\n {cyanBright $ ggt push --env main --force}\n `;\n};\n\nexport const run: Run<typeof args> = async (ctx, args) => {\n if (args._.length > 0) {\n throw new ArgError(sprint`\n \"ggt push\" does not take any positional arguments.\n\n If you are trying to push changes from a specific directory,\n you must \"cd\" to that directory and then run \"ggt push\".\n `);\n }\n\n const directory = await loadSyncJsonDirectory(process.cwd());\n const syncJson = await SyncJson.loadOrInit(ctx, { command: \"push\", args, directory });\n const filesync = new FileSync(syncJson);\n const hashes = await filesync.hashes(ctx);\n\n if (hashes.localChangesToPush.size === 0) {\n println({ ensureEmptyLineAbove: true, content: \"Nothing to push.\" });\n return;\n }\n\n if (hashes.environmentChangesToPull.size > 0 && !hashes.onlyDotGadgetFilesChanged) {\n // show them the environment changes they will discard\n await filesync.print(ctx, { hashes });\n }\n\n await filesync.push(ctx, { command: \"push\", hashes });\n};\n"],
|
|
5
|
-
"mappings": "6NAAAA,IASO,IAAMC,EAAO,CAClB,GAAGC,EACH,UAAW,CAAE,KAAM,QAAS,MAAO,IAAK,CAC1C,EAEaC,EAAgBC,GACpBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAsBIC,EAAwB,MAAOC,EAAKN,IAAS,CACxD,GAAIA,EAAK,EAAE,OAAS,EAClB,MAAM,IAAIO,EAASH;AAAA;AAAA;AAAA;AAAA;AAAA,KAKlB,EAGH,IAAMI,EAAY,MAAMC,EAAsB,QAAQ,IAAI,CAAC,EACrDC,EAAW,MAAMC,EAAS,WAAWL,EAAK,CAAE,QAAS,OAAQ,KAAAN,EAAM,UAAAQ,CAAU,CAAC,EAC9EI,EAAW,IAAIC,EAASH,CAAQ,EAChCI,EAAS,MAAMF,EAAS,OAAON,CAAG,EAExC,GAAIQ,EAAO,mBAAmB,OAAS,EAAG,CACxCC,EAAQ,CAAE,qBAAsB,GAAM,QAAS,kBAAmB,CAAC,EACnE,MACF,CAEID,EAAO,yBAAyB,KAAO,GAAK,CAACA,EAAO,2BAEtD,MAAMF,EAAS,MAAMN,EAAK,CAAE,OAAAQ,CAAO,CAAC,EAGtC,MAAMF,EAAS,KAAKN,EAAK,CAAE,QAAS,OAAQ,OAAAQ,
|
|
4
|
+
"sourcesContent": ["import { ArgError, type ArgsDefinition } from \"../services/command/arg.js\";\nimport type { Run, Usage } from \"../services/command/command.js\";\nimport { FileSync } from \"../services/filesync/filesync.js\";\nimport { SyncJson, SyncJsonArgs, loadSyncJsonDirectory } from \"../services/filesync/sync-json.js\";\nimport { println } from \"../services/output/print.js\";\nimport { sprint } from \"../services/output/sprint.js\";\n\nexport type PushArgs = typeof args;\n\nexport const args = {\n ...SyncJsonArgs,\n \"--force\": { type: Boolean, alias: \"-f\" },\n} satisfies ArgsDefinition;\n\nexport const usage: Usage = (_ctx) => {\n return sprint`\n Pushes your local files to your environment directory.\n\n This command first tracks changes in your environment directory since the last sync.\n If changes are detected, you will be prompted to discard them or abort the push.\n\n {gray Usage}\n ggt push [options]\n\n {gray Options}\n -a, --app <app_name> Selects the app to push local changes to. Default set on \".gadget/sync.json\"\n --from, -e, --env <env_name> Selects the environment to push local changes to. Default set on \".gadget/sync.json\"\n --force Forces a push by discarding any changes made on your environment directory since last sync\n --allow-different-directory Pushes changes from any local directory with existing files, even if the \".gadget/sync.json\" file is missing\n --allow-different-app Pushes changes to an app using --app command, instead of the one in the \u201C.gadget/sync.json\u201D file\n\n {gray Examples}\n Push all local changes to the main environment by discarding any changes made on main\n {cyanBright $ ggt push --env main --force}\n `;\n};\n\nexport const run: Run<typeof args> = async (ctx, args) => {\n if (args._.length > 0) {\n throw new ArgError(sprint`\n \"ggt push\" does not take any positional arguments.\n\n If you are trying to push changes from a specific directory,\n you must \"cd\" to that directory and then run \"ggt push\".\n `);\n }\n\n const directory = await loadSyncJsonDirectory(process.cwd());\n const syncJson = await SyncJson.loadOrInit(ctx, { command: \"push\", args, directory });\n const filesync = new FileSync(syncJson);\n const hashes = await filesync.hashes(ctx);\n\n if (hashes.localChangesToPush.size === 0) {\n println({ ensureEmptyLineAbove: true, content: \"Nothing to push.\" });\n return;\n }\n\n if (hashes.environmentChangesToPull.size > 0 && !hashes.onlyDotGadgetFilesChanged) {\n // show them the environment changes they will discard\n await filesync.print(ctx, { hashes });\n }\n\n await filesync.push(ctx, { command: \"push\", hashes, force: args[\"--force\"] });\n};\n"],
|
|
5
|
+
"mappings": "6NAAAA,IASO,IAAMC,EAAO,CAClB,GAAGC,EACH,UAAW,CAAE,KAAM,QAAS,MAAO,IAAK,CAC1C,EAEaC,EAAgBC,GACpBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAsBIC,EAAwB,MAAOC,EAAKN,IAAS,CACxD,GAAIA,EAAK,EAAE,OAAS,EAClB,MAAM,IAAIO,EAASH;AAAA;AAAA;AAAA;AAAA;AAAA,KAKlB,EAGH,IAAMI,EAAY,MAAMC,EAAsB,QAAQ,IAAI,CAAC,EACrDC,EAAW,MAAMC,EAAS,WAAWL,EAAK,CAAE,QAAS,OAAQ,KAAAN,EAAM,UAAAQ,CAAU,CAAC,EAC9EI,EAAW,IAAIC,EAASH,CAAQ,EAChCI,EAAS,MAAMF,EAAS,OAAON,CAAG,EAExC,GAAIQ,EAAO,mBAAmB,OAAS,EAAG,CACxCC,EAAQ,CAAE,qBAAsB,GAAM,QAAS,kBAAmB,CAAC,EACnE,MACF,CAEID,EAAO,yBAAyB,KAAO,GAAK,CAACA,EAAO,2BAEtD,MAAMF,EAAS,MAAMN,EAAK,CAAE,OAAAQ,CAAO,CAAC,EAGtC,MAAMF,EAAS,KAAKN,EAAK,CAAE,QAAS,OAAQ,OAAAQ,EAAQ,MAAOd,EAAK,SAAS,CAAE,CAAC,CAC9E",
|
|
6
6
|
"names": ["init_cjs", "args", "SyncJsonArgs", "usage", "_ctx", "sprint", "run", "ctx", "ArgError", "directory", "loadSyncJsonDirectory", "syncJson", "SyncJson", "filesync", "FileSync", "hashes", "println"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as E,Q as u,z as $}from"./chunk-
|
|
1
|
+
import{I as E,Q as u,z as $}from"./chunk-GIAIN3IJ.js";import{c as b,e as g,g as a}from"./chunk-SGMPMYEU.js";var k=b((me,F)=>{a();function G(t){return Array.isArray(t)?t:[t]}var S="",C=" ",p="\\",B=/^\s+$/,W=/(?:[^\\]|^)\\$/,K=/^\\!/,V=/^\\#/,Y=/\r?\n/g,M=/^\.*\/|^\.+$/,y="/",T="node-ignore";typeof Symbol<"u"&&(T=Symbol.for("node-ignore"));var I=T,q=(t,e,s)=>Object.defineProperty(t,e,{value:s}),J=/([0-z])-([0-z])/g,H=()=>!1,Q=t=>t.replace(J,(e,s,r)=>s.charCodeAt(0)<=r.charCodeAt(0)?e:S),U=t=>{let{length:e}=t;return t.slice(0,e-e%2)},Z=[[/^\uFEFF/,()=>S],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,s)=>e+(s.indexOf("\\")===0?C:S)],[/(\\+?)\s/g,(t,e)=>{let{length:s}=e;return e.slice(0,s-s%2)+C}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,s)=>e+6<s.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,s)=>{let r=s.replace(/\\\*/g,"[^\\/]*");return e+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>p],[/\\\\/g,()=>p],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,s,r,n)=>e===p?`\\[${s}${U(r)}${n}`:n==="]"&&r.length%2===0?`[${Q(s)}${r}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],O=Object.create(null),ee=(t,e)=>{let s=O[t];return s||(s=Z.reduce((r,[n,i])=>r.replace(n,i.bind(t)),t),O[t]=s),e?new RegExp(s,"i"):new RegExp(s)},R=t=>typeof t=="string",te=t=>t&&R(t)&&!B.test(t)&&!W.test(t)&&t.indexOf("#")!==0,se=t=>t.split(Y),x=class{constructor(e,s,r,n){this.origin=e,this.pattern=s,this.negative=r,this.regex=n}},re=(t,e)=>{let s=t,r=!1;t.indexOf("!")===0&&(r=!0,t=t.substr(1)),t=t.replace(K,"!").replace(V,"#");let n=ee(t,e);return new x(s,t,r,n)},ne=(t,e)=>{throw new e(t)},o=(t,e,s)=>R(t)?t?o.isNotRelative(t)?s(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:s("path must not be empty",TypeError):s(`path must be a string, but got \`${e}\``,TypeError),L=t=>M.test(t);o.isNotRelative=L;o.convert=t=>t;var v=class{constructor({ignorecase:e=!0,ignoreCase:s=e,allowRelativePaths:r=!1}={}){q(this,I,!0),this._rules=[],this._ignoreCase=s,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[I]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(te(e)){let s=re(e,this._ignoreCase);this._added=!0,this._rules.push(s)}}add(e){return this._added=!1,G(R(e)?se(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,s){let r=!1,n=!1;return this._rules.forEach(i=>{let{negative:l}=i;if(n===l&&r!==n||l&&!r&&!n&&!s)return;i.regex.test(e)&&(r=!l,n=l)}),{ignored:r,unignored:n}}_test(e,s,r,n){let i=e&&o.convert(e);return o(i,e,this._allowRelativePaths?H:ne),this._t(i,s,r,n)}_t(e,s,r,n){if(e in s)return s[e];if(n||(n=e.split(y)),n.pop(),!n.length)return s[e]=this._testOne(e,r);let i=this._t(n.join(y)+y,s,r,n);return s[e]=i.ignored?i:this._testOne(e,r)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return G(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},d=t=>new v(t),ie=t=>o(t&&o.convert(t),t,H);d.isPathValid=ie;d.default=d;F.exports=d;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=s=>/^\\\\\?\\/.test(s)||/["<>|\u0000-\u001F]+/u.test(s)?s:s.replace(/\\/g,"/");o.convert=t;let e=/^[a-z]:\//i;o.isNotRelative=s=>e.test(s)||L(s)}});var D=b((pe,X)=>{a();X.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var s=t.length;if(s<=1)return t;var r="";if(s>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),r+i.join("/")}});a();var _=g($(),1);a();var f=g($(),1),j=g(k(),1),A=g(D(),1);import oe from"node:assert";import{createHash as ae}from"node:crypto";import c from"node:path";import{Transform as ce}from"node:stream";import{pipeline as le}from"node:stream/promises";var ue=[".gadget/"],fe=[".DS_Store","node_modules",".git"],ge=[".gadget/sync.json",".gadget/backup","yarn-error.log"],z=class t{constructor(e){this.path=e}_ignorer;_isHashing=!1;static async init(e){let s=new t(e);return await s.loadIgnoreFile(),s}relative(e){return c.isAbsolute(e)?c.relative(this.path,e):e}absolute(...e){let s=c.resolve(this.path,...e);return oe(s.startsWith(this.path),`expected ${s} to be within ${this.path}`),s}normalize(e,s){return c.isAbsolute(e)&&(e=this.relative(e)),e=(0,A.default)(e,!0),s&&(e+="/"),e}async loadIgnoreFile(){this._ignorer=j.default.default(),this._ignorer.add(fe);try{let e=await f.default.readFile(this.absolute(".ignore"),"utf8");this._ignorer.add(e)}catch(e){h(e)}}ignores(e){return e=this.relative(e),e===""?!1:e.startsWith("..")||(e=(0,A.default)(e,!1),this._isHashing&&ge.some(s=>e.startsWith(s)))?!0:ue.some(s=>e.startsWith(s))?!1:this._ignorer.ignores(e)}async*walk({dir:e=this.path}={}){e!==this.path&&(yield this.normalize(e,!0));for await(let s of await f.default.opendir(e)){let r=c.join(e,s.name);this.ignores(r)||(s.isDirectory()?yield*this.walk({dir:r}):s.isFile()&&(yield this.normalize(r,!1)))}}async hashes(){try{this._isHashing=!0;let e={};for await(let s of this.walk()){let r=this.absolute(s);e[s]=await he(r)}return e}finally{this._isHashing=!1}}async hasFiles(){return!await this.isEmptyOrNonExistent()}async isEmptyOrNonExistent(){let e=!0;try{for await(let s of this.walk()){e=!1;break}}catch(s){h(s)}return e}},de=process.platform==="linux"||process.platform==="darwin",he=async t=>{let e=ae("sha1");e.update(c.basename(t));let s=await f.default.stat(t),r;if(de&&(r=s.mode&511),s.isDirectory())return{sha1:e.digest("hex"),permissions:r};let n=new ce({transform(i,l,m){if(!i.includes(13)){m(void 0,i);return}let w=Buffer.alloc(i.length),N=0;for(let P of i)P!==13&&(w[N++]=P);m(void 0,w.subarray(0,N))}});return await le(f.default.createReadStream(t),n,e),{sha1:e.digest("hex"),permissions:r}},h=t=>{if(!(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT"))throw t};var _e=E(t=>{if(process.env.GGT_SESSION)return t.log.debug("reading session from env"),process.env.GGT_SESSION;try{return t.log.debug("reading session from disk"),_.default.readFileSync(u("session.txt"),"utf8")}catch(e){h(e);return}}),Ge=(t,e)=>{_e.clear(),process.env.GGT_SESSION&&(t.log.debug("writing session to env",{session:!!e}),process.env.GGT_SESSION=e),t.log.debug("writing session to disk",{session:!!e,path:u("session.txt")}),e?_.default.outputFileSync(u("session.txt"),e):_.default.removeSync(u("session.txt"))},Ce=E(t=>(t.log.debug("reading token from env"),process.env.GGT_TOKEN));export{z as a,de as b,h as c,_e as d,Ge as e,Ce as f};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
normalize-path/index.js:
|
|
@@ -9,4 +9,4 @@ normalize-path/index.js:
|
|
|
9
9
|
* Released under the MIT License.
|
|
10
10
|
*)
|
|
11
11
|
*/
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-AGRDDZFS.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as V}from"./chunk-
|
|
1
|
+
import{c as V}from"./chunk-W4IVYUHW.js";import{a as lr}from"./chunk-FQ2LR3BI.js";import{a as yr,b as vr,i as br}from"./chunk-XB3JTJT6.js";import{a as st,c as pr,f as pt,g as mt,j as Pt,l as Wi,m as mr,o as ee,p as Q,t as hr,u as dr,v as re,w as gr,z as ft}from"./chunk-O2K4B6AL.js";import{a as fr}from"./chunk-AGRDDZFS.js";import{$ as z,D as ct,K as lt,P as te,R as ur,U as Et,X as cr,Z as T,_ as R,b as G,e as B,g as tr,h as er,l as rr,m as nr,t as sr,u as ir,v as or,y as ar,z as Qi}from"./chunk-GIAIN3IJ.js";import{a as Vi,c as Zt,e as nt,g as C}from"./chunk-SGMPMYEU.js";var xr=Zt(D=>{"use strict";C();var Ki=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(D,"__esModule",{value:!0});var Xi=Vi("fs"),Zi=Ki(lr()),it=Zi.default("@kwsites/file-exists");function to(t,e,r){it("checking %s",t);try{let n=Xi.statSync(t);return n.isFile()&&e?(it("[OK] path represents a file"),!0):n.isDirectory()&&r?(it("[OK] path represents a directory"),!0):(it("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return it("[FAIL] path is not accessible: %o",n),!1;throw it("[FATAL] %o",n),n}}function eo(t,e=D.READABLE){return to(t,(e&D.FILE)>0,(e&D.FOLDER)>0)}D.exists=eo;D.FILE=1;D.FOLDER=2;D.READABLE=D.FILE+D.FOLDER});var Er=Zt(Rt=>{"use strict";C();function ro(t){for(var e in t)Rt.hasOwnProperty(e)||(Rt[e]=t[e])}Object.defineProperty(Rt,"__esModule",{value:!0});ro(xr())});var ue=Zt(Z=>{"use strict";C();Object.defineProperty(Z,"__esModule",{value:!0});Z.createDeferred=Z.deferred=void 0;function ae(){let t,e,r="pending";return{promise:new Promise((s,i)=>{t=s,e=i}),done(s){r==="pending"&&(r="resolved",t(s))},fail(s){r==="pending"&&(r="rejected",e(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}Z.deferred=ae;Z.createDeferred=ae;Z.default=ae});C();var _r=nt(Wi(),1);var Ec=Object.freeze({Fatal:"Fatal",Error:"Error",Warning:"Warning",Info:"Info"}),ne=({problems:t,showFileTypes:e,...r})=>{let n="";for(let[s,i]of Object.entries(t)){n+=R(""),n+=R`• {cyan ${s}} {redBright ${(0,_r.default)("problem",i.length,!0)}}`;for(let o of i){let[a,...c]=o.message.split(`
|
|
2
2
|
`);n+=T` {red ✖} `,(e??o.type==="SourceFile")&&(n+=T`${Hi(s)} `),n+=T(a);for(let p of c)n+=R(""),n+=T` ${p}`;for(let p of o.labels)n+=T` {dim ${p}}`;n+=R("")}}return R({...r,content:n})},Pc=t=>{z(ne(t))},Hi=t=>{switch(!0){case sr(t):return G.yellowBright("JavaScript");case ir(t):return G.blue("TypeScript");case or(t):return G.magenta("Gelly");default:return G.gray("File")}},Cc=t=>{let e={};for(let r of t){let n=r.node?.apiIdentifier??r.node?.name??"Other";e[n]??=[],e[n].push({type:r.node?.type??"Unknown",severity:r.severity,message:r.message,labels:mr(r.nodeLabels?.map(s=>s?.identifier)??[])})}return e},Rc=t=>{let e={};for(let r of t)e[r.path]??=[],e[r.path].push({type:r.type,severity:r.level,message:r.message,labels:[]});return e};C();var kr=class extends mt{isBug=pt.NO;constructor(){super("Yarn not found")}render(){return T`
|
|
3
3
|
Yarn must be installed to sync your application. You can install it by running:
|
|
4
4
|
|
|
@@ -114,4 +114,4 @@ import{c as V}from"./chunk-ZHG3WLFU.js";import{a as lr}from"./chunk-FQ2LR3BI.js"
|
|
|
114
114
|
• ${a.join(`
|
|
115
115
|
\u2022 `)}
|
|
116
116
|
`)},gc=async(t,{directory:e})=>{try{return await ai(e.path).revparse(["--abbrev-ref","HEAD"])}catch(r){t.log.warn("failed to read git branch",{error:r});return}},yc=B.object({application:B.string(),environment:B.string(),environments:B.record(B.object({filesVersion:B.string()}))}),vc=B.object({app:B.string(),filesVersion:B.string(),mtime:B.number()}),bc=B.union([yc,vc]),_c=bc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{Ec as a,ne as b,Pc as c,Cc as d,Rc as e,kr as f,Ct as g,wr as h,Tr as i,Yi as j,Fc as k,oe as l,yp as m,pi as n,vp as o};
|
|
117
|
-
//# sourceMappingURL=chunk-
|
|
117
|
+
//# sourceMappingURL=chunk-BKO2TX4J.js.map
|