@@ -4,12 +4,12 @@ This document outlines the step-by-step process to migrate from the original rep
44
55## Overview
66
7- | Item | From | To |
8- | ------| ------| -----|
9- | ** Repository** | Original repository | ` github.com/NHSDigital/fdp-react-design-system ` |
10- | ** Package Name** | ` @nhsdigital/fdp-design-system ` | ` @nhsdigital/fdp-design-system ` |
11- | ** Registry** | GitHub Packages | npm public registry |
12- | ** Author** | Original author | FDP Product Design Team |
7+ | Item | From | To |
8+ | ---------------- | ------------------------------- | ----------------------------------------------- |
9+ | ** Repository** | Original repository | ` github.com/NHSDigital/fdp-react-design-system ` |
10+ | ** Package Name** | ` @nhsdigital/fdp-design-system ` | ` @nhsdigital/fdp-design-system ` |
11+ | ** Registry** | GitHub Packages | npm public registry |
12+ | ** Author** | Original author | FDP Product Design Team |
1313
1414---
1515
@@ -18,24 +18,30 @@ This document outlines the step-by-step process to migrate from the original rep
1818The NHSDigital template provides standardized CI/CD, security scanning, and compliance tooling.
1919
2020### Step 1.1: Add NHSDigital remote and fetch template
21+
2122``` bash
2223git remote add nhsdigital https://github.com/NHSDigital/fdp-react-design-system.git
2324git fetch nhsdigital main
2425```
2526
2627### Step 1.2: Merge template (allowing unrelated histories)
28+
2729``` bash
2830git merge nhsdigital/main --allow-unrelated-histories -m " Merge NHSDigital repository template"
2931```
3032
3133### Step 1.3: Resolve conflicts
34+
3235Expected conflicts (template vs existing files):
36+
3337- ` .gitignore ` - Merge both (keep our npm/node ignores, add template's report ignores)
3438- ` README.md ` - Keep ours, but adopt template structure where appropriate
3539- ` .github/ ` workflows - Keep template's CI/CD structure, adapt for npm
3640
3741### Step 1.4: Review and integrate template components
42+
3843Template provides:
44+
3945- ` .github/workflows/ ` - CI/CD pipeline stages (commit, test, build, publish, deploy)
4046- ` .github/actions/ ` - Security scanning, linting, dependency checks
4147- ` .github/ISSUE_TEMPLATE/ ` - Standardized issue templates
@@ -51,25 +57,30 @@ Template provides:
5157## Phase 2: Remove Unnecessary Dependencies
5258
5359### Step 2.1: Remove Chromatic
60+
5461``` bash
5562npm uninstall chromatic @chromatic-com/storybook
5663```
5764
5865Remove from ` package.json ` scripts:
66+
5967- ` "chromatic": "npx chromatic" `
6068- ` "chromatic:ci": "npx chromatic --exit-zero-on-changes" `
6169- ` "chromatic:review": "npx chromatic --auto-accept-changes" `
6270
6371### Step 2.2: Remove GSAP
72+
6473``` bash
6574npm uninstall gsap
6675```
6776
6877Update components to use fallbacks:
78+
6979- ` src/components/Parallax/ParallaxScene.tsx ` - Already has native scroll fallback
7080- ` src/components/ProductRoadmap/ProductRoadmap.tsx ` - Already has CSS fallback
7181
7282Changes needed:
83+
73841 . Remove GSAP import attempts from both components
74852 . Use native scroll/CSS-only implementations
75863 . Update component documentation to reflect no GSAP dependency
@@ -78,7 +89,7 @@ Changes needed:
7889
7990## Phase 3: Remove Unnecessary Documentation
8091
81- ### Files to DELETE (agent work, tracking, aspirational):
92+ ### Files to DELETE (agent work, tracking, aspirational)
8293
8394``` bash
8495# Burndown/tracking docs
@@ -105,7 +116,8 @@ rm docs/roadmaps/lms-extensions.md
105116rm docs/roadmaps/ai-interaction-roadmap.tsx
106117```
107118
108- ### Files to REVIEW (decide based on current relevance):
119+ ### Files to REVIEW (decide based on current relevance)
120+
109121- ` docs/roadmaps/ARCHITECTURE_SSR_NUNJUCKS_MIGRATION.mdx ` - Keep architecture info, remove roadmap framing
110122- ` docs/slot-matrix-stories.md ` - Keep if SlotMatrix is active
111123
@@ -114,6 +126,7 @@ rm docs/roadmaps/ai-interaction-roadmap.tsx
114126## Phase 4: Remove Unnecessary Functionality
115127
116128### Step 4.1: Remove FDP Internal Dashboards
129+
117130Delete ` src/components/FDP/ ` contents EXCEPT Subnav:
118131
119132``` bash
@@ -128,6 +141,7 @@ rm src/components/FDP/*.syntheticData.ts
128141Update ` src/components/FDP/index.ts ` to only export Subnav (already the case).
129142
130143### Step 4.2: Remove Development/Migration Scripts
144+
131145Delete scripts that were for one-time migrations:
132146
133147``` bash
@@ -190,17 +204,21 @@ Update `package.json` to remove corresponding npm scripts.
190204```
191205
192206### Step 5.2: Update all internal package references
207+
193208Search and replace throughout codebase:
209+
194210- ` @nhsdigital/fdp-design-system ` → ` @nhsdigital/fdp-design-system `
195211
196212Files to update:
213+
197214- ` README.md ` (all import examples)
198215- ` docs/ ` (all documentation)
199216- ` examples/nextjs/ ` (package.json and imports)
200217- ` examples/express-njk/ ` (if applicable)
201218- Storybook stories with import examples
202219
203220### Step 5.3: Update README.md
221+
204222- Remove GitHub Packages authentication instructions
205223- Add npm public registry installation: ` npm install @nhsdigital/fdp-design-system `
206224- Update repository URLs
@@ -211,6 +229,7 @@ Files to update:
211229## Phase 6: Update CI/CD for npm Publishing
212230
213231### Step 6.1: Adapt NHSDigital workflow for npm
232+
214233The template provides ` .github/workflows/cicd-2-publish.yaml ` . Update to:
215234
216235``` yaml
@@ -238,6 +257,7 @@ jobs:
238257` ` `
239258
240259### Step 6.2: Set up npm access
260+
2412611. Create npm organization account for ` @nhsdigital` (if not exists)
2422622. Generate npm access token
2432633. Add `NPM_TOKEN` secret to GitHub repository
@@ -247,9 +267,11 @@ jobs:
247267# # Phase 7: Final Cleanup and Verification
248268
249269# ## Step 7.1: Update CLAUDE.md
270+
250271Update with new repository info, package name, and commands.
251272
252273# ## Step 7.2: Run full verification
274+
253275` ` ` bash
254276npm run lint
255277npm run typecheck
@@ -259,13 +281,15 @@ npm run build:parity
259281` ` `
260282
261283# ## Step 7.3: Test local installation
284+
262285` ` ` bash
263286npm pack
264287# In a test project:
265288npm install /path/to/nhsdigital-fdp-react-design-system-x.x.x.tgz
266289` ` `
267290
268291# ## Step 7.4: Update git remote and push
292+
269293` ` ` bash
270294git remote set-url origin https://github.com/NHSDigital/fdp-react-design-system.git
271295git push -u origin main
@@ -276,16 +300,19 @@ git push -u origin main
276300# # Phase 8: Post-Migration Tasks
277301
278302# ## Step 8.1: Archive old repository
303+
279304- Add deprecation notice to original repository
280305- Point users to new repository
281306
282307# ## Step 8.2: First npm publish
308+
283309` ` ` bash
284310npm version 1.0.0 # Or appropriate version for fresh start
285311npm publish --access public
286312` ` `
287313
288314# ## Step 8.3: Verify npm installation
315+
289316` ` ` bash
290317npm install @nhsdigital/fdp-design-system
291318` ` `
@@ -307,38 +334,45 @@ After the main migration is stable, extract SPC to its own repository:
307334# # Checklist
308335
309336# ## Phase 1: Template Merge
337+
310338- [x] Add NHSDigital remote
311339- [x] Merge template with `--allow-unrelated-histories`
312340- [x] Resolve merge conflicts
313341- [x] Review and integrate template CI/CD
314342
315343# ## Phase 2: Dependencies
344+
316345- [x] Remove Chromatic
317346- [x] Remove GSAP
318347- [x] Update ParallaxScene to use fallback only
319348- [x] Update ProductRoadmap to use fallback only
320349
321350# ## Phase 3: Documentation
351+
322352- [x] Delete 16 identified docs files
323353- [x] Review 2 ambiguous files
324354
325355# ## Phase 4: Functionality
356+
326357- [x] Remove FDP internal dashboards (keep Subnav)
327358- [x] Remove ~20 development/migration scripts
328359- [x] Update package.json scripts
329360
330361# ## Phase 5: Package Config
362+
331363- [x] Update package name to `@nhsdigital/fdp-design-system`
332364- [x] Update author to "FDP Product Design Team"
333365- [x] Update license to MIT
334366- [x] Update publishConfig for npm public
335367- [x] Search/replace all package references
336368
337369# ## Phase 6: CI/CD
370+
338371- [x] Configure npm publish workflow
339372- [ ] Set up NPM_TOKEN secret (requires manual setup in GitHub)
340373
341374# ## Phase 7: Verification
375+
342376- [x] Lint passes (`npm run lint`)
343377- [x] SSR tests pass (59 test files, 220 tests)
344378- [ ] Component tests (pre-existing ResizeObserver mock issues in GanttChart/SPC tests)
@@ -347,6 +381,7 @@ After the main migration is stable, extract SPC to its own repository:
347381- [ ] Local pack/install test
348382
349383# ## Phase 8: Go Live
384+
350385- [ ] Push to NHSDigital repo
351386- [ ] Publish to npm
352387- [ ] Archive old repo
0 commit comments