Skip to content

Commit 9af2e62

Browse files
committed
Update package configuration for NHSDigital npm public registry
Package changes: - Renamed package to @nhsdigital/nhs-fdp-design-system - Updated version to 1.0.0 for fresh public release - Changed author to "FDP Product Design Team" - Changed license to MIT - Added repository, bugs, homepage URLs pointing to NHSDigital/fdp-react-design-system - Updated publishConfig to use npm public registry - Added keywords for discoverability - Updated publish scripts to use --access public Updated all references across codebase: - 50+ files updated from @fergusbisset/nhs-fdp-design-system to @nhsdigital/nhs-fdp-design-system - Documentation, imports, comments all updated
1 parent 87811bd commit 9af2e62

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+323
-306
lines changed

CLAUDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Components with interactivity use a split pattern:
7070
- `.tsx` - Client variant with state and data attributes for behaviours
7171
- `.server.tsx` - Server variant invoking pure renderer only
7272

73-
Server variants can be imported via `@fergusbisset/nhs-fdp-design-system/components/ComponentName/server`
73+
Server variants can be imported via `@nhsdigital/nhs-fdp-design-system/components/ComponentName/server`
7474

7575
### Design Token System
7676
Built with Style Dictionary, tokens are in `packages/nhs-fdp/tokens/`:
@@ -112,6 +112,7 @@ The build system auto-generates exports:
112112

113113
1. **Documentation Location**: All docs go in `docs/` subdirectories, never at repo root
114114
2. **React Version**: Uses React 19.2.0
115-
3. **Package Registry**: Published to GitHub Packages (`@fergusbisset` scope)
115+
3. **Package Registry**: Published to npm public registry (`@nhsdigital/nhs-fdp-design-system`)
116116
4. **Next.js Compatibility**: Supports Next.js 13.4+ through 16
117117
5. **Pre-version Checks**: `npm run preversion` runs lint, tests, and build before version bumps
118+
6. **Repository**: https://github.com/NHSDigital/fdp-react-design-system

MIGRATION-PLAN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This document outlines the step-by-step process to migrate from `fergusbisset/nh
77
| Item | From | To |
88
|------|------|-----|
99
| **Repository** | `github.com/fergusbisset/nhs-fdp-design-system` | `github.com/NHSDigital/fdp-react-design-system` |
10-
| **Package Name** | `@fergusbisset/nhs-fdp-design-system` | `@nhsdigital/nhs-fdp-design-system` |
10+
| **Package Name** | `@nhsdigital/nhs-fdp-design-system` | `@nhsdigital/nhs-fdp-design-system` |
1111
| **Registry** | GitHub Packages | npm public registry |
1212
| **Author** | Fergus Bisset | FDP Product Design Team |
1313

@@ -191,7 +191,7 @@ Update `package.json` to remove corresponding npm scripts.
191191

192192
### Step 5.2: Update all internal package references
193193
Search and replace throughout codebase:
194-
- `@fergusbisset/nhs-fdp-design-system``@nhsdigital/nhs-fdp-design-system`
194+
- `@nhsdigital/nhs-fdp-design-system``@nhsdigital/nhs-fdp-design-system`
195195

196196
Files to update:
197197
- `README.md` (all import examples)

docs/BEHAVIOURS_ARCHITECTURE.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ This architecture ensures:
6363

6464
### 1. SSR Components (Server-Side)
6565

66-
**Import from:** `@fergusbisset/nhs-fdp-design-system/ssr` or main export
66+
**Import from:** `@nhsdigital/nhs-fdp-design-system/ssr` or main export
6767

6868
**Usage:**
6969
```tsx
7070
// app/page.tsx (Next.js App Router - Server Component)
71-
import { Button, Radios, Input } from '@fergusbisset/nhs-fdp-design-system/ssr';
71+
import { Button, Radios, Input } from '@nhsdigital/nhs-fdp-design-system/ssr';
7272

