stacks 0.58.28 → 0.58.30

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 (233) hide show
  1. package/core/README.md +1 -1
  2. package/core/actions/dist/src/deploy/index.js +1 -1
  3. package/core/actions/dist/src/dev/components.js +1 -1
  4. package/core/actions/dist/src/dev/index.js +10 -0
  5. package/core/actions/dist/src/generate/lib-entries.js +3 -3
  6. package/core/actions/dist/src/helpers/lib-entries.js +3 -3
  7. package/core/actions/dist/src/index.js +10 -0
  8. package/core/actions/dist/src/lint/fix.js +1 -1
  9. package/core/actions/dist/src/release.js +8 -0
  10. package/core/actions/dist/src/upgrade.js +1 -1
  11. package/core/actions/package.json +1 -1
  12. package/core/actions/src/build/docs.ts +7 -0
  13. package/core/actions/src/deploy/index.ts +1 -1
  14. package/core/actions/src/dev/api.ts +2 -2
  15. package/core/actions/src/dev/components.ts +1 -1
  16. package/core/actions/src/dev/dashboard.ts +7 -0
  17. package/core/actions/src/dev/desktop.ts +3 -3
  18. package/core/actions/src/dev/index.ts +10 -0
  19. package/core/actions/src/dev/system-tray.ts +6 -0
  20. package/core/actions/src/helpers/lib-entries.ts +3 -3
  21. package/core/actions/src/lint/fix.ts +1 -1
  22. package/core/ai/package.json +3 -3
  23. package/core/alias/package.json +1 -1
  24. package/core/analytics/package.json +1 -1
  25. package/core/api/package.json +1 -1
  26. package/core/arrays/package.json +1 -1
  27. package/core/auth/package.json +1 -1
  28. package/core/buddy/README.md +2 -2
  29. package/core/buddy/dist/{chunk-b75e6db0012faa55.js → chunk-0455e53fab4244b1.js} +1 -4
  30. package/core/buddy/dist/{chunk-fd47b42fb923a4be.js → chunk-61e8f138963fc709.js} +173 -137
  31. package/core/buddy/dist/cli.js +2 -2
  32. package/core/buddy/dist/index.js +2 -2
  33. package/core/buddy/package.json +1 -1
  34. package/core/buddy/src/commands/add.ts +4 -0
  35. package/core/buddy/src/commands/build.ts +12 -1
  36. package/core/buddy/src/commands/changelog.ts +2 -0
  37. package/core/buddy/src/commands/clean.ts +2 -0
  38. package/core/buddy/src/commands/cloud.ts +6 -0
  39. package/core/buddy/src/commands/commit.ts +2 -0
  40. package/core/buddy/src/commands/configure.ts +3 -0
  41. package/core/buddy/src/commands/create.ts +8 -8
  42. package/core/buddy/src/commands/deploy.ts +24 -23
  43. package/core/buddy/src/commands/dev.ts +50 -10
  44. package/core/buddy/src/commands/dns.ts +2 -0
  45. package/core/buddy/src/commands/domains.ts +2 -0
  46. package/core/buddy/src/commands/example.ts +4 -0
  47. package/core/buddy/src/commands/fresh.ts +2 -0
  48. package/core/buddy/src/commands/generate.ts +12 -3
  49. package/core/buddy/src/commands/http.ts +2 -0
  50. package/core/buddy/src/commands/install.ts +2 -0
  51. package/core/buddy/src/commands/key.ts +4 -2
  52. package/core/buddy/src/commands/lint.ts +3 -0
  53. package/core/buddy/src/commands/make.ts +11 -1
  54. package/core/buddy/src/commands/migrate.ts +3 -0
  55. package/core/buddy/src/commands/prepublish.ts +2 -0
  56. package/core/buddy/src/commands/release.ts +2 -0
  57. package/core/buddy/src/commands/seed.ts +2 -0
  58. package/core/buddy/src/commands/setup.ts +33 -34
  59. package/core/buddy/src/commands/test.ts +2 -0
  60. package/core/buddy/src/commands/tinker.ts +2 -0
  61. package/core/buddy/src/commands/types.ts +3 -0
  62. package/core/buddy/src/commands/upgrade.ts +6 -0
  63. package/core/build/package.json +1 -1
  64. package/core/bun-create/bud/package.json +3 -2
  65. package/core/bun-create/buddy/package.json +2 -2
  66. package/core/bun-create/stack/package.json +2 -2
  67. package/core/bun-create/stacks/package.json +2 -2
  68. package/core/bun-create/stx/package.json +2 -2
  69. package/core/bun-plugin-yaml/dist/index.js +1 -19
  70. package/core/bun-plugin-yaml/package.json +1 -1
  71. package/core/bun-plugin-yaml/src/index.ts +1 -1
  72. package/core/cache/package.json +2 -2
  73. package/core/chat/package.json +1 -1
  74. package/core/cli/dist/index.js +24 -23
  75. package/core/cli/package.json +1 -1
  76. package/core/cli/src/helpers.ts +21 -31
  77. package/core/cli/src/run.ts +9 -7
  78. package/core/cloud/buddy +2 -0
  79. package/core/cloud/package.json +33 -33
  80. package/core/cloud/src/cloud/ai.ts +45 -36
  81. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +10 -10
  82. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
  83. package/core/cloud/src/cloud/cdn.ts +44 -5
  84. package/core/cloud/src/cloud/cli.ts +45 -0
  85. package/core/cloud/src/cloud/compute.ts +1 -1
  86. package/core/cloud/src/cloud/index.ts +6 -1
  87. package/core/cloud/src/cloud/lambda/cli-setup/index.js +67 -0
  88. package/core/cloud/src/index.ts +1 -0
  89. package/core/cloud/src/runtime/example/lambda.ts +1 -1
  90. package/core/cloud/src/runtime/runtime.ts +1 -0
  91. package/core/cloud/src/runtime/server.ts +1 -1
  92. package/core/collections/package.json +1 -1
  93. package/core/config/dist/index.js +130 -122
  94. package/core/config/package.json +1 -1
  95. package/core/config/src/overrides.ts +0 -2
  96. package/core/database/package.json +2 -2
  97. package/core/database/src/kysely-bun-worker/driver.ts +1 -0
  98. package/core/database/src/kysely-bun-worker/worker.ts +1 -1
  99. package/core/datetime/package.json +1 -1
  100. package/core/desktop/dist/index.js +6 -0
  101. package/core/desktop/package.json +5 -5
  102. package/core/desktop/src/index.ts +2 -0
  103. package/core/desktop/src/system-tray.ts +1 -0
  104. package/core/development/package.json +1 -1
  105. package/core/dns/package.json +7 -7
  106. package/core/docs/build.ts +1 -1
  107. package/core/docs/dist/index.js +29878 -9995
  108. package/core/docs/package.json +6 -5
  109. package/core/docs/src/index.ts +7 -1
  110. package/core/docs/src/meta.ts +32 -0
  111. package/core/docs/src/scripts/pwa.ts +116 -0
  112. package/core/email/email-forwarder.cjs +1 -0
  113. package/core/email/package.json +3 -3
  114. package/core/email/src/server/converter.ts +1 -0
  115. package/core/email/src/server/inbound.ts +1 -0
  116. package/core/email/src/server/outbound.ts +6 -4
  117. package/core/enums/dist/index.js +4 -2
  118. package/core/enums/package.json +1 -1
  119. package/core/enums/src/index.ts +4 -2
  120. package/core/env/package.json +1 -1
  121. package/core/error-handling/package.json +1 -1
  122. package/core/eslint-config/package.json +18 -18
  123. package/core/eslint-config/src/configs/comments.ts +1 -1
  124. package/core/eslint-config/src/configs/imports.ts +9 -0
  125. package/core/eslint-config/src/configs/svelte.ts +1 -0
  126. package/core/eslint-config/src/configs/unicorn.ts +1 -1
  127. package/core/eslint-config/src/configs/vue.ts +0 -1
  128. package/core/eslint-config/src/factory.ts +2 -8
  129. package/core/events/package.json +1 -1
  130. package/core/faker/package.json +2 -2
  131. package/core/git/dist/index.js +40 -0
  132. package/core/git/package.json +3 -3
  133. package/core/git/src/index.ts +62 -0
  134. package/core/health/package.json +1 -1
  135. package/core/http/package.json +1 -1
  136. package/core/lint/package.json +1 -1
  137. package/core/logging/dist/index.js +0 -6
  138. package/core/logging/package.json +1 -1
  139. package/core/music/package.json +3 -3
  140. package/core/notifications/package.json +2 -2
  141. package/core/objects/package.json +1 -1
  142. package/core/orm/package.json +1 -1
  143. package/core/path/dist/index.js +6 -3
  144. package/core/path/package.json +1 -1
  145. package/core/path/src/index.ts +7 -3
  146. package/core/payments/dist/index.js +2 -5
  147. package/core/payments/package.json +3 -3
  148. package/core/push/package.json +1 -1
  149. package/core/query-builder/package.json +1 -1
  150. package/core/queue/package.json +1 -1
  151. package/core/raycast/package.json +5 -0
  152. package/core/raycast/src/index.ts +0 -0
  153. package/core/realtime/package.json +1 -1
  154. package/core/repl/package.json +1 -1
  155. package/core/router/dist/index.js +16 -496
  156. package/core/router/package.json +1 -1
  157. package/core/router/src/middleware.ts +16 -14
  158. package/core/scheduler/package.json +1 -1
  159. package/core/search-engine/package.json +2 -2
  160. package/core/security/dist/index.js +3 -6
  161. package/core/security/package.json +2 -2
  162. package/core/server/dist/index.js +6 -2
  163. package/core/server/package.json +2 -2
  164. package/core/server/src/config.ts +14 -9
  165. package/core/signals/package.json +1 -1
  166. package/core/slug/package.json +1 -1
  167. package/core/sms/package.json +1 -1
  168. package/core/storage/dist/index.js +28 -10
  169. package/core/storage/package.json +1 -1
  170. package/core/storage/src/files.ts +10 -2
  171. package/core/storage/src/zip.ts +1 -1
  172. package/core/strings/package.json +3 -3
  173. package/core/stx +2 -0
  174. package/core/tables/package.json +3 -3
  175. package/core/testing/package.json +3 -3
  176. package/core/tinker/package.json +1 -1
  177. package/core/tsconfig.json +4 -9
  178. package/core/tunnel/package.json +1 -1
  179. package/core/types/dist/index.js +3 -1
  180. package/core/types/package.json +13 -13
  181. package/core/types/src/cli.ts +3 -3
  182. package/core/types/src/cloud.ts +4 -1
  183. package/core/types/src/dns.ts +1 -1
  184. package/core/types/src/native.ts +0 -0
  185. package/core/types/src/stacks.ts +0 -10
  186. package/core/ui/package.json +8 -8
  187. package/core/utils/dist/index.js +1 -1
  188. package/core/utils/package.json +1 -1
  189. package/core/validation/package.json +1 -1
  190. package/core/vite/README.md +1 -1
  191. package/core/vite/build.ts +1 -1
  192. package/core/vite/dist/index.js +211 -203
  193. package/core/vite/package.json +5 -5
  194. package/core/vite/src/components.ts +1 -1
  195. package/core/vite/src/dashboard.ts +100 -0
  196. package/core/vite/src/desktop.ts +2 -58
  197. package/core/vite/src/example-vue.ts +1 -1
  198. package/core/vite/src/example-wc.ts +1 -1
  199. package/core/vite/src/functions.ts +1 -1
  200. package/core/vite/src/index.ts +9 -11
  201. package/core/vite/src/plugin/auto-imports.ts +1 -1
  202. package/core/vite/src/plugin/layouts.ts +6 -7
  203. package/core/vite/src/plugin/router.ts +3 -1
  204. package/core/vite/src/system-tray.ts +100 -0
  205. package/core/vite/src/views.ts +13 -2
  206. package/core/vite/src/web-components.ts +1 -1
  207. package/core/whois/dist/index.js +1 -2
  208. package/core/whois/package.json +1 -1
  209. package/core/whois/src/index.ts +10 -8
  210. package/core/x-ray/package.json +1 -1
  211. package/core/zsh-buddy/README.md +51 -0
  212. package/core/zsh-buddy/package.json +29 -0
  213. package/ide/dictionary.txt +12 -0
  214. package/ide/jetbrains/.idea/stacks.iml +0 -1
  215. package/ide/vscode/.vscode/settings.json +7 -2
  216. package/ide/vscode/package.json +2 -4
  217. package/package.json +12 -7
  218. package/core/cloud/src/server/.dockerignore +0 -15
  219. package/core/cloud/src/server/Dockerfile +0 -21
  220. package/core/cloud/src/server/index.ts +0 -3
  221. package/core/cloud/src/server/package.json +0 -12
  222. package/core/cloud/src/server/runtime.ts +0 -828
  223. package/core/scripts/build +0 -58
  224. package/core/scripts/ensure +0 -33
  225. package/core/scripts/fresh +0 -14
  226. package/core/scripts/link +0 -14
  227. package/core/scripts/move-built-src-files.ts +0 -28
  228. package/core/scripts/move-dts-files.ts +0 -35
  229. package/core/scripts/publish +0 -43
  230. package/core/scripts/setup +0 -176
  231. package/core/tables/vite.config.ts +0 -84
  232. package/core/vite/src/plugin/index.ts +0 -21
  233. /package/core/vite/src/{stacks.ts → plugins.ts} +0 -0
