@meith/web 0.33.1 → 0.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meith/web",
3
- "version": "0.33.1",
3
+ "version": "0.33.2",
4
4
  "description": "The board itself: the Next.js app, and the forum-web bin that materializes it into an external board workspace.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,54 +43,54 @@
43
43
  "react-dom": "19.2.8",
44
44
  "tailwindcss": "^4.3.3",
45
45
  "typescript": "7.0.2",
46
- "@meith/accounts": "0.33.1",
47
- "@meith/admin": "0.33.1",
48
- "@meith/antispam": "0.33.1",
49
- "@meith/api": "0.33.1",
50
- "@meith/attachments": "0.33.1",
51
- "@meith/authorization": "0.33.1",
52
- "@meith/avatars": "0.33.1",
53
- "@meith/board-digest": "0.33.1",
54
- "@meith/core": "0.33.1",
55
- "@meith/db": "0.33.1",
56
- "@meith/demo": "0.33.1",
57
- "@meith/drafts": "0.33.1",
58
- "@meith/drivers": "0.33.1",
59
- "@meith/events": "0.33.1",
60
- "@meith/forums": "0.33.1",
61
- "@meith/groups": "0.33.1",
62
- "@meith/i18n": "0.33.1",
63
- "@meith/import": "0.33.1",
64
- "@meith/install": "0.33.1",
65
- "@meith/mail": "0.33.1",
66
- "@meith/markdown": "0.33.1",
67
- "@meith/marketplace": "0.33.1",
68
- "@meith/messages": "0.33.1",
69
- "@meith/moderation": "0.33.1",
70
- "@meith/notifications": "0.33.1",
71
- "@meith/plugin-calendar": "0.33.1",
72
- "@meith/plugin-dues": "0.33.1",
73
- "@meith/plugin-kit": "0.33.1",
74
- "@meith/polls": "0.33.1",
75
- "@meith/posts": "0.33.1",
76
- "@meith/profile-fields": "0.33.1",
77
- "@meith/relations": "0.33.1",
78
- "@meith/reputation": "0.33.1",
79
- "@meith/runtime": "0.33.1",
80
- "@meith/search": "0.33.1",
81
- "@meith/settings": "0.33.1",
82
- "@meith/signatures": "0.33.1",
83
- "@meith/subscriptions": "0.33.1",
84
- "@meith/tasks": "0.33.1",
85
- "@meith/theme-clubhouse": "0.33.1",
86
- "@meith/theme-default": "0.33.1",
87
- "@meith/theme-kit": "0.33.1",
88
- "@meith/theme-midnight": "0.33.1",
89
- "@meith/theme-phasebook": "0.33.1",
90
- "@meith/theme-raidframe": "0.33.1",
91
- "@meith/threads": "0.33.1",
92
- "@meith/ui": "0.33.1",
93
- "@meith/upgrade": "0.33.1"
46
+ "@meith/accounts": "0.33.2",
47
+ "@meith/admin": "0.33.2",
48
+ "@meith/antispam": "0.33.2",
49
+ "@meith/api": "0.33.2",
50
+ "@meith/attachments": "0.33.2",
51
+ "@meith/authorization": "0.33.2",
52
+ "@meith/avatars": "0.33.2",
53
+ "@meith/board-digest": "0.33.2",
54
+ "@meith/core": "0.33.2",
55
+ "@meith/db": "0.33.2",
56
+ "@meith/demo": "0.33.2",
57
+ "@meith/drafts": "0.33.2",
58
+ "@meith/drivers": "0.33.2",
59
+ "@meith/events": "0.33.2",
60
+ "@meith/forums": "0.33.2",
61
+ "@meith/groups": "0.33.2",
62
+ "@meith/i18n": "0.33.2",
63
+ "@meith/import": "0.33.2",
64
+ "@meith/install": "0.33.2",
65
+ "@meith/mail": "0.33.2",
66
+ "@meith/markdown": "0.33.2",
67
+ "@meith/marketplace": "0.33.2",
68
+ "@meith/messages": "0.33.2",
69
+ "@meith/moderation": "0.33.2",
70
+ "@meith/notifications": "0.33.2",
71
+ "@meith/plugin-calendar": "0.33.2",
72
+ "@meith/plugin-dues": "0.33.2",
73
+ "@meith/plugin-kit": "0.33.2",
74
+ "@meith/polls": "0.33.2",
75
+ "@meith/posts": "0.33.2",
76
+ "@meith/profile-fields": "0.33.2",
77
+ "@meith/relations": "0.33.2",
78
+ "@meith/reputation": "0.33.2",
79
+ "@meith/runtime": "0.33.2",
80
+ "@meith/search": "0.33.2",
81
+ "@meith/settings": "0.33.2",
82
+ "@meith/signatures": "0.33.2",
83
+ "@meith/subscriptions": "0.33.2",
84
+ "@meith/tasks": "0.33.2",
85
+ "@meith/theme-clubhouse": "0.33.2",
86
+ "@meith/theme-default": "0.33.2",
87
+ "@meith/theme-kit": "0.33.2",
88
+ "@meith/theme-midnight": "0.33.2",
89
+ "@meith/theme-phasebook": "0.33.2",
90
+ "@meith/theme-raidframe": "0.33.2",
91
+ "@meith/threads": "0.33.2",
92
+ "@meith/ui": "0.33.2",
93
+ "@meith/upgrade": "0.33.2"
94
94
  },
