Skip to content

Commit

Permalink
fix(@galactiks/config): remove contentlayer dep from config package
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelgautier committed Sep 30, 2023
1 parent 4ee160c commit 1c3f0f3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 41 deletions.
1 change: 0 additions & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"config"
],
"dependencies": {
"@galactiks/contentlayer": "workspace:^",
"deepmerge": "4.3.1",
"lodash.set": "4.3.2",
"zod": "3.22.2"
Expand Down
18 changes: 9 additions & 9 deletions packages/config/src/config.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { pageDocumentTypes } from '@galactiks/contentlayer';
import deepmerge from 'deepmerge';
import { existsSync, readFileSync } from 'fs';
import set from 'lodash.set';
Expand Down Expand Up @@ -26,18 +25,19 @@ const pageSchema = z.object({
.or(z.string()),
});

const pagesObjectItemSchema = pageSchema.or(z.literal(false)).optional();
const galactiksConfigFileSchema = z.object({
locales: localesSchema.optional(),
template: z.string(),
pages: z
.object(
Object.fromEntries(
Object.values(pageDocumentTypes).map((key) => [
key,
pageSchema.or(z.literal(false)).optional(),
])
)
)
.object({
articles: pagesObjectItemSchema,
'organizations': pagesObjectItemSchema,
'pages': pagesObjectItemSchema,
'people': pagesObjectItemSchema,
'place': pagesObjectItemSchema,
'tags': pagesObjectItemSchema,
})
.optional(),
});

Expand Down
59 changes: 28 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1c3f0f3

Please sign in to comment.