@gadgetinc/ggt 1.7.2 → 1.7.4

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 (55) hide show
  1. package/README.md +1 -0
  2. package/dist/{add-BIKODQCS.js → add-KJLV4API.js} +5 -5
  3. package/dist/add-KJLV4API.js.map +7 -0
  4. package/dist/{chunk-FGUWID6B.js → chunk-J2OYMAMD.js} +2 -2
  5. package/dist/{chunk-XQWSZW7K.js → chunk-L5H5T2T6.js} +2 -2
  6. package/dist/chunk-M6L2X3GX.js +194 -0
  7. package/dist/chunk-M6L2X3GX.js.map +7 -0
  8. package/dist/{chunk-ILB6CSBN.js → chunk-MHTXRD5G.js} +2 -2
  9. package/dist/{chunk-KMNQ3LJT.js → chunk-OIVNACS7.js} +2 -2
  10. package/dist/{chunk-KMNQ3LJT.js.map → chunk-OIVNACS7.js.map} +2 -2
  11. package/dist/{chunk-DYAWQS24.js → chunk-X47UA3VR.js} +2 -2
  12. package/dist/{chunk-MBWB2XUY.js → chunk-XKYYKHP4.js} +4 -4
  13. package/dist/chunk-XKYYKHP4.js.map +7 -0
  14. package/dist/chunk-YU6P3ESA.js +121 -0
  15. package/dist/chunk-YU6P3ESA.js.map +7 -0
  16. package/dist/{configure-LD5XC2MR.js → configure-CXY6JQB7.js} +2 -2
  17. package/dist/deploy-XFZBJJWP.js +25 -0
  18. package/dist/deploy-XFZBJJWP.js.map +7 -0
  19. package/dist/{dev-O5KGPP2V.js → dev-GG6TU3DJ.js} +4 -3
  20. package/dist/{dev-O5KGPP2V.js.map → dev-GG6TU3DJ.js.map} +2 -2
  21. package/dist/{list-O5JTZNKN.js → list-3QZTSHQV.js} +2 -2
  22. package/dist/login-HKGCVIWO.js +2 -0
  23. package/dist/{logout-ACRXIJEF.js → logout-SWWGI27Q.js} +2 -2
  24. package/dist/{logs-SS34WQ2K.js → logs-DW4PH3U6.js} +2 -2
  25. package/dist/main.js +1 -1
  26. package/dist/{open-JQTW6XFM.js → open-J2ZVNVJ6.js} +2 -2
  27. package/dist/{pull-5HLV3C74.js → pull-ORNQFSFG.js} +2 -2
  28. package/dist/push-KMZZ6JJL.js +2 -0
  29. package/dist/{status-PL7MJVN7.js → status-JAREJZ4X.js} +2 -2
  30. package/dist/{whoami-3RPUP2PK.js → whoami-MIJFO4MW.js} +2 -2
  31. package/package.json +1 -1
  32. package/dist/add-BIKODQCS.js.map +0 -7
  33. package/dist/chunk-D2R4J557.js +0 -116
  34. package/dist/chunk-D2R4J557.js.map +0 -7
  35. package/dist/chunk-MBWB2XUY.js.map +0 -7
  36. package/dist/chunk-VJTDX5WL.js +0 -194
  37. package/dist/chunk-VJTDX5WL.js.map +0 -7
  38. package/dist/deploy-3H3W42UM.js +0 -25
  39. package/dist/deploy-3H3W42UM.js.map +0 -7
  40. package/dist/login-6MLYS6A4.js +0 -2
  41. package/dist/push-62ZJ6D3R.js +0 -2
  42. /package/dist/{chunk-FGUWID6B.js.map → chunk-J2OYMAMD.js.map} +0 -0
  43. /package/dist/{chunk-XQWSZW7K.js.map → chunk-L5H5T2T6.js.map} +0 -0
  44. /package/dist/{chunk-ILB6CSBN.js.map → chunk-MHTXRD5G.js.map} +0 -0
  45. /package/dist/{chunk-DYAWQS24.js.map → chunk-X47UA3VR.js.map} +0 -0
  46. /package/dist/{configure-LD5XC2MR.js.map → configure-CXY6JQB7.js.map} +0 -0
  47. /package/dist/{list-O5JTZNKN.js.map → list-3QZTSHQV.js.map} +0 -0
  48. /package/dist/{login-6MLYS6A4.js.map → login-HKGCVIWO.js.map} +0 -0
  49. /package/dist/{logout-ACRXIJEF.js.map → logout-SWWGI27Q.js.map} +0 -0
  50. /package/dist/{logs-SS34WQ2K.js.map → logs-DW4PH3U6.js.map} +0 -0
  51. /package/dist/{open-JQTW6XFM.js.map → open-J2ZVNVJ6.js.map} +0 -0
  52. /package/dist/{pull-5HLV3C74.js.map → pull-ORNQFSFG.js.map} +0 -0
  53. /package/dist/{push-62ZJ6D3R.js.map → push-KMZZ6JJL.js.map} +0 -0
  54. /package/dist/{status-PL7MJVN7.js.map → status-JAREJZ4X.js.map} +0 -0
  55. /package/dist/{whoami-3RPUP2PK.js.map → whoami-MIJFO4MW.js.map} +0 -0