7373
export default function Page() {
7474
return (
@@ -97,12 +97,12 @@ export default function Page() {
9797

9898
### 2. BehavioursLoader (Client Component)
9999

100-
**Import from:** `@fergusbisset/nhs-fdp-design-system/behaviours/react`
100+
**Import from:** `@nhsdigital/nhs-fdp-design-system/behaviours/react`
101101

102102
**Usage:**
103103
```tsx
104104
// app/layout.tsx (Next.js App Router - Server Component)
105-
import { BehavioursLoader } from '@fergusbisset/nhs-fdp-design-system/behaviours/react';
105+
import { BehavioursLoader } from '@nhsdigital/nhs-fdp-design-system/behaviours/react';
106106

107107
export default function RootLayout({ children }) {
108108
return (
@@ -137,12 +137,12 @@ export default function RootLayout({ children }) {
137137

138138
### 3. Vanilla JS Behaviours (Browser-Only)
139139

140-
**Import from:** `@fergusbisset/nhs-fdp-design-system/behaviours`
140+
**Import from:** `@nhsdigital/nhs-fdp-design-system/behaviours`
141141

142142
**Usage:**
143143
```typescript
144144
// Traditional approach (if not using React)
145-
import { initAll } from '@fergusbisset/nhs-fdp-design-system/behaviours';
145+
import { initAll } from '@nhsdigital/nhs-fdp-design-system/behaviours';
146146

147147
// After DOM is ready
148148
document.addEventListener('DOMContentLoaded', () => {
@@ -163,8 +163,8 @@ document.addEventListener('DOMContentLoaded', () => {
163163

164164
```tsx
165165
// app/layout.tsx (Server Component)
166-
import { BehavioursLoader } from '@fergusbisset/nhs-fdp-design-system/behaviours/react';
167-
import '@fergusbisset/nhs-fdp-design-system/css';
166+
import { BehavioursLoader } from '@nhsdigital/nhs-fdp-design-system/behaviours/react';
167+
import '@nhsdigital/nhs-fdp-design-system/css';
168168

169169
export default function RootLayout({ children }) {
170170
return (
@@ -180,7 +180,7 @@ export default function RootLayout({ children }) {
180180

181181
```tsx
182182
// app/page.tsx (Server Component)
183-
import { Button, Radios } from '@fergusbisset/nhs-fdp-design-system/ssr';
183+
import { Button, Radios } from '@nhsdigital/nhs-fdp-design-system/ssr';
184184

185185
export default function Page() {
186186
return (
@@ -196,8 +196,8 @@ export default function Page() {
196196

197197
```tsx
198198
// pages/_app.tsx
199-
import { BehavioursLoader } from '@fergusbisset/nhs-fdp-design-system/behaviours/react';
200-
import '@fergusbisset/nhs-fdp-design-system/css';
199+
import { BehavioursLoader } from '@nhsdigital/nhs-fdp-design-system/behaviours/react';
200+
import '@nhsdigital/nhs-fdp-design-system/css';
201201

202202
export default function App({ Component, pageProps }) {
203203
return (
@@ -219,7 +219,7 @@ import nunjucks from 'nunjucks';
219219
const app = express();
220220

221221
// Serve behaviours bundle
222-
app.use('/static', express.static('node_modules/@fergusbisset/nhs-fdp-design-system/dist/behaviours'));
222+
app.use('/static', express.static('node_modules/@nhsdigital/nhs-fdp-design-system/dist/behaviours'));
223223

224224
// In your template:
225225
// <script src="/static/index.js"></script>
@@ -282,7 +282,7 @@ export function initRadios(scope = document) {
282282
```tsx
283283
// ✅ CORRECT - Import in layout, use after children
284284
// app/layout.tsx (Server Component is OK)
285-
import { BehavioursLoader } from '@fergusbisset/nhs-fdp-design-system/behaviours/react';
285+
import { BehavioursLoader } from '@nhsdigital/nhs-fdp-design-system/behaviours/react';
286286

287287
export default function Layout({ children }) {
288288
return (

docs/BEHAVIOURS_INITIALIZATION.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Use Next.js `Script` component or plain `<script>` tags to initialize behaviours
3838

3939
```tsx
4040
// app/layout.tsx (Server Component - no "use client" needed!)
41-
import { InitBehaviours } from '@fergusbisset/nhs-fdp-design-system/nextjs'
41+
import { InitBehaviours } from '@nhsdigital/nhs-fdp-design-system/nextjs'
4242

4343
export default function RootLayout({ children }: { children: React.ReactNode }) {
4444
return (
@@ -77,7 +77,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
7777

7878
```tsx
7979
// app/layout.tsx
80-
import { InitBehavioursInline } from '@fergusbisset/nhs-fdp-design-system/nextjs'
80+
import { InitBehavioursInline } from '@nhsdigital/nhs-fdp-design-system/nextjs'
8181

8282
export default function RootLayout({ children }: { children: React.ReactNode }) {
8383
return (
@@ -112,7 +112,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
112112

113113
<!-- Load behaviours after content -->
114114
<script
115-
src="/node_modules/@fergusbisset/nhs-fdp-design-system/dist/behaviours/init.js"
115+
src="/node_modules/@nhsdigital/nhs-fdp-design-system/dist/behaviours/init.js"
116116
type="module"
117117
defer
118118
></script>
@@ -124,7 +124,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
124124

125125
```html
126126
<script
127-
src="https://unpkg.com/@fergusbisset/nhs-fdp-design-system/dist/behaviours/init.js"
127+
src="https://unpkg.com/@nhsdigital/nhs-fdp-design-system/dist/behaviours/init.js"
128128
type="module"
129129
defer
130130
></script>
@@ -149,7 +149,7 @@ export function ClientInitializer() {
149149
if (typeof window === 'undefined') return
150150

151151
// Import and initialize
152-
import('@fergusbisset/nhs-fdp-design-system/behaviours')
152+
import('@nhsdigital/nhs-fdp-design-system/behaviours')
153153
.then(({ initAll }) => {
154154
initAll(document)
155155
})
@@ -197,7 +197,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
197197

198198
```tsx
199199
// app/layout.tsx
200-
import { BehavioursLoader } from '@fergusbisset/nhs-fdp-design-system/behaviours/react'
200+
import { BehavioursLoader } from '@nhsdigital/nhs-fdp-design-system/behaviours/react'
201201

202202
export default function RootLayout({ children }) {
203203
return (
@@ -215,7 +215,7 @@ export default function RootLayout({ children }) {
215215

216216
```tsx
217217
// app/layout.tsx
218-
import { InitBehaviours } from '@fergusbisset/nhs-fdp-design-system/nextjs'
218+
import { InitBehaviours } from '@nhsdigital/nhs-fdp-design-system/nextjs'
219219

220220
export default function RootLayout({ children }) {
221221
return (
@@ -247,7 +247,7 @@ export function ScopedSection() {
247247
useEffect(() => {
248248
if (!containerRef.current) return
249249

250-
import('@fergusbisset/nhs-fdp-design-system/behaviours')
250+
import('@nhsdigital/nhs-fdp-design-system/behaviours')
251251
.then(({ initAll }) => {
252252
initAll(containerRef.current!) // Init only in this container
253253
})
@@ -275,7 +275,7 @@ export function ManagedSection() {
275275

276276
let cleanup: (() => void) | undefined
277277

278-
import('@fergusbisset/nhs-fdp-design-system/behaviours')
278+
import('@nhsdigital/nhs-fdp-design-system/behaviours')
279279
.then(({ initAll, teardownAll }) => {
280280
initAll(containerRef.current!)
281281
cleanup = () => teardownAll(containerRef.current!)
@@ -306,8 +306,8 @@ export function ManagedSection() {
306306
### "Module not found" errors
307307

308308
**Check**:
309-
1. Package is installed: `npm list @fergusbisset/nhs-fdp-design-system`
310-
2. Import path is correct: `@fergusbisset/nhs-fdp-design-system/nextjs`
309+
1. Package is installed: `npm list @nhsdigital/nhs-fdp-design-system`
310+
2. Import path is correct: `@nhsdigital/nhs-fdp-design-system/nextjs`
311311
3. Build succeeded: `npm run build`
312312

313313
### Behaviours run too early (before hydration)
@@ -342,7 +342,7 @@ Use `<InitBehavioursInline />` if:
342342
**The recommended approach is `<InitBehaviours />`** from the `/nextjs` export:
343343

344344
```tsx
345-
import { InitBehaviours } from '@fergusbisset/nhs-fdp-design-system/nextjs'
345+
import { InitBehaviours } from '@nhsdigital/nhs-fdp-design-system/nextjs'
346346
```
347347

348348
This gives you:

docs/MIGRATIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ We’ve simplified SPC imports to a few stable surfaces and reduced accidental c
55
Recommended pattern (barrel-first):
66

77
- Component and basic types → `src/components/DataVisualisation/charts/SPC` (SPC barrel)
8-
- Example: `import { SPCChart } from '@fergusbisset/nhs-fdp-design-system/src/components/DataVisualisation/charts/SPC'`
8+
- Example: `import { SPCChart } from '@nhsdigital/nhs-fdp-design-system/src/components/DataVisualisation/charts/SPC'`
99
- Example: `import type { SPCChartProps, SPCDatum } from '.../charts/SPC'`
1010
- Engine helpers and enums → `src/components/DataVisualisation/charts/SPC/engine`
1111
- Example: `import { buildSpcV26a, SpcVisualCategory } from '.../charts/SPC/engine'`

docs/NEXTJS-QUICK-START.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Load the behaviours via a tiny client-only component provided by the library. Th
1414

1515
```tsx
1616
// app/layout.tsx (Server Component)
17-
import '@fergusbisset/nhs-fdp-design-system/dist/nhs-fdp-design-system.css';
18-
import { HeaderServer } from '@fergusbisset/nhs-fdp-design-system/ssr';
19-
import { NHSBehavioursInit } from '@fergusbisset/nhs-fdp-design-system/nextjs';
17+
import '@nhsdigital/nhs-fdp-design-system/dist/nhs-fdp-design-system.css';
18+
import { HeaderServer } from '@nhsdigital/nhs-fdp-design-system/ssr';
19+
import { NHSBehavioursInit } from '@nhsdigital/nhs-fdp-design-system/nextjs';
2020

2121
export default function RootLayout({ children }: { children: React.ReactNode }) {
2222
return (
@@ -34,7 +34,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
3434
}
3535
```
3636

37-
Alternative (legacy): If you can’t use the component, create your own client-only wrapper that imports '@fergusbisset/nhs-fdp-design-system/behaviours'. Note: avoid manual script tags (e.g. adding a src directly) – this is brittle in Next.js and won’t help SSR inline dynamic imports.
37+
Alternative (legacy): If you can’t use the component, create your own client-only wrapper that imports '@nhsdigital/nhs-fdp-design-system/behaviours'. Note: avoid manual script tags (e.g. adding a src directly) – this is brittle in Next.js and won’t help SSR inline dynamic imports.
3838

3939
## How to Verify It's Working
4040

@@ -64,7 +64,7 @@ So behaviours **automatically initialize** there. But in your Next.js app, nothi
6464

6565
## What the Behaviours Do
6666

67-
When you import `@fergusbisset/nhs-fdp-design-system/behaviours`, it:
67+
When you import `@nhsdigital/nhs-fdp-design-system/behaviours`, it:
6868

6969
1. **Auto-initializes** on DOM ready (code at bottom of `behaviours/index.ts`)
7070
2. **Finds all headers** on the page (`.nhsuk-header`)
@@ -80,9 +80,9 @@ Without this, you just get the static SSR markup with no interactivity.
8080

8181
```tsx
8282
// app/layout.tsx
83-
import '@fergusbisset/nhs-fdp-design-system/behaviours' // ← The magic line
84-
import { Header } from '@fergusbisset/nhs-fdp-design-system/ssr'
85-
import '@fergusbisset/nhs-fdp-design-system/dist/nhs-fdp-design-system.css'
83+
import '@nhsdigital/nhs-fdp-design-system/behaviours' // ← The magic line
84+
import { Header } from '@nhsdigital/nhs-fdp-design-system/ssr'
85+
import '@nhsdigital/nhs-fdp-design-system/dist/nhs-fdp-design-system.css'
8686

8787
export default function RootLayout({
8888
children

docs/PUBLISHING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ Users can install specific versions:
7070

7171
```bash
7272
# Latest alpha
73-
npm install @fergusbisset/nhs-fdp-design-system@alpha
73+
npm install @nhsdigital/nhs-fdp-design-system@alpha
7474

7575
# Latest beta
76-
npm install @fergusbisset/nhs-fdp-design-system@beta
76+
npm install @nhsdigital/nhs-fdp-design-system@beta
7777

7878
# Latest stable
79-
npm install @fergusbisset/nhs-fdp-design-system
79+
npm install @nhsdigital/nhs-fdp-design-system
8080
# or explicitly:
81-
npm install @fergusbisset/nhs-fdp-design-system@latest
81+
npm install @nhsdigital/nhs-fdp-design-system@latest
8282

8383
# Specific version
84-
npm install @fergusbisset/[email protected]
84+
npm install @nhsdigital/[email protected]
8585
```
8686

8787
## Benefits

docs/RELEASE_v0.0.43.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ If you import ProductCard from `/ssr`:
5252

5353
**Before (v0.0.42):**
5454
```tsx
55-
import { ProductCard } from '@fergusbisset/nhs-fdp-design-system/ssr';
55+
import { ProductCard } from '@nhsdigital/nhs-fdp-design-system/ssr';
5656

5757
<ProductCard
5858
title="Product"
@@ -65,7 +65,7 @@ import { ProductCard } from '@fergusbisset/nhs-fdp-design-system/ssr';
6565

6666
**After (v0.0.43):**
6767
```tsx
68-
import { ProductCard } from '@fergusbisset/nhs-fdp-design-system/ssr';
68+
import { ProductCard } from '@nhsdigital/nhs-fdp-design-system/ssr';
6969

7070
<ProductCard
7171
title="Product"
@@ -81,7 +81,7 @@ import { ProductCard } from '@fergusbisset/nhs-fdp-design-system/ssr';
8181
Client-side usage (main barrel) is **100% backward compatible**:
8282

8383
```tsx
84-
import { ProductCard } from '@fergusbisset/nhs-fdp-design-system';
84+
import { ProductCard } from '@nhsdigital/nhs-fdp-design-system';
8585

8686
// All existing code continues to work unchanged
8787
<ProductCard
@@ -99,7 +99,7 @@ import { ProductCard } from '@fergusbisset/nhs-fdp-design-system';
9999

100100
```tsx
101101
// app/products/page.tsx (Server Component - default)
102-
import { ProductCard } from '@fergusbisset/nhs-fdp-design-system/ssr';
102+
import { ProductCard } from '@nhsdigital/nhs-fdp-design-system/ssr';
103103

104104
export default function ProductsPage() {
105105
return (
@@ -133,7 +133,7 @@ export default function ProductsPage() {
133133
// app/products/interactive.tsx
134134
'use client'; // Required in Next.js App Router
135135

136-
import { ProductCard } from '@fergusbisset/nhs-fdp-design-system';
136+
import { ProductCard } from '@nhsdigital/nhs-fdp-design-system';
137137
import { useRouter } from 'next/navigation';
138138

139139
export default function InteractiveProduct() {
@@ -232,7 +232,7 @@ You can now use ProductCard in **Server Components** (the default):
232232

233233
```tsx
234234
// app/page.tsx - No 'use client' needed!
235-
import { ProductCard } from '@fergusbisset/nhs-fdp-design-system/ssr';
235+
import { ProductCard } from '@nhsdigital/nhs-fdp-design-system/ssr';
236236

237237
export default function HomePage() {
238238
return <ProductCard title="My Product" href="/product" />;
@@ -265,7 +265,7 @@ Questions? Check the documentation:
265265
## Installation
266266

267267
```bash
268-
npm install @fergusbisset/[email protected]
268+
npm install @nhsdigital/[email protected]
269269
```
270270

271271
or with `.npmrc`:
@@ -278,5 +278,5 @@ or with `.npmrc`:
278278
then:
279279

280280
```bash
281-
npm install @fergusbisset/nhs-fdp-design-system@latest
281+
npm install @nhsdigital/nhs-fdp-design-system@latest
282282
```

docs/SSR_HEADER_BEHAVIOUR.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ The `InitBehaviours` component (from `/nextjs` export) initializes all behaviour
4848

4949
```tsx
5050
// app/layout.tsx (Server Component - no "use client" needed!)
51-
import { InitBehaviours } from '@fergusbisset/nhs-fdp-design-system/nextjs'
52-
import { HeaderServer } from '@fergusbisset/nhs-fdp-design-system/ssr'
51+
import { InitBehaviours } from '@nhsdigital/nhs-fdp-design-system/nextjs'
52+
import { HeaderServer } from '@nhsdigital/nhs-fdp-design-system/ssr'
5353

5454
export default function RootLayout({ children }) {
5555
return (
@@ -210,7 +210,7 @@ export function CustomHeaderInit() {
210210
useEffect(() => {
211211
if (!headerRef.current) return
212212

213-
import('@fergusbisset/nhs-fdp-design-system/behaviours')
213+
import('@nhsdigital/nhs-fdp-design-system/behaviours')
214214
.then(({ initHeaders }) => {
215215
const instances = initHeaders(headerRef.current!)
216216
return () => instances.forEach(i => i.destroy())

0 commit comments

Comments
 (0)