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

feat: bump deps #243

Merged
merged 18 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 0 additions & 18 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc.cjs

This file was deleted.

30 changes: 0 additions & 30 deletions .github/actions/pnpm-install/action.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Setup Node.js + pnpm"
description: "..."

runs:
using: composite
steps:
- name: Setup pnpm
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: "lts/*"
cache: "pnpm"

- name: Install dependencies
shell: bash
run: pnpm install
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ updates:
actions:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup-node"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
18 changes: 11 additions & 7 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Install dependencies
uses: ./.github/actions/pnpm-install
- name: Set up Node.js
uses: ./.github/actions/setup-node

- name: Lint
run: pnpm lint
- name: Check
run: pnpm check

# TODO: cache playwright
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Build app for e2e tests
run: pnpm build

- name: Run e2e tests
run: pnpm exec playwright test
run: pnpm e2e

- uses: actions/[email protected].0
- uses: actions/[email protected].3
if: always()
with:
name: playwright-report
Expand Down
2 changes: 1 addition & 1 deletion app/components/combobox/suggestion.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DOMPurify from "dompurify";
import { forwardRef, type HTMLAttributes } from "react";
import { type HTMLAttributes, forwardRef } from "react";
import { twMerge } from "tailwind-merge";

interface Props extends HTMLAttributes<HTMLLIElement> {
Expand Down
2 changes: 1 addition & 1 deletion app/components/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { forwardRef, type SVGAttributes } from "react";
import { type SVGAttributes, forwardRef } from "react";

export type IconProps = SVGAttributes<SVGSVGElement>;

Expand Down
2 changes: 1 addition & 1 deletion app/components/inline-link.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { forwardRef, type AnchorHTMLAttributes, type ReactNode } from "react";
import { type AnchorHTMLAttributes, type ReactNode, forwardRef } from "react";
import { twMerge } from "tailwind-merge";

type Props = AnchorHTMLAttributes<HTMLAnchorElement> & {
Expand Down
6 changes: 3 additions & 3 deletions app/features/app/layout.tsx → app/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { GitHub } from "~/components/icons";
import { InlineLink } from "~/components/inline-link";
import { Tooltip } from "~/components/tooltip";

export function Layout({ children }: { children: ReactNode }) {
export function MainLayout({ children }: { children: ReactNode }) {
return (
<div className="flex flex-grow flex-col items-center">
<Header />
Expand Down Expand Up @@ -42,7 +42,7 @@ function Footer({ className }: { className: string }) {
</a>
</Tooltip>
</div>
<p>
<div>
Powered by{" "}
<Tooltip label="node package registry">
<InlineLink href="https://www.npmjs.com/">npm</InlineLink>
Expand All @@ -51,7 +51,7 @@ function Footer({ className }: { className: string }) {
<Tooltip label="cdn">
<InlineLink href="https://unpkg.com/">unpkg</InlineLink>
</Tooltip>
</p>
</div>
</footer>
);
}
15 changes: 0 additions & 15 deletions app/features/app/providers.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions app/features/app/query-client.ts

This file was deleted.

4 changes: 2 additions & 2 deletions app/features/package-search/package-search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useId, useRef, useState } from "react";

import { Combobox } from "~/components/combobox";

import { useSuggestions, type SuggestionsResponseData } from "./suggestions";
import { type SuggestionsResponseData, useSuggestions } from "./suggestions";

interface PackageFormElement extends HTMLFormElement {
elements: HTMLFormControlsCollection & {
Expand Down Expand Up @@ -37,7 +37,7 @@ export function PackageSearch({ initialQuery = "" }: Props) {
};

return (
<Form ref={formRef} action="/package" method="get">
<Form ref={formRef} action="/package/" method="get">
<input ref={submitRef} type="submit" className="hidden" />
<Combobox
id={comboboxId}
Expand Down
2 changes: 1 addition & 1 deletion app/features/package-search/results/package-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { twMerge } from "tailwind-merge";
import { Code } from "~/components/icons";
import { InlineLink } from "~/components/inline-link";
import { Tooltip } from "~/components/tooltip";
import { type PackageData } from "~/server-services/package-data";
import { type PackageData } from "~/server-services/package-data/types";

import { useSourceCodeIcon } from "./use-source-code-icon";

Expand Down
4 changes: 2 additions & 2 deletions app/features/package-search/results/results.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Await } from "@remix-run/react";
import { Suspense } from "react";

import { isErrorResponse, type PackageDataLoaderData } from "~/server-services/package-data";

import { isErrorResponse } from "~/server-services/package-data/errors";
import { type PackageDataLoaderData } from "~/server-services/package-data/package-data.server";
import { DeclarationFiles } from "./declaration-files";
import { LoadingResults } from "./loading-results";
import { PackageDetails } from "./package-details";
Expand Down
7 changes: 2 additions & 5 deletions app/features/package-search/results/types-package-data.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import {
isErrorResponse,
type ErrorResponseData,
type PackageData,
} from "~/server-services/package-data";
import { type ErrorResponseData, isErrorResponse } from "~/server-services/package-data/errors";

import { PackageData } from "~/server-services/package-data/types";
import { PackageDetails } from "./package-details";
import { ErrorIcon, ResultEntry, ResultType, SuccessIcon, WarningIcon } from "./results-entry";

Expand Down
12 changes: 7 additions & 5 deletions app/mocks/npms-suggestions.response.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { rest } from "msw";
import { http, HttpResponse, delay } from "msw";

import { type SuggestionsResponseData } from "~/features/package-search/suggestions";

Expand Down Expand Up @@ -29,14 +29,16 @@ export function npmsSuggestionsReact() {
highlight: "<em>react</em>-redux",
},
];
return rest.get("https://api.npms.io/v2/search/suggestions", async (req, res, ctx) => {
return res(ctx.delay(), ctx.json(data));
return http.get("https://api.npms.io/v2/search/suggestions", async () => {
await delay();
return HttpResponse.json(data);
});
}

export function npmsSuggestionsEmpty() {
const data: SuggestionsResponseData[] = [];
return rest.get("https://api.npms.io/v2/search/suggestions", async (req, res, ctx) => {
return res(ctx.delay(), ctx.json(data));
return http.get("https://api.npms.io/v2/search/suggestions", async () => {
await delay();
return HttpResponse.json(data);
});
}
Loading