stacks 0.44.12 → 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 +3 -3
- package/buddy/README.md +3 -3
- package/buddy/package.json +4 -4
- package/buddy/src/commands/build.ts +7 -0
- package/buddy/src/commands/fresh.ts +3 -3
- package/buddy/src/commands/lint.ts +21 -3
- package/buddy/src/commands/release.ts +2 -2
- package/core/actions/package.json +2 -2
- package/core/actions/src/build-core.ts +7 -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 +4 -1
- 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 +29 -5
- 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 +22 -9
- package/core/cli/src/helpers.ts +5 -5
- 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 +1 -1
- 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/health/package.json +1 -1
- 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 +2 -2
- 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 +3 -3
- package/core/types/src/cli.ts +26 -4
- 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 +4 -4
- package/core/actions/test.ts +0 -10
- package/core/cloud/dist/actions/README.md +0 -53
- package/core/notifications/tests/example.test.ts +0 -7
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
|
|
|
@@ -408,7 +408,7 @@ Made with ❤️
|
|
|
408
408
|
[npm-downloads-src]: https://img.shields.io/npm/dm/stacks?style=flat-square
|
|
409
409
|
[npm-downloads-href]: https://npmjs.com/package/stacks
|
|
410
410
|
|
|
411
|
-
[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
|
|
412
412
|
[github-actions-href]: https://github.com/stacksjs/stacks/actions?query=workflow%3Aci
|
|
413
413
|
|
|
414
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
|
|
|
@@ -408,7 +408,7 @@ Made with ❤️
|
|
|
408
408
|
[npm-downloads-src]: https://img.shields.io/npm/dm/stacks?style=flat-square
|
|
409
409
|
[npm-downloads-href]: https://npmjs.com/package/stacks
|
|
410
410
|
|
|
411
|
-
[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
|
|
412
412
|
[github-actions-href]: https://github.com/stacksjs/stacks/actions?query=workflow%3Aci
|
|
413
413
|
|
|
414
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,7 +83,7 @@
|
|
|
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
|
|
86
|
+
"build:core": "pnpm buddy build:core",
|
|
87
87
|
"build:buddy": "npx unbuild",
|
|
88
88
|
"build:cli": "pnpm run build:buddy",
|
|
89
89
|
"build:runtime": "pnpm run build:cli",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"example": "wip",
|
|
108
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",
|
|
109
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",
|
|
110
|
-
"lint": "
|
|
111
|
-
"lint:fix": "
|
|
110
|
+
"lint": "pnpm buddy lint",
|
|
111
|
+
"lint:fix": "pnpm buddy lint:fix",
|
|
112
112
|
"serve": "pnpm buddy serve",
|
|
113
113
|
"serve:pages": "pnpm run dev:pages",
|
|
114
114
|
"serve:functions": "pnpm run dev:functions",
|
|
@@ -103,6 +103,13 @@ async function build(buddy: CLI) {
|
|
|
103
103
|
await runAction(Action.BuildDocs, options)
|
|
104
104
|
})
|
|
105
105
|
|
|
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
|
+
|
|
106
113
|
buddy
|
|
107
114
|
.command('build:stacks', 'Build the Stacks framework.')
|
|
108
115
|
.option('-s, --stacks', descriptions.stacks, { default: true })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CLI,
|
|
1
|
+
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
2
2
|
import { runAction } from '@stacksjs/actions'
|
|
3
3
|
import { intro, outro } from '@stacksjs/cli'
|
|
4
4
|
import { Action, ExitCode } from '@stacksjs/types'
|
|
@@ -12,9 +12,9 @@ async function fresh(buddy: CLI) {
|
|
|
12
12
|
buddy
|
|
13
13
|
.command('fresh', descriptions.fresh)
|
|
14
14
|
.option('--debug', descriptions.debug, { default: false })
|
|
15
|
-
.action(async (options:
|
|
15
|
+
.action(async (options: FreshOptions) => {
|
|
16
16
|
const perf = intro('buddy fresh')
|
|
17
|
-
const result = await runAction(Action.Fresh, options)
|
|
17
|
+
const result = await runAction(Action.Fresh, { ...options, shouldShowSpinner: true })
|
|
18
18
|
|
|
19
19
|
if (result.isErr()) {
|
|
20
20
|
outro('While running the fresh command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CLI, LintOptions } from '@stacksjs/types'
|
|
2
|
-
import {
|
|
2
|
+
import { intro, log, outro } from '@stacksjs/cli'
|
|
3
|
+
import { Action } from '@stacksjs/types'
|
|
4
|
+
import { runAction } from '@stacksjs/actions'
|
|
3
5
|
|
|
4
6
|
async function lint(buddy: CLI) {
|
|
5
7
|
const descriptions = {
|
|
@@ -13,14 +15,30 @@ async function lint(buddy: CLI) {
|
|
|
13
15
|
.option('-f, --fix', descriptions.lintFix, { default: false })
|
|
14
16
|
.option('--debug', descriptions.debug, { default: false })
|
|
15
17
|
.action(async (options: LintOptions) => {
|
|
16
|
-
|
|
18
|
+
const perf = intro('buddy lint')
|
|
19
|
+
const result = await runAction(Action.Lint, options)
|
|
20
|
+
|
|
21
|
+
if (result.isErr()) {
|
|
22
|
+
outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true })
|
|
23
|
+
process.exit()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
outro('Linted', { startTime: perf, useSeconds: true })
|
|
17
27
|
})
|
|
18
28
|
|
|
19
29
|
buddy
|
|
20
30
|
.command('lint:fix', descriptions.lintFix)
|
|
21
31
|
.option('--debug', descriptions.debug, { default: false })
|
|
22
32
|
.action(async (options: LintOptions) => {
|
|
23
|
-
|
|
33
|
+
log.info('Fixing lint errors...')
|
|
34
|
+
const result = await runAction(Action.LintFix, options)
|
|
35
|
+
|
|
36
|
+
if (result.isErr()) {
|
|
37
|
+
log.error('There was an error lint fixing your code.', result.error)
|
|
38
|
+
process.exit()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
log.success('Fixed lint errors')
|
|
24
42
|
})
|
|
25
43
|
}
|
|
26
44
|
|
|
@@ -13,7 +13,7 @@ async function release(buddy: CLI) {
|
|
|
13
13
|
.command('release', descriptions.release)
|
|
14
14
|
.option('--debug', descriptions.debug, { default: true }) // it's on by default because it requires manual input
|
|
15
15
|
.action(async (options: ReleaseOptions) => {
|
|
16
|
-
const
|
|
16
|
+
const startTime = intro('buddy release')
|
|
17
17
|
const result = await runAction(Action.Release, options)
|
|
18
18
|
|
|
19
19
|
if (result.isErr()) {
|
|
@@ -21,7 +21,7 @@ async function release(buddy: CLI) {
|
|
|
21
21
|
process.exit()
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
outro('Triggered CI/CD release workflow', { startTime
|
|
24
|
+
outro('Triggered CI/CD release workflow', { startTime, useSeconds: true })
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.45.0",
|
|
5
5
|
"packageManager": "pnpm@7.18.2",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@stacksjs/types": "workspace:*",
|
|
55
55
|
"@stacksjs/utils": "workspace:*",
|
|
56
56
|
"markdown-it": "^13.0.1",
|
|
57
|
-
"vue-component-meta": "^1.0.
|
|
57
|
+
"vue-component-meta": "^1.0.16"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@stacksjs/strings": "workspace:*",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { frameworkPath } from '@stacksjs/path'
|
|
2
|
+
import { runCommands } from '@stacksjs/cli'
|
|
3
|
+
|
|
4
|
+
await runCommands([
|
|
5
|
+
'pnpm --filter \'./core/**\' --filter=\'!./core/config\' --filter=\'!./core/x-ray\' build', // command to build the core packages, excluding the config & x-ray package
|
|
6
|
+
'pnpm --filter \'../core/config\' build', // command to build the config package
|
|
7
|
+
], { debug: true, cwd: frameworkPath() })
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { runCommand } from '@stacksjs/cli'
|
|
2
|
+
import { frameworkPath } from '@stacksjs/path'
|
|
3
|
+
|
|
4
|
+
const result = await runCommand(
|
|
5
|
+
'npx bumpp ./package.json ./buddy/package.json ./core/**/package.json ./vscode/package.json --execute \'pnpm run changelog\' --all',
|
|
6
|
+
{ debug: true, cwd: frameworkPath(), shell: true },
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
if (result.isErr())
|
|
10
|
+
console.error(result.error)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { runCommands } from '@stacksjs/cli'
|
|
2
2
|
import { frameworkPath } from '@stacksjs/path'
|
|
3
3
|
|
|
4
|
-
await runCommands([
|
|
4
|
+
await runCommands([
|
|
5
|
+
'pnpm run clean',
|
|
6
|
+
'pnpm install',
|
|
7
|
+
], { cwd: frameworkPath(), debug: true })
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { log } from '@stacksjs/logging'
|
|
2
|
-
import { NpmScript } from '@stacksjs/types'
|
|
2
|
+
import { Action, NpmScript } from '@stacksjs/types'
|
|
3
3
|
import type { GeneratorOptions } from '@stacksjs/types'
|
|
4
4
|
import { runNpmScript } from '@stacksjs/utils'
|
|
5
5
|
import { projectPath } from '@stacksjs/path'
|
|
6
6
|
import { runCommand } from '@stacksjs/cli'
|
|
7
|
-
import {
|
|
7
|
+
import { runAction } from './helpers'
|
|
8
8
|
|
|
9
9
|
export async function invoke(options?: GeneratorOptions) {
|
|
10
10
|
if (options?.types)
|
|
@@ -79,7 +79,7 @@ export async function vsCodeCustomData(options?: GeneratorOptions) {
|
|
|
79
79
|
process.exit()
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
await
|
|
82
|
+
await runAction(Action.LintFix, { debug: true }) // the generated json file needs to be linted
|
|
83
83
|
log.success('Successfully generated the custom-elements.json file')
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -91,7 +91,7 @@ export async function ideHelpers(options?: GeneratorOptions) {
|
|
|
91
91
|
process.exit()
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
await
|
|
94
|
+
await runAction(Action.LintFix, { debug: true }) // the generated json file needs to be linted
|
|
95
95
|
log.success('Successfully generated IDE helpers')
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -103,7 +103,7 @@ export async function componentMeta(options?: GeneratorOptions) {
|
|
|
103
103
|
process.exit()
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
await
|
|
106
|
+
await runAction(Action.LintFix, { debug: true }) // the generated json file needs to be linted
|
|
107
107
|
log.success('Successfully generated component meta information')
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -37,7 +37,7 @@ export async function createVueLibraryEntryPoint() {
|
|
|
37
37
|
data: generateEntryPointData('vue-components'),
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
-
log.success('Created Vue component library entry point.')
|
|
40
|
+
log.success('Created the Vue component library entry point.')
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export async function createWebComponentLibraryEntryPoint() {
|
|
@@ -87,7 +87,7 @@ export async function generatePackageJson(type: 'vue-components' | 'web-componen
|
|
|
87
87
|
else if (type === 'functions')
|
|
88
88
|
prettyName = 'Function Library'
|
|
89
89
|
|
|
90
|
-
log.success(`Created ${prettyName} package.json
|
|
90
|
+
log.success(`Created the ${prettyName} package.json file.`)
|
|
91
91
|
}
|
|
92
92
|
catch (err) {
|
|
93
93
|
log.error(`There was an error creating the ${prettyName} package.json.`, err)
|
|
@@ -1,23 +1,47 @@
|
|
|
1
1
|
import storage from '@stacksjs/storage'
|
|
2
|
-
import { runCommand } from '@stacksjs/cli'
|
|
2
|
+
import { runCommand, runCommands } from '@stacksjs/cli'
|
|
3
3
|
import { actionsPath, functionsPath } from '@stacksjs/path'
|
|
4
|
-
import type { CliOptions } from '@stacksjs/types'
|
|
4
|
+
import type { CliOptions, CommandResult } from '@stacksjs/types'
|
|
5
|
+
import type { Err, Result } from '@stacksjs/error-handling'
|
|
5
6
|
import { err } from '@stacksjs/error-handling'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
* Run
|
|
9
|
+
* Run an Action the Stacks way.
|
|
9
10
|
*
|
|
10
11
|
* @param command The action to invoke.
|
|
11
12
|
* @param options The options to pass to the command.
|
|
12
13
|
* @returns The result of the command.
|
|
13
14
|
*/
|
|
14
|
-
export async function runAction(action: string, options?: CliOptions) {
|
|
15
|
+
export async function runAction(action: string, options?: CliOptions): Promise<Result<CommandResult<string>, Error> | Err<CommandResult<string>, string>> {
|
|
15
16
|
if (!hasAction(action))
|
|
16
17
|
return err(`The specified action "${action}" does not exist`)
|
|
17
18
|
|
|
18
19
|
const cmd = `npx esno ${actionsPath(`${action}.ts`)}`
|
|
19
20
|
|
|
20
|
-
return
|
|
21
|
+
return options?.shouldShowSpinner
|
|
22
|
+
? await runCommands([cmd], options)
|
|
23
|
+
: await runCommand(cmd, options)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Run Actions the Stacks way.
|
|
28
|
+
*
|
|
29
|
+
* @param command The action to invoke.
|
|
30
|
+
* @param options The options to pass to the command.
|
|
31
|
+
* @returns The result of the command.
|
|
32
|
+
*/
|
|
33
|
+
export async function runActions(actions: string[], options?: CliOptions): Promise<Result<CommandResult<string>, Error>[] | Result<CommandResult<string>, Error> | Err<CommandResult<string>, string>> {
|
|
34
|
+
if (!actions.length)
|
|
35
|
+
return err('No actions were specified')
|
|
36
|
+
|
|
37
|
+
for (const action of actions) {
|
|
38
|
+
if (!hasAction(action))
|
|
39
|
+
return err(`The specified action "${action}" does not exist`)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const commands = actions.map(action => `npx esno ${actionsPath(`${action}.ts`)}`)
|
|
43
|
+
|
|
44
|
+
return await runCommands(commands, options)
|
|
21
45
|
}
|
|
22
46
|
|
|
23
47
|
export function hasAction(action: string) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { runAction } from '@stacksjs/actions'
|
|
2
|
+
import { log } from '@stacksjs/cli'
|
|
3
|
+
import { projectPath } from '@stacksjs/path'
|
|
4
|
+
import { Action } from '@stacksjs/types'
|
|
5
|
+
|
|
6
|
+
log.info('Linting your project.')
|
|
7
|
+
await runAction(Action.FixLintIssues, { debug: true, cwd: projectPath(), shouldShowSpinner: true })
|
|
8
|
+
log.success('Linted your project.')
|
package/core/actions/src/lint.ts
CHANGED
|
@@ -1,36 +1,12 @@
|
|
|
1
|
-
import { log } from '@stacksjs/logging'
|
|
2
1
|
import { intro, outro, runCommand } from '@stacksjs/cli'
|
|
3
|
-
import { runNpmScript } from '@stacksjs/utils'
|
|
4
|
-
import type { LintOptions } from '@stacksjs/types'
|
|
5
2
|
import { ExitCode, NpmScript } from '@stacksjs/types'
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
await lintFix(options)
|
|
10
|
-
else
|
|
11
|
-
await lint(options)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export async function lint(options: LintOptions) {
|
|
15
|
-
const perf = intro('buddy lint')
|
|
16
|
-
const result = await runCommand(NpmScript.Lint, { ...options, debug: true })
|
|
17
|
-
|
|
18
|
-
if (result.isErr()) {
|
|
19
|
-
outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true })
|
|
20
|
-
process.exit(ExitCode.FatalError)
|
|
21
|
-
}
|
|
4
|
+
const perf = intro('buddy lint')
|
|
5
|
+
const result = await runCommand(NpmScript.Lint, { cwd: frameworkPath(), debug: true })
|
|
22
6
|
|
|
23
|
-
|
|
7
|
+
if (result.isErr()) {
|
|
8
|
+
outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true })
|
|
9
|
+
process.exit(ExitCode.FatalError)
|
|
24
10
|
}
|
|
25
11
|
|
|
26
|
-
|
|
27
|
-
log.info('Fixing lint errors...')
|
|
28
|
-
const result = await runNpmScript(NpmScript.LintFix, options)
|
|
29
|
-
|
|
30
|
-
if (result.isErr()) {
|
|
31
|
-
log.error('There was an error lint fixing your code.', result.error)
|
|
32
|
-
process.exit()
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
log.success('Fixed lint errors')
|
|
36
|
-
}
|
|
12
|
+
outro('Linted', { startTime: perf, useSeconds: true })
|
package/core/actions/src/make.ts
CHANGED
|
@@ -46,7 +46,7 @@ export async function component(options: MakeOptions) {
|
|
|
46
46
|
const name = options.name
|
|
47
47
|
log.info('Creating your component...')
|
|
48
48
|
await createComponent(options)
|
|
49
|
-
log.success(`Created ${italic(name)} component
|
|
49
|
+
log.success(`Created the ${italic(name)} component.`)
|
|
50
50
|
}
|
|
51
51
|
catch (error) {
|
|
52
52
|
log.error('There was an error creating your component.', error)
|
|
@@ -77,7 +77,7 @@ export async function database(options: MakeOptions) {
|
|
|
77
77
|
const name = options.name
|
|
78
78
|
log.info(`Creating your ${italic(name)} database...`)
|
|
79
79
|
await createDatabase(options)
|
|
80
|
-
log.success(`Created ${italic(name)} database
|
|
80
|
+
log.success(`Created the ${italic(name)} database.`)
|
|
81
81
|
}
|
|
82
82
|
catch (error) {
|
|
83
83
|
log.error('There was an error creating your database.', error)
|
|
@@ -95,7 +95,7 @@ export async function factory(options: MakeOptions) {
|
|
|
95
95
|
const name = options.name
|
|
96
96
|
log.info(`Creating your ${italic(name)} factory...`)
|
|
97
97
|
await createDatabase(options)
|
|
98
|
-
log.success(`Created ${italic(name)} factory
|
|
98
|
+
log.success(`Created the ${italic(name)} factory.`)
|
|
99
99
|
}
|
|
100
100
|
catch (error) {
|
|
101
101
|
log.error('There was an error creating your factory.', error)
|
|
@@ -113,7 +113,7 @@ export async function migration(options: MakeOptions) {
|
|
|
113
113
|
const name = options.name
|
|
114
114
|
log.info(`Creating your ${italic(name)} migration...`)
|
|
115
115
|
await createMigration(options)
|
|
116
|
-
log.success(`Created ${italic(name)} migration
|
|
116
|
+
log.success(`Created the ${italic(name)} migration.`)
|
|
117
117
|
}
|
|
118
118
|
catch (error) {
|
|
119
119
|
log.error('There was an error creating your migration.', error)
|
|
@@ -131,7 +131,7 @@ export async function notification(options: MakeOptions) {
|
|
|
131
131
|
const name = options.name
|
|
132
132
|
log.info(`Creating your ${italic(name)} notification...`)
|
|
133
133
|
await createNotification(options)
|
|
134
|
-
log.success(`Created ${italic(name)} notification
|
|
134
|
+
log.success(`Created the ${italic(name)} notification.`)
|
|
135
135
|
}
|
|
136
136
|
catch (error) {
|
|
137
137
|
log.error('There was an error creating your notification.', error)
|
|
@@ -149,7 +149,7 @@ export async function page(options: MakeOptions) {
|
|
|
149
149
|
const name = options.name
|
|
150
150
|
log.info('Creating your page...')
|
|
151
151
|
createPage(options)
|
|
152
|
-
log.success(`Created ${name} page
|
|
152
|
+
log.success(`Created the ${name} page.`)
|
|
153
153
|
}
|
|
154
154
|
catch (error) {
|
|
155
155
|
log.error('There was an error creating your page.', error)
|
|
@@ -181,7 +181,7 @@ export async function fx(options: MakeOptions) {
|
|
|
181
181
|
const name = options.name
|
|
182
182
|
log.info('Creating your function...')
|
|
183
183
|
await createFunction(options)
|
|
184
|
-
log.success(`Created ${name} function
|
|
184
|
+
log.success(`Created the ${name} function.`)
|
|
185
185
|
}
|
|
186
186
|
catch (error) {
|
|
187
187
|
log.error('There was an error creating your function.', error)
|
|
@@ -214,7 +214,7 @@ export async function language(options: MakeOptions) {
|
|
|
214
214
|
const name = options.name
|
|
215
215
|
log.info('Creating your translation file...')
|
|
216
216
|
createLanguage(options)
|
|
217
|
-
log.success(`Created ${name} translation file
|
|
217
|
+
log.success(`Created the ${name} translation file.`)
|
|
218
218
|
}
|
|
219
219
|
catch (error) {
|
|
220
220
|
log.error('There was an error creating your language.', error)
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { frameworkPath } from '@stacksjs/path'
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { log } from '@stacksjs/cli'
|
|
3
|
+
import { runActions } from '@stacksjs/actions'
|
|
4
|
+
import { Action } from '@stacksjs/types'
|
|
5
|
+
// import { log } from '@stacksjxs/cli'
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
await runActions([
|
|
8
|
+
Action.GeneratePackageJsons, // generate the package.json's for each package
|
|
9
|
+
Action.LintFix, // ensure there are no lint errors
|
|
10
|
+
Action.Bump, // bump the versions, generate the changelog, and push the changes, including the git version tag
|
|
11
|
+
], { debug: true, cwd: frameworkPath() }) // debug mode needs to be enabled to see the output due to the interactive prompts
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
log.error('There was an error while releasing your stack, during the process of fixing your lint errors.', result.error)
|
|
13
|
-
process.exit()
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// next, lets run lint:fix to make sure there are no lint errors
|
|
17
|
-
// because when "generate-package-json" runs, it generates some lint errors
|
|
18
|
-
result = await runNpmScript(NpmScript.LintFix, { debug: true, cwd: frameworkPath() })
|
|
19
|
-
|
|
20
|
-
if (result.isErr()) {
|
|
21
|
-
log.error('There was an error while releasing your stack, during the process of fixing your lint errors.', result.error)
|
|
22
|
-
process.exit()
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// next, lets run the release script to bump the versions and generate the changelog, and push the changes
|
|
26
|
-
// ultimately, a successful git push will trigger the CI/CD release workflow
|
|
27
|
-
result = await runNpmScript(NpmScript.Release, { debug: true, cwd: frameworkPath() })
|
|
28
|
-
|
|
29
|
-
if (result.isErr()) {
|
|
30
|
-
log.error('There was an error while releasing your stack.', result.error)
|
|
31
|
-
process.exit()
|
|
32
|
-
}
|
|
13
|
+
// log.success('Successfully released the Stacks framework')
|
package/core/ai/package.json
CHANGED
package/core/alias/package.json
CHANGED
package/core/arrays/package.json
CHANGED
package/core/auth/package.json
CHANGED
|
@@ -11,7 +11,7 @@ else
|
|
|
11
11
|
export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@4.0.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@4.0.2/node_modules/vite/bin/vite.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/vite@4.0.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vite@4.0.2/node_modules/vite/bin/vite.js" "$@"
|
|
17
17
|
fi
|
|
@@ -11,7 +11,7 @@ else
|
|
|
11
11
|
export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite-ssg@0.22.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite-ssg@0.22.1_h5aity6h2fxdq34afxf7tsy23q/node_modules/vite-ssg/bin/vite-ssg.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/vite-ssg@0.22.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vite-ssg@0.22.1_h5aity6h2fxdq34afxf7tsy23q/node_modules/vite-ssg/bin/vite-ssg.js" "$@"
|
|
17
17
|
fi
|
package/core/build/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/build",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.45.0",
|
|
5
5
|
"packageManager": "pnpm@7.18.2",
|
|
6
6
|
"description": "The Stacks framework build tools and configurations.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"unbuild": "^1.0.2",
|
|
58
58
|
"unplugin-auto-import": "^0.12.1",
|
|
59
59
|
"unplugin-vue-components": "^0.22.12",
|
|
60
|
-
"vite": "^4.0.
|
|
61
|
-
"vite-plugin-inspect": "^0.7.
|
|
60
|
+
"vite": "^4.0.2",
|
|
61
|
+
"vite-plugin-inspect": "^0.7.11",
|
|
62
62
|
"vite-plugin-pages": "^0.28.0",
|
|
63
63
|
"vite-plugin-pwa": "^0.14.0",
|
|
64
64
|
"vite-plugin-vue-layouts": "^0.7.0",
|
package/core/cache/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cache",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.45.0",
|
|
5
5
|
"packageManager": "pnpm@7.18.2",
|
|
6
6
|
"description": "The Stacks way to test.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typecheck": "tsc --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
48
|
+
"@aws-sdk/client-dynamodb": "^3.235.0",
|
|
49
49
|
"@stacksjs/config": "workspace:*",
|
|
50
50
|
"@types/memjs": "^1.2.4",
|
|
51
51
|
"memcached": "^2.2.2",
|