diff --git a/.eslintrc b/.eslintrc index fd9526fa..c4eb9fa7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,7 +4,7 @@ "node": true, "es6": true }, - "ignorePatterns": ["packages/_archive/*", "examples/*", "**/dist/*"], + "ignorePatterns": ["packages/_archive/*", "examples/*", "**/dist/*", "**/.nyc_output/*"], "parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint", "simple-import-sort", "import"], "extends": ["plugin:react-hooks/recommended", "plugin:@typescript-eslint/recommended", "prettier"], diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57b3f1aa..731a6ee3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,8 +19,7 @@ jobs: strategy: matrix: node-version: [16.x] - # Note tests are currently not run in Windows because the path seperator on Windows invalidates the test results 🙈 - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: schickling-actions/checkout-and-install@main diff --git a/.prettierignore b/.prettierignore index ffda0759..fd82805a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ packages/_archive/* -**/dist/* \ No newline at end of file +**/dist/* +**/.nyc_output/* \ No newline at end of file diff --git a/examples/mdx/next.config.js b/examples/mdx/next.config.js deleted file mode 100644 index 7234249c..00000000 --- a/examples/mdx/next.config.js +++ /dev/null @@ -1,3 +0,0 @@ -const { withContentlayer } = require('next-contentlayer') - -module.exports = withContentlayer()({}) diff --git a/examples/mdx/next.config.mjs b/examples/mdx/next.config.mjs new file mode 100644 index 00000000..08c70613 --- /dev/null +++ b/examples/mdx/next.config.mjs @@ -0,0 +1,3 @@ +import { withContentlayer } from 'next-contentlayer' + +export default withContentlayer()({}) diff --git a/examples/playground-azimuth-colocated/package.json b/examples/playground-azimuth-colocated/package.json index 26489335..5f7a52ed 100644 --- a/examples/playground-azimuth-colocated/package.json +++ b/examples/playground-azimuth-colocated/package.json @@ -7,7 +7,7 @@ "start": "next start" }, "dependencies": { - "date-fns": "^2.24.0", + "date-fns": "^2.25.0", "marked": "^3.0.4", "next": "^12.0.2", "react": "^17.0.2", diff --git a/examples/playground-azimuth-contentful/package.json b/examples/playground-azimuth-contentful/package.json index c58900c2..b7912d18 100644 --- a/examples/playground-azimuth-contentful/package.json +++ b/examples/playground-azimuth-contentful/package.json @@ -7,7 +7,7 @@ "build": "next build" }, "dependencies": { - "date-fns": "^2.24.0", + "date-fns": "^2.25.0", "marked": "^3.0.4", "next": "^12.0.2", "react": "^17.0.2", diff --git a/examples/playground-azimuth-sanity/web/package.json b/examples/playground-azimuth-sanity/web/package.json index e16fdd26..61d06b00 100644 --- a/examples/playground-azimuth-sanity/web/package.json +++ b/examples/playground-azimuth-sanity/web/package.json @@ -10,7 +10,7 @@ "dependencies": { "@contentlayer/source-sanity": "workspace:*", "contentlayer": "workspace:*", - "date-fns": "^2.24.0", + "date-fns": "^2.25.0", "marked": "^3.0.4", "next": "^12.0.2", "react": "^17.0.2", diff --git a/examples/playground-azimuth/package.json b/examples/playground-azimuth/package.json index 49ce8b12..fc1de44a 100644 --- a/examples/playground-azimuth/package.json +++ b/examples/playground-azimuth/package.json @@ -7,7 +7,7 @@ "start": "next start" }, "dependencies": { - "date-fns": "^2.24.0", + "date-fns": "^2.25.0", "marked": "^3.0.4", "next": "^12.0.2", "react": "^17.0.2", diff --git a/examples/playground-contentful-starter/package.json b/examples/playground-contentful-starter/package.json index d5f65da6..8aa3c886 100644 --- a/examples/playground-contentful-starter/package.json +++ b/examples/playground-contentful-starter/package.json @@ -8,7 +8,7 @@ "start": "next start" }, "dependencies": { - "date-fns": "^2.24.0", + "date-fns": "^2.25.0", "next": "^12.0.2", "react": "17.0.2", "react-dom": "17.0.2" diff --git a/examples/starter-js/package.json b/examples/starter-js/package.json index 55d4be01..0f5a0e9b 100644 --- a/examples/starter-js/package.json +++ b/examples/starter-js/package.json @@ -9,7 +9,7 @@ "gen:stackbit": "contentlayer-stackbit-yaml-generator" }, "dependencies": { - "date-fns": "^2.24.0", + "date-fns": "^2.25.0", "next": "^12.0.2", "react": "17.0.2", "react-dom": "17.0.2" diff --git a/examples/starter/package.json b/examples/starter/package.json index fed5036e..6a57477a 100644 --- a/examples/starter/package.json +++ b/examples/starter/package.json @@ -9,7 +9,7 @@ "gen:stackbit": "contentlayer-stackbit-yaml-generator" }, "dependencies": { - "date-fns": "^2.24.0", + "date-fns": "^2.25.0", "next": "^12.0.2", "react": "17.0.2", "react-dom": "17.0.2" diff --git a/packages/@contentlayer/cli/package.json b/packages/@contentlayer/cli/package.json index cbfdaaca..52331825 100644 --- a/packages/@contentlayer/cli/package.json +++ b/packages/@contentlayer/cli/package.json @@ -1,6 +1,6 @@ { "name": "@contentlayer/cli", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "exports": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/@contentlayer/cli/src/commands/BuildCommand.ts b/packages/@contentlayer/cli/src/commands/BuildCommand.ts index b5dd3db3..a8f52a5b 100644 --- a/packages/@contentlayer/cli/src/commands/BuildCommand.ts +++ b/packages/@contentlayer/cli/src/commands/BuildCommand.ts @@ -19,9 +19,10 @@ export class BuildCommand extends BaseCommand { } executeSafe = pipe( - T.suspend(() => core.getConfig({ configPath: this.configPath, cwd: process.cwd() })), - T.chain((source) => core.generateDotpkg({ source, verbose: this.verbose, cwd: process.cwd() })), + T.suspend(this.clearCacheIfNeeded), + T.chain(() => core.getConfig({ configPath: this.configPath })), + T.chain((source) => core.generateDotpkg({ source, verbose: this.verbose })), T.tap(core.logGenerateInfo), - OT.withSpan('@contentlayer/cli/commands/BuildCommand:executeSafe', { attributes: { cwd: process.cwd() } }), + OT.withSpan('@contentlayer/cli/commands/BuildCommand:executeSafe'), ) } diff --git a/packages/@contentlayer/cli/src/commands/DevCommand.ts b/packages/@contentlayer/cli/src/commands/DevCommand.ts index dc2d3ee8..b2e8e1db 100644 --- a/packages/@contentlayer/cli/src/commands/DevCommand.ts +++ b/packages/@contentlayer/cli/src/commands/DevCommand.ts @@ -20,16 +20,10 @@ export class DevCommand extends BaseCommand { } executeSafe = pipe( - S.suspend(() => - core.getConfigWatch({ - configPath: this.configPath, - cwd: process.cwd(), - }), - ), + S.fromEffect(T.suspend(this.clearCacheIfNeeded)), + S.chain(() => core.getConfigWatch({ configPath: this.configPath })), S.tapSkipFirstRight(() => T.log(`Contentlayer config change detected. Updating type definitions and data...`)), - S.chainSwitchMapEitherRight((source) => - core.generateDotpkgStream({ source, verbose: this.verbose, cwd: process.cwd() }), - ), + S.chainSwitchMapEitherRight((source) => core.generateDotpkgStream({ source, verbose: this.verbose })), S.tap(E.fold((error) => T.log(errorToString(error)), core.logGenerateInfo)), S.runDrain, ) diff --git a/packages/@contentlayer/cli/src/commands/PostInstallCommand.ts b/packages/@contentlayer/cli/src/commands/PostInstallCommand.ts index 81aae1e1..94337d94 100644 --- a/packages/@contentlayer/cli/src/commands/PostInstallCommand.ts +++ b/packages/@contentlayer/cli/src/commands/PostInstallCommand.ts @@ -12,7 +12,7 @@ export class PostInstallCommand extends BaseCommand { T.gen(function* ($) { // `process.env.INIT_CWD` is set by `yarn` or `npm` during installation const cwd = process.env.INIT_CWD ?? process.cwd() - const artifactsDirPath = yield* $(ArtifactsDir.mkdir({ cwd })) + const artifactsDirPath = yield* $(ArtifactsDir.mkdir) yield* $(T.forEachPar_(['data', 'types'], (moduleName) => makeModuleStub({ artifactsDirPath, moduleName }))) diff --git a/packages/@contentlayer/cli/src/commands/_BaseCommand.ts b/packages/@contentlayer/cli/src/commands/_BaseCommand.ts index 8dcde7fb..ad75e81d 100644 --- a/packages/@contentlayer/cli/src/commands/_BaseCommand.ts +++ b/packages/@contentlayer/cli/src/commands/_BaseCommand.ts @@ -1,4 +1,6 @@ +import type { HasCwd } from '@contentlayer/core' import * as core from '@contentlayer/core' +import { unknownToPosixFilePath } from '@contentlayer/utils' import type { HasClock, OT } from '@contentlayer/utils/effect' import { pipe, T } from '@contentlayer/utils/effect' import { fs } from '@contentlayer/utils/node' @@ -20,23 +22,27 @@ export abstract class BaseCommand extends Command { description: 'More verbose logging and error stack traces', }) - abstract executeSafe: T.Effect + abstract executeSafe: T.Effect execute = () => pipe( - pipe(clearCacheIfNeeded(this.clearCache), T.zipRight(this.executeSafe)), + this.executeSafe, core.runMain({ tracingServiceName: 'contentlayer-cli', verbose: this.verbose || process.env.CL_DEBUG !== undefined, }), ) -} -const clearCacheIfNeeded = (shouldClearCache: boolean) => - T.gen(function* ($) { - if (shouldClearCache) { - const artifactsDir = core.ArtifactsDir.getDirPath({ cwd: process.cwd() }) - yield* $(fs.rm(artifactsDir, { recursive: true, force: true })) - yield* $(T.log('Cache cleared successfully')) - } - }) + clearCacheIfNeeded = () => { + const { clearCache } = this + + return T.gen(function* ($) { + if (clearCache) { + const cwd = unknownToPosixFilePath(process.cwd()) + const artifactsDir = core.ArtifactsDir.getDirPath({ cwd }) + yield* $(fs.rm(artifactsDir, { recursive: true, force: true })) + yield* $(T.log('Cache cleared successfully')) + } + }) + } +} diff --git a/packages/@contentlayer/client/package.json b/packages/@contentlayer/client/package.json index 9a5e0123..06ad0007 100644 --- a/packages/@contentlayer/client/package.json +++ b/packages/@contentlayer/client/package.json @@ -1,6 +1,6 @@ { "name": "@contentlayer/client", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "exports": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/@contentlayer/core/package.json b/packages/@contentlayer/core/package.json index 6373727b..f97cbea1 100644 --- a/packages/@contentlayer/core/package.json +++ b/packages/@contentlayer/core/package.json @@ -1,6 +1,6 @@ { "name": "@contentlayer/core", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "exports": "./dist/index.js", "types": "./dist/index.d.ts", @@ -29,7 +29,7 @@ "date-fns": "2.x", "esbuild": "0.11.x || 0.12.x || 0.13.x", "gray-matter": "^4.0.3", - "markdown-wasm": "^1.1.2", + "markdown-wasm": "^1.2.0", "mdx-bundler": "^6.0.2", "rehype-stringify": "^9.0.2", "remark-parse": "^10.0.0", diff --git a/packages/@contentlayer/core/src/ArtifactsDir.ts b/packages/@contentlayer/core/src/ArtifactsDir.ts index d8033f05..78a6e653 100644 --- a/packages/@contentlayer/core/src/ArtifactsDir.ts +++ b/packages/@contentlayer/core/src/ArtifactsDir.ts @@ -1,30 +1,36 @@ +import type { PosixFilePath } from '@contentlayer/utils' +import { filePathJoin } from '@contentlayer/utils' import type { OT } from '@contentlayer/utils/effect' import { pipe, T } from '@contentlayer/utils/effect' import type { GetContentlayerVersionError } from '@contentlayer/utils/node' import { fs, getContentlayerVersion } from '@contentlayer/utils/node' + +import type { HasCwd } from './cwd.js' +import { getCwd } from './cwd.js' // import utilsPkg from '@contentlayer/utils/package.json' -import * as path from 'path' export namespace ArtifactsDir { - export const getDirPath = ({ cwd }: { cwd: string }): string => path.join(cwd, 'node_modules', '.contentlayer') + export const getDirPath = ({ cwd }: { cwd: PosixFilePath }): PosixFilePath => + filePathJoin(cwd, 'node_modules' as PosixFilePath, '.contentlayer' as PosixFilePath) + + export const mkdir: T.Effect = T.gen(function* ($) { + const cwd = yield* $(getCwd) + const dirPath = getDirPath({ cwd }) + yield* $(fs.mkdirp(dirPath)) - export const mkdir = ({ cwd }: { cwd: string }): T.Effect => - pipe(T.succeed(getDirPath({ cwd })), T.tap(fs.mkdirp)) + return dirPath + }) - export const getCacheDirPath = ({ - cwd, - }: { - cwd: string - }): T.Effect => - pipe( - getContentlayerVersion(), - T.map((contentlayerVersion) => path.join(getDirPath({ cwd }), '.cache', `v${contentlayerVersion}`)), - ) + export const getCacheDirPath: T.Effect = pipe( + T.struct({ + contentlayerVersion: getContentlayerVersion(), + cwd: getCwd, + }), + T.map(({ contentlayerVersion, cwd }) => + filePathJoin(getDirPath({ cwd }), '.cache' as PosixFilePath, `v${contentlayerVersion}` as PosixFilePath), + ), + ) - export const mkdirCache = ({ - cwd, - }: { - cwd: string - }): T.Effect => - pipe(getCacheDirPath({ cwd }), T.tap(fs.mkdirp)) + export const mkdirCache: T.Effect = + pipe(getCacheDirPath, T.tap(fs.mkdirp)) } diff --git a/packages/@contentlayer/core/src/DataCache.ts b/packages/@contentlayer/core/src/DataCache.ts index 4945c084..339b7d7e 100644 --- a/packages/@contentlayer/core/src/DataCache.ts +++ b/packages/@contentlayer/core/src/DataCache.ts @@ -5,6 +5,7 @@ import { fs } from '@contentlayer/utils/node' import * as path from 'path' import { ArtifactsDir } from './ArtifactsDir.js' +import type { HasCwd } from './cwd.js' import type { Document } from './data.js' export namespace DataCache { @@ -32,17 +33,15 @@ export namespace DataCache { export const loadPreviousCacheFromDisk = ({ schemaHash, - cwd, }: { schemaHash: string - cwd: string }): T.Effect< - OT.HasTracer, + OT.HasTracer & HasCwd, fs.StatError | fs.ReadFileError | fs.JsonParseError | GetContentlayerVersionError, Cache | undefined > => T.gen(function* ($) { - const cacheDirPath = yield* $(ArtifactsDir.getCacheDirPath({ cwd })) + const cacheDirPath = yield* $(ArtifactsDir.getCacheDirPath) const filePath = path.join(cacheDirPath, dataCacheFileName(schemaHash)) const cache = yield* $( @@ -58,18 +57,16 @@ export namespace DataCache { export const writeCacheToDisk = ({ cache, schemaHash, - cwd, }: { cache: Cache schemaHash: string - cwd: string }): T.Effect< - OT.HasTracer, + OT.HasTracer & HasCwd, never, E.Either > => pipe( - ArtifactsDir.mkdirCache({ cwd }), + ArtifactsDir.mkdirCache, T.chain((cacheDirPath) => { const filePath = path.join(cacheDirPath, dataCacheFileName(schemaHash)) return fs.writeFileJson({ filePath, content: cache }) diff --git a/packages/@contentlayer/core/src/cwd.ts b/packages/@contentlayer/core/src/cwd.ts new file mode 100644 index 00000000..eb707e76 --- /dev/null +++ b/packages/@contentlayer/core/src/cwd.ts @@ -0,0 +1,20 @@ +import { unknownToPosixFilePath } from '@contentlayer/utils' +import type { Has } from '@contentlayer/utils/effect' +import { T, tag } from '@contentlayer/utils/effect' + +const CwdSymbol = Symbol() + +export const makeCwd = T.gen(function* (_) { + const cwd = yield* _(T.succeedWith(() => unknownToPosixFilePath(process.cwd()))) + + return { serviceId: CwdSymbol, cwd } as const +}) + +export interface Cwd extends T.OutputOf {} +export const Cwd = tag() + +export const provideCwd = T.provideServiceM(Cwd)(makeCwd) + +export const getCwd = T.accessService(Cwd)((_) => _.cwd) + +export type HasCwd = Has diff --git a/packages/@contentlayer/core/src/generation/generate-dotpkg.ts b/packages/@contentlayer/core/src/generation/generate-dotpkg.ts index cf8387bb..5967f7bf 100644 --- a/packages/@contentlayer/core/src/generation/generate-dotpkg.ts +++ b/packages/@contentlayer/core/src/generation/generate-dotpkg.ts @@ -1,13 +1,15 @@ +import type { PosixFilePath } from '@contentlayer/utils' +import { filePathJoin, unknownToPosixFilePath } from '@contentlayer/utils' import * as utils from '@contentlayer/utils' import type { E, HasClock } from '@contentlayer/utils/effect' import { flow, OT, pipe, S, T } from '@contentlayer/utils/effect' import { fs } from '@contentlayer/utils/node' import { camelCase } from 'camel-case' import { promises as fsPromise } from 'fs' -import * as path from 'path' import type { PackageJson } from 'type-fest' import { ArtifactsDir } from '../ArtifactsDir.js' +import type { HasCwd } from '../cwd.js' import type { DataCache } from '../DataCache.js' import type { SourceProvideSchemaError } from '../errors.js' import type { SourceFetchDataError } from '../index.js' @@ -41,14 +43,12 @@ export const logGenerateInfo = (info: GenerateInfo): T.Effect => +}): T.Effect => pipe( - generateDotpkgStream({ source, verbose, cwd }), + generateDotpkgStream({ source, verbose }), S.take(1), S.runCollect, T.map((_) => _[0]!), @@ -60,18 +60,16 @@ export const generateDotpkg = ({ export const generateDotpkgStream = ({ source, verbose, - cwd, }: { source: SourcePlugin verbose: boolean - cwd: string -}): S.Stream> => { +}): S.Stream> => { const writtenFilesCache = {} const generationOptions = { sourcePluginType: source.type, options: source.options } const resolveParams = pipe( T.structPar({ schemaDef: source.provideSchema, - targetPath: ArtifactsDir.mkdir({ cwd }), + targetPath: ArtifactsDir.mkdir, }), T.either, ) @@ -84,7 +82,7 @@ export const generateDotpkgStream = ({ S.fromEffect(resolveParams), S.chainMapEitherRight(({ schemaDef, targetPath }) => pipe( - source.fetchData({ schemaDef, verbose, cwd }), + source.fetchData({ schemaDef, verbose }), S.mapEffectEitherRight((cache) => pipe( writeFilesForCache({ schemaDef, targetPath, cache, generationOptions, writtenFilesCache }), @@ -99,7 +97,7 @@ export const generateDotpkgStream = ({ const writeFilesForCache = (params: { schemaDef: SchemaDef cache: DataCache.Cache - targetPath: string + targetPath: PosixFilePath generationOptions: GenerationOptions writtenFilesCache: WrittenFilesCache }): T.Effect> => @@ -123,11 +121,11 @@ const writeFilesForCache_ = async ({ }: { schemaDef: SchemaDef cache: DataCache.Cache - targetPath: string + targetPath: PosixFilePath generationOptions: GenerationOptions writtenFilesCache: WrittenFilesCache }): Promise => { - const withPrefix = (...path_: string[]) => path.join(targetPath, ...path_) + const withPrefix = (...path_: string[]) => filePathJoin(targetPath, ...path_.map(unknownToPosixFilePath)) if (process.env['CL_DEBUG']) { // NOTE cache directory already exists because `source.fetchData` has already created it @@ -220,7 +218,7 @@ const writeFileWithWrittenFilesCache = content, documentHash, }: { - filePath: string + filePath: PosixFilePath content: string documentHash?: string }): Promise => { diff --git a/packages/@contentlayer/core/src/getConfig/index.ts b/packages/@contentlayer/core/src/getConfig/index.ts index 331ab92b..acf7a914 100644 --- a/packages/@contentlayer/core/src/getConfig/index.ts +++ b/packages/@contentlayer/core/src/getConfig/index.ts @@ -4,6 +4,8 @@ import type { GetContentlayerVersionError } from '@contentlayer/utils/node' import { fs } from '@contentlayer/utils/node' import * as path from 'path' +import type { HasCwd } from '../cwd.js' +import { getCwd } from '../cwd.js' import type { EsbuildBinNotFoundError } from '../errors.js' import { ConfigNoDefaultExportError, ConfigReadError, NoConfigFoundError } from '../errors.js' import { ArtifactsDir } from '../index.js' @@ -23,32 +25,26 @@ type GetConfigError = export const getConfig = ({ configPath, - cwd, }: { configPath?: string - cwd: string -}): T.Effect => +}): T.Effect => pipe( - getConfigWatch({ configPath, cwd }), + getConfigWatch({ configPath }), S.take(1), S.runCollect, T.map((_) => _[0]!), T.rightOrFail, - OT.withSpan('@contentlayer/core/getConfig:getConfig', { attributes: { configPath, cwd } }), + OT.withSpan('@contentlayer/core/getConfig:getConfig', { attributes: { configPath } }), ) export const getConfigWatch = ({ configPath: configPath_, - cwd, }: { configPath?: string - cwd: string -}): S.Stream> => { +}): S.Stream> => { const resolveParams = pipe( - T.structPar({ - configPath: resolveConfigPath({ configPath: configPath_, cwd }), - }), - T.chainMergeObject(() => makeTmpDirAndResolveEntryPoint({ cwd })), + T.structPar({ configPath: resolveConfigPath({ configPath: configPath_ }) }), + T.chainMergeObject(() => makeTmpDirAndResolveEntryPoint), T.either, ) @@ -77,12 +73,12 @@ export const getConfigWatch = ({ const resolveConfigPath = ({ configPath, - cwd, }: { configPath?: string - cwd: string -}): T.Effect => +}): T.Effect => T.gen(function* ($) { + const cwd = yield* $(getCwd) + if (configPath) { if (path.isAbsolute(configPath)) { return configPath @@ -101,11 +97,10 @@ const resolveConfigPath = ({ return yield* $(T.fail(new NoConfigFoundError({ cwd, configPath }))) }) -const makeTmpDirAndResolveEntryPoint = ({ cwd }: { cwd: string }) => - pipe( - ArtifactsDir.mkdirCache({ cwd }), - T.map((cacheDir) => ({ outfilePath: path.join(cacheDir, 'compiled-contentlayer-config.mjs') })), - ) +const makeTmpDirAndResolveEntryPoint = pipe( + ArtifactsDir.mkdirCache, + T.map((cacheDir) => ({ outfilePath: path.join(cacheDir, 'compiled-contentlayer-config.mjs') })), +) const getConfigFromResult = ({ result, diff --git a/packages/@contentlayer/core/src/index.ts b/packages/@contentlayer/core/src/index.ts index e56ab5e8..c5e9ed0d 100644 --- a/packages/@contentlayer/core/src/index.ts +++ b/packages/@contentlayer/core/src/index.ts @@ -2,6 +2,7 @@ export * from './generation/generate-dotpkg.js' export * from './generation/generate-types.js' export * from './DataCache.js' export * from './data.js' +export * from './cwd.js' export * from './gen.js' export * from './errors.js' export * from './getConfig/index.js' diff --git a/packages/@contentlayer/core/src/mdx.ts b/packages/@contentlayer/core/src/mdx.ts index 7a6d1c55..bf5537f1 100644 --- a/packages/@contentlayer/core/src/mdx.ts +++ b/packages/@contentlayer/core/src/mdx.ts @@ -24,6 +24,7 @@ export const bundleMDX = ({ const { rehypePlugins, remarkPlugins, cwd: cwd_, ...restOptions } = options ?? {} const getCwdFromContentDirPath = () => + // TODO don't use `process.cwd()` but instead `HasCwd` path.isAbsolute(contentDirPath) ? contentDirPath : path.join(process.cwd(), contentDirPath) const cwd = cwd_ ?? getCwdFromContentDirPath() diff --git a/packages/@contentlayer/core/src/plugin.ts b/packages/@contentlayer/core/src/plugin.ts index e19502c5..b192309d 100644 --- a/packages/@contentlayer/core/src/plugin.ts +++ b/packages/@contentlayer/core/src/plugin.ts @@ -4,6 +4,7 @@ import type { BundleMDXOptions } from 'mdx-bundler/dist/types' import type { LiteralUnion } from 'type-fest' import type * as unified from 'unified' +import type { HasCwd } from './cwd.js' import type { DataCache } from './DataCache.js' import type { SourceFetchDataError, SourceProvideSchemaError } from './errors.js' import type { SchemaDef, StackbitExtension } from './schema/index.js' @@ -70,9 +71,8 @@ export type ProvideSchema = T.Effect S.Stream< - OT.HasTracer & HasClock, + OT.HasTracer & HasClock & HasCwd, never, E.Either > diff --git a/packages/@contentlayer/core/src/runMain.ts b/packages/@contentlayer/core/src/runMain.ts index 4c9dab85..a08b4311 100644 --- a/packages/@contentlayer/core/src/runMain.ts +++ b/packages/@contentlayer/core/src/runMain.ts @@ -1,18 +1,26 @@ +import type { HasCwd } from '@contentlayer/core' +import { provideCwd } from '@contentlayer/core' import * as core from '@contentlayer/core' -import { JaegerNodeTracing } from '@contentlayer/utils' +import { DummyTracing, JaegerNodeTracing } from '@contentlayer/utils' import type { HasClock, OT } from '@contentlayer/utils/effect' import { Cause, pipe, pretty, T } from '@contentlayer/utils/effect' export const runMain = ({ tracingServiceName, verbose }: { tracingServiceName: string; verbose: boolean }) => - (eff: T.Effect) => + (eff: T.Effect) => pipe( T.gen(function* ($) { if (process.platform === 'win32') { yield* $(T.log('Warning: Contentlayer might not work as expected on Windows')) } - const result = yield* $(pipe(eff, T.provideSomeLayer(JaegerNodeTracing(tracingServiceName)), T.result)) + // Only use Otel tracing if explicitly enabled via env var + const provideTracing = + process.env.CL_OTEL !== undefined + ? T.provideSomeLayer(JaegerNodeTracing(tracingServiceName)) + : T.provide(DummyTracing) + + const result = yield* $(pipe(eff, provideTracing, provideCwd, T.result)) if (result._tag === 'Failure') { const failOrCause = Cause.failureOrCause(result.cause) diff --git a/packages/@contentlayer/source-contentful/package.json b/packages/@contentlayer/source-contentful/package.json index ecd4fc5e..951c33e8 100644 --- a/packages/@contentlayer/source-contentful/package.json +++ b/packages/@contentlayer/source-contentful/package.json @@ -1,6 +1,6 @@ { "name": "@contentlayer/source-contentful", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "exports": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/@contentlayer/source-files/package.json b/packages/@contentlayer/source-files/package.json index 0c54913a..c7a5aaf9 100644 --- a/packages/@contentlayer/source-files/package.json +++ b/packages/@contentlayer/source-files/package.json @@ -1,6 +1,6 @@ { "name": "@contentlayer/source-files", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "exports": { ".": { @@ -30,8 +30,8 @@ "@contentlayer/utils": "workspace:*", "chokidar": "^3.5.2", "date-fns-tz": "^1.1.6", - "glob": "^7.1.7", - "glob-promise": "^4.1.0", + "glob": "^7.2.0", + "glob-promise": "^4.2.2", "gray-matter": "^4.0.3", "minimatch": "^3.0.4", "ts-pattern": "^3.3.3", diff --git a/packages/@contentlayer/source-files/src/__test__/errors/utils.ts b/packages/@contentlayer/source-files/src/__test__/errors/utils.ts index bbb50ceb..9ae81f34 100644 --- a/packages/@contentlayer/source-files/src/__test__/errors/utils.ts +++ b/packages/@contentlayer/source-files/src/__test__/errors/utils.ts @@ -1,5 +1,6 @@ import type * as core from '@contentlayer/core' -import { capitalizeFirstLetter } from '@contentlayer/utils' +import type { PosixFilePath } from '@contentlayer/utils' +import { capitalizeFirstLetter, singleItem, unknownToPosixFilePath } from '@contentlayer/utils' import faker from 'faker' import * as path from 'path' @@ -28,6 +29,9 @@ export const makeSchemaDef = (): core.SchemaDef => { return schemaDef } +const generateFakeFilePath = (extension = 'md'): PosixFilePath => + singleItem(path.join('docs', faker.system.commonFileName(extension))).map(unknownToPosixFilePath).item + export const makeErrors = ( countRecord: Partial>, ): FetchDataError.FetchDataError[] => { @@ -36,18 +40,18 @@ export const makeErrors = ( faker.seed(123) doNTimes(countRecord.CouldNotDetermineDocumentTypeError, () => { - const documentFilePath = path.join('docs', faker.system.commonFileName('md')) + const documentFilePath = generateFakeFilePath() errors.push(new FetchDataError.CouldNotDetermineDocumentTypeError({ typeFieldName: 'type', documentFilePath })) }) doNTimes(countRecord.NoSuchDocumentTypeError, () => { - const documentFilePath = path.join('docs', faker.system.commonFileName('md')) + const documentFilePath = generateFakeFilePath() const documentTypeName = capitalizeFirstLetter(faker.hacker.noun()) errors.push(new FetchDataError.NoSuchDocumentTypeError({ documentFilePath, documentTypeName })) }) doNTimes(countRecord.UnexpectedError, () => { - const documentFilePath = path.join('docs', faker.system.commonFileName('md')) + const documentFilePath = generateFakeFilePath() errors.push( new FetchDataError.UnexpectedError({ documentFilePath, @@ -57,13 +61,13 @@ export const makeErrors = ( }) doNTimes(countRecord.ComputedValueError, () => { - const documentFilePath = path.join('docs', faker.system.commonFileName('md')) + const documentFilePath = generateFakeFilePath() const error = new Error(`Some problem happened: ${faker.hacker.phrase()}`) errors.push(new FetchDataError.ComputedValueError({ documentFilePath, error })) }) doNTimes(countRecord.ExtraFieldDataError, () => { - const documentFilePath = path.join('docs', faker.system.commonFileName('md')) + const documentFilePath = generateFakeFilePath() const documentTypeName = capitalizeFirstLetter(faker.hacker.noun()) errors.push( new FetchDataError.ExtraFieldDataError({ @@ -78,7 +82,7 @@ export const makeErrors = ( }) doNTimes(countRecord.MissingRequiredFieldsError, () => { - const documentFilePath = path.join('docs', faker.system.commonFileName('md')) + const documentFilePath = generateFakeFilePath() const documentTypeName = capitalizeFirstLetter(faker.hacker.noun()) const fieldDef: core.FieldDef = { type: 'string', diff --git a/packages/@contentlayer/source-files/src/__test__/mapping.spec.ts b/packages/@contentlayer/source-files/src/__test__/mapping.spec.ts index 87ebda89..930f9e8f 100644 --- a/packages/@contentlayer/source-files/src/__test__/mapping.spec.ts +++ b/packages/@contentlayer/source-files/src/__test__/mapping.spec.ts @@ -14,6 +14,8 @@ t.test('getFlattenedPath', async (t) => { t.equal(getFlattenedPath('index.md'), '') }) +const __unusedValue: any = '' + t.test('getDataForFieldDef', async (t) => { const testValue = async ({ type, @@ -29,7 +31,7 @@ t.test('getDataForFieldDef', async (t) => { const transformedData = await runPromise( getDataForFieldDef({ rawFieldData, - contentDirPath: '', + contentDirPath: __unusedValue, fieldDef: { type, name: 'someField', @@ -39,7 +41,7 @@ t.test('getDataForFieldDef', async (t) => { description: undefined, }, coreSchemaDef: { hash: '', documentTypeDefMap: {}, nestedTypeDefMap: {} }, - relativeFilePath: '', + relativeFilePath: __unusedValue, options: { fieldOptions: core.defaultFieldOptions, markdown: undefined, diff --git a/packages/@contentlayer/source-files/src/errors/index.ts b/packages/@contentlayer/source-files/src/errors/index.ts index faed3140..7deb7b5c 100644 --- a/packages/@contentlayer/source-files/src/errors/index.ts +++ b/packages/@contentlayer/source-files/src/errors/index.ts @@ -1,4 +1,5 @@ import type * as core from '@contentlayer/core' +import type { PosixFilePath } from '@contentlayer/utils' import { errorToString } from '@contentlayer/utils' import { Tagged } from '@contentlayer/utils/effect' @@ -34,7 +35,7 @@ export namespace FetchDataError { export class InvalidFrontmatterError extends Tagged('InvalidFrontmatterError')<{ readonly error: unknown - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath }> implements AggregatableError { @@ -49,7 +50,7 @@ export namespace FetchDataError { export class InvalidMarkdownFileError extends Tagged('InvalidMarkdownFileError')<{ readonly error: unknown - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath }> implements AggregatableError { @@ -63,7 +64,7 @@ export namespace FetchDataError { export class InvalidYamlFileError extends Tagged('InvalidYamlFileError')<{ readonly error: unknown - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath }> implements AggregatableError { @@ -77,7 +78,7 @@ export namespace FetchDataError { export class InvalidJsonFileError extends Tagged('InvalidJsonFileError')<{ readonly error: unknown - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath }> implements AggregatableError { @@ -91,7 +92,7 @@ export namespace FetchDataError { export class ComputedValueError extends Tagged('ComputedValueError')<{ readonly error: unknown - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath }> implements AggregatableError { @@ -119,7 +120,7 @@ export namespace FetchDataError { export class CouldNotDetermineDocumentTypeError extends Tagged('CouldNotDetermineDocumentTypeError')<{ - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath readonly typeFieldName: string }> implements AggregatableError @@ -141,7 +142,7 @@ one of the following document type names: ${validTypeNames}).` export class NoSuchDocumentTypeError extends Tagged('NoSuchDocumentTypeError')<{ readonly documentTypeName: string - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath }> implements AggregatableError { @@ -161,7 +162,7 @@ Please use one of the following document type names: ${validTypeNames}.\ export class NoSuchNestedDocumentTypeError extends Tagged('NoSuchNestedDocumentTypeError')<{ readonly documentTypeName: string - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath readonly fieldName: string readonly validNestedTypeNames: string[] }> @@ -182,7 +183,7 @@ Couldn't find nested document type definitions provided by name for ${documentCo export class MissingRequiredFieldsError extends Tagged('MissingRequiredFieldsError')<{ - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath readonly documentTypeName: string readonly fieldDefsWithMissingData: core.FieldDef[] }> @@ -206,7 +207,7 @@ ${misingRequiredFieldsStr}\ export class ExtraFieldDataError extends Tagged('ExtraFieldDataError')<{ - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath readonly documentTypeName: string readonly extraFieldEntries: readonly (readonly [fieldKey: string, fieldValue: any])[] }> @@ -228,7 +229,7 @@ ${extraFields} ` export class UnexpectedError extends Tagged('UnexpectedError')<{ - readonly documentFilePath: string + readonly documentFilePath: PosixFilePath readonly error: unknown }> implements AggregatableError diff --git a/packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts b/packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts index 634ffae6..9847f0a5 100644 --- a/packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts +++ b/packages/@contentlayer/source-files/src/fetchData/fetchAllDocuments.ts @@ -1,10 +1,11 @@ import type * as core from '@contentlayer/core' +import type { PosixFilePath } from '@contentlayer/utils' +import { filePathJoin, posixFilePath } from '@contentlayer/utils' import { Chunk, O, OT, pipe, T, These } from '@contentlayer/utils/effect' import { fs } from '@contentlayer/utils/node' import { promise as glob } from 'glob-promise' import matter from 'gray-matter' import * as os from 'os' -import * as path from 'path' import yaml from 'yaml' import { FetchDataError } from '../errors/index.js' @@ -25,7 +26,7 @@ export const fetchAllDocuments = ({ }: { coreSchemaDef: core.SchemaDef filePathPatternMap: FilePathPatternMap - contentDirPath: string + contentDirPath: PosixFilePath flags: Flags options: core.PluginOptions previousCache: core.DataCache.Cache | undefined @@ -80,16 +81,16 @@ export const makeCacheItemFromFilePath = ({ options, previousCache, }: { - relativeFilePath: string + relativeFilePath: PosixFilePath filePathPatternMap: FilePathPatternMap coreSchemaDef: core.SchemaDef - contentDirPath: string + contentDirPath: PosixFilePath options: core.PluginOptions previousCache: core.DataCache.Cache | undefined }): T.Effect> => pipe( T.gen(function* ($) { - const fullFilePath = path.join(contentDirPath, relativeFilePath) + const fullFilePath = filePathJoin(contentDirPath, relativeFilePath) const documentHash = yield* $( pipe( @@ -146,7 +147,7 @@ export const makeCacheItemFromFilePath = ({ return These.warnOption({ document, documentHash, hasWarnings: O.isSome(warnings) }, warnings) }), - OT.withSpan('@contentlayer/source-local/fetchData:makeDocumentFromFilePath'), + OT.withSpan('@contentlayer/source-local/fetchData:makeCacheItemFromFilePath'), T.mapError((error) => { if ( error._tag === 'node.fs.StatError' || @@ -165,8 +166,8 @@ const processRawContent = ({ fullFilePath, relativeFilePath, }: { - fullFilePath: string - relativeFilePath: string + fullFilePath: PosixFilePath + relativeFilePath: PosixFilePath }): T.Effect< OT.HasTracer, | FetchDataError.UnsupportedFileExtension @@ -219,7 +220,7 @@ const getComputedValues = ({ }: { documentTypeDef: core.DocumentTypeDef document: core.Document - documentFilePath: string + documentFilePath: PosixFilePath }): T.Effect> => { if (documentTypeDef.computedFields === undefined) { return T.succeed(undefined) @@ -242,11 +243,15 @@ const getAllRelativeFilePaths = ({ contentDirPath, }: { contentDirPath: string -}): T.Effect => { +}): T.Effect => { const filePathPattern = '**/*.{md,mdx,json,yaml,yml}' - return T.tryCatchPromise( - () => glob(filePathPattern, { cwd: contentDirPath }), - (error) => new fs.UnknownFSError({ error }), + return pipe( + T.tryCatchPromise( + () => glob(filePathPattern, { cwd: contentDirPath }), + (error) => new fs.UnknownFSError({ error }), + ), + T.map((_) => _.map(posixFilePath)), + OT.withSpan('@contentlayer/source-local/fetchData:getAllRelativeFilePaths'), ) } @@ -255,7 +260,7 @@ const parseMarkdown = ({ documentFilePath, }: { markdownString: string - documentFilePath: string + documentFilePath: PosixFilePath }): T.Effect< unknown, FetchDataError.InvalidMarkdownFileError | FetchDataError.InvalidFrontmatterError, @@ -277,7 +282,7 @@ const parseJson = ({ documentFilePath, }: { jsonString: string - documentFilePath: string + documentFilePath: PosixFilePath }): T.Effect> => T.tryCatch( () => JSON.parse(jsonString), @@ -289,7 +294,7 @@ const parseYaml = ({ documentFilePath, }: { yamlString: string - documentFilePath: string + documentFilePath: PosixFilePath }): T.Effect> => T.tryCatch( () => yaml.parse(yamlString), diff --git a/packages/@contentlayer/source-files/src/fetchData/index.ts b/packages/@contentlayer/source-files/src/fetchData/index.ts index a49ad56a..85432780 100644 --- a/packages/@contentlayer/source-files/src/fetchData/index.ts +++ b/packages/@contentlayer/source-files/src/fetchData/index.ts @@ -1,5 +1,8 @@ +import type { HasCwd } from '@contentlayer/core' import * as core from '@contentlayer/core' +import type { PosixFilePath } from '@contentlayer/utils' import * as utils from '@contentlayer/utils' +import { unknownToPosixFilePath } from '@contentlayer/utils' import type { E, OT } from '@contentlayer/utils/effect' import { pipe, S, T, These } from '@contentlayer/utils/effect' import { FSWatch } from '@contentlayer/utils/node' @@ -16,16 +19,14 @@ export const fetchData = ({ options, contentDirPath, verbose, - cwd, }: { coreSchemaDef: core.SchemaDef documentTypeDefs: LocalSchema.DocumentTypeDef[] flags: Flags options: core.PluginOptions - contentDirPath: string + contentDirPath: PosixFilePath verbose: boolean - cwd: string -}): S.Stream> => { +}): S.Stream> => { const filePathPatternMap: FilePathPatternMap = Object.fromEntries( documentTypeDefs .filter((_) => _.filePathPattern) @@ -44,10 +45,7 @@ export const fetchData = ({ S.mapEitherRight(chokidarAllEventToCustomUpdateEvent), ) - const resolveParams = pipe( - core.DataCache.loadPreviousCacheFromDisk({ schemaHash: coreSchemaDef.hash, cwd }), - T.either, - ) + const resolveParams = pipe(core.DataCache.loadPreviousCacheFromDisk({ schemaHash: coreSchemaDef.hash }), T.either) return pipe( S.fromEffect(resolveParams), @@ -97,7 +95,7 @@ export const fetchData = ({ // update local and persisted cache S.tapRight((cache_) => T.succeedWith(() => (cache = cache_))), S.tapRightEither((cache_) => - core.DataCache.writeCacheToDisk({ cache: cache_, schemaHash: coreSchemaDef.hash, cwd }), + core.DataCache.writeCacheToDisk({ cache: cache_, schemaHash: coreSchemaDef.hash }), ), ), ), @@ -116,7 +114,7 @@ const updateCacheEntry = ({ coreSchemaDef, options, }: { - contentDirPath: string + contentDirPath: PosixFilePath filePathPatternMap: FilePathPatternMap cache: core.DataCache.Cache event: CustomUpdateEventFileUpdated @@ -160,9 +158,9 @@ const chokidarAllEventToCustomUpdateEvent = (event: FSWatch.FileSystemEvent): Cu switch (event._tag) { case 'FileAdded': case 'FileChanged': - return { _tag: 'updated', relativeFilePath: event.path } + return { _tag: 'updated', relativeFilePath: unknownToPosixFilePath(event.path) } case 'FileRemoved': - return { _tag: 'deleted', relativeFilePath: event.path } + return { _tag: 'deleted', relativeFilePath: unknownToPosixFilePath(event.path) } case 'DirectoryRemoved': case 'DirectoryAdded': return { _tag: 'init' } @@ -175,12 +173,12 @@ type CustomUpdateEvent = CustomUpdateEventFileUpdated | CustomUpdateEventFileDel type CustomUpdateEventFileUpdated = { readonly _tag: 'updated' - relativeFilePath: string + relativeFilePath: PosixFilePath } type CustomUpdateEventFileDeleted = { readonly _tag: 'deleted' - relativeFilePath: string + relativeFilePath: PosixFilePath } type CustomUpdateEventInit = { diff --git a/packages/@contentlayer/source-files/src/fetchData/mapping.ts b/packages/@contentlayer/source-files/src/fetchData/mapping.ts index 5a87100c..6487b4b9 100644 --- a/packages/@contentlayer/source-files/src/fetchData/mapping.ts +++ b/packages/@contentlayer/source-files/src/fetchData/mapping.ts @@ -1,5 +1,6 @@ import type { UnexpectedMarkdownError, UnexpectedMDXError } from '@contentlayer/core' import * as core from '@contentlayer/core' +import type { PosixFilePath } from '@contentlayer/utils' import * as utils from '@contentlayer/utils' import type { OT } from '@contentlayer/utils/effect' import { pipe, T } from '@contentlayer/utils/effect' @@ -22,8 +23,8 @@ export const makeDocument = ({ rawContent: RawContent documentTypeDef: core.DocumentTypeDef coreSchemaDef: core.SchemaDef - relativeFilePath: string - contentDirPath: string + relativeFilePath: PosixFilePath + contentDirPath: PosixFilePath options: core.PluginOptions }): T.Effect< OT.HasTracer, @@ -120,8 +121,8 @@ const makeNestedDocument = ({ typeName: string coreSchemaDef: core.SchemaDef options: core.PluginOptions - relativeFilePath: string - contentDirPath: string + relativeFilePath: PosixFilePath + contentDirPath: PosixFilePath }): T.Effect => T.gen(function* ($) { const objValues = yield* $( @@ -157,8 +158,8 @@ const getDataForFieldDef = ({ rawFieldData: any coreSchemaDef: core.SchemaDef options: core.PluginOptions - relativeFilePath: string - contentDirPath: string + relativeFilePath: PosixFilePath + contentDirPath: PosixFilePath }): T.Effect => T.gen(function* ($) { if (rawFieldData === undefined) { @@ -280,8 +281,8 @@ const getDataForListItem = ({ fieldDef: core.ListFieldDef | core.ListPolymorphicFieldDef coreSchemaDef: core.SchemaDef options: core.PluginOptions - relativeFilePath: string - contentDirPath: string + relativeFilePath: PosixFilePath + contentDirPath: PosixFilePath }): T.Effect => { if (typeof rawItemData === 'string') { return T.succeed(rawItemData) diff --git a/packages/@contentlayer/source-files/src/fetchData/validate.ts b/packages/@contentlayer/source-files/src/fetchData/validate.ts index 8d211791..5b1417e3 100644 --- a/packages/@contentlayer/source-files/src/fetchData/validate.ts +++ b/packages/@contentlayer/source-files/src/fetchData/validate.ts @@ -1,4 +1,5 @@ import type * as core from '@contentlayer/core' +import type { PosixFilePath } from '@contentlayer/utils' import { O, These } from '@contentlayer/utils/effect' import minimatch from 'minimatch' @@ -22,7 +23,7 @@ export const validateDocumentData = ({ coreSchemaDef: core.SchemaDef rawContent: RawContent /** relativeFilePath just needed for better error handling */ - relativeFilePath: string + relativeFilePath: PosixFilePath filePathPatternMap: FilePathPatternMap options: core.PluginOptions }): These.These => { diff --git a/packages/@contentlayer/source-files/src/index.ts b/packages/@contentlayer/source-files/src/index.ts index 94e6d87e..bcf0241b 100644 --- a/packages/@contentlayer/source-files/src/index.ts +++ b/packages/@contentlayer/source-files/src/index.ts @@ -1,5 +1,6 @@ import type * as core from '@contentlayer/core' import { processArgs, SourceProvideSchemaError } from '@contentlayer/core' +import { unknownToPosixFilePath } from '@contentlayer/utils' import { pipe, T } from '@contentlayer/utils/effect' import { fetchData } from './fetchData/index.js' @@ -52,7 +53,14 @@ export const makeSource: core.MakeSourcePlugin = async (args) => { makeCoreSchema({ documentTypeDefs, options }), T.mapError((error) => new SourceProvideSchemaError({ error })), ), - fetchData: ({ schemaDef, verbose, cwd }) => - fetchData({ coreSchemaDef: schemaDef, documentTypeDefs, flags, options, contentDirPath, verbose, cwd }), + fetchData: ({ schemaDef, verbose }) => + fetchData({ + coreSchemaDef: schemaDef, + documentTypeDefs, + flags, + options, + contentDirPath: unknownToPosixFilePath(contentDirPath), + verbose, + }), } } diff --git a/packages/@contentlayer/source-sanity/package.json b/packages/@contentlayer/source-sanity/package.json index 06eebab4..b04904f1 100644 --- a/packages/@contentlayer/source-sanity/package.json +++ b/packages/@contentlayer/source-sanity/package.json @@ -1,6 +1,6 @@ { "name": "@contentlayer/source-sanity", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "exports": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/@contentlayer/utils/package.json b/packages/@contentlayer/utils/package.json index 476ef949..5c5bda69 100644 --- a/packages/@contentlayer/utils/package.json +++ b/packages/@contentlayer/utils/package.json @@ -1,6 +1,6 @@ { "name": "@contentlayer/utils", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "exports": { "./package.json": { @@ -56,14 +56,16 @@ }, "dependencies": { "@effect-ts/core": "^0.45.5", - "@effect-ts/otel": "next", - "@effect-ts/otel-node": "next", + "@effect-ts/otel": "^0.7.0", + "@effect-ts/otel-node": "^0.7.0", "@opentelemetry/api": "^1.0.3", - "@opentelemetry/exporter-collector": "^0.24.0", - "@opentelemetry/node": "^0.24.0", - "@opentelemetry/resources": "^0.24.0", - "@opentelemetry/semantic-conventions": "^0.24.0", - "@opentelemetry/tracing": "^0.24.0", + "@opentelemetry/core": "^1.0.0", + "@opentelemetry/exporter-collector": "^0.25.0", + "@opentelemetry/exporter-collector-grpc": "^0.25.0", + "@opentelemetry/resources": "^1.0.0", + "@opentelemetry/sdk-trace-base": "^1.0.0", + "@opentelemetry/sdk-trace-node": "^1.0.0", + "@opentelemetry/semantic-conventions": "^1.0.0", "chokidar": "^3.5.2", "hash-wasm": "^4.9.0", "inflection": "^1.13.1", diff --git a/packages/@contentlayer/utils/src/effect/Effect.ts b/packages/@contentlayer/utils/src/effect/Effect.ts index 4327d1cb..ea93dd24 100644 --- a/packages/@contentlayer/utils/src/effect/Effect.ts +++ b/packages/@contentlayer/utils/src/effect/Effect.ts @@ -5,6 +5,8 @@ import * as Tuple from '@effect-ts/core/Collections/Immutable/Tuple' export * from '@effect-ts/core/Effect' +export type { _A as OutputOf } from '@effect-ts/core/Utils' + export const log = (...args: any[]) => T.succeedWith(() => { console.log(...args) diff --git a/packages/@contentlayer/utils/src/effect/index.ts b/packages/@contentlayer/utils/src/effect/index.ts index 2a18b819..c46a417f 100644 --- a/packages/@contentlayer/utils/src/effect/index.ts +++ b/packages/@contentlayer/utils/src/effect/index.ts @@ -4,6 +4,7 @@ import type { Has } from '@effect-ts/core/Has' export { pipe, flow } from '@effect-ts/core/Function' export { Tagged } from '@effect-ts/core/Case' export type { Has } from '@effect-ts/core/Has' +export { tag } from '@effect-ts/core/Has' export { pretty } from '@effect-ts/core/Effect/Cause' export * as Stream from './Stream.js' @@ -11,6 +12,8 @@ export * as S from './Stream.js' export * as Effect from './Effect.js' export * as T from './Effect.js' +export * as Branded from '@effect-ts/core/Branded' + export * as Sync from '@effect-ts/core/Sync' export * as Tuple from '@effect-ts/core/Collections/Immutable/Tuple' @@ -25,6 +28,9 @@ export * as Cause from '@effect-ts/core/Effect/Cause' export * as Clock from '@effect-ts/core/Effect/Clock' export type HasClock = Has +export * as Layer from '@effect-ts/core/Effect/Layer' +export * as L from '@effect-ts/core/Effect/Layer' + export * as Schedule from '@effect-ts/core/Effect/Schedule' export * as SC from '@effect-ts/core/Effect/Schedule' diff --git a/packages/@contentlayer/utils/src/file-paths.ts b/packages/@contentlayer/utils/src/file-paths.ts new file mode 100644 index 00000000..abd24bd0 --- /dev/null +++ b/packages/@contentlayer/utils/src/file-paths.ts @@ -0,0 +1,32 @@ +import * as path from 'path' + +import { Branded } from './effect/index.js' + +export type PosixFilePath = Branded.Branded + +export const posixFilePath = (path_: string): PosixFilePath => { + if (!isPosixFilePathString(path_)) { + throw new Error(`Expected a Posix file path, got ${path_}`) + } + return Branded.makeBranded(path_) +} + +export const isPosixFilePathString = (path_: string) => !path_.includes(path.win32.sep) +export const assertPosixFilePathString = (path_: string): asserts path_ is PosixFilePath => { + if (!isPosixFilePathString(path_)) { + throw new Error(`Expected a Posix file path, got ${path_}`) + } +} + +export const unknownToPosixFilePath = (path_: string): PosixFilePath => { + if (isPosixFilePathString(path_)) { + return posixFilePath(path_) + } + return posixFilePath(path_.split(path.win32.sep).join(path.posix.sep)) +} + +export type UnknownFilePath = Branded.Branded + +export const unknownFilePath = (path_: string): UnknownFilePath => Branded.makeBranded(path_) + +export const filePathJoin = (...paths: T[]): T => path.join(...paths) as T diff --git a/packages/@contentlayer/utils/src/index.ts b/packages/@contentlayer/utils/src/index.ts index 87b0b375..2fa5b3bd 100644 --- a/packages/@contentlayer/utils/src/index.ts +++ b/packages/@contentlayer/utils/src/index.ts @@ -4,6 +4,8 @@ export * from './object/index.js' export * from './tracing.js' export * from './promise.js' export * from './hash.js' +export * from './single-item.js' +export * from './file-paths.js' export * from './tracing-effect/index.js' export { AsciiTree } from 'oo-ascii-tree' diff --git a/packages/@contentlayer/utils/src/node/fs-watcher.ts b/packages/@contentlayer/utils/src/node/fs-watcher.ts index abf8df22..a829d1f5 100644 --- a/packages/@contentlayer/utils/src/node/fs-watcher.ts +++ b/packages/@contentlayer/utils/src/node/fs-watcher.ts @@ -12,35 +12,37 @@ import * as Chokidar from 'chokidar' import type fs from 'fs' import { Tagged } from '../effect/index.js' +import type { UnknownFilePath } from '../file-paths.js' +import { unknownFilePath } from '../file-paths.js' export class FileAdded { readonly _tag = 'FileAdded' - constructor(public path: string, public stats: O.Option) {} + constructor(public path: UnknownFilePath, public stats: O.Option) {} } export class FileRemoved { readonly _tag = 'FileRemoved' - constructor(public path: string, public stats: O.Option) {} + constructor(public path: UnknownFilePath, public stats: O.Option) {} } export class FileChanged { readonly _tag = 'FileChanged' - constructor(public path: string, public stats: O.Option) {} + constructor(public path: UnknownFilePath, public stats: O.Option) {} } export class DirectoryAdded { readonly _tag = 'DirectoryAdded' - constructor(public path: string, public stats: O.Option) {} + constructor(public path: UnknownFilePath, public stats: O.Option) {} } export class DirectoryRemoved { readonly _tag = 'DirectoryRemoved' - constructor(public path: string, public stats: O.Option) {} + constructor(public path: UnknownFilePath, public stats: O.Option) {} } export type FileSystemEvent = FileAdded | FileRemoved | FileChanged | DirectoryAdded | DirectoryRemoved @@ -130,22 +132,43 @@ class ConcreteFileWatcher extends FileWatcherInternal { _.on('all', (eventName, path, stats) => { switch (eventName) { case 'add': - T.run(H.publish_(this.fsEventsHub, Ex.succeed(E.right(new FileAdded(path, O.fromNullable(stats)))))) + T.run( + H.publish_( + this.fsEventsHub, + Ex.succeed(E.right(new FileAdded(unknownFilePath(path), O.fromNullable(stats)))), + ), + ) break case 'unlink': - T.run(H.publish_(this.fsEventsHub, Ex.succeed(E.right(new FileRemoved(path, O.fromNullable(stats)))))) + T.run( + H.publish_( + this.fsEventsHub, + Ex.succeed(E.right(new FileRemoved(unknownFilePath(path), O.fromNullable(stats)))), + ), + ) break case 'change': - T.run(H.publish_(this.fsEventsHub, Ex.succeed(E.right(new FileChanged(path, O.fromNullable(stats)))))) + T.run( + H.publish_( + this.fsEventsHub, + Ex.succeed(E.right(new FileChanged(unknownFilePath(path), O.fromNullable(stats)))), + ), + ) break case 'addDir': T.run( - H.publish_(this.fsEventsHub, Ex.succeed(E.right(new DirectoryAdded(path, O.fromNullable(stats))))), + H.publish_( + this.fsEventsHub, + Ex.succeed(E.right(new DirectoryAdded(unknownFilePath(path), O.fromNullable(stats)))), + ), ) break case 'unlinkDir': T.run( - H.publish_(this.fsEventsHub, Ex.succeed(E.right(new DirectoryRemoved(path, O.fromNullable(stats))))), + H.publish_( + this.fsEventsHub, + Ex.succeed(E.right(new DirectoryRemoved(unknownFilePath(path), O.fromNullable(stats)))), + ), ) break } diff --git a/packages/@contentlayer/utils/src/node/fs.ts b/packages/@contentlayer/utils/src/node/fs.ts index 46adae44..c8d12ae8 100644 --- a/packages/@contentlayer/utils/src/node/fs.ts +++ b/packages/@contentlayer/utils/src/node/fs.ts @@ -96,7 +96,7 @@ export const writeFileJson = ({ T.chain((contentStr) => writeFile(filePath, contentStr)), ) -export const mkdirp = (dirPath: string): T.Effect => +export const mkdirp = (dirPath: T): T.Effect => OT.withSpan('mkdirp', { attributes: { dirPath } })( T.tryCatchPromise( () => fs.mkdir(dirPath, { recursive: true }), diff --git a/packages/@contentlayer/utils/src/single-item.ts b/packages/@contentlayer/utils/src/single-item.ts new file mode 100644 index 00000000..9dfd59a9 --- /dev/null +++ b/packages/@contentlayer/utils/src/single-item.ts @@ -0,0 +1,13 @@ +export class SingleItem { + constructor(public item: T) {} + + map(fn: (item: T) => U): SingleItem { + return new SingleItem(fn(this.item)) + } + + filter(fn: (item: T) => boolean): SingleItem { + return fn(this.item) ? this : new SingleItem(undefined) + } +} + +export const singleItem = (item: T) => new SingleItem(item) diff --git a/packages/contentlayer-stackbit-yaml-generator/package.json b/packages/contentlayer-stackbit-yaml-generator/package.json index be140881..97976168 100644 --- a/packages/contentlayer-stackbit-yaml-generator/package.json +++ b/packages/contentlayer-stackbit-yaml-generator/package.json @@ -1,6 +1,6 @@ { "name": "contentlayer-stackbit-yaml-generator", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "bin": "./dist/cli/index.js", "exports": "./dist/lib/index.js", diff --git a/packages/contentlayer-stackbit-yaml-generator/src/cli/DefaultCommand.ts b/packages/contentlayer-stackbit-yaml-generator/src/cli/DefaultCommand.ts index c7efba8d..720b5540 100644 --- a/packages/contentlayer-stackbit-yaml-generator/src/cli/DefaultCommand.ts +++ b/packages/contentlayer-stackbit-yaml-generator/src/cli/DefaultCommand.ts @@ -1,4 +1,5 @@ -import { getConfig } from '@contentlayer/core' +import type { HasCwd } from '@contentlayer/core' +import { getConfig, provideCwd } from '@contentlayer/core' import { JaegerNodeTracing, recRemoveUndefinedValues } from '@contentlayer/utils' import { OT, pipe, pretty, T } from '@contentlayer/utils/effect' import { Command, Option } from 'clipanion' @@ -30,12 +31,14 @@ export class DefaultCommand extends Command { validator: t.isString(), }) + // TODO refactor similar to `@contentlayer/cli` async execute() { try { await pipe( this.executeSafe(), T.provideSomeLayer(JaegerNodeTracing('contentlayer-stackbit-yaml-generator')), T.tapCause((cause) => T.die(pretty(cause))), + provideCwd, T.runPromise, ) } catch (e: any) { @@ -44,9 +47,9 @@ export class DefaultCommand extends Command { } } - executeSafe = (): T.Effect => + executeSafe = (): T.Effect => pipe( - getConfig({ configPath: this.configPath, cwd: process.cwd() }), + getConfig({ configPath: this.configPath }), T.chain((source) => T.struct({ source: T.succeed(source), schema: source.provideSchema })), T.chain(({ schema, source }) => T.tryCatchPromise( diff --git a/packages/contentlayer/package.json b/packages/contentlayer/package.json index 24c6392e..bda1dad9 100644 --- a/packages/contentlayer/package.json +++ b/packages/contentlayer/package.json @@ -1,6 +1,6 @@ { "name": "contentlayer", - "version": "0.0.28", + "version": "0.0.29", "bin": "./bin/cli.cjs", "type": "module", "engines": { @@ -54,7 +54,7 @@ "./package.json" ], "scripts": { - "#postinstall": "This is executed in packages that install Contentlayer", + "#postinstall": "This is executed in packages which install `contentlayer`", "postinstall": "node ./bin/cli.cjs postinstall || echo 'No Contentlayer build found.'" }, "dependencies": { diff --git a/packages/next-contentlayer/package.json b/packages/next-contentlayer/package.json index d526026a..f3173740 100644 --- a/packages/next-contentlayer/package.json +++ b/packages/next-contentlayer/package.json @@ -1,25 +1,26 @@ { "name": "next-contentlayer", - "version": "0.0.28", + "version": "0.0.29", "type": "module", "main": "./dist/cjs/index.cjs", "exports": { ".": { - "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.cjs" + "import": "./dist/index.js", + "require": "./dist/index-cjs.cjs" }, "./hooks": { - "import": "./dist/esm/hooks/index.js", - "require": "./dist/cjs/hooks/index.js" + "import": "./dist/hooks/index.js", + "require": "./dist/hooks/index.js" } }, + "types": "./dist/index.d.ts", "typesVersions": { "*": { ".": [ - "./dist/esm/index" + "./dist" ], "hooks": [ - "./dist/esm/hooks/index" + "./dist/hooks" ] } }, @@ -28,7 +29,7 @@ "./package.json" ], "scripts": { - "prepack": "sed '/^import /d' dist/cjs/index.js > dist/cjs/index.cjs" + "prepack": "sed '/^import /d' dist/index-cjs.js > dist/index-cjs.cjs" }, "dependencies": { "@contentlayer/core": "workspace:*", @@ -36,7 +37,7 @@ "rxjs": "^7.1.0" }, "peerDependencies": { - "next": "^11 || ^12", + "next": "^12", "react": "*", "react-dom": "*" }, diff --git a/packages/next-contentlayer/src/index-cjs.ts b/packages/next-contentlayer/src/index-cjs.ts new file mode 100644 index 00000000..132caab3 --- /dev/null +++ b/packages/next-contentlayer/src/index-cjs.ts @@ -0,0 +1,47 @@ +import type { NextConfig } from 'next' + +export type { NextConfig } + +type PluginOptions = {} + +let devServerStarted = false + +module.exports.withContentlayer = + (_pluginOptions: PluginOptions = {}) => + (nextConfig: Partial = {}): Partial => { + // could be either `next dev` or just `next` + const isNextDev = process.argv.includes('dev') || process.argv.some((_) => _.endsWith('/.bin/next')) + const isBuild = process.argv.includes('build') + + return { + ...nextConfig, + // Since Next.js doesn't provide some kind of real "plugin system" we're (ab)using the `redirects` option here + // in order to hook into and block the `next build` and initial `next dev` run. + redirects: async () => { + // NOTE since next.config.js doesn't support ESM yet, this "CJS -> ESM bridge" is needed + const { runContentlayerBuild, runContentlayerDev } = await import('./plugin.js') + if (isBuild) { + await runContentlayerBuild() + } else if (isNextDev && !devServerStarted) { + devServerStarted = true + // TODO also block here until first Contentlayer run is complete + runContentlayerDev() + } + + return nextConfig.redirects?.() ?? [] + }, + webpack(config: any, options: any) { + config.watchOptions = { + ...config.watchOptions, + // ignored: /node_modules([\\]+|\/)+(?!\.contentlayer)/, + ignored: ['**/node_modules/!(.contentlayer)/**/*'], + } + + if (typeof nextConfig.webpack === 'function') { + return nextConfig.webpack(config, options) + } + + return config + }, + } + } diff --git a/packages/next-contentlayer/src/index.ts b/packages/next-contentlayer/src/index.ts index 132caab3..19885769 100644 --- a/packages/next-contentlayer/src/index.ts +++ b/packages/next-contentlayer/src/index.ts @@ -1,12 +1,14 @@ import type { NextConfig } from 'next' +import { runContentlayerBuild, runContentlayerDev } from './plugin.js' + export type { NextConfig } type PluginOptions = {} let devServerStarted = false -module.exports.withContentlayer = +export const withContentlayer = (_pluginOptions: PluginOptions = {}) => (nextConfig: Partial = {}): Partial => { // could be either `next dev` or just `next` @@ -18,8 +20,6 @@ module.exports.withContentlayer = // Since Next.js doesn't provide some kind of real "plugin system" we're (ab)using the `redirects` option here // in order to hook into and block the `next build` and initial `next dev` run. redirects: async () => { - // NOTE since next.config.js doesn't support ESM yet, this "CJS -> ESM bridge" is needed - const { runContentlayerBuild, runContentlayerDev } = await import('./plugin.js') if (isBuild) { await runContentlayerBuild() } else if (isNextDev && !devServerStarted) { diff --git a/packages/next-contentlayer/src/plugin.ts b/packages/next-contentlayer/src/plugin.ts index cee4320d..1f174ea8 100644 --- a/packages/next-contentlayer/src/plugin.ts +++ b/packages/next-contentlayer/src/plugin.ts @@ -11,12 +11,10 @@ export const runContentlayerDev = async () => { if (contentlayerInitialized) return contentlayerInitialized = true - const cwd = process.cwd() - await pipe( - core.getConfigWatch({ cwd }), + core.getConfigWatch({}), S.tapSkipFirstRight(() => T.log(`Contentlayer config change detected. Updating type definitions and data...`)), - S.chainSwitchMapEitherRight((source) => core.generateDotpkgStream({ source, verbose: false, cwd })), + S.chainSwitchMapEitherRight((source) => core.generateDotpkgStream({ source, verbose: false })), S.tap(E.fold((error) => T.log(errorToString(error)), core.logGenerateInfo)), S.runDrain, runMain, @@ -27,11 +25,9 @@ export const runContentlayerBuild = async () => { if (contentlayerInitialized) return contentlayerInitialized = true - const cwd = process.cwd() - await pipe( - core.getConfig({ cwd: process.cwd() }), - T.chain((source) => core.generateDotpkg({ source, verbose: false, cwd })), + core.getConfig({}), + T.chain((source) => core.generateDotpkg({ source, verbose: false })), T.tap(core.logGenerateInfo), OT.withSpan('next-contentlayer:runContentlayerBuild'), runMain, diff --git a/packages/next-contentlayer/tsconfig.cjs.json b/packages/next-contentlayer/tsconfig.cjs.json deleted file mode 100644 index 4d26d4d3..00000000 --- a/packages/next-contentlayer/tsconfig.cjs.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - // "module": "commonjs", - "outDir": "./dist/cjs", - "tsBuildInfoFile": "./dist/.tsbuildinfo.cjs.json" - }, - "references": [{ "path": "../@contentlayer/utils" }, { "path": "../@contentlayer/core" }] -} diff --git a/packages/next-contentlayer/tsconfig.json b/packages/next-contentlayer/tsconfig.json index 21ab1be9..dfb8c9fe 100644 --- a/packages/next-contentlayer/tsconfig.json +++ b/packages/next-contentlayer/tsconfig.json @@ -5,7 +5,7 @@ "allowSyntheticDefaultImports": true, "module": "ES2020", "rootDir": "./src", - "outDir": "./dist/esm", + "outDir": "./dist", "tsBuildInfoFile": "./dist/.tsbuildinfo.json" }, "include": ["./src"], diff --git a/tsconfig.all.json b/tsconfig.all.json index 69fd43ad..58317c4b 100644 --- a/tsconfig.all.json +++ b/tsconfig.all.json @@ -11,7 +11,6 @@ { "path": "./packages/@contentlayer/utils" }, { "path": "./packages/contentlayer" }, { "path": "./packages/contentlayer-stackbit-yaml-generator" }, - { "path": "./packages/next-contentlayer/tsconfig.cjs.json" }, { "path": "./packages/next-contentlayer" } ] } diff --git a/yarn.lock b/yarn.lock index 4dbec5b8..37142c69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1640,7 +1640,7 @@ __metadata: date-fns: 2.x esbuild: 0.11.x || 0.12.x || 0.13.x gray-matter: ^4.0.3 - markdown-wasm: ^1.1.2 + markdown-wasm: ^1.2.0 mdx-bundler: ^6.0.2 rehype-stringify: ^9.0.2 remark-parse: ^10.0.0 @@ -1685,8 +1685,8 @@ __metadata: chokidar: ^3.5.2 date-fns-tz: ^1.1.6 faker: ^5.5.3 - glob: ^7.1.7 - glob-promise: ^4.1.0 + glob: ^7.2.0 + glob-promise: ^4.2.2 gray-matter: ^4.0.3 minimatch: ^3.0.4 tap: ^15.0.10 @@ -1716,14 +1716,16 @@ __metadata: resolution: "@contentlayer/utils@workspace:packages/@contentlayer/utils" dependencies: "@effect-ts/core": ^0.45.5 - "@effect-ts/otel": next - "@effect-ts/otel-node": next + "@effect-ts/otel": ^0.7.0 + "@effect-ts/otel-node": ^0.7.0 "@opentelemetry/api": ^1.0.3 - "@opentelemetry/exporter-collector": ^0.24.0 - "@opentelemetry/node": ^0.24.0 - "@opentelemetry/resources": ^0.24.0 - "@opentelemetry/semantic-conventions": ^0.24.0 - "@opentelemetry/tracing": ^0.24.0 + "@opentelemetry/core": ^1.0.0 + "@opentelemetry/exporter-collector": ^0.25.0 + "@opentelemetry/exporter-collector-grpc": ^0.25.0 + "@opentelemetry/resources": ^1.0.0 + "@opentelemetry/sdk-trace-base": ^1.0.0 + "@opentelemetry/sdk-trace-node": ^1.0.0 + "@opentelemetry/semantic-conventions": ^1.0.0 "@types/inflection": ^1.13.0 chokidar: ^3.5.2 hash-wasm: ^4.9.0 @@ -1766,27 +1768,31 @@ __metadata: languageName: node linkType: hard -"@effect-ts/otel-node@npm:next": - version: 0.5.3-alpha.0 - resolution: "@effect-ts/otel-node@npm:0.5.3-alpha.0" +"@effect-ts/otel-node@npm:^0.7.0": + version: 0.7.0 + resolution: "@effect-ts/otel-node@npm:0.7.0" dependencies: - "@effect-ts/otel": ^0.5.3-alpha.0 + "@effect-ts/otel": ^0.7.0 peerDependencies: "@effect-ts/core": ^0.44.0 - "@opentelemetry/node": ^0.24.0 - checksum: e1be81df1db5c13f5e1ac6c7e8bfd1644198944ad8c48599ddf404c4b6710ddf0d0c17b6f4288afadc52d6f774a157d93f30bdf74269fd98a346833fb5408a59 + "@opentelemetry/api": ^1.0.0 + "@opentelemetry/core": ^1.0.0 + "@opentelemetry/exporter-collector-grpc": ^0.25.0 + "@opentelemetry/sdk-trace-base": ^1.0.0 + "@opentelemetry/sdk-trace-node": ^1.0.0 + checksum: f40c64e838bb4fb5786adb4316aef2a97b338d726b2f02007caae96329a95ad8af40eb56f06acaf5e5373a8ae72da2253aed6561dd00884cfd104c054aa37352 languageName: node linkType: hard -"@effect-ts/otel@npm:^0.5.3-alpha.0, @effect-ts/otel@npm:next": - version: 0.5.3-alpha.0 - resolution: "@effect-ts/otel@npm:0.5.3-alpha.0" +"@effect-ts/otel@npm:^0.7.0": + version: 0.7.0 + resolution: "@effect-ts/otel@npm:0.7.0" peerDependencies: "@effect-ts/core": ^0.44.0 "@opentelemetry/api": ^1.0.0 - "@opentelemetry/core": ^0.24.0 - "@opentelemetry/tracing": ^0.24.0 - checksum: e4547011825ef102a3372cb93c49cc94affd2d67844c3bc5d75a4f241707e04984a25594487675b6f1009711ed3f4f7db4424d3ad5cabb50790f57b2ef926f5f + "@opentelemetry/core": ^1.0.0 + "@opentelemetry/sdk-trace-base": ^1.0.0 + checksum: a5c63d579aa037b1683a8c455b3b08c9355392c299fb67fadb5893fe22cba79e9f92eeea7f1b9b9fc3eaeaf0ca3ba22bd9d02e4e6923c4443c7d0429a4825d09 languageName: node linkType: hard @@ -1865,6 +1871,31 @@ __metadata: languageName: node linkType: hard +"@grpc/grpc-js@npm:^1.3.7": + version: 1.4.3 + resolution: "@grpc/grpc-js@npm:1.4.3" + dependencies: + "@grpc/proto-loader": ^0.6.4 + "@types/node": ">=12.12.47" + checksum: 46925c732397dcbe07baa675ceb5c08d4ebf901fd5f54d859d439c86c167dfc5f4dc2f6b9506d1f19fe7c289a1d60af439a972366301818b674eb1e17ac38025 + languageName: node + linkType: hard + +"@grpc/proto-loader@npm:^0.6.4": + version: 0.6.6 + resolution: "@grpc/proto-loader@npm:0.6.6" + dependencies: + "@types/long": ^4.0.1 + lodash.camelcase: ^4.3.0 + long: ^4.0.0 + protobufjs: ^6.10.0 + yargs: ^16.1.1 + bin: + proto-loader-gen-types: build/bin/proto-loader-gen-types.js + checksum: d147accc4d6bbdfd67ca681192cea286511aadc532930b77106bb458b094a8473031eb0de523e5fe2e0e87c4f5ee7c4c31248e01276b910040da169e0f6b3196 + languageName: node + linkType: hard + "@hapi/accept@npm:5.0.2": version: 5.0.2 resolution: "@hapi/accept@npm:5.0.2" @@ -2363,12 +2394,12 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/api-metrics@npm:0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/api-metrics@npm:0.24.0" +"@opentelemetry/api-metrics@npm:0.25.0": + version: 0.25.0 + resolution: "@opentelemetry/api-metrics@npm:0.25.0" peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: 447b173a22269ae1045e6db1ff48027a8be6d83c6e156427c388080169867b01c758e7a83ae9a321174bb2e450a221c8cf9e9fa3c5ef471ee070c9ab0e6395aa + "@opentelemetry/api": ^1.0.2 + checksum: fbc440990fa5fd5f9dfe51b6e2b1ffb79b0f5440beb7a6e2db36fdfb02c8d1e66965408f28e037570c0cc1d365131b27192698fe85a73f8d9a2f186d3b62aa14 languageName: node linkType: hard @@ -2379,124 +2410,186 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/context-async-hooks@npm:0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/context-async-hooks@npm:0.24.0" +"@opentelemetry/context-async-hooks@npm:1.0.0": + version: 1.0.0 + resolution: "@opentelemetry/context-async-hooks@npm:1.0.0" peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: d23062e4f999e8e7fd4dc7727d68e121948b64cdc9d537f6a38a3ab925a6122609862b984daeafb9faf61db586140e8c958832025c2ecd3da6671dc6e9011c15 + "@opentelemetry/api": ^1.0.2 + checksum: 91283f136e0a71b2c4a99e583544760cb2d65f310a70e9f0fc552d2aeb0dfca11a984a4fad585615298fa548ec290e7eadec87a0c0e404036302209fa3534e3b languageName: node linkType: hard -"@opentelemetry/core@npm:0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/core@npm:0.24.0" +"@opentelemetry/core@npm:0.25.0": + version: 0.25.0 + resolution: "@opentelemetry/core@npm:0.25.0" dependencies: - "@opentelemetry/semantic-conventions": 0.24.0 - semver: ^7.1.3 + "@opentelemetry/semantic-conventions": 0.25.0 + semver: ^7.3.5 peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: 388693eef05f3135bb881e4b8107799ca517186fb24aeb54ba3b65961376ae2e22f1970d583e716463578cecd5f0dceb085bdc84dae8751330bebd0098e9a97f + "@opentelemetry/api": ^1.0.2 + checksum: 305c724cb2dbb4dfa57359fcc553a9fc60ed8a48ca9ee0fdd9c85fb7172d3e636a82e22e25bbcd08bf87059bd05c2f13c8b843bdda332fb64a1d16828bf155fa languageName: node linkType: hard -"@opentelemetry/exporter-collector@npm:^0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/exporter-collector@npm:0.24.0" +"@opentelemetry/core@npm:1.0.0, @opentelemetry/core@npm:^1.0.0": + version: 1.0.0 + resolution: "@opentelemetry/core@npm:1.0.0" dependencies: - "@opentelemetry/api-metrics": 0.24.0 - "@opentelemetry/core": 0.24.0 - "@opentelemetry/metrics": 0.24.0 - "@opentelemetry/resources": 0.24.0 - "@opentelemetry/tracing": 0.24.0 + "@opentelemetry/semantic-conventions": 1.0.0 + semver: ^7.3.5 peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: 7fa989b61314c13ec1b37a29a2013f05c94181cf0749f79989efc45ba96a7ef21929fa68c5fbccf1b9d6e9b07c32ab96c4861faadf3b69490b18053251412152 + "@opentelemetry/api": ^1.0.2 + checksum: 0b8168656b591e5c6f9e446b3b08e2fb2cf49df9a346343b4536ea8fece3a94807db354007d4727617350cbf7aa51bf21e5ac74ac97bbb3968a7019c34be2556 languageName: node linkType: hard -"@opentelemetry/metrics@npm:0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/metrics@npm:0.24.0" +"@opentelemetry/exporter-collector-grpc@npm:^0.25.0": + version: 0.25.0 + resolution: "@opentelemetry/exporter-collector-grpc@npm:0.25.0" dependencies: - "@opentelemetry/api-metrics": 0.24.0 - "@opentelemetry/core": 0.24.0 - "@opentelemetry/resources": 0.24.0 - lodash.merge: ^4.6.2 + "@grpc/grpc-js": ^1.3.7 + "@grpc/proto-loader": ^0.6.4 + "@opentelemetry/core": 0.25.0 + "@opentelemetry/exporter-collector": 0.25.0 + "@opentelemetry/resources": 0.25.0 + "@opentelemetry/sdk-metrics-base": 0.25.0 + "@opentelemetry/sdk-trace-base": 0.25.0 peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: b55eb8f5463b859cd819fe9993b2ada03d7a459747e9c11816373e4cc28398869687160067a59476856ddd9d926ad9f196ce26a942b9072f3facac929cb1aa63 + "@opentelemetry/api": ^1.0.2 + checksum: db2f0fcbe2f1bc113b701f21b133b2c1d8317a70804698b77861fede2273770b12b7c837ce3cce183975f11a7a96275dd8bdf8fcc813edf455f3e2ce8502a809 languageName: node linkType: hard -"@opentelemetry/node@npm:^0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/node@npm:0.24.0" - dependencies: - "@opentelemetry/context-async-hooks": 0.24.0 - "@opentelemetry/core": 0.24.0 - "@opentelemetry/propagator-b3": 0.24.0 - "@opentelemetry/propagator-jaeger": 0.24.0 - "@opentelemetry/tracing": 0.24.0 - semver: ^7.1.3 +"@opentelemetry/exporter-collector@npm:0.25.0, @opentelemetry/exporter-collector@npm:^0.25.0": + version: 0.25.0 + resolution: "@opentelemetry/exporter-collector@npm:0.25.0" + dependencies: + "@opentelemetry/api-metrics": 0.25.0 + "@opentelemetry/core": 0.25.0 + "@opentelemetry/resources": 0.25.0 + "@opentelemetry/sdk-metrics-base": 0.25.0 + "@opentelemetry/sdk-trace-base": 0.25.0 peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: cb5b9bac6bc9ad33a0f7c08237c6d0e1b3dc213744709b117a53d8ae1470ad21d5cfaa0549e47fed3834f3e25c06abcb3966ba558d0b20f1878449eafaeabf9c + "@opentelemetry/api": ^1.0.2 + checksum: 71db7d99e81421ce707580650c06b74631ff0d593591305f825cd1c1df85f2f49a0af6f66821cf3280fc66ae3903b5c7195dbd22dbd824d46aa135fe2261f7f1 languageName: node linkType: hard -"@opentelemetry/propagator-b3@npm:0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/propagator-b3@npm:0.24.0" +"@opentelemetry/propagator-b3@npm:1.0.0": + version: 1.0.0 + resolution: "@opentelemetry/propagator-b3@npm:1.0.0" dependencies: - "@opentelemetry/core": 0.24.0 + "@opentelemetry/core": 1.0.0 peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: 6467c3cb548130ed63c78f42b8e7e91c88b852951c14b0aadf20e835c70eb8298122f75ea4bd7abf24cc754257241d1204e15868eca5c743e6af147112a09670 + "@opentelemetry/api": ^1.0.2 + checksum: 3c6ce09ee5c48cd3338788bd69378f98ed224fa46123545526ad99948a4e7c4cf3dce5e5056863186677531f5ecec2c1833ddd6a049183847b42fbafc2416d3d languageName: node linkType: hard -"@opentelemetry/propagator-jaeger@npm:0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/propagator-jaeger@npm:0.24.0" +"@opentelemetry/propagator-jaeger@npm:1.0.0": + version: 1.0.0 + resolution: "@opentelemetry/propagator-jaeger@npm:1.0.0" dependencies: - "@opentelemetry/core": 0.24.0 + "@opentelemetry/core": 1.0.0 peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: 32c3e27349008e92dbbb58b75c8f86161627fca88579f077b30efc0ea4906f1e250bbdcf3ea52229e71b9fac54d3352554f43ac1ce802994529c6ee4d564eb6c + "@opentelemetry/api": ^1.0.2 + checksum: 96efb0257942867f199eb3cb238e02bb18e229622c3087343b50b85668881f8b470bf6e9fa35157e18e97f26f9bf303d45dcd770d7aac23fe005817908709d8a languageName: node linkType: hard -"@opentelemetry/resources@npm:0.24.0, @opentelemetry/resources@npm:^0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/resources@npm:0.24.0" +"@opentelemetry/resources@npm:0.25.0": + version: 0.25.0 + resolution: "@opentelemetry/resources@npm:0.25.0" dependencies: - "@opentelemetry/core": 0.24.0 - "@opentelemetry/semantic-conventions": 0.24.0 + "@opentelemetry/core": 0.25.0 + "@opentelemetry/semantic-conventions": 0.25.0 peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: 37e6ea95d369d2da58a7fd6ff1782db2a6ffe85c60ba104623039f5cd22925cd4a0e6945857d13b4ea28a851131ba33976cb24d36c0f81a9292fcad75618038a + "@opentelemetry/api": ^1.0.2 + checksum: c90186e3051e5993108d49052479a693f80959ba95c4d8343f2459c34c71574c03cd84832f6f77a7fd05debd89ccea63eda054dc178bc9eafd399f217abae338 languageName: node linkType: hard -"@opentelemetry/semantic-conventions@npm:0.24.0, @opentelemetry/semantic-conventions@npm:^0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/semantic-conventions@npm:0.24.0" - checksum: 56e0e817a048ea6fcf28d5193b59ca5ed3b57bfb62bb1386be774d898951351c97afd9b41e6821858cbe5599c9ce3514ec64407e09fe73ccedaa7c90d358e5e7 +"@opentelemetry/resources@npm:1.0.0, @opentelemetry/resources@npm:^1.0.0": + version: 1.0.0 + resolution: "@opentelemetry/resources@npm:1.0.0" + dependencies: + "@opentelemetry/core": 1.0.0 + "@opentelemetry/semantic-conventions": 1.0.0 + peerDependencies: + "@opentelemetry/api": ^1.0.2 + checksum: 95aa8456360ec172790362e41e288aca3e4294f90359d269bc66645f684779be8d56b46d69ae045eb4e32d043de0dbe97a4953e12d5940218b2241cd44b989df languageName: node linkType: hard -"@opentelemetry/tracing@npm:0.24.0, @opentelemetry/tracing@npm:^0.24.0": - version: 0.24.0 - resolution: "@opentelemetry/tracing@npm:0.24.0" +"@opentelemetry/sdk-metrics-base@npm:0.25.0": + version: 0.25.0 + resolution: "@opentelemetry/sdk-metrics-base@npm:0.25.0" dependencies: - "@opentelemetry/core": 0.24.0 - "@opentelemetry/resources": 0.24.0 - "@opentelemetry/semantic-conventions": 0.24.0 + "@opentelemetry/api-metrics": 0.25.0 + "@opentelemetry/core": 0.25.0 + "@opentelemetry/resources": 0.25.0 lodash.merge: ^4.6.2 peerDependencies: - "@opentelemetry/api": ^1.0.1 - checksum: e691e1f44115f06b1c6039dcb144fd58efc819f440ad77588c68f7b9f32d6f10b22c58c0b05cfeb215178338aa506189bce7767f08e3d4d522774af227472845 + "@opentelemetry/api": ^1.0.2 + checksum: 49992e4bd91cad23bc94bc9a486d9ee72ca2ddc509051245f398249defc44316ec2d3fc5e34921d81eaef8bc6477d87e492217a7eda7307b2aeabaf58ad5bd4e + languageName: node + linkType: hard + +"@opentelemetry/sdk-trace-base@npm:0.25.0": + version: 0.25.0 + resolution: "@opentelemetry/sdk-trace-base@npm:0.25.0" + dependencies: + "@opentelemetry/core": 0.25.0 + "@opentelemetry/resources": 0.25.0 + "@opentelemetry/semantic-conventions": 0.25.0 + lodash.merge: ^4.6.2 + peerDependencies: + "@opentelemetry/api": ^1.0.2 + checksum: b8ae1ddad1eb29852ef75d75c7bb4bf90e19ecb7428d504fb9bba67a7222dc08f45169e162ea62d43abee1ccd07f8ddf3b543f8fc9b38d1d34fc54659f864023 + languageName: node + linkType: hard + +"@opentelemetry/sdk-trace-base@npm:1.0.0, @opentelemetry/sdk-trace-base@npm:^1.0.0": + version: 1.0.0 + resolution: "@opentelemetry/sdk-trace-base@npm:1.0.0" + dependencies: + "@opentelemetry/core": 1.0.0 + "@opentelemetry/resources": 1.0.0 + "@opentelemetry/semantic-conventions": 1.0.0 + lodash.merge: ^4.6.2 + peerDependencies: + "@opentelemetry/api": ^1.0.2 + checksum: 0cbbc2c720f96347e0c9a1ca7a9a4cd3c7219da267edd357ed532951e602c5c3c0729cca15fa77ab316ad009f5cb1217c78f44c71f8522fec047e98cb41e253f + languageName: node + linkType: hard + +"@opentelemetry/sdk-trace-node@npm:^1.0.0": + version: 1.0.0 + resolution: "@opentelemetry/sdk-trace-node@npm:1.0.0" + dependencies: + "@opentelemetry/context-async-hooks": 1.0.0 + "@opentelemetry/core": 1.0.0 + "@opentelemetry/propagator-b3": 1.0.0 + "@opentelemetry/propagator-jaeger": 1.0.0 + "@opentelemetry/sdk-trace-base": 1.0.0 + semver: ^7.3.5 + peerDependencies: + "@opentelemetry/api": ^1.0.2 + checksum: 5b6ff96ad7b09d76f99f9f3d674a7b0d0c0b234abe861660ca187f0b669ab66e493447105a4387eacf7b88be4ca82daa42d314e8c2093278d1da840c28fc50fe + languageName: node + linkType: hard + +"@opentelemetry/semantic-conventions@npm:0.25.0": + version: 0.25.0 + resolution: "@opentelemetry/semantic-conventions@npm:0.25.0" + checksum: 0771e3298ed67f87d466e3eeac17fb3363cd7759b0b306b42d296464ef40c5f00e351535bc5eab0b678f3c60cb256309d6c4779b586beaf5edf99300d1e0ab45 + languageName: node + linkType: hard + +"@opentelemetry/semantic-conventions@npm:1.0.0, @opentelemetry/semantic-conventions@npm:^1.0.0": + version: 1.0.0 + resolution: "@opentelemetry/semantic-conventions@npm:1.0.0" + checksum: 1fc7a5cbabd49ebfaf83413dcadd742a483efb8d95532aef3522b332abf32cc5c4602ec87ea5d9fc0bcfeea4e88e4993d2e996bf050fdfae3d19d1fa91ddae8a languageName: node linkType: hard @@ -2550,6 +2643,79 @@ __metadata: languageName: node linkType: hard +"@protobufjs/aspromise@npm:^1.1.1, @protobufjs/aspromise@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/aspromise@npm:1.1.2" + checksum: 011fe7ef0826b0fd1a95935a033a3c0fd08483903e1aa8f8b4e0704e3233406abb9ee25350ec0c20bbecb2aad8da0dcea58b392bbd77d6690736f02c143865d2 + languageName: node + linkType: hard + +"@protobufjs/base64@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/base64@npm:1.1.2" + checksum: 67173ac34de1e242c55da52c2f5bdc65505d82453893f9b51dc74af9fe4c065cf4a657a4538e91b0d4a1a1e0a0642215e31894c31650ff6e3831471061e1ee9e + languageName: node + linkType: hard + +"@protobufjs/codegen@npm:^2.0.4": + version: 2.0.4 + resolution: "@protobufjs/codegen@npm:2.0.4" + checksum: 59240c850b1d3d0b56d8f8098dd04787dcaec5c5bd8de186fa548de86b86076e1c50e80144b90335e705a044edf5bc8b0998548474c2a10a98c7e004a1547e4b + languageName: node + linkType: hard + +"@protobufjs/eventemitter@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/eventemitter@npm:1.1.0" + checksum: 0369163a3d226851682f855f81413cbf166cd98f131edb94a0f67f79e75342d86e89df9d7a1df08ac28be2bc77e0a7f0200526bb6c2a407abbfee1f0262d5fd7 + languageName: node + linkType: hard + +"@protobufjs/fetch@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/fetch@npm:1.1.0" + dependencies: + "@protobufjs/aspromise": ^1.1.1 + "@protobufjs/inquire": ^1.1.0 + checksum: 3fce7e09eb3f1171dd55a192066450f65324fd5f7cc01a431df01bb00d0a895e6bfb5b0c5561ce157ee1d886349c90703d10a4e11a1a256418ff591b969b3477 + languageName: node + linkType: hard + +"@protobufjs/float@npm:^1.0.2": + version: 1.0.2 + resolution: "@protobufjs/float@npm:1.0.2" + checksum: 5781e1241270b8bd1591d324ca9e3a3128d2f768077a446187a049e36505e91bc4156ed5ac3159c3ce3d2ba3743dbc757b051b2d723eea9cd367bfd54ab29b2f + languageName: node + linkType: hard + +"@protobufjs/inquire@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/inquire@npm:1.1.0" + checksum: ca06f02eaf65ca36fb7498fc3492b7fc087bfcc85c702bac5b86fad34b692bdce4990e0ef444c1e2aea8c034227bd1f0484be02810d5d7e931c55445555646f4 + languageName: node + linkType: hard + +"@protobufjs/path@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/path@npm:1.1.2" + checksum: 856eeb532b16a7aac071cacde5c5620df800db4c80cee6dbc56380524736205aae21e5ae47739114bf669ab5e8ba0e767a282ad894f3b5e124197cb9224445ee + languageName: node + linkType: hard + +"@protobufjs/pool@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/pool@npm:1.1.0" + checksum: d6a34fbbd24f729e2a10ee915b74e1d77d52214de626b921b2d77288bd8f2386808da2315080f2905761527cceffe7ec34c7647bd21a5ae41a25e8212ff79451 + languageName: node + linkType: hard + +"@protobufjs/utf8@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/utf8@npm:1.1.0" + checksum: f9bf3163d13aaa3b6f5e6fbf37a116e094ea021c0e1f2a7ccd0e12a29e2ce08dafba4e8b36e13f8ed7397e1591610ce880ed1289af4d66cf4ace8a36a9557278 + languageName: node + linkType: hard + "@reach/auto-id@npm:^0.13.2": version: 0.13.2 resolution: "@reach/auto-id@npm:0.13.2" @@ -3808,6 +3974,13 @@ __metadata: languageName: node linkType: hard +"@types/long@npm:^4.0.1": + version: 4.0.1 + resolution: "@types/long@npm:4.0.1" + checksum: ff9653c33f5000d0f131fd98a950a0343e2e33107dd067a97ac4a3b9678e1a2e39ea44772ad920f54ef6e8f107f76bc92c2584ba905a0dc4253282a4101166d0 + languageName: node + linkType: hard + "@types/mdast@npm:^3.0.0": version: 3.0.10 resolution: "@types/mdast@npm:3.0.10" @@ -3852,7 +4025,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^16.10.2": +"@types/node@npm:*, @types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0, @types/node@npm:^16.10.2": version: 16.11.6 resolution: "@types/node@npm:16.11.6" checksum: 6e19634766ff589d3d2f361c2196b671f8f133cdadc5ad347a621c360d8994b6c4fbccfb2ad9c60c588c593831a96497c9c6b77d2b7e91be723384b94f6368e7 @@ -7333,7 +7506,7 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:2.x, date-fns@npm:^2.16.1, date-fns@npm:^2.24.0": +"date-fns@npm:2.x, date-fns@npm:^2.16.1, date-fns@npm:^2.25.0": version: 2.25.0 resolution: "date-fns@npm:2.25.0" checksum: 8896dc1dde0ee5ef77616942423bfa11fa2017a5ac19457293b7aaedc8822ff94f0a14eaf93da573b09b601dc0149eb430988a046cc9f79a2eb15f8c66c9c50c @@ -8882,7 +9055,7 @@ __metadata: "@types/react-helmet": ^6.1.2 contentlayer: "workspace:*" contentlayer-stackbit-yaml-generator: "workspace:*" - date-fns: ^2.24.0 + date-fns: ^2.25.0 marked: ^3.0.4 next: ^12.0.2 next-contentlayer: "workspace:*" @@ -8906,7 +9079,7 @@ __metadata: "@types/react-helmet": ^6.1.2 contentlayer: "workspace:*" contentlayer-stackbit-yaml-generator: "workspace:*" - date-fns: ^2.24.0 + date-fns: ^2.25.0 marked: ^3.0.4 next: ^12.0.2 next-contentlayer: "workspace:*" @@ -8929,7 +9102,7 @@ __metadata: "@types/react-dom": ^17.0.9 "@types/react-helmet": ^6.1.2 contentlayer: "workspace:*" - date-fns: ^2.24.0 + date-fns: ^2.25.0 marked: ^3.0.4 next: ^12.0.2 react: ^17.0.2 @@ -8951,7 +9124,7 @@ __metadata: "@types/react-helmet": ^6.1.2 contentlayer: "workspace:*" contentlayer-stackbit-yaml-generator: "workspace:*" - date-fns: ^2.24.0 + date-fns: ^2.25.0 marked: ^3.0.4 next: ^12.0.2 next-contentlayer: "workspace:*" @@ -8972,7 +9145,7 @@ __metadata: "@types/react": ^17.0.21 "@types/react-dom": ^17.0.9 contentlayer: latest - date-fns: ^2.24.0 + date-fns: ^2.25.0 next: ^12.0.2 next-contentlayer: latest react: 17.0.2 @@ -9021,7 +9194,7 @@ __metadata: dependencies: contentlayer: latest contentlayer-stackbit-yaml-generator: latest - date-fns: ^2.24.0 + date-fns: ^2.25.0 next: ^12.0.2 next-contentlayer: latest react: 17.0.2 @@ -9038,7 +9211,7 @@ __metadata: "@types/react-dom": ^17.0.9 contentlayer: latest contentlayer-stackbit-yaml-generator: latest - date-fns: ^2.24.0 + date-fns: ^2.25.0 next: ^12.0.2 next-contentlayer: latest react: 17.0.2 @@ -10112,7 +10285,7 @@ fsevents@^1.2.7: languageName: node linkType: hard -"glob-promise@npm:^4.1.0": +"glob-promise@npm:^4.2.2": version: 4.2.2 resolution: "glob-promise@npm:4.2.2" dependencies: @@ -10151,7 +10324,7 @@ fsevents@^1.2.7: languageName: node linkType: hard -"glob@npm:^7.0.0, glob@npm:^7.0.5, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.1.7, glob@npm:~7.2.0": +"glob@npm:^7.0.0, glob@npm:^7.0.5, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.1.7, glob@npm:^7.2.0, glob@npm:~7.2.0": version: 7.2.0 resolution: "glob@npm:7.2.0" dependencies: @@ -13201,6 +13374,13 @@ fsevents@^1.2.7: languageName: node linkType: hard +"long@npm:^4.0.0": + version: 4.0.0 + resolution: "long@npm:4.0.0" + checksum: 16afbe8f749c7c849db1f4de4e2e6a31ac6e617cead3bdc4f9605cb703cd20e1e9fc1a7baba674ffcca57d660a6e5b53a9e236d7b25a295d3855cca79cc06744 + languageName: node + linkType: hard + "longest-streak@npm:^3.0.0": version: 3.0.1 resolution: "longest-streak@npm:3.0.1" @@ -13396,7 +13576,7 @@ fsevents@^1.2.7: languageName: node linkType: hard -"markdown-wasm@npm:^1.1.2": +"markdown-wasm@npm:^1.2.0": version: 1.2.0 resolution: "markdown-wasm@npm:1.2.0" checksum: c1f5fee6f1cb24b05bccab8261cbfdf16f0f523cb0a24d3eddc374b5a3cbd5ab70b0bcf0c84c4453f17a68f95c63ecb190989d15e9ef05b1b5c5b613b625adb5 @@ -14500,7 +14680,7 @@ fsevents@^1.2.7: rxjs: ^7.1.0 typescript: ^4.4.4 peerDependencies: - next: ^11 || ^12 + next: ^12 react: "*" react-dom: "*" languageName: unknown @@ -17007,6 +17187,30 @@ fsevents@^1.2.7: languageName: node linkType: hard +"protobufjs@npm:^6.10.0": + version: 6.11.2 + resolution: "protobufjs@npm:6.11.2" + dependencies: + "@protobufjs/aspromise": ^1.1.2 + "@protobufjs/base64": ^1.1.2 + "@protobufjs/codegen": ^2.0.4 + "@protobufjs/eventemitter": ^1.1.0 + "@protobufjs/fetch": ^1.1.0 + "@protobufjs/float": ^1.0.2 + "@protobufjs/inquire": ^1.1.0 + "@protobufjs/path": ^1.1.2 + "@protobufjs/pool": ^1.1.0 + "@protobufjs/utf8": ^1.1.0 + "@types/long": ^4.0.1 + "@types/node": ">=13.7.0" + long: ^4.0.0 + bin: + pbjs: bin/pbjs + pbts: bin/pbts + checksum: 80e9d9610c3eb66f9eae4e44a1ae30381cedb721b7d5f635d781fe4c507e2c77bb7c879addcd1dda79733d3ae589d9e66fd18d42baf99b35df7382a0f9920795 + languageName: node + linkType: hard + "proxy-addr@npm:~2.0.5": version: 2.0.7 resolution: "proxy-addr@npm:2.0.7" @@ -18833,7 +19037,7 @@ resolve@^2.0.0-next.3: languageName: node linkType: hard -"semver@npm:^7.1.3, semver@npm:^7.2.1, semver@npm:^7.3.5": +"semver@npm:^7.2.1, semver@npm:^7.3.5": version: 7.3.5 resolution: "semver@npm:7.3.5" dependencies: @@ -22215,7 +22419,7 @@ resolve@^2.0.0-next.3: languageName: node linkType: hard -"yargs@npm:^16.2.0": +"yargs@npm:^16.1.1, yargs@npm:^16.2.0": version: 16.2.0 resolution: "yargs@npm:16.2.0" dependencies: