Skip to content

Commit 6235892

Browse files
authored
Merge pull request #1130 from joshunrau/update-react-and-tailwind
update react to v19 and tailwind to v4
2 parents 01ab9e6 + a82250d commit 6235892

File tree

217 files changed

+10433
-6406
lines changed

Some content is hidden

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

217 files changed

+10433
-6406
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ sqlite/
6565

6666
# runtime core intermediate build
6767
packages/runtime-core/lib/
68+
69+
# storybook
70+
*storybook.log
71+
storybook-static

apps/api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
},
1717
"dependencies": {
1818
"@douglasneuroinformatics/libcrypto": "catalog:",
19-
"@douglasneuroinformatics/libjs": "^2.4.0",
20-
"@douglasneuroinformatics/libnest": "^3.0.1",
19+
"@douglasneuroinformatics/libjs": "catalog:",
20+
"@douglasneuroinformatics/libnest": "^5.2.0",
2121
"@douglasneuroinformatics/libpasswd": "catalog:",
2222
"@douglasneuroinformatics/libstats": "catalog:",
2323
"@faker-js/faker": "^9.4.0",

apps/api/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AppContainer } from '@douglasneuroinformatics/libnest';
1+
import { AppFactory } from '@douglasneuroinformatics/libnest';
22

33
import { AssignmentsModule } from './assignments/assignments.module';
44
import { $Env } from './core/env.schema';
@@ -13,7 +13,7 @@ import { SummaryModule } from './summary/summary.module';
1313
import { UsersModule } from './users/users.module';
1414
import { ConfiguredAuthModule } from './vendor/configured.auth.module';
1515

