Skip to content

Commit cb92c7e

Browse files
committed
chore: wip
1 parent fdd3e74 commit cb92c7e

File tree

12 files changed

+43
-66
lines changed

12 files changed

+43
-66
lines changed

bun.lockb

88 Bytes
Binary file not shown.

storage/framework/stacks/core/actions/src/ai/request-model-access.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import process from 'node:process'
12
import * as AWS4 from 'aws4'
23

34
// todo: Remove axios and use the AWS SDK instead if possible, but I couldn't get it to work. At least, move to our own fetch wrapper
@@ -11,10 +12,10 @@ import { ai } from '@stacksjs/config'
1112
process.env.AWS_REGION = 'us-east-1'
1213

1314
config.getCredentials((err) => {
14-
if (err) { console.log(err.stack) }
15+
if (err) { log.info(err.stack) }
1516
else if (config.credentials) {
1617
const { accessKeyId, secretAccessKey, sessionToken } = config.credentials
17-
console.log('AWS credentials are set', accessKeyId, secretAccessKey, sessionToken)
18+
log.info('AWS credentials are set', accessKeyId, secretAccessKey, sessionToken)
1819

1920
const endpoint = 'https://bedrock.us-east-1.amazonaws.com/foundation-model-entitlement'
2021
const region = 'us-east-1'
@@ -28,7 +29,7 @@ config.getCredentials((err) => {
2829
}
2930

3031
for (const model of models) {
31-
console.log(`Requesting access to model ${model}`)
32+
log.info(`Requesting access to model ${model}`)
3233
const request = {
3334
host: 'bedrock.us-east-1.amazonaws.com',
3435
method: 'POST',
@@ -61,10 +62,10 @@ config.getCredentials((err) => {
6162
data: signedRequest.body,
6263
})
6364
.then((response) => {
64-
console.log(response.data)
65+
log.info(response.data)
6566
})
6667
.catch((error) => {
67-
console.error(error.data)
68+
log.error(error.data)
6869
})
6970
}
7071
}

storage/framework/stacks/core/actions/src/deploy/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import process from 'node:process'
12
import { log, runCommand } from '@stacksjs/cli'
23
import { config } from '@stacksjs/config'
34
import { path as p } from '@stacksjs/path'

storage/framework/stacks/core/actions/src/start-caddy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { handleError } from '@stacksjs/error-handling'
22
import { runCommand } from '@stacksjs/cli'
33
import { path as p } from '@stacksjs/path'
44

5+
// eslint-disable-next-line no-console
56
console.log('Starting Caddy...')
67

78
const result = await runCommand('caddy run', {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { runCommand } from '@stacksjs/cli'
22

33
const command: string = 'bun build ./src/index.ts --outdir dist --format esm --target bun'
4-
const result = await runCommand(command, {
4+
5+
await runCommand(command, {
56
cwd: import.meta.dir,
67
})

storage/framework/stacks/core/api/src/index.ts

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,7 @@ export async function useHttpFetch(endpoint = '') {
6262
},
6363
}
6464

65-
try {
66-
const result: FetchResponse = await ofetch(url, parameters)
67-
return result
68-
}
69-
catch (err: any) {
70-
throw err
71-
}
65+
return await ofetch(url, parameters) as FetchResponse
7266
}
7367

7468
async function patch(url: string, params?: Params): Promise<any> {
@@ -88,15 +82,8 @@ export async function useHttpFetch(endpoint = '') {
8882
}
8983

9084
loading.value = true
91-
try {
92-
const result: FetchResponse = await ofetch(url, parameters)
9385

94-
loading.value = false
95-
return result
96-
}
97-
catch (err: any) {
98-
throw err
99-
}
86+
return await ofetch(url, parameters) as FetchResponse
10087
}
10188

10289
async function destroy(url: string, params?: Params): Promise<any> {
@@ -115,15 +102,8 @@ export async function useHttpFetch(endpoint = '') {
115102
}
116103

117104
loading.value = true
118-
try {
119-
const result: FetchResponse = await ofetch(url, parameters)
120-
121-
loading.value = false
122-
return result
123-
}
124-
catch (err: any) {
125-
throw err
126-
}
105+
106+
return await ofetch(url, parameters) as FetchResponse
127107
}
128108

129109
function setToken(authToken: string) {

storage/framework/stacks/core/cloud/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export async function deleteIamUsers() {
203203

204204
const promises = users.map(async (user) => {
205205
const userName = user.UserName || ''
206-
console.log(`Deleting IAM user: ${userName}`)
206+
log.info(`Deleting IAM user: ${userName}`)
207207

208208
// Get the list of policies attached to the user
209209
const policies = await iam.listAttachedUserPolicies({ UserName: userName })

storage/framework/stacks/core/eslint-config/eslint.config.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

storage/framework/stacks/core/eslint-config/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
"eslint-plugin-react": "^7.33.2",
3838
"eslint-plugin-react-hooks": "^4.6.0",
3939
"eslint-plugin-react-refresh": "^0.4.5",
40-
"eslint-ts-patch": "^8.55.0-1"
40+
"eslint-plugin-svelte": "^2.34.1",
41+
"eslint-ts-patch": "^8.55.0-1",
42+
"svelte-eslint-parser": "^0.33.1"
4143
},
4244
"peerDependenciesMeta": {
4345
"@unocss/eslint-plugin": {
@@ -54,6 +56,12 @@
5456
},
5557
"eslint-plugin-react-refresh": {
5658
"optional": true
59+
},
60+
"eslint-plugin-svelte": {
61+
"optional": true
62+
},
63+
"svelte-eslint-parser": {
64+
"optional": true
5765
}
5866
},
5967
"dependencies": {

storage/framework/stacks/core/eslint-config/src/configs/svelte.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export async function svelte(
2121
])
2222

2323
const [
24-
// pluginSvelte,
25-
// parserSvelte,
24+
pluginSvelte,
25+
parserSvelte,
2626
] = await Promise.all([
27-
// interopDefault(import('eslint-plugin-svelte')),
28-
// interopDefault(import('svelte-eslint-parser')),
27+
interopDefault(import('eslint-plugin-svelte')),
28+
interopDefault(import('svelte-eslint-parser')),
2929
] as const)
3030

3131
return [

0 commit comments

Comments
 (0)