@stacksjs/actions 0.70.73 → 0.70.75

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 (163) hide show
  1. package/dist/action.d.ts +8 -6
  2. package/dist/action.js +1 -1
  3. package/dist/actions.js +1 -1
  4. package/dist/add.js +1 -1
  5. package/dist/ai/request-model-access.d.ts +1 -1
  6. package/dist/ai/request-model-access.js +1 -1
  7. package/dist/auth/client.d.ts +1 -1
  8. package/dist/auth/prune.d.ts +1 -1
  9. package/dist/auth/setup.d.ts +1 -1
  10. package/dist/auth/token.d.ts +1 -1
  11. package/dist/blog.js +23 -23
  12. package/dist/build/cli.d.ts +1 -1
  13. package/dist/build/component-libs.d.ts +1 -1
  14. package/dist/build/core.d.ts +1 -1
  15. package/dist/build/desktop.d.ts +1 -1
  16. package/dist/build/docs.d.ts +1 -1
  17. package/dist/build/frontend-static.js +1 -1
  18. package/dist/build/server.d.ts +1 -1
  19. package/dist/build/stacks.d.ts +1 -1
  20. package/dist/build/views.d.ts +1 -1
  21. package/dist/build.js +1 -1
  22. package/dist/bump.d.ts +1 -1
  23. package/dist/bump.js +7 -2
  24. package/dist/changelog.d.ts +0 -1
  25. package/dist/changelog.js +2 -1
  26. package/dist/check/ports.d.ts +1 -1
  27. package/dist/{chunk-8tmc78d6.js → chunk-49ry9mgz.js} +1 -1
  28. package/dist/{chunk-qqth0x9w.js → chunk-73y0wp0s.js} +1 -1
  29. package/dist/{chunk-bbd6n9q2.js → chunk-8kvzjd10.js} +1 -1
  30. package/dist/{chunk-vn8sr2rt.js → chunk-dxvgx0r7.js} +1 -1
  31. package/dist/{chunk-jn81jcta.js → chunk-f8z1aft6.js} +1 -1
  32. package/dist/{chunk-29eg94q3.js → chunk-gcjrdkq7.js} +1 -1
  33. package/dist/{chunk-c0cs49hn.js → chunk-heh4x32p.js} +1 -1
  34. package/dist/{chunk-y5k9qbfd.js → chunk-hr9ndn21.js} +1 -1
  35. package/dist/{chunk-b10hy2vq.js → chunk-hv8tkjw2.js} +2 -2
  36. package/dist/{chunk-ckcjsw9a.js → chunk-n057zfgw.js} +1 -1
  37. package/dist/{chunk-j9vajggg.js → chunk-t5j470r2.js} +1 -1
  38. package/dist/chunk-v0hqskdk.js +3 -0
  39. package/dist/{chunk-r3t7shd4.js → chunk-v1dg1jp6.js} +1 -1
  40. package/dist/{chunk-prpycg7f.js → chunk-w4erevzw.js} +1 -1
  41. package/dist/{chunk-m0v346zb.js → chunk-x0cnhg3z.js} +1 -1
  42. package/dist/clean.d.ts +1 -1
  43. package/dist/commit.js +1 -1
  44. package/dist/copy-types.d.ts +1 -1
  45. package/dist/database/seed.d.ts +1 -1
  46. package/dist/deploy/create-receipt-rule.d.ts +1 -1
  47. package/dist/deploy/index.d.ts +1 -1
  48. package/dist/deploy/index.js +2 -2
  49. package/dist/dev/api.d.ts +1 -1
  50. package/dist/dev/api.js +1 -1
  51. package/dist/dev/components.d.ts +1 -1
  52. package/dist/dev/dashboard-globals.js +1 -1
  53. package/dist/dev/dashboard-utils.d.ts +59 -53
  54. package/dist/dev/dashboard-utils.js +1 -1
  55. package/dist/dev/dashboard.d.ts +10 -0
  56. package/dist/dev/dashboard.js +4 -4
  57. package/dist/dev/desktop.d.ts +1 -1
  58. package/dist/dev/docs.d.ts +1 -1
  59. package/dist/dev/docs.js +1 -1
  60. package/dist/dev/index.js +1 -1
  61. package/dist/dev/migrate-watcher.js +1 -1
  62. package/dist/dev/system-tray.d.ts +1 -1
  63. package/dist/dev/views.d.ts +1 -1
  64. package/dist/dev/views.js +1 -1
  65. package/dist/discover-packages.js +1 -1
  66. package/dist/domains/add.d.ts +1 -1
  67. package/dist/domains/remove.d.ts +1 -1
  68. package/dist/examples.js +1 -1
  69. package/dist/find-projects.d.ts +1 -1
  70. package/dist/fresh.d.ts +1 -1
  71. package/dist/generate/action-types.d.ts +1 -1
  72. package/dist/generate/component-meta.d.ts +1 -1
  73. package/dist/generate/component-meta.js +1 -1
  74. package/dist/generate/custom-cli-file.d.ts +1 -1
  75. package/dist/generate/env-files.d.ts +1 -1
  76. package/dist/generate/env-files.js +1 -1
  77. package/dist/generate/ide-helpers.d.ts +1 -1
  78. package/dist/generate/ide-helpers.js +1 -1
  79. package/dist/generate/index.js +1 -1
  80. package/dist/generate/lib-entries.js +1 -1
  81. package/dist/generate/pantry-file.d.ts +1 -1
  82. package/dist/generate/symlink-core.d.ts +1 -1
  83. package/dist/generate/types.d.ts +1 -1
  84. package/dist/generate/vscode-custom-data.d.ts +1 -1
  85. package/dist/generate/vscode-custom-data.js +1 -1
  86. package/dist/helpers/component-meta.js +1 -1
  87. package/dist/helpers/index.js +1 -1
  88. package/dist/helpers/lib-entries.js +1 -1
  89. package/dist/helpers/package-json.js +1 -1
  90. package/dist/helpers/utils.js +1 -1
  91. package/dist/helpers/vscode-custom-data.js +1 -1
  92. package/dist/index.js +1 -1
  93. package/dist/key-generate.d.ts +1 -1
  94. package/dist/lint/fix.d.ts +1 -1
  95. package/dist/lint/fix.js +1 -1
  96. package/dist/lint/index.d.ts +1 -1
  97. package/dist/lint/index.js +1 -1
  98. package/dist/lint/lint.js +1 -1
  99. package/dist/make-command.js +1 -1
  100. package/dist/make-job.js +1 -1
  101. package/dist/make-policy.js +1 -1
  102. package/dist/make-resource.js +1 -1
  103. package/dist/make.js +1 -1
  104. package/dist/migrate/database.d.ts +1 -1
  105. package/dist/migrate/fresh.d.ts +1 -1
  106. package/dist/orm/base.js +1 -1
  107. package/dist/prepublish.d.ts +1 -1
  108. package/dist/queue/clear.d.ts +1 -1
  109. package/dist/queue/dlq-purge.d.ts +1 -1
  110. package/dist/queue/dlq-retry.d.ts +1 -1
  111. package/dist/queue/dlq.d.ts +1 -1
  112. package/dist/queue/failed.d.ts +1 -1
  113. package/dist/queue/flush.d.ts +1 -1
  114. package/dist/queue/inspect.d.ts +1 -1
  115. package/dist/queue/list.d.ts +1 -1
  116. package/dist/queue/monitor.d.ts +1 -1
  117. package/dist/queue/pause.d.ts +1 -1
  118. package/dist/queue/quarantine.d.ts +1 -1
  119. package/dist/queue/resume.d.ts +1 -1
  120. package/dist/queue/retry.d.ts +1 -1
  121. package/dist/queue/schedule-list.d.ts +1 -1
  122. package/dist/queue/schedule.d.ts +1 -1
  123. package/dist/queue/status.d.ts +1 -1
  124. package/dist/queue/table.d.ts +1 -1
  125. package/dist/queue/unquarantine.d.ts +1 -1
  126. package/dist/queue/work.d.ts +1 -1
  127. package/dist/release.d.ts +1 -1
  128. package/dist/release.js +1 -1
  129. package/dist/route/list.d.ts +1 -1
  130. package/dist/run-action.js +1 -1
  131. package/dist/saas/setup.d.ts +1 -1
  132. package/dist/scaffold-crud.js +1 -1
  133. package/dist/schedule/run.d.ts +1 -1
  134. package/dist/search/flush.d.ts +1 -1
  135. package/dist/search/import.d.ts +1 -1
  136. package/dist/search/settings-list.d.ts +1 -1
  137. package/dist/search/settings.d.ts +1 -1
  138. package/dist/serve/api.d.ts +1 -1
  139. package/dist/setup/index.js +1 -1
  140. package/dist/setup/ssl.js +1 -1
  141. package/dist/stacks.js +1 -1
  142. package/dist/templates.d.ts +21 -1
  143. package/dist/templates.js +1 -1
  144. package/dist/test/feature.d.ts +1 -1
  145. package/dist/test/index.d.ts +1 -1
  146. package/dist/test/ui.d.ts +1 -1
  147. package/dist/test/unit.d.ts +1 -1
  148. package/dist/typecheck.d.ts +1 -1
  149. package/dist/types.js +1 -1
  150. package/dist/upgrade/binary.d.ts +1 -1
  151. package/dist/upgrade/dependencies.js +1 -1
  152. package/dist/upgrade/framework-utils.js +1 -1
  153. package/dist/upgrade/framework.d.ts +1 -1
  154. package/dist/upgrade/framework.js +1 -1
  155. package/dist/upgrade/index.d.ts +1 -1
  156. package/dist/upgrade/index.js +1 -1
  157. package/dist/upgrade/packages.js +8 -8
  158. package/dist/upgrade/shell.d.ts +1 -1
  159. package/dist/upgrade.js +1 -1
  160. package/package.json +26 -23
  161. package/dist/chunk-1ebgbeyr.js +0 -920
  162. package/dist/chunk-h3163h5z.js +0 -3
  163. package/dist/chunk-vntz6mtt.js +0 -16
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"../chunk-cdk2r2jd.js";import{A as h,t as a,u as b,v as c,w as d,x as e,y as f,z as g}from"../chunk-j9vajggg.js";import"../chunk-h3163h5z.js";export{e as trustCertificate,c as sslCertificatesExist,g as setupSSL,h as isSSLSetupComplete,a as isDomainInHosts,d as isCertificateTrusted,f as generateCertificates,b as addDomainToHosts};
2
+ import"../chunk-cdk2r2jd.js";import{A as h,t as a,u as b,v as c,w as d,x as e,y as f,z as g}from"../chunk-t5j470r2.js";import"../chunk-v0hqskdk.js";export{e as trustCertificate,c as sslCertificatesExist,g as setupSSL,h as isSSLSetupComplete,a as isDomainInHosts,d as isCertificateTrusted,f as generateCertificates,b as addDomainToHosts};
package/dist/setup/ssl.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{A as h,t as a,u as b,v as c,w as d,x as e,y as f,z as g}from"../chunk-j9vajggg.js";import"../chunk-h3163h5z.js";export{e as trustCertificate,c as sslCertificatesExist,g as setupSSL,h as isSSLSetupComplete,a as isDomainInHosts,d as isCertificateTrusted,f as generateCertificates,b as addDomainToHosts};
2
+ import{A as h,t as a,u as b,v as c,w as d,x as e,y as f,z as g}from"../chunk-t5j470r2.js";import"../chunk-v0hqskdk.js";export{e as trustCertificate,c as sslCertificatesExist,g as setupSSL,h as isSSLSetupComplete,a as isDomainInHosts,d as isCertificateTrusted,f as generateCertificates,b as addDomainToHosts};
package/dist/stacks.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{q as a,r as b,s as c}from"./chunk-0wyxyqak.js";import"./chunk-h3163h5z.js";export{b as uninstallStack,c as listStacks,a as installStack};
2
+ import{q as a,r as b,s as c}from"./chunk-0wyxyqak.js";import"./chunk-v0hqskdk.js";export{b as uninstallStack,c as listStacks,a as installStack};
@@ -4,5 +4,25 @@
4
4
  * These templates use the {0}, {1}, etc. format for template substitution
