Skip to content

Commit fdac478

Browse files
committed
Release 0.2.5
1 parent 081e03e commit fdac478

File tree

16 files changed

+43
-20
lines changed

16 files changed

+43
-20
lines changed

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"**/.DS_Store": true,
1616
"**/Thumbs.db": true,
1717
"**/dist": true,
18-
"**/*.lock": true,
1918
"**/vercel.json": true,
2019
"**/.yarn": true,
2120
"**/.direnv": true

packages/@contentlayer/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentlayer/cli",
3-
"version": "0.2.5-dev.7",
3+
"version": "0.2.5",
44
"type": "module",
55
"exports": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/@contentlayer/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentlayer/client",
3-
"version": "0.2.5-dev.7",
3+
"version": "0.2.5",
44
"type": "module",
55
"exports": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/@contentlayer/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentlayer/core",
3-
"version": "0.2.5-dev.7",
3+
"version": "0.2.5",
44
"type": "module",
55
"exports": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/@contentlayer/core/src/ArtifactsDir.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export namespace ArtifactsDir {
1616
export const mkdir: T.Effect<OT.HasTracer & HasCwd, fs.MkdirError, PosixFilePath> = T.gen(function* ($) {
1717
const cwd = yield* $(getCwd)
1818
const dirPath = getDirPath({ cwd })
19+
1920
yield* $(fs.mkdirp(dirPath))
2021

2122
return dirPath

packages/@contentlayer/core/src/getConfig/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { E } from '@contentlayer/utils/effect'
2-
import { Chunk, OT, pipe, S, T } from '@contentlayer/utils/effect'
2+
import { Array, Chunk, O, OT, pipe, S, T } from '@contentlayer/utils/effect'
33
import type { GetContentlayerVersionError } from '@contentlayer/utils/node'
44
import { fs } from '@contentlayer/utils/node'
55
import * as path from 'node:path'
@@ -48,14 +48,14 @@ export const getConfigWatch = ({
4848
configPath?: string
4949
}): S.Stream<OT.HasTracer & HasCwd, never, E.Either<GetConfigError, Config>> => {
5050
const resolveParams = pipe(
51-
T.structPar({ configPath: resolveConfigPath({ configPath: configPath_ }) }),
51+
T.structPar({ configPath: resolveConfigPath({ configPath: configPath_ }), cwd: getCwd }),
5252
T.chainMergeObject(() => makeTmpDirAndResolveEntryPoint),
5353
T.either,
5454
)
5555

5656
return pipe(
5757
S.fromEffect(resolveParams),
58-
S.chainMapEitherRight(({ configPath, outfilePath }) =>
58+
S.chainMapEitherRight(({ configPath, outfilePath, cwd }) =>
5959
pipe(
6060
esbuild.makeAndSubscribe({
6161
entryPoints: [configPath],
@@ -70,6 +70,7 @@ export const getConfigWatch = ({
7070
bundle: true,
7171
logLevel: 'silent',
7272
metafile: true,
73+
absWorkingDir: cwd,
7374
plugins: [contentlayerGenPlugin(), makeAllPackagesExternalPlugin(configPath)],
7475
}),
7576
S.mapEffectEitherRight((result) => getConfigFromResult({ result, configPath })),
@@ -133,11 +134,15 @@ const getConfigFromResult = ({
133134

134135
const cwd = yield* $(getCwd)
135136

136-
const outfilePath = Object.keys(result.metafile!.outputs)
137+
// Deriving the exact outfilePath here since it's suffixed with a hash
138+
const outfilePath = pipe(
139+
Object.keys(result.metafile!.outputs),
137140
// Will look like `path.join(cacheDir, 'compiled-contentlayer-config-[SOME_HASH].mjs')
138-
.filter((_) => _.match(/compiled-contentlayer-config-.+.mjs$/))
141+
Array.find((_) => _.match(/compiled-contentlayer-config-.+.mjs$/) !== null),
139142
// Needs to be absolute path for ESM import to work
140-
.map((_) => path.join(cwd, _))[0]!
143+
O.map((_) => path.join(cwd, _)),
144+
O.getUnsafe,
145+
)
141146

142147
const esbuildHash = outfilePath.match(/compiled-contentlayer-config-(.+).mjs$/)![1]!
143148

packages/@contentlayer/source-contentful/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentlayer/source-contentful",
3-
"version": "0.2.5-dev.7",
3+
"version": "0.2.5",
44
"type": "module",
55
"exports": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/@contentlayer/source-files/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentlayer/source-files",
3-
"version": "0.2.5-dev.7",
3+
"version": "0.2.5",
44
"type": "module",
55
"exports": {
66
".": {

packages/@contentlayer/source-sanity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentlayer/source-sanity",
3-
"version": "0.2.5-dev.7",
3+
"version": "0.2.5",
44
"type": "module",
55
"exports": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/@contentlayer/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentlayer/utils",
3-
"version": "0.2.5-dev.7",
3+
"version": "0.2.5",
44
"type": "module",
55
"exports": {
66
"./package.json": {

0 commit comments

Comments
 (0)