@@ -1,25 +0,0 @@
1
- import{a as ee}from"./chunk-SX5LO3XQ.js";import{a as te}from"./chunk-MBWB2XUY.js";import{b as H,c as R,e as Q,k as y,p as Z}from"./chunk-VJTDX5WL.js";import{a as J,c as q,d as _,i as X,m as W,n as K}from"./chunk-D2R4J557.js";import"./chunk-JSGXXXFU.js";import{b as Y}from"./chunk-WNAYBYSG.js";import"./chunk-FGUWID6B.js";import"./chunk-JBY5A44K.js";import"./chunk-HN3YKQ3C.js";import{a as A,c as O,g as z,u as w}from"./chunk-XQWSZW7K.js";import"./chunk-DYAWQS24.js";import"./chunk-XGQQOMPO.js";import"./chunk-KMNQ3LJT.js";import{b as i,ca as G,d as F,fa as j,ha as l,ja as t,n as V}from"./chunk-24OT7GHO.js";import"./chunk-GFQYFEEH.js";import{a as m,h as M}from"./chunk-7DYQUG5M.js";M();import le from"node:assert";var Re={...te,"--env":{type:String,alias:["-e","--environment","--from"]},"--allow-problems":{type:Boolean,alias:"--allow-issues"},"--allow-charges":{type:Boolean},"--allow-data-delete":{type:Boolean}},_e=m(s=>l`
2
- Deploys your app to production.
3
-
4
- This command first performs a sync to ensure that your local and environment directories
5
- match, changes are tracked since last sync. If any conflicts are detected, they must be
6
- resolved before deployment.
7
-
8
- {gray Usage}
9
- $ ggt deploy [options]
10
-
11
- {gray Options}
12
- -a, --app <app_name> Selects a specific app to deploy. Default set on ".gadget/sync.json"
13
- --from, -e, --env <env_name> Selects a specific environment to sync and deploy from. Default set on ".gadget/sync.json"
14
- --force Deploys by discarding any changes made to the environment directory since last sync
15
- --allow-different-directory Deploys from any local directory with existing files, even if the ".gadget/sync.json" file is missing
16
- --allow-different-app Deploys a different app using the --app command, instead of the one specified in the “.gadget/sync.json” file
17
- --allow-problems Deploys despite any existing issues found in the app (gelly errors, typescript errors etc.)
18
- --allow-data-delete Deploys even if it results in the deletion of data in production
19
- --allow-charges Deploys even if it results in additional charges to your plan
20
-
21
- {gray Examples}
22
- Deploys code from the staging environment of a myBlog
23
- {cyanBright $ ggt deploy -a myBlog -from staging}
24
- `,"usage"),Pe=m(async(s,o)=>{let ne=await K(process.cwd()),a=await W.loadOrInit(s,{command:"deploy",args:o,directory:ne});t({ensureEmptyLineAbove:!0,content:`Deploying ${a.environment.name} to ${A(a.environment.application.primaryDomain,`https://${a.environment.application.primaryDomain}/`)}`});let T=new Z(a),p=await T.hashes(s);if(!p.inSync&&(p.localChangesToPush.size>0||!p.onlyDotGadgetFilesChanged)){if(await T.print(s,{hashes:p}),!o["--force"])if(t({ensureEmptyLineAbove:!0,content:"Your environment's files must match your local files before you can deploy."}),G.isInteractive||F.testLike){let r;switch(!0){case p.bothChanged:r=l`Would you like to push your local changes and {underline discard your environment's} changes now?`,o["--force"]=!0;break;case p.localChangesToPush.size>0:r=l`Would you like to push your local changes now?`;break;case p.environmentChanges.size>0:r=l`Do you want to {underline discard your environment's} changes now?`,o["--force"]=!0;break;default:ee("no changes to push or discard")}await w(r)}else t({ensureEmptyLineAbove:!0,content:"Assuming you want to push your local files now."});await T.push(s,{command:"deploy",hashes:p,force:o["--force"]})}let I={localFilesVersion:String(a.filesVersion),force:o["--allow-problems"],allowDeletedData:o["--allow-data-delete"],allowCharges:o["--allow-charges"]},E,f=e.NOT_STARTED,B=!1,v=a.edit.subscribe({subscription:Q,variables:I,onError:m(async r=>{if(s.log.error("failed to deploy",{error:r}),E?.fail(P(a,f)+" "+y()),V(r.cause)){let c=r.cause[0];if(le(c,"expected graphqlError to be defined"),c.extensions)switch(!0){case c.extensions.requiresUpgrade:t({ensureEmptyLineAbove:!0,content:c.message.replace(/GGT_PAYMENT_REQUIRED:?\s*/,"")}),process.exit(1);break;case c.extensions.requiresAdditionalCharge:t({ensureEmptyLineAbove:!0,content:c.message.replace(/GGT_PAYMENT_REQUIRED:?\s*/,"")}),await w({ensureEmptyLineAbove:!0,content:"Do you want to continue?"}),v.resubscribe({...I,allowCharges:!0});return}}await O(s,r)},"onError"),onData:m(async({publishStatus:r})=>{if(!r){s.log.warn("received empty publish status");return}let{publishStarted:c,progress:D,issues:N,status:g,deletedModelsAndFields:se}=r,C=N.length>0,{deletedModels:U,deletedModelFields:$}=se??{deletedModels:[],deletedModelFields:[]},x=U.length>0||$.length>0;if(!B&&(C||x)){B=!0;let d=N.filter(u=>u.severity===J.Fatal);if(d.length>0&&await O(s,new X(_(d))),C&&(t({ensureEmptyLineAbove:!0,content:l`{bold.yellow !} {bold Issues found in your development app}`}),q({problems:_(N)})),x){t({ensureEmptyLineAbove:!0,content:l`{bold.yellow !} {bold Data deleted on deploy}`});let u=i.blueBright("updated"),b=i.redBright("deleted"),S=[];U.forEach(n=>{S.push({symbol:R,name:i.redBright(n),action:b,indent:0})}),$.forEach(({modelIdentifier:n,fields:h})=>{S.push({symbol:H,name:i.blueBright(n),action:u,indent:0}),h.forEach(L=>{S.push({symbol:R,name:i.redBright(L),action:b,indent:2})})});let re=S.reduce((n,h)=>Math.max(n,h.name.length),0),ae=S.reduce((n,h)=>Math.max(n,h.indent),0),k=2;t({ensureEmptyLineAbove:!0,content:i.gray("These changes will be applied to production based on the app you're deploying.")});for(let n of S){let h=" ".repeat(n.indent*k),L=" ".repeat(re-n.name.length+2),ie=" ".repeat((ae-n.indent)*k);t({ensureEmptyLineAbove:!1,content:j(`${h}${n.symbol} ${n.name}${L}${ie}${n.action}`,6)})}}if(!c)await w("Do you want to continue?"),v.resubscribe({...I,force:!0,allowDeletedData:!0});else{let u=o["--allow-data-delete"],b=o["--allow-problems"];if(!u&&!b)throw new z("expected --allow-data-delete or --allow-problems to be true");b&&t(l`Deploying regardless of problems because "${i.gray("--allow-problems")}" was passed.`),u&&t(l`Deploying regardless of deleted data because "${i.gray("--allow-data-delete")}" was passed.`)}return}if(g?.code==="Errored"){E?.fail(P(a,f)+" "+y()),g.message&&t({ensureEmptyLineAbove:!0,content:i.red(g.message)}),g.output&&t({ensureEmptyLineAbove:!0,content:l`${A("Check logs",g.output)}`});return}if(D===e.COMPLETED){E?.succeed(oe(a,f));let d=i.green("Deploy successful!");g?.output&&(d+=` ${A("Check logs",g.output)}.`),t({ensureEmptyLineAbove:!0,content:d});return}if(D!==f){let d=P(a,D);if(d!==E?.text){E?.succeed(oe(a,f));let u=f===e.NOT_STARTED||!G.isInteractive;E=Y({ensureEmptyLineAbove:u,content:d})}f=D}},"onData"),onComplete:m(()=>{v.unsubscribe()},"onComplete")})},"run"),e=Object.freeze({NOT_STARTED:"NOT_STARTED",STARTING:"STARTING",BUILDING_ASSETS:"BUILDING_ASSETS",UPLOADING_ASSETS:"UPLOADING_ASSETS",CONVERGING_STORAGE:"CONVERGING_STORAGE",PUBLISHING_TREE:"PUBLISHING_TREE",RELOADING_SANDBOX:"RELOADING_SANDBOX",COMPLETED:"COMPLETED"}),P=m((s,o)=>{switch(o){case e.NOT_STARTED:case e.STARTING:case e.BUILDING_ASSETS:case e.UPLOADING_ASSETS:return"Building frontend assets.";case e.CONVERGING_STORAGE:return"Setting up database.";case e.PUBLISHING_TREE:return`Copying ${s.environment.name}.`;case e.RELOADING_SANDBOX:return"Restarting app.";case e.COMPLETED:return"Deploy complete!";default:return"Unknown step."}},"stepToSpinnerStart"),oe=m((s,o)=>{switch(o){case e.NOT_STARTED:case e.STARTING:case e.BUILDING_ASSETS:case e.UPLOADING_ASSETS:return`Built frontend assets. ${y()}`;case e.CONVERGING_STORAGE:return`Setup database. ${y()}`;case e.PUBLISHING_TREE:return`Copied ${s.environment.name}. ${y()}`;case e.RELOADING_SANDBOX:return`Restarted app. ${y()}`;case e.COMPLETED:return"Deploy successful!";default:return`Completed unknown step. ${y()}`}},"stepToSpinnerEnd");export{e as AppDeploymentSteps,Re as args,Pe as run,oe as stepToSpinnerEnd,P as stepToSpinnerStart,_e as usage};
25
- //# sourceMappingURL=deploy-3H3W42UM.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/commands/deploy.ts"],
4
- "sourcesContent": ["import chalk from \"chalk\";\nimport indentString from \"indent-string\";\nimport assert from \"node:assert\";\nimport terminalLink from \"terminal-link\";\nimport { PUBLISH_STATUS_SUBSCRIPTION } from \"../services/app/edit/operation.js\";\nimport { type Run, type Usage } from \"../services/command/command.js\";\nimport { env } from \"../services/config/env.js\";\nimport { deletedSymbol, updatedSymbol } from \"../services/filesync/changes.js\";\nimport { DeployDisallowedError } from \"../services/filesync/error.js\";\nimport { FileSync } from \"../services/filesync/filesync.js\";\nimport { SyncJson, loadSyncJsonDirectory } from \"../services/filesync/sync-json.js\";\nimport { confirm } from \"../services/output/confirm.js\";\nimport { output } from \"../services/output/output.js\";\nimport { println } from \"../services/output/print.js\";\nimport { ProblemSeverity, printProblems, publishIssuesToProblems } from \"../services/output/problems.js\";\nimport { UnexpectedError, reportErrorAndExit } from \"../services/output/report.js\";\nimport { spin, type spinner } from \"../services/output/spinner.js\";\nimport { sprint } from \"../services/output/sprint.js\";\nimport { ts } from \"../services/output/timestamp.js\";\nimport { unreachable } from \"../services/util/assert.js\";\nimport { isGraphQLErrors } from \"../services/util/is.js\";\nimport { args as PushArgs } from \"./push.js\";\n\nexport type DeployArgs = typeof args;\n\nexport const args = {\n ...PushArgs,\n \"--env\": { type: String, alias: [\"-e\", \"--environment\", \"--from\"] },\n \"--allow-problems\": { type: Boolean, alias: \"--allow-issues\" },\n \"--allow-charges\": { type: Boolean },\n \"--allow-data-delete\": { type: Boolean },\n};\n\nexport const usage: Usage = (_ctx) => {\n return sprint`\n Deploys your app to production.\n\n This command first performs a sync to ensure that your local and environment directories\n match, changes are tracked since last sync. If any conflicts are detected, they must be\n resolved before deployment.\n\n {gray Usage}\n $ ggt deploy [options]\n\n {gray Options}\n -a, --app <app_name> Selects a specific app to deploy. Default set on \".gadget/sync.json\"\n --from, -e, --env <env_name> Selects a specific environment to sync and deploy from. Default set on \".gadget/sync.json\"\n --force Deploys by discarding any changes made to the environment directory since last sync\n --allow-different-directory Deploys from any local directory with existing files, even if the \".gadget/sync.json\" file is missing\n --allow-different-app Deploys a different app using the --app command, instead of the one specified in the \u201C.gadget/sync.json\u201D file\n --allow-problems Deploys despite any existing issues found in the app (gelly errors, typescript errors etc.)\n --allow-data-delete Deploys even if it results in the deletion of data in production\n --allow-charges Deploys even if it results in additional charges to your plan\n\n {gray Examples}\n Deploys code from the staging environment of a myBlog\n {cyanBright $ ggt deploy -a myBlog -from staging}\n`;\n};\n\nexport const run: Run<DeployArgs> = async (ctx, args) => {\n const directory = await loadSyncJsonDirectory(process.cwd());\n const syncJson = await SyncJson.loadOrInit(ctx, { command: \"deploy\", args, directory });\n\n println({\n ensureEmptyLineAbove: true,\n content: `Deploying ${syncJson.environment.name} to ${terminalLink(syncJson.environment.application.primaryDomain, `https://${syncJson.environment.application.primaryDomain}/`)}`,\n });\n\n const filesync = new FileSync(syncJson);\n const hashes = await filesync.hashes(ctx);\n if (!hashes.inSync && (hashes.localChangesToPush.size > 0 || !hashes.onlyDotGadgetFilesChanged)) {\n // the following is true:\n // 1. our local files don't match our environment's files\n // 2. we have local changes to push or non .gadget/ files have changed on our environment\n // therefor, we need to push before we can deploy\n await filesync.print(ctx, { hashes });\n\n if (!args[\"--force\"]) {\n // they didn't pass --force, so we need to ask them if they want to push\n println({\n ensureEmptyLineAbove: true,\n content: \"Your environment's files must match your local files before you can deploy.\",\n });\n\n if (output.isInteractive || env.testLike) {\n // we're interactive, so ask them what they want to do\n let content: string;\n // eslint-disable-next-line max-depth\n switch (true) {\n case hashes.bothChanged:\n content = sprint`Would you like to push your local changes and {underline discard your environment's} changes now?`;\n args[\"--force\"] = true; // accepting this confirmation implies --force\n break;\n case hashes.localChangesToPush.size > 0:\n content = sprint`Would you like to push your local changes now?`;\n break;\n case hashes.environmentChanges.size > 0:\n content = sprint`Do you want to {underline discard your environment's} changes now?`;\n args[\"--force\"] = true; // same as above\n break;\n default:\n unreachable(\"no changes to push or discard\");\n }\n\n await confirm(content);\n } else {\n // we're not interactive, so we're likely in a CI/CD environment\n // assume they want to push\n println({\n ensureEmptyLineAbove: true,\n content: \"Assuming you want to push your local files now.\",\n });\n }\n }\n\n await filesync.push(ctx, { command: \"deploy\", hashes, force: args[\"--force\"] });\n }\n\n const variables = {\n localFilesVersion: String(syncJson.filesVersion),\n force: args[\"--allow-problems\"],\n allowDeletedData: args[\"--allow-data-delete\"],\n allowCharges: args[\"--allow-charges\"],\n };\n\n let spinner: spinner | undefined;\n let currentStep: AppDeploymentSteps = AppDeploymentSteps.NOT_STARTED;\n let printedProblems = false;\n\n const subscription = syncJson.edit.subscribe({\n subscription: PUBLISH_STATUS_SUBSCRIPTION,\n variables,\n onError: async (error) => {\n ctx.log.error(\"failed to deploy\", { error });\n spinner?.fail(stepToSpinnerStart(syncJson, currentStep) + \" \" + ts());\n\n if (isGraphQLErrors(error.cause)) {\n const graphqlError = error.cause[0];\n assert(graphqlError, \"expected graphqlError to be defined\");\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- TODO: extensions is typed as never undefined, but it can be.\n if (graphqlError.extensions) {\n switch (true) {\n case graphqlError.extensions[\"requiresUpgrade\"]:\n println({ ensureEmptyLineAbove: true, content: graphqlError.message.replace(/GGT_PAYMENT_REQUIRED:?\\s*/, \"\") });\n process.exit(1);\n break;\n case graphqlError.extensions[\"requiresAdditionalCharge\"]:\n println({ ensureEmptyLineAbove: true, content: graphqlError.message.replace(/GGT_PAYMENT_REQUIRED:?\\s*/, \"\") });\n await confirm({ ensureEmptyLineAbove: true, content: \"Do you want to continue?\" });\n subscription.resubscribe({ ...variables, allowCharges: true });\n return;\n }\n }\n }\n\n await reportErrorAndExit(ctx, error);\n },\n onData: async ({ publishStatus }): Promise<void> => {\n if (!publishStatus) {\n ctx.log.warn(\"received empty publish status\");\n return;\n }\n\n const { publishStarted, progress: step, issues, status, deletedModelsAndFields } = publishStatus;\n const hasIssues = issues.length > 0;\n\n const { deletedModels, deletedModelFields } = deletedModelsAndFields ?? { deletedModels: [], deletedModelFields: [] };\n const hasDataLoss = deletedModels.length > 0 || deletedModelFields.length > 0;\n\n if (!printedProblems && (hasIssues || hasDataLoss)) {\n printedProblems = true;\n\n const fatalIssues = issues.filter((issue) => issue.severity === ProblemSeverity.Fatal);\n if (fatalIssues.length > 0) {\n await reportErrorAndExit(ctx, new DeployDisallowedError(publishIssuesToProblems(fatalIssues)));\n }\n\n if (hasIssues) {\n println({ ensureEmptyLineAbove: true, content: sprint`{bold.yellow !} {bold Issues found in your development app}` });\n printProblems({ problems: publishIssuesToProblems(issues) });\n }\n\n if (hasDataLoss) {\n println({\n ensureEmptyLineAbove: true,\n content: sprint`{bold.yellow !} {bold Data deleted on deploy}`,\n });\n\n const updated = chalk.blueBright(\"updated\");\n const deleted = chalk.redBright(\"deleted\");\n\n const rows: { symbol: string; name: string; action: string; indent: number }[] = [];\n\n deletedModels.forEach((model: string) => {\n rows.push({ symbol: deletedSymbol, name: chalk.redBright(model), action: deleted, indent: 0 });\n });\n\n deletedModelFields.forEach(({ modelIdentifier, fields }) => {\n rows.push({ symbol: updatedSymbol, name: chalk.blueBright(modelIdentifier), action: updated, indent: 0 });\n fields.forEach((field) => {\n rows.push({ symbol: deletedSymbol, name: chalk.redBright(field), action: deleted, indent: 2 });\n });\n });\n\n const longestNameLength = rows.reduce((longest, row) => Math.max(longest, row.name.length), 0);\n const longestIndent = rows.reduce((longest, row) => Math.max(longest, row.indent), 0);\n const indentSize = 2;\n\n println({\n ensureEmptyLineAbove: true,\n content: chalk.gray(\"These changes will be applied to production based on the app you're deploying.\"),\n });\n for (const row of rows) {\n const indentation = \" \".repeat(row.indent * indentSize);\n const namePadding = \" \".repeat(longestNameLength - row.name.length + 2);\n const actionPadding = \" \".repeat((longestIndent - row.indent) * indentSize);\n println({\n ensureEmptyLineAbove: false,\n content: indentString(`${indentation}${row.symbol} ${row.name}${namePadding}${actionPadding}${row.action}`, 6),\n });\n }\n }\n\n if (!publishStarted) {\n await confirm(\"Do you want to continue?\");\n subscription.resubscribe({ ...variables, force: true, allowDeletedData: true });\n } else {\n const allowDataDelete = args[\"--allow-data-delete\"];\n const allowProblems = args[\"--allow-problems\"];\n\n if (!allowDataDelete && !allowProblems) {\n throw new UnexpectedError(\"expected --allow-data-delete or --allow-problems to be true\");\n }\n\n if (allowProblems) {\n println(sprint`Deploying regardless of problems because \"${chalk.gray(\"--allow-problems\")}\" was passed.`);\n }\n\n if (allowDataDelete) {\n println(sprint`Deploying regardless of deleted data because \"${chalk.gray(\"--allow-data-delete\")}\" was passed.`);\n }\n }\n\n return;\n }\n\n if (status?.code === \"Errored\") {\n spinner?.fail(stepToSpinnerStart(syncJson, currentStep) + \" \" + ts());\n\n if (status.message) {\n println({ ensureEmptyLineAbove: true, content: chalk.red(status.message) });\n }\n if (status.output) {\n println({ ensureEmptyLineAbove: true, content: sprint`${terminalLink(\"Check logs\", status.output)}` });\n }\n return;\n }\n\n if (step === AppDeploymentSteps.COMPLETED) {\n spinner?.succeed(stepToSpinnerEnd(syncJson, currentStep));\n\n let content = chalk.green(\"Deploy successful!\");\n if (status?.output) {\n content += ` ${terminalLink(\"Check logs\", status.output)}.`;\n }\n\n println({ ensureEmptyLineAbove: true, content });\n return;\n }\n\n if (step !== currentStep) {\n const spinnerText = stepToSpinnerStart(syncJson, step);\n if (spinnerText !== spinner?.text) {\n // stop the current spinner, if any, and start a new one\n spinner?.succeed(stepToSpinnerEnd(syncJson, currentStep));\n\n const ensureEmptyLineAbove = currentStep === AppDeploymentSteps.NOT_STARTED || !output.isInteractive;\n spinner = spin({ ensureEmptyLineAbove, content: spinnerText });\n }\n\n currentStep = step as AppDeploymentSteps;\n }\n },\n onComplete: () => {\n subscription.unsubscribe();\n },\n });\n};\n\nexport const AppDeploymentSteps = Object.freeze({\n NOT_STARTED: \"NOT_STARTED\",\n STARTING: \"STARTING\",\n BUILDING_ASSETS: \"BUILDING_ASSETS\",\n UPLOADING_ASSETS: \"UPLOADING_ASSETS\",\n CONVERGING_STORAGE: \"CONVERGING_STORAGE\",\n PUBLISHING_TREE: \"PUBLISHING_TREE\",\n RELOADING_SANDBOX: \"RELOADING_SANDBOX\",\n COMPLETED: \"COMPLETED\",\n});\n\nexport type AppDeploymentSteps = (typeof AppDeploymentSteps)[keyof typeof AppDeploymentSteps];\n\nexport const stepToSpinnerStart = (syncJson: SyncJson, step: string): string => {\n switch (step) {\n case AppDeploymentSteps.NOT_STARTED:\n case AppDeploymentSteps.STARTING:\n case AppDeploymentSteps.BUILDING_ASSETS:\n case AppDeploymentSteps.UPLOADING_ASSETS:\n return \"Building frontend assets.\";\n case AppDeploymentSteps.CONVERGING_STORAGE:\n return \"Setting up database.\";\n case AppDeploymentSteps.PUBLISHING_TREE:\n return `Copying ${syncJson.environment.name}.`;\n case AppDeploymentSteps.RELOADING_SANDBOX:\n return \"Restarting app.\";\n case AppDeploymentSteps.COMPLETED:\n return \"Deploy complete!\";\n default:\n return \"Unknown step.\";\n }\n};\n\nexport const stepToSpinnerEnd = (syncJson: SyncJson, step: string): string => {\n switch (step) {\n case AppDeploymentSteps.NOT_STARTED:\n case AppDeploymentSteps.STARTING:\n case AppDeploymentSteps.BUILDING_ASSETS:\n case AppDeploymentSteps.UPLOADING_ASSETS:\n return `Built frontend assets. ${ts()}`;\n case AppDeploymentSteps.CONVERGING_STORAGE:\n return `Setup database. ${ts()}`;\n case AppDeploymentSteps.PUBLISHING_TREE:\n return `Copied ${syncJson.environment.name}. ${ts()}`;\n case AppDeploymentSteps.RELOADING_SANDBOX:\n return `Restarted app. ${ts()}`;\n case AppDeploymentSteps.COMPLETED:\n return \"Deploy successful!\";\n default:\n return `Completed unknown step. ${ts()}`;\n }\n};\n"],
5
- "mappings": "2qBAAAA,IAEA,OAAOC,OAAY,cAuBZ,IAAMC,GAAO,CAClB,GAAGA,GACH,QAAS,CAAE,KAAM,OAAQ,MAAO,CAAC,KAAM,gBAAiB,QAA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EAAmB,SACxB,KAAKA,EAAmB,gBACxB,KAAKA,EAAmB,iBACtB,MAAO,4BACT,KAAKA,EAAmB,mBACtB,MAAO,uBACT,KAAKA,EAAmB,gBACtB,MAAO,WAAWf,EAAS,YAAY,IAAI,IAC7C,KAAKe,EAAmB,kBACtB,MAAO,kBACT,KAAKA,EAAmB,UACtB,MAAO,mBACT,QACE,MAAO,eACX,CACF,EAlBkC,sBAoBrBiD,GAAmBvE,EAAA,CAACO,EAAoB4B,IAAyB,CAC5E,OAAQA,EAAM,CACZ,KAAKb,EAAmB,YACxB,KAAKA,EAAmB,SACxB,KAAKA,EAAmB,gBACxB,KAAKA,EAAmB,iBACtB,MAAO,0BAA0BM,EAAG,CAAC,GACvC,KAAKN,EAAmB,mBACtB,MAAO,mBAAmBM,EAAG,CAAC,GAChC,KAAKN,EAAmB,gBACtB,MAAO,UAAUf,EAAS,YAAY,IAAI,KAAKqB,EAAG,CAAC,GACrD,KAAKN,EAAmB,kBACtB,MAAO,kBAAkBM,EAAG,CAAC,GAC/B,KAAKN,EAAmB,UACtB,MAAO,qBACT,QACE,MAAO,2BAA2BM,EAAG,CAAC,EAC1C,CACF,EAlBgC",
6
- "names": ["init_cjs", "assert", "args", "usage", "__name", "_ctx", "sprint", "run", "ctx", "directory", "loadSyncJsonDirectory", "syncJson", "SyncJson", "println", "terminalLink", "filesync", "FileSync", "hashes", "output", "env", "content", "unreachable", "confirm", "variables", "spinner", "currentStep", "AppDeploymentSteps", "printedProblems", "subscription", "PUBLISH_STATUS_SUBSCRIPTION", "error", "stepToSpinnerStart", "ts", "isGraphQLErrors", "graphqlError", "assert", "reportErrorAndExit", "publishStatus", "publishStarted", "step", "issues", "status", "deletedModelsAndFields", "hasIssues", "deletedModels", "deletedModelFields", "hasDataLoss", "fatalIssues", "issue", "ProblemSeverity", "DeployDisallowedError", "publishIssuesToProblems", "printProblems", "updated", "source_default", "deleted", "rows", "model", "deletedSymbol", "modelIdentifier", "fields", "updatedSymbol", "field", "longestNameLength", "longest", "row", "longestIndent", "indentSize", "indentation", "namePadding", "actionPadding", "indentString", "allowDataDelete", "allowProblems", "UnexpectedError", "stepToSpinnerEnd", "spinnerText", "ensureEmptyLineAbove", "spin"]
7
- }
@@ -1,2 +0,0 @@
1
- import{r as a,s as b,t as c}from"./chunk-XQWSZW7K.js";import"./chunk-DYAWQS24.js";import"./chunk-XGQQOMPO.js";import"./chunk-KMNQ3LJT.js";import"./chunk-24OT7GHO.js";import"./chunk-GFQYFEEH.js";import"./chunk-7DYQUG5M.js";export{c as login,b as run,a as usage};
2
- //# sourceMappingURL=login-6MLYS6A4.js.map
@@ -1,2 +0,0 @@
1
- import{a,b,c}from"./chunk-MBWB2XUY.js";import"./chunk-VJTDX5WL.js";import"./chunk-D2R4J557.js";import"./chunk-JSGXXXFU.js";import"./chunk-WNAYBYSG.js";import"./chunk-FGUWID6B.js";import"./chunk-JBY5A44K.js";import"./chunk-HN3YKQ3C.js";import"./chunk-XQWSZW7K.js";import"./chunk-DYAWQS24.js";import"./chunk-XGQQOMPO.js";import"./chunk-KMNQ3LJT.js";import"./chunk-24OT7GHO.js";import"./chunk-GFQYFEEH.js";import"./chunk-7DYQUG5M.js";export{a as args,c as run,b as usage};
2
- //# sourceMappingURL=push-62ZJ6D3R.js.map