@pikku/cli 0.9.0 → 0.9.2
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/CHANGELOG.md +30 -0
- package/bin/pikku-all.ts +9 -4
- package/bin/pikku-nextjs.ts +3 -3
- package/dist/bin/pikku-all.js +9 -4
- package/dist/bin/pikku-nextjs.js +3 -3
- package/dist/bin/pikku.js +0 -0
- package/dist/src/serialize-pikku-types.js +28 -25
- package/dist/src/utils.d.ts +5 -1
- package/dist/src/utils.js +17 -6
- package/dist/src/wirings/rpc/pikku-command-rpc-client.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/serialize-pikku-types.ts +28 -25
- package/src/utils.ts +26 -6
- package/src/wirings/rpc/pikku-command-rpc-client.ts +1 -1
- package/dist/src/events/channels/pikku-channels.d.ts +0 -2
- package/dist/src/events/channels/pikku-channels.js +0 -9
- package/dist/src/events/channels/pikku-command-channels-map.d.ts +0 -2
- package/dist/src/events/channels/pikku-command-channels-map.js +0 -8
- package/dist/src/events/channels/pikku-command-channels.d.ts +0 -2
- package/dist/src/events/channels/pikku-command-channels.js +0 -9
- package/dist/src/events/channels/pikku-command-websocket-typed.d.ts +0 -2
- package/dist/src/events/channels/pikku-command-websocket-typed.js +0 -15
- package/dist/src/events/channels/serialize-typed-channel-map.d.ts +0 -4
- package/dist/src/events/channels/serialize-typed-channel-map.js +0 -111
- package/dist/src/events/channels/serialize-websocket-wrapper.d.ts +0 -1
- package/dist/src/events/channels/serialize-websocket-wrapper.js +0 -75
- package/dist/src/events/fetch/index.d.ts +0 -2
- package/dist/src/events/fetch/index.js +0 -12
- package/dist/src/events/functions/pikku-command-function-types.d.ts +0 -2
- package/dist/src/events/functions/pikku-command-function-types.js +0 -13
- package/dist/src/events/functions/pikku-command-functions.d.ts +0 -6
- package/dist/src/events/functions/pikku-command-functions.js +0 -35
- package/dist/src/events/functions/pikku-command-services.d.ts +0 -3
- package/dist/src/events/functions/pikku-command-services.js +0 -73
- package/dist/src/events/functions/pikku-function-types.d.ts +0 -2
- package/dist/src/events/functions/pikku-function-types.js +0 -13
- package/dist/src/events/functions/pikku-functions.d.ts +0 -6
- package/dist/src/events/functions/pikku-functions.js +0 -35
- package/dist/src/events/http/openapi-spec-generator.d.ts +0 -79
- package/dist/src/events/http/openapi-spec-generator.js +0 -145
- package/dist/src/events/http/pikku-command-http-map.d.ts +0 -2
- package/dist/src/events/http/pikku-command-http-map.js +0 -8
- package/dist/src/events/http/pikku-command-http-routes.d.ts +0 -2
- package/dist/src/events/http/pikku-command-http-routes.js +0 -9
- package/dist/src/events/http/pikku-command-nextjs.d.ts +0 -2
- package/dist/src/events/http/pikku-command-nextjs.js +0 -36
- package/dist/src/events/http/pikku-command-openapi.d.ts +0 -2
- package/dist/src/events/http/pikku-command-openapi.js +0 -20
- package/dist/src/events/http/pikku-http-routes.d.ts +0 -2
- package/dist/src/events/http/pikku-http-routes.js +0 -9
- package/dist/src/events/http/serialize-fetch-wrapper.d.ts +0 -1
- package/dist/src/events/http/serialize-fetch-wrapper.js +0 -67
- package/dist/src/events/http/serialize-typed-http-map.d.ts +0 -4
- package/dist/src/events/http/serialize-typed-http-map.js +0 -100
- package/dist/src/events/mcp/pikku-command-mcp-json.d.ts +0 -2
- package/dist/src/events/mcp/pikku-command-mcp-json.js +0 -13
- package/dist/src/events/mcp/pikku-command-mcp.d.ts +0 -2
- package/dist/src/events/mcp/pikku-command-mcp.js +0 -54
- package/dist/src/events/mcp/serialize-mcp-json.d.ts +0 -5
- package/dist/src/events/mcp/serialize-mcp-json.js +0 -101
- package/dist/src/events/queue/pikku-command-queue-map.d.ts +0 -2
- package/dist/src/events/queue/pikku-command-queue-map.js +0 -8
- package/dist/src/events/queue/pikku-command-queue-service.d.ts +0 -2
- package/dist/src/events/queue/pikku-command-queue-service.js +0 -12
- package/dist/src/events/queue/pikku-command-queue.d.ts +0 -2
- package/dist/src/events/queue/pikku-command-queue.js +0 -10
- package/dist/src/events/queue/pikku-queue-map.d.ts +0 -2
- package/dist/src/events/queue/pikku-queue-map.js +0 -8
- package/dist/src/events/queue/pikku-queue.d.ts +0 -2
- package/dist/src/events/queue/pikku-queue.js +0 -10
- package/dist/src/events/queue/serialize-queue-map.d.ts +0 -4
- package/dist/src/events/queue/serialize-queue-map.js +0 -77
- package/dist/src/events/queue/serialize-queue-meta.d.ts +0 -2
- package/dist/src/events/queue/serialize-queue-meta.js +0 -6
- package/dist/src/events/queue/serialize-queue-wrapper.d.ts +0 -1
- package/dist/src/events/queue/serialize-queue-wrapper.js +0 -35
- package/dist/src/events/rpc/index.d.ts +0 -2
- package/dist/src/events/rpc/index.js +0 -12
- package/dist/src/events/rpc/pikku-command-rpc-client.d.ts +0 -2
- package/dist/src/events/rpc/pikku-command-rpc-client.js +0 -12
- package/dist/src/events/rpc/pikku-command-rpc-map.d.ts +0 -2
- package/dist/src/events/rpc/pikku-command-rpc-map.js +0 -8
- package/dist/src/events/rpc/pikku-command-rpc.d.ts +0 -2
- package/dist/src/events/rpc/pikku-command-rpc.js +0 -6
- package/dist/src/events/rpc/pikku-rpc.d.ts +0 -2
- package/dist/src/events/rpc/pikku-rpc.js +0 -6
- package/dist/src/events/rpc/serialize-rpc-wrapper.d.ts +0 -1
- package/dist/src/events/rpc/serialize-rpc-wrapper.js +0 -68
- package/dist/src/events/rpc/serialize-typed-rpc-map.d.ts +0 -4
- package/dist/src/events/rpc/serialize-typed-rpc-map.js +0 -66
- package/dist/src/events/scheduler/pikku-command-scheduler.d.ts +0 -2
- package/dist/src/events/scheduler/pikku-command-scheduler.js +0 -10
- package/dist/src/events/scheduler/serialize-scheduler-meta.d.ts +0 -2
- package/dist/src/events/scheduler/serialize-scheduler-meta.js +0 -10
- package/lcov.info +0 -582
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @pikku/cli
|
|
2
2
|
|
|
3
|
+
## 0.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1256238: feat: pikkufunc in types extends function config to include all the different params
|
|
8
|
+
- d3a9a09: refactor: change addMiddleware to addHTTPMiddleware due to route support'
|
|
9
|
+
|
|
10
|
+
chore: export addHTTPMiddleware from pikku-types for consistency
|
|
11
|
+
|
|
12
|
+
- 840e078: refactor: change APIMiddleware type to PikkuMiddleware
|
|
13
|
+
- a5905a9: chore: updating all dependencies
|
|
14
|
+
- Updated dependencies [1256238]
|
|
15
|
+
- Updated dependencies [6cf8efd]
|
|
16
|
+
- Updated dependencies [d3a9a09]
|
|
17
|
+
- Updated dependencies [840e078]
|
|
18
|
+
- Updated dependencies [667d23c]
|
|
19
|
+
- Updated dependencies [a5905a9]
|
|
20
|
+
- @pikku/core@0.9.2
|
|
21
|
+
- @pikku/inspector@0.9.2
|
|
22
|
+
|
|
23
|
+
## 0.9.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- fdb1593: feat: adding silent option to cli
|
|
28
|
+
- fdb1593: core: bumping everything with a patch to sync up the major release inconsistencies in dependencies
|
|
29
|
+
- Updated dependencies [fdb1593]
|
|
30
|
+
- @pikku/core@0.9.1
|
|
31
|
+
- @pikku/inspector@0.9.1
|
|
32
|
+
|
|
3
33
|
## 0.9.0
|
|
4
34
|
|
|
5
35
|
### Breaking Changes
|
package/bin/pikku-all.ts
CHANGED
|
@@ -262,7 +262,11 @@ const watch = (
|
|
|
262
262
|
watcher.on('ready', async () => {
|
|
263
263
|
const handle = async () => {
|
|
264
264
|
try {
|
|
265
|
+
const start = Date.now()
|
|
265
266
|
await runAll(logger, cliConfig, options)
|
|
267
|
+
if (options.silent) {
|
|
268
|
+
logger.timing(`✓ Generated in ${Date.now() - start}ms`)
|
|
269
|
+
}
|
|
266
270
|
} catch (err) {
|
|
267
271
|
console.error(err)
|
|
268
272
|
console.info()
|
|
@@ -291,7 +295,7 @@ const watch = (
|
|
|
291
295
|
}
|
|
292
296
|
|
|
293
297
|
export const action = async (options: PikkuCLIOptions): Promise<void> => {
|
|
294
|
-
const logger = new CLILogger({ logLogo: true })
|
|
298
|
+
const logger = new CLILogger({ logLogo: true, silent: options.silent })
|
|
295
299
|
|
|
296
300
|
const cliConfig = await getPikkuCLIConfig(
|
|
297
301
|
options.config,
|
|
@@ -315,13 +319,13 @@ export const all = (program: Command): void => {
|
|
|
315
319
|
program
|
|
316
320
|
.command('all', { isDefault: true })
|
|
317
321
|
.description('Generate all the files used by pikku')
|
|
318
|
-
.option('
|
|
322
|
+
.option('--pikku-config-type', 'The type of your pikku config object')
|
|
319
323
|
.option(
|
|
320
|
-
'
|
|
324
|
+
'--singleton-services-factory-type',
|
|
321
325
|
'The type of your singleton services factory'
|
|
322
326
|
)
|
|
323
327
|
.option(
|
|
324
|
-
'
|
|
328
|
+
'--session-services-factory-type',
|
|
325
329
|
'The type of your session services factory'
|
|
326
330
|
)
|
|
327
331
|
.option('-c | --config <string>', 'The path to pikku cli config file')
|
|
@@ -332,5 +336,6 @@ export const all = (program: Command): void => {
|
|
|
332
336
|
)
|
|
333
337
|
.option('--directories <directories...>', 'Which directories to filter by')
|
|
334
338
|
.option('-w | --watch', 'Whether to watch file changes')
|
|
339
|
+
.option('-s | --silent', 'Silent mode - only show errors')
|
|
335
340
|
.action(action)
|
|
336
341
|
}
|
package/bin/pikku-nextjs.ts
CHANGED
|
@@ -30,13 +30,13 @@ export const nextjs = (program: Command): void => {
|
|
|
30
30
|
program
|
|
31
31
|
.command('nextjs')
|
|
32
32
|
.description('generate nextjs wrapper')
|
|
33
|
-
.option('
|
|
33
|
+
.option('--pikku-config-type', 'The type of your pikku config object')
|
|
34
34
|
.option(
|
|
35
|
-
'
|
|
35
|
+
'--singleton-services-factory-type',
|
|
36
36
|
'The type of your singleton services factory'
|
|
37
37
|
)
|
|
38
38
|
.option(
|
|
39
|
-
'
|
|
39
|
+
'--session-services-factory-type',
|
|
40
40
|
'The type of your session services factory'
|
|
41
41
|
)
|
|
42
42
|
.option('-c | --config <string>', 'The path to pikku cli config file')
|
package/dist/bin/pikku-all.js
CHANGED
|
@@ -132,7 +132,11 @@ const watch = (logger, cliConfig, options) => {
|
|
|
132
132
|
watcher.on('ready', async () => {
|
|
133
133
|
const handle = async () => {
|
|
134
134
|
try {
|
|
135
|
+
const start = Date.now();
|
|
135
136
|
await runAll(logger, cliConfig, options);
|
|
137
|
+
if (options.silent) {
|
|
138
|
+
logger.timing(`✓ Generated in ${Date.now() - start}ms`);
|
|
139
|
+
}
|
|
136
140
|
}
|
|
137
141
|
catch (err) {
|
|
138
142
|
console.error(err);
|
|
@@ -156,7 +160,7 @@ const watch = (logger, cliConfig, options) => {
|
|
|
156
160
|
configWatcher.on('change', generatorWatcher);
|
|
157
161
|
};
|
|
158
162
|
export const action = async (options) => {
|
|
159
|
-
const logger = new CLILogger({ logLogo: true });
|
|
163
|
+
const logger = new CLILogger({ logLogo: true, silent: options.silent });
|
|
160
164
|
const cliConfig = await getPikkuCLIConfig(options.config, [], {
|
|
161
165
|
tags: options.tags,
|
|
162
166
|
types: options.types,
|
|
@@ -173,13 +177,14 @@ export const all = (program) => {
|
|
|
173
177
|
program
|
|
174
178
|
.command('all', { isDefault: true })
|
|
175
179
|
.description('Generate all the files used by pikku')
|
|
176
|
-
.option('
|
|
177
|
-
.option('
|
|
178
|
-
.option('
|
|
180
|
+
.option('--pikku-config-type', 'The type of your pikku config object')
|
|
181
|
+
.option('--singleton-services-factory-type', 'The type of your singleton services factory')
|
|
182
|
+
.option('--session-services-factory-type', 'The type of your session services factory')
|
|
179
183
|
.option('-c | --config <string>', 'The path to pikku cli config file')
|
|
180
184
|
.option('-t | --tags <tags...>', 'Which tags to filter by')
|
|
181
185
|
.option('--types <types...>', 'Which types to filter by (http, channel, queue, scheduler, rpc, mcp)')
|
|
182
186
|
.option('--directories <directories...>', 'Which directories to filter by')
|
|
183
187
|
.option('-w | --watch', 'Whether to watch file changes')
|
|
188
|
+
.option('-s | --silent', 'Silent mode - only show errors')
|
|
184
189
|
.action(action);
|
|
185
190
|
};
|
package/dist/bin/pikku-nextjs.js
CHANGED
|
@@ -16,9 +16,9 @@ export const nextjs = (program) => {
|
|
|
16
16
|
program
|
|
17
17
|
.command('nextjs')
|
|
18
18
|
.description('generate nextjs wrapper')
|
|
19
|
-
.option('
|
|
20
|
-
.option('
|
|
21
|
-
.option('
|
|
19
|
+
.option('--pikku-config-type', 'The type of your pikku config object')
|
|
20
|
+
.option('--singleton-services-factory-type', 'The type of your singleton services factory')
|
|
21
|
+
.option('--session-services-factory-type', 'The type of your session services factory')
|
|
22
22
|
.option('-c | --config <string>', 'The path to pikku cli config file')
|
|
23
23
|
.action(action);
|
|
24
24
|
};
|
package/dist/bin/pikku.js
CHANGED
|
File without changes
|
|
@@ -6,7 +6,7 @@ export const serializePikkuTypes = (userSessionTypeImport, userSessionTypeName,
|
|
|
6
6
|
* This is used to provide the application types in the typescript project
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { CorePikkuPermission,
|
|
9
|
+
import { CorePikkuFunctionConfig, CorePikkuPermission, CorePikkuMiddleware, addHTTPMiddleware } from '@pikku/core'
|
|
10
10
|
import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function'
|
|
11
11
|
import { CoreHTTPFunctionWiring, AssertHTTPWiringParams, wireHTTP as wireHTTPCore } from '@pikku/core/http'
|
|
12
12
|
import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
|
|
@@ -34,7 +34,7 @@ export type PikkuPermission<In = unknown, RequiredServices extends ${singletonSe
|
|
|
34
34
|
*
|
|
35
35
|
* @template RequiredServices - The services required for this middleware
|
|
36
36
|
*/
|
|
37
|
-
export type
|
|
37
|
+
export type PikkuMiddleware<RequiredServices extends ${singletonServicesTypeName} = ${singletonServicesTypeName}> = CorePikkuMiddleware<RequiredServices, ${userSessionTypeName}>
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* A sessionless API function that doesn't require user authentication.
|
|
@@ -96,7 +96,7 @@ type PikkuFunction<
|
|
|
96
96
|
* @template Out - Output type for the HTTP wiring
|
|
97
97
|
* @template Route - String literal type for the HTTP path (e.g., "/users/:id")
|
|
98
98
|
*/
|
|
99
|
-
type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out, Route, PikkuFunction<In, Out>, PikkuFunctionSessionless<In, Out>, PikkuPermission<In>,
|
|
99
|
+
type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out, Route, PikkuFunction<In, Out>, PikkuFunctionSessionless<In, Out>, PikkuPermission<In>, PikkuMiddleware>
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Type definition for WebSocket channels with typed data exchange.
|
|
@@ -166,16 +166,7 @@ type MCPPromptWiring<In> = CoreMCPPrompt<PikkuFunctionSessionless<In, MCPPromptR
|
|
|
166
166
|
export const pikkuFunc = <In, Out = unknown>(
|
|
167
167
|
func:
|
|
168
168
|
| PikkuFunction<In, Out>
|
|
169
|
-
|
|
|
170
|
-
func: PikkuFunction<In, Out>
|
|
171
|
-
auth?: true
|
|
172
|
-
name?: string
|
|
173
|
-
}
|
|
174
|
-
| {
|
|
175
|
-
func: PikkuFunctionSessionless<In, Out>
|
|
176
|
-
auth: false
|
|
177
|
-
name?: string
|
|
178
|
-
}
|
|
169
|
+
| CorePikkuFunctionConfig<PikkuFunction<In, Out>, PikkuPermission<In>>
|
|
179
170
|
) => {
|
|
180
171
|
return typeof func === 'function' ? func : func.func
|
|
181
172
|
}
|
|
@@ -203,10 +194,7 @@ export const pikkuFunc = <In, Out = unknown>(
|
|
|
203
194
|
export const pikkuSessionlessFunc = <In, Out = unknown>(
|
|
204
195
|
func:
|
|
205
196
|
| PikkuFunctionSessionless<In, Out>
|
|
206
|
-
|
|
|
207
|
-
func: PikkuFunctionSessionless<In, Out>
|
|
208
|
-
name?: string
|
|
209
|
-
}
|
|
197
|
+
| CorePikkuFunctionConfig<PikkuFunctionSessionless<In, Out>, PikkuPermission<In>>
|
|
210
198
|
) => {
|
|
211
199
|
return typeof func === 'function' ? func : func.func
|
|
212
200
|
}
|
|
@@ -293,10 +281,7 @@ export const pikkuChannelDisconnectionFunc = <ChannelData = unknown>(
|
|
|
293
281
|
export const pikkuChannelFunc = <In = unknown, Out = unknown, ChannelData = unknown>(
|
|
294
282
|
func:
|
|
295
283
|
| PikkuFunctionSessionless<In, Out, ChannelData>
|
|
296
|
-
|
|
|
297
|
-
func: PikkuFunctionSessionless<In, Out, ChannelData>
|
|
298
|
-
name?: string
|
|
299
|
-
}
|
|
284
|
+
| CorePikkuFunctionConfig<PikkuFunction<In, Out, ChannelData>, PikkuPermission<In>>
|
|
300
285
|
) => {
|
|
301
286
|
return typeof func === 'function' ? func : func.func
|
|
302
287
|
}
|
|
@@ -320,10 +305,7 @@ export const pikkuChannelFunc = <In = unknown, Out = unknown, ChannelData = unkn
|
|
|
320
305
|
export const pikkuVoidFunc = (
|
|
321
306
|
func:
|
|
322
307
|
| PikkuFunctionSessionless<void, void>
|
|
323
|
-
|
|
|
324
|
-
func: PikkuFunctionSessionless<void, void>
|
|
325
|
-
name?: string
|
|
326
|
-
}
|
|
308
|
+
| CorePikkuFunctionConfig<PikkuFunction<void, void>, PikkuPermission<void>>
|
|
327
309
|
) => {
|
|
328
310
|
return typeof func === 'function' ? func : func.func
|
|
329
311
|
}
|
|
@@ -341,6 +323,27 @@ export const wireChannel = <ChannelData, Channel extends string>(
|
|
|
341
323
|
wireChannelCore(channel as any) // TODO
|
|
342
324
|
}
|
|
343
325
|
|
|
326
|
+
/**
|
|
327
|
+
* Registers middleware either globally or for a specific route.
|
|
328
|
+
*
|
|
329
|
+
* When a string route pattern is provided along with middleware, the middleware
|
|
330
|
+
* is applied only to that route. Otherwise, if an array is provided, it is treated
|
|
331
|
+
* as global middleware (applied to all routes).
|
|
332
|
+
*
|
|
333
|
+
* @param routeOrMiddleware - Either a global middleware array or a route pattern string
|
|
334
|
+
* @param middleware - The middleware array to apply when a route pattern is specified
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* \`\`\`typescript
|
|
338
|
+
* // Add global middleware
|
|
339
|
+
* addHTTPMiddleware([authMiddleware, loggingMiddleware])
|
|
340
|
+
*
|
|
341
|
+
* // Add route-specific middleware
|
|
342
|
+
* addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
|
|
343
|
+
* \`\`\`
|
|
344
|
+
*/
|
|
345
|
+
export { addHTTPMiddleware }
|
|
346
|
+
|
|
344
347
|
/**
|
|
345
348
|
* Registers an HTTP wiring with the Pikku framework.
|
|
346
349
|
*
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { InspectorState, TypesMap } from '@pikku/inspector';
|
|
2
2
|
export declare class CLILogger {
|
|
3
|
-
|
|
3
|
+
private silent;
|
|
4
|
+
constructor({ logLogo, silent, }: {
|
|
4
5
|
logLogo: boolean;
|
|
6
|
+
silent?: boolean;
|
|
5
7
|
});
|
|
6
8
|
primary(message: string): void;
|
|
7
9
|
success(message: string): void;
|
|
@@ -9,6 +11,7 @@ export declare class CLILogger {
|
|
|
9
11
|
error(message: string): void;
|
|
10
12
|
warn(message: string): void;
|
|
11
13
|
debug(message: string): void;
|
|
14
|
+
timing(message: string): void;
|
|
12
15
|
private logPikkuLogo;
|
|
13
16
|
}
|
|
14
17
|
export declare const getFileImportRelativePath: (from: string, to: string, packageMappings: Record<string, string>) => string;
|
|
@@ -36,6 +39,7 @@ export interface PikkuCLIOptions {
|
|
|
36
39
|
tags?: string[];
|
|
37
40
|
types?: string[];
|
|
38
41
|
directories?: string[];
|
|
42
|
+
silent?: boolean;
|
|
39
43
|
}
|
|
40
44
|
export declare const getPikkuFilesAndMethods: (logger: CLILogger, { singletonServicesTypeImportMap, sessionServicesTypeImportMap, userSessionTypeImportMap, sessionServicesFactories, singletonServicesFactories, configFactories, }: InspectorState, packageMappings: Record<string, string>, outputFile: string, { configFileType, singletonServicesFactoryType, sessionServicesFactoryType, }: PikkuCLIOptions, requires?: Partial<{
|
|
41
45
|
config: boolean;
|
package/dist/src/utils.js
CHANGED
|
@@ -13,19 +13,27 @@ const logo = `
|
|
|
13
13
|
|_| |_|_| \_)_| \_)____/
|
|
14
14
|
`;
|
|
15
15
|
export class CLILogger {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
silent;
|
|
17
|
+
constructor({ logLogo, silent = false, }) {
|
|
18
|
+
this.silent = silent;
|
|
19
|
+
if (logLogo && !silent) {
|
|
18
20
|
this.logPikkuLogo();
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
primary(message) {
|
|
22
|
-
|
|
24
|
+
if (!this.silent) {
|
|
25
|
+
console.log(chalk.green(message));
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
28
|
success(message) {
|
|
25
|
-
|
|
29
|
+
if (!this.silent) {
|
|
30
|
+
console.log(chalk.green(message));
|
|
31
|
+
}
|
|
26
32
|
}
|
|
27
33
|
info(message) {
|
|
28
|
-
|
|
34
|
+
if (!this.silent) {
|
|
35
|
+
console.log(chalk.blue(message));
|
|
36
|
+
}
|
|
29
37
|
}
|
|
30
38
|
error(message) {
|
|
31
39
|
console.error(chalk.red(message));
|
|
@@ -34,10 +42,13 @@ export class CLILogger {
|
|
|
34
42
|
console.error(chalk.yellow(message));
|
|
35
43
|
}
|
|
36
44
|
debug(message) {
|
|
37
|
-
if (process.env.DEBUG) {
|
|
45
|
+
if (process.env.DEBUG && !this.silent) {
|
|
38
46
|
console.log(chalk.gray(message));
|
|
39
47
|
}
|
|
40
48
|
}
|
|
49
|
+
timing(message) {
|
|
50
|
+
console.log(chalk.gray(message));
|
|
51
|
+
}
|
|
41
52
|
logPikkuLogo() {
|
|
42
53
|
this.primary(logo);
|
|
43
54
|
const packageJson = JSON.parse(readFileSync(`${dirname(__filename)}/../../package.json`, 'utf-8'));
|
|
@@ -2,7 +2,7 @@ import { serializeRPCWrapper } from './serialize-rpc-wrapper.js';
|
|
|
2
2
|
import { getFileImportRelativePath, logCommandInfoAndTime, writeFileInDir, } from '../../utils.js';
|
|
3
3
|
export const pikkuRPCClient = async (logger, { rpcWiringsFile, rpcMapDeclarationFile, packageMappings }) => {
|
|
4
4
|
return await logCommandInfoAndTime(logger, 'Generating RPC wrapper', 'Generated RPC wrapper', [
|
|
5
|
-
rpcWiringsFile === undefined,
|
|
5
|
+
rpcWiringsFile === undefined || rpcWiringsFile === null,
|
|
6
6
|
"rpcWiringsFile isn't set in the pikku config",
|
|
7
7
|
], async () => {
|
|
8
8
|
if (!rpcWiringsFile) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../bin/pikku-all.ts","../bin/pikku-fetch.ts","../bin/pikku-nextjs.ts","../bin/pikku-openapi.ts","../bin/pikku-queue-service.ts","../bin/pikku-schemas.ts","../bin/pikku-websocket.ts","../bin/pikku.ts","../src/inspector-glob.ts","../src/pikku-cli-config.ts","../src/pikku-command-schemas.ts","../src/schema-generator.ts","../src/schemas.ts","../src/serialize-import-map.ts","../src/serialize-pikku-types.ts","../src/types.ts","../src/utils.ts","../src/runtimes/nextjs/pikku-command-nextjs.ts","../src/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/wirings/channels/pikku-channels.ts","../src/wirings/channels/pikku-command-channels-map.ts","../src/wirings/channels/pikku-command-channels.ts","../src/wirings/channels/pikku-command-websocket-typed.ts","../src/wirings/channels/serialize-typed-channel-map.ts","../src/wirings/channels/serialize-websocket-wrapper.ts","../src/wirings/fetch/index.ts","../src/wirings/functions/pikku-command-function-types.ts","../src/wirings/functions/pikku-command-functions.ts","../src/wirings/functions/pikku-command-services.ts","../src/wirings/functions/pikku-function-types.ts","../src/wirings/functions/pikku-functions.ts","../src/wirings/http/openapi-spec-generator.ts","../src/wirings/http/pikku-command-http-map.ts","../src/wirings/http/pikku-command-http-routes.ts","../src/wirings/http/pikku-command-openapi.ts","../src/wirings/http/pikku-http-routes.ts","../src/wirings/http/serialize-fetch-wrapper.ts","../src/wirings/http/serialize-typed-http-map.ts","../src/wirings/mcp/pikku-command-mcp-json.ts","../src/wirings/mcp/pikku-command-mcp.ts","../src/wirings/mcp/serialize-mcp-json.ts","../src/wirings/queue/pikku-command-queue-map.ts","../src/wirings/queue/pikku-command-queue-service.ts","../src/wirings/queue/pikku-command-queue.ts","../src/wirings/queue/pikku-queue-map.ts","../src/wirings/queue/pikku-queue.ts","../src/wirings/queue/serialize-queue-map.ts","../src/wirings/queue/serialize-queue-meta.ts","../src/wirings/queue/serialize-queue-wrapper.ts","../src/wirings/rpc/pikku-command-rpc-client.ts","../src/wirings/rpc/pikku-command-rpc-map.ts","../src/wirings/rpc/pikku-command-rpc.ts","../src/wirings/rpc/pikku-rpc.ts","../src/wirings/rpc/serialize-rpc-wrapper.ts","../src/wirings/rpc/serialize-typed-rpc-map.ts","../src/wirings/scheduler/pikku-command-scheduler.ts","../src/wirings/scheduler/serialize-scheduler-meta.ts"],"version":"5.
|
|
1
|
+
{"root":["../bin/pikku-all.ts","../bin/pikku-fetch.ts","../bin/pikku-nextjs.ts","../bin/pikku-openapi.ts","../bin/pikku-queue-service.ts","../bin/pikku-schemas.ts","../bin/pikku-websocket.ts","../bin/pikku.ts","../src/inspector-glob.ts","../src/pikku-cli-config.ts","../src/pikku-command-schemas.ts","../src/schema-generator.ts","../src/schemas.ts","../src/serialize-import-map.ts","../src/serialize-pikku-types.ts","../src/types.ts","../src/utils.ts","../src/runtimes/nextjs/pikku-command-nextjs.ts","../src/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/wirings/channels/pikku-channels.ts","../src/wirings/channels/pikku-command-channels-map.ts","../src/wirings/channels/pikku-command-channels.ts","../src/wirings/channels/pikku-command-websocket-typed.ts","../src/wirings/channels/serialize-typed-channel-map.ts","../src/wirings/channels/serialize-websocket-wrapper.ts","../src/wirings/fetch/index.ts","../src/wirings/functions/pikku-command-function-types.ts","../src/wirings/functions/pikku-command-functions.ts","../src/wirings/functions/pikku-command-services.ts","../src/wirings/functions/pikku-function-types.ts","../src/wirings/functions/pikku-functions.ts","../src/wirings/http/openapi-spec-generator.ts","../src/wirings/http/pikku-command-http-map.ts","../src/wirings/http/pikku-command-http-routes.ts","../src/wirings/http/pikku-command-openapi.ts","../src/wirings/http/pikku-http-routes.ts","../src/wirings/http/serialize-fetch-wrapper.ts","../src/wirings/http/serialize-typed-http-map.ts","../src/wirings/mcp/pikku-command-mcp-json.ts","../src/wirings/mcp/pikku-command-mcp.ts","../src/wirings/mcp/serialize-mcp-json.ts","../src/wirings/queue/pikku-command-queue-map.ts","../src/wirings/queue/pikku-command-queue-service.ts","../src/wirings/queue/pikku-command-queue.ts","../src/wirings/queue/pikku-queue-map.ts","../src/wirings/queue/pikku-queue.ts","../src/wirings/queue/serialize-queue-map.ts","../src/wirings/queue/serialize-queue-meta.ts","../src/wirings/queue/serialize-queue-wrapper.ts","../src/wirings/rpc/pikku-command-rpc-client.ts","../src/wirings/rpc/pikku-command-rpc-map.ts","../src/wirings/rpc/pikku-command-rpc.ts","../src/wirings/rpc/pikku-rpc.ts","../src/wirings/rpc/serialize-rpc-wrapper.ts","../src/wirings/rpc/serialize-typed-rpc-map.ts","../src/wirings/scheduler/pikku-command-scheduler.ts","../src/wirings/scheduler/serialize-scheduler-meta.ts"],"version":"5.9.2"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"author": "yasser.fadl@gmail.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -21,22 +21,22 @@
|
|
|
21
21
|
"test:coverage": "bash run-tests.sh --coverage"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@openapi-contrib/json-schema-to-openapi-schema": "^
|
|
25
|
-
"@pikku/core": "^0.9.
|
|
26
|
-
"@pikku/inspector": "^0.9.
|
|
27
|
-
"@types/cookie": "^0.
|
|
24
|
+
"@openapi-contrib/json-schema-to-openapi-schema": "^4.0.2",
|
|
25
|
+
"@pikku/core": "^0.9.2",
|
|
26
|
+
"@pikku/inspector": "^0.9.2",
|
|
27
|
+
"@types/cookie": "^1.0.0",
|
|
28
28
|
"@types/uuid": "^10.0.0",
|
|
29
|
-
"chalk": "^5.
|
|
29
|
+
"chalk": "^5.5.0",
|
|
30
30
|
"chokidar": "^4.0.3",
|
|
31
|
-
"commander": "^
|
|
31
|
+
"commander": "^14",
|
|
32
32
|
"path-to-regexp": "^8.2.0",
|
|
33
33
|
"tinyglobby": "^0.2.12",
|
|
34
|
-
"ts-json-schema-generator": "^2.
|
|
35
|
-
"typescript": "^5.
|
|
36
|
-
"yaml": "^2.
|
|
34
|
+
"ts-json-schema-generator": "^2.4.0",
|
|
35
|
+
"typescript": "^5.9",
|
|
36
|
+
"yaml": "^2.8.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^
|
|
39
|
+
"@types/node": "^24.2.1"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=18"
|
|
@@ -13,7 +13,7 @@ export const serializePikkuTypes = (
|
|
|
13
13
|
* This is used to provide the application types in the typescript project
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { CorePikkuPermission,
|
|
16
|
+
import { CorePikkuFunctionConfig, CorePikkuPermission, CorePikkuMiddleware, addHTTPMiddleware } from '@pikku/core'
|
|
17
17
|
import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function'
|
|
18
18
|
import { CoreHTTPFunctionWiring, AssertHTTPWiringParams, wireHTTP as wireHTTPCore } from '@pikku/core/http'
|
|
19
19
|
import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
|
|
@@ -41,7 +41,7 @@ export type PikkuPermission<In = unknown, RequiredServices extends ${singletonSe
|
|
|
41
41
|
*
|
|
42
42
|
* @template RequiredServices - The services required for this middleware
|
|
43
43
|
*/
|
|
44
|
-
export type
|
|
44
|
+
export type PikkuMiddleware<RequiredServices extends ${singletonServicesTypeName} = ${singletonServicesTypeName}> = CorePikkuMiddleware<RequiredServices, ${userSessionTypeName}>
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* A sessionless API function that doesn't require user authentication.
|
|
@@ -103,7 +103,7 @@ type PikkuFunction<
|
|
|
103
103
|
* @template Out - Output type for the HTTP wiring
|
|
104
104
|
* @template Route - String literal type for the HTTP path (e.g., "/users/:id")
|
|
105
105
|
*/
|
|
106
|
-
type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out, Route, PikkuFunction<In, Out>, PikkuFunctionSessionless<In, Out>, PikkuPermission<In>,
|
|
106
|
+
type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out, Route, PikkuFunction<In, Out>, PikkuFunctionSessionless<In, Out>, PikkuPermission<In>, PikkuMiddleware>
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* Type definition for WebSocket channels with typed data exchange.
|
|
@@ -173,16 +173,7 @@ type MCPPromptWiring<In> = CoreMCPPrompt<PikkuFunctionSessionless<In, MCPPromptR
|
|
|
173
173
|
export const pikkuFunc = <In, Out = unknown>(
|
|
174
174
|
func:
|
|
175
175
|
| PikkuFunction<In, Out>
|
|
176
|
-
|
|
|
177
|
-
func: PikkuFunction<In, Out>
|
|
178
|
-
auth?: true
|
|
179
|
-
name?: string
|
|
180
|
-
}
|
|
181
|
-
| {
|
|
182
|
-
func: PikkuFunctionSessionless<In, Out>
|
|
183
|
-
auth: false
|
|
184
|
-
name?: string
|
|
185
|
-
}
|
|
176
|
+
| CorePikkuFunctionConfig<PikkuFunction<In, Out>, PikkuPermission<In>>
|
|
186
177
|
) => {
|
|
187
178
|
return typeof func === 'function' ? func : func.func
|
|
188
179
|
}
|
|
@@ -210,10 +201,7 @@ export const pikkuFunc = <In, Out = unknown>(
|
|
|
210
201
|
export const pikkuSessionlessFunc = <In, Out = unknown>(
|
|
211
202
|
func:
|
|
212
203
|
| PikkuFunctionSessionless<In, Out>
|
|
213
|
-
|
|
|
214
|
-
func: PikkuFunctionSessionless<In, Out>
|
|
215
|
-
name?: string
|
|
216
|
-
}
|
|
204
|
+
| CorePikkuFunctionConfig<PikkuFunctionSessionless<In, Out>, PikkuPermission<In>>
|
|
217
205
|
) => {
|
|
218
206
|
return typeof func === 'function' ? func : func.func
|
|
219
207
|
}
|
|
@@ -300,10 +288,7 @@ export const pikkuChannelDisconnectionFunc = <ChannelData = unknown>(
|
|
|
300
288
|
export const pikkuChannelFunc = <In = unknown, Out = unknown, ChannelData = unknown>(
|
|
301
289
|
func:
|
|
302
290
|
| PikkuFunctionSessionless<In, Out, ChannelData>
|
|
303
|
-
|
|
|
304
|
-
func: PikkuFunctionSessionless<In, Out, ChannelData>
|
|
305
|
-
name?: string
|
|
306
|
-
}
|
|
291
|
+
| CorePikkuFunctionConfig<PikkuFunction<In, Out, ChannelData>, PikkuPermission<In>>
|
|
307
292
|
) => {
|
|
308
293
|
return typeof func === 'function' ? func : func.func
|
|
309
294
|
}
|
|
@@ -327,10 +312,7 @@ export const pikkuChannelFunc = <In = unknown, Out = unknown, ChannelData = unkn
|
|
|
327
312
|
export const pikkuVoidFunc = (
|
|
328
313
|
func:
|
|
329
314
|
| PikkuFunctionSessionless<void, void>
|
|
330
|
-
|
|
|
331
|
-
func: PikkuFunctionSessionless<void, void>
|
|
332
|
-
name?: string
|
|
333
|
-
}
|
|
315
|
+
| CorePikkuFunctionConfig<PikkuFunction<void, void>, PikkuPermission<void>>
|
|
334
316
|
) => {
|
|
335
317
|
return typeof func === 'function' ? func : func.func
|
|
336
318
|
}
|
|
@@ -348,6 +330,27 @@ export const wireChannel = <ChannelData, Channel extends string>(
|
|
|
348
330
|
wireChannelCore(channel as any) // TODO
|
|
349
331
|
}
|
|
350
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Registers middleware either globally or for a specific route.
|
|
335
|
+
*
|
|
336
|
+
* When a string route pattern is provided along with middleware, the middleware
|
|
337
|
+
* is applied only to that route. Otherwise, if an array is provided, it is treated
|
|
338
|
+
* as global middleware (applied to all routes).
|
|
339
|
+
*
|
|
340
|
+
* @param routeOrMiddleware - Either a global middleware array or a route pattern string
|
|
341
|
+
* @param middleware - The middleware array to apply when a route pattern is specified
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* \`\`\`typescript
|
|
345
|
+
* // Add global middleware
|
|
346
|
+
* addHTTPMiddleware([authMiddleware, loggingMiddleware])
|
|
347
|
+
*
|
|
348
|
+
* // Add route-specific middleware
|
|
349
|
+
* addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
|
|
350
|
+
* \`\`\`
|
|
351
|
+
*/
|
|
352
|
+
export { addHTTPMiddleware }
|
|
353
|
+
|
|
351
354
|
/**
|
|
352
355
|
* Registers an HTTP wiring with the Pikku framework.
|
|
353
356
|
*
|
package/src/utils.ts
CHANGED
|
@@ -17,20 +17,35 @@ const logo = `
|
|
|
17
17
|
`
|
|
18
18
|
|
|
19
19
|
export class CLILogger {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
private silent: boolean
|
|
21
|
+
|
|
22
|
+
constructor({
|
|
23
|
+
logLogo,
|
|
24
|
+
silent = false,
|
|
25
|
+
}: {
|
|
26
|
+
logLogo: boolean
|
|
27
|
+
silent?: boolean
|
|
28
|
+
}) {
|
|
29
|
+
this.silent = silent
|
|
30
|
+
if (logLogo && !silent) {
|
|
22
31
|
this.logPikkuLogo()
|
|
23
32
|
}
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
primary(message: string) {
|
|
27
|
-
|
|
36
|
+
if (!this.silent) {
|
|
37
|
+
console.log(chalk.green(message))
|
|
38
|
+
}
|
|
28
39
|
}
|
|
29
40
|
success(message: string) {
|
|
30
|
-
|
|
41
|
+
if (!this.silent) {
|
|
42
|
+
console.log(chalk.green(message))
|
|
43
|
+
}
|
|
31
44
|
}
|
|
32
45
|
info(message: string) {
|
|
33
|
-
|
|
46
|
+
if (!this.silent) {
|
|
47
|
+
console.log(chalk.blue(message))
|
|
48
|
+
}
|
|
34
49
|
}
|
|
35
50
|
error(message: string) {
|
|
36
51
|
console.error(chalk.red(message))
|
|
@@ -39,11 +54,15 @@ export class CLILogger {
|
|
|
39
54
|
console.error(chalk.yellow(message))
|
|
40
55
|
}
|
|
41
56
|
debug(message: string) {
|
|
42
|
-
if (process.env.DEBUG) {
|
|
57
|
+
if (process.env.DEBUG && !this.silent) {
|
|
43
58
|
console.log(chalk.gray(message))
|
|
44
59
|
}
|
|
45
60
|
}
|
|
46
61
|
|
|
62
|
+
timing(message: string) {
|
|
63
|
+
console.log(chalk.gray(message))
|
|
64
|
+
}
|
|
65
|
+
|
|
47
66
|
private logPikkuLogo() {
|
|
48
67
|
this.primary(logo)
|
|
49
68
|
const packageJson = JSON.parse(
|
|
@@ -129,6 +148,7 @@ export interface PikkuCLIOptions {
|
|
|
129
148
|
tags?: string[]
|
|
130
149
|
types?: string[]
|
|
131
150
|
directories?: string[]
|
|
151
|
+
silent?: boolean
|
|
132
152
|
}
|
|
133
153
|
|
|
134
154
|
const getMetaTypes = (
|
|
@@ -15,7 +15,7 @@ export const pikkuRPCClient: PikkuCommandWithoutState = async (
|
|
|
15
15
|
'Generating RPC wrapper',
|
|
16
16
|
'Generated RPC wrapper',
|
|
17
17
|
[
|
|
18
|
-
rpcWiringsFile === undefined,
|
|
18
|
+
rpcWiringsFile === undefined || rpcWiringsFile === null,
|
|
19
19
|
"rpcWiringsFile isn't set in the pikku config",
|
|
20
20
|
],
|
|
21
21
|
async () => {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { logCommandInfoAndTime, serializeFileImports, writeFileInDir, } from '../../utils.js';
|
|
2
|
-
export const pikkuChannels = async (logger, cliConfig, visitState) => {
|
|
3
|
-
return await logCommandInfoAndTime(logger, 'Finding Channels', 'Found channels', [visitState.channels.files.size === 0], async () => {
|
|
4
|
-
const { channelsWiringFile, channelsWiringMetaFile, packageMappings } = cliConfig;
|
|
5
|
-
const { channels } = visitState;
|
|
6
|
-
await writeFileInDir(logger, channelsWiringFile, serializeFileImports('addChannel', channelsWiringFile, channels.files, packageMappings));
|
|
7
|
-
await writeFileInDir(logger, channelsWiringMetaFile, `import { pikkuState } from '@pikku/core'\npikkuState('channel', 'meta', ${JSON.stringify(channels.meta, null, 2)})`);
|
|
8
|
-
});
|
|
9
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { logCommandInfoAndTime, writeFileInDir } from '../../utils.js';
|
|
2
|
-
import { serializeTypedChannelsMap } from './serialize-typed-channel-map.js';
|
|
3
|
-
export const pikkuChannelsMap = async (logger, { channelsMapDeclarationFile, packageMappings }, state) => {
|
|
4
|
-
return await logCommandInfoAndTime(logger, 'Creating channels map', 'Created channels map', [state.channels.files.size === 0], async () => {
|
|
5
|
-
const content = serializeTypedChannelsMap(channelsMapDeclarationFile, packageMappings, state.functions.typesMap, state.functions.meta, state.channels.meta);
|
|
6
|
-
await writeFileInDir(logger, channelsMapDeclarationFile, content);
|
|
7
|
-
});
|
|
8
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { logCommandInfoAndTime, serializeFileImports, writeFileInDir, } from '../../utils.js';
|
|
2
|
-
export const pikkuChannels = async (logger, cliConfig, visitState) => {
|
|
3
|
-
return await logCommandInfoAndTime(logger, 'Finding Channels', 'Found channels', [visitState.channels.files.size === 0], async () => {
|
|
4
|
-
const { channelsWiringFile, channelsWiringMetaFile, packageMappings } = cliConfig;
|
|
5
|
-
const { channels } = visitState;
|
|
6
|
-
await writeFileInDir(logger, channelsWiringFile, serializeFileImports('addChannel', channelsWiringFile, channels.files, packageMappings));
|
|
7
|
-
await writeFileInDir(logger, channelsWiringMetaFile, `import { pikkuState } from '@pikku/core'\npikkuState('channel', 'meta', ${JSON.stringify(channels.meta, null, 2)})`);
|
|
8
|
-
});
|
|
9
|
-
};
|