@stacksjs/buddy 0.58.73 → 0.59.2

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 (57) hide show
  1. package/dist/chunk-d2428b387d843985.js +2016 -0
  2. package/dist/cli.d.ts +1 -0
  3. package/dist/cli.js +23 -9
  4. package/dist/commands/build.d.ts +2 -0
  5. package/dist/commands/changelog.d.ts +2 -0
  6. package/dist/commands/clean.d.ts +2 -0
  7. package/dist/commands/cloud.d.ts +2 -0
  8. package/dist/commands/commit.d.ts +2 -0
  9. package/dist/commands/configure.d.ts +2 -0
  10. package/dist/commands/create.d.ts +2 -0
  11. package/dist/commands/deploy.d.ts +2 -0
  12. package/dist/commands/dev.d.ts +3 -0
  13. package/dist/commands/dns.d.ts +2 -0
  14. package/dist/commands/domains.d.ts +2 -0
  15. package/dist/commands/fresh.d.ts +2 -0
  16. package/dist/commands/generate.d.ts +2 -0
  17. package/dist/commands/http.d.ts +2 -0
  18. package/dist/commands/index.d.ts +31 -0
  19. package/dist/commands/install.d.ts +2 -0
  20. package/dist/commands/key.d.ts +2 -0
  21. package/dist/commands/lint.d.ts +2 -0
  22. package/dist/commands/list.d.ts +2 -0
  23. package/dist/commands/make.d.ts +2 -0
  24. package/dist/commands/migrate.d.ts +2 -0
  25. package/dist/commands/ports.d.ts +2 -0
  26. package/dist/commands/prepublish.d.ts +2 -0
  27. package/dist/commands/projects.d.ts +2 -0
  28. package/dist/commands/release.d.ts +2 -0
  29. package/dist/commands/seed.d.ts +2 -0
  30. package/dist/commands/setup.d.ts +4 -0
  31. package/dist/commands/test.d.ts +2 -0
  32. package/dist/commands/tinker.d.ts +2 -0
  33. package/dist/commands/types.d.ts +2 -0
  34. package/dist/commands/upgrade.d.ts +2 -0
  35. package/dist/commands/version.d.ts +2 -0
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.js +2 -5
  38. package/dist/stacks +0 -0
  39. package/package.json +1 -3
  40. package/src/cli.ts +18 -13
  41. package/src/commands/add.ts +1 -1
  42. package/src/commands/commit.ts +1 -1
  43. package/src/commands/deploy.ts +1 -1
  44. package/src/commands/dev.ts +1 -3
  45. package/src/commands/index.ts +0 -1
  46. package/src/commands/key.ts +1 -1
  47. package/src/commands/list.ts +1 -1
  48. package/src/commands/make.ts +28 -2
  49. package/src/commands/ports.ts +135 -28
  50. package/src/commands/prepublish.ts +1 -1
  51. package/src/commands/projects.ts +2 -3
  52. package/src/commands/setup.ts +1 -0
  53. package/src/commands/types.ts +1 -1
  54. package/dist/chunk-1a569f35f66ae151.js +0 -10945
  55. package/dist/chunk-bf054cfbc9cf2201.js +0 -993
  56. package/src/commands/check.ts +0 -45
  57. /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-1a569f35f66ae151.js";
28
- import"./chunk-0455e53fab4244b1.js";
29
- import"./chunk-bf054cfbc9cf2201.js";
31
+ } from "./chunk-d2428b387d843985.js";
32
+ import"./chunk-970e033f764e29fc.js";
30
33
 
31
34
  // src/cli.ts
32
35
  import process from "process";
33
- import {log} from "@stacksjs/logging";
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 = new CAC("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,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function build(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function changelog(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function clean(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function cloud(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function commit(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function configure(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function create(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function deploy(buddy: CLI): void;
@@ -0,0 +1,3 @@
1
+ import type { CLI, DevOptions } from '@stacksjs/types';
2
+ export declare function dev(buddy: CLI): void;
3
+ export declare function startDevelopmentServer(options: DevOptions): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function dns(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function domains(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function fresh(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import { type CLI } from '@stacksjs/types';
2
+ export declare function generate(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function http(buddy: CLI): void;
@@ -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';
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function install(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function key(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function lint(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function list(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function make(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function migrate(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function ports(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function prepublish(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function projects(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function release(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function seed(buddy: CLI): void;
@@ -0,0 +1,4 @@
1
+ import type { CLI, CliOptions } from '@stacksjs/types';
2
+ export declare function setup(buddy: CLI): void;
3
+ export declare function optimizePkgxDeps(): Promise<void>;
4
+ export declare function ensureEnvIsSet(options: CliOptions): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function test(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function tinker(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function types(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function upgrade(buddy: CLI): void;
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function version(buddy: CLI): void;
@@ -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-1a569f35f66ae151.js";
39
- import"./chunk-0455e53fab4244b1.js";
40
- import"./chunk-bf054cfbc9cf2201.js";
37
+ } from "./chunk-d2428b387d843985.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.58.73",
4
+ "version": "0.59.2",
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 { log } from '@stacksjs/logging'
3
- import { CAC } from 'cac'
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
- // const buddy = cli('buddy')
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
- // cmd.commit(buddy)
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
- // cmd.make(buddy)
53
- // cmd.migrate(buddy)
58
+ cmd.make(buddy)
59
+ cmd.migrate(buddy)
54
60
  cmd.release(buddy)
55
- // cmd.seed(buddy)
61
+ cmd.seed(buddy)
56
62
  cmd.setup(buddy)
57
- // cmd.example(buddy)
58
- // cmd.test(buddy)
63
+ cmd.test(buddy)
59
64
  cmd.version(buddy)
60
- // cmd.prepublish(buddy)
65
+ cmd.prepublish(buddy)
61
66
  cmd.upgrade(buddy)
62
67
 
63
68
  // dynamic imports
@@ -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 'stacks/logging'
5
+ import { log } from '@stacksjs/logging'
6
6
 
7
7
  export function add(buddy: CLI) {
8
8
  const descriptions = {
@@ -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 'stacks/logging'
4
+ import { log } from '@stacksjs/logging'
5
5
 
6
6
  export function commit(buddy: CLI) {
7
7
  const descriptions = {
@@ -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('')
@@ -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...') // in other words, ensure caddy is 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)
@@ -1,6 +1,5 @@
1
1
  export * from './build'
2
2
  export * from './changelog'
3
- export * from './check'
4
3
  export * from './clean'
5
4
  export * from './cloud'
6
5
  export * from './commit'
@@ -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 = {
@@ -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 'stacks/logging'
5
+ import { log } from '@stacksjs/logging'
6
6
 
7
7
  export function list(buddy: CLI) {
8
8
  const descriptions = {
@@ -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 new stack',
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)