@stacksjs/actions 0.70.87 → 0.70.88

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 (284) hide show
  1. package/package.json +16 -16
  2. package/dist/action.d.ts +0 -149
  3. package/dist/action.js +0 -2
  4. package/dist/actions.d.ts +0 -2
  5. package/dist/actions.js +0 -2
  6. package/dist/add.d.ts +0 -6
  7. package/dist/add.js +0 -2
  8. package/dist/ai/request-model-access.d.ts +0 -1
  9. package/dist/ai/request-model-access.js +0 -2
  10. package/dist/auth/client.d.ts +0 -1
  11. package/dist/auth/client.js +0 -3
  12. package/dist/auth/prune.d.ts +0 -1
  13. package/dist/auth/prune.js +0 -2
  14. package/dist/auth/setup.d.ts +0 -1
  15. package/dist/auth/setup.js +0 -206
  16. package/dist/auth/token.d.ts +0 -1
  17. package/dist/auth/token.js +0 -2
  18. package/dist/blog.d.ts +0 -19
  19. package/dist/blog.js +0 -148
  20. package/dist/build/cli.d.ts +0 -1
  21. package/dist/build/cli.js +0 -2
  22. package/dist/build/component-libs.d.ts +0 -1
  23. package/dist/build/component-libs.js +0 -2
  24. package/dist/build/core.d.ts +0 -1
  25. package/dist/build/core.js +0 -2
  26. package/dist/build/desktop.d.ts +0 -1
  27. package/dist/build/desktop.js +0 -2
  28. package/dist/build/docs.d.ts +0 -1
  29. package/dist/build/docs.js +0 -2
  30. package/dist/build/frontend-static.d.ts +0 -16
  31. package/dist/build/frontend-static.js +0 -9
  32. package/dist/build/server.d.ts +0 -1
  33. package/dist/build/server.js +0 -2
  34. package/dist/build/stacks.d.ts +0 -1
  35. package/dist/build/stacks.js +0 -2
  36. package/dist/build/views.d.ts +0 -1
  37. package/dist/build/views.js +0 -2
  38. package/dist/build.d.ts +0 -9
  39. package/dist/build.js +0 -2
  40. package/dist/bump.d.ts +0 -1
  41. package/dist/bump.js +0 -8
  42. package/dist/cdn/invalidate-cache.d.ts +0 -1
  43. package/dist/cdn/invalidate-cache.js +0 -1
  44. package/dist/changelog.d.ts +0 -9
  45. package/dist/changelog.js +0 -3
  46. package/dist/check/ports.d.ts +0 -1
  47. package/dist/check/ports.js +0 -2
  48. package/dist/chunk-0c8sd1t6.js +0 -2
  49. package/dist/chunk-0g2nzhx9.js +0 -240
  50. package/dist/chunk-0gadhvn7.js +0 -3
  51. package/dist/chunk-0h27aa4r.js +0 -93
  52. package/dist/chunk-3peh8kqs.js +0 -851
  53. package/dist/chunk-62gdfav8.js +0 -3
  54. package/dist/chunk-6bk53y02.js +0 -3
  55. package/dist/chunk-78c5n3s2.js +0 -3
  56. package/dist/chunk-c74qv38e.js +0 -17
  57. package/dist/chunk-cdk2r2jd.js +0 -1
  58. package/dist/chunk-dbz9dp2h.js +0 -3
  59. package/dist/chunk-e142dheq.js +0 -3
  60. package/dist/chunk-ec4gky40.js +0 -3
  61. package/dist/chunk-h3d81wrg.js +0 -3
  62. package/dist/chunk-m3q0x4h0.js +0 -688
  63. package/dist/chunk-mqgbyhph.js +0 -5
  64. package/dist/chunk-n24m8prb.js +0 -3
  65. package/dist/chunk-n5eqwhck.js +0 -7
  66. package/dist/chunk-nsvnqv8y.js +0 -5
  67. package/dist/chunk-nty6mmx4.js +0 -283
  68. package/dist/chunk-s735m9mg.js +0 -1
  69. package/dist/chunk-tpb8jgsk.js +0 -7
  70. package/dist/chunk-tsbk5vne.js +0 -3
  71. package/dist/chunk-xg9xscqz.js +0 -1
  72. package/dist/chunk-y6e448he.js +0 -7
  73. package/dist/clean.d.ts +0 -1
  74. package/dist/clean.js +0 -2
  75. package/dist/commit.d.ts +0 -3
  76. package/dist/commit.js +0 -2
  77. package/dist/copy-types.d.ts +0 -1
  78. package/dist/copy-types.js +0 -3
  79. package/dist/database/seed.d.ts +0 -1
  80. package/dist/database/seed.js +0 -2
  81. package/dist/deploy/create-receipt-rule.d.ts +0 -1
  82. package/dist/deploy/create-receipt-rule.js +0 -2
  83. package/dist/deploy/index.d.ts +0 -1
  84. package/dist/deploy/index.js +0 -300
  85. package/dist/dev/api.d.ts +0 -1
  86. package/dist/dev/api.js +0 -6
  87. package/dist/dev/components.d.ts +0 -1
  88. package/dist/dev/components.js +0 -2
  89. package/dist/dev/dashboard-globals.d.ts +0 -4
  90. package/dist/dev/dashboard-globals.js +0 -3
  91. package/dist/dev/dashboard-utils.d.ts +0 -150
  92. package/dist/dev/dashboard-utils.js +0 -2
  93. package/dist/dev/dashboard.d.ts +0 -22
  94. package/dist/dev/dashboard.js +0 -8
  95. package/dist/dev/desktop.d.ts +0 -1
  96. package/dist/dev/desktop.js +0 -2
  97. package/dist/dev/docs.d.ts +0 -1
  98. package/dist/dev/docs.js +0 -2
  99. package/dist/dev/index.d.ts +0 -10
  100. package/dist/dev/index.js +0 -2
  101. package/dist/dev/migrate-watcher.d.ts +0 -1
  102. package/dist/dev/migrate-watcher.js +0 -2
  103. package/dist/dev/system-tray.d.ts +0 -1
  104. package/dist/dev/system-tray.js +0 -2
  105. package/dist/dev/views.d.ts +0 -1
  106. package/dist/dev/views.js +0 -2
  107. package/dist/discover-packages.d.ts +0 -18
  108. package/dist/discover-packages.js +0 -2
  109. package/dist/domains/add.d.ts +0 -1
  110. package/dist/domains/add.js +0 -2
  111. package/dist/domains/purchase.d.ts +0 -1
  112. package/dist/domains/purchase.js +0 -2
  113. package/dist/domains/remove.d.ts +0 -1
  114. package/dist/domains/remove.js +0 -2
  115. package/dist/examples.d.ts +0 -5
  116. package/dist/examples.js +0 -2
  117. package/dist/find-projects.d.ts +0 -1
  118. package/dist/find-projects.js +0 -2
  119. package/dist/fresh.d.ts +0 -1
  120. package/dist/fresh.js +0 -2
  121. package/dist/generate/action-types.d.ts +0 -1
  122. package/dist/generate/action-types.js +0 -8
  123. package/dist/generate/component-meta.d.ts +0 -1
  124. package/dist/generate/component-meta.js +0 -3
  125. package/dist/generate/custom-cli-file.d.ts +0 -1
  126. package/dist/generate/custom-cli-file.js +0 -4
  127. package/dist/generate/env-files.d.ts +0 -1
  128. package/dist/generate/env-files.js +0 -26
  129. package/dist/generate/ide-helpers.d.ts +0 -1
  130. package/dist/generate/ide-helpers.js +0 -3
  131. package/dist/generate/index.d.ts +0 -36
  132. package/dist/generate/index.js +0 -2
  133. package/dist/generate/lib-entries.d.ts +0 -1
  134. package/dist/generate/lib-entries.js +0 -3
  135. package/dist/generate/pantry-file.d.ts +0 -1
  136. package/dist/generate/pantry-file.js +0 -2
  137. package/dist/generate/symlink-core.d.ts +0 -1
  138. package/dist/generate/symlink-core.js +0 -2
  139. package/dist/generate/types.d.ts +0 -1
  140. package/dist/generate/types.js +0 -2
  141. package/dist/generate/vscode-custom-data.d.ts +0 -1
  142. package/dist/generate/vscode-custom-data.js +0 -3
  143. package/dist/generate/web-types.d.ts +0 -1
  144. package/dist/generate/web-types.js +0 -1
  145. package/dist/helpers/component-meta.d.ts +0 -26
  146. package/dist/helpers/component-meta.js +0 -2
  147. package/dist/helpers/index.d.ts +0 -4
  148. package/dist/helpers/index.js +0 -2
  149. package/dist/helpers/lib-entries.d.ts +0 -12
  150. package/dist/helpers/lib-entries.js +0 -2
  151. package/dist/helpers/package-json.d.ts +0 -2
  152. package/dist/helpers/package-json.js +0 -43
  153. package/dist/helpers/utils.d.ts +0 -23
  154. package/dist/helpers/utils.js +0 -2
  155. package/dist/helpers/vscode-custom-data.d.ts +0 -3
  156. package/dist/helpers/vscode-custom-data.js +0 -2
  157. package/dist/index.d.ts +0 -49
  158. package/dist/index.js +0 -2
  159. package/dist/key-generate.d.ts +0 -1
  160. package/dist/key-generate.js +0 -2
  161. package/dist/lint/fix.d.ts +0 -1
  162. package/dist/lint/fix.js +0 -3
  163. package/dist/lint/index.d.ts +0 -1
  164. package/dist/lint/index.js +0 -3
  165. package/dist/lint/lint.d.ts +0 -14
  166. package/dist/lint/lint.js +0 -2
  167. package/dist/make-command.d.ts +0 -10
  168. package/dist/make-command.js +0 -45
  169. package/dist/make-job.d.ts +0 -5
  170. package/dist/make-job.js +0 -129
  171. package/dist/make-policy.d.ts +0 -10
  172. package/dist/make-policy.js +0 -94
  173. package/dist/make-resource.d.ts +0 -10
  174. package/dist/make-resource.js +0 -113
  175. package/dist/make.d.ts +0 -52
  176. package/dist/make.js +0 -2
  177. package/dist/migrate/database.d.ts +0 -1
  178. package/dist/migrate/database.js +0 -2
  179. package/dist/migrate/fresh.d.ts +0 -1
  180. package/dist/migrate/fresh.js +0 -2
  181. package/dist/orm/base.d.ts +0 -1
  182. package/dist/orm/base.js +0 -2
  183. package/dist/orm/test.d.ts +0 -1
  184. package/dist/orm/test.js +0 -1
  185. package/dist/prepublish.d.ts +0 -1
  186. package/dist/prepublish.js +0 -2
  187. package/dist/queue/clear.d.ts +0 -1
  188. package/dist/queue/clear.js +0 -2
  189. package/dist/queue/dlq-purge.d.ts +0 -1
  190. package/dist/queue/dlq-purge.js +0 -2
  191. package/dist/queue/dlq-retry.d.ts +0 -1
  192. package/dist/queue/dlq-retry.js +0 -2
  193. package/dist/queue/dlq.d.ts +0 -1
  194. package/dist/queue/dlq.js +0 -5
  195. package/dist/queue/failed.d.ts +0 -1
  196. package/dist/queue/failed.js +0 -5
  197. package/dist/queue/flush.d.ts +0 -1
  198. package/dist/queue/flush.js +0 -3
  199. package/dist/queue/inspect.d.ts +0 -1
  200. package/dist/queue/inspect.js +0 -8
  201. package/dist/queue/list.d.ts +0 -1
  202. package/dist/queue/list.js +0 -5
  203. package/dist/queue/monitor.d.ts +0 -1
  204. package/dist/queue/monitor.js +0 -7
  205. package/dist/queue/pause.d.ts +0 -1
  206. package/dist/queue/pause.js +0 -2
  207. package/dist/queue/quarantine.d.ts +0 -1
  208. package/dist/queue/quarantine.js +0 -3
  209. package/dist/queue/resume.d.ts +0 -1
  210. package/dist/queue/resume.js +0 -2
  211. package/dist/queue/retry.d.ts +0 -1
  212. package/dist/queue/retry.js +0 -2
  213. package/dist/queue/schedule-list.d.ts +0 -1
  214. package/dist/queue/schedule-list.js +0 -5
  215. package/dist/queue/schedule.d.ts +0 -1
  216. package/dist/queue/schedule.js +0 -2
  217. package/dist/queue/status.d.ts +0 -1
  218. package/dist/queue/status.js +0 -5
  219. package/dist/queue/table.d.ts +0 -1
  220. package/dist/queue/table.js +0 -2
  221. package/dist/queue/unquarantine.d.ts +0 -1
  222. package/dist/queue/unquarantine.js +0 -2
  223. package/dist/queue/work.d.ts +0 -1
  224. package/dist/queue/work.js +0 -2
  225. package/dist/release.d.ts +0 -1
  226. package/dist/release.js +0 -3
  227. package/dist/route/list.d.ts +0 -1
  228. package/dist/route/list.js +0 -3
  229. package/dist/run-action.d.ts +0 -2
  230. package/dist/run-action.js +0 -2
  231. package/dist/saas/setup.d.ts +0 -1
  232. package/dist/saas/setup.js +0 -2
  233. package/dist/scaffold-crud.d.ts +0 -25
  234. package/dist/scaffold-crud.js +0 -87
  235. package/dist/schedule/run.d.ts +0 -1
  236. package/dist/schedule/run.js +0 -2
  237. package/dist/search/flush.d.ts +0 -1
  238. package/dist/search/flush.js +0 -2
  239. package/dist/search/import.d.ts +0 -1
  240. package/dist/search/import.js +0 -2
  241. package/dist/search/settings-list.d.ts +0 -1
  242. package/dist/search/settings-list.js +0 -2
  243. package/dist/search/settings.d.ts +0 -1
  244. package/dist/search/settings.js +0 -2
  245. package/dist/serve/api.d.ts +0 -1
  246. package/dist/serve/api.js +0 -2
  247. package/dist/setup/index.d.ts +0 -1
  248. package/dist/setup/index.js +0 -2
  249. package/dist/setup/ssl.d.ts +0 -38
  250. package/dist/setup/ssl.js +0 -2
  251. package/dist/stacks.d.ts +0 -4
  252. package/dist/stacks.js +0 -2
  253. package/dist/templates.d.ts +0 -28
  254. package/dist/templates.js +0 -2
  255. package/dist/test/feature.d.ts +0 -1
  256. package/dist/test/feature.js +0 -2
  257. package/dist/test/index.d.ts +0 -1
  258. package/dist/test/index.js +0 -2
  259. package/dist/test/ui.d.ts +0 -1
  260. package/dist/test/ui.js +0 -2
  261. package/dist/test/unit.d.ts +0 -1
  262. package/dist/test/unit.js +0 -2
  263. package/dist/typecheck.d.ts +0 -1
  264. package/dist/typecheck.js +0 -2
  265. package/dist/types.d.ts +0 -3
  266. package/dist/types.js +0 -2
  267. package/dist/upgrade/binary.d.ts +0 -1
  268. package/dist/upgrade/binary.js +0 -2
  269. package/dist/upgrade/bun.d.ts +0 -1
  270. package/dist/upgrade/bun.js +0 -1
  271. package/dist/upgrade/dependencies.d.ts +0 -1
  272. package/dist/upgrade/dependencies.js +0 -2
  273. package/dist/upgrade/framework-utils.d.ts +0 -150
  274. package/dist/upgrade/framework-utils.js +0 -2
  275. package/dist/upgrade/framework.d.ts +0 -1
  276. package/dist/upgrade/framework.js +0 -7
  277. package/dist/upgrade/index.d.ts +0 -1
  278. package/dist/upgrade/index.js +0 -2
  279. package/dist/upgrade/packages.d.ts +0 -14
  280. package/dist/upgrade/packages.js +0 -12
  281. package/dist/upgrade/shell.d.ts +0 -1
  282. package/dist/upgrade/shell.js +0 -5
  283. package/dist/upgrade.d.ts +0 -7
  284. package/dist/upgrade.js +0 -2