5
5
  * which works with the @stacksjs/strings template function
6
6
  */
7
- export declare const CODE_TEMPLATES: () => unknown;
7
+ export declare const CODE_TEMPLATES: {
8
+ action: string;
9
+ actionWithValidation: string;
10
+ actionWithAuth: string;
11
+ actionWithBoth: string;
12
+ component: string;
13
+ page: string;
14
+ function: string;
15
+ language: string;
16
+ notification: string;
17
+ mail: string;
18
+ mailTemplate: string;
19
+ middleware: string;
20
+ model: string;
21
+ migration: string;
22
+ stackPackageJson: string;
23
+ job: string;
24
+ event: string;
25
+ listener: string;
26
+ command: string
27
+ };
8
28
  export type TemplateKey = keyof typeof CODE_TEMPLATES;
package/dist/templates.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{fa as a}from"./chunk-w363nwy3.js";import"./chunk-h3163h5z.js";export{a as CODE_TEMPLATES};
2
+ import{fa as a}from"./chunk-w363nwy3.js";import"./chunk-v0hqskdk.js";export{a as CODE_TEMPLATES};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
package/dist/test/ui.d.ts CHANGED
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
package/dist/types.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-h3163h5z.js";import t from"process";import{NpmScript as e}from"@stacksjs/enums";import{log as s}from"@stacksjs/logging";import{ExitCode as i}from"@stacksjs/types";import{runNpmScript as p}from"@stacksjs/utils";async function m(r){let o=await p(e.TypesFix,r);if(o.isErr)s.error("There was an error fixing your types.",o.error),t.exit(i.FatalError);s.success("Types are set")}async function u(r){return await m(r)}export{u as types,m as invoke};
2
+ import"./chunk-v0hqskdk.js";import t from"process";import{NpmScript as e}from"@stacksjs/enums";import{log as s}from"@stacksjs/logging";import{ExitCode as i}from"@stacksjs/types";import{runNpmScript as p}from"@stacksjs/utils";async function m(r){let o=await p(e.TypesFix,r);if(o.isErr)s.error("There was an error fixing your types.",o.error),t.exit(i.FatalError);s.success("Types are set")}async function u(r){return await m(r)}export{u as types,m as invoke};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"../chunk-h3163h5z.js";var c=void 0;export{c as default};
2
+ import"../chunk-v0hqskdk.js";var c=void 0;export{c as default};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n}from"../chunk-n24m8prb.js";import"../chunk-h3163h5z.js";export{g as writeSyncedVersion,e as writeChannel,m as snapshotTree,h as shouldShortCircuit,i as resolveUpgradeMessage,a as resolveUpgradeContext,j as resolveSuccessMessage,c as readVersion,f as readSyncedVersion,d as readChannel,n as diffSnapshots,l as detectLocalStacks,b as buildTemplateString,k as MANAGED_PATHS};
2
+ import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n}from"../chunk-n24m8prb.js";import"../chunk-v0hqskdk.js";export{g as writeSyncedVersion,e as writeChannel,m as snapshotTree,h as shouldShortCircuit,i as resolveUpgradeMessage,a as resolveUpgradeContext,j as resolveSuccessMessage,c as readVersion,f as readSyncedVersion,d as readChannel,n as diffSnapshots,l as detectLocalStacks,b as buildTemplateString,k as MANAGED_PATHS};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{c as R,d as x,e as w,f as S,g as u,h as y,i as h,j as p,k as g,l as d,m as D,n as l,o as H,p as m}from"../chunk-n24m8prb.js";import{sb as j}from"../chunk-h3163h5z.js";import{copyFileSync as i,cpSync as a,existsSync as B,mkdirSync as f,readFileSync as e,rmSync as qq}from"fs";import{dirname as zq,join as U}from"path";import I from"process";import{parseOptions as Kq}from"@stacksjs/cli";import{downloadTemplate as n}from"@stacksjs/gitit";import{path as N}from"@stacksjs/path";import{ExitCode as C}from"@stacksjs/types";var Y=Kq(),O=N.projectPath();if(!B(N.projectPath("storage/framework/core"))){let{upgradeStacksPackages:q}=await import("./packages.js");await q(O,{version:Y.version,canary:Y.canary,stable:Y.stable,force:Y.force,dryRun:Y.dryRun,noPostinstall:Y.noPostinstall??Y.postinstall===!1})}var c=U(O,".stacks-channel"),s=U(O,".stacks-version"),A=S(c),$=R(Y,A),r=N.projectPath("storage/framework/core/buddy/package.json"),Qq=w(r),Wq=Y.from?N.projectPath(Y.from):null,_=Wq??l(O),E=!!_;console.log(g($,A,!!Y.stable));console.log(E?` source: local checkout at ${_}`:` source: github:stacksjs/stacks#${$.ref}`);if(!Y.force){let q=await Jq(O);if(q.length>0){console.warn(`
2
+ import{c as R,d as x,e as w,f as S,g as u,h as y,i as h,j as p,k as g,l as d,m as D,n as l,o as H,p as m}from"../chunk-n24m8prb.js";import{qb as j}from"../chunk-v0hqskdk.js";import{copyFileSync as i,cpSync as a,existsSync as B,mkdirSync as f,readFileSync as e,rmSync as qq}from"fs";import{dirname as zq,join as U}from"path";import I from"process";import{parseOptions as Kq}from"@stacksjs/cli";import{downloadTemplate as n}from"@stacksjs/gitit";import{path as N}from"@stacksjs/path";import{ExitCode as C}from"@stacksjs/types";var Y=Kq(),O=N.projectPath();if(!B(N.projectPath("storage/framework/core"))){let{upgradeStacksPackages:q}=await import("./packages.js");await q(O,{version:Y.version,canary:Y.canary,stable:Y.stable,force:Y.force,dryRun:Y.dryRun,noPostinstall:Y.noPostinstall??Y.postinstall===!1})}var c=U(O,".stacks-channel"),s=U(O,".stacks-version"),A=S(c),$=R(Y,A),r=N.projectPath("storage/framework/core/buddy/package.json"),Qq=w(r),Wq=Y.from?N.projectPath(Y.from):null,_=Wq??l(O),E=!!_;console.log(g($,A,!!Y.stable));console.log(E?` source: local checkout at ${_}`:` source: github:stacksjs/stacks#${$.ref}`);if(!Y.force){let q=await Jq(O);if(q.length>0){console.warn(`
3
3
  \u26A0 The following framework-managed paths have uncommitted changes:`);for(let z of q)console.warn(` - ${z}`);console.warn(`
4
4
  Aborting to avoid clobbering your edits.`),console.warn(` Re-run with --force to overwrite, or commit / stash the changes first.
5
5
  `),I.exit(C.FatalError)}}var G=null;if(!Y.force&&!$.targetVersion){G=await t($,E,_);let q=y(s);if(p({force:!!Y.force,targetVersion:$.targetVersion,remoteSha:G,synced:q,channel:$.channel}))console.log(`\u2714 Already on the latest ${$.channel} (${G.slice(0,7)}).`),I.exit(C.Success)}var b=N.frameworkPath("core/actions/src/upgrade/framework.ts"),k=await o(b),V={added:0,changed:0,removed:0,unchanged:0},v=[];try{for(let q of D){let z=U(O,q.localPath),K=q.isFile?await T(z):await H(z,q.skip);if(E&&_)await Bq(_,q,z);else{if(q.isFile)continue;await Iq($.ref,q,z,!!Y.force)}let Q=q.isFile?await T(z):await H(z,q.skip),W=m(K,Q);V.added+=W.added,V.changed+=W.changed,V.removed+=W.removed,V.unchanged+=W.unchanged,v.push({managed:q,summary:W})}if(!E)await Uq($.ref)}catch(q){console.error("\u2718 Failed to upgrade Stacks framework:",q?.message||q),I.exit(C.FatalError)}var Xq=w(r),P=await o(b),Yq=I.argv.includes("--__restarted");if(k!==0n&&P!==0n&&k!==P&&!Yq){console.log(`Upgrade pulled a newer version of the upgrade action \u2014 re-running once to pick up new sync paths and hooks.
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"../chunk-s735m9mg.js";import{gb as r}from"../chunk-bbd6n9q2.js";import"../chunk-h3163h5z.js";import e from"process";import{parseArgs as o}from"@stacksjs/cli";import{Action as i}from"@stacksjs/enums";import{ExitCode as t}from"@stacksjs/types";var a=o();if(a?.framework||a?.all)await r(i.UpgradeFramework,a);if(a?.dependencies||a?.all)await r(i.UpgradeDeps,a);if(a?.bun||a?.all)await r(i.UpgradeBun,a);if(a?.shell||a?.all)await r(i.UpgradeShell,a);if(a?.binary||a?.all)await r(i.UpgradeBinary,a);e.exit(t.Success);
2
+ import"../chunk-s735m9mg.js";import{gb as r}from"../chunk-8kvzjd10.js";import"../chunk-v0hqskdk.js";import e from"process";import{parseArgs as o}from"@stacksjs/cli";import{Action as i}from"@stacksjs/enums";import{ExitCode as t}from"@stacksjs/types";var a=o();if(a?.framework||a?.all)await r(i.UpgradeFramework,a);if(a?.dependencies||a?.all)await r(i.UpgradeDeps,a);if(a?.bun||a?.all)await r(i.UpgradeBun,a);if(a?.shell||a?.all)await r(i.UpgradeShell,a);if(a?.binary||a?.all)await r(i.UpgradeBinary,a);e.exit(t.Success);
@@ -1,12 +1,12 @@
1
1
  // @bun
2
- import"../chunk-h3163h5z.js";import{existsSync as U,readFileSync as V,writeFileSync as W}from"fs";import{join as X}from"path";import N from"process";import{runCommand as Y}from"@stacksjs/cli";async function Z(A){let z=await fetch("https://registry.npmjs.org/stacks").catch(()=>null);if(!z||!z.ok)throw Error("Could not reach the npm registry to resolve the target `stacks` version.");let J=await z.json(),K=J["dist-tags"]??{},H=J.versions??{},q;if(A.version){if(!H[A.version])throw Error(`stacks@${A.version} was not found on the npm registry.`);q=A.version}else{let I=A.canary?"canary":"latest",b=K[I];if(!b)throw Error(`The \`${I}\` dist-tag is not published for \`stacks\`.`);q=b}let E=new Set(Object.keys(H[q]?.dependencies??{}));return{version:q,coreDeps:E}}function _(A,z,J){let K=[],H=(q)=>q==="stacks"||q.startsWith("@stacksjs/")&&J.has(q);for(let q of["dependencies","devDependencies"]){let E=A[q];if(!E)continue;for(let[I,b]of Object.entries(E)){if(!H(I))continue;let G=`${/^[\^~]/.test(b)?b[0]:/^\d/.test(b)?"":"^"}${z}`;if(b!==G)K.push({name:I,from:b,to:G}),E[I]=G}}return K}async function T(A,z){let J=X(A,"package.json");if(!U(J))console.error("No package.json found \u2014 nothing to upgrade."),N.exit(1);let K=V(J,"utf-8"),H=JSON.parse(K),q=H.dependencies?.stacks??H.devDependencies?.stacks,{version:E,coreDeps:I}=await Z(z).catch((M)=>{console.error(`\u2717 ${M.message}`),N.exit(1)});if(console.log(`
2
+ import"../chunk-v0hqskdk.js";import{existsSync as U,readFileSync as V,writeFileSync as W}from"fs";import{join as X}from"path";import M from"process";import{runCommand as Y}from"@stacksjs/cli";async function Z(A){let z=await fetch("https://registry.npmjs.org/stacks").catch(()=>null);if(!z||!z.ok)throw Error("Could not reach the npm registry to resolve the target `stacks` version.");let I=await z.json(),J=I["dist-tags"]??{},G=I.versions??{},q;if(A.version){if(!G[A.version])throw Error(`stacks@${A.version} was not found on the npm registry.`);q=A.version}else{let H=A.canary?"canary":"latest",b=J[H];if(!b)throw Error(`The \`${H}\` dist-tag is not published for \`stacks\`.`);q=b}let E=new Set(Object.keys(G[q]?.dependencies??{}));return{version:q,coreDeps:E}}function _(A,z,I){let J=[],G=(q)=>q==="stacks"||q.startsWith("@stacksjs/")&&I.has(q);for(let q of["dependencies","devDependencies"]){let E=A[q];if(!E)continue;for(let[H,b]of Object.entries(E)){if(!G(H))continue;let O=`${/^[\^~]/.test(b)?b[0]:/^\d/.test(b)?"":"^"}${z}`;if(b!==O)J.push({name:H,from:b,to:O}),E[H]=O}}return J}async function T(A,z){let I=X(A,"package.json");if(!U(I))console.error("No package.json found \u2014 nothing to upgrade."),M.exit(1);let J=V(I,"utf-8"),G=JSON.parse(J),q=G.dependencies?.stacks??G.devDependencies?.stacks,{version:E,coreDeps:H}=await Z(z).catch((K)=>{console.error(`\u2717 ${K.message}`),M.exit(1)});if(console.log(`
3
3
  Upgrading the Stacks framework${z.canary?" (canary)":""} \u2192 ${E}`),q)console.log(` current \`stacks\` constraint: ${q}
4
- `);let b=_(H,E,I);if(b.length===0&&!z.force)console.log(`\u2714 Already up to date \u2014 every framework dependency matches the target.
5
- `),N.exit(0);if(b.length>0){console.log(" The following dependencies will be updated:");let M=Math.max(...b.map((O)=>O.name.length));for(let O of b)console.log(` ${O.name.padEnd(M)} ${O.from} \u2192 ${O.to}`);console.log("")}if(z.dryRun)console.log(` --dry-run: no files were written and nothing was installed.
6
- `),N.exit(0);if(b.length>0){let M=K.endsWith(`
4
+ `);let b=_(G,E,H);if(b.length===0&&!z.force)console.log(`\u2714 Already up to date \u2014 every framework dependency matches the target.
5
+ `),M.exit(0);if(b.length>0){console.log(" The following dependencies will be updated:");let K=Math.max(...b.map((N)=>N.name.length));for(let N of b)console.log(` ${N.name.padEnd(K)} ${N.from} \u2192 ${N.to}`);console.log("")}if(z.dryRun)console.log(` --dry-run: no files were written and nothing was installed.
6
+ `),M.exit(0);if(b.length>0){let K=J.endsWith(`
7
7
  `)?`
8
- `:"";W(J,`${JSON.stringify(H,null,2)}${M}`),console.log("\u2714 Updated package.json")}let Q=["stacks",...[...I].filter((M)=>M.startsWith("@stacksjs/"))];if(z.noPostinstall)console.log(" --no-postinstall: skipping install. Run this to pull the new versions:"),console.log(` bun update ${Q.slice(0,3).join(" ")} \u2026
9
- `),N.exit(0);console.log(` Installing\u2026
10
- `);let G=await Y(`bun update ${Q.join(" ")}`,{cwd:A});if(G&&typeof G==="object"&&"isErr"in G?typeof G.isErr==="function"?G.isErr():G.isErr===!0:!1)console.error("\n\u2717 The install step failed. Your package.json was updated \u2014 resolve the error and re-run `bun update`.\n"),N.exit(1);console.log(`
8
+ `:"";W(I,`${JSON.stringify(G,null,2)}${K}`),console.log("\u2714 Updated package.json")}let Q=["stacks",...[...H].filter((K)=>K.startsWith("@stacksjs/"))];if(z.noPostinstall)console.log(" --no-postinstall: skipping install. Run this to pull the new versions:"),console.log(` bun update ${Q.slice(0,3).join(" ")} \u2026
9
+ `),M.exit(0);if(console.log(` Installing\u2026
10
+ `),(await Y(`bun update ${Q.join(" ")}`,{cwd:A})).isErr)console.error("\n\u2717 The install step failed. Your package.json was updated \u2014 resolve the error and re-run `bun update`.\n"),M.exit(1);console.log(`
11
11
  \u2714 Upgraded to stacks@${E}. Review the changelog: https://github.com/stacksjs/stacks/releases/tag/v${E}
12
- `),N.exit(0)}export{T as upgradeStacksPackages};
12
+ `),M.exit(0)}export{T as upgradeStacksPackages};
@@ -1 +1 @@
1
-
1
+ export {};
package/dist/upgrade.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-h3163h5z.js";import{readFileSync as K}from"fs";import A from"process";import{intro as L,outro as B,runCommand as I}from"@stacksjs/cli";import{NpmScript as M}from"@stacksjs/enums";import{log as G}from"@stacksjs/logging";import{projectPath as J}from"@stacksjs/path";import*as w from"@stacksjs/storage";import{ExitCode as H}from"@stacksjs/types";var{version:Q}=JSON.parse(K(new URL("../package.json",import.meta.url),"utf8"));function _(b){try{console.log("checkForUncommittedChanges",b)}catch(q){console.error(q)}}async function $(b){let z=J("updates");if(w.doesFolderExist(z))await w.deleteFolder(z);G.info("Downloading framework updates..."),await I("giget stacks updates",b),G.success(`Your framework updated correctly to version: v${Q}`)}async function v(){let b=await L("buddy upgrade:dependencies"),q=await I(M.UpgradeDependencies,{cwd:J()});if(q.isErr)await B("While running the upgrade:dependencies command, there was an issue",{startTime:b,useSeconds:!0},q.error),A.exit(H.FatalError);await B("Freshly updated your dependencies.",{startTime:b,useSeconds:!0}),A.exit(H.Success)}export{v as updateDependencies,$ as downloadFrameworkUpdate,_ as checkForUncommittedChanges};
2
+ import"./chunk-v0hqskdk.js";import{readFileSync as K}from"fs";import A from"process";import{intro as L,outro as B,runCommand as I}from"@stacksjs/cli";import{NpmScript as M}from"@stacksjs/enums";import{log as G}from"@stacksjs/logging";import{projectPath as J}from"@stacksjs/path";import*as w from"@stacksjs/storage";import{ExitCode as H}from"@stacksjs/types";var{version:Q}=JSON.parse(K(new URL("../package.json",import.meta.url),"utf8"));function _(b){try{console.log("checkForUncommittedChanges",b)}catch(q){console.error(q)}}async function $(b){let z=J("updates");if(w.doesFolderExist(z))await w.deleteFolder(z);G.info("Downloading framework updates..."),await I("giget stacks updates",b),G.success(`Your framework updated correctly to version: v${Q}`)}async function v(){let b=await L("buddy upgrade:dependencies"),q=await I(M.UpgradeDependencies,{cwd:J()});if(q.isErr)await B("While running the upgrade:dependencies command, there was an issue",{startTime:b,useSeconds:!0},q.error),A.exit(H.FatalError);await B("Freshly updated your dependencies.",{startTime:b,useSeconds:!0}),A.exit(H.Success)}export{v as updateDependencies,$ as downloadFrameworkUpdate,_ as checkForUncommittedChanges};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.70.73",
4
+ "version": "0.70.75",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -42,10 +42,11 @@
42
42
  "default": "./dist/run-action.js"
43
43
  },
44
44
  "./*": {
45
- "development": "./src/*",
46
- "bun": "./dist/*",
47
- "import": "./dist/*",
48
- "default": "./dist/*"
45
+ "types": "./dist/*.d.ts",
46
+ "development": "./src/*.ts",
47
+ "bun": "./dist/*.js",
48
+ "import": "./dist/*.js",
49
+ "default": "./dist/*.js"
49
50
  }
50
51
  },
51
52
  "module": "dist/index.js",
@@ -60,28 +61,30 @@
60
61
  "prepublishOnly": "bun run build"
61
62
  },
62
63
  "dependencies": {
63
- "@stacksjs/bunpress": "^0.1.11",
64
- "@stacksjs/ts-cloud": "^0.7.12",
64
+ "@stacksjs/bumpx": "^0.2.6",
65
+ "@stacksjs/bunpress": "^0.1.12",
66
+ "@stacksjs/logsmith": "^0.2.3",
67
+ "@stacksjs/ts-cloud": "^0.7.14",
65
68
  "@stacksjs/ts-md": "^0.1.1"
66
69
  },
67
70
  "devDependencies": {
68
- "@stacksjs/api": "0.70.73",
69
- "@stacksjs/cli": "0.70.73",
70
- "@stacksjs/config": "0.70.73",
71
- "@stacksjs/database": "0.70.73",
71
+ "@stacksjs/api": "0.70.75",
72
+ "@stacksjs/cli": "0.70.75",
73
+ "@stacksjs/config": "0.70.75",
74
+ "@stacksjs/database": "0.70.75",
72
75
  "@stacksjs/tlsx": "^0.13.2",
73
- "better-dx": "^0.2.12",
74
- "@stacksjs/dns": "0.70.73",
75
- "@stacksjs/enums": "0.70.73",
76
- "@stacksjs/env": "0.70.73",
77
- "@stacksjs/error-handling": "0.70.73",
78
- "@stacksjs/logging": "0.70.73",
79
- "@stacksjs/path": "0.70.73",
80
- "@stacksjs/security": "0.70.73",
81
- "@stacksjs/storage": "0.70.73",
82
- "@stacksjs/strings": "0.70.73",
83
- "@stacksjs/utils": "0.70.73",
84
- "@stacksjs/validation": "0.70.73"
76
+ "better-dx": "^0.2.16",
77
+ "@stacksjs/dns": "0.70.75",
78
+ "@stacksjs/enums": "0.70.75",
79
+ "@stacksjs/env": "0.70.75",
80
+ "@stacksjs/error-handling": "0.70.75",
81
+ "@stacksjs/logging": "0.70.75",
82
+ "@stacksjs/path": "0.70.75",
83
+ "@stacksjs/security": "0.70.75",
84
+ "@stacksjs/storage": "0.70.75",
85
+ "@stacksjs/strings": "0.70.75",
86
+ "@stacksjs/utils": "0.70.75",
87
+ "@stacksjs/validation": "0.70.75"
85
88
  },
86
89
  "peerDependencies": {
87
90
  "pickier": "^0.1.28"