Skip to content

Commit 72e0dc9

Browse files
committed
chore: wip
1 parent ba82e83 commit 72e0dc9

File tree

14 files changed

+75
-33
lines changed

14 files changed

+75
-33
lines changed

.stacks/core/cloud/build.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,3 @@ const result = await runCommand('bun build ./src/edge/origin-request.ts --outfil
66

77
if (result.isErr())
88
log.error(result.error)
9-
10-
const result2 = await runCommand('zip -r dist.zip dist/origin-request.js package.json', {
11-
cwd: import.meta.dir,
12-
})
13-
14-
if (result2.isErr())
15-
log.error(result2.error)

.stacks/core/cloud/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"build-edge": "bun build ./src/edge/origin-request.ts --outfile ./dist/origin-request.js",
5050
"build-layer": "bun ./src/runtime/scripts/build-layer.ts",
5151
"publish-layer": "bun ./src/runtime/scripts/publish-layer.ts",
52-
"build-server": "bun --bun build-server.ts",
52+
"build-server": "echo 'bun --bun build-server.ts'",
5353
"typecheck": "bun --bun tsc --noEmit",
5454
"prepublishOnly": "bun run build"
5555
},
@@ -108,6 +108,7 @@
108108
},
109109
"devDependencies": {
110110
"@oclif/plugin-plugins": "^4.1.8",
111+
"@stacksjs/cli": "workspace:*",
111112
"@stacksjs/development": "workspace:*",
112113
"@stacksjs/env": "workspace:*",
113114
"jszip": "^3.10.1",

.stacks/core/cloud/zip.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { log, runCommand } from '@stacksjs/cli'
2+
3+
const result = await runCommand('zip -r dist.zip dist/origin-request.js package.json', {
4+
cwd: import.meta.dir,
5+
})
6+
7+
if (result.isErr())
8+
log.error(result.error)

.stacks/core/env/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { log, runCommand } from '@stacksjs/cli'
22

3-
const result = await runCommand('bun build ./src/index.ts --external vite --external @stacksjs/path --external @stacksjs/validation --outdir dist --format esm', {
3+
const result = await runCommand('bun build ./src/index.ts --external @stacksjs/storage --external node:process --external @stacksjs/path --external @stacksjs/validation --outdir dist --format esm --target bun', {
44
cwd: import.meta.dir,
55
})
66

.stacks/core/env/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { readFileSync, writeFileSync } from 'node:fs'
1+
import { fs } from '@stacksjs/storage'
22
import p from 'node:process'
3-
import type { Env } from '@stacksjs/env'
3+
import type { Env } from './types'
44
import { projectPath } from '@stacksjs/path'
55
import { ValidationBoolean, ValidationEnum, ValidationNumber } from '@stacksjs/validation'
66
import type { EnvKey } from '~/storage/framework/stacks/env'
@@ -53,7 +53,7 @@ export const env: Env = new Proxy(process(), handler)
5353

5454
export function writeEnv(key: EnvKey, value: string, options?: { path: string }) {
5555
const envPath = options?.path || projectPath('.env')
56-
const env = readFileSync(envPath, 'utf-8')
56+
const env = fs.readFileSync(envPath, 'utf-8')
5757

5858
// Split the file into lines
5959
const lines = env.split('\n')
@@ -70,7 +70,7 @@ export function writeEnv(key: EnvKey, value: string, options?: { path: string })
7070
lines.push(`${key}=${value}`)
7171

7272
// Join the lines back into a string and write it to the .env file
73-
writeFileSync(envPath, lines.join('\n'))
73+
fs.writeFileSync(envPath, lines.join('\n'))
7474
}
7575

7676
export * from './types'

.stacks/core/path/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"prepublishOnly": "bun --bun run build"
4646
},
4747
"dependencies": {
48+
"@stacksjs/validation": "workspace:*",
4849
"pathe": "^1.1.1"
4950
},
5051
"devDependencies": {

.stacks/core/path/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import process from 'node:process'
22
import { basename, delimiter, dirname, extname, format, isAbsolute, join, normalize, normalizeString, parse, relative, resolve, sep, toNamespacedPath } from 'pathe'
33

4+
// also exported in stacks/validation
5+
const isBrowser = typeof window !== 'undefined'
6+
47
/**
58
* Returns the path to the `actions` directory. The actions directory
69
* contains the core Stacks' actions. An action

.stacks/scripts/build

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ for dir in $dirs; do
2222
cd $dir
2323

2424
# Check if the directory is one of the two specified
25-
## This is because eslint requires cjs builds which we use unbuild for
25+
## This is because eslint requires cjs builds which we use tsup for
2626
case "$dir" in
2727
*"/eslint-config")
28-
# Run the bun unbuild command
28+
# build the package
2929
bun run build
3030
;;
3131
*)
@@ -39,12 +39,12 @@ for dir in $dirs; do
3939

4040
# Check if build-server.ts exists in the directory
4141
# the cloud package needs this check
42-
if [ -f "build-server.ts" ]; then
43-
# Extract the command from build-server.ts
44-
cmd=$(sed -nE "s/.*runCommand\('(.*)',.*/\1/p" build-server.ts)
45-
# Run the extracted command
46-
eval $cmd
47-
fi
42+
# if [ -f "build-server.ts" ]; then
43+
# # Extract the command from build-server.ts
44+
# cmd=$(sed -nE "s/.*runCommand\('(.*)',.*/\1/p" build-server.ts)
45+
# # Run the extracted command
46+
# eval $cmd
47+
# fi
4848
;;
4949
esac
5050

.stacks/scripts/setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ fi
157157

158158
eval "$(pkgx integrate)"
159159

160-
# todo: need to check if this repo already exists
160+
# todo: need to check if this repo already exists locally
161161
git clone https://github.com/stacksjs/stacks.git $1
162162

163163
cd $1

bun.lockb

56 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)