File tree Expand file tree Collapse file tree 12 files changed +33
-23
lines changed
vite-plugin-vue-layouts/src Expand file tree Collapse file tree 12 files changed +33
-23
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ export class StorageStack extends NestedStack {
7
7
constructor ( scope : Construct , id : string , props ?: NestedStackProps ) {
8
8
super ( scope , id , props )
9
9
10
- if ( ! storage . name )
11
- throw new Error ( './config storage.name is not defined' )
10
+ // if (!storage.name)
11
+ // throw new Error('./config storage.name is not defined')
12
12
13
- // eslint-disable-next-line no-new
14
- new s3 . Bucket ( this , storage . name )
13
+ // // eslint-disable-next-line no-new
14
+ // new s3.Bucket(this, storage.name)
15
15
}
16
16
}
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ type Data = Blob | TypedArray | ArrayBufferLike | string | BlobPart[]
34
34
export async function writeFile ( path : Path , data : Data ) : Promise < number > {
35
35
if ( typeof path === 'string' ) {
36
36
const dirPath = dirname ( path )
37
- if ( ! existsSync ( dirPath ) )
38
- createFolder ( dirPath )
37
+ if ( ! await existsSync ( dirPath ) )
38
+ await createFolder ( dirPath )
39
39
40
40
return await Bun . write ( Bun . file ( path ) , data )
41
41
}
Original file line number Diff line number Diff line change 1
- type Visibility = 'public' | 'private'
1
+ // type Visibility = 'public' | 'private'
2
2
3
- export function setVisibility ( path : string , visibility : Visibility ) {
3
+ // export function setVisibility(path: string, visibility: Visibility) {
4
+ export function setVisibility ( ) {
4
5
return 'wip'
5
6
}
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export function gunzipSync(data: Uint8Array) {
46
46
return Bun . gunzipSync ( data ) // decompressed
47
47
}
48
48
49
- export async function deflateSync ( data : Uint8Array , options ?: ZlibCompressionOptions ) {
49
+ export function deflateSync ( data : Uint8Array , options ?: ZlibCompressionOptions ) {
50
50
return Bun . deflateSync ( data , options ) // compressed
51
51
}
52
52
Original file line number Diff line number Diff line change 1
1
export interface CloudOptions {
2
2
driver : 'aws'
3
3
4
+ // eslint-disable-next-line @typescript-eslint/ban-types
4
5
storage : { }
5
6
6
7
firewall : {
@@ -15,6 +16,7 @@ export interface CloudOptions {
15
16
rules : {
16
17
name : string
17
18
priority : number
19
+ // eslint-disable-next-line @typescript-eslint/ban-types
18
20
action : { block ?: { } ; allow ?: { } }
19
21
visibilityConfig : {
20
22
sampledRequestsEnabled : boolean
Original file line number Diff line number Diff line change 13
13
* useEvent('user:registered', { name: 'Chris', email: 'chris@stacksjs.dev' })
14
14
* events.emit('user:registered', { name: 'Chris', email: 'chris@stacksjs.dev' })
15
15
* useEvents.emit('user:registered', { name: 'Chris', email: 'chris@stacksjs.dev' })
16
- * ````
17
-
16
+ * ```
17
+ *
18
18
* @example To capture an event, you may use any of the following approaches:
19
19
* ```ts
20
20
* listen('user:registered', (user) => sendWelcomeEmail(user))
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export interface Route {
49
49
export interface MiddlewareType {
50
50
name : string
51
51
priority : number
52
+ // eslint-disable-next-line @typescript-eslint/ban-types
52
53
handle : Function
53
54
}
54
55
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export interface SecurityOptions {
14
14
rules : {
15
15
name : string
16
16
priority : number
17
+ // eslint-disable-next-line @typescript-eslint/ban-types
17
18
action : { block ?: { } ; allow ?: { } }
18
19
visibilityConfig : {
19
20
sampledRequestsEnabled : boolean
Original file line number Diff line number Diff line change 1
1
/**
2
2
* Throttle a function.
3
3
*
4
- * @param fn: Function
5
- * @param wait = 300
6
- * @returns
4
+ * @param { Function } fn
5
+ * @param { number } [wait]
6
+ * @returns { Function }
7
7
*
8
8
* @example
9
9
* ```ts
Original file line number Diff line number Diff line change 1
1
import { resolve } from 'node:path'
2
+ import process from 'node:process'
2
3
import type { ModuleNode , Plugin , ResolvedConfig } from 'vite'
3
4
import { createVirtualModuleCode } from './clientSide'
4
5
import { getFilesFromPath } from './files'
@@ -76,10 +77,15 @@ export default function Layout(userOptions: UserOptions = {}): Plugin {
76
77
updateVirtualModule ( )
77
78
} )
78
79
79
- watcher . on ( 'change' , async ( path ) => {
80
+ watcher . on ( 'change' , ( path ) => {
80
81
path = `/${ normalizePath ( path ) } `
81
- const module = await moduleGraph . getModuleByUrl ( path )
82
- reloadModule ( module , path )
82
+ moduleGraph . getModuleByUrl ( path )
83
+ . then ( ( module ) => {
84
+ reloadModule ( module , path )
85
+ } )
86
+ . catch ( ( error ) => {
87
+ console . error ( 'Error while getting module by URL:' , error )
88
+ } )
83
89
} )
84
90
} ,
85
91
resolveId ( id ) {
You can’t perform that action at this time.
0 commit comments