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(deps): bump next from 13.5.6 to 14.2.10 #45

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "next start"
},
"dependencies": {
"next": "^13.0.6",
"next": "^14.2.10",
"nextra": "2.13.4",
"nextra-theme-docs": "2.13.4",
"react": "^18.2.0",
Expand Down
3 changes: 2 additions & 1 deletion apps/storefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"js-cookie": "3.0.5",
"lodash": "4.17.21",
"lucide-react": "^0.368.0",
"next": "14.2.12",
"next": "14.2.10",
"next-auth": "5.0.0-beta.17",
"next-intl": "3.19.3",
"nextjs-routes": "2.1.0",
Expand Down Expand Up @@ -68,6 +68,7 @@
"pino": "9.3.2",
"postcss": "^8.4.41",
"prettier": "3.3.3",
"semantic-release": "24.1.3",
"tailwindcss": "^3.4.4",
"ts-toolbelt": "^9.6.0",
"tsconfig": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"use client";

import { useSearchParams } from "next/navigation";
import { useTranslations } from "next-intl";
import { type ReactNode, useState } from "react";
import { type ReactNode, useEffect, useState } from "react";

import { type CountryCode, type CountryDisplay } from "@nimara/codegen/schema";
import { type AddressFormRow } from "@nimara/domain/objects/AddressForm";
import type { CountryCode, CountryDisplay } from "@nimara/codegen/schema";
import type { AddressFormRow } from "@nimara/domain/objects/AddressForm";
import {
Dialog,
DialogContent,
Expand All @@ -13,6 +14,9 @@ import {
DialogTrigger,
} from "@nimara/ui/components/dialog";

import { useRouter } from "@/i18n/routing";
import { paths } from "@/lib/paths";

import { AddNewAddressForm } from "../_forms/create-address-form";

interface AddNewAddressModalProps {
Expand All @@ -29,8 +33,16 @@ export function AddNewAddressModal({
countryCode,
}: AddNewAddressModalProps) {
const t = useTranslations();
const searchParams = useSearchParams();
const router = useRouter();
const [isOpen, setIsOpen] = useState(false);

useEffect(() => {
if (searchParams.get("country")) {
router.push(paths.account.addresses.asPath());
}
}, [isOpen]);

return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>{children}</DialogTrigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import type { Address } from "@nimara/domain/objects/Address";
import { Button } from "@nimara/ui/components/button";

import { getAccessToken } from "@/auth";
import { Link } from "@/i18n/routing";
import { displayFormattedAddressLines } from "@/lib/address";
import { paths } from "@/lib/paths";
import { getCurrentRegion } from "@/regions/server";
import { addressService, userService } from "@/services";

Expand Down Expand Up @@ -111,16 +109,13 @@ export default async function Page({
countryCode={countryCode}
>
<Button
asChild
variant="outline"
className="flex items-center gap-1 rounded px-[11px] sm:rounded-md sm:px-4"
>
<Link href={paths.account.addresses.asPath()}>
<PlusIcon className="h-4 w-4" />
<span className="hidden sm:block">
{t("address.add-new-address")}
</span>
</Link>
<PlusIcon className="h-4 w-4" />
<span className="hidden sm:block">
{t("address.add-new-address")}
</span>
</Button>
</AddNewAddressModal>
)}
Expand Down
17 changes: 16 additions & 1 deletion apps/storefront/src/app/[locale]/(main)/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { SearchSortBy } from "./_listing/search-sort-by";
type SearchParams = {
after?: string;
before?: string;
category?: string;
limit?: string;
page?: string;
q?: string;
Expand Down Expand Up @@ -85,11 +86,25 @@ export default async function Page({ searchParams }: PageProps) {
);
const { options } = searchService.getSortByOptions(searchContext);

const getHeader = () => {
if (query) {
return t("results-for", { query });
}

if (searchParams.category) {
return (
searchParams.category[0].toUpperCase() + searchParams.category.slice(1)
);
}

return null;
};

return (
<div className="w-full">
<section className="mx-auto my-8 grid gap-8">
<div className="flex items-center justify-between">
<h2 className="text-xl">{query && t("results-for", { query })}</h2>
{getHeader() && <h2 className="text-2xl">{getHeader()}</h2>}
<div className="flex gap-4">
<div className="hidden md:block">
<SearchSortBy options={options} searchParams={searchParams} />
Expand Down
12 changes: 8 additions & 4 deletions apps/storefront/src/app/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { type MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: "*",
allow: "/",
},
rules: [
{
userAgent: "*",
allow: "/",
disallow: ["/api/", "/_next/", "/_vercel/"],
},
],
sitemap: `${process.env.BASE_URL}/sitemap.xml`,
};
}
44 changes: 44 additions & 0 deletions apps/storefront/src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import type { MetadataRoute } from "next";

import type { SearchContext } from "@nimara/infrastructure/use-cases/search/types";

import { searchService } from "@/services/search";

type Item = MetadataRoute.Sitemap[number];

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const searchContext = {
currency: "USD",
channel: "channel-us",
languageCode: "EN_US",
} satisfies SearchContext;

const { results } = await searchService.search(
{
query: "",
limit: 100,
},
searchContext,
);

const publicUrl = process.env.BASE_URL;
const productUrls = results.map(
(product) =>
({
url: `${publicUrl}/products/${product.slug}`,
lastModified: product.updatedAt,
changeFrequency: "daily",
priority: 0.8,
}) satisfies Item,
);

return [
{
url: publicUrl ?? "https://www.nimara.store",
lastModified: new Date(),
changeFrequency: "always",
priority: 1,
},
...productUrls,
];
}
Loading