stacks 0.58.63 → 0.58.64
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/index.js +3 -0
- package/core/actions/dist/src/release.js +5 -2
- package/core/actions/dist/src/upgrade.js +1 -1
- package/core/actions/package.json +1 -1
- package/core/actions/src/action.ts +4 -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 +7 -7
- 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/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 +1 -1
- 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 +1 -1
- 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 +30 -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 +1 -1
- 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 +1 -1
- 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
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export {
|
|
2
|
+
assert,
|
|
3
|
+
it,
|
|
4
|
+
expect,
|
|
5
|
+
test,
|
|
6
|
+
describe,
|
|
7
|
+
beforeEach,
|
|
8
|
+
afterEach,
|
|
9
|
+
beforeAll,
|
|
10
|
+
afterAll,
|
|
11
|
+
} from 'vitest'
|
|
12
|
+
export * as unit from 'vitest'
|
|
3
13
|
export * as feature from '@playwright/test'
|
package/core/tinker/package.json
CHANGED
package/core/tunnel/package.json
CHANGED
package/core/types/package.json
CHANGED
package/core/types/src/cli.ts
CHANGED
|
@@ -29,7 +29,7 @@ export type Writable =
|
|
|
29
29
|
|
|
30
30
|
export type In = Readable
|
|
31
31
|
export type Out = Writable
|
|
32
|
-
export type Err = Writable
|
|
32
|
+
// export type Err = Writable // TODO: find a workaround for this to not clash with our other Err export
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* The file descriptor for the standard input. It may be:
|
|
@@ -29,11 +29,6 @@ export type Jobs = Job[]
|
|
|
29
29
|
export type CronJob = Job
|
|
30
30
|
export type CronJobs = Jobs
|
|
31
31
|
|
|
32
|
-
// export type Job = JobOptions
|
|
33
|
-
// export type Jobs = Job[]
|
|
34
|
-
// export type CronJob = Job
|
|
35
|
-
// export type CronJobs = Jobs
|
|
36
|
-
|
|
37
32
|
export enum Every {
|
|
38
33
|
// Second = '* * * * * *',
|
|
39
34
|
// FiveSeconds = '*/5 * * * * *',
|
package/core/types/src/errors.ts
CHANGED
package/core/types/src/router.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Action } from '@stacksjs/actions'
|
|
2
|
+
|
|
1
3
|
export interface NitroEventHandler {
|
|
2
4
|
/**
|
|
3
5
|
* Path prefix or route
|
|
@@ -41,7 +43,7 @@ export interface Route {
|
|
|
41
43
|
url: string // used synonymously with uri
|
|
42
44
|
method: HttpMethod
|
|
43
45
|
pattern: RegExp
|
|
44
|
-
callback: RouteCallback | ActionName
|
|
46
|
+
callback: RouteCallback | ActionName | Action
|
|
45
47
|
paramNames: string[]
|
|
46
48
|
middleware?: string | string[]
|
|
47
49
|
statusCode?: StatusCode
|
|
@@ -57,12 +59,12 @@ export interface MiddlewareType {
|
|
|
57
59
|
export type StatusCode = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 500
|
|
58
60
|
export type RedirectCode = Extract<StatusCode, 301 | 302>
|
|
59
61
|
|
|
60
|
-
export type
|
|
62
|
+
export type MiddlewareFn = () => void
|
|
61
63
|
|
|
62
64
|
export interface Middlewares {
|
|
63
|
-
logger:
|
|
64
|
-
auth:
|
|
65
|
-
[key: string]:
|
|
65
|
+
logger: MiddlewareFn
|
|
66
|
+
auth: MiddlewareFn
|
|
67
|
+
[key: string]: MiddlewareFn
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
export interface RouteGroupOptions {
|
package/core/ui/package.json
CHANGED
package/core/utils/dist/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/base.ts
|
|
3
3
|
import {toString} from "@stacksjs/strings";
|
|
4
|
-
function assert(condition, message) {
|
|
5
|
-
if (!condition)
|
|
6
|
-
throw new Error(message);
|
|
7
|
-
}
|
|
8
4
|
async function loop(times, callback) {
|
|
9
5
|
[...Array(times)].forEach(async (item, i) => await callback(i));
|
|
10
6
|
}
|
|
@@ -516,7 +512,7 @@ function retry(fn, options) {
|
|
|
516
512
|
attempt();
|
|
517
513
|
});
|
|
518
514
|
}
|
|
519
|
-
|
|
515
|
+
function calculateDelay(attemptCount, initialDelay, backoffFactor, jitter) {
|
|
520
516
|
let delay = initialDelay * backoffFactor ** attemptCount;
|
|
521
517
|
if (jitter) {
|
|
522
518
|
const random = Math.random();
|
|
@@ -524,7 +520,7 @@ var calculateDelay = function(attemptCount, initialDelay, backoffFactor, jitter)
|
|
|
524
520
|
delay = delay + jitterValue * (random - 0.5) * 2;
|
|
525
521
|
}
|
|
526
522
|
return delay;
|
|
527
|
-
}
|
|
523
|
+
}
|
|
528
524
|
// src/sleep.ts
|
|
529
525
|
function sleep(ms) {
|
|
530
526
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -922,7 +918,7 @@ function prettyBytes(number, options) {
|
|
|
922
918
|
return prefix + numberString + separator + unit;
|
|
923
919
|
}
|
|
924
920
|
// package.json
|
|
925
|
-
var version = "0.58.
|
|
921
|
+
var version = "0.58.64";
|
|
926
922
|
export {
|
|
927
923
|
wordChar,
|
|
928
924
|
wordBoundary,
|
|
@@ -1293,6 +1289,7 @@ export {
|
|
|
1293
1289
|
char,
|
|
1294
1290
|
caseInsensitive,
|
|
1295
1291
|
carriageReturn,
|
|
1292
|
+
calculateDelay,
|
|
1296
1293
|
breakpointsVuetify,
|
|
1297
1294
|
breakpointsTailwind,
|
|
1298
1295
|
breakpointsSematic,
|
|
@@ -1303,7 +1300,6 @@ export {
|
|
|
1303
1300
|
batchInvoke,
|
|
1304
1301
|
autoResetRef,
|
|
1305
1302
|
asyncComputed,
|
|
1306
|
-
assert,
|
|
1307
1303
|
anyOf,
|
|
1308
1304
|
and,
|
|
1309
1305
|
allocate,
|
package/core/utils/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// inspired by vue-use
|
|
2
2
|
import { fs } from '@stacksjs/storage'
|
|
3
3
|
import type { PackageManifest } from '@vueuse/metadata'
|
|
4
|
-
import filesize from 'filesize'
|
|
4
|
+
import { filesize } from 'filesize'
|
|
5
5
|
import { markdownTable } from 'markdown-table'
|
|
6
6
|
import { version } from '../package.json'
|
|
7
7
|
import { getExportsSize } from '../src/export-size'
|
|
@@ -47,8 +47,8 @@ export const packages: PackageManifest[] = [
|
|
|
47
47
|
async function run() {
|
|
48
48
|
// made shared library imported can resolve correctly
|
|
49
49
|
// const packagesRoot = resolve(__dirname, '../../..', 'core')
|
|
50
|
-
// await fs.writeFile(join(packagesRoot, 'shared/index.mjs'), 'export * from "./dist/index.js"', 'utf-8')
|
|
51
|
-
// await fs.writeFile(join(packagesRoot, 'core/index.mjs'), 'export * from "./dist/index.js"', 'utf-8')
|
|
50
|
+
// await fs.writeFile(join(packagesRoot, 'shared/index.mjs'), 'export * from "./dist/index.js"', 'utf-8')))
|
|
51
|
+
// await fs.writeFile(join(packagesRoot, 'core/index.mjs'), 'export * from "./dist/index.js"', 'utf-8')))
|
|
52
52
|
// await fs.copy(join(packagesRoot, 'shared/dist'), join(packagesRoot, 'core/dist/node_modules/@vueuse/shared'), { overwrite: true })
|
|
53
53
|
|
|
54
54
|
let md = '# Export size\n\n'
|
package/core/utils/src/base.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { toString } from '@stacksjs/strings'
|
|
2
2
|
|
|
3
|
-
export function assert(condition: boolean, message: string): asserts condition {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
3
|
+
// export function assert(condition: boolean, message: string): asserts condition {
|
|
4
|
+
// if (!condition)
|
|
5
|
+
// throw new Error(message)
|
|
6
|
+
// }
|
|
7
7
|
|
|
8
8
|
// export function noop() {}
|
|
9
9
|
|
|
@@ -6,7 +6,7 @@ import type { Result } from '@stacksjs/error-handling'
|
|
|
6
6
|
import { err, handleError, ok } from '@stacksjs/error-handling'
|
|
7
7
|
import { frameworkPath, projectPath } from '@stacksjs/path'
|
|
8
8
|
import * as storage from '@stacksjs/storage'
|
|
9
|
-
import type { CliOptions, Manifest,
|
|
9
|
+
import type { CliOptions, Manifest, SyncSubprocess } from '@stacksjs/types'
|
|
10
10
|
import type { NpmScript } from '@stacksjs/enums'
|
|
11
11
|
import { Action } from '@stacksjs/enums'
|
|
12
12
|
import { parse } from 'yaml'
|
|
@@ -19,7 +19,7 @@ export async function packageManager() {
|
|
|
19
19
|
return packageManager
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export async function initProject(): Promise<Result<SyncSubprocess,
|
|
22
|
+
export async function initProject(): Promise<Result<SyncSubprocess, Error>> {
|
|
23
23
|
if (app.env !== 'production')
|
|
24
24
|
log.info('Project not yet initialized, generating application key...')
|
|
25
25
|
else
|
|
@@ -131,7 +131,7 @@ export async function setEnvValue(key: string, value: string) {
|
|
|
131
131
|
/**
|
|
132
132
|
* Runs the specified NPM script in the package.json file.
|
|
133
133
|
*/
|
|
134
|
-
export async function runNpmScript(script: NpmScript, options?: CliOptions): Promise<Result<SyncSubprocess,
|
|
134
|
+
export async function runNpmScript(script: NpmScript, options?: CliOptions): Promise<Result<SyncSubprocess, Error>> {
|
|
135
135
|
const { data: manifest } = await storage.readJsonFile('package.json', frameworkPath())
|
|
136
136
|
|
|
137
137
|
if (isManifest(manifest) && hasScript(manifest, script)) // simple, yet effective check to see if the script exists
|
package/core/utils/src/retry.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function retry(fn, options) {
|
|
1
|
+
export function retry(fn: Function, options: any): Promise<any> {
|
|
2
2
|
const { retries = 3, initialDelay = 1000, backoffFactor = 2, jitter = true } = options
|
|
3
3
|
|
|
4
4
|
return new Promise((resolve, reject) => {
|
|
@@ -22,7 +22,7 @@ export function retry(fn, options) {
|
|
|
22
22
|
})
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function calculateDelay(attemptCount, initialDelay, backoffFactor, jitter) {
|
|
25
|
+
export function calculateDelay(attemptCount: number, initialDelay: number, backoffFactor: number, jitter?: boolean): number {
|
|
26
26
|
let delay = initialDelay * backoffFactor ** attemptCount
|
|
27
27
|
if (jitter) {
|
|
28
28
|
const random = Math.random() // Generates a number between 0 and 1
|
package/core/vite/dist/index.js
CHANGED
|
@@ -609,7 +609,7 @@ var web_components_default = defineConfig6(({ command }) => {
|
|
|
609
609
|
// src/plugin/docs.ts
|
|
610
610
|
import {kolorist as c2} from "@stacksjs/cli";
|
|
611
611
|
// package.json
|
|
612
|
-
var version = "0.58.
|
|
612
|
+
var version = "0.58.64";
|
|
613
613
|
|
|
614
614
|
// src/plugin/docs.ts
|
|
615
615
|
var docsEngine = {
|
package/core/vite/package.json
CHANGED
package/core/vite/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export type { BuildOptions as ViteBuildOptions, ViteDevServer } from 'vite'
|
|
2
2
|
// import type { Env } from '@stacksjs/env'
|
|
3
3
|
|
|
4
4
|
// export function loadEnv(...args: Parameters<typeof viteLoadEnv>): Env {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
+
// @ts-expect-error - unsure why this is an error because those are valid exports
|
|
2
3
|
import type { ViteDevServer as DevServer, Plugin } from 'vite'
|
|
3
4
|
import { kolorist as c, parseOptions } from '@stacksjs/cli'
|
|
4
5
|
import { localUrl } from '@stacksjs/config'
|
|
@@ -19,7 +20,7 @@ interface StacksPluginOptions {
|
|
|
19
20
|
// https://github.com/hannoeru/vite-plugin-pages
|
|
20
21
|
export function stacks(options?: StacksPluginOptions): Plugin {
|
|
21
22
|
if (!options)
|
|
22
|
-
options = parseOptions()
|
|
23
|
+
options = parseOptions() as StacksPluginOptions // TODO: low priority, but we can do better
|
|
23
24
|
|
|
24
25
|
return {
|
|
25
26
|
name: 'stacks',
|
|
@@ -43,7 +44,7 @@ export function stacks(options?: StacksPluginOptions): Plugin {
|
|
|
43
44
|
|
|
44
45
|
// Transform hook for transforming individual files
|
|
45
46
|
// async transform(code, id) {
|
|
46
|
-
transform(code) {
|
|
47
|
+
transform(code: any) {
|
|
47
48
|
return code // Return the unmodified code
|
|
48
49
|
},
|
|
49
50
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ViteConfig } from '@stacksjs/types'
|
|
2
1
|
import { path as p } from '@stacksjs/path'
|
|
3
2
|
import { server } from '@stacksjs/server'
|
|
4
3
|
import { alias } from '@stacksjs/alias'
|
|
@@ -9,7 +8,7 @@ import type { ViteBuildOptions } from '.'
|
|
|
9
8
|
|
|
10
9
|
// const isWebComponent = true
|
|
11
10
|
|
|
12
|
-
export const webComponentsConfig
|
|
11
|
+
export const webComponentsConfig = {
|
|
13
12
|
root: p.frameworkPath('libs/components/web'),
|
|
14
13
|
envDir: p.projectPath(),
|
|
15
14
|
envPrefix: 'FRONTEND_',
|
|
@@ -58,6 +57,7 @@ export function webComponentsBuildOptions(): ViteBuildOptions {
|
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
|
|
60
|
+
// @ts-expect-error - resolve this later
|
|
61
61
|
export default defineConfig(({ command }) => {
|
|
62
62
|
if (command === 'serve')
|
|
63
63
|
return webComponentsConfig
|
package/core/whois/package.json
CHANGED
package/core/whois/src/index.ts
CHANGED
|
@@ -22,7 +22,7 @@ async function findWhoIsServer(tld: string): Promise<string> {
|
|
|
22
22
|
const body = await res.text()
|
|
23
23
|
const server = body.match(/whois:\s+(.*)\s+/)
|
|
24
24
|
if (server)
|
|
25
|
-
return server[1]
|
|
25
|
+
return server[1]!
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
catch (err) {
|
|
@@ -103,7 +103,7 @@ function getTLD(domain: string): keyof typeof SERVERS {
|
|
|
103
103
|
|
|
104
104
|
// get whois query parameters if exist on parameters.json for whois server
|
|
105
105
|
function getParameters(server: string): string | undefined {
|
|
106
|
-
return PARAMETERS[server]
|
|
106
|
+
return (PARAMETERS as { [key: string]: string })[server]
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
package/core/x-ray/package.json
CHANGED
package/ide/vscode/package.json
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|