stacks 0.58.41 → 0.58.44

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 (129) hide show
  1. package/core/actions/dist/src/build/core.js +10 -14
  2. package/core/actions/dist/src/lint/index.js +11 -15
  3. package/core/actions/dist/src/upgrade/index.js +62 -0
  4. package/core/actions/dist/src/upgrade.js +10 -5
  5. package/core/actions/package.json +1 -1
  6. package/core/actions/src/build/cli.ts +7 -0
  7. package/core/actions/src/build/core.ts +16 -48
  8. package/core/actions/src/dev/api.ts +1 -1
  9. package/core/actions/src/lint/index.ts +20 -12
  10. package/core/actions/src/upgrade/index.ts +16 -20
  11. package/core/actions/src/upgrade.ts +5 -5
  12. package/core/ai/dist/index.js +10372 -0
  13. package/core/ai/package.json +3 -3
  14. package/core/alias/package.json +1 -1
  15. package/core/analytics/package.json +1 -1
  16. package/core/api/dist/index.js +636 -0
  17. package/core/api/package.json +1 -1
  18. package/core/arrays/package.json +1 -1
  19. package/core/auth/package.json +1 -1
  20. package/core/buddy/{src/compile.ts → compile.ts} +1 -2
  21. package/core/buddy/dist/{chunk-c58676a39cd23812.js → chunk-b32089b9556f373c.js} +48 -14
  22. package/core/buddy/dist/cli.js +6 -2
  23. package/core/buddy/dist/index.js +1 -1
  24. package/core/buddy/package.json +1 -1
  25. package/core/buddy/src/cli.ts +2 -3
  26. package/core/buddy/src/commands/build.ts +55 -10
  27. package/core/buddy/src/commands/lint.ts +2 -1
  28. package/core/buddy/src/commands/upgrade.ts +2 -2
  29. package/core/build/package.json +1 -1
  30. package/core/bun-create/bud/package.json +1 -1
  31. package/core/bun-create/buddy/package.json +1 -1
  32. package/core/bun-create/stack/package.json +1 -1
  33. package/core/bun-create/stacks/package.json +1 -1
  34. package/core/bun-create/stx/package.json +1 -1
  35. package/core/bun-plugin-yaml/package.json +1 -1
  36. package/core/cache/package.json +2 -2
  37. package/core/chat/package.json +1 -1
  38. package/core/cli/dist/index.js +1 -1
  39. package/core/cli/package.json +1 -1
  40. package/core/cloud/build.ts +4 -0
  41. package/core/cloud/dist/index.js +2718 -0
  42. package/core/cloud/package.json +29 -29
  43. package/core/cloud/src/cloud/ai.ts +4 -34
  44. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +6 -6
  45. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
  46. package/core/cloud/src/cloud/cdn.ts +23 -23
  47. package/core/cloud/src/cloud/compute.ts +1 -0
  48. package/core/cloud/src/cloud/index.ts +1 -0
  49. package/core/collections/package.json +1 -1
  50. package/core/config/dist/index.js +2 -13
  51. package/core/config/package.json +1 -1
  52. package/core/database/package.json +2 -2
  53. package/core/datetime/package.json +1 -1
  54. package/core/desktop/package.json +3 -5
  55. package/core/development/package.json +1 -1
  56. package/core/dns/package.json +4 -4
  57. package/core/docs/package.json +1 -1
  58. package/core/email/package.json +1 -1
  59. package/core/enums/dist/index.js +3 -3
  60. package/core/enums/package.json +1 -1
  61. package/core/enums/src/index.ts +3 -3
  62. package/core/env/package.json +1 -1
  63. package/core/error-handling/package.json +1 -1
  64. package/core/eslint-config/package.json +4 -4
  65. package/core/events/package.json +1 -1
  66. package/core/faker/package.json +1 -1
  67. package/core/git/package.json +1 -1
  68. package/core/health/package.json +1 -1
  69. package/core/http/package.json +1 -1
  70. package/core/lint/package.json +1 -1
  71. package/core/logging/package.json +1 -1
  72. package/core/notifications/package.json +1 -1
  73. package/core/objects/package.json +1 -1
  74. package/core/orm/package.json +1 -1
  75. package/core/path/dist/index.js +14 -2
  76. package/core/path/package.json +1 -1
  77. package/core/path/src/index.ts +18 -2
  78. package/core/payments/package.json +1 -1
  79. package/core/push/dist/index.js +35 -0
  80. package/core/push/package.json +1 -1
  81. package/core/query-builder/package.json +1 -1
  82. package/core/queue/package.json +1 -1
  83. package/core/raycast/package.json +6 -2
  84. package/core/realtime/package.json +1 -1
  85. package/core/repl/package.json +1 -1
  86. package/core/router/dist/index.js +1 -2
  87. package/core/router/package.json +1 -1
  88. package/core/router/src/middleware.ts +1 -3
  89. package/core/scheduler/package.json +1 -1
  90. package/core/search-engine/package.json +1 -1
  91. package/core/security/package.json +1 -1
  92. package/core/server/package.json +1 -1
  93. package/core/signals/package.json +1 -1
  94. package/core/slug/package.json +1 -1
  95. package/core/sms/dist/index.js +240 -0
  96. package/core/sms/package.json +1 -1
  97. package/core/storage/dist/index.js +3 -1
  98. package/core/storage/package.json +1 -1
  99. package/core/storage/src/zip.ts +3 -6
  100. package/core/strings/package.json +1 -1
  101. package/core/tables/package.json +2 -2
  102. package/core/testing/package.json +1 -1
  103. package/core/tinker/package.json +1 -1
  104. package/core/tunnel/package.json +1 -1
  105. package/core/types/package.json +2 -2
  106. package/core/types/src/cli.ts +2 -2
  107. package/core/ui/dist/index.js +4 -2
  108. package/core/ui/package.json +2 -2
  109. package/core/ui/src/uno.config.ts +2 -1
  110. package/core/utils/dist/index.js +1 -1
  111. package/core/utils/package.json +1 -1
  112. package/core/validation/package.json +3 -3
  113. package/core/vite/dist/index.js +2 -10
  114. package/core/vite/package.json +3 -3
  115. package/core/vite/src/api.ts +9 -11
  116. package/core/vite/src/example-vue.ts +1 -8
  117. package/core/whois/package.json +1 -1
  118. package/core/x-ray/package.json +2 -3
  119. package/core/x-ray/src/desktop/main.ts +0 -6
  120. package/core/zsh-buddy/package.json +8 -2
  121. package/ide/dictionary.txt +6 -0
  122. package/ide/vscode/package.json +1 -1
  123. package/package.json +2 -2
  124. package/core/music/package.json +0 -46
  125. package/core/music/src/components/SampleComponent.stx +0 -5
  126. package/core/music/src/layouts/default.stx +0 -3
  127. package/core/music/src/pages/index.stx +0 -10
  128. package/core/music/src/pages/music.stx +0 -10
  129. package/core/music/src/styles/main.css +0 -1