@@ -1,58 +0,0 @@
1
- #!/bin/sh
2
-
3
- # Get the script's directory
4
- script_dir=$(realpath $(dirname "$0"))
5
-
6
- # Get all directories in the core path
7
- dirs=$(find "$script_dir/../" -type d -maxdepth 1)
8
-
9
- # Check if no directories found
10
- if [ -z "$dirs" ]; then
11
- echo "No core packages found"
12
- exit 1
13
- fi
14
-
15
- # Loop through each directory
16
- for dir in $dirs; do
17
- # Skip the ../scripts directory
18
- if [ "$dir" = "$script_dir/../scripts" ]; then
19
- continue
20
- fi
21
-
22
- echo ""
23
- echo "🏗️ Building..."
24
- echo "📦 $dir"
25
-
26
- # Change to the directory
27
- cd $dir
28
-
29
- # Check if the directory is one of the specified ones
30
- case "$dir" in
31
- ## This is because eslint requires cjs builds which we use tsup for
32
- *"/eslint-config")
33
- # build the package
34
- bun run build
35
- ;;
36
- *)
37
- # Check if build.ts exists in the directory
38
- if [ -f "build.ts" ]; then
39
- # Extract the command from build.ts
40
- cmd=$(sed -nE "s/.*runCommand\('(.*)',.*/\1/p" build.ts)
41
- # Run the extracted command
42
- eval $cmd
43
- fi
44
- ;;
45
- esac
46
-
47
- # Check if the build command was successful
48
- if [ $? -ne 0 ]; then
49
- echo "Failed to build $dir"
50
- exit 1
51
- fi
52
-
53
- echo "✅ Build complete"
54
- echo ""
55
-
56
- # Change back to the original directory
57
- cd - >/dev/null
58
- done
@@ -1,33 +0,0 @@
1
- #!/bin/sh
2
-
3
- ## This script ensures that Bun is installed.
4
-
5
- REQUIRED_BUN_VERSION=$(awk '/bun.sh/{print substr($2, 2)}' ../../pkgx.yaml | tr -d "'")
6
-
7
- # Remove the '>=v' prefix from the version string
8
- REQUIRED_BUN_VERSION=${REQUIRED_BUN_VERSION#>=v}
9
-
10
- REQUIRED_BUN_MAJOR=$(echo "$REQUIRED_BUN_VERSION" | cut -d. -f1)
11
- REQUIRED_BUN_MINOR=$(echo "$REQUIRED_BUN_VERSION" | cut -d. -f2)
12
- REQUIRED_BUN_PATCH=$(echo "$REQUIRED_BUN_VERSION" | cut -d. -f3)
13
-
14
- INSTALLED_BUN_VERSION=$(node -v 2>/dev/null || echo "")
15
- INSTALLED_BUN_VERSION=${INSTALLED_BUN_VERSION#v} # removes the 'v' prefix
16
- INSTALLED_BUN_MAJOR=$(echo "$INSTALLED_BUN_VERSION" | cut -d. -f1)
17
- INSTALLED_BUN_MINOR=$(echo "$INSTALLED_BUN_VERSION" | cut -d. -f2)
18
- INSTALLED_BUN_PATCH=$(echo "$INSTALLED_BUN_VERSION" | cut -d. -f3)
19
-
20
- if [[ "$INSTALLED_BUN_MAJOR" -lt "$REQUIRED_BUN_MAJOR" ||
21
- ("$INSTALLED_BUN_MAJOR" -eq "$REQUIRED_BUN_MAJOR" && "$INSTALLED_BUN_MINOR" -lt "$REQUIRED_BUN_MINOR") ||
22
- ("$INSTALLED_BUN_MAJOR" -eq "$REQUIRED_BUN_MAJOR" && "$INSTALLED_BUN_MINOR" -eq "$REQUIRED_BUN_MINOR" && "$INSTALLED_BUN_PATCH" -lt "$REQUIRED_BUN_PATCH") ]]; then
23
- sh ./setup.sh
24
- bun_version=$(exec $SHELL -l -c "source ~/.zshrc; tea +bun.sh'=$REQUIRED_BUN_VERSION' >/dev/null 2>&1; tea +bun.sh'=$REQUIRED_BUN_VERSION' bun -v")
25
- exec $SHELL -c "source ~/.zshrc; tea -SE >/dev/null 2>&1 && cd ."
26
- echo " # managed by stacks"
27
- echo " • bun $bun_version"
28
- echo "\n Please reopen your shell for updates to take effect." | awk '{print "\033[3m" $0 "\033[0m"}'
29
-
30
- exit
31
- fi
32
-
33
- echo "Bun v$REQUIRED_BUN_VERSION or greater is installed!"
@@ -1,14 +0,0 @@
1
- #!/bin/sh
2
-
3
- # delete ../../../bun.lockb
4
- rm ../../bun.lock
5
-
6
- # delete all node_modules and dist folders
7
- rimraf ../../**/dist
8
- rimraf ../../**/node_modules # ensure this runs last or else rimraf will delete itself
9
-
10
- # install dependencies via Bun
11
- bun install
12
-
13
- # link all core packages
14
- # ./link.sh
package/core/scripts/link DELETED
@@ -1,14 +0,0 @@
1
- #!/bin/sh
2
-
3
- # loop over every directory in ./storage/framework/core/*
4
- for dir in ../src/*/; do
5
- # -d checks if it's a directory
6
- if [[ -d "$dir" ]]; then
7
- # navigate into directory
8
- cd "$dir"
9
- # execute your command
10
- bun link
11
- # navigate back to the original directory
12
- cd -
13
- fi
14
- done
@@ -1,28 +0,0 @@
1
- import process from 'node:process'
2
- import { italic, log } from '@stacksjs/cli'
3
- import { glob, storage } from '@stacksjs/storage'
4
- import { ExitCode } from '@stacksjs/types'
5
-
6
- log.info('Moving built src files to right path in the dist folder...')
7
-
8
- const files = await glob([
9
- '../src/**/dist/src/**',
10
- ])
11
-
12
- if (files.length === 0) {
13
- log.info('No files to move')
14
- process.exit(ExitCode.Success)
15
- }
16
-
17
- for (const file of files) {
18
- const path = file.replace('dist/src', 'dist')
19
-
20
- log.info('Moving', italic(file), 'to', italic(path))
21
-
22
- await storage.move(file, path, { overwrite: true })
23
- }
24
-
25
- // delete empty /dist/src folder
26
- await storage.del('../src/**/dist/src')
27
-
28
- log.success('Moved built src files to right path in the dist folder')
@@ -1,35 +0,0 @@
1
- import process from 'node:process'
2
- import { italic, log } from '@stacksjs/cli'
3
- import { glob, storage } from '@stacksjs/storage'
4
- import { ExitCode } from '@stacksjs/types'
5
- import { corePath } from '@stacksjs/path'
6
-
7
- log.info('Getting started to move d.ts & d.ts.map files...')
8
-
9
- const files = await glob([
10
- '../dist/types/storage/framework/core/**/src/*.d.ts',
11
- '../dist/types/storage/framework/core/**/src/*.d.ts.map',
12
- '../dist/types/storage/framework/core/**/src/**/*.d.ts',
13
- '../dist/types/storage/framework/core/**/src/**/*.d.ts.map',
14
- '../dist/types/storage/framework/core/**/src/**/**/*.d.ts',
15
- '../dist/types/storage/framework/core/**/src/**/**/*.d.ts.map',
16
- ])
17
-
18
- if (files.length === 0) {
19
- log.info('No d.ts files found')
20
- process.exit(ExitCode.Success)
21
- }
22
-
23
- for (const file of files) {
24
- const path = file
25
- .replace('../dist/types/storage/framework/core/', '../src/')
26
- .replace('/src/', '/dist/')
27
-
28
- log.info('Moving', italic(file), 'to', italic(path))
29
-
30
- await storage.move(file, path, { overwrite: true })
31
- }
32
- log.success('Moved d.ts files')
33
-
34
- log.info('Deleting dist/src folders')
35
- await storage.del(corePath('**/dist/src'))
@@ -1,43 +0,0 @@
1
- #!/bin/sh
2
-
3
- # Get the script's directory
4
- script_dir=$(realpath $(dirname "$0"))
5
-
6
- # Get all directories in the core path except for src/bun-create
7
- dirs=$(find "$script_dir/../" -type d -maxdepth 1 -not -path "$script_dir/../bun-create")
8
-
9
- # Get all directories in src/bun-create up to two levels deep
10
- bun_create_dirs=$(find "$script_dir/../src" -type d -maxdepth 2)
11
-
12
- # Combine the two directory lists
13
- dirs="$dirs $bun_create_dirs"
14
-
15
- # Check if no directories found
16
- if [ -z "$dirs" ]; then
17
- echo "No core packages found"
18
- exit 1
19
- fi
20
-
21
- # Loop through each directory
22
- for dir in $dirs; do
23
- echo ""
24
- echo "🏗️ Releasing..."
25
- echo "📦 $dir"
26
-
27
- # Change to the directory
28
- cd $dir
29
-
30
- npm publish --access public --no-git-checks || echo "Failed to publish $dir"
31
-
32
- # Check if the build command was successful
33
- if [ $? -ne 0 ]; then
34
- echo "Failed to publish $dir"
35
- exit 1
36
- fi
37
-
38
- echo "✅ Latest is published"
39
- echo ""
40
-
41
- # Change back to the original directory
42
- cd - >/dev/null
43
- done
@@ -1,176 +0,0 @@
1
- #!/bin/sh
2
-
3
- ## updates or installs pkgx
4
- ### thanks to pkgx.sh for this script 💙
5
-
6
- set -e
7
-
8
- if test -n "$VERBOSE" -o -n "$GITHUB_ACTIONS" -a -n "$RUNNER_DEBUG"; then
9
- set -x
10
- fi
11
-
12
- if test -d /usr/local/bin -a ! -w /usr/local/bin; then
13
- SUDO="sudo"
14
- elif test -d /usr/local -a ! -w /usr/local; then
15
- SUDO="sudo"
16
- elif test -d /usr -a ! -w /usr; then
17
- SUDO="sudo"
18
- fi
19
-
20
- _install_pre_reqs() {
21
- if test -f /etc/debian_version; then
22
- apt update --yes
23
-
24
- # minimal but required or networking doesn’t work
25
- # https://packages.debian.org/buster/all/netbase/filelist
26
- A=netbase
27
-
28
- # difficult to pkg in our opinion
29
- B=libudev-dev
30
-
31
- case $(cat /etc/debian_version) in
32
- jessie/sid|8.*|stretch/sid|9.*)
33
- apt --yes install libc-dev libstdc++-4.8-dev libgcc-4.7-dev $A $B;;
34
- buster/sid|10.*)
35
- apt --yes install libc-dev libstdc++-8-dev libgcc-8-dev $A $B;;
36
- bullseye/sid|11.*)
37
- apt --yes install libc-dev libstdc++-10-dev libgcc-9-dev $A $B;;
38
- bookworm/sid|12.*|*)
39
- apt --yes install libc-dev libstdc++-11-dev libgcc-11-dev $A $B;;
40
- esac
41
- elif test -f /etc/fedora-release; then
42
- $SUDO yum --assumeyes install libatomic
43
- fi
44
- }
45
-
46
- _is_ci() {
47
- [ -n "$CI" ] && [ $CI != 0 ]
48
- }
49
-
50
- _install_pkgx() {
51
- if _is_ci; then
52
- progress="--no-progress-meter"
53
- else
54
- progress="--progress-bar"
55
- fi
56
-
57
- tmpdir=$(mktemp -d)
58
-
59
- if [ $# -eq 0 ]; then
60
- if [ -f /usr/local/bin/pkgx ]; then
61
- echo "upgrading: /usr/local/bin/pkgx" >&2
62
- else
63
- echo "installing: /usr/local/bin/pkgx" >&2
64
- fi
65
-
66
- # using a named pipe to prevent curl progress output trumping the sudo password prompt
67
- pipe="$tmpdir/pipe"
68
- mkfifo "$pipe"
69
-
70
- curl $progress --fail --proto '=https' "https://pkgx.sh/$(uname)/$(uname -m)".tgz > "$pipe" &
71
- $SUDO sh -c "
72
- mkdir -p /usr/local/bin
73
- tar xz --directory /usr/local/bin < '$pipe'
74
- " &
75
- wait
76
-
77
- rm -r "$tmpdir"
78
-
79
- if [ "$(command which pkgx)" != /usr/local/bin/pkgx ]; then
80
- echo "warning: active pkgx is not /usr/local/bin/pkgx" >&2
81
- export PATH="/usr/local/bin:$PATH" # so we can exec if required
82
- fi
83
-
84
- # tell the user what version we just installed
85
- pkgx --version
86
-
87
- else
88
- curl $progress --fail --proto '=https' \
89
- "https://pkgx.sh/$(uname)/$(uname -m)".tgz \
90
- | tar xz --directory "$tmpdir"
91
-
92
- export PATH="$tmpdir:$PATH"
93
- export PKGX_DIR="$tmpdir"
94
- fi
95
-
96
- unset tmpdir pipe
97
- }
98
-
99
- _pkgx_is_old() {
100
- v="$(/usr/local/bin/pkgx --version || echo pkgx 0)"
101
- /usr/local/bin/pkgx --silent semverator gt \
102
- $(curl -Ssf https://pkgx.sh/VERSION) \
103
- $(echo $v | awk '{print $2}')
104
- }
105
-
106
- _should_install_pkgx() {
107
- if [ ! -f /usr/local/bin/pkgx ]; then
108
- return 0
109
- elif _pkgx_is_old >/dev/null 2>&1; then
110
- return 0
111
- else
112
- return 1
113
- fi
114
- }
115
-
116
- ########################################################################### meat
117
-
118
- if _should_install_pkgx; then
119
- _install_pkgx "$@"
120
- elif [ $# -eq 0 ]; then
121
- echo "$(pkgx --version) already installed" >&2
122
- fi
123
-
124
- if _is_ci; then
125
- apt() {
126
- # we should use apt-get not apt in CI
127
- # weird shit ref: https://askubuntu.com/a/668859
128
- export DEBIAN_FRONTEND=noninteractive
129
- cmd=$1
130
- shift
131
- $SUDO apt-get $cmd -qq -o=Dpkg::Use-Pty=0 $@
132
- }
133
- else
134
- apt() {
135
- case "$1" in
136
- update)
137
- echo "ensure you have the `pkgx` pre-requisites installed:" >&2
138
- echo >&2
139
- ;;
140
- install)
141
- echo " apt-get" "$@" >&2
142
- ;;
143
- esac
144
- }
145
- yum() {
146
- echo " yum" "$@" >&2
147
- }
148
- unset SUDO
149
- fi
150
-
151
- _install_pre_reqs
152
-
153
- if [ $# -gt 0 ]; then
154
- pkgx "$@"
155
- elif [ $(basename "/$0") != 'installer.sh' ]; then
156
- # ^^ temporary exception for action.ts
157
-
158
- if type eval >/dev/null 2>&1; then
159
- # we `type eval` as on Travis there was no `eval`!
160
- eval "$(pkgx --shellcode)" 2>/dev/null
161
- fi
162
-
163
- if ! _is_ci; then
164
- echo "for more info: pkgx --help" >&2
165
- fi
166
- fi
167
-
168
- eval "$(pkgx integrate)"
169
-
170
- # todo: need to check if this repo already exists locally
171
- git clone https://github.com/stacksjs/stacks.git $1
172
-
173
- cd $1
174
-
175
- # need to log to console: "in order to finish the setup,
176
- # please run
@@ -1,84 +0,0 @@
1
- import process from 'node:process'
2
- import { defineConfig, loadEnv } from 'vite'
3
- import type { BuildOptions as ViteBuildOptions } from 'vite'
4
- import Components from 'unplugin-vue-components/vite'
5
- import type { ViteConfig } from '../types/src'
6
- import { libraryEntryPath, libsPath, projectPath, storagePath } from '../path/src'
7
- import { app, library } from '../config/src'
8
- import { alias } from '../alias/src'
9
- import { autoImports, uiEngine } from '../vite/src'
10
-
11
- export const vueComponentsConfig: ViteConfig = {
12
- envDir: projectPath(),
13
- envPrefix: 'FRONTEND_',
14
- publicDir: storagePath('public'),
15
-
16
- server: {
17
- host: app.url,
18
- open: false,
19
- },
20
-
21
- resolve: {
22
- dedupe: ['vue'],
23
- alias,
24
- },
25
-
26
- optimizeDeps: {
27
- exclude: ['stacks', 'vue', 'fsevents', 'emitter', '@stacksjs/utils', '@stacksjs/validation', '@stacksjs/vite', '@stacksjs/server', '@stacksjs/config', 'stacks/utils', 'stacks/validation'],
28
- },
29
-
30
- plugins: [
31
- // preview(),
32
- uiEngine(),
33
- // cssEngine(),
34
- autoImports(),
35
- Components({
36
- // allow auto load markdown components under `./src/components/`
37
- extensions: ['stx', 'vue', 'md'],
38
- // allow auto import and register components used in markdown
39
- include: [/\.stx$/, /\.stx\?stx/, /\.vue$/, /\.vue\?vue/, /\.md$/],
40
- dts: 'src/components.d.ts',
41
- }),
42
- ],
43
-
44
- build: vueComponentsBuildOptions(),
45
- }
46
-
47
- export function vueComponentsBuildOptions(): ViteBuildOptions {
48
- return {
49
- outDir: libsPath('components/vue/dist'),
50
- emptyOutDir: true,
51
- lib: {
52
- entry: libraryEntryPath('vue-components'),
53
- name: library.vueComponents?.name,
54
- formats: ['cjs', 'es'],
55
- fileName: (format: string) => {
56
- if (format === 'es')
57
- return 'index.mjs'
58
-
59
- if (format === 'cjs')
60
- return 'index.cjs'
61
-
62
- return 'index.?.js'
63
- },
64
- },
65
-
66
- rollupOptions: {
67
- external: ['vue', '@stacksjs/vite'],
68
- output: {
69
- globals: {
70
- vue: 'Vue',
71
- },
72
- },
73
- },
74
- }
75
- }
76
-
77
- export default defineConfig(({ command, mode }) => {
78
- process.env = { ...process.env, ...loadEnv(mode, projectPath(), '') }
79
-
80
- if (command === 'serve')
81
- return vueComponentsConfig
82
-
83
- return vueComponentsConfig
84
- })
@@ -1,21 +0,0 @@
1
- import type { ConfigEnv, Plugin } from 'vite'
2
- import type { UserConfig } from 'vitepress'
3
-
4
- // import { autoImports, components, cssEngine, inspect, layouts, pages, uiEngine } from '@stacksjs/build'
5
- // import type { ConfigEnv, Plugin, PluginOption } from 'vite'
6
-
7
- export interface StacksPlugin extends Plugin {
8
- config: (config: UserConfig, env: ConfigEnv) => UserConfig
9
- }
10
-
11
- // export default function framework(config: any) {
12
- // return <PluginOption> [
13
- // inspect(config),
14
- // layouts(config),
15
- // components(config),
16
- // pages(config),
17
- // autoImports(config),
18
- // uiEngine(config),
19
- // cssEngine(config),
20
- // ]
21
- // }
File without changes