@pikku/cli 0.7.2 → 0.7.3
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 +8 -0
- package/bin/pikku-all.ts +5 -2
- package/bin/pikku-channels-map.ts +2 -33
- package/bin/pikku-channels.ts +2 -30
- package/bin/pikku-fetch.ts +3 -3
- package/bin/pikku-function-types.ts +8 -42
- package/bin/pikku-functions.ts +3 -16
- package/bin/pikku-http-map.ts +2 -32
- package/bin/pikku-http-routes.ts +2 -30
- package/bin/pikku-nextjs.ts +1 -1
- package/bin/pikku-openapi.ts +1 -1
- package/bin/pikku-rpc-map.ts +25 -0
- package/bin/pikku-rpc.ts +62 -7
- package/bin/pikku-scheduler.ts +2 -30
- package/bin/pikku-schemas.ts +2 -2
- package/bin/pikku-websocket.ts +1 -1
- package/bin/pikku.ts +0 -10
- package/dist/bin/pikku-all.d.ts +1 -1
- package/dist/bin/pikku-all.js +5 -2
- package/dist/bin/pikku-channels-map.d.ts +0 -2
- package/dist/bin/pikku-channels-map.js +1 -16
- package/dist/bin/pikku-channels.d.ts +0 -2
- package/dist/bin/pikku-channels.js +1 -16
- package/dist/bin/pikku-fetch.d.ts +1 -1
- package/dist/bin/pikku-fetch.js +1 -1
- package/dist/bin/pikku-function-types.d.ts +2 -4
- package/dist/bin/pikku-function-types.js +3 -22
- package/dist/bin/pikku-functions.js +3 -4
- package/dist/bin/pikku-http-map.d.ts +0 -2
- package/dist/bin/pikku-http-map.js +1 -16
- package/dist/bin/pikku-http-routes.d.ts +0 -2
- package/dist/bin/pikku-http-routes.js +1 -16
- package/dist/bin/pikku-nextjs.d.ts +1 -1
- package/dist/bin/pikku-nextjs.js +1 -1
- package/dist/bin/pikku-openapi.js +1 -1
- package/dist/bin/pikku-rpc-map.d.ts +3 -0
- package/dist/bin/pikku-rpc-map.js +8 -0
- package/dist/bin/pikku-rpc.d.ts +5 -1
- package/dist/bin/pikku-rpc.js +33 -6
- package/dist/bin/pikku-scheduler.d.ts +0 -2
- package/dist/bin/pikku-scheduler.js +1 -16
- package/dist/bin/pikku-schemas.d.ts +1 -1
- package/dist/bin/pikku-schemas.js +2 -2
- package/dist/bin/pikku-websocket.d.ts +1 -1
- package/dist/bin/pikku-websocket.js +1 -1
- package/dist/bin/pikku.js +0 -10
- package/dist/src/inspector-glob.js +1 -1
- package/dist/src/pikku-cli-config.d.ts +7 -5
- package/dist/src/pikku-cli-config.js +6 -0
- package/dist/src/schema-generator.js +1 -1
- package/dist/src/serialize-pikku-types.d.ts +1 -1
- package/dist/src/serialize-pikku-types.js +6 -3
- package/dist/src/serialize-typed-channel-map.js +2 -2
- package/dist/src/serialize-typed-http-map.js +1 -1
- package/dist/src/serialize-typed-rpc-map.d.ts +4 -0
- package/dist/src/serialize-typed-rpc-map.js +66 -0
- package/dist/src/{utils.d.ts → utils/utils.d.ts} +2 -1
- package/dist/src/{utils.js → utils/utils.js} +15 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/inspector-glob.ts +1 -1
- package/src/pikku-cli-config.ts +31 -5
- package/src/schema-generator.ts +1 -1
- package/src/serialize-pikku-types.ts +6 -3
- package/src/serialize-typed-channel-map.ts +2 -2
- package/src/serialize-typed-http-map.ts +1 -1
- package/src/serialize-typed-rpc-map.ts +105 -0
- package/src/{utils.ts → utils/utils.ts} +20 -2
- package/dist/src/serialize-typed-function-map.d.ts +0 -5
- package/dist/src/serialize-typed-function-map.js +0 -109
- package/src/serialize-typed-function-map.ts +0 -161
- /package/dist/src/{serialize-import-map.d.ts → utils/serialize-import-map.d.ts} +0 -0
- /package/dist/src/{serialize-import-map.js → utils/serialize-import-map.js} +0 -0
- /package/src/{serialize-import-map.ts → utils/serialize-import-map.ts} +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { logCommandInfoAndTime, logPikkuLogo, serializeFileImports, writeFileInDir, } from '../src/utils.js';
|
|
3
|
-
import { inspectorGlob } from '../src/inspector-glob.js';
|
|
1
|
+
import { logCommandInfoAndTime, serializeFileImports, writeFileInDir, } from '../src/utils/utils.js';
|
|
4
2
|
export const pikkuChannels = async (cliConfig, visitState) => {
|
|
5
3
|
return await logCommandInfoAndTime('Finding Channels', 'Found channels', [visitState.channels.files.size === 0], async () => {
|
|
6
4
|
const { channelsFile, channelsMetaFile, packageMappings } = cliConfig;
|
|
@@ -9,16 +7,3 @@ export const pikkuChannels = async (cliConfig, visitState) => {
|
|
|
9
7
|
await writeFileInDir(channelsMetaFile, `import { pikkuState } from '@pikku/core'\npikkuState('channel', 'meta', ${JSON.stringify(channels.meta, null, 2)})`);
|
|
10
8
|
});
|
|
11
9
|
};
|
|
12
|
-
async function action(cliOptions) {
|
|
13
|
-
logPikkuLogo();
|
|
14
|
-
const cliConfig = await getPikkuCLIConfig(cliOptions.config, ['rootDir', 'srcDirectories', 'httpRoutesFile'], cliOptions.tags);
|
|
15
|
-
const visitState = await inspectorGlob(cliConfig.rootDir, cliConfig.srcDirectories, cliConfig.filters);
|
|
16
|
-
await pikkuChannels(cliConfig, visitState);
|
|
17
|
-
}
|
|
18
|
-
export const channels = (program) => {
|
|
19
|
-
program
|
|
20
|
-
.command('channels')
|
|
21
|
-
.description('Find all channels to import')
|
|
22
|
-
.option('-c | --config <string>', 'The path to pikku cli config file')
|
|
23
|
-
.action(action);
|
|
24
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { PikkuCLIOptions } from '../src/utils.js';
|
|
3
2
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
|
+
import { PikkuCLIOptions } from '../src/utils/utils.js';
|
|
4
4
|
export declare const pikkuFetch: ({ fetchFile, httpRoutesMapDeclarationFile, packageMappings, }: PikkuCLIConfig) => Promise<void>;
|
|
5
5
|
export declare const action: (options: PikkuCLIOptions) => Promise<void>;
|
|
6
6
|
export declare const fetch: (program: Command) => void;
|
package/dist/bin/pikku-fetch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getFileImportRelativePath, logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils.js';
|
|
2
1
|
import { getPikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
2
|
import { serializeFetchWrapper } from '../src/serialize-fetch-wrapper.js';
|
|
3
|
+
import { getFileImportRelativePath, logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils/utils.js';
|
|
4
4
|
export const pikkuFetch = async ({ fetchFile, httpRoutesMapDeclarationFile, packageMappings, }) => {
|
|
5
5
|
await logCommandInfoAndTime('Generating fetch wrapper', 'Generated fetch wrapper', [fetchFile === undefined, "fetchFile isn't set in the pikku config"], async () => {
|
|
6
6
|
if (!fetchFile) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
1
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
2
|
import { InspectorState } from '@pikku/inspector';
|
|
4
|
-
import { PikkuCLIOptions } from '../src/utils.js';
|
|
5
|
-
export declare const pikkuFunctionTypes: ({ typesDeclarationFile: typesFile, packageMappings }: PikkuCLIConfig, options: PikkuCLIOptions, visitState: InspectorState) => Promise<void>;
|
|
6
|
-
export declare const functionTypes: (program: Command) => void;
|
|
3
|
+
import { PikkuCLIOptions } from '../src/utils/utils.js';
|
|
4
|
+
export declare const pikkuFunctionTypes: ({ typesDeclarationFile: typesFile, packageMappings, rpcMapDeclarationFile, }: PikkuCLIConfig, options: PikkuCLIOptions, visitState: InspectorState) => Promise<void>;
|
|
@@ -1,32 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getFileImportRelativePath, getPikkuFilesAndMethods, logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils.js';
|
|
3
|
-
import { pikkuHTTP } from './pikku-http-routes.js';
|
|
4
|
-
import { inspectorGlob } from '../src/inspector-glob.js';
|
|
1
|
+
import { getFileImportRelativePath, getPikkuFilesAndMethods, logCommandInfoAndTime, writeFileInDir, } from '../src/utils/utils.js';
|
|
5
2
|
import { serializePikkuTypes } from '../src/serialize-pikku-types.js';
|
|
6
|
-
export const pikkuFunctionTypes = async ({ typesDeclarationFile: typesFile, packageMappings }, options, visitState) => {
|
|
3
|
+
export const pikkuFunctionTypes = async ({ typesDeclarationFile: typesFile, packageMappings, rpcMapDeclarationFile, }, options, visitState) => {
|
|
7
4
|
await logCommandInfoAndTime('Creating api types', 'Created api types', [false], async () => {
|
|
8
5
|
const { userSessionType, sessionServicesType, singletonServicesType } = await getPikkuFilesAndMethods(visitState, packageMappings, typesFile, options, {
|
|
9
6
|
userSessionType: true,
|
|
10
7
|
sessionServiceType: true,
|
|
11
8
|
singletonServicesType: true,
|
|
12
9
|
});
|
|
13
|
-
const content = serializePikkuTypes(`import type { ${userSessionType.type} } from '${getFileImportRelativePath(typesFile, userSessionType.typePath, packageMappings)}'`, userSessionType.type, `import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(typesFile, singletonServicesType.typePath, packageMappings)}'`, singletonServicesType.type, `import type { ${sessionServicesType.type} } from '${getFileImportRelativePath(typesFile, sessionServicesType.typePath, packageMappings)}'`,
|
|
10
|
+
const content = serializePikkuTypes(`import type { ${userSessionType.type} } from '${getFileImportRelativePath(typesFile, userSessionType.typePath, packageMappings)}'`, userSessionType.type, `import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(typesFile, singletonServicesType.typePath, packageMappings)}'`, singletonServicesType.type, `import type { ${sessionServicesType.type} } from '${getFileImportRelativePath(typesFile, sessionServicesType.typePath, packageMappings)}'`, `import type { TypedPikkuRPC } from '${getFileImportRelativePath(typesFile, rpcMapDeclarationFile, packageMappings)}'`);
|
|
14
11
|
await writeFileInDir(typesFile, content);
|
|
15
12
|
});
|
|
16
13
|
};
|
|
17
|
-
async function action(cliOptions) {
|
|
18
|
-
logPikkuLogo();
|
|
19
|
-
const cliConfig = await getPikkuCLIConfig(cliOptions.config, ['rootDir', 'srcDirectories', 'typesDeclarationFile'], cliOptions.tags);
|
|
20
|
-
const visitState = await inspectorGlob(cliConfig.rootDir, cliConfig.srcDirectories, cliConfig.filters);
|
|
21
|
-
await pikkuHTTP(cliConfig, visitState);
|
|
22
|
-
}
|
|
23
|
-
export const functionTypes = (program) => {
|
|
24
|
-
program
|
|
25
|
-
.command('types')
|
|
26
|
-
.description('Generate the core API')
|
|
27
|
-
.option('-ct | --pikku-config-type', 'The type of your pikku config object')
|
|
28
|
-
.option('-ss | --singleton-services-factory-type', 'The type of your singleton services factory')
|
|
29
|
-
.option('-se | --session-services-factory-type', 'The type of your session services factory')
|
|
30
|
-
.option('-c | --config <string>', 'The path to pikku cli config file')
|
|
31
|
-
.action(action);
|
|
32
|
-
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { logCommandInfoAndTime,
|
|
1
|
+
import { logCommandInfoAndTime, writeFileInDir } from '../src/utils/utils.js';
|
|
2
2
|
export const pikkuFunctions = async (cliConfig, visitState) => {
|
|
3
|
-
return await logCommandInfoAndTime('Finding Pikku functions', 'Found Pikku functions', [
|
|
4
|
-
const {
|
|
3
|
+
return await logCommandInfoAndTime('Finding Pikku functions', 'Found Pikku functions', [true], async () => {
|
|
4
|
+
const { functionsMetaFile } = cliConfig;
|
|
5
5
|
const { functions } = visitState;
|
|
6
|
-
await writeFileInDir(functionsFile, serializeFileImports('addFunction', functionsFile, functions.files, packageMappings));
|
|
7
6
|
await writeFileInDir(functionsMetaFile, `import { pikkuState } from '@pikku/core'\npikkuState('function', 'meta', ${JSON.stringify(functions.meta, null, 2)})`);
|
|
8
7
|
});
|
|
9
8
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
1
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
2
|
import { InspectorState } from '@pikku/inspector';
|
|
4
3
|
export declare const pikkuHTTPMap: ({ httpRoutesMapDeclarationFile, packageMappings }: PikkuCLIConfig, { http, functions }: InspectorState) => Promise<boolean>;
|
|
5
|
-
export declare const routesMap: (program: Command) => void;
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils.js';
|
|
1
|
+
import { logCommandInfoAndTime, writeFileInDir } from '../src/utils/utils.js';
|
|
3
2
|
import { serializeTypedRoutesMap } from '../src/serialize-typed-http-map.js';
|
|
4
|
-
import { inspectorGlob } from '../src/inspector-glob.js';
|
|
5
3
|
export const pikkuHTTPMap = async ({ httpRoutesMapDeclarationFile, packageMappings }, { http, functions }) => {
|
|
6
4
|
return await logCommandInfoAndTime('Creating HTTP map', 'Created HTTP map', [http.files.size === 0], async () => {
|
|
7
5
|
const content = serializeTypedRoutesMap(httpRoutesMapDeclarationFile, packageMappings, functions.typesMap, functions.meta, http.meta, http.metaInputTypes);
|
|
8
6
|
await writeFileInDir(httpRoutesMapDeclarationFile, content);
|
|
9
7
|
});
|
|
10
8
|
};
|
|
11
|
-
async function action(cliOptions) {
|
|
12
|
-
logPikkuLogo();
|
|
13
|
-
const cliConfig = await getPikkuCLIConfig(cliOptions.config, ['rootDir', 'srcDirectories', 'httpRoutesFile'], cliOptions.tags);
|
|
14
|
-
const visitState = await inspectorGlob(cliConfig.rootDir, cliConfig.srcDirectories, cliConfig.filters);
|
|
15
|
-
await pikkuHTTPMap(cliConfig, visitState);
|
|
16
|
-
}
|
|
17
|
-
export const routesMap = (program) => {
|
|
18
|
-
program
|
|
19
|
-
.command('map')
|
|
20
|
-
.description('Generate a map of all routes to aid in type checking')
|
|
21
|
-
.option('-c | --config <string>', 'The path to pikku cli config file')
|
|
22
|
-
.action(action);
|
|
23
|
-
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
1
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
2
|
import { InspectorState } from '@pikku/inspector';
|
|
4
3
|
export declare const pikkuHTTP: (cliConfig: PikkuCLIConfig, visitState: InspectorState) => Promise<boolean>;
|
|
5
|
-
export declare const routes: (program: Command) => void;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { logCommandInfoAndTime, logPikkuLogo, serializeFileImports, writeFileInDir, } from '../src/utils.js';
|
|
3
|
-
import { inspectorGlob } from '../src/inspector-glob.js';
|
|
1
|
+
import { logCommandInfoAndTime, serializeFileImports, writeFileInDir, } from '../src/utils/utils.js';
|
|
4
2
|
export const pikkuHTTP = async (cliConfig, visitState) => {
|
|
5
3
|
return await logCommandInfoAndTime('Finding HTTP routes', 'Found HTTP routes', [visitState.http.files.size === 0], async () => {
|
|
6
4
|
const { httpRoutesFile, httpRoutesMetaFile, packageMappings } = cliConfig;
|
|
@@ -9,16 +7,3 @@ export const pikkuHTTP = async (cliConfig, visitState) => {
|
|
|
9
7
|
await writeFileInDir(httpRoutesMetaFile, `import { pikkuState } from '@pikku/core'\npikkuState('http', 'meta', ${JSON.stringify(http.meta, null, 2)})`);
|
|
10
8
|
});
|
|
11
9
|
};
|
|
12
|
-
async function action(cliOptions) {
|
|
13
|
-
logPikkuLogo();
|
|
14
|
-
const cliConfig = await getPikkuCLIConfig(cliOptions.config, ['rootDir', 'srcDirectories', 'httpRoutesFile'], cliOptions.tags);
|
|
15
|
-
const visitState = await inspectorGlob(cliConfig.rootDir, cliConfig.srcDirectories, cliConfig.filters);
|
|
16
|
-
await pikkuHTTP(cliConfig, visitState);
|
|
17
|
-
}
|
|
18
|
-
export const routes = (program) => {
|
|
19
|
-
program
|
|
20
|
-
.command('routes')
|
|
21
|
-
.description('Find all routes to import')
|
|
22
|
-
.option('-c | --config <string>', 'The path to pikku cli config file')
|
|
23
|
-
.action(action);
|
|
24
|
-
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { PikkuCLIOptions } from '../src/utils.js';
|
|
2
|
+
import { PikkuCLIOptions } from '../src/utils/utils.js';
|
|
3
3
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
4
4
|
import { InspectorState } from '@pikku/inspector';
|
|
5
5
|
export declare const pikkuNext: ({ nextBackendFile, nextHTTPFile, httpRoutesFile, httpRoutesMapDeclarationFile, schemaDirectory, packageMappings, fetchFile, }: PikkuCLIConfig, visitState: InspectorState, options: PikkuCLIOptions) => Promise<boolean>;
|
package/dist/bin/pikku-nextjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { serializeNextJsBackendWrapper as serializeNextBackendWrapper } from '../src/serialize-nextjs-backend-wrapper.js';
|
|
2
2
|
import { serializeNextJsHTTPWrapper as serializeNextHTTPWrapper } from '../src/serialize-nextjs-http-wrapper.js';
|
|
3
|
-
import { getFileImportRelativePath, getPikkuFilesAndMethods, logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils.js';
|
|
3
|
+
import { getFileImportRelativePath, getPikkuFilesAndMethods, logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils/utils.js';
|
|
4
4
|
import { getPikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
5
5
|
import { inspectorGlob } from '../src/inspector-glob.js';
|
|
6
6
|
export const pikkuNext = async ({ nextBackendFile, nextHTTPFile, httpRoutesFile, httpRoutesMapDeclarationFile, schemaDirectory, packageMappings, fetchFile, }, visitState, options) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils.js';
|
|
1
|
+
import { logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils/utils.js';
|
|
2
2
|
import { generateSchemas } from '../src/schema-generator.js';
|
|
3
3
|
import { generateOpenAPISpec } from '../src/openapi-spec-generator.js';
|
|
4
4
|
import { getPikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { logCommandInfoAndTime, writeFileInDir } from '../src/utils/utils.js';
|
|
2
|
+
import { serializeTypedRPCMap } from '../src/serialize-typed-rpc-map.js';
|
|
3
|
+
export const pikkuRPCMap = async ({ rpcMapDeclarationFile, packageMappings }, { functions, rpc }) => {
|
|
4
|
+
return await logCommandInfoAndTime('Creating RPC map', 'Created RPC map', [rpc.files.size === 0], async () => {
|
|
5
|
+
const content = serializeTypedRPCMap(rpcMapDeclarationFile, packageMappings, functions.typesMap, functions.meta, rpc.meta);
|
|
6
|
+
await writeFileInDir(rpcMapDeclarationFile, content);
|
|
7
|
+
});
|
|
8
|
+
};
|
package/dist/bin/pikku-rpc.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
2
2
|
import { InspectorState } from '@pikku/inspector';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const serializeRPCImports: (outputPath: string, functionsMap: Map<string, {
|
|
4
|
+
path: string;
|
|
5
|
+
exportedName: string;
|
|
6
|
+
}>, packageMappings?: Record<string, string>) => string;
|
|
7
|
+
export declare const pikkuRPC: ({ rpcFile, rpcMetaFile, packageMappings }: PikkuCLIConfig, { rpc }: InspectorState) => Promise<boolean>;
|
package/dist/bin/pikku-rpc.js
CHANGED
|
@@ -1,8 +1,35 @@
|
|
|
1
|
-
import { logCommandInfoAndTime, writeFileInDir } from '../src/utils.js';
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { getFileImportRelativePath, logCommandInfoAndTime, writeFileInDir, } from '../src/utils/utils.js';
|
|
2
|
+
export const serializeRPCImports = (outputPath, functionsMap, packageMappings = {}) => {
|
|
3
|
+
const serializedImports = [
|
|
4
|
+
`/* Import and register RPCs */`,
|
|
5
|
+
`import { addFunction } from '@pikku/core'`,
|
|
6
|
+
];
|
|
7
|
+
const serializedRegistrations = [];
|
|
8
|
+
// Sort by function name for consistent output
|
|
9
|
+
const sortedEntries = Array.from(functionsMap.entries()).sort((a, b) => a[0].localeCompare(b[0]));
|
|
10
|
+
for (const [name, { path, exportedName }] of sortedEntries) {
|
|
11
|
+
const filePath = getFileImportRelativePath(outputPath, path, packageMappings);
|
|
12
|
+
// For directly exported functions, we can just import and register them
|
|
13
|
+
if (name === exportedName) {
|
|
14
|
+
serializedImports.push(`import { ${exportedName} } from '${filePath}'`);
|
|
15
|
+
serializedRegistrations.push(`addFunction('${name}', { func: ${exportedName} })`);
|
|
16
|
+
}
|
|
17
|
+
// For renamed functions, we need to import and alias them
|
|
18
|
+
else {
|
|
19
|
+
serializedImports.push(`import { ${exportedName} as ${name} } from '${filePath}'`);
|
|
20
|
+
serializedRegistrations.push(`addFunction('${name}', ${name})`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Add a blank line between imports and registrations
|
|
24
|
+
if (serializedImports.length > 0 && serializedRegistrations.length > 0) {
|
|
25
|
+
serializedImports.push('');
|
|
26
|
+
}
|
|
27
|
+
// Combine the imports and registrations
|
|
28
|
+
return [...serializedImports, ...serializedRegistrations].join('\n');
|
|
29
|
+
};
|
|
30
|
+
export const pikkuRPC = async ({ rpcFile, rpcMetaFile, packageMappings }, { rpc }) => {
|
|
31
|
+
return await logCommandInfoAndTime('Finding RPCs tasks', 'Found RPCs', [rpc.files.size === 0], async () => {
|
|
32
|
+
await writeFileInDir(rpcFile, serializeRPCImports(rpcFile, rpc.files, packageMappings));
|
|
33
|
+
await writeFileInDir(rpcMetaFile, `import { pikkuState } from '@pikku/core'\npikkuState('rpc', 'meta', ${JSON.stringify(rpc.meta, null, 2)})`);
|
|
7
34
|
});
|
|
8
35
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
1
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
2
|
import { InspectorState } from '@pikku/inspector';
|
|
4
3
|
export declare const pikkuScheduler: (cliConfig: PikkuCLIConfig, visitState: InspectorState) => Promise<boolean>;
|
|
5
|
-
export declare const schedules: (program: Command) => void;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { logCommandInfoAndTime, logPikkuLogo, serializeFileImports, writeFileInDir, } from '../src/utils.js';
|
|
1
|
+
import { logCommandInfoAndTime, serializeFileImports, writeFileInDir, } from '../src/utils/utils.js';
|
|
3
2
|
import { serializeSchedulerMeta } from '../src/serialize-scheduler-meta.js';
|
|
4
|
-
import { inspectorGlob } from '../src/inspector-glob.js';
|
|
5
3
|
export const pikkuScheduler = async (cliConfig, visitState) => {
|
|
6
4
|
return await logCommandInfoAndTime('Finding scheduled tasks', 'Found scheduled tasks', [visitState.scheduledTasks.files.size === 0], async () => {
|
|
7
5
|
const { schedulersFile, schedulersMetaFile, packageMappings } = cliConfig;
|
|
@@ -10,16 +8,3 @@ export const pikkuScheduler = async (cliConfig, visitState) => {
|
|
|
10
8
|
await writeFileInDir(schedulersFile, serializeFileImports('addSerializedTasks', schedulersFile, scheduledTasks.files, packageMappings));
|
|
11
9
|
});
|
|
12
10
|
};
|
|
13
|
-
async function action(options) {
|
|
14
|
-
logPikkuLogo();
|
|
15
|
-
const cliConfig = await getPikkuCLIConfig(options.config, ['rootDir', 'srcDirectories', 'httpRoutesFile'], options.tags);
|
|
16
|
-
const visitState = await inspectorGlob(cliConfig.rootDir, cliConfig.srcDirectories, cliConfig.filters);
|
|
17
|
-
await pikkuScheduler(cliConfig, visitState);
|
|
18
|
-
}
|
|
19
|
-
export const schedules = (program) => {
|
|
20
|
-
program
|
|
21
|
-
.command('scheduler')
|
|
22
|
-
.description('Find all scheduled tasks to import')
|
|
23
|
-
.option('-c | --config <string>', 'The path to pikku cli config file')
|
|
24
|
-
.action(action);
|
|
25
|
-
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
3
|
import { InspectorState } from '@pikku/inspector';
|
|
4
|
-
export declare const pikkuSchemas: ({ tsconfig, schemaDirectory, supportsImportAttributes }: PikkuCLIConfig, { functions, http
|
|
4
|
+
export declare const pikkuSchemas: ({ tsconfig, schemaDirectory, supportsImportAttributes }: PikkuCLIConfig, { functions, http }: InspectorState) => Promise<boolean>;
|
|
5
5
|
export declare const schemas: (program: Command) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { saveSchemas, generateSchemas } from '../src/schema-generator.js';
|
|
2
2
|
import { getPikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
|
-
import { logCommandInfoAndTime, logPikkuLogo } from '../src/utils.js';
|
|
3
|
+
import { logCommandInfoAndTime, logPikkuLogo } from '../src/utils/utils.js';
|
|
4
4
|
import { inspectorGlob } from '../src/inspector-glob.js';
|
|
5
|
-
export const pikkuSchemas = async ({ tsconfig, schemaDirectory, supportsImportAttributes }, { functions, http
|
|
5
|
+
export const pikkuSchemas = async ({ tsconfig, schemaDirectory, supportsImportAttributes }, { functions, http }) => {
|
|
6
6
|
return await logCommandInfoAndTime('Creating schemas', 'Created schemas', [false], async () => {
|
|
7
7
|
const schemas = await generateSchemas(tsconfig, functions.typesMap, functions.meta, http.meta);
|
|
8
8
|
await saveSchemas(schemaDirectory, schemas, functions.typesMap, functions.meta, supportsImportAttributes);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { PikkuCLIOptions } from '../src/utils.js';
|
|
2
|
+
import { PikkuCLIOptions } from '../src/utils/utils.js';
|
|
3
3
|
import { PikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
4
4
|
export declare const pikkuWebSocket: ({ websocketFile, channelsMapDeclarationFile, packageMappings, }: PikkuCLIConfig) => Promise<void>;
|
|
5
5
|
export declare const action: (options: PikkuCLIOptions) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getFileImportRelativePath, logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils.js';
|
|
1
|
+
import { getFileImportRelativePath, logCommandInfoAndTime, logPikkuLogo, writeFileInDir, } from '../src/utils/utils.js';
|
|
2
2
|
import { getPikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
3
|
import { serializeWebsocketWrapper } from '../src/serialize-websocket-wrapper.js';
|
|
4
4
|
export const pikkuWebSocket = async ({ websocketFile, channelsMapDeclarationFile, packageMappings, }) => {
|
package/dist/bin/pikku.js
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { schemas } from './pikku-schemas.js';
|
|
4
|
-
import { routes } from './pikku-http-routes.js';
|
|
5
4
|
import { nextjs } from './pikku-nextjs.js';
|
|
6
5
|
import { all } from './pikku-all.js';
|
|
7
|
-
import { functionTypes } from './pikku-function-types.js';
|
|
8
|
-
import { routesMap } from './pikku-http-map.js';
|
|
9
6
|
import { fetch } from './pikku-fetch.js';
|
|
10
|
-
import { channels } from './pikku-channels.js';
|
|
11
|
-
import { schedules } from './pikku-scheduler.js';
|
|
12
7
|
const program = new Command('pikku');
|
|
13
8
|
program.usage('[command]');
|
|
14
9
|
all(program);
|
|
15
|
-
routes(program);
|
|
16
|
-
routesMap(program);
|
|
17
|
-
functionTypes(program);
|
|
18
10
|
schemas(program);
|
|
19
11
|
nextjs(program);
|
|
20
12
|
fetch(program);
|
|
21
|
-
channels(program);
|
|
22
|
-
schedules(program);
|
|
23
13
|
program.parse(process.argv);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import { glob } from 'tinyglobby';
|
|
3
3
|
import { inspect } from '@pikku/inspector';
|
|
4
|
-
import { logCommandInfoAndTime } from './utils.js';
|
|
4
|
+
import { logCommandInfoAndTime } from './utils/utils.js';
|
|
5
5
|
export const inspectorGlob = async (rootDir, srcDirectories, filters) => {
|
|
6
6
|
let result;
|
|
7
7
|
await logCommandInfoAndTime('Inspecting codebase', 'Inspected codebase', [false], async () => {
|
|
@@ -2,19 +2,21 @@ import { OpenAPISpecInfo } from './openapi-spec-generator.js';
|
|
|
2
2
|
import { InspectorFilters } from '@pikku/inspector';
|
|
3
3
|
export interface PikkuCLICoreOutputFiles {
|
|
4
4
|
outDir?: string;
|
|
5
|
+
schemaDirectory: string;
|
|
6
|
+
typesDeclarationFile: string;
|
|
5
7
|
functionsFile: string;
|
|
6
8
|
functionsMetaFile: string;
|
|
7
9
|
httpRoutesFile: string;
|
|
8
10
|
httpRoutesMetaFile: string;
|
|
11
|
+
httpRoutesMapDeclarationFile: string;
|
|
9
12
|
channelsFile: string;
|
|
10
13
|
channelsMetaFile: string;
|
|
14
|
+
channelsMapDeclarationFile: string;
|
|
15
|
+
rpcFile: string;
|
|
16
|
+
rpcMetaFile: string;
|
|
17
|
+
rpcMapDeclarationFile: string;
|
|
11
18
|
schedulersFile: string;
|
|
12
19
|
schedulersMetaFile: string;
|
|
13
|
-
rpcFile: string;
|
|
14
|
-
schemaDirectory: string;
|
|
15
|
-
typesDeclarationFile: string;
|
|
16
|
-
httpRoutesMapDeclarationFile: string;
|
|
17
|
-
channelsMapDeclarationFile: string;
|
|
18
20
|
bootstrapFile: string;
|
|
19
21
|
}
|
|
20
22
|
export type PikkuCLIConfig = {
|
|
@@ -65,6 +65,12 @@ const _getPikkuCLIConfig = async (configFile = undefined, requiredFields, tags =
|
|
|
65
65
|
if (!result.rpcFile) {
|
|
66
66
|
result.rpcFile = join(result.outDir, 'pikku-rpc.gen.ts');
|
|
67
67
|
}
|
|
68
|
+
if (!result.rpcMetaFile) {
|
|
69
|
+
result.rpcMetaFile = join(result.outDir, 'pikku-rpc-meta.gen.ts');
|
|
70
|
+
}
|
|
71
|
+
if (!result.rpcMapDeclarationFile) {
|
|
72
|
+
result.rpcMapDeclarationFile = join(result.outDir, 'pikku-rpc-map.gen.ts');
|
|
73
|
+
}
|
|
68
74
|
if (!result.httpRoutesFile) {
|
|
69
75
|
result.httpRoutesFile = join(result.outDir, 'pikku-http-routes.gen.ts');
|
|
70
76
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createGenerator, RootlessError } from 'ts-json-schema-generator';
|
|
2
|
-
import { logInfo, writeFileInDir } from './utils.js';
|
|
2
|
+
import { logInfo, writeFileInDir } from './utils/utils.js';
|
|
3
3
|
import { mkdir, writeFile } from 'fs/promises';
|
|
4
4
|
export async function generateSchemas(tsconfig, typesMap, functionMeta, httpRoutesMeta) {
|
|
5
5
|
const schemasSet = new Set(typesMap.customTypes.keys());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
3
|
*/
|
|
4
|
-
export declare const serializePikkuTypes: (userSessionTypeImport: string, userSessionTypeName: string, singletonServicesTypeImport: string, singletonServicesTypeName: string, sessionServicesTypeImport: string,
|
|
4
|
+
export declare const serializePikkuTypes: (userSessionTypeImport: string, userSessionTypeName: string, singletonServicesTypeImport: string, singletonServicesTypeName: string, sessionServicesTypeImport: string, rpcMapTypeImport: string) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
3
|
*/
|
|
4
|
-
export const serializePikkuTypes = (userSessionTypeImport, userSessionTypeName, singletonServicesTypeImport, singletonServicesTypeName, sessionServicesTypeImport,
|
|
4
|
+
export const serializePikkuTypes = (userSessionTypeImport, userSessionTypeName, singletonServicesTypeImport, singletonServicesTypeName, sessionServicesTypeImport, rpcMapTypeImport) => {
|
|
5
5
|
return `/**
|
|
6
6
|
* This is used to provide the application types in the typescript project
|
|
7
7
|
*/
|
|
@@ -15,6 +15,7 @@ import { CoreAPIChannel, PikkuChannel, addChannel as addCoreChannel } from '@pik
|
|
|
15
15
|
${userSessionTypeImport}
|
|
16
16
|
${singletonServicesTypeImport}
|
|
17
17
|
${sessionServicesTypeImport}
|
|
18
|
+
${rpcMapTypeImport}
|
|
18
19
|
|
|
19
20
|
export type APIPermission<In = unknown, RequiredServices extends ${singletonServicesTypeName} = ${singletonServicesTypeName}> = CoreAPIPermission<In, RequiredServices, ${userSessionTypeName}>
|
|
20
21
|
export type APIMiddleware<RequiredServices extends ${singletonServicesTypeName} = ${singletonServicesTypeName}> = PikkuMiddleware<RequiredServices, ${userSessionTypeName}>
|
|
@@ -23,7 +24,8 @@ type APIFunctionSessionless<
|
|
|
23
24
|
In = unknown,
|
|
24
25
|
Out = never,
|
|
25
26
|
ChannelData = null, // null means optional channel
|
|
26
|
-
RequiredServices extends Services = Services &
|
|
27
|
+
RequiredServices extends Services = Services &
|
|
28
|
+
{ rpc: TypedPikkuRPC } & (
|
|
27
29
|
[ChannelData] extends [null]
|
|
28
30
|
? { channel?: PikkuChannel<unknown, Out> } // Optional channel
|
|
29
31
|
: { channel: PikkuChannel<ChannelData, Out> } // Required channel with any data type
|
|
@@ -34,7 +36,8 @@ type APIFunction<
|
|
|
34
36
|
In = unknown,
|
|
35
37
|
Out = never,
|
|
36
38
|
ChannelData = null, // null means optional channel
|
|
37
|
-
RequiredServices extends Services = Services &
|
|
39
|
+
RequiredServices extends Services = Services &
|
|
40
|
+
{ rpc: TypedPikkuRPC } & (
|
|
38
41
|
[ChannelData] extends [null]
|
|
39
42
|
? { channel?: PikkuChannel<unknown, Out> } // Optional channel
|
|
40
43
|
: { channel: PikkuChannel<ChannelData, Out> } // Required channel with any data type
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { serializeImportMap } from './serialize-import-map.js';
|
|
2
|
-
import { generateCustomTypes } from './
|
|
1
|
+
import { serializeImportMap } from './utils/serialize-import-map.js';
|
|
2
|
+
import { generateCustomTypes } from './utils/utils.js';
|
|
3
3
|
export const serializeTypedChannelsMap = (relativeToPath, packageMappings, typesMap, channelsMeta) => {
|
|
4
4
|
const { channels, requiredTypes } = generateChannels(channelsMeta);
|
|
5
5
|
typesMap.customTypes.forEach(({ references }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { serializeImportMap } from './serialize-import-map.js';
|
|
1
|
+
import { serializeImportMap } from './utils/serialize-import-map.js';
|
|
2
2
|
export const serializeTypedRoutesMap = (relativeToPath, packageMappings, typesMap, functionsMeta, routesMeta, metaTypes) => {
|
|
3
3
|
const requiredTypes = new Set();
|
|
4
4
|
const serializedCustomTypes = generateCustomTypes(typesMap, requiredTypes);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TypesMap } from '@pikku/inspector';
|
|
2
|
+
import { FunctionsMeta } from '@pikku/core';
|
|
3
|
+
import { RPCMeta } from '../../core/src/rpc/rpc-types.js';
|
|
4
|
+
export declare const serializeTypedRPCMap: (relativeToPath: string, packageMappings: Record<string, string>, typesMap: TypesMap, functionsMeta: FunctionsMeta, rpcMeta: Record<string, RPCMeta>) => string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { serializeImportMap } from './utils/serialize-import-map.js';
|
|
2
|
+
import { generateCustomTypes } from './utils/utils.js';
|
|
3
|
+
export const serializeTypedRPCMap = (relativeToPath, packageMappings, typesMap, functionsMeta, rpcMeta) => {
|
|
4
|
+
const requiredTypes = new Set();
|
|
5
|
+
const serializedCustomTypes = generateCustomTypes(typesMap, requiredTypes);
|
|
6
|
+
const serializedRPCs = generateRPCs(rpcMeta, functionsMeta, typesMap, requiredTypes);
|
|
7
|
+
const serializedImportMap = serializeImportMap(relativeToPath, packageMappings, typesMap, requiredTypes);
|
|
8
|
+
return `/**
|
|
9
|
+
* This provides the structure needed for typescript to be aware of RPCs and their return types
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
${serializedImportMap}
|
|
13
|
+
${serializedCustomTypes}
|
|
14
|
+
|
|
15
|
+
interface RPCHandler<I, O> {
|
|
16
|
+
input: I;
|
|
17
|
+
output: O;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
${serializedRPCs}
|
|
21
|
+
|
|
22
|
+
type RPCInvoke = <Name extends keyof RPCMap>(
|
|
23
|
+
name: Name,
|
|
24
|
+
data: RPCMap[Name]['input'],
|
|
25
|
+
options?: {
|
|
26
|
+
location?: 'local' | 'remote' | 'auto'
|
|
27
|
+
}
|
|
28
|
+
) => Promise<RPCMap[Name]['output']>
|
|
29
|
+
|
|
30
|
+
export type TypedPikkuRPC = {
|
|
31
|
+
depth: number;
|
|
32
|
+
global: boolean;
|
|
33
|
+
invoke: RPCInvoke;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
};
|
|
37
|
+
function generateRPCs(rpcMeta, functionsMeta, typesMap, requiredTypes) {
|
|
38
|
+
// Initialize an object to collect RPCs
|
|
39
|
+
const rpcsObj = {};
|
|
40
|
+
// Iterate through RPC metadata
|
|
41
|
+
for (const [funcName, { pikkuFuncName }] of Object.entries(rpcMeta)) {
|
|
42
|
+
const functionMeta = functionsMeta[pikkuFuncName];
|
|
43
|
+
if (!functionMeta) {
|
|
44
|
+
throw new Error(`Function ${funcName} not found in functionsMeta. Please check your configuration.`);
|
|
45
|
+
}
|
|
46
|
+
const input = functionMeta.inputs ? functionMeta.inputs[0] : undefined;
|
|
47
|
+
const output = functionMeta.outputs ? functionMeta.outputs[0] : undefined;
|
|
48
|
+
// Store the input and output types for RPCHandler
|
|
49
|
+
const inputType = input ? typesMap.getTypeMeta(input).uniqueName : 'null';
|
|
50
|
+
const outputType = output ? typesMap.getTypeMeta(output).uniqueName : 'null';
|
|
51
|
+
requiredTypes.add(inputType);
|
|
52
|
+
requiredTypes.add(outputType);
|
|
53
|
+
// Add RPC entry
|
|
54
|
+
rpcsObj[funcName] = {
|
|
55
|
+
inputType,
|
|
56
|
+
outputType,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
// Build the RPCs object as a string
|
|
60
|
+
let rpcsStr = 'export type RPCMap = {\n';
|
|
61
|
+
for (const [funcName, handler] of Object.entries(rpcsObj)) {
|
|
62
|
+
rpcsStr += ` readonly '${funcName}': RPCHandler<${handler.inputType}, ${handler.outputType}>,\n`;
|
|
63
|
+
}
|
|
64
|
+
rpcsStr += '};\n';
|
|
65
|
+
return rpcsStr;
|
|
66
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InspectorState } from '@pikku/inspector';
|
|
1
|
+
import { InspectorState, TypesMap } from '@pikku/inspector';
|
|
2
2
|
export declare const logPrimary: (message: string) => void;
|
|
3
3
|
export declare const logSuccess: (message: string) => void;
|
|
4
4
|
export declare const logInfo: (message: string) => void;
|
|
@@ -39,4 +39,5 @@ export declare const logCommandInfoAndTime: (commandStart: string, commandEnd: s
|
|
|
39
39
|
export declare const logPikkuLogo: () => void;
|
|
40
40
|
export declare const DO_NOT_MODIFY_COMMENT = "/**\n * This file was generated by the @pikku/cli\n */\n";
|
|
41
41
|
export declare const serializeFileImports: (importType: string, outputPath: string, files: Set<string>, packageMappings?: Record<string, string>) => string;
|
|
42
|
+
export declare function generateCustomTypes(typesMap: TypesMap, requiredTypes: Set<string>): string;
|
|
42
43
|
export {};
|
|
@@ -123,7 +123,7 @@ const logo = `
|
|
|
123
123
|
`;
|
|
124
124
|
export const logPikkuLogo = () => {
|
|
125
125
|
logPrimary(logo);
|
|
126
|
-
const packageJson = JSON.parse(readFileSync(`${dirname(__filename)}
|
|
126
|
+
const packageJson = JSON.parse(readFileSync(`${dirname(__filename)}/../../../package.json`, 'utf-8'));
|
|
127
127
|
logPrimary(`⚙️ Welcome to the Pikku CLI (v${packageJson.version})\n`);
|
|
128
128
|
};
|
|
129
129
|
// TODO: add version back in once the ESM dust settles
|
|
@@ -143,3 +143,17 @@ export const serializeFileImports = (importType, outputPath, files, packageMappi
|
|
|
143
143
|
});
|
|
144
144
|
return serializedOutput.join('\n');
|
|
145
145
|
};
|
|
146
|
+
export function generateCustomTypes(typesMap, requiredTypes) {
|
|
147
|
+
return `
|
|
148
|
+
// Custom types are those that are defined directly within generics
|
|
149
|
+
// or are broken into simpler types
|
|
150
|
+
${Array.from(typesMap.customTypes.entries())
|
|
151
|
+
.map(([name, { type, references }]) => {
|
|
152
|
+
references.forEach((name) => {
|
|
153
|
+
const originalName = typesMap.getTypeMeta(name).originalName;
|
|
154
|
+
requiredTypes.add(originalName);
|
|
155
|
+
});
|
|
156
|
+
return `export type ${name} = ${type}`;
|
|
157
|
+
})
|
|
158
|
+
.join('\n')}`;
|
|
159
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../bin/pikku-all.ts","../bin/pikku-channels-map.ts","../bin/pikku-channels.ts","../bin/pikku-fetch.ts","../bin/pikku-function-types.ts","../bin/pikku-functions.ts","../bin/pikku-http-map.ts","../bin/pikku-http-routes.ts","../bin/pikku-nextjs.ts","../bin/pikku-openapi.ts","../bin/pikku-rpc.ts","../bin/pikku-scheduler.ts","../bin/pikku-schemas.ts","../bin/pikku-websocket.ts","../bin/pikku.ts","../src/inspector-glob.ts","../src/openapi-spec-generator.ts","../src/pikku-cli-config.ts","../src/schema-generator.ts","../src/serialize-fetch-wrapper.ts","../src/serialize-
|
|
1
|
+
{"root":["../bin/pikku-all.ts","../bin/pikku-channels-map.ts","../bin/pikku-channels.ts","../bin/pikku-fetch.ts","../bin/pikku-function-types.ts","../bin/pikku-functions.ts","../bin/pikku-http-map.ts","../bin/pikku-http-routes.ts","../bin/pikku-nextjs.ts","../bin/pikku-openapi.ts","../bin/pikku-rpc-map.ts","../bin/pikku-rpc.ts","../bin/pikku-scheduler.ts","../bin/pikku-schemas.ts","../bin/pikku-websocket.ts","../bin/pikku.ts","../src/inspector-glob.ts","../src/openapi-spec-generator.ts","../src/pikku-cli-config.ts","../src/schema-generator.ts","../src/serialize-fetch-wrapper.ts","../src/serialize-nextjs-backend-wrapper.ts","../src/serialize-nextjs-http-wrapper.ts","../src/serialize-pikku-types.ts","../src/serialize-scheduler-meta.ts","../src/serialize-typed-channel-map.ts","../src/serialize-typed-http-map.ts","../src/serialize-typed-rpc-map.ts","../src/serialize-websocket-wrapper.ts","../src/utils/serialize-import-map.ts","../src/utils/utils.ts"],"version":"5.7.3"}
|