Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add typing to templates.ts #1602

Merged
merged 8 commits into from
Jan 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions src/cli/init/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,31 @@ import { InitOptions } from "../types";

export const { dependencies, devDependencies, peerDependencies, scripts, version } = packageJSON;

export function genPkgJSON(opts: InitOptions, pgkVerOverride?: string) {
type peprPackageJSON = {
data: {
name: string;
version: string;
description: string;
keywords: string[];
engines: { node: string };
pepr: {
samayer12 marked this conversation as resolved.
Show resolved Hide resolved
uuid: string;
onError: string;
samayer12 marked this conversation as resolved.
Show resolved Hide resolved
webhookTimeout: number;
customLabels: { namespace: { "pepr.dev": string } };
samayer12 marked this conversation as resolved.
Show resolved Hide resolved
alwaysIgnore: { namespaces: never[] };
samayer12 marked this conversation as resolved.
Show resolved Hide resolved
includedFiles: never[];
samayer12 marked this conversation as resolved.
Show resolved Hide resolved
env: object;
};
scripts: { "k3d-setup": string };
dependencies: { pepr: string; undici: string };
devDependencies: { typescript: string };
};
path: string;
print: string;
};

export function genPkgJSON(opts: InitOptions, pgkVerOverride?: string): peprPackageJSON {
// Generate a random UUID for the module based on the module name
const uuid = uuidv5(opts.name, uuidv4());
// Generate a name for the module based on the module name
Expand Down Expand Up @@ -72,7 +96,7 @@ export function genPkgJSON(opts: InitOptions, pgkVerOverride?: string) {
};
}

export function genPeprTS() {
export function genPeprTS(): { path: string; data: string } {
return {
path: "pepr.ts",
data: peprTS,
Expand Down
Loading