16-
export default AppContainer.create({
16+
export default AppFactory.create({
1717
docs: {
1818
contact: {
1919

apps/api/src/vendor/configured.auth.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { z } from 'zod';
2020
ability.can('manage', 'all');
2121
break;
2222
case 'GROUP_MANAGER':
23-
ability.can('manage', 'Assignment');
23+
ability.can('manage', 'Assignment', { groupId: { in: groupIds } });
2424
ability.can('manage', 'Group', { id: { in: groupIds } });
2525
ability.can('read', 'Instrument');
2626
ability.can('create', 'InstrumentRecord');

apps/gateway/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@douglasneuroinformatics/libcrypto": "catalog:",
20-
"@douglasneuroinformatics/libui": "catalog:",
21-
"@opendatacapture/instrument-renderer": "workspace:*",
20+
"@douglasneuroinformatics/libui": "^4.2.1",
2221
"@opendatacapture/react-core": "workspace:*",
2322
"@opendatacapture/runtime-core": "workspace:*",
2423
"@opendatacapture/runtime-v1": "workspace:*",
@@ -30,8 +29,8 @@
3029
"lodash-es": "workspace:lodash-es__4.x@*",
3130
"pino-http": "^10.4.0",
3231
"pino-pretty": "^11.2.2",
33-
"react": "workspace:react__18.x@*",
34-
"react-dom": "workspace:react-dom__18.x@*",
32+
"react": "workspace:react__19.x@*",
33+
"react-dom": "workspace:react-dom__19.x@*",
3534
"sirv": "^2.0.4",
3635
"sqlite3": "^5.1.7",
3736
"zod": "workspace:zod__3.23.x@*"
@@ -40,15 +39,14 @@
4039
"@douglasneuroinformatics/esbuild-plugin-prisma": "catalog:",
4140
"@opendatacapture/release-info": "workspace:*",
4241
"@opendatacapture/vite-plugin-runtime": "workspace:*",
42+
"@tailwindcss/vite": "catalog:",
4343
"@types/compression": "^1.7.5",
4444
"@types/express": "^4.17.21",
4545
"@vitejs/plugin-react-swc": "^3.7.2",
46-
"autoprefixer": "^10.4.20",
4746
"esbuild": "catalog:",
4847
"nodemon": "catalog:",
49-
"postcss": "^8.5.1",
5048
"prisma": "catalog:",
51-
"tailwindcss": "^3.4.17",
49+
"tailwindcss": "catalog:",
5250
"type-fest": "workspace:type-fest__4.x@*",
5351
"vite": "catalog:"
5452
},

apps/gateway/src/Root.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { useEffect, useRef } from 'react';
22

33
import { LanguageToggle, NotificationHub, ThemeToggle } from '@douglasneuroinformatics/libui/components';
44
import { useNotificationsStore } from '@douglasneuroinformatics/libui/hooks';
5-
import { InstrumentRenderer } from '@opendatacapture/instrument-renderer';
6-
import type { InstrumentSubmitHandler } from '@opendatacapture/instrument-renderer';
7-
import { Branding } from '@opendatacapture/react-core';
5+
import { Branding, InstrumentRenderer } from '@opendatacapture/react-core';
6+
import type { InstrumentSubmitHandler } from '@opendatacapture/react-core';
87
import type { UpdateRemoteAssignmentData } from '@opendatacapture/schemas/assignment';
98
import type { InstrumentBundleContainer } from '@opendatacapture/schemas/instrument';
109
import axios from 'axios';
@@ -54,7 +53,7 @@ export const Root = ({ id, initialSeriesIndex, target, token }: RootProps) => {
5453

5554
return (
5655
<div className="flex h-screen flex-col" ref={ref} style={{ display: 'none' }}>
57-
<header className="fixed top-0 z-10 w-full bg-white/80 text-slate-700 shadow backdrop-blur-lg dark:bg-slate-800/75 dark:text-slate-300">
56+
<header className="fixed top-0 z-10 w-full bg-white/80 text-slate-700 shadow-sm backdrop-blur-lg dark:bg-slate-800/75 dark:text-slate-300">
5857
<div className="container flex items-center justify-between py-3 font-medium">
5958
<Branding className="[&>span]:hidden sm:[&>span]:block" fontSize="md" />
6059
<div className="flex gap-3">
@@ -69,7 +68,7 @@ export const Root = ({ id, initialSeriesIndex, target, token }: RootProps) => {
6968
</div>
7069
</div>
7170
</header>
72-
<main className="container flex min-h-0 max-w-3xl flex-grow flex-col pb-16 pt-32 xl:max-w-5xl">
71+
<main className="container flex min-h-0 max-w-3xl grow flex-col pb-16 pt-32 xl:max-w-5xl">
7372
<InstrumentRenderer
7473
className="min-h-full w-full"
7574
initialSeriesIndex={initialSeriesIndex}

apps/gateway/tailwind.config.cjs

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/gateway/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"/runtime/v1/*": ["../../runtime/v1/dist/*"]
88
}
99
},
10-
"include": ["scripts/*", "src/**/*", "tailwind.config.cjs", "vite.config.ts"]
10+
"include": ["scripts/*", "src/**/*", "vite.config.ts"]
1111
}

apps/gateway/vite.config.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import path from 'path';
22

33
import { runtime } from '@opendatacapture/vite-plugin-runtime';
4+
import tailwindcss from '@tailwindcss/vite';
45
import react from '@vitejs/plugin-react-swc';
5-
import autoprefixer from 'autoprefixer';
6-
import tailwindcss from 'tailwindcss';
76
import { defineConfig } from 'vite';
87

98
export default defineConfig(({ mode }) => ({
@@ -13,11 +12,6 @@ export default defineConfig(({ mode }) => ({
1312
sourcemap: true,
1413
target: 'es2022'
1514
},
16-
css: {
17-
postcss: {
18-
plugins: [autoprefixer(), tailwindcss()]
19-
}
20-
},
2115
optimizeDeps: {
2216
esbuildOptions: {
2317
target: 'es2022'
@@ -28,7 +22,8 @@ export default defineConfig(({ mode }) => ({
2822
react(),
2923
runtime({
3024
disabled: mode === 'test'
31-
})
25+
}),
26+
tailwindcss()
3227
],
3328
resolve: {
3429
alias: {

apps/outreach/astro.config.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path';
44

55
import sitemap from '@astrojs/sitemap';
66
import starlight from '@astrojs/starlight';
7-
import tailwind from '@astrojs/tailwind';
7+
import tailwind from '@tailwindcss/vite';
88
import { defineConfig, sharpImageService } from 'astro/config';
99
import { toString } from 'mdast-util-to-string';
1010
import getReadingTime from 'reading-time';
@@ -99,18 +99,18 @@ export default defineConfig({
9999
},
100100
starlightTypeDocSidebarGroup
101101
],
102-
social: {
103-
github: 'https://github.com/DouglasNeuroInformatics/OpenDataCapture'
104-
},
102+
social: [
103+
{
104+
href: 'https://github.com/DouglasNeuroInformatics/OpenDataCapture',
105+
icon: 'github',
106+
label: 'GitHub'
107+
}
108+
],
105109
tableOfContents: {
106110
maxHeadingLevel: 4,
107111
minHeadingLevel: 2
108112
},
109113
title: 'Open Data Capture'
110-
}),
111-
tailwind({
112-
applyBaseStyles: false,
113-
configFile: path.resolve(import.meta.dirname, 'tailwind.config.cjs')
114114
})
115115
],
116116
markdown: {
@@ -143,7 +143,8 @@ export default defineConfig({
143143
'docs/en/docs': '../../docs/en',
144144
'docs/fr/docs': '../../docs/fr'
145145
}
146-
})
146+
}),
147+
tailwind()
147148
],
148149
// this is necessary because the MDX imports will attempt to resolve from their actual location
149150
resolve: {

0 commit comments

Comments
 (0)