@@ -1,150 +0,0 @@
1
- /**
2
- * Resolve the target channel and git ref from CLI options and persisted channel.
3
- * Priority: --version > --canary > --stable > persisted channel
4
- *
5
- * Branch model: `main` is the bleeding-edge "dump everything" branch; `stable`
6
- * is the vetted branch that PRs are merged into from `main` once main is proven.
7
- * So the `stable` channel tracks the `stable` branch (vetted) and the `canary`
8
- * channel tracks the `main` branch (bleeding edge). A pinned `--version` still
9
- * resolves to the matching `vX` tag.
10
- */
11
- export declare function resolveUpgradeContext(options: {
12
- version?: string
13
- canary?: boolean
14
- stable?: boolean
15
- }, currentChannel: 'stable' | 'canary'): UpgradeContext;
16
- /**
17
- * Build the gitit template string for a path under the stacks repo.
18
- * `subPath` is relative to the repo root (e.g. `storage/framework/core`).
19
- */
20
- export declare function buildTemplateString(ref: string, subPath?: string): string;
21
- /**
22
- * Read a version from a package.json file. Returns null on any error.
23
- */
24
- export declare function readVersion(pkgPath: string): string | null;
25
- /**
26
- * Read the persisted channel from the channel file.
27
- */
28
- export declare function readChannel(channelFilePath: string): 'stable' | 'canary';
29
- /**
30
- * Persist the channel to the channel file.
31
- */
32
- export declare function writeChannel(channelFilePath: string, ch: 'stable' | 'canary'): void;
33
- /**
34
- * Read the last-synced `{ channel, sha }` from `.stacks-version`.
35
- *
36
- * Returns null on absence or any malformed content — callers treat null as
37
- * "no prior sync", which always falls through to a sync (first-run safe). The
38
- * stored format is a single line: `"<channel> <40-hex-sha>"`. A bare sha
39
- * (legacy) or unknown channel parses to null so it never wrongly short-circuits.
40
- */
41
- export declare function readSyncedVersion(versionFilePath: string): SyncedVersion | null;
42
- /**
43
- * Persist the last-synced channel + sha to `.stacks-version`.
44
- */
45
- export declare function writeSyncedVersion(versionFilePath: string, ch: 'stable' | 'canary', sha: string): void;
46
- /**
47
- * Pure decision for the "already up to date" short-circuit. Returns true only
48
- * when a sync can be safely skipped: no override flags, not a pinned version,
49
- * a resolved remote sha, a prior sync on the SAME channel, and the synced sha
50
- * equals the remote sha. Any of:
51
- * - `force` (explicit re-sync)
52
- * - `targetVersion` (pinned tag — always install)
53
- * - `remoteSha === null` (network/git failure → fail open to sync)
54
- * - `synced === null` (first run → always sync)
55
- * - channel mismatch (channel switch never short-circuits)
56
- * - sha mismatch (a newer commit is available)
57
- * yields false (proceed with the sync).
58
- */
59
- export declare function shouldShortCircuit(args: {
60
- force: boolean
61
- targetVersion?: string
62
- remoteSha: string | null
63
- synced: SyncedVersion | null
64
- channel: 'stable' | 'canary'
65
- }): boolean;
66
- /**
67
- * Determine the user-facing log message for the upgrade action.
68
- */
69
- export declare function resolveUpgradeMessage(ctx: UpgradeContext, currentChannel: 'stable' | 'canary', isStableFlag: boolean): string;
70
- /**
71
- * Determine the user-facing success message after an upgrade.
72
- */
73
- export declare function resolveSuccessMessage(ctx: UpgradeContext, currentVersion: string | null, newVersion: string | null, currentChannel: 'stable' | 'canary', force: boolean): string;
74
- /**
75
- * Auto-detect a local stacks checkout the user might be developing against.
76
- *
77
- * Order:
78
- * 1. `STACKS_LOCAL_PATH` env var (explicit)
79
- * 2. Sibling directory: `<project>/../stacks`
80
- * 3. `~/Code/stacks` and a few common dev paths
81
- *
82
- * Returns null if nothing looks like a stacks checkout. We confirm by checking
83
- * for `storage/framework/core/buddy/package.json` — the canonical marker.
84
- */
85
- export declare function detectLocalStacks(projectRoot: string): string | null;
86
- /**
87
- * Walk a directory recursively and return a Map of relative-path → entry,
88
- * with each entry's size + content hash captured at the time of the call.
89
- * Hashing the entire tree at snapshot time (rather than at diff time) means
90
- * the "before" snapshot stays valid even after `cpSync` overwrites the
91
- * files in place.
92
- *
93
- * Async because we read each file via `Bun.file().arrayBuffer()`. On a
94
- * 3000-file framework tree this completes in ~50ms — `Bun.hash` is xxh3,
95
- * not a crypto hash, and the I/O is fully parallelized.
96
- */
97
- export declare function snapshotTree(root: string, skip?: string[]): Promise<Map<string, SnapshotEntry>>;
98
- /**
99
- * Diff two snapshots produced by `snapshotTree`. Pure comparison — both
100
- * inputs already carry their content hash, so this is just bookkeeping.
101
- */
102
- export declare function diffSnapshots(before: Map<string, SnapshotEntry>, after: Map<string, SnapshotEntry>): ChangeSummary;
103
- export declare const MANAGED_PATHS: ManagedPath[];
104
- export declare interface UpgradeContext {
105
- channel: 'stable' | 'canary'
106
- ref: string
107
- targetVersion?: string
108
- }
109
- /**
110
- * The last-synced channel + commit sha, persisted to `.stacks-version` so
111
- * `buddy update` can short-circuit when the project is already on the latest
112
- * commit of its channel.
113
- */
114
- export declare interface SyncedVersion {
115
- channel: 'stable' | 'canary'
116
- sha: string
117
- }
118
- /**
119
- * Framework-managed paths, relative to the project root, that `buddy update`
120
- * keeps in sync with the upstream stacks repo. Each entry can be a directory
121
- * (synced recursively) or a single file. The `subPath` is the path inside the
122
- * upstream stacks checkout — almost always the same as `localPath`, except
123
- * for root scripts that live at the project root in apps but at the repo root
124
- * in the stacks monorepo.
125
- */
126
- export declare interface ManagedPath {
127
- localPath: string
128
- subPath: string
129
- isFile?: boolean
130
- skip?: string[]
131
- label: string
132
- }
133
- /**
134
- * Snapshot entry. We capture size + content hash at snapshot time so the
135
- * before/after diff can detect "actually changed" vs "just re-copied with
136
- * fresh mtimes". `cpSync` and `downloadTemplate` always touch mtimes,
137
- * even when the destination bytes are identical to the source — using
138
- * mtime as the change signal turns every no-op upgrade into a "1600
139
- * changed" report.
140
- */
141
- export declare interface SnapshotEntry {
142
- size: number
143
- hash: bigint
144
- }
145
- export declare interface ChangeSummary {
146
- added: number
147
- changed: number
148
- removed: number
149
- unchanged: number
150
- }
@@ -1,2 +0,0 @@
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-h3d81wrg.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 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
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{Lb as j}from"../chunk-h3d81wrg.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
- \u26A0 The following framework-managed paths have uncommitted changes:`);for(let z of q)console.warn(` - ${z}`);console.warn(`
4
- Aborting to avoid clobbering your edits.`),console.warn(` Re-run with --force to overwrite, or commit / stash the changes first.
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.
6
- `);let q=I.argv.slice(2).filter((Q)=>Q!=="--__restarted"),K=await Bun.spawn({cmd:[I.argv[0]||"bun",b,...q,"--__restarted"],cwd:O,stdout:"inherit",stderr:"inherit"}).exited;I.exit(K??0)}if(!$.targetVersion){if(u(c,$.channel),!G)G=await t($,E,_);if(G)h(s,$.channel,G)}console.log(`\u2714 ${d($,Qq,Xq,A,!!Y.force)}`);console.log("Sync summary:");for(let{managed:q,summary:z}of v)if(q.isFile){let K=z.added+z.changed>0;console.log(` ${q.label.padEnd(10)} ${K?"updated":"unchanged"}`)}else if(z.added+z.changed+z.removed===0)console.log(` ${q.label.padEnd(10)} unchanged (${z.unchanged} files)`);else console.log(` ${q.label.padEnd(10)} +${z.added} ~${z.changed} -${z.removed} (${z.unchanged} unchanged)`);var $q=!Y.noPostinstall&&Y.postinstall!==!1;if($q)await Zq({aggregate:V,perPath:v,projectRoot:O});if($.channel==="canary"&&!$.targetVersion)console.warn("\u26A0 Canary builds may contain bugs or breaking changes. Not recommended for production.");I.exit(C.Success);async function Jq(q){let z=U(q,".git");if(!B(z))return[];try{let K=Bun.spawn({cmd:["git","-C",q,"status","--porcelain","--",...D.map((W)=>W.localPath)],stdout:"pipe",stderr:"pipe"}),Q=await new Response(K.stdout).text();return await K.exited,Q.split(`
7
- `).filter((W)=>W.length>0).map((W)=>W.slice(3))}catch{return[]}}async function t(q,z,K){let Q=/^[0-9a-f]{40}$/i;try{if(z&&K){let J=Bun.spawn({cmd:["git","-C",K,"rev-parse",q.ref],stdout:"pipe",stderr:"pipe"}),Z=(await new Response(J.stdout).text()).trim();if(await J.exited===0&&Q.test(Z))return Z.toLowerCase();let F=Bun.spawn({cmd:["git","-C",K,"rev-parse","HEAD"],stdout:"pipe",stderr:"pipe"}),L=(await new Response(F.stdout).text()).trim();return await F.exited===0&&Q.test(L)?L.toLowerCase():null}let W=Bun.spawn({cmd:["git","ls-remote","https://github.com/stacksjs/stacks.git",`refs/heads/${q.ref}`],stdout:"pipe",stderr:"pipe"}),M=await new Response(W.stdout).text();if(await W.exited!==0)return null;let X=M.match(/^([0-9a-f]{40})\s/i);return X?.[1]?X[1].toLowerCase():null}catch{return null}}async function o(q){try{if(!B(q))return 0n;let z=await Bun.file(q).arrayBuffer();return Bun.hash(z)}catch{return 0n}}async function T(q){let z=new Map;if(!B(q))return z;try{let K=Bun.file(q);if(K.size>0){let Q=await K.arrayBuffer();z.set("self",{size:K.size,hash:Bun.hash(Q)})}}catch{}return z}async function Bq(q,z,K){let Q=U(q,z.subPath);if(!B(Q)){console.warn(` skip ${z.label}: source missing at ${Q}`);return}if(z.isFile){f(zq(K),{recursive:!0}),i(Q,K);return}f(K,{recursive:!0}),a(Q,K,{recursive:!0,force:!0,filter:(W)=>{if(!z.skip)return!0;let M=W.split("/").pop()||"";return!z.skip.includes(M)}})}async function Iq(q,z,K,Q){let W=x(q,z.subPath);await n(W,{dir:K,force:!0,forceClean:!1,preferOffline:!Q})}async function Uq(q){let z=N.projectPath(".tmp-upgrade");try{await n(`github:stacksjs/stacks#${q}`,{dir:z,force:!0,forceClean:!0,preferOffline:!0,silent:!0});for(let K of D){if(!K.isFile)continue;let Q=U(z,K.subPath),W=N.projectPath(K.localPath);try{if(B(Q)&&B(W))i(Q,W)}catch{}}}catch{}finally{if(B(z))qq(z,{recursive:!0,force:!0})}}async function Zq(q){let{aggregate:z,perPath:K,projectRoot:Q}=q;if(z.added+z.changed+z.removed===0){console.log("Nothing changed \u2014 skipping post-sync hooks.");return}console.log("Regenerating auto-import manifest...");try{let{generateAutoImportFiles:X}=await import("@stacksjs/server");await X()}catch(X){console.warn(` auto-imports failed (non-fatal): ${X?.message||X}`)}if(K.some((X)=>{let{managed:J,summary:Z}=X;if(J.isFile)return!1;if(J.label!=="core"&&J.label!=="defaults")return!1;if(Z.added+Z.changed===0)return!1;return Nq(U(Q,J.localPath))})){console.log("Running `bun install` to refresh dependencies...");try{let J=await Bun.spawn({cmd:[I.argv[0]||"bun","install"],cwd:Q,stdout:"inherit",stderr:"inherit"}).exited;if(J!==0)console.warn(` bun install exited with code ${J} (non-fatal)`)}catch(X){console.warn(` bun install failed (non-fatal): ${X?.message||X}`)}}let M=U(Q,"database","migrations");if(B(M)){console.log("Running pending migrations...");try{let X=N.frameworkPath("core/buddy/src/cli.ts"),Z=await Bun.spawn({cmd:[I.argv[0]||"bun",X,"migrate"],cwd:Q,stdout:"inherit",stderr:"inherit"}).exited;if(Z!==0)console.warn(` migrate exited with code ${Z} (non-fatal \u2014 DB may not be set up yet)`)}catch(X){console.warn(` migrate failed (non-fatal): ${X?.message||X}`)}}}function Nq(q){try{if(!B(q))return!1;return e(U(q,"package.json"),"utf-8").length>0}catch{return B(q)}}
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"../chunk-s735m9mg.js";import{Ib as r}from"../chunk-0gadhvn7.js";import"../chunk-h3d81wrg.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,14 +0,0 @@
1
- /**
2
- * Upgrade a node_modules app to a published framework version. Called by the
3
- * framework upgrade script when no vendored `storage/framework/core` exists.
4
- * Handles resolution, package.json rewrite, and reinstall; then `process.exit`s.
5
- */
6
- export declare function upgradeStacksPackages(projectRoot: string, options: PackageUpgradeOptions): Promise<never>;
7
- export declare interface PackageUpgradeOptions {
8
- version?: string
9
- canary?: boolean
10
- stable?: boolean
11
- force?: boolean
12
- dryRun?: boolean
13
- noPostinstall?: boolean
14
- }
@@ -1,12 +0,0 @@
1
- // @bun
2
- import"../chunk-h3d81wrg.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
- Upgrading the Stacks framework${z.canary?" (canary)":""} \u2192 ${E}`),q)console.log(` current \`stacks\` constraint: ${q}
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
- `)?`
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
- \u2714 Upgraded to stacks@${E}. Review the changelog: https://github.com/stacksjs/stacks/releases/tag/v${E}
12
- `),M.exit(0)}export{T as upgradeStacksPackages};
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- // @bun
2
- var{$:K}=globalThis.Bun;import N from"process";import{italic as U,runCommand as I}from"@stacksjs/cli";import{log as q}from"@stacksjs/logging";import{path as A}from"@stacksjs/path";import{writeFile as V}from"@stacksjs/storage";import{ExitCode as W}from"@stacksjs/types";var O=(await K`echo $HOME`.text()).trim(),H=A.join(O,".zshrc"),J=A.shellPath("src/buddy.plugin.zsh"),D=A.join(O,".oh-my-zsh/custom/plugins/buddy/");q.info(`Setting up Oh My Zsh via ${H}...`);K.cwd(A.dirname(H));var G=await K`cat ${A.basename(H)}`.text(),Q=/^(?!#).*plugins=\(([^)]+)\)/m,M=G.match(Q);if(M){let B=M[1]?.split(/\s+/).filter(Boolean);if(!B)q.error("Maybe the plugins line in your .zshrc file could not be found? If this continues being an issue, please reach out to us on Discord."),N.exit(W.FatalError);if(!B.includes("buddy")){B.push("buddy");let S=`plugins=(
3
- ${B.map((T)=>T.trim()).join(`
4
- `)}
5
- )`;G=G.replace(Q,S),await V(H,G),q.info(`Copying buddy zsh plugin ${J} to ${D}...`),await I(`mkdir -p ${D}`),await I(`cp -rf ${J} ${D}`),q.success("Copied buddy zsh plugin")}else q.info("Buddy is already set up"),q.info("Ensuring `buddy` is updated..."),await I(`cp -rf ${J} ${D}`),q.success("Updated buddy zsh plugin to latest version")}q.success("Oh My Zsh Setup Complete");q.info(U("To see changes reflect, you may need to open a new terminal window"));if(N.env.TERM_PROGRAM==="vscode")q.info("\u2318\u21E7P terminal.create.new.terminal");
package/dist/upgrade.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { UpgradeOptions } from '@stacksjs/types';
2
- // import { determineDebugLevel } from '@stacksjs/utils'
3
- // export async function checkForUncommittedChanges(path = './stacks', options: UpgradeOptions) {
4
- export declare function checkForUncommittedChanges(options: UpgradeOptions): void;
5
- export declare function downloadFrameworkUpdate(options: UpgradeOptions): Promise<void>;
6
- // export async function updateDependencies(options: UpgradeOptions) {
7
- export declare function updateDependencies(): Promise<void>;
package/dist/upgrade.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-h3d81wrg.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};