@meith/cli 0.36.1 → 0.37.0
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 +13 -14
- package/src/index.ts +0 -14
- package/src/upgrade.ts +1 -1
- package/src/demo.ts +0 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "The operator CLI: migrations, backup and restore, imports, users and settings — and the meith bin that runs it against an external board workspace.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,19 +24,18 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@aws-sdk/client-s3": "3.1111.0",
|
|
26
26
|
"tsx": "^4.23.12",
|
|
27
|
-
"@meith/accounts": "0.
|
|
28
|
-
"@meith/backup": "0.
|
|
29
|
-
"@meith/core": "0.
|
|
30
|
-
"@meith/db": "0.
|
|
31
|
-
"@meith/
|
|
32
|
-
"@meith/
|
|
33
|
-
"@meith/
|
|
34
|
-
"@meith/
|
|
35
|
-
"@meith/
|
|
36
|
-
"@meith/
|
|
37
|
-
"@meith/
|
|
38
|
-
"
|
|
39
|
-
"create-meith": "0.36.1"
|
|
27
|
+
"@meith/accounts": "0.37.0",
|
|
28
|
+
"@meith/backup": "0.37.0",
|
|
29
|
+
"@meith/core": "0.37.0",
|
|
30
|
+
"@meith/db": "0.37.0",
|
|
31
|
+
"@meith/drivers": "0.37.0",
|
|
32
|
+
"@meith/forums": "0.37.0",
|
|
33
|
+
"@meith/plugin-kit": "0.37.0",
|
|
34
|
+
"@meith/profile-fields": "0.37.0",
|
|
35
|
+
"@meith/runtime": "0.37.0",
|
|
36
|
+
"@meith/settings": "0.37.0",
|
|
37
|
+
"@meith/tasks": "0.37.0",
|
|
38
|
+
"create-meith": "0.37.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"esbuild": "^0.28.2"
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
userCreate,
|
|
14
14
|
userPromote,
|
|
15
15
|
} from './commands'
|
|
16
|
-
import { demoReset, demoSeed } from './demo'
|
|
17
16
|
import { importCommand } from './import'
|
|
18
17
|
import { profileFieldAdd, profileFieldList, profileFieldRemove } from './profile-fields'
|
|
19
18
|
import { pushKeys } from './push'
|
|
@@ -388,19 +387,6 @@ const commands: Command[] = [
|
|
|
388
387
|
summary: 'Build the full-text index for posts that have none. Resumable.',
|
|
389
388
|
run: searchReindex,
|
|
390
389
|
},
|
|
391
|
-
|
|
392
|
-
{
|
|
393
|
-
name: 'demo:seed',
|
|
394
|
-
summary: 'Write the demo board into an empty database. Needs DEMO_MODE.',
|
|
395
|
-
run: demoSeed,
|
|
396
|
-
},
|
|
397
|
-
|
|
398
|
-
{
|
|
399
|
-
name: 'demo:reset',
|
|
400
|
-
summary: 'Drop everything and rebuild the demo board. Needs DEMO_MODE.',
|
|
401
|
-
usage: 'meith demo:reset --yes',
|
|
402
|
-
run: demoReset,
|
|
403
|
-
},
|
|
404
390
|
]
|
|
405
391
|
|
|
406
392
|
let envFiles: LoadedEnvFiles = { root: undefined, loaded: [] }
|
package/src/upgrade.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { type PluginDefinition, pluginNavigationPlacements } from '@meith/plugin
|
|
|
12
12
|
import { backupBeforeMigrating, runPluginLifecycle } from '@meith/runtime'
|
|
13
13
|
import { type PluginUpgrade, planUpgrade, upgradeNotice } from '@meith/upgrade'
|
|
14
14
|
|
|
15
|
-
export const CODE_VERSION = '0.
|
|
15
|
+
export const CODE_VERSION = '0.37.0'
|
|
16
16
|
|
|
17
17
|
export function pluginUpgrades(plugins: readonly PluginDefinition[]): readonly PluginUpgrade[] {
|
|
18
18
|
return plugins.map((plugin) => ({
|
package/src/demo.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { ConfigurationError, env } from '@meith/core'
|
|
2
|
-
import { getDb } from '@meith/db'
|
|
3
|
-
import { resetDemoBoard, seedDemoBoard } from '@meith/demo'
|
|
4
|
-
import type { PluginDefinition } from '@meith/plugin-kit'
|
|
5
|
-
|
|
6
|
-
import { requirePostgres } from './context'
|
|
7
|
-
|
|
8
|
-
function requireDemoMode(): void {
|
|
9
|
-
if (!env.DEMO_MODE) {
|
|
10
|
-
throw new ConfigurationError(
|
|
11
|
-
'DEMO_MODE is not set, and this command destroys the board it is pointed ' +
|
|
12
|
-
'at. If this really is a demo, set DEMO_MODE=1 in the environment; if it ' +
|
|
13
|
-
'is not, you have the wrong DATABASE_URL.',
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async function plugins(): Promise<readonly PluginDefinition[]> {
|
|
19
|
-
const { installedPluginDefinitions } = await import('@board/plugins')
|
|
20
|
-
return installedPluginDefinitions()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export async function demoSeed(): Promise<number> {
|
|
24
|
-
requirePostgres()
|
|
25
|
-
requireDemoMode()
|
|
26
|
-
|
|
27
|
-
const summary = await seedDemoBoard(getDb(), new Date(), { plugins: await plugins() })
|
|
28
|
-
|
|
29
|
-
console.log(
|
|
30
|
-
`Seeded ${summary.members} member(s), ${summary.forums} forum(s), ` +
|
|
31
|
-
`${summary.threads} thread(s) and ${summary.posts} post(s).`,
|
|
32
|
-
)
|
|
33
|
-
if (summary.plugins.length > 0) {
|
|
34
|
-
console.log(`Furnished plugin(s): ${summary.plugins.join(', ')}.`)
|
|
35
|
-
}
|
|
36
|
-
return 0
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export async function demoReset(args: readonly string[]): Promise<number> {
|
|
40
|
-
requirePostgres()
|
|
41
|
-
requireDemoMode()
|
|
42
|
-
|
|
43
|
-
if (!args.includes('--yes')) {
|
|
44
|
-
console.error(
|
|
45
|
-
'This drops every table in the database and writes the demo board back.\n' +
|
|
46
|
-
'Nothing survives it. Re-run with --yes if that is what you want.',
|
|
47
|
-
)
|
|
48
|
-
return 1
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const result = await resetDemoBoard({ db: getDb(), plugins: await plugins() })
|
|
52
|
-
|
|
53
|
-
console.log(
|
|
54
|
-
`Reset in ${Math.round(result.elapsedMs / 1000)}s: ` +
|
|
55
|
-
`${result.migrationsApplied} migration(s), ${result.members} member(s), ` +
|
|
56
|
-
`${result.forums} forum(s), ${result.threads} thread(s), ${result.posts} post(s)` +
|
|
57
|
-
`${result.plugins.length === 0 ? '' : `, plugin(s) ${result.plugins.join(', ')}`}.`,
|
|
58
|
-
)
|
|
59
|
-
console.log('Uploaded files are untouched — the web container clears those on its own reset.')
|
|
60
|
-
return 0
|
|
61
|
-
}
|