Skip to content

Commit 0115059

Browse files
committed
chore: wip
1 parent 40f4756 commit 0115059

File tree

17 files changed

+136
-114
lines changed

17 files changed

+136
-114
lines changed

bun.lockb

18.8 KB
Binary file not shown.

storage/framework/core/components/stepper/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@types/clean-css": "^4.2.11",
4949
"@vue/tsconfig": "^0.5.1",
5050
"clean-css": "^5.3.3",
51-
"unocss": "0.63.3",
51+
"unocss": "0.61.0",
5252
"unplugin-icons": "^0.19.3"
5353
}
5454
}

storage/framework/core/docs/src/index.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import { kolorist as c } from '@stacksjs/cli'
33
import { docs } from '@stacksjs/config'
44
import { path as p } from '@stacksjs/path'
55
import { server } from '@stacksjs/server'
6+
import type { DocsConfig } from '@stacksjs/types'
67
import { withPwa } from '@vite-pwa/vitepress'
8+
import type { ViteDevServer } from 'vite'
79
import { defineConfig } from 'vitepress'
8-
import type { UserConfig } from 'vitepress'
10+
import type { DefaultTheme, UserConfigExport, UserConfig as VitePressConfig } from 'vitepress'
911
import { version } from '../package.json'
1012
import { pwaDocs as pwa } from './scripts/pwa'
1113

12-
export const frameworkDefaults = {
14+
export const frameworkDefaults: VitePressConfig = {
1315
base: '/docs/',
1416
cleanUrls: true,
1517
srcDir: p.projectPath('docs'),
@@ -35,7 +37,7 @@ export const frameworkDefaults = {
3537
plugins: [
3638
{
3739
name: 'stacks-plugin',
38-
configureServer(server) {
40+
configureServer(server: ViteDevServer) {
3941
// const base = server.config.base || '/'
4042
// const _print = server.printUrls
4143
server.printUrls = () => {
@@ -51,9 +53,9 @@ export const frameworkDefaults = {
5153
},
5254

5355
pwa,
54-
} satisfies UserConfig
56+
}
5557

56-
const config: UserConfig = {
58+
const combinedConfig: VitePressConfig = {
5759
...frameworkDefaults,
5860
...docs,
5961
}
@@ -62,4 +64,6 @@ export * from './plugins'
6264
export * from './scripts/pwa'
6365
export * from './meta'
6466

65-
export default withPwa(defineConfig(config))
67+
const conf: Promise<UserConfigExport<DefaultTheme.Config>> = withPwa(defineConfig(combinedConfig))
68+
69+
export default conf

storage/framework/core/ecommerce/build.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { dts } from 'bun-plugin-dts-auto'
12
import { intro, outro } from '../build/src'
23

34
const { startTime } = await intro({
@@ -10,6 +11,12 @@ const result = await Bun.build({
1011
format: 'esm',
1112
sourcemap: 'linked',
1213
minify: true,
14+
plugins: [
15+
dts({
16+
root: './src',
17+
outdir: './dist',
18+
}),
19+
],
1320
})
1421

1522
await outro({

storage/framework/core/ecommerce/src/receipts/printer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ class TSPIVPrinter implements PrinterDriver {
3333
}
3434

3535
// Export the TSP IV printer instance
36-
export const tspIVPrinter = new TSPIVPrinter()
36+
export const tspIVPrinter: PrinterDriver = new TSPIVPrinter()

storage/framework/core/email/build.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { dts } from 'bun-plugin-dts-auto'
12
import { intro, outro } from '../build/src'
23

34
const { startTime } = await intro({
@@ -12,6 +13,12 @@ const result = await Bun.build({
1213
sourcemap: 'linked',
1314
minify: true,
1415
external: ['@stacksjs/cli', '@stacksjs/config', '@stacksjs/error-handling', '@stacksjs/types', '@stacksjs/path'],
16+
plugins: [
17+
dts({
18+
root: './src',
19+
outdir: './dist',
20+
}),
21+
],
1522
})
1623

1724
await outro({
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
import { SES } from '@aws-sdk/client-ses'
2-
import { log } from '@stacksjs/logging'
3-
import type { RenderOptions } from './template'
4-
import { template } from './template'
5-
import type { Message, SendEmailParams } from './types'
1+
// import { SES } from '@aws-sdk/client-ses'
2+
// import { log } from '@stacksjs/logging'
3+
// import type { RenderOptions } from './template'
4+
// import { template } from './template'
5+
// import type { Message, SendEmailParams } from './types'
66

7-
export class Email {
8-
private client: SES
7+
// export class Email {
8+
// private client: SES
99

10-
constructor(private message: Message) {
11-
this.client = new SES({ region: 'us-east-1' })
12-
this.message = message
13-
}
10+
// constructor(private message: Message) {
11+
// this.client = new SES({ region: 'us-east-1' })
12+
// this.message = message
13+
// }
1414

15-
public async send(options?: RenderOptions) {
16-
log.info('Sending email...')
17-
const path = this.message.template
15+
// public async send(options?: RenderOptions): Promise<{ message: string }> {
16+
// log.info('Sending email...')
17+
// const path = this.message.template
1818

19-
try {
20-
const templ = await template(path, options)
19+
// try {
20+
// const templ = await template(path, options)
2121

22-
const params: SendEmailParams = {
23-
Source: this.message.from?.address || '',
22+
// const params: SendEmailParams = {
23+
// Source: this.message.from?.address || '',
2424

25-
Destination: {
26-
ToAddresses: [this.message.to],
27-
},
25+
// Destination: {
26+
// ToAddresses: [this.message.to],
27+
// },
2828

29-
Message: {
30-
Body: {
31-
Html: {
32-
Charset: 'UTF-8',
33-
Data: templ.html,
34-
},
35-
},
29+
// Message: {
30+
// Body: {
31+
// Html: {
32+
// Charset: 'UTF-8',
33+
// Data: templ.html,
34+
// },
35+
// },
3636

37-
Subject: {
38-
Charset: 'UTF-8',
39-
Data: this.message.subject,
40-
},
41-
},
42-
}
37+
// Subject: {
38+
// Charset: 'UTF-8',
39+
// Data: this.message.subject,
40+
// },
41+
// },
42+
// }
4343

44-
await this.client.sendEmail(params)
44+
// await this.client.sendEmail(params)
4545

46-
let returnMsg: { message: string } = { message: 'Email sent' }
46+
// let returnMsg: { message: string } = { message: 'Email sent' }
4747

48-
if (this.message.handle) returnMsg = await this.message.handle()
48+
// if (this.message.handle) returnMsg = await this.message.handle()
4949

50-
await this.onSuccess()
50+
// await this.onSuccess()
5151

52-
return returnMsg
53-
} catch (error) {
54-
return this.onError(error as Error)
55-
}
56-
}
52+
// return returnMsg
53+
// } catch (error) {
54+
// return this.onError(error as Error)
55+
// }
56+
// }
5757

58-
public async onError(error: Error) {
59-
log.error(error)
58+
// public async onError(error: Error) {
59+
// log.error(error)
6060

61-
if (!this.message.onError) return
61+
// if (!this.message.onError) return
6262

63-
return await this.message.onError(error)
64-
}
63+
// return await this.message.onError(error)
64+
// }
6565

66-
public onSuccess() {
67-
try {
68-
if (!this.message.onSuccess) return
66+
// // public onSuccess() {
67+
// // try {
68+
// // if (!this.message.onSuccess) return
6969

70-
this.message.onSuccess()
71-
} catch (error) {
72-
return this.onError(error as Error)
73-
}
74-
}
75-
}
70+
// // this.message.onSuccess()
71+
// // } catch (error) {
72+
// // return this.onError(error as Error)
73+
// // }
74+
// // }
75+
// }
7676

77-
export type { Message }
77+
// export type { Message }
7878

79-
export const email = (options: Message) => new Email(options)
80-
export default Email
79+
// // export const email = (options: Message) => new Email(options)
80+
// export default Email
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
import { italic } from '@stacksjs/cli'
2-
import { ResultAsync } from '@stacksjs/error-handling'
3-
import type { EmailOptions } from '@stacksjs/types'
1+
// import { italic } from '@stacksjs/cli'
2+
// import { ResultAsync } from '@stacksjs/error-handling'
3+
// import type { EmailOptions } from '@stacksjs/types'
44

5-
// import { stringify } from 'json5'
5+
// // import { stringify } from 'json5'
66

7-
export async function send(
8-
options: EmailOptions,
9-
provider: any,
10-
providerName: string,
11-
): Promise<ResultAsync<any, Error>> {
12-
// const template = `
13-
// <extends src="./src/notifications/src/utils/template.html">
14-
// <block name="template">
15-
// ${options.html}
16-
// </block>
17-
// </extends>`
7+
// export async function send(
8+
// options: EmailOptions,
9+
// provider: any,
10+
// providerName: string,
11+
// ): Promise<ResultAsync<any, Error>> {
12+
// // const template = `
13+
// // <extends src="./src/notifications/src/utils/template.html">
14+
// // <block name="template">
15+
// // ${options.html}
16+
// // </block>
17+
// // </extends>`
1818

19-
// await Maizzle.render(
20-
// template,
21-
// {
22-
// tailwind: {
23-
// // config: stringify(config),
24-
// css,
25-
// maizzle: maizzleConfig,
26-
// },
27-
// },
28-
// )
29-
// .then(({ html }: any) => {
30-
// options.html = html
31-
// })
32-
// .catch((error: any) => log.error(`Failed to render email template using provider: ${italic(providerName)}.`, error))
19+
// // await Maizzle.render(
20+
// // template,
21+
// // {
22+
// // tailwind: {
23+
// // // config: stringify(config),
24+
// // css,
25+
// // maizzle: maizzleConfig,
26+
// // },
27+
// // },
28+
// // )
29+
// // .then(({ html }: any) => {
30+
// // options.html = html
31+
// // })
32+
// // .catch((error: any) => log.error(`Failed to render email template using provider: ${italic(providerName)}.`, error))
3333

34-
return ResultAsync.fromPromise(
35-
provider.sendMessage(options),
36-
() => new Error(`Failed to send message using provider: ${italic(providerName)}`),
37-
)
38-
}
34+
// return ResultAsync.fromPromise(
35+
// provider.sendMessage(options),
36+
// () => new Error(`Failed to send message using provider: ${italic(providerName)}`),
37+
// )
38+
// }

storage/framework/core/email/src/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface RenderOptions {
88
i18n?: I18n
99
}
1010

11-
export const template = async (path: string, options?: RenderOptions) => {
11+
export const template = async (path: string, options?: RenderOptions): Promise<string> => {
1212
const email = config(resourcesPath('emails'), {
1313
verbose: !!process.env.DEBUG,
1414
// options: {
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { notification } from '@stacksjs/config'
22

3-
export const email = notification.email
3+
export const email: typeof notification.email = notification.email
44

5-
export default {
6-
email,
7-
}
5+
export default email

0 commit comments

Comments
 (0)