Skip to content

Commit 3ad874d

Browse files
committed
chore: wip
chore: wip
1 parent de482c7 commit 3ad874d

File tree

112 files changed

+738
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+738
-436
lines changed

.stacks/core/actions/src/action.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export class Action {
2+
name: string
3+
description: string
4+
handle: () => Promise<string>
5+
6+
constructor({ name, description, handle }: { name: string; description: string; handle: () => Promise<string> }) {
7+
this.name = name
8+
this.description = description
9+
this.handle = handle
10+
}
11+
}

.stacks/core/actions/src/database/fields.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ async function extractModelRule() {
2424
const regex = /rule:.*$/gm
2525

2626
let match: RegExpExecArray | null
27-
while ((match = regex.exec(code)) !== null) rules.push(match[0])
27+
match = regex.exec(code)
28+
while (match !== null) {
29+
rules.push(match[0])
30+
match = regex.exec(code)
31+
}
2832
}
2933

3034
await extractModelRule()

.stacks/core/actions/src/database/user-migration.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import process from 'node:process'
12
import type { Kysely } from 'kysely'
23
import { sql } from 'kysely'
34
import { db } from '@stacksjs/database'
5+
import { ExitCode } from '@stacksjs/types'
46

57
export async function up(db: Kysely<any>): Promise<void> {
68
await db.schema
@@ -15,4 +17,4 @@ export async function up(db: Kysely<any>): Promise<void> {
1517

1618
await up(db)
1719

18-
process.exit(0)
20+
process.exit(ExitCode.Success)

.stacks/core/actions/src/deploy/create-receipt-rule.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import process from 'node:process'
2+
import { log } from '@stacksjs/cli'
13
import { S3 } from '@aws-sdk/client-s3'
24
import { SES } from '@aws-sdk/client-ses'
35
import { ExitCode } from '@stacksjs/types'
4-
import process from 'node:process'
56

67
const ses = new SES({ apiVersion: '2010-12-01' })
78
const s3 = new S3({ apiVersion: '2006-03-01' })
@@ -15,7 +16,6 @@ const s3 = new S3({ apiVersion: '2006-03-01' })
1516
let bucketName: string | undefined
1617
const data = await s3.listBuckets({})
1718

18-
console.log('Data', data)
1919
if (data.Buckets)
2020
bucketName = data.Buckets.find(bucket => bucket.Name && bucket.Name.includes('-email-'))?.Name
2121

@@ -48,7 +48,7 @@ const params: any = {
4848

4949
try {
5050
const data = await ses.createReceiptRule(params)
51-
console.log('Success', data)
51+
log.info('Success', data)
5252
}
5353
catch (error) {
5454
console.error(error)

.stacks/core/actions/src/dev/api.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { path as p } from '@stacksjs/path'
2-
import { runCommand, log } from '@stacksjs/cli'
3-
import { parseOptions } from '@stacksjs/cli'
2+
import { log, parseOptions, runCommand } from '@stacksjs/cli'
43
import { serve } from '@stacksjs/router'
54

65
const options = parseOptions()

.stacks/core/actions/src/dev/components.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { DeployOptions } from '@stacksjs/types'
55
const options: DeployOptions = parseOptions()
66

77
if (options.verbose)
8+
// eslint-disable-next-line no-console
89
console.log('dev components options', options)
910

1011
await runCommand(`bunx --bun vite --config ${vitePath('src/vue-components.ts')}`, {

.stacks/core/actions/src/dev/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { log } from '@stacksjs/logging'
22
import { runCommand } from '@stacksjs/cli'
3-
import { runAction } from '../helpers'
43
import type { DevOptions } from '@stacksjs/types'
54
import { Action, NpmScript } from '@stacksjs/types'
5+
import { runAction } from '../helpers'
66

77
export async function runDevServer(options: DevOptions) {
88
log.info('Starting your Frontend Engine...')

.stacks/core/actions/src/generate/model-classes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import process from 'node:process'
12
import { db } from '@stacksjs/database'
2-
33
import type { Collection } from '@stacksjs/collections'
44
import { collect } from '@stacksjs/collections'
55

.stacks/core/actions/src/generate/model-generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ const writer = file.writer()
99

1010
writer.write(code)
1111

12-
await writer.end()
12+
await writer.end()

.stacks/core/actions/src/generate/pkgx-file.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// generates the pkgx file based on the user configuration
2-
// @ts-ignore
3-
import data from '../../../../../pkgx.yaml'
42
import { config } from '@stacksjs/config'
53
import { runCommand } from '@stacksjs/cli'
64

5+
// @ts-expect-error - no types
6+
import data from '../../../../../pkgx.yaml'
7+
78
if (!data)
89
throw new Error('pkgx.yaml file not found')
910

0 commit comments

Comments
 (0)