Skip to content

Commit 974dc49

Browse files
committed
chore: wip
chore: wip
1 parent 2594bc6 commit 974dc49

File tree

4 files changed

+71
-23
lines changed

4 files changed

+71
-23
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ Stacks helps you every step along the way—in beginner & expert-friendly ways,
2626
2727
<!-- ![Atomic UI & FX Design](./docs/assets/diagram.png) -->
2828

29+
## Get Started
30+
31+
It’s incredibly easy to get started with this framework. Simply run the following command in your terminal:
32+
33+
```bash
34+
sh <(curl stacksjs.org) my-project # wip
35+
36+
# alternatively, if Bun >= v1.0 is installed already,
37+
# you may also get started via:
38+
bunx stacks new my-project
39+
```
40+
2941
## Features
3042

3143
The Stacks framework is a harmony of several “engines” to build any web and/or desktop application, in highly scalable & privacy-friendly ways. It consists of the following engines:
@@ -112,18 +124,6 @@ Develop beautiful, reactive, composable UIs without learning a new set of langua
112124

113125
> _A true rapid application development framework for all Full Stack needs. Next-level simplicity & helpful DX._
114126
115-
## Get Started
116-
117-
It’s incredibly easy to get started with this framework. Simply run the following command in your terminal:
118-
119-
```bash
120-
sh <(curl stacksjs.org) my-project
121-
122-
# alternatively, if Bun >= v1.0 is installed already,
123-
# you may also get started via:
124-
bunx stacks new my-project
125-
```
126-
127127
## 🤖 Usage
128128

129129
The following list includes some of the most common ways to interact with the Stacks API.

bootstrap

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/sh
2+
3+
## To learn more, visit https://stacksjs.org/docs/bootstrap
4+
5+
if [ -n "$1" ]; then
6+
# Check if the directory exists
7+
if [ -d "storage/framework/core" ]; then
8+
:
9+
else
10+
if [ -d "$1" ]; then
11+
echo "Project $1 exists locally. Please use a different name. Bye for now."
12+
exit 1
13+
else
14+
git clone https://github.com/stacksjs/stacks.git $1
15+
cd $1
16+
# Run the pkgx-install script
17+
"./storage/framework/scripts/pkgx-install"
18+
19+
echo "Project $1 has been created. Please open a new terminal, run 'bun run dev' to start the server."
20+
21+
exit 1
22+
fi
23+
fi
24+
fi
25+
26+
# Get the directory of the current script and go up 3 directories
27+
PROJECT_ROOT="$(cd "$(dirname "$0")/../../../" && pwd)"
28+
29+
cd $PROJECT_ROOT
30+
# Run the pkgx-install script
31+
if [[ $* == *--verbose* ]]; then
32+
"./storage/framework/scripts/pkgx-install"
33+
# bun --bun ./storage/framework/core/buddy/src/cli.ts setup --verbose
34+
else
35+
"./storage/framework/scripts/pkgx-install" > /dev/null 2>&1
36+
# bun --bun ./storage/framework/core/buddy/src/cli.ts setup
37+
fi
38+
39+
# Create a named pipe
40+
mkfifo /tmp/mypipe
41+
42+
43+
# Run the command, send output to both the console and the pipe
44+
pkgx bun --bun ./storage/framework/core/buddy/src/cli.ts setup | tee /tmp/mypipe &
45+
46+
# Read from the pipe, add timestamps, and append to the file
47+
while IFS= read -r line; do echo "$(date '+[%Y-%m-%d %H:%M:%S]') $line"; done < /tmp/mypipe >> storage/logs/console.log
48+
49+
# Remove the named pipe
50+
rm /tmp/mypipe

storage/framework/core/cloud/src/cloud/lambda/cli-setup/index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
async function handler() {
2-
const setupScriptContents = `
3-
if [ -n "$1" ]; then
2+
const setupScriptContents = `if [ -n "$1" ]; then
43
# Check if the directory exists
54
if [ -d "storage/framework/core" ]; then
65
:
@@ -35,16 +34,16 @@ else
3534
fi
3635
3736
# Create a named pipe
38-
mkfifo mypipe
37+
mkfifo /tmp/mypipe
3938
4039
# Run the command, send output to both the console and the pipe
41-
pkgx bun --bun ./storage/framework/core/buddy/src/cli.ts setup | tee mypipe &
40+
pkgx bun --bun ./storage/framework/core/buddy/src/cli.ts setup | tee /tmp/mypipe &
4241
4342
# Read from the pipe, add timestamps, and append to the file
44-
while IFS= read -r line; do echo "$(date '+[%Y-%m-%d %H:%M:%S]') $line"; done < mypipe >> storage/logs/console.log
43+
while IFS= read -r line; do echo "$(date '+[%Y-%m-%d %H:%M:%S]') $line"; done < /tmp/mypipe >> storage/logs/console.log
4544
4645
# Remove the named pipe
47-
rm mypipe
46+
rm /tmp/mypipe
4847
`
4948

5049
return {
@@ -56,4 +55,3 @@ rm mypipe
5655
module.exports = {
5756
handler,
5857
}
59-

storage/framework/scripts/setup

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ else
3333
fi
3434

3535
# Create a named pipe
36-
mkfifo mypipe
36+
mkfifo /tmp/mypipe
3737

3838
# Run the command, send output to both the console and the pipe
39-
pkgx bun --bun ./storage/framework/core/buddy/src/cli.ts setup | tee mypipe &
39+
pkgx bun --bun ./storage/framework/core/buddy/src/cli.ts setup | tee /tmp/mypipe &
4040

4141
# Read from the pipe, add timestamps, and append to the file
42-
while IFS= read -r line; do echo "$(date '+[%Y-%m-%d %H:%M:%S]') $line"; done < mypipe >> storage/logs/console.log
42+
while IFS= read -r line; do echo "$(date '+[%Y-%m-%d %H:%M:%S]') $line"; done < /tmp/mypipe >> storage/logs/console.log
4343

4444
# Remove the named pipe
45-
rm mypipe
45+
rm /tmp/mypipe

0 commit comments

Comments
 (0)