@stacksjs/buddy 0.58.73 → 0.59.1
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.
- package/dist/chunk-32440b2561f1e29c.js +2015 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +23 -9
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/changelog.d.ts +2 -0
- package/dist/commands/clean.d.ts +2 -0
- package/dist/commands/cloud.d.ts +2 -0
- package/dist/commands/commit.d.ts +2 -0
- package/dist/commands/configure.d.ts +2 -0
- package/dist/commands/create.d.ts +2 -0
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dns.d.ts +2 -0
- package/dist/commands/domains.d.ts +2 -0
- package/dist/commands/fresh.d.ts +2 -0
- package/dist/commands/generate.d.ts +2 -0
- package/dist/commands/http.d.ts +2 -0
- package/dist/commands/index.d.ts +31 -0
- package/dist/commands/install.d.ts +2 -0
- package/dist/commands/key.d.ts +2 -0
- package/dist/commands/lint.d.ts +2 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/make.d.ts +2 -0
- package/dist/commands/migrate.d.ts +2 -0
- package/dist/commands/ports.d.ts +2 -0
- package/dist/commands/prepublish.d.ts +2 -0
- package/dist/commands/projects.d.ts +2 -0
- package/dist/commands/release.d.ts +2 -0
- package/dist/commands/seed.d.ts +2 -0
- package/dist/commands/setup.d.ts +4 -0
- package/dist/commands/test.d.ts +2 -0
- package/dist/commands/tinker.d.ts +2 -0
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/upgrade.d.ts +2 -0
- package/dist/commands/version.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -5
- package/dist/stacks +0 -0
- package/package.json +1 -3
- package/src/cli.ts +18 -13
- package/src/commands/add.ts +1 -1
- package/src/commands/commit.ts +1 -1
- package/src/commands/deploy.ts +1 -1
- package/src/commands/dev.ts +1 -3
- package/src/commands/index.ts +0 -1
- package/src/commands/key.ts +1 -1
- package/src/commands/list.ts +1 -1
- package/src/commands/make.ts +28 -2
- package/src/commands/ports.ts +135 -28
- package/src/commands/prepublish.ts +1 -1
- package/src/commands/projects.ts +2 -3
- package/src/commands/types.ts +1 -1
- package/dist/chunk-1a569f35f66ae151.js +0 -10945
- package/dist/chunk-bf054cfbc9cf2201.js +0 -993
- package/src/commands/check.ts +0 -45
- /package/dist/{chunk-0455e53fab4244b1.js → chunk-970e033f764e29fc.js} +0 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
CAC,
|
|
4
3
|
build,
|
|
5
4
|
changelog,
|
|
6
|
-
check,
|
|
7
5
|
clean,
|
|
8
6
|
cloud,
|
|
7
|
+
commit,
|
|
9
8
|
configure,
|
|
10
9
|
deploy,
|
|
11
10
|
dev,
|
|
@@ -18,32 +17,42 @@ install,
|
|
|
18
17
|
key,
|
|
19
18
|
lint,
|
|
20
19
|
list,
|
|
20
|
+
make,
|
|
21
|
+
migrate,
|
|
21
22
|
ports,
|
|
23
|
+
prepublish,
|
|
22
24
|
projects,
|
|
23
25
|
release,
|
|
26
|
+
seed,
|
|
24
27
|
setup,
|
|
28
|
+
test,
|
|
25
29
|
upgrade,
|
|
26
30
|
version
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import"./chunk-
|
|
29
|
-
import"./chunk-bf054cfbc9cf2201.js";
|
|
31
|
+
} from "./chunk-32440b2561f1e29c.js";
|
|
32
|
+
import"./chunk-970e033f764e29fc.js";
|
|
30
33
|
|
|
31
34
|
// src/cli.ts
|
|
32
35
|
import process from "process";
|
|
33
|
-
import {log} from "@stacksjs/
|
|
36
|
+
import {cli as cli2, log} from "@stacksjs/cli";
|
|
34
37
|
import {ensureProjectIsInitialized} from "@stacksjs/utils";
|
|
35
38
|
import {path as p} from "@stacksjs/path";
|
|
36
39
|
import {fs} from "@stacksjs/storage";
|
|
37
40
|
async function main() {
|
|
38
|
-
const buddy =
|
|
41
|
+
const buddy = cli2("buddy");
|
|
39
42
|
setup(buddy);
|
|
40
43
|
key(buddy);
|
|
41
|
-
await ensureProjectIsInitialized();
|
|
44
|
+
const isAppKeySet = await ensureProjectIsInitialized();
|
|
45
|
+
if (isAppKeySet) {
|
|
46
|
+
log.info("Project is initialized");
|
|
47
|
+
} else {
|
|
48
|
+
log.warn("Your `APP_KEY` is not yet");
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
42
51
|
build(buddy);
|
|
43
52
|
changelog(buddy);
|
|
44
|
-
check(buddy);
|
|
45
53
|
clean(buddy);
|
|
46
54
|
cloud(buddy);
|
|
55
|
+
commit(buddy);
|
|
47
56
|
configure(buddy);
|
|
48
57
|
dev(buddy);
|
|
49
58
|
domains(buddy);
|
|
@@ -57,9 +66,14 @@ async function main() {
|
|
|
57
66
|
install(buddy);
|
|
58
67
|
lint(buddy);
|
|
59
68
|
list(buddy);
|
|
69
|
+
make(buddy);
|
|
70
|
+
migrate(buddy);
|
|
60
71
|
release(buddy);
|
|
72
|
+
seed(buddy);
|
|
61
73
|
setup(buddy);
|
|
74
|
+
test(buddy);
|
|
62
75
|
version(buddy);
|
|
76
|
+
prepublish(buddy);
|
|
63
77
|
upgrade(buddy);
|
|
64
78
|
await dynamicImports(buddy);
|
|
65
79
|
buddy.help();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from './build';
|
|
2
|
+
export * from './changelog';
|
|
3
|
+
export * from './clean';
|
|
4
|
+
export * from './cloud';
|
|
5
|
+
export * from './commit';
|
|
6
|
+
export * from './configure';
|
|
7
|
+
export * from './create';
|
|
8
|
+
export * from './deploy';
|
|
9
|
+
export * from './dev';
|
|
10
|
+
export * from './domains';
|
|
11
|
+
export * from './dns';
|
|
12
|
+
export * from './fresh';
|
|
13
|
+
export * from './generate';
|
|
14
|
+
export * from './http';
|
|
15
|
+
export * from './lint';
|
|
16
|
+
export * from './list';
|
|
17
|
+
export * from './install';
|
|
18
|
+
export * from './key';
|
|
19
|
+
export * from './make';
|
|
20
|
+
export * from './migrate';
|
|
21
|
+
export * from './ports';
|
|
22
|
+
export * from './prepublish';
|
|
23
|
+
export * from './projects';
|
|
24
|
+
export * from './release';
|
|
25
|
+
export * from './seed';
|
|
26
|
+
export * from './setup';
|
|
27
|
+
export * from './test';
|
|
28
|
+
export * from './tinker';
|
|
29
|
+
export * from './types';
|
|
30
|
+
export * from './upgrade';
|
|
31
|
+
export * from './version';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './commands';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import {
|
|
3
3
|
build,
|
|
4
4
|
changelog,
|
|
5
|
-
check,
|
|
6
5
|
clean,
|
|
7
6
|
cloud,
|
|
8
7
|
commit,
|
|
@@ -35,9 +34,8 @@ tinker,
|
|
|
35
34
|
types,
|
|
36
35
|
upgrade,
|
|
37
36
|
version
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import"./chunk-
|
|
40
|
-
import"./chunk-bf054cfbc9cf2201.js";
|
|
37
|
+
} from "./chunk-32440b2561f1e29c.js";
|
|
38
|
+
import"./chunk-970e033f764e29fc.js";
|
|
41
39
|
export {
|
|
42
40
|
version,
|
|
43
41
|
upgrade,
|
|
@@ -71,7 +69,6 @@ export {
|
|
|
71
69
|
commit,
|
|
72
70
|
cloud,
|
|
73
71
|
clean,
|
|
74
|
-
check,
|
|
75
72
|
changelog,
|
|
76
73
|
build
|
|
77
74
|
};
|
package/dist/stacks
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.59.1",
|
|
5
5
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -107,7 +107,6 @@
|
|
|
107
107
|
"@stacksjs/search-engine": "latest",
|
|
108
108
|
"@stacksjs/security": "latest",
|
|
109
109
|
"@stacksjs/server": "latest",
|
|
110
|
-
"@stacksjs/signals": "latest",
|
|
111
110
|
"@stacksjs/storage": "latest",
|
|
112
111
|
"@stacksjs/strings": "latest",
|
|
113
112
|
"@stacksjs/testing": "latest",
|
|
@@ -153,7 +152,6 @@
|
|
|
153
152
|
"@stacksjs/search-engine": "latest",
|
|
154
153
|
"@stacksjs/security": "latest",
|
|
155
154
|
"@stacksjs/server": "latest",
|
|
156
|
-
"@stacksjs/signals": "latest",
|
|
157
155
|
"@stacksjs/storage": "latest",
|
|
158
156
|
"@stacksjs/strings": "latest",
|
|
159
157
|
"@stacksjs/testing": "latest",
|
package/src/cli.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { CAC } from '@stacksjs/cli'
|
|
3
|
+
import { cli, log } from '@stacksjs/cli'
|
|
4
4
|
import { ensureProjectIsInitialized } from '@stacksjs/utils'
|
|
5
5
|
import { path as p } from '@stacksjs/path'
|
|
6
6
|
import { fs } from '@stacksjs/storage'
|
|
@@ -20,22 +20,28 @@ process.on('unhandledRejection', (error: Error) => {
|
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
async function main() {
|
|
23
|
-
|
|
24
|
-
const buddy = new CAC('buddy')
|
|
23
|
+
const buddy = cli('buddy')
|
|
25
24
|
|
|
26
25
|
// the following commands are not dependent on the project being initialized
|
|
27
26
|
cmd.setup(buddy)
|
|
28
27
|
cmd.key(buddy)
|
|
29
28
|
|
|
30
29
|
// before running any commands, ensure the project is already initialized
|
|
31
|
-
await ensureProjectIsInitialized()
|
|
30
|
+
const isAppKeySet = await ensureProjectIsInitialized()
|
|
31
|
+
if (isAppKeySet) {
|
|
32
|
+
log.info('Project is initialized')
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
log.warn('Your `APP_KEY` is not yet')
|
|
36
|
+
// TODO: add prompt to set the key
|
|
37
|
+
process.exit(1)
|
|
38
|
+
}
|
|
32
39
|
|
|
33
40
|
cmd.build(buddy)
|
|
34
41
|
cmd.changelog(buddy)
|
|
35
|
-
cmd.check(buddy)
|
|
36
42
|
cmd.clean(buddy)
|
|
37
43
|
cmd.cloud(buddy)
|
|
38
|
-
|
|
44
|
+
cmd.commit(buddy)
|
|
39
45
|
cmd.configure(buddy)
|
|
40
46
|
cmd.dev(buddy)
|
|
41
47
|
cmd.domains(buddy)
|
|
@@ -49,15 +55,14 @@ async function main() {
|
|
|
49
55
|
cmd.install(buddy)
|
|
50
56
|
cmd.lint(buddy)
|
|
51
57
|
cmd.list(buddy)
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
cmd.make(buddy)
|
|
59
|
+
cmd.migrate(buddy)
|
|
54
60
|
cmd.release(buddy)
|
|
55
|
-
|
|
61
|
+
cmd.seed(buddy)
|
|
56
62
|
cmd.setup(buddy)
|
|
57
|
-
|
|
58
|
-
// cmd.test(buddy)
|
|
63
|
+
cmd.test(buddy)
|
|
59
64
|
cmd.version(buddy)
|
|
60
|
-
|
|
65
|
+
cmd.prepublish(buddy)
|
|
61
66
|
cmd.upgrade(buddy)
|
|
62
67
|
|
|
63
68
|
// dynamic imports
|
package/src/commands/add.ts
CHANGED
|
@@ -2,7 +2,7 @@ import process from 'node:process'
|
|
|
2
2
|
import type { AddOptions, BuildOptions, CLI } from '@stacksjs/types'
|
|
3
3
|
import { ExitCode } from '@stacksjs/types'
|
|
4
4
|
import { runAdd } from '@stacksjs/actions'
|
|
5
|
-
import { log } from '
|
|
5
|
+
import { log } from '@stacksjs/logging'
|
|
6
6
|
|
|
7
7
|
export function add(buddy: CLI) {
|
|
8
8
|
const descriptions = {
|
package/src/commands/commit.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
2
|
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
3
3
|
import { runCommit } from '@stacksjs/actions'
|
|
4
|
-
import { log } from '
|
|
4
|
+
import { log } from '@stacksjs/logging'
|
|
5
5
|
|
|
6
6
|
export function commit(buddy: CLI) {
|
|
7
7
|
const descriptions = {
|
package/src/commands/deploy.ts
CHANGED
|
@@ -69,7 +69,7 @@ async function configureDomain(domain: string, options: DeployOptions, startTime
|
|
|
69
69
|
// TODO: add check for whether the local APP_ENV is getting deployed, if so, ask if the user meant to deploy `dev`
|
|
70
70
|
if (domain.includes('localhost')) {
|
|
71
71
|
log.info('You are deploying to a local environment.')
|
|
72
|
-
log.info('Please set your .env or ./config/app.ts properly.')
|
|
72
|
+
log.info('Please set your .env or ./config/app.ts properly. The domain we are deploying cannot be a `localhost` domain.')
|
|
73
73
|
console.log('')
|
|
74
74
|
log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
|
|
75
75
|
console.log('')
|
package/src/commands/dev.ts
CHANGED
|
@@ -52,7 +52,7 @@ export function dev(buddy: CLI) {
|
|
|
52
52
|
|
|
53
53
|
const perf = await intro('buddy dev')
|
|
54
54
|
|
|
55
|
-
// log.info('Ensuring web server/s running...')
|
|
55
|
+
// log.info('Ensuring web server/s running...')
|
|
56
56
|
|
|
57
57
|
// // check if port 443 is open
|
|
58
58
|
// const result = await runCommand('lsof -i :443', { silent: true })
|
|
@@ -60,8 +60,6 @@ export function dev(buddy: CLI) {
|
|
|
60
60
|
// if (result.isErr())
|
|
61
61
|
// log.warn('While checking if port 443 is open, we noticed it may be in use')
|
|
62
62
|
|
|
63
|
-
// runAction(Action.StartCaddy, { ...options, silent: true })
|
|
64
|
-
|
|
65
63
|
switch (server) {
|
|
66
64
|
case 'frontend':
|
|
67
65
|
await runFrontendDevServer(options)
|
package/src/commands/index.ts
CHANGED
package/src/commands/key.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
2
|
import type { CLI, KeyOptions } from '@stacksjs/types'
|
|
3
3
|
import { intro, log, outro } from '@stacksjs/cli'
|
|
4
|
-
import { Action } from '@stacksjs/enums'
|
|
5
4
|
import { runAction } from '@stacksjs/actions'
|
|
5
|
+
import { Action } from '@stacksjs/enums'
|
|
6
6
|
|
|
7
7
|
export function key(buddy: CLI) {
|
|
8
8
|
const descriptions = {
|
package/src/commands/list.ts
CHANGED
|
@@ -2,7 +2,7 @@ import process from 'node:process'
|
|
|
2
2
|
import type { CLI, CliOptions } from '@stacksjs/types'
|
|
3
3
|
import { $ } from 'bun'
|
|
4
4
|
import { projectPath } from '@stacksjs/path'
|
|
5
|
-
import { log } from '
|
|
5
|
+
import { log } from '@stacksjs/logging'
|
|
6
6
|
|
|
7
7
|
export function list(buddy: CLI) {
|
|
8
8
|
const descriptions = {
|
package/src/commands/make.ts
CHANGED
|
@@ -10,7 +10,9 @@ import {
|
|
|
10
10
|
makePage,
|
|
11
11
|
makeStack,
|
|
12
12
|
} 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'
|
|
14
16
|
import { log } from '@stacksjs/logging'
|
|
15
17
|
import type { CLI, MakeOptions } from '@stacksjs/types'
|
|
16
18
|
import { ExitCode } from '@stacksjs/types'
|
|
@@ -26,7 +28,8 @@ export function make(buddy: CLI) {
|
|
|
26
28
|
migration: 'Create a new migration',
|
|
27
29
|
factory: 'Create a new factory',
|
|
28
30
|
notification: 'Create a new notification',
|
|
29
|
-
stack: 'Create a new
|
|
31
|
+
stack: 'Create a new stack',
|
|
32
|
+
certificate: 'Create a new SSL Certificate',
|
|
30
33
|
select: 'What are you trying to make?',
|
|
31
34
|
project: 'Target a specific project',
|
|
32
35
|
verbose: 'Enable verbose output',
|
|
@@ -280,6 +283,29 @@ export function make(buddy: CLI) {
|
|
|
280
283
|
log.info(path, name)
|
|
281
284
|
})
|
|
282
285
|
|
|
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
|
+
|
|
283
309
|
buddy.on('make:*', () => {
|
|
284
310
|
console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
|
|
285
311
|
process.exit(1)
|