@milkio/astra 1.0.0-alpha.93 → 1.0.0-alpha.95
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 +4 -3
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { format } from 'date-fns'
|
|
|
9
9
|
import type { CookbookOptions } from './utils/cookbook-dto-types'
|
|
10
10
|
|
|
11
11
|
export type AstraOptionsInit = {
|
|
12
|
-
stargate: { $types: any, execute: any, ping: any,
|
|
12
|
+
stargate: { $types: any, execute: any, ping: any, __cookbook: any }
|
|
13
13
|
bootstrap: () => Promise<Record<string, any>>
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -112,7 +112,7 @@ export async function createAstra<AstraOptions extends AstraOptionsInit, Generat
|
|
|
112
112
|
const thisFilePath = join(fileURLToPath(importMetaUrl))
|
|
113
113
|
const thisFileDirPath = join(dirname(thisFilePath)).replaceAll('\\', '/')
|
|
114
114
|
const thisFileDirPathArr = thisFileDirPath.split('/')
|
|
115
|
-
let projectName
|
|
115
|
+
let projectName = ''
|
|
116
116
|
|
|
117
117
|
await (async () => {
|
|
118
118
|
let isProjectsDirectory = false
|
|
@@ -149,7 +149,7 @@ export async function createAstra<AstraOptions extends AstraOptionsInit, Generat
|
|
|
149
149
|
options.params.$milkioGenerateParams = 'enable'
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
const results = await this.options.stargate.
|
|
152
|
+
const results = await this.options.stargate.__cookbook.subscribe(`http://localhost:${cookbookOptions.general.cookbookPort}`)
|
|
153
153
|
void (async () => {
|
|
154
154
|
for await (const result of results) {
|
|
155
155
|
if (result.type !== 'milkio@logger') continue
|
|
@@ -167,6 +167,7 @@ export async function createAstra<AstraOptions extends AstraOptionsInit, Generat
|
|
|
167
167
|
|
|
168
168
|
const getNow = () => format(new Date(), '(yyyy-MM-dd hh:mm:ss)')
|
|
169
169
|
const onLoggerInserting = (log: Log) => {
|
|
170
|
+
// biome-ignore lint/style/noParameterAssign: <explanation>
|
|
170
171
|
log = [...log]
|
|
171
172
|
log[0] = `\n${log[0]}` as any
|
|
172
173
|
console.log(...log)
|