Skip to content

Commit ed628d0

Browse files
committed
chore: wip
1 parent 85e1e36 commit ed628d0

File tree

15 files changed

+43
-106
lines changed

15 files changed

+43
-106
lines changed

app/Scheduler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { schedule } from '@stacksjs/scheduler'
1+
import process from 'node:process'
2+
import { schedule } from '@stacksjs/scheduler'
23

34
/**
45
* **Scheduler**
@@ -12,6 +13,6 @@ export default function () {
1213
schedule.action('name').everyFiveMinutes()
1314
}
1415

15-
process.on('SIGINT', function () {
16+
process.on('SIGINT', () => {
1617
schedule.gracefulShutdown().then(() => process.exit(0))
1718
})

bun.lockb

2.72 KB
Binary file not shown.

pkgx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
dependencies:
33
aws.amazon.com/cli: ^2.13.7
44
bun.sh: ^1.0.29
5-
caddyserver.com: ^2.7.4
65
dns.lookup.dog: ^0.1.0
76
info-zip.org/zip: ^3.0
87
info-zip.org/unzip: ^6.0
@@ -14,3 +13,4 @@ dependencies:
1413
stedolan.github.io/jq: ^1.7
1514
httpie.io: ^3.2.2
1615
rust-lang.org: ^1.74.1 # optional, for certain dev purposes only
16+
mozilla.org/nss: ^3.92.0 # only needed for certutil, so the CA can be automatically installed in Firefox

storage/framework/Caddyfile

Lines changed: 0 additions & 31 deletions
This file was deleted.

storage/framework/core/actions/src/generate/caddyfile.ts

Lines changed: 0 additions & 44 deletions
This file was deleted.

storage/framework/core/actions/src/start-caddy.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

storage/framework/core/buddy/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ await Bun.build({
2727
'@stacksjs/storage',
2828
'@stacksjs/types',
2929
'@aws-sdk/client-route-53',
30+
'bun',
3031
],
3132

3233
plugins: [

storage/framework/core/buddy/src/commands/dev.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,14 @@ export function dev(buddy: CLI) {
5252

5353
const perf = await intro('buddy dev')
5454

55-
// log.info('Ensuring web server/s running...') // in other words, ensure caddy is running
55+
// log.info('Ensuring web server/s running...')
5656

5757
// // check if port 443 is open
5858
// const result = await runCommand('lsof -i :443', { silent: true })
5959

6060
// if (result.isErr())
6161
// log.warn('While checking if port 443 is open, we noticed it may be in use')
6262

63-
// runAction(Action.StartCaddy, { ...options, silent: true })
64-
6563
switch (server) {
6664
case 'frontend':
6765
await runFrontendDevServer(options)

storage/framework/core/buddy/src/commands/make.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import {
1010
makePage,
1111
makeStack,
1212
} from '@stacksjs/actions'
13-
import { intro, italic, outro } from '@stacksjs/cli'
13+
import { intro, italic, outro, runCommand } from '@stacksjs/cli'
14+
import { localUrl } from '@stacksjs/config'
15+
import { path as p } from '@stacksjs/path'
1416
import { log } from '@stacksjs/logging'
1517
import type { CLI, MakeOptions } from '@stacksjs/types'
1618
import { ExitCode } from '@stacksjs/types'
@@ -26,7 +28,8 @@ export function make(buddy: CLI) {
2628
migration: 'Create a new migration',
2729
factory: 'Create a new factory',
2830
notification: 'Create a new notification',
29-
stack: 'Create a new new stack',
31+
stack: 'Create a new stack',
32+
certificate: 'Create a new SSL Certificate',
3033
select: 'What are you trying to make?',
3134
project: 'Target a specific project',
3235
verbose: 'Enable verbose output',
@@ -280,6 +283,29 @@ export function make(buddy: CLI) {
280283
log.info(path, name)
281284
})
282285

286+
buddy
287+
.command('make:certificate', descriptions.certificate)
288+
.alias('make:cert')
289+
.example('buddy make:certificate')
290+
.action(async (options: MakeOptions) => {
291+
log.debug('Running `buddy make:certificate` ...', options)
292+
293+
const domain = await localUrl()
294+
log.info(`Creating SSL certificate...`)
295+
296+
await runCommand(`mkcert ${domain}`, {
297+
cwd: p.projectStoragePath('keys'),
298+
})
299+
300+
log.success('Certificate created')
301+
302+
log.info(`Installing SSL certificate...`)
303+
await runCommand(`mkcert -install`, {
304+
cwd: p.projectStoragePath('keys'),
305+
})
306+
log.success('Certificate installed')
307+
})
308+
283309
buddy.on('make:*', () => {
284310
console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
285311
process.exit(1)

storage/framework/core/enums/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export enum Action {
8686
Prepublish = 'prepublish',
8787
Release = 'release', // ✅
8888
ShowFeatureTestReport = 'show-feature-test-report',
89-
StartCaddy = 'start-caddy',
9089
Test = 'test',
9190
TestUi = 'test-ui',
9291
TestUnit = 'test-unit',

0 commit comments

Comments
 (0)