95
95
  "scripts": {
96
96
  "dev": "next dev",
@@ -1,11 +1,12 @@
1
1
  import 'server-only'
2
2
 
3
- import { env, logger, ValidationError } from '@meith/core'
3
+ import { ConfigurationError, env, logger, ValidationError } from '@meith/core'
4
4
  import {
5
5
  appliedPluginMigrations,
6
6
  applyPluginMigration,
7
7
  getDb,
8
8
  PostgresNavigationRepository,
9
+ pendingCoreMigrations,
9
10
  readVersion,
10
11
  recordVersion,
11
12
  } from '@meith/db'
@@ -16,12 +17,29 @@ import { planUpgrade, type UpgradeState, upgradeNotice } from '@meith/upgrade'
16
17
 
17
18
  import { activeDefinitions } from './plugin-host'
18
19
 
19
- export const CODE_VERSION = '0.33.1'
20
+ export const CODE_VERSION = '0.33.2'
20
21
 
21
22
  export interface UpgradeApplied {
22
23
  readonly plugins: readonly string[]
23
24
  }
24
25
 
26
+ let coreMigrationsUnreadable = false
27
+
28
+ async function missingCoreMigrations(db: ReturnType<typeof getDb>): Promise<readonly string[]> {
29
+ if (coreMigrationsUnreadable) return []
30
+
31
+ try {
32
+ return await pendingCoreMigrations(db)
33
+ } catch (error) {
34
+ if (error instanceof ConfigurationError) coreMigrationsUnreadable = true
35
+ logger().warn(
36
+ { err: String(error) },
37
+ 'could not read the pending core migrations, comparing versions only',
38
+ )
39
+ return []
40
+ }
41
+ }
42
+
25
43
  export async function applyPendingUpgrade(): Promise<UpgradeApplied> {
26
44
  const db = getDb()
27
45
  const definitions = activeDefinitions()
@@ -31,10 +49,12 @@ export async function applyPendingUpgrade(): Promise<UpgradeApplied> {
31
49
  applied[plugin.key] = await appliedPluginMigrations(db, plugin.key)
32
50
  }
33
51
 
52
+ const pendingCore = await missingCoreMigrations(db)
53
+
34
54
  const state: UpgradeState = {
35
55
  recordedVersion: (await readVersion(db, 'core')) ?? CODE_VERSION,
36
56
  codeVersion: CODE_VERSION,
37
- pendingCoreMigrations: [],
57
+ pendingCoreMigrations: pendingCore,
38
58
  plugins: definitions.map((plugin) => ({
39
59
  key: plugin.key,
40
60
  version: plugin.version,
@@ -52,6 +72,15 @@ export async function applyPendingUpgrade(): Promise<UpgradeApplied> {
52
72
  : new ValidationError(notice)
53
73
  }
54
74
 
75
+ if (pendingCore.length > 0) {
76
+ throw new ValidationError(
77
+ msg('error.app.core-migrations-pending', {
78
+ count: pendingCore.length,
79
+ migrations: pendingCore.join(', '),
80
+ }),
81
+ )
82
+ }
83
+
55
84
  const fresh = new Set<string>()
56
85
  for (const plugin of definitions) {
57
86
  if ((await readVersion(db, `plugin:${plugin.key}`)) === null) fresh.add(plugin.key)
@@ -101,7 +130,7 @@ export async function pendingUpgradeNotice(): Promise<string | null> {
101
130
  const state: UpgradeState = {
102
131
  recordedVersion: (await readVersion(db, 'core')) ?? CODE_VERSION,
103
132
  codeVersion: CODE_VERSION,
104
- pendingCoreMigrations: [],
133
+ pendingCoreMigrations: await missingCoreMigrations(db),
105
134
  plugins: plugins.map((plugin) => ({
106
135
  key: plugin.key,
107
136
  version: plugin.version,