Skip to content

Commit 1c04c03

Browse files
author
Tadhg Lewis
committed
Fix deps updating
1 parent 76c4c52 commit 1c04c03

7 files changed

Lines changed: 43 additions & 53 deletions

File tree

packages/create-issue-status/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"picocolors": "^1.1.1"
3838
},
3939
"devDependencies": {
40-
"@types/mri": "^1.2.0",
4140
"@types/node": "^25.9.1",
4241
"tsdown": "^0.22.0",
4342
"typescript": "^6.0.3"

packages/create-issue-status/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ${PROVIDERS.map((p) => ` ${p.color(p.name.padEnd(12))} ${p.display}`).join(
7878
message: "Project name:",
7979
placeholder: defaultTargetDir,
8080
validate: (input) => {
81-
const trimmed = input.trim();
81+
const trimmed = input?.trim() ?? "";
8282
if (trimmed.length === 0) return "Please enter a project name";
8383
if (!/^[a-zA-Z0-9-_]+$/.test(trimmed))
8484
return "Project name can only contain letters, numbers, hyphens, and underscores";
@@ -126,7 +126,7 @@ ${PROVIDERS.map((p) => ` ${p.color(p.name.padEnd(12))} ${p.display}`).join(
126126
message: "Package name:",
127127
placeholder: toValidPackageName(getProjectName()),
128128
validate: (dir) => {
129-
if (isValidPackageName(dir)) return;
129+
if (dir && isValidPackageName(dir)) return;
130130
return "Invalid package.json name";
131131
},
132132
});
@@ -194,7 +194,7 @@ ${PROVIDERS.map((p) => ` ${p.color(p.name.padEnd(12))} ${p.display}`).join(
194194
const githubOwnerResult = await prompts.text({
195195
message: "GitHub repository owner/organization:",
196196
validate: (input) => {
197-
if (input.trim().length > 0) return;
197+
if ((input?.trim().length ?? 0) > 0) return;
198198
return "Please enter the owner";
199199
},
200200
});
@@ -209,7 +209,7 @@ ${PROVIDERS.map((p) => ` ${p.color(p.name.padEnd(12))} ${p.display}`).join(
209209
const githubRepoResult = await prompts.text({
210210
message: "GitHub repository name:",
211211
validate: (input) => {
212-
if (input.trim().length > 0) return;
212+
if ((input?.trim().length ?? 0) > 0) return;
213213
return "Please enter the repository name";
214214
},
215215
});
@@ -226,7 +226,7 @@ ${PROVIDERS.map((p) => ` ${p.color(p.name.padEnd(12))} ${p.display}`).join(
226226
const gitlabProjectIdResult = await prompts.text({
227227
message: "GitLab project ID or path (e.g., 'owner/repo' or project ID):",
228228
validate: (input) => {
229-
if (input.trim().length > 0) return;
229+
if ((input?.trim().length ?? 0) > 0) return;
230230
return "Please enter the project ID or path";
231231
},
232232
});

packages/issue-status/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22

3-
import "./dist/index.js";
3+
import "./dist/index.mjs";

packages/issue-status/src/components/Component.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@ import type { ComponentType } from "../api/types";
33
import { Badge } from "../incidents/Badge";
44
import { useState } from "react";
55

6+
const Box = ({
7+
children,
8+
clickable,
9+
className,
10+
onClick,
11+
}: {
12+
children: React.ReactNode;
13+
clickable?: boolean;
14+
className?: string;
15+
onClick?: () => void;
16+
}) => (
17+
<div
18+
onClick={onClick}
19+
className={`
20+
bg-gray-50 dark:bg-gray-900
21+
p-2 px-4
22+
rounded-xs
23+
flex justify-between items-center
24+
text-gray-800 dark:text-gray-200
25+
${clickable ? "cursor-pointer" : "cursor-default"}
26+
${className || ""}
27+
`}
28+
>
29+
{children}
30+
</div>
31+
);
32+
633
export const Component = ({ name, status, children }: ComponentType) => {
734
const [showChildren, setShowChildren] = useState(false);
835

@@ -42,33 +69,6 @@ export const Component = ({ name, status, children }: ComponentType) => {
4269

4370
const isClickable = Boolean(children?.length);
4471

45-
const Box = ({
46-
children: boxChildren,
47-
clickable,
48-
className,
49-
onClick,
50-
}: {
51-
children: React.ReactNode;
52-
clickable?: boolean;
53-
className?: string;
54-
onClick?: () => void;
55-
}) => (
56-
<div
57-
onClick={onClick}
58-
className={`
59-
bg-gray-50 dark:bg-gray-900
60-
p-2 px-4
61-
rounded-xs
62-
flex justify-between items-center
63-
text-gray-800 dark:text-gray-200
64-
${clickable ? "cursor-pointer" : "cursor-default"}
65-
${className || ""}
66-
`}
67-
>
68-
{boxChildren}
69-
</div>
70-
);
71-
7272
return (
7373
<>
7474
<Box
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
import { describe } from "vitest";
1+
import { describe, test } from "vitest";
22

3-
describe("github", () => {});
3+
describe("github", () => {
4+
test.todo("add coverage for github provider");
5+
});

packages/issue-status/vite.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ export default defineConfig(async () => {
1111

1212
const configPath = path.resolve(process.cwd(), "issue-status.config.ts");
1313

14-
const config = (await tsImport(configPath, import.meta.dirname))
15-
.default as IssueStatusConfig;
16-
1714
if (!fs.existsSync(configPath)) {
1815
throw new Error("issue-status.config.ts not found.");
1916
}
2017

18+
const config = (await tsImport(configPath, import.meta.dirname))
19+
.default as IssueStatusConfig;
20+
2121
return {
2222
root: packageRoot,
2323
base: "./",
@@ -31,15 +31,15 @@ export default defineConfig(async () => {
3131
return html
3232
.replace(
3333
/<title>Vite \+ React \+ TS<\/title>/,
34-
`<title>${config.name}</title>`
34+
`<title>${config.name}</title>`,
3535
)
3636
.replace(
3737
/<link rel="icon" href="\/vite.svg" \/>/,
38-
`<link rel="icon" href="/vite.svg" />`
38+
`<link rel="icon" href="/vite.svg" />`,
3939
)
4040
.replace(
4141
/<meta name="description" content="My status page description" \/>/,
42-
`<meta name="description" content="${config.description}" />`
42+
`<meta name="description" content="${config.description}" />`,
4343
);
4444
},
4545
},

pnpm-lock.yaml

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)