@@ -2,24 +2,20 @@
2
2
  // src/build/core.ts
3
3
  import process from "process";
4
4
  import {glob} from "@stacksjs/storage";
5
+ import {dim, italic, log} from "@stacksjs/cli";
5
6
  import {corePath} from "@stacksjs/path";
6
7
  import {ExitCode} from "@stacksjs/types";
7
- import {dim, italic, log, runCommand} from "@stacksjs/cli";
8
+ var {$ } = globalThis.Bun;
8
9
  log.info("Building core packages");
9
- var dirs = await glob([corePath("*")], { onlyDirectories: true });
10
+ var dirs = (await glob([corePath("*")], { onlyDirectories: true })).sort();
10
11
  if (dirs.length === 0) {
11
12
  log.info("No core packages found");
12
13
  process.exit(ExitCode.FatalError);
13
14
  }
14
- dirs.forEach(async (folder) => {
15
- log.info("\uD83C\uDFD7\uFE0F Building...");
16
- log.info(`\uD83D\uDCE6 ${italic(dim(folder))}`);
17
- const result = await runCommand("bun --bun run build", {
18
- cwd: folder
19
- });
20
- if (result.isErr()) {
21
- log.error(`Failed to build ${italic(folder)}`);
22
- process.exit(ExitCode.FatalError);
23
- }
24
- log.success("\u2705 Build complete");
25
- });
15
+ for (const folder of dirs) {
16
+ log.info(`\uD83C\uDFD7\uFE0F Building ${italic(dim(folder))}`);
17
+ $.cwd(folder);
18
+ await $`bun run build`;
19
+ log.success(`${italic(dim(folder))} built`);
20
+ console.log(``);
21
+ }
@@ -1,21 +1,17 @@
1
1
  // @bun
