@alstar/studio 0.0.0-beta.3 → 0.0.0-beta.4

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/index.ts CHANGED
@@ -24,7 +24,7 @@ const createStudio = async (studioStructure?: types.Structure) => {
24
24
 
25
25
  structure = studioStructure || []
26
26
 
27
- loadDb('./cms.db')
27
+ loadDb('./studio.db')
28
28
 
29
29
  createStudioTables()
30
30
 
@@ -67,7 +67,5 @@ const createStudio = async (studioStructure?: types.Structure) => {
67
67
  return app
68
68
  }
69
69
 
70
- export const defineConfig = (config: types.StudioConfig) => config
71
- export const defineStructure = (structure: types.Structure) => structure
72
-
70
+ export { defineConfig, defineEntry, defineStructure } from './utils/define.ts'
73
71
  export { createStudio, query }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alstar/studio",
3
- "version": "0.0.0-beta.3",
3
+ "version": "0.0.0-beta.4",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "dependencies": {
@@ -0,0 +1,13 @@
1
+ import { type Context } from 'hono'
2
+ import * as types from '../types.ts'
3
+ import { type HttpBindings } from '@hono/node-server'
4
+ import { type BlankInput } from 'hono/types'
5
+ import { type HtmlEscapedString } from './html.ts'
6
+
7
+ export const defineConfig = (config: types.StudioConfig) => config
8
+ export const defineStructure = (structure: types.Structure) => structure
9
+ export const defineEntry = (
10
+ fn: (
11
+ c: Context<{ Bindings: HttpBindings }, string, BlankInput>,
12
+ ) => HtmlEscapedString | Promise<HtmlEscapedString>,
13
+ ) => fn
@@ -3,7 +3,7 @@ import path from 'node:path'
3
3
  import { Hono } from 'hono'
4
4
  import { type HtmlEscapedString } from 'hono/utils/html'
5
5
 
6
- type Page<C> = (c?: C) => HtmlEscapedString | Promise<HtmlEscapedString>
6
+ export type Page<C> = (c?: C) => HtmlEscapedString | Promise<HtmlEscapedString>
7
7
 
8
8
  export const fileBasedRouter = async (rootdir: string) => {
9
9
  const router = new Hono()