stacks 0.58.63 → 0.58.65
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/core/actions/dist/src/database/seed.js +0 -3
- package/core/actions/dist/src/deploy/index.js +1 -1
- package/core/actions/dist/src/upgrade.js +1 -1
- package/core/actions/package.json +1 -1
- package/core/actions/src/action.ts +3 -1
- package/core/actions/src/copy-types.ts +1 -1
- package/core/actions/src/database/seed.ts +3 -3
- package/core/actions/src/deploy/index.ts +1 -1
- package/core/actions/src/helpers/utils.ts +2 -2
- package/core/ai/package.json +1 -1
- package/core/alias/package.json +1 -1
- package/core/analytics/package.json +1 -1
- package/core/api/package.json +1 -1
- package/core/arrays/package.json +1 -1
- package/core/arrays/src/helpers.ts +3 -3
- package/core/auth/package.json +1 -1
- package/core/buddy/dist/cli.js +1 -1
- package/core/buddy/package.json +1 -1
- package/core/buddy/src/cli.ts +1 -1
- package/core/build/package.json +1 -1
- package/core/bun-create/bud/package.json +1 -1
- package/core/bun-create/buddy/package.json +1 -1
- package/core/bun-create/stack/package.json +1 -1
- package/core/bun-create/stacks/package.json +1 -1
- package/core/bun-create/stx/package.json +1 -1
- package/core/bun-plugin-yaml/package.json +1 -1
- package/core/cache/package.json +1 -1
- package/core/cache/tests/DynamoDB.test.ts +125 -125
- package/core/cache/tests/Memcached.test.ts +51 -51
- package/core/cache/tests/Redis.test.ts +84 -84
- package/core/chat/package.json +1 -1
- package/core/cli/dist/index.js +1 -1
- package/core/cli/package.json +1 -1
- package/core/cli/src/exec.ts +2 -2
- package/core/cloud/dist/index.js +8 -8
- package/core/cloud/package.json +1 -1
- package/core/cloud/src/cloud/ai.ts +3 -3
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +1 -1
- package/core/cloud/src/cloud/cli.ts +1 -1
- package/core/cloud/src/cloud/compute.ts +1 -1
- package/core/cloud/src/cloud/deployment.ts +3 -3
- package/core/cloud/src/cloud/router-layer/nodejs/package.json +2 -2
- package/core/collections/package.json +1 -1
- package/core/config/dist/index.js +4 -0
- package/core/config/package.json +1 -1
- package/core/database/package.json +1 -1
- package/core/database/src/kysely-bun-worker/driver.ts +1 -1
- package/core/datetime/package.json +1 -1
- package/core/desktop/package.json +3 -3
- package/core/development/package.json +1 -1
- package/core/dns/package.json +1 -1
- package/core/docs/package.json +1 -1
- package/core/email/package.json +2 -2
- package/core/enums/package.json +1 -1
- package/core/env/package.json +1 -1
- package/core/error-handling/package.json +1 -1
- package/core/error-handling/src/handler.ts +1 -1
- package/core/eslint-config/package.json +2 -2
- package/core/events/package.json +1 -1
- package/core/faker/package.json +1 -1
- package/core/git/package.json +1 -1
- package/core/health/package.json +1 -1
- package/core/http/package.json +1 -1
- package/core/lint/package.json +1 -1
- package/core/logging/package.json +1 -1
- package/core/notifications/package.json +1 -1
- package/core/objects/package.json +1 -1
- package/core/orm/package.json +1 -1
- package/core/path/dist/index.js +30 -0
- package/core/path/package.json +1 -1
- package/core/path/src/index.ts +31 -0
- package/core/payments/package.json +1 -1
- package/core/push/package.json +1 -1
- package/core/query-builder/package.json +1 -1
- package/core/queue/package.json +1 -1
- package/core/raycast/package.json +1 -1
- package/core/realtime/package.json +1 -1
- package/core/repl/package.json +1 -1
- package/core/router/dist/index.js +40 -2
- package/core/router/package.json +1 -1
- package/core/router/src/router.ts +21 -1
- package/core/router/src/server.ts +0 -2
- package/core/scheduler/dist/index.js +1 -2
- package/core/scheduler/package.json +2 -1
- package/core/scheduler/src/index.ts +1 -1
- package/core/scheduler/src/job.ts +2 -2
- package/core/scheduler/src/schedule.ts +2 -2
- package/core/scheduler/tests/cron.test.ts +1243 -1243
- package/core/scheduler/tests/crontime.test.ts +780 -778
- package/core/search-engine/dist/index.js +1 -3
- package/core/search-engine/package.json +1 -1
- package/core/search-engine/src/index.ts +5 -5
- package/core/security/package.json +1 -1
- package/core/server/package.json +1 -1
- package/core/signals/package.json +1 -1
- package/core/slug/package.json +1 -1
- package/core/sms/package.json +1 -1
- package/core/storage/dist/index.js +0 -1
- package/core/storage/package.json +1 -1
- package/core/storage/src/files.ts +2 -5
- package/core/storage/src/hash.ts +0 -2
- package/core/strings/package.json +1 -1
- package/core/tables/package.json +1 -1
- package/core/testing/dist/index.js +14978 -1
- package/core/testing/package.json +1 -1
- package/core/testing/src/index.ts +12 -2
- package/core/tinker/package.json +1 -1
- package/core/tunnel/package.json +1 -1
- package/core/types/package.json +2 -2
- package/core/types/src/cli.ts +1 -1
- package/core/types/src/cron-jobs.ts +0 -5
- package/core/types/src/errors.ts +1 -1
- package/core/types/src/router.ts +7 -5
- package/core/ui/package.json +3 -3
- package/core/utils/dist/index.js +4 -8
- package/core/utils/package.json +1 -1
- package/core/utils/scripts/export-size.ts +3 -3
- package/core/utils/src/base.ts +4 -4
- package/core/utils/src/helpers.ts +3 -3
- package/core/utils/src/retry.ts +2 -2
- package/core/validation/package.json +1 -1
- package/core/vite/dist/index.js +1 -1
- package/core/vite/package.json +1 -1
- package/core/vite/src/functions.ts +0 -1
- package/core/vite/src/index.ts +1 -1
- package/core/vite/src/plugin/docs.ts +2 -0
- package/core/vite/src/plugin/stacks.ts +3 -2
- package/core/vite/src/web-components.ts +2 -2
- package/core/whois/package.json +1 -1
- package/core/whois/src/index.ts +2 -2
- package/core/x-ray/package.json +1 -1
- package/core/zsh-buddy/package.json +1 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +1 -1
- package/core/actions/src/database/mydb.sqlite +0 -0
- package/core/actions/src/database/stacks.sqlite +0 -0
- package/core/server/src/api.ts +0 -5
|
@@ -27,5 +27,5 @@ await runCommand("bun zip.ts", {
|
|
|
27
27
|
log.info("Preparing Deployment...");
|
|
28
28
|
var profile = process.env.AWS_PROFILE || "stacks";
|
|
29
29
|
await runCommand(`bunx cdk deploy --require-approval never --profile="${profile}"`, {
|
|
30
|
-
cwd: p.
|
|
30
|
+
cwd: p.frameworkCloudPath()
|
|
31
31
|
});
|
|
@@ -7,7 +7,7 @@ import {projectPath} from "@stacksjs/path";
|
|
|
7
7
|
import * as storage from "@stacksjs/storage";
|
|
8
8
|
import {NpmScript} from "@stacksjs/enums";
|
|
9
9
|
// package.json
|
|
10
|
-
var version = "0.58.
|
|
10
|
+
var version = "0.58.65";
|
|
11
11
|
|
|
12
12
|
// src/upgrade.ts
|
|
13
13
|
function checkForUncommittedChanges(options) {
|
|
@@ -16,10 +16,12 @@ export class Action {
|
|
|
16
16
|
rate?: JobOptions['rate']
|
|
17
17
|
tries?: JobOptions['tries']
|
|
18
18
|
backoff?: JobOptions['backoff']
|
|
19
|
-
enabled?:
|
|
19
|
+
enabled?: boolean
|
|
20
20
|
handle: () => Promise<any>
|
|
21
21
|
|
|
22
22
|
constructor({ name, description, handle, rate, tries, backoff, enabled }: ActionOptions) {
|
|
23
|
+
// log.debug(`Action ${name} created`) // TODO
|
|
24
|
+
|
|
23
25
|
this.name = name
|
|
24
26
|
this.description = description
|
|
25
27
|
this.rate = rate
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// import { database } from '@stacksjs/config'
|
|
2
|
-
import { seed } from '@stacksjs/database'
|
|
3
|
-
|
|
4
|
-
await seed()
|
|
2
|
+
// import { seed } from '@stacksjs/database'
|
|
3
|
+
//
|
|
4
|
+
// await seed()
|
|
@@ -42,5 +42,5 @@ const profile = process.env.AWS_PROFILE || 'stacks'
|
|
|
42
42
|
|
|
43
43
|
// TODO: ensure we check whether cdk bootstrap needs to be run
|
|
44
44
|
await runCommand(`bunx cdk deploy --require-approval never --profile="${profile}"`, {
|
|
45
|
-
cwd: p.
|
|
45
|
+
cwd: p.frameworkCloudPath(),
|
|
46
46
|
})
|
|
@@ -2,7 +2,7 @@ import * as storage from '@stacksjs/storage'
|
|
|
2
2
|
import { buddyOptions, runCommand, runCommands } from '@stacksjs/cli'
|
|
3
3
|
import { log } from '@stacksjs/logging'
|
|
4
4
|
import * as p from '@stacksjs/path'
|
|
5
|
-
import type { ActionOptions,
|
|
5
|
+
import type { ActionOptions, Subprocess } from '@stacksjs/types'
|
|
6
6
|
import type { Result } from '@stacksjs/error-handling'
|
|
7
7
|
import { err, handleError } from '@stacksjs/error-handling'
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ import { err, handleError } from '@stacksjs/error-handling'
|
|
|
13
13
|
* @param options The options to pass to the command.
|
|
14
14
|
* @returns The result of the command.
|
|
15
15
|
*/
|
|
16
|
-
export async function runAction(action: string, options?: ActionOptions): Promise<Result<Subprocess,
|
|
16
|
+
export async function runAction(action: string, options?: ActionOptions): Promise<Result<Subprocess, Error>> {
|
|
17
17
|
const opts = buddyOptions()
|
|
18
18
|
const path = p.relativeActionsPath(`${action}.ts`)
|
|
19
19
|
const cmd = `bun --bun ${path} ${opts}`.trimEnd()
|
package/core/ai/package.json
CHANGED
package/core/alias/package.json
CHANGED
package/core/api/package.json
CHANGED
package/core/arrays/package.json
CHANGED
|
@@ -74,12 +74,12 @@ export function partition<T>(array: readonly T[], ...filters: PartitionFilter<T>
|
|
|
74
74
|
let i = 0
|
|
75
75
|
for (const filter of filters) {
|
|
76
76
|
if (filter(e, idx, arr)) {
|
|
77
|
-
result[i]
|
|
77
|
+
result[i]!.push(e)
|
|
78
78
|
return
|
|
79
79
|
}
|
|
80
80
|
i += 1
|
|
81
81
|
}
|
|
82
|
-
result[i]
|
|
82
|
+
result[i]!.push(e)
|
|
83
83
|
})
|
|
84
84
|
return result
|
|
85
85
|
}
|
|
@@ -266,7 +266,7 @@ export function sample<T>(arr: T[], count: number) {
|
|
|
266
266
|
export function shuffle<T>(array: T[]): T[] {
|
|
267
267
|
for (let i = array.length - 1; i > 0; i--) {
|
|
268
268
|
const j = Math.floor(Math.random() * (i + 1));
|
|
269
|
-
[array[i]
|
|
269
|
+
[array[i]!, array[j]!] = [array[j]!, array[i]!]
|
|
270
270
|
}
|
|
271
271
|
return array
|
|
272
272
|
}
|
package/core/auth/package.json
CHANGED
package/core/buddy/dist/cli.js
CHANGED
|
@@ -3945,7 +3945,7 @@ async function main() {
|
|
|
3945
3945
|
]);
|
|
3946
3946
|
buddy.command("inspire", "Inspire yourself with a random quote").alias("insp").action(() => {
|
|
3947
3947
|
log.info(quotes.random());
|
|
3948
|
-
log.success("Have a great
|
|
3948
|
+
log.success("Have a great days!");
|
|
3949
3949
|
});
|
|
3950
3950
|
buddy.on("inspire:*", () => {
|
|
3951
3951
|
console.log("Invalid command:", buddy.args.join(" "));
|
package/core/buddy/package.json
CHANGED
package/core/buddy/src/cli.ts
CHANGED
package/core/build/package.json
CHANGED
package/core/cache/package.json
CHANGED
|
@@ -1,127 +1,113 @@
|
|
|
1
|
-
import { DynamoDB, ListTablesCommand } from '@aws-sdk/client-dynamodb'
|
|
2
|
-
import { expect, it } from '@stacksjs/testing'
|
|
3
|
-
|
|
4
|
-
const dynamodb = new DynamoDB({ region: 'us-east-1' })
|
|
5
|
-
|
|
6
|
-
describe('dynamoDB test', () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
async function createTable() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// TODO: needs to be imported to cache package
|
|
63
|
-
async function set(key: string, value: string | number): Promise<void> {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// TODO: needs to be imported to cache package
|
|
86
|
-
async function get(key: string): Promise<string | undefined | null> {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// TODO: needs to be imported to cache package
|
|
108
|
-
async function remove(key: string): Promise<void> {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const params = {
|
|
112
|
-
TableName: 'cache',
|
|
113
|
-
Key: {
|
|
114
|
-
[keyAttribute]: {
|
|
115
|
-
S: key,
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
await dynamodb.deleteItem(params)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// TODO: needs to be imported to cache package
|
|
124
|
-
// async function del(key: string): Promise<void> {
|
|
1
|
+
// import { DynamoDB, ListTablesCommand } from '@aws-sdk/client-dynamodb'
|
|
2
|
+
// import { expect, it } from '@stacksjs/testing'
|
|
3
|
+
//
|
|
4
|
+
// const dynamodb = new DynamoDB({ region: 'us-east-1' })
|
|
5
|
+
//
|
|
6
|
+
// describe('dynamoDB test', () => {
|
|
7
|
+
// it('it should create a table for dynamodb cache', async () => {
|
|
8
|
+
// await createTable()
|
|
9
|
+
// })
|
|
10
|
+
//
|
|
11
|
+
// it('it should set dynamodb cache', async () => {
|
|
12
|
+
// await set('foo', 'bar')
|
|
13
|
+
// const value = await get('foo')
|
|
14
|
+
// expect(value).toBe('bar')
|
|
15
|
+
// })
|
|
16
|
+
//
|
|
17
|
+
// it('it should get dynamodb cache', async () => {
|
|
18
|
+
// await set('foo', 'bar')
|
|
19
|
+
// const value = await get('foo')
|
|
20
|
+
// expect(value).toBe('bar')
|
|
21
|
+
// })
|
|
22
|
+
//
|
|
23
|
+
// it('it should delete dynamodb cache', async () => {
|
|
24
|
+
// await set('foo', 'bar')
|
|
25
|
+
// await remove('foo')
|
|
26
|
+
// const value = await get('foo')
|
|
27
|
+
// expect(value).toBe(null)
|
|
28
|
+
// })
|
|
29
|
+
// })
|
|
30
|
+
//
|
|
31
|
+
// async function createTable() {
|
|
32
|
+
// const tables = await dynamodb.send(new ListTablesCommand({}))
|
|
33
|
+
//
|
|
34
|
+
// const tableExists = tables.TableNames?.includes('cache')
|
|
35
|
+
//
|
|
36
|
+
// if (tableExists)
|
|
37
|
+
// return
|
|
38
|
+
//
|
|
39
|
+
// const params = {
|
|
40
|
+
// AttributeDefinitions: [
|
|
41
|
+
// {
|
|
42
|
+
// AttributeName: 'key',
|
|
43
|
+
// AttributeType: 'S',
|
|
44
|
+
// },
|
|
45
|
+
// ],
|
|
46
|
+
// KeySchema: [
|
|
47
|
+
// {
|
|
48
|
+
// AttributeName: 'key',
|
|
49
|
+
// KeyType: 'HASH',
|
|
50
|
+
// },
|
|
51
|
+
// ],
|
|
52
|
+
// ProvisionedThroughput: {
|
|
53
|
+
// ReadCapacityUnits: 5,
|
|
54
|
+
// WriteCapacityUnits: 5,
|
|
55
|
+
// },
|
|
56
|
+
// TableName: 'cache',
|
|
57
|
+
// }
|
|
58
|
+
//
|
|
59
|
+
// await dynamodb.createTable(params)
|
|
60
|
+
// }
|
|
61
|
+
//
|
|
62
|
+
// // TODO: needs to be imported to cache package
|
|
63
|
+
// async function set(key: string, value: string | number): Promise<void> {
|
|
64
|
+
// // eslint-disable-next-line no-console
|
|
65
|
+
// console.log('set', key, value)
|
|
66
|
+
// return Promise.resolve()
|
|
67
|
+
// // const valueAttribute = 'value'
|
|
68
|
+
// // const keyAttribute = 'key'
|
|
69
|
+
// //
|
|
70
|
+
// // const params: PutItemCommandInput = {
|
|
71
|
+
// // TableName: 'cache',
|
|
72
|
+
// // Item: {
|
|
73
|
+
// // [keyAttribute]: {
|
|
74
|
+
// // S: key,
|
|
75
|
+
// // },
|
|
76
|
+
// // [valueAttribute]: {
|
|
77
|
+
// // [getValueType(value)]: serialize(value),
|
|
78
|
+
// // },
|
|
79
|
+
// // },
|
|
80
|
+
// // }
|
|
81
|
+
// //
|
|
82
|
+
// // await dynamodb.putItem(params)
|
|
83
|
+
// }
|
|
84
|
+
//
|
|
85
|
+
// // TODO: needs to be imported to cache package
|
|
86
|
+
// async function get(key: string): Promise<string | undefined | null> {
|
|
87
|
+
// const valueAttribute = 'value'
|
|
88
|
+
// const keyAttribute = 'key'
|
|
89
|
+
//
|
|
90
|
+
// const params = {
|
|
91
|
+
// TableName: 'cache',
|
|
92
|
+
// Key: {
|
|
93
|
+
// [keyAttribute]: {
|
|
94
|
+
// S: key,
|
|
95
|
+
// },
|
|
96
|
+
// },
|
|
97
|
+
// }
|
|
98
|
+
//
|
|
99
|
+
// const response = await dynamodb.getItem(params)
|
|
100
|
+
//
|
|
101
|
+
// if (!response.Item)
|
|
102
|
+
// return null
|
|
103
|
+
//
|
|
104
|
+
// return response.Item[valueAttribute].S ?? response.Item[valueAttribute].N
|
|
105
|
+
// }
|
|
106
|
+
//
|
|
107
|
+
// // TODO: needs to be imported to cache package
|
|
108
|
+
// async function remove(key: string): Promise<void> {
|
|
109
|
+
// const keyAttribute = 'key'
|
|
110
|
+
//
|
|
125
111
|
// const params = {
|
|
126
112
|
// TableName: 'cache',
|
|
127
113
|
// Key: {
|
|
@@ -130,6 +116,20 @@ async function remove(key: string): Promise<void> {
|
|
|
130
116
|
// },
|
|
131
117
|
// },
|
|
132
118
|
// }
|
|
133
|
-
|
|
119
|
+
//
|
|
134
120
|
// await dynamodb.deleteItem(params)
|
|
135
121
|
// }
|
|
122
|
+
//
|
|
123
|
+
// // TODO: needs to be imported to cache package
|
|
124
|
+
// // async function del(key: string): Promise<void> {
|
|
125
|
+
// // const params = {
|
|
126
|
+
// // TableName: 'cache',
|
|
127
|
+
// // Key: {
|
|
128
|
+
// // [keyAttribute]: {
|
|
129
|
+
// // S: key,
|
|
130
|
+
// // },
|
|
131
|
+
// // },
|
|
132
|
+
// // }
|
|
133
|
+
//
|
|
134
|
+
// // await dynamodb.deleteItem(params)
|
|
135
|
+
// // }
|