The minimalistic document archiving platform.
chore(config): added the possibility to exclude config variables from the doc website (#922)
Corentin Thomasset077e4294fb34
diff --git a/apps/docs/package.json b/apps/docs/package.jsonindex ceed50a9..dc2854f6 100644--- a/apps/docs/package.json+++ b/apps/docs/package.json@@ -37,7 +37,7 @@"@unocss/reset": "catalog:","eslint": "catalog:","eslint-plugin-astro": "^1.3.1",- "figue": "^3.1.1",+ "figue": "catalog:","lodash-es": "^4.17.21","marked": "^15.0.6","typescript": "catalog:",diff --git a/apps/docs/src/config.data.ts b/apps/docs/src/config.data.tsindex 52e89c65..29c1a7cb 100644--- a/apps/docs/src/config.data.ts+++ b/apps/docs/src/config.data.ts@@ -29,7 +29,7 @@ function formatDoc(doc: string | undefined): string {}const rows = configDetails- .filter(({ path }) => path[0] !== 'env')+ .filter(({ showInDocumentation }) => showInDocumentation !== false).map(({ doc, default: defaultValue, env, path }) => {const isEmptyDefaultValue = isNil(defaultValue) || (isArray(defaultValue) && isEmpty(defaultValue)) || defaultValue === '';diff --git a/apps/papra-server/package.json b/apps/papra-server/package.jsonindex c74963ce..4872aef9 100644--- a/apps/papra-server/package.json+++ b/apps/papra-server/package.json@@ -65,7 +65,7 @@"chokidar": "^4.0.3","drizzle-kit": "^0.30.6","drizzle-orm": "^0.38.4",- "figue": "^3.1.1",+ "figue": "catalog:","file-type": "^21.3.0","hono": "^4.10.7","lodash-es": "^4.17.21",diff --git a/apps/papra-server/src/modules/config/config.ts b/apps/papra-server/src/modules/config/config.tsindex 8b59e62e..0045787c 100644--- a/apps/papra-server/src/modules/config/config.ts+++ b/apps/papra-server/src/modules/config/config.ts@@ -1,4 +1,4 @@-import type { ConfigDefinition } from 'figue';+import type { AppConfigDefinition } from './config.types';import process from 'node:process';import { memoizeOnce, safelySync } from '@corentinth/chisels';import { loadConfig } from 'c12';@@ -32,21 +32,22 @@ export const configDefinition = {schema: z.enum(['development', 'production', 'test']),default: 'development',env: 'NODE_ENV',+ showInDocumentation: false,},version: {- doc: 'The application version. Set via PAPRA_VERSION build arg in Docker.',+ doc: 'The application version, used for display in the about page. Set by dockerfile build args during release builds.',schema: z.string(),default: 'dev',env: 'PAPRA_VERSION',},gitCommitSha: {- doc: 'The git commit hash. Set via GIT_COMMIT build arg in Docker.',+ doc: 'The git commit hash, used for display in the about page. Set by dockerfile build args during release builds.',schema: z.string(),default: 'unknown',env: 'GIT_COMMIT',},gitCommitDate: {- doc: 'The git commit date (ISO 8601 format). Set via BUILD_DATE build arg in Docker.',+ doc: 'The git commit date (ISO 8601 format), used for display in the about page. Set by dockerfile build args during release builds.',schema: z.string(),default: 'unknown',env: 'BUILD_DATE',@@ -159,7 +160,7 @@ export const configDefinition = {subscriptions: subscriptionsConfig,tags: tagsConfig,tracking: trackingConfig,-} as const satisfies ConfigDefinition;+} as const satisfies AppConfigDefinition;const logger = createLogger({ namespace: 'config' });diff --git a/apps/papra-server/src/modules/config/config.types.ts b/apps/papra-server/src/modules/config/config.types.tsindex ff3733c2..815dc58a 100644--- a/apps/papra-server/src/modules/config/config.types.ts+++ b/apps/papra-server/src/modules/config/config.types.ts@@ -1,3 +1,6 @@+import type { ConfigDefinition } from 'figue';import type { parseConfig } from './config';export type Config = Awaited<ReturnType<typeof parseConfig>>['config'];++export type AppConfigDefinition = ConfigDefinition<{ showInDocumentation?: boolean }>;diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex b6dfcc68..db46014d 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -36,6 +36,9 @@ catalogs:eslint:specifier: ^9.39.2version: 9.39.2+ figue:+ specifier: ^3.2.0+ version: 3.2.0ofetch:specifier: 1.4.1version: 1.4.1@@ -133,8 +136,8 @@ importers:specifier: ^1.3.1figue:- specifier: ^3.1.1- version: 3.1.1+ specifier: 'catalog:'+ version: 3.2.0lodash-es:specifier: ^4.17.21version: 4.17.21@@ -507,8 +510,8 @@ importers:specifier: ^0.38.4version: 0.38.4(@cloudflare/[email protected])(@libsql/[email protected])(@types/[email protected])([email protected])([email protected])figue:- specifier: ^3.1.1- version: 3.1.1+ specifier: 'catalog:'+ version: 3.2.0file-type:specifier: ^21.3.0version: 21.3.0@@ -7587,8 +7590,8 @@ packages:resolution: {integrity: sha512-e6eB7zN6UBSwGVwrbWVH+gdLnkW9WwHhmq2YDK1Sh30pzx1onRVGBvogTlUeWxwTa+L86NYdo4hFkh7O8ZjSnA==}- resolution: {integrity: sha512-LYqDGKztWh0tU5eCTzW5nK3MAp4K5ihEsnyWiNwU6jW0yVle9DqQCiMra5lMTXE21d9x882ZoOK4SitMXvaQ3Q==}+ resolution: {integrity: sha512-l7SfD0YvYG0l/Sgk+LqRQps/6kBlogrTSNfuMTzTtsk3HQG4TCIFcNoTKZ2/EUnlD3dHxCzSJI6AEeZ2gl/mLw==}resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==}@@ -19705,7 +19708,7 @@ snapshots:'@typescript-eslint/eslint-plugin': 8.54.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])eslint: 9.39.2([email protected])- eslint-import-resolver-typescript: 3.10.1([email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected])))([email protected]([email protected]))+ eslint-import-resolver-typescript: 3.10.1([email protected])([email protected]([email protected]))eslint-plugin-import: 2.32.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected]([email protected]))eslint-plugin-react: 7.37.5([email protected]([email protected]))@@ -19735,7 +19738,7 @@ snapshots:transitivePeerDependencies:- supports-color- [email protected]([email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected])))([email protected]([email protected])):dependencies:'@nolyfill/is-core-module': 1.0.39debug: 4.4.3([email protected])@@ -19760,14 +19763,14 @@ snapshots:dependencies:eslint: 9.39.2([email protected])- [email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected]([email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected])))([email protected]([email protected])))([email protected]([email protected])):+ [email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected]([email protected])):dependencies:debug: 3.2.7optionalDependencies:eslint: 9.39.2([email protected])eslint-import-resolver-node: 0.3.9- eslint-import-resolver-typescript: 3.10.1([email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected])))([email protected]([email protected]))+ eslint-import-resolver-typescript: 3.10.1([email protected])([email protected]([email protected]))transitivePeerDependencies:- supports-color@@ -19826,7 +19829,7 @@ snapshots:doctrine: 2.1.0eslint: 9.39.2([email protected])eslint-import-resolver-node: 0.3.9- eslint-module-utils: 2.12.1(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected]([email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected])))([email protected]([email protected])))([email protected]([email protected]))+ eslint-module-utils: 2.12.1(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected]([email protected]))hasown: 2.0.2is-core-module: 2.16.1is-glob: 4.0.3@@ -20490,7 +20493,7 @@ snapshots:dependencies:'@standard-schema/spec': 1.0.0diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex c6e25d13..fe2aa8c6 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -22,6 +22,7 @@ catalog:'@iconify-json/tabler': ^1.2.26ofetch: 1.4.1valibot: ^1.2.0+ figue: ^3.2.0ignoredBuiltDependencies:- esbuild