JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31
  • Score
    100M100P100Q73506F
  • License MIT

Self-contained project portfolio component for Next.js App Router. Drop in one component, pass a clientSlug and apiBase, done.

Package Exports

  • project-portfolio

Readme

project-portfolio

Self-contained project portfolio component for Next.js App Router. Pass a clientSlug and apiBase — it fetches, caches, and renders everything.

Requirements

  • Next.js 13+ (App Router)
  • React 18+

No other dependencies.

Installation

npm install project-portfolio

Usage

// app/page.tsx
import { ProjectPortfolio } from "project-portfolio"

export default function Page() {
  return (
    <ProjectPortfolio
      clientSlug="your-client-slug"
      apiBase="https://your-api.com"
    />
  )
}

Props

Prop Type Required Default Description
clientSlug string Yes Identifies which client's projects to load
apiBase string Yes Base URL of the projects API
title string No Client name Override the header title
basePath string No "/projects" Base path for project detail links

Caching

Data is cached at two levels:

  1. Per-renderReact.cache() deduplicates any duplicate calls within the same render pass
  2. Cross-requestnext: { revalidate: 60 } on each fetch call caches responses in Next.js's built-in Data Cache for 60 seconds

No third-party caching libraries are used.

Publishing to npm

# 1. Create an account at https://npmjs.com
# 2. Log in
npm login

# 3. Build and publish
cd package
npm run build
npm publish --access public

Updating

Bump the version field in package/package.json then run npm publish again.