2
2
  // src/lint/index.ts
3
3
  import process from "process";
4
- import {runCommands} from "@stacksjs/cli";
5
- import {projectPath} from "@stacksjs/path";
6
4
  import {ExitCode} from "@stacksjs/types";
7
5
  import {NpmScript} from "@stacksjs/enums";
8
- async function lintAction() {
9
- const result = await runCommands([
10
- NpmScript.Lint,
11
- NpmScript.LintPackageJson
12
- ], { cwd: projectPath(), verbose: true });
13
- if (Array.isArray(result)) {
14
- if (result.map((r) => r.isErr()).includes(true))
15
- process.exit(ExitCode.FatalError);
16
- }
17
- process.exit(ExitCode.Success);
6
+ import {log, runCommands} from "@stacksjs/cli";
7
+ import {projectPath} from "@stacksjs/path";
8
+ log.info("Ensuring Code Style...");
9
+ var result = await runCommands([
10
+ NpmScript.Lint,
11
+ NpmScript.LintPackageJson
12
+ ], { cwd: projectPath() });
13
+ if (Array.isArray(result)) {
14
+ if (result.map((r) => r.isErr()).includes(true))
15
+ process.exit(ExitCode.FatalError);
18
16
  }
19
- export {
20
- lintAction as default
21
- };
17
+ log.success("Linted");
@@ -1 +1,63 @@
1
1
  // @bun
2
+ // src/helpers/utils.ts
3
+ import * as storage from "@stacksjs/storage";
4
+ import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
5
+ import {log} from "@stacksjs/logging";
6
+ import * as p from "@stacksjs/path";
7
+ import {err, handleError} from "@stacksjs/error-handling";
8
+ var parseOptions = function(options) {
9
+ if (!options)
10
+ return "";
11
+ const parsedOptions = Object.entries(options).map(([key, value]) => {
12
+ if (key.length === 1)
13
+ return `-${key}=${value}`;
14
+ if (typeof value === "boolean" && value)
15
+ return `--${key}`;
16
+ return `--${key}=${typeof value === "string" && value.includes(" ") ? `"${value}"` : value}`;
17
+ });
18
+ return parsedOptions.filter(Boolean).join(" ").replace("----=", "");
19
+ };
20
+ async function runAction(action, options) {
21
+ if (!hasAction(action))
22
+ return err(handleError(`The specified action "${action}" does not exist`));
23
+ const opts = parseOptions(options);
24
+ const path = p.relativeActionsPath(`${action}.ts`);
25
+ const cmd = `bun --bun ${`${path} ${opts}`}`;
26
+ const o = {
27
+ cwd: options?.cwd || p.projectPath(),
28
+ ...options
29
+ };
30
+ if (options?.verbose) {
31
+ log.debug("Running cmd:", underline(italic(cmd)));
32
+ log.debug("Running action:", underline(italic(`./actions/${action}.ts`)));
33
+ log.debug("with action options of:", o);
34
+ }
35
+ return await runCommand(cmd, o);
36
+ }
37
+ async function runActions(actions, options) {
38
+ if (!actions.length)
39
+ return err("No actions were specified");
40
+ for (const action of actions) {
41
+ if (!hasAction(action))
42
+ return err(`The specified action "${action}" does not exist`);
43
+ }
44
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
+ return await runCommands(commands, options);
46
+ }
47
+ function hasAction(action) {
48
+ if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
49
+ return true;
50
+ return storage.isFile(p.actionsPath(`${action}.ts`));
51
+ }
52
+ // src/upgrade/index.ts
53
+ import process from "process";
54
+ import {ExitCode, parseArgs} from "@stacksjs/cli";
55
+ import {Action} from "@stacksjs/enums";
56
+ var options = parseArgs();
57
+ if (options?.framework || options?.all)
58
+ await updateFramework(options);
59
+ if (options?.dependencies || options?.all)
60
+ await updateDependencies(options);
61
+ if (options?.bun || options?.all)
62
+ await runAction(Action.UpgradeBun, options);
63
+ process.exit(ExitCode.InvalidArgument);
@@ -6,29 +6,34 @@ import {log} from "@stacksjs/logging";
6
6
  import {projectPath} from "@stacksjs/path";
7
7
  import * as storage from "@stacksjs/storage";
8
8
  // package.json
9
- var version = "0.58.41";
9
+ var version = "0.58.44";
10
10
 
11
11
  // src/upgrade.ts
12
- function checkForUncommittedChanges(options) {
12
+ function checkForUncommittedChanges(options2) {
13
13
  try {
14
14
  } catch (error) {
15
15
  if (error.status === 1) {
16
- if (!options?.force) {
16
+ if (!options2?.force) {
17
17
  }
18
18
  }
19
19
  }
20
20
  }
21
- async function downloadFrameworkUpdate(options) {
21
+ async function downloadFrameworkUpdate(options2) {
22
22
  const tempFolderName = "updates";
23
23
  const tempUpdatePath = projectPath(tempFolderName);
24
24
  if (storage.doesFolderExist(tempUpdatePath))
25
25
  await deleteFolder(tempUpdatePath);
26
26
  log.info("Downloading framework updates...");
27
- await runCommand(`giget stacks ${tempFolderName}`, options);
27
+ await runCommand(`giget stacks ${tempFolderName}`, options2);
28
28
  log.success(`Your framework updated correctly to version: v${version}`);
29
29
  }
30
30
  async function updateDependencies() {
31
31
  const perf = await intro("buddy upgrade:dependencies");
32
+ const result = await runCommand(NpmScript.UpgradeDependencies, options);
33
+ if (result.isErr()) {
34
+ outro("While running the upgrade:dependencies command, there was an issue", { startTime: perf, useSeconds: true }, result.error);
35
+ process.exit();
36
+ }
32
37
  await outro("Freshly updated your dependencies.", { startTime: perf, useSeconds: true });
33
38
  process.exit();
34
39
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.58.41",
4
+ "version": "0.58.44",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -0,0 +1,7 @@
1
+ import { log } from '@stacksjs/cli'
2
+ import { buddyPath } from '@stacksjs/path'
3
+ import { $ } from 'bun'
4
+
5
+ log.info('Building CLI')
6
+
7
+ await $`bun ${buddyPath('compile.ts')}`
@@ -1,66 +1,34 @@
1
1
  import process from 'node:process'
2
2
  import { glob } from '@stacksjs/storage'
3
+ import { dim, italic, log } from '@stacksjs/cli'
3
4
  import { corePath } from '@stacksjs/path'
4
5
  import { ExitCode } from '@stacksjs/types'
5
- import { dim, italic, log, runCommand } from '@stacksjs/cli'
6
+ import { $ } from 'bun'
6
7
 
7
8
  log.info('Building core packages')
8
9
 
9
- const dirs = (await glob([corePath('*')], { onlyDirectories: true }))
10
+ const dirs = (await glob([corePath('*')], { onlyDirectories: true })).sort()
10
11
 
11
12
  if (dirs.length === 0) {
12
13
  log.info('No core packages found')
13
14
  process.exit(ExitCode.FatalError)
14
15
  }
15
16
 
16
- dirs.forEach(async (folder) => {
17
- log.info('🏗️ Building...')
18
- log.info(`📦 ${italic(dim(folder))}`)
17
+ for (const folder of dirs) {
18
+ log.info(`🏗️ Building ${italic(dim(folder))}`)
19
19
 
20
- const result = await runCommand('bun --bun run build', {
21
- cwd: folder,
22
- })
20
+ $.cwd(folder)
21
+ await $`bun run build`
22
+ log.success(`${italic(dim(folder))} built`)
23
23
 
24
- if (result.isErr()) {
25
- log.error(`Failed to build ${italic(folder)}`)
26
- process.exit(ExitCode.FatalError)
27
- }
28
-
29
- log.success('✅ Build complete')
30
- })
31
-
32
- // run the tsc command
33
- // log.info('Generating type definitions...')
34
-
35
- // const tscResult = await runCommand('bun --bun tsc', projectPath())
36
-
37
- // if (tscResult.isErr()) {
38
- // log.error(tscResult.error)
39
- // process.exit(ExitCode.FatalError)
40
- // }
24
+ // eslint-disable-next-line no-console
25
+ console.log(``)
26
+ }
41
27
 
42
- // log.success('Generated type definitions')
28
+ // dirs.forEach(async (folder) => {
29
+ // log.info(`🏗️ Building ${italic(dim(folder))}`)
43
30
 
44
- // move type definitions to the dist folder
45
- // log.info('Moving type definitions to dist folder...')
46
- // const moveResult = await runCommand('bun --bun move-dts-files.ts', {
47
- // cwd: import.meta.dir
31
+ // $.cwd(folder)
32
+ // const text = await $`bun run build`.text()
33
+ // console.log(text)
48
34
  // })
49
-
50
- // if (moveResult.isErr()) {
51
- // log.error(moveResult.error)
52
- // process.exit(ExitCode.FatalError)
53
- // }
54
-
55
- // log.success('Moved type definitions to dist folder')
56
-
57
- // move core/*/dist/src/* to core/*/dist/*
58
- // log.info('Moving built source files to dist folder...')
59
- // const moveSrcResult = await runCommand('bun --bun move-built-src-files.ts', import.meta.dir)
60
-
61
- // if (moveSrcResult.isErr()) {
62
- // log.error(moveSrcResult.error)
63
- // process.exit(ExitCode.FatalError)
64
- // }
65
-
66
- // log.success('Moved built source files in the dist folder')
@@ -12,7 +12,7 @@ serve({
12
12
  port: config.app.ports?.api, // defaults to 3999
13
13
  })
14
14
 
15
- // we need this proxied by vite
15
+ // the reason we start a Vite dev server next is because we need the Bun server proxied by vite
16
16
  await runCommand(`bunx vite --config ${p.vitePath('src/api.ts')}`, {
17
17
  // ...options,
18
18
  cwd: p.frameworkPath(),
@@ -1,19 +1,27 @@
1
1
  import process from 'node:process'
2
- import { runCommands } from '@stacksjs/cli'
3
- import { projectPath } from '@stacksjs/path'
4
2
  import { ExitCode } from '@stacksjs/types'
5
3
  import { NpmScript } from '@stacksjs/enums'
4
+ import { log, runCommands } from '@stacksjs/cli'
5
+ import { projectPath } from '@stacksjs/path'
6
+
7
+ // import { $ } from 'bun'
6
8
 
7
- export default async function lintAction() {
8
- const result = await runCommands([
9
- NpmScript.Lint,
10
- NpmScript.LintPackageJson,
11
- ], { cwd: projectPath(), verbose: true })
9
+ log.info('Ensuring Code Style...')
12
10
 
13
- if (Array.isArray(result)) {
14
- if (result.map(r => r.isErr()).includes(true))
15
- process.exit(ExitCode.FatalError)
16
- }
11
+ // TODO: somehow, we currently cannot trigger bunx using $`` syntax
12
+ // $.cwd(projectPath())
17
13
 
18
- process.exit(ExitCode.Success)
14
+ // await $`${NpmScript.Lint}`
15
+ // await $`${NpmScript.LintPackageJson}`
16
+
17
+ const result = await runCommands([
18
+ NpmScript.Lint,
19
+ NpmScript.LintPackageJson,
20
+ ], { cwd: projectPath() })
21
+
22
+ if (Array.isArray(result)) {
23
+ if (result.map(r => r.isErr()).includes(true))
24
+ process.exit(ExitCode.FatalError)
19
25
  }
26
+
27
+ log.success('Linted')
@@ -1,25 +1,21 @@
1
- // import { ExitCode, parseArgs } from '@stacksjs/cli'
2
- // import { Action } from '@stacksjs/enums'
3
- // import { runAction } from '../helpers'
4
- //
5
- // const options = parseArgs()
1
+ import process from 'node:process'
2
+ import { ExitCode, parseArgs } from '@stacksjs/cli'
3
+ import { Action } from '@stacksjs/enums'
4
+ import { runAction } from '../helpers'
5
+
6
+ const options = parseArgs()
6
7
 
7
8
  // run all the upgrade actions
8
- // if (options?.framework || options?.all)
9
- // await updateFramework(options)
9
+ if (options?.framework || options?.all)
10
+ await updateFramework(options)
11
+
12
+ if (options?.dependencies || options?.all)
13
+ await updateDependencies(options)
10
14
 
11
- // if (options?.dependencies || options?.all)
12
- // await updateDependencies(options)
15
+ if (options?.bun || options?.all)
16
+ await runAction(Action.UpgradeBun, options)
13
17
 
14
- // if (options?.packageManager || options?.all)
15
- // await runAction(Action.UpgradePackageManager, options)
16
- //
17
- // if (options?.node || options?.all)
18
- // await runAction(Action.UpgradeNode, options)
19
- //
20
- // else
21
- // process.exit(ExitCode.InvalidArgument)
18
+ process.exit(ExitCode.InvalidArgument)
22
19
 
23
- // // TODO: also update CI files & configurations, and other files, possibly
24
- // // we want this to be smart enough to update only if files that have been updated
25
- // // TODO: this script should trigger regeneration of auto-imports.d.ts & components.d.ts
20
+ // TODO: also update CI files & configurations, and other files, possibly (taze?)
21
+ // we want this to be smart enough to update only if files that have been updated
@@ -53,12 +53,12 @@ export async function downloadFrameworkUpdate(options: UpgradeOptions) {
53
53
  // export async function updateDependencies(options: UpgradeOptions) {
54
54
  export async function updateDependencies() {
55
55
  const perf = await intro('buddy upgrade:dependencies')
56
- // const result = await runCommand(NpmScript.UpgradeDependencies, options)
56
+ const result = await runCommand(NpmScript.UpgradeDependencies, options)
57
57
 
58
- // if (result.isErr()) {
59
- // outro('While running the upgrade:dependencies command, there was an issue', { startTime: perf, useSeconds: true }, result.error)
60
- // process.exit()
61
- // }
58
+ if (result.isErr()) {
59
+ outro('While running the upgrade:dependencies command, there was an issue', { startTime: perf, useSeconds: true }, result.error)
60
+ process.exit()
61
+ }
62
62
 
63
63
  await outro('Freshly updated your dependencies.', { startTime: perf, useSeconds: true })
64
64
  process.exit()