stacks 0.44.11 → 0.45.0
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/README.md +4 -3
- package/buddy/README.md +4 -3
- package/buddy/package.json +7 -6
- package/buddy/src/commands/add.ts +12 -12
- package/buddy/src/commands/build.ts +55 -31
- package/buddy/src/commands/clean.ts +6 -6
- package/buddy/src/commands/commit.ts +6 -6
- package/buddy/src/commands/create.ts +14 -14
- package/buddy/src/commands/dev.ts +15 -15
- package/buddy/src/commands/example.ts +11 -11
- package/buddy/src/commands/fresh.ts +21 -10
- package/buddy/src/commands/generate.ts +20 -20
- package/buddy/src/commands/key.ts +2 -2
- package/buddy/src/commands/lint.ts +29 -11
- package/buddy/src/commands/make.ts +33 -33
- package/buddy/src/commands/preinstall.ts +6 -6
- package/buddy/src/commands/prepublish.ts +6 -6
- package/buddy/src/commands/release.ts +4 -4
- package/buddy/src/commands/setup.ts +8 -8
- package/buddy/src/commands/test.ts +11 -11
- package/buddy/src/commands/types.ts +8 -8
- package/buddy/src/commands/update.ts +20 -20
- package/buddy/src/index.ts +1 -0
- package/core/actions/package.json +2 -2
- package/core/actions/src/build-component-libs.ts +15 -0
- package/core/actions/src/build-core.ts +7 -0
- package/core/actions/src/build-stacks.ts +9 -0
- package/core/actions/src/bump.ts +10 -0
- package/core/actions/src/fix-lint-issues.ts +4 -0
- package/core/actions/src/fresh.ts +6 -26
- package/core/actions/src/{generate-package-json.ts → generate-package-jsons.ts} +0 -0
- package/core/actions/src/generate.ts +5 -5
- package/core/actions/src/helpers/lib-entries.ts +1 -1
- package/core/actions/src/helpers/package-json.ts +1 -1
- package/core/actions/src/helpers/utils.ts +31 -6
- package/core/actions/src/lint-fix.ts +8 -0
- package/core/actions/src/lint.ts +6 -30
- package/core/actions/src/make.ts +8 -8
- package/core/actions/src/release.ts +9 -28
- package/core/ai/package.json +1 -1
- package/core/alias/package.json +1 -1
- package/core/arrays/package.json +1 -1
- package/core/auth/package.json +1 -1
- package/core/build/node_modules/.bin/vite +2 -2
- package/core/build/node_modules/.bin/vite-ssg +2 -2
- package/core/build/package.json +3 -3
- package/core/cache/package.json +2 -2
- package/core/cache/tests/Redis.test.ts +0 -1
- package/core/cli/package.json +1 -1
- package/core/cli/src/actions/run.ts +24 -11
- package/core/cli/src/helpers.ts +6 -6
- package/core/cloud/package.json +1 -1
- package/core/collections/package.json +1 -1
- package/core/config/package.json +1 -1
- package/core/dashboard/package.json +1 -1
- package/core/database/package.json +2 -2
- package/core/datetime/package.json +1 -1
- package/core/desktop/package.json +1 -1
- package/core/docs/node_modules/.bin/vitepress +2 -2
- package/core/docs/package.json +2 -2
- package/core/domains/package.json +1 -1
- package/core/drivers/package.json +1 -1
- package/core/email/package.json +1 -1
- package/core/error-handling/package.json +2 -2
- package/core/git/package.json +1 -1
- package/core/{cloud/dist/actions → health}/README.md +11 -8
- package/core/health/node_modules/.bin/mkdist +17 -0
- package/core/health/node_modules/.bin/tsc +17 -0
- package/core/health/node_modules/.bin/tsserver +17 -0
- package/core/health/package.json +54 -0
- package/core/health/src/drivers/ohdear.ts +1 -0
- package/core/health/src/index.ts +1 -0
- package/core/health/src/notifications/index.ts +1 -0
- package/core/{notifications → health}/tests/example.test.ts +0 -0
- package/core/lint/node_modules/.bin/eslint +2 -2
- package/core/lint/package.json +3 -3
- package/core/logging/package.json +1 -1
- package/core/modules/package.json +1 -1
- package/core/modules/src/nprogress.ts +3 -1
- package/core/notifications/README.md +205 -30
- package/core/notifications/package.json +1 -1
- package/core/notifications/src/drivers/chat/slack.ts +1 -1
- package/core/notifications/src/drivers/email/actions/send.ts +1 -1
- package/core/notifications/src/drivers/push/expo.ts +19 -0
- package/core/notifications/src/drivers/push/fcm.ts +19 -0
- package/core/notifications/src/index.ts +17 -22
- package/core/notifications/tests/chat/Slack.test.ts +12 -2
- package/core/notifications/tests/email/Mailgun.test.ts +14 -3
- package/core/notifications/tests/email/Sendgrid.test.ts +15 -4
- package/core/notifications/tests/sms/Twilio.test.ts +13 -2
- package/core/objects/package.json +1 -1
- package/core/path/package.json +1 -1
- package/core/payments/package.json +1 -1
- package/core/realtime/package.json +1 -1
- package/core/router/package.json +1 -1
- package/core/search-engine/package.json +2 -2
- package/core/security/package.json +1 -1
- package/core/server/node_modules/.bin/vite +2 -2
- package/core/server/package.json +2 -2
- package/core/storage/package.json +1 -1
- package/core/strings/package.json +1 -1
- package/core/testing/node_modules/.bin/mkdist +2 -2
- package/core/testing/node_modules/.bin/vitest +2 -2
- package/core/testing/package.json +5 -5
- package/core/types/node_modules/.bin/vitepress +2 -2
- package/core/types/package.json +4 -4
- package/core/types/src/cli.ts +33 -3
- package/core/types/src/notifications.ts +161 -0
- package/core/ui/node_modules/.bin/vue-tsc +2 -2
- package/core/ui/package.json +2 -2
- package/core/utils/package.json +5 -5
- package/core/utils/src/helpers.ts +1 -1
- package/core/x-ray/package.json +1 -1
- package/core/x-ray/src/desktop/app.vue +0 -1
- package/core/x-ray/src/ray.config.js +1 -0
- package/core/x-ray/src/types.ts +1 -0
- package/package.json +8 -8
- package/tsconfig.json +2 -2
- package/components/vue/dist/.gitkeep +0 -0
- package/components/web/dist/.gitkeep +0 -0
- package/core/actions/test.ts +0 -10
package/README.md
CHANGED
|
@@ -53,12 +53,12 @@ _Develop serverless (or server) functions with countless helpers to build scalab
|
|
|
53
53
|
- 📢 **Notifications** _emails, SMSs, direct, and push notifications & webhooks_
|
|
54
54
|
- 💳 **Payments** _unified API for one-off & subscription billing methods for Stripe_
|
|
55
55
|
- ⚙️ **Queues** _run your heavy workload in the background_
|
|
56
|
-
-
|
|
56
|
+
- 💬 **Realtime** _"everything you need to build dynamic real-time apps"_
|
|
57
57
|
- 🧭 **Router** _smart routing, file-based or Laravel-like_
|
|
58
58
|
- 🔎 **Search Engine** _smart searching, advanced filtering & sorting, pagination, headless UI_
|
|
59
59
|
- 💾 **Storage** _easily create & make use of local & remote storages/file systems_
|
|
60
60
|
- 🌪️ **Validation** _e2e type-safety (frontend knows what the backend knows)_
|
|
61
|
-
-
|
|
61
|
+
- 🎯 **X-Ray** _all you need to debug, log & analyze_
|
|
62
62
|
|
|
63
63
|
### Stacks Cloud
|
|
64
64
|
|
|
@@ -91,6 +91,7 @@ _Enhanced productivity for developers. No more creating boilerplate._
|
|
|
91
91
|
- ✨ **Git Workflows** _committing with ease_
|
|
92
92
|
- 🚗 **Auto Imports** _your components & functions, including date, string, array, & object helpers_
|
|
93
93
|
- ⏩ **Code Snippets** _say goodbye to the boilerplate_
|
|
94
|
+
- 🔤 **Spell Checker** _be notified once when there are typos_
|
|
94
95
|
- 🛠️ **Utilities** _Collections, VueUse, and more_
|
|
95
96
|
- 🧪 **Testing** _unit & e2e tests powered by Vitest & Playwright_
|
|
96
97
|
|
|
@@ -407,7 +408,7 @@ Made with ❤️
|
|
|
407
408
|
[npm-downloads-src]: https://img.shields.io/npm/dm/stacks?style=flat-square
|
|
408
409
|
[npm-downloads-href]: https://npmjs.com/package/stacks
|
|
409
410
|
|
|
410
|
-
[github-actions-src]: https://img.shields.io/github/workflow/status/stacksjs/stacks/
|
|
411
|
+
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/stacks/ci.yml?style=flat-square&branch=main
|
|
411
412
|
[github-actions-href]: https://github.com/stacksjs/stacks/actions?query=workflow%3Aci
|
|
412
413
|
|
|
413
414
|
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/stacks/main?style=flat-square
|
package/buddy/README.md
CHANGED
|
@@ -53,12 +53,12 @@ _Develop serverless (or server) functions with countless helpers to build scalab
|
|
|
53
53
|
- 📢 **Notifications** _emails, SMSs, direct, and push notifications & webhooks_
|
|
54
54
|
- 💳 **Payments** _unified API for one-off & subscription billing methods for Stripe_
|
|
55
55
|
- ⚙️ **Queues** _run your heavy workload in the background_
|
|
56
|
-
-
|
|
56
|
+
- 💬 **Realtime** _"everything you need to build dynamic real-time apps"_
|
|
57
57
|
- 🧭 **Router** _smart routing, file-based or Laravel-like_
|
|
58
58
|
- 🔎 **Search Engine** _smart searching, advanced filtering & sorting, pagination, headless UI_
|
|
59
59
|
- 💾 **Storage** _easily create & make use of local & remote storages/file systems_
|
|
60
60
|
- 🌪️ **Validation** _e2e type-safety (frontend knows what the backend knows)_
|
|
61
|
-
-
|
|
61
|
+
- 🎯 **X-Ray** _all you need to debug, log & analyze_
|
|
62
62
|
|
|
63
63
|
### Stacks Cloud
|
|
64
64
|
|
|
@@ -91,6 +91,7 @@ _Enhanced productivity for developers. No more creating boilerplate._
|
|
|
91
91
|
- ✨ **Git Workflows** _committing with ease_
|
|
92
92
|
- 🚗 **Auto Imports** _your components & functions, including date, string, array, & object helpers_
|
|
93
93
|
- ⏩ **Code Snippets** _say goodbye to the boilerplate_
|
|
94
|
+
- 🔤 **Spell Checker** _be notified once when there are typos_
|
|
94
95
|
- 🛠️ **Utilities** _Collections, VueUse, and more_
|
|
95
96
|
- 🧪 **Testing** _unit & e2e tests powered by Vitest & Playwright_
|
|
96
97
|
|
|
@@ -407,7 +408,7 @@ Made with ❤️
|
|
|
407
408
|
[npm-downloads-src]: https://img.shields.io/npm/dm/stacks?style=flat-square
|
|
408
409
|
[npm-downloads-href]: https://npmjs.com/package/stacks
|
|
409
410
|
|
|
410
|
-
[github-actions-src]: https://img.shields.io/github/workflow/status/stacksjs/stacks/
|
|
411
|
+
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/stacks/ci.yml?style=flat-square&branch=main
|
|
411
412
|
[github-actions-href]: https://github.com/stacksjs/stacks/actions?query=workflow%3Aci
|
|
412
413
|
|
|
413
414
|
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/stacks/main?style=flat-square
|
package/buddy/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.45.0",
|
|
5
5
|
"packageManager": "pnpm@7.18.2",
|
|
6
6
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -83,11 +83,12 @@
|
|
|
83
83
|
"build:functions": "npx vite build -c ./core/build/src/functions.ts",
|
|
84
84
|
"build:docs": "npx vitepress build ../apps/docs",
|
|
85
85
|
"build:pages": "npx vite-ssg build ./pages -c ./core/build/src/pages.ts",
|
|
86
|
-
"build:core": "pnpm
|
|
87
|
-
"build:
|
|
86
|
+
"build:core": "pnpm buddy build:core",
|
|
87
|
+
"build:buddy": "npx unbuild",
|
|
88
|
+
"build:cli": "pnpm run build:buddy",
|
|
88
89
|
"build:runtime": "pnpm run build:cli",
|
|
89
90
|
"build:desktop": "wip",
|
|
90
|
-
"build:stacks": "
|
|
91
|
+
"build:stacks": "pnpm buddy build:stacks",
|
|
91
92
|
"build:all": "wip",
|
|
92
93
|
"prod": "pnpm run build",
|
|
93
94
|
"prod:components": "pnpm run build:components",
|
|
@@ -106,8 +107,8 @@
|
|
|
106
107
|
"example": "wip",
|
|
107
108
|
"example:vue": "pnpm run build:components && cd examples/vue && ln -sf ../../components/vue/dist dist && npx vite serve -c ../../core/build/example-vue.ts",
|
|
108
109
|
"example:web-components": "pnpm run build:web-components && cd examples/web && ln -sf ../../components/web/dist dist && npx vite serve -c ../../core/build/example-wc.ts",
|
|
109
|
-
"lint": "
|
|
110
|
-
"lint:fix": "
|
|
110
|
+
"lint": "pnpm buddy lint",
|
|
111
|
+
"lint:fix": "pnpm buddy lint:fix",
|
|
111
112
|
"serve": "pnpm buddy serve",
|
|
112
113
|
"serve:pages": "pnpm run dev:pages",
|
|
113
114
|
"serve:functions": "pnpm run dev:functions",
|
|
@@ -3,16 +3,16 @@ import { ExitCode } from '@stacksjs/types'
|
|
|
3
3
|
import { prompts } from '@stacksjs/cli'
|
|
4
4
|
import { invoke } from '@stacksjs/actions/add'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
async function add(buddy: CLI) {
|
|
7
|
+
const descriptions = {
|
|
8
|
+
add: 'Add a stack to your project (coming soon)',
|
|
9
|
+
table: 'Add the Table Stack to your project',
|
|
10
|
+
calendar: 'Add the Calendar Stack to your project',
|
|
11
|
+
all: 'Add all stacks',
|
|
12
|
+
debug: 'Enable debug mode',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
buddy
|
|
16
16
|
.command('add', descriptions.add)
|
|
17
17
|
.option('-t, --table', descriptions.table, { default: false })
|
|
18
18
|
.option('-c, --calendar', descriptions.calendar, { default: false })
|
|
@@ -39,7 +39,7 @@ async function add(stacks: CLI) {
|
|
|
39
39
|
process.exit(ExitCode.Success)
|
|
40
40
|
})
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
buddy
|
|
43
43
|
.command('add:table', descriptions.table)
|
|
44
44
|
.option('-t, --table', descriptions.table, { default: true })
|
|
45
45
|
.option('--debug', descriptions.debug, { default: false })
|
|
@@ -47,7 +47,7 @@ async function add(stacks: CLI) {
|
|
|
47
47
|
await invoke(options)
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
buddy
|
|
51
51
|
.command('add:calendar', descriptions.calendar)
|
|
52
52
|
.option('-t, --calendar', descriptions.calendar, { default: true })
|
|
53
53
|
.option('--debug', descriptions.debug, { default: false })
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { BuildOptions, CLI } from '@stacksjs/types'
|
|
2
|
-
import { ExitCode } from '@stacksjs/types'
|
|
3
|
-
import { prompts } from '@stacksjs/cli'
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { Action, ExitCode } from '@stacksjs/types'
|
|
3
|
+
import { intro, log, outro, prompts } from '@stacksjs/cli'
|
|
4
|
+
import { runAction } from '@stacksjs/actions'
|
|
5
|
+
|
|
6
|
+
async function build(buddy: CLI) {
|
|
7
|
+
const descriptions = {
|
|
8
|
+
components: 'Build your component library',
|
|
9
|
+
vueComponents: 'Build your Vue component library',
|
|
10
|
+
webComponents: 'Build your framework agnostic web component library',
|
|
11
|
+
elements: 'An alias to the -w flag',
|
|
12
|
+
functions: 'Build your function library',
|
|
13
|
+
pages: 'Build your SSG pages',
|
|
14
|
+
docs: 'Build your documentation site',
|
|
15
|
+
stacks: 'Build Stacks framework',
|
|
16
|
+
debug: 'Enable debug mode',
|
|
17
|
+
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
stacks
|
|
19
|
+
buddy
|
|
20
20
|
.command('build', 'Automagically build any of your libraries/packages for production use. Select any of the following packages')
|
|
21
21
|
.option('-c, --components', descriptions.components)
|
|
22
22
|
.option('-v, --vue-components', descriptions.vueComponents) // these are automatically built with your -c option as well
|
|
@@ -47,60 +47,84 @@ async function build(stacks: CLI) {
|
|
|
47
47
|
options = answers.reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
await
|
|
50
|
+
await runAction(Action.BuildStacks, options)
|
|
51
51
|
|
|
52
52
|
process.exit(ExitCode.Success)
|
|
53
53
|
})
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
buddy
|
|
56
56
|
.command('build:components', 'Automagically build component libraries for production use & npm/CDN distribution')
|
|
57
57
|
.option('-c, --components', descriptions.components, { default: true })
|
|
58
58
|
.option('--debug', descriptions.debug, { default: false })
|
|
59
59
|
.action(async (options: BuildOptions) => {
|
|
60
|
-
await
|
|
60
|
+
await runAction(Action.BuildComponentLibs, options)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
buddy
|
|
64
|
+
.command('build:cli', 'Automagically build the CLI')
|
|
65
|
+
.option('-c, --components', descriptions.components, { default: true })
|
|
66
|
+
.option('--debug', descriptions.debug, { default: false })
|
|
67
|
+
.action(async (options: BuildOptions) => {
|
|
68
|
+
await runAction(Action.BuildCli, options)
|
|
61
69
|
})
|
|
62
70
|
|
|
63
|
-
|
|
71
|
+
buddy
|
|
64
72
|
.command('build:functions', 'Automagically build function library for npm/CDN distribution')
|
|
65
73
|
.option('-f, --functions', descriptions.functions, { default: true })
|
|
66
74
|
.option('--debug', descriptions.debug, { default: false })
|
|
67
75
|
.action(async (options: BuildOptions) => {
|
|
68
|
-
await
|
|
76
|
+
await runAction(Action.BuildFunctionLib, options)
|
|
69
77
|
})
|
|
70
78
|
|
|
71
|
-
|
|
79
|
+
buddy
|
|
72
80
|
.command('build:vue-components', 'Automagically build Vue component library for npm/CDN distribution')
|
|
73
81
|
.option('-v, --vue-components', descriptions.vueComponents, { default: true })
|
|
74
82
|
.option('--debug', descriptions.debug, { default: false })
|
|
75
83
|
.alias('build:vue')
|
|
76
84
|
.action(async (options: BuildOptions) => {
|
|
77
|
-
await
|
|
85
|
+
await runAction(Action.BuildVueComponentLib, options)
|
|
78
86
|
})
|
|
79
87
|
|
|
80
|
-
|
|
88
|
+
buddy
|
|
81
89
|
.command('build:web-components', 'Automagically build Web Component library for npm/CDN distribution')
|
|
82
90
|
.option('-w, --web-components', descriptions.webComponents, { default: true })
|
|
83
91
|
.option('--debug', descriptions.debug, { default: false })
|
|
84
92
|
.alias('build:elements')
|
|
85
93
|
.alias('build:wc')
|
|
86
94
|
.action(async (options: BuildOptions) => {
|
|
87
|
-
await
|
|
95
|
+
await runAction(Action.BuildWebComponentLib, options)
|
|
88
96
|
})
|
|
89
97
|
|
|
90
|
-
|
|
98
|
+
buddy
|
|
91
99
|
.command('build:docs', 'Automagically build your documentation site.')
|
|
92
100
|
.option('-d, --docs', descriptions.docs, { default: true })
|
|
93
101
|
.option('--debug', descriptions.debug, { default: false })
|
|
94
102
|
.action(async (options: BuildOptions) => {
|
|
95
|
-
await
|
|
103
|
+
await runAction(Action.BuildDocs, options)
|
|
96
104
|
})
|
|
97
105
|
|
|
98
|
-
|
|
99
|
-
.command('build:
|
|
106
|
+
buddy
|
|
107
|
+
.command('build:core', 'Automagically build the Stacks core.')
|
|
108
|
+
.option('--debug', descriptions.debug, { default: false })
|
|
109
|
+
.action(async (options: BuildOptions) => {
|
|
110
|
+
await runAction(Action.BuildCore, options)
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
buddy
|
|
114
|
+
.command('build:stacks', 'Build the Stacks framework.')
|
|
100
115
|
.option('-s, --stacks', descriptions.stacks, { default: true })
|
|
101
116
|
.option('--debug', descriptions.debug, { default: false })
|
|
102
117
|
.action(async (options: BuildOptions) => {
|
|
103
|
-
|
|
118
|
+
console.log('here')
|
|
119
|
+
const perf = intro('buddy release')
|
|
120
|
+
const result = await runAction(Action.BuildStacks, options)
|
|
121
|
+
|
|
122
|
+
if (result.isErr()) {
|
|
123
|
+
log.error('Failed to build Stacks.', result.error)
|
|
124
|
+
process.exit()
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
outro('Stacks built successfully', { startTime: perf, useSeconds: true })
|
|
104
128
|
})
|
|
105
129
|
}
|
|
106
130
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { CLI, CleanOptions } from '@stacksjs/types'
|
|
2
2
|
import { invoke } from '@stacksjs/actions/clean'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
async function clean(buddy: CLI) {
|
|
5
|
+
const descriptions = {
|
|
6
|
+
clean: 'Removes all node_modules & lock files',
|
|
7
|
+
debug: 'Enable debug mode',
|
|
8
|
+
}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
stacks
|
|
10
|
+
buddy
|
|
11
11
|
.command('clean', descriptions.clean)
|
|
12
12
|
.option('--debug', descriptions.debug, { default: false })
|
|
13
13
|
.action(async (options: CleanOptions) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
2
2
|
import { invoke } from '@stacksjs/actions/commit'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
async function commit(buddy: CLI) {
|
|
5
|
+
const descriptions = {
|
|
6
|
+
commit: 'Commit your stashed changes',
|
|
7
|
+
debug: 'Enable debug mode',
|
|
8
|
+
}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
stacks
|
|
10
|
+
buddy
|
|
11
11
|
.command('commit', descriptions.commit)
|
|
12
12
|
.option('--debug', descriptions.debug, { default: false })
|
|
13
13
|
.action(async (options: FreshOptions) => {
|
|
@@ -6,21 +6,21 @@ import { resolve } from '@stacksjs/path'
|
|
|
6
6
|
import { ExitCode } from '@stacksjs/types'
|
|
7
7
|
import { generate as generateAppKey } from '@stacksjs/actions/key'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
async function create(buddy: CLI) {
|
|
10
|
+
const descriptions = {
|
|
11
|
+
command: 'Create a new Stacks project',
|
|
12
|
+
ui: 'Are you building a UI?',
|
|
13
|
+
components: 'Are you building UI components?',
|
|
14
|
+
webComponents: 'Automagically built optimized custom elements/web components?',
|
|
15
|
+
vue: 'Automagically built a Vue component library?',
|
|
16
|
+
pages: 'How about pages?',
|
|
17
|
+
functions: 'Are you developing functions/composables?',
|
|
18
|
+
api: 'Are you building an API?',
|
|
19
|
+
database: 'Do you need a database?',
|
|
20
|
+
debug: 'Enable debug mode',
|
|
21
|
+
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
stacks
|
|
23
|
+
buddy
|
|
24
24
|
.command('new <name>', descriptions.command)
|
|
25
25
|
.option('-u, --ui', descriptions.ui, { default: true }) // if no, disregard remainder of questions wrt UI
|
|
26
26
|
.option('-c, --components', descriptions.components, { default: true }) // if no, -v and -w would be false
|
|
@@ -3,17 +3,17 @@ import type { CLI, DevOption, DevOptions } from '@stacksjs/types'
|
|
|
3
3
|
import { prompts } from '@stacksjs/cli'
|
|
4
4
|
import { components, desktop, docs, functions, pages, invoke as startDevelopmentServer } from '@stacksjs/actions/dev'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
async function dev(buddy: CLI) {
|
|
7
|
+
const descriptions = {
|
|
8
|
+
components: 'Start the Components development server',
|
|
9
|
+
desktop: 'Start the Desktop development server',
|
|
10
|
+
functions: 'Start the Functions development server',
|
|
11
|
+
docs: 'Start the Documentation development server',
|
|
12
|
+
pages: 'Start the Pages development server',
|
|
13
|
+
debug: 'Enable debug mode',
|
|
14
|
+
}
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
stacks
|
|
16
|
+
buddy
|
|
17
17
|
.command('dev', 'Start the development server for any of the following')
|
|
18
18
|
.option('-c, --components', descriptions.components)
|
|
19
19
|
.option('-f, --functions', descriptions.functions)
|
|
@@ -53,35 +53,35 @@ async function dev(stacks: CLI) {
|
|
|
53
53
|
process.exit(ExitCode.Success)
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
buddy
|
|
57
57
|
.command('dev:components', descriptions.components)
|
|
58
58
|
.option('--debug', descriptions.debug, { default: false })
|
|
59
59
|
.action(async (options: DevOptions) => {
|
|
60
60
|
await startDevelopmentServer(options)
|
|
61
61
|
})
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
buddy
|
|
64
64
|
.command('dev:docs', descriptions.docs)
|
|
65
65
|
.option('--debug', descriptions.debug, { default: false })
|
|
66
66
|
.action(async (options: DevOptions) => {
|
|
67
67
|
await docs(options)
|
|
68
68
|
})
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
buddy
|
|
71
71
|
.command('dev:desktop', descriptions.desktop)
|
|
72
72
|
.option('--debug', descriptions.debug, { default: false })
|
|
73
73
|
.action(async (options: DevOptions) => {
|
|
74
74
|
await desktop(options)
|
|
75
75
|
})
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
buddy
|
|
78
78
|
.command('dev:functions', descriptions.functions)
|
|
79
79
|
.option('--debug', descriptions.debug, { default: false })
|
|
80
80
|
.action(async (options: DevOptions) => {
|
|
81
81
|
await functions(options)
|
|
82
82
|
})
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
buddy
|
|
85
85
|
.command('dev:pages', descriptions.pages)
|
|
86
86
|
.option('--debug', descriptions.debug, { default: false })
|
|
87
87
|
.action(async (options: DevOptions) => {
|
|
@@ -3,16 +3,16 @@ import type { CLI, ExamplesOption, ExamplesOptions } from '@stacksjs/types'
|
|
|
3
3
|
import { italic, log, prompts } from '@stacksjs/cli'
|
|
4
4
|
import { componentExample, invoke as runExample, webComponentExample } from '@stacksjs/actions/examples'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
async function example(buddy: CLI) {
|
|
7
|
+
const descriptions = {
|
|
8
|
+
example: 'Which example do you want to see?',
|
|
9
|
+
components: 'Test your libraries against your built bundle',
|
|
10
|
+
vue: 'Test your Vue component library',
|
|
11
|
+
webComponents: 'Test your web component library',
|
|
12
|
+
debug: 'Enable debug mode',
|
|
13
|
+
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
stacks
|
|
15
|
+
buddy
|
|
16
16
|
.command('example', descriptions.example)
|
|
17
17
|
.option('-c, --components', descriptions.components)
|
|
18
18
|
.option('-v, --vue', descriptions.vue)
|
|
@@ -44,7 +44,7 @@ async function example(stacks: CLI) {
|
|
|
44
44
|
process.exit(ExitCode.Success)
|
|
45
45
|
})
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
buddy
|
|
48
48
|
.command('example:vue', descriptions.vue)
|
|
49
49
|
.option('-v, --vue', descriptions.debug, { default: true })
|
|
50
50
|
.option('--debug', descriptions.debug, { default: false })
|
|
@@ -53,7 +53,7 @@ async function example(stacks: CLI) {
|
|
|
53
53
|
await runExample(options)
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
buddy
|
|
57
57
|
.command('example:web-components', 'Test your Web Component library.')
|
|
58
58
|
.option('-w, --web-components', descriptions.debug, { default: true })
|
|
59
59
|
.option('--debug', descriptions.debug, { default: false })
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
import type { CLI,
|
|
2
|
-
import {
|
|
1
|
+
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
2
|
+
import { runAction } from '@stacksjs/actions'
|
|
3
|
+
import { intro, outro } from '@stacksjs/cli'
|
|
4
|
+
import { Action, ExitCode } from '@stacksjs/types'
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
async function fresh(buddy: CLI) {
|
|
7
|
+
const descriptions = {
|
|
8
|
+
fresh: 'Reinstalls your npm dependencies',
|
|
9
|
+
debug: 'Enable debug mode',
|
|
10
|
+
}
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
stacks
|
|
12
|
+
buddy
|
|
11
13
|
.command('fresh', descriptions.fresh)
|
|
12
14
|
.option('--debug', descriptions.debug, { default: false })
|
|
13
|
-
.action(async (options:
|
|
14
|
-
|
|
15
|
+
.action(async (options: FreshOptions) => {
|
|
16
|
+
const perf = intro('buddy fresh')
|
|
17
|
+
const result = await runAction(Action.Fresh, { ...options, shouldShowSpinner: true })
|
|
18
|
+
|
|
19
|
+
if (result.isErr()) {
|
|
20
|
+
outro('While running the fresh command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
|
|
21
|
+
process.exit()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
outro('Freshly reinstalled your dependencies.', { startTime: perf, useSeconds: true })
|
|
25
|
+
process.exit(ExitCode.Success)
|
|
15
26
|
})
|
|
16
27
|
}
|
|
17
28
|
|
|
@@ -3,20 +3,20 @@ import { ExitCode } from '@stacksjs/types'
|
|
|
3
3
|
import { prompts } from '@stacksjs/cli'
|
|
4
4
|
import { componentMeta, ideHelpers, libEntries, invoke as startGenerationProcess, types, vsCodeCustomData, vueCompat, webTypes } from '@stacksjs/actions/generate'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
async function generate(buddy: CLI) {
|
|
7
|
+
const descriptions = {
|
|
8
|
+
command: 'Automagically build any of your libraries/packages for production use. Select any of the following packages',
|
|
9
|
+
types: 'Generate your TypeScript types',
|
|
10
|
+
entries: 'Generate your function & component library entry points',
|
|
11
|
+
webTypes: 'Generate web-types.json for IDEs',
|
|
12
|
+
customData: 'Generate VS Code custom data (custom-elements.json) for IDEs',
|
|
13
|
+
ideHelpers: 'Generate IDE helpers',
|
|
14
|
+
vueCompat: 'Generate Vue 2 & 3 compatibility',
|
|
15
|
+
componentMeta: 'Generate component meta information',
|
|
16
|
+
debug: 'Enable debug mode',
|
|
17
|
+
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
stacks
|
|
19
|
+
buddy
|
|
20
20
|
.command('generate', descriptions.command)
|
|
21
21
|
.option('-t, --types', descriptions.types)
|
|
22
22
|
.option('-e, --entries', descriptions.entries)
|
|
@@ -52,7 +52,7 @@ async function generate(stacks: CLI) {
|
|
|
52
52
|
process.exit(ExitCode.Success)
|
|
53
53
|
})
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
buddy
|
|
56
56
|
.command('generate:types', descriptions.types)
|
|
57
57
|
.option('--debug', descriptions.debug, { default: false })
|
|
58
58
|
.alias('types:generate')
|
|
@@ -60,42 +60,42 @@ async function generate(stacks: CLI) {
|
|
|
60
60
|
await types(options)
|
|
61
61
|
})
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
buddy
|
|
64
64
|
.command('generate:entries', descriptions.entries)
|
|
65
65
|
.option('--debug', descriptions.debug, { default: false })
|
|
66
66
|
.action(async (options: GeneratorOptions) => {
|
|
67
67
|
await libEntries(options)
|
|
68
68
|
})
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
buddy
|
|
71
71
|
.command('generate:vue-compatibility', descriptions.vueCompat)
|
|
72
72
|
.option('--debug', descriptions.debug, { default: false })
|
|
73
73
|
.action(async (options: GeneratorOptions) => {
|
|
74
74
|
await vueCompat(options)
|
|
75
75
|
})
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
buddy
|
|
78
78
|
.command('generate:web-types', descriptions.webTypes)
|
|
79
79
|
.option('--debug', descriptions.debug, { default: false })
|
|
80
80
|
.action(async (options: GeneratorOptions) => {
|
|
81
81
|
await webTypes(options)
|
|
82
82
|
})
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
buddy
|
|
85
85
|
.command('generate:vscode-custom-data', descriptions.customData)
|
|
86
86
|
.option('--debug', descriptions.debug, { default: false })
|
|
87
87
|
.action(async (options: GeneratorOptions) => {
|
|
88
88
|
await vsCodeCustomData(options)
|
|
89
89
|
})
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
buddy
|
|
92
92
|
.command('generate:ide-helpers', descriptions.ideHelpers)
|
|
93
93
|
.option('--debug', descriptions.debug, { default: false })
|
|
94
94
|
.action(async (options: GeneratorOptions) => {
|
|
95
95
|
await ideHelpers(options)
|
|
96
96
|
})
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
buddy
|
|
99
99
|
.command('generate:component-meta', descriptions.componentMeta)
|
|
100
100
|
.option('--debug', descriptions.debug, { default: false })
|
|
101
101
|
.action(async (options: GeneratorOptions) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { CLI, KeyOptions } from '@stacksjs/types'
|
|
2
2
|
import { generate as generateAppKey } from '@stacksjs/actions/key'
|
|
3
3
|
|
|
4
|
-
async function key(
|
|
4
|
+
async function key(buddy: CLI) {
|
|
5
5
|
const descriptions = {
|
|
6
6
|
command: 'Generate & set the application key.',
|
|
7
7
|
debug: 'Enable debug mode',
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
buddy
|
|
11
11
|
.command('key:generate', descriptions.command)
|
|
12
12
|
.option('--debug', descriptions.debug, { default: false })
|
|
13
13
|
.action(async (options: KeyOptions) => {
|