Skip to content

Commit

Permalink
Merge pull request #73 from thegalactiks/remove-contentlayer-config-dep
Browse files Browse the repository at this point in the history
fix(@galactiks/config): remove contentlayer dep from config package
  • Loading branch information
emmanuelgautier authored Sep 30, 2023
2 parents 4ee160c + 1c3f0f3 commit 6348e8f
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 6348e8f

Please sign in to comment.