-
Notifications
You must be signed in to change notification settings - Fork 2
feat: migrate to mono repo #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 4f9517b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughConverts the repo to a Yarn workspaces monorepo. Introduces two packages: @alauda/doom (core) and @alauda/doom-export (PDF export). Updates build configs (tsconfig, ESLint, Prettier), CI publish workflow, and rewires imports/exports to the new package boundaries while removing legacy barrel exports under src/. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as @alauda/doom CLI
participant Export as @alauda/doom-export
participant Playwright as Playwright/browser
participant PDF as PDF tools
User->>CLI: run doom export ...
CLI->>Export: generatePdf(options)
Export->>Playwright: render pages
Export->>PDF: merge/post-process
Export-->>CLI: PDF path/result
CLI-->>User: output success/error
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(No out-of-scope functional changes detected.) Possibly related PRs
Suggested labels
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
56e9b0f to
a8e55f7
Compare
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the codebase from a single package structure to a monorepo setup with separate packages for the main functionality and export capabilities.
- Restructures the codebase into
packages/doomandpackages/exportwith shared TypeScript configuration - Moves export-related functionality into a separate
@alauda/doom-exportpackage - Updates import paths from
.jsto.tsextensions throughout the codebase
Reviewed Changes
Copilot reviewed 29 out of 186 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.base.json | Adds shared TypeScript configuration for the monorepo |
| packages/export/* | Creates new export package with moved PDF generation functionality |
| packages/doom/* | Creates main doom package with updated imports to use the new export package |
| package.json | Converts root to monorepo workspace with updated scripts and dependencies |
| Various config files | Updates ignore patterns and paths for monorepo structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 11
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
packages/export/src/export-pdf-core/generatePdf.ts (1)
113-114: HTTP header name typo: use RefererPlaywright/Node expect the historical misspelling “referer”. The current “refer” header will be ignored.
- refer: parsedUrlString, + referer: parsedUrlString,packages/export/src/html-export-pdf/core/printer.ts (3)
121-128: Misuse of Playwrightconnectoptions;args/headless/pipeare ignored.
chromium.connect()does not accept launch options likeargs,headless, orpipe. These options are only used bychromium.launch(). As written, connecting to a remote browser won’t apply the intended settings; worse, it suggests a false sense of configuration parity.Minimal fix: use separate option sets for
connectvslaunch.- if (this.browserWSEndpoint) { - this.browser = await chromium.connect( - this.browserWSEndpoint, - browserOptions, - ) - } else { - this.browser = await chromium.launch(browserOptions) - } + if (this.browserWSEndpoint) { + // Only pass supported ConnectOptions here (e.g., timeout, headers) + const { timeout } = (launchOptions ?? {}) as { timeout?: number } + this.browser = await chromium.connect(this.browserWSEndpoint, { timeout }) + } else { + this.browser = await chromium.launch(browserOptions) + }If you intend to connect to an existing Chromium via CDP, consider
chromium.connectOverCDP({ wsEndpoint, timeout }).
147-171: Access control routing not installed unless allowed lists are non-empty.
route('**/*', ...)is only registered whenneedsAllowedRules()is truthy. That function currently checks onlyallowedPaths/allowedDomains. As a result,allowLocal/allowRemoteare not enforced unless you also provide allowed lists.Fix by treating the booleans as gating conditions too:
- if (this.needsAllowedRules()) { + if (this.needsAllowedRules()) { await page.route('**/*', (route) => { - const uri = new URL(route.request().url()) - const { host, protocol, pathname } = uri + const uri = new URL(route.request().url()) + const { host, protocol } = uri const local = protocol === 'file:' - if (local && !this.withinAllowedPath(pathname)) { + // Convert file URL to OS path for reliable checks on all platforms + const pathname = local ? toFsPath(uri) : undefined + + if (local && pathname && !this.withinAllowedPath(pathname)) { return route.abort() } if (local && !this.allowLocal) { return route.abort() } if (host && !this.isAllowedDomain(host)) { return route.abort() } if (host && !this.allowRemote) { return route.abort() } return route.continue() }) }And update
needsAllowedRules()accordingly (see next comment).
Outside this hunk, add:// near imports import { fileURLToPath } from 'node:url' // near class methods (helper) function toFsPath(u: URL) { return fileURLToPath(u) // handles Windows and percent-encoding correctly }
297-299: Return a boolean and includeallowLocal/allowRemotein the condition.This currently returns a number and ignores the boolean gates; make it explicit.
- needsAllowedRules() { - return this.allowedPaths.length || this.allowedDomains.length - } + needsAllowedRules() { + return ( + this.allowedPaths.length > 0 || + this.allowedDomains.length > 0 || + this.allowLocal === false || + this.allowRemote === false + ) + }
🧹 Nitpick comments (22)
.prettierignore (1)
2-2: Broadened pyodide ignore looks good; consider aligning Prettier/Eslint ignores.The
**/pyodidepattern is appropriate for a monorepo. To avoid Prettier touching build artifacts across packages (and to stay consistent with eslint ignores), consider also ignoringdistandlib.Apply this diff:
.yarn **/pyodide +# build outputs in all packages +**/dist +**/lib # too big fixture-docs/shared/crds/operator.tekton.dev_*.yaml.changeset/dull-jeans-stare.md (1)
1-6: Confirm semver: monorepo migration may be user-visible; ensure “minor” is correct.If import paths, CLI entry points, or package names changed for consumers, this would be a breaking change and should be a major bump. If behavior is preserved, minor is fine—please verify.
Also, expand the message to clarify what changed to help release notes readers.
Suggested tweak:
--- "@alauda/doom-export": minor "@alauda/doom": minor --- -feat: migrate to mono repo +feat: migrate to monorepo, split into core (@alauda/doom) and export (@alauda/doom-export). +No breaking changes to public APIs/import paths..github/workflows/pkg-pr-new.yml (1)
35-35: Double-check glob quoting for pkg-pr-new.Quoting
'./packages/*'prevents shell expansion and passes the glob literally topkg-pr-new. If the tool expects expanded directories, drop the quotes; if it supports its own globbing, keeping quotes is fine. Please verify the intended behavior.If shell expansion is desired, apply:
- run: yarn dlx pkg-pr-new publish './packages/*' --packageManager=yarn # --compact + run: yarn dlx pkg-pr-new publish ./packages/* --packageManager=yarn # --compactNote: Yarn v4 usage in this repo is compatible with
yarn dlx; no issues there.eslint.config.js (1)
15-15: Use**/distto cover nested package builds.Given the monorepo,
distat the root isn’t sufficient. Mirror thelib/pyodideapproach fordist.- ignores: ['dist', '**/lib', '**/pyodide'], + ignores: ['**/dist', '**/lib', '**/pyodide'],packages/export/src/helpers.ts (1)
4-9: Minor cleanup: preferpath.dirname(orimport.meta.dirname) for clarity; optionally exportPKG_DIR.Functionally correct, but
path.dirname(fileURLToPath(import.meta.url))is clearer than resolving..off the file path. If your Node engine is ≥20,import.meta.dirnameis even cleaner. ExportingPKG_DIRcan also be handy for consumers/tests.Option A (Node < 20 safe):
-const BASE_DIR = path.resolve(fileURLToPath(import.meta.url), '..') +const BASE_DIR = path.dirname(fileURLToPath(import.meta.url)) -const PKG_DIR = path.resolve(BASE_DIR, '..') +export const PKG_DIR = path.resolve(BASE_DIR, '..') export const pkgResolve = (...paths: string[]) => - path.resolve(PKG_DIR, ...paths) + path.resolve(PKG_DIR, ...paths)Option B (Node ≥ 20):
-const BASE_DIR = path.resolve(fileURLToPath(import.meta.url), '..') +const BASE_DIR = import.meta.dirname -const PKG_DIR = path.resolve(BASE_DIR, '..') +export const PKG_DIR = path.resolve(BASE_DIR, '..')packages/export/src/merge-pdfs/index.ts (2)
18-21: Avoid hard process exit in a library function; prefer throwing.This function is imported from other modules; calling process.exit(1) here can terminate consumers unexpectedly. Also, error messages should go to stderr.
Apply:
- if (entries.length < 2) { - process.stdout.write(yellowBright('At least two PDF files.\n')) - process.exit(1) - } + if (entries.length < 2) { + process.stderr.write(yellowBright('At least two PDF files.\n')) + throw new Error('At least two PDF files.') + }
47-51: Normalize Windows paths when generating temp filenames.filePath.split('/').join('-') misses backslashes on Windows, which then become literal characters in the filename. Normalize both separators.
- entries.forEach((filePath) => { - const tempFileName = `/${filePath.split('/').join('-')}` + entries.forEach((filePath) => { + const tempFileName = `/${filePath.replace(/[\\/]/g, '-')}` tempFileNameArr.push(tempFileName) pyodide.FS.writeFile(tempFileName, readFileSync(filePath)) })packages/export/package.json (1)
16-23: Add types and publish config for better DX and first publish.TypeScript will usually locate .d.ts next to .js under exports, but being explicit helps editors. Also, scoped packages default to “restricted” on first publish unless access=public is set.
{ "name": "@alauda/doom-export", "version": "0.0.0", "type": "module", "description": "Doctor Doom making docs.", + "types": "./lib/index.d.ts", "repository": { @@ "exports": { ".": "./lib/index.js", "./package.json": "./package.json" }, + "publishConfig": { + "access": "public" + }, + "sideEffects": false, "files": [ "lib", "pyodide" ],packages/export/src/export-pdf-core/utils/mergePDF.ts (2)
90-96: Guard against outline length mismatch.outlines[index] can be undefined if the PDF’s internal outline count differs from outlineNodes length, causing a crash on outline.children access.
- for (const [index, outlineNode] of outlineNodes.entries()) { - const outline = outlines[index] + for (const [index, outlineNode] of outlineNodes.entries()) { + const outline = outlines[index] + if (!outline) continue outlineMap.set(outlineNode, outline) for (const [index, outlineChild] of outlineNode.children.entries()) { - outlineMap.set(outlineChild, outline.children[index]) + const child = outline.children[index] + if (child) outlineMap.set(outlineChild, child) } }
190-191: Handle cross-device rename (EXDEV).fs.rename can fail across mount points. Fallback to copy+unlink.
- } else if (pages.length === 1) { - await fs.rename(pages[0].pagePath, saveFilePath) + } else if (pages.length === 1) { + try { + await fs.rename(pages[0].pagePath, saveFilePath) + } catch (err) { + const code = (err as NodeJS.ErrnoException)?.code + if (code === 'EXDEV') { + await fs.copyFile(pages[0].pagePath, saveFilePath) + await fs.unlink(pages[0].pagePath) + } else { + throw err + } + }packages/export/tsconfig.json (2)
2-2: Use explicit.jsoninextendsto avoid tooling edge cases.Some tooling (including editors and build scripts) can mis-resolve extensionless config paths. Prefer
../../tsconfig.base.json.Apply this diff:
- "extends": "../../tsconfig.base", + "extends": "../../tsconfig.base.json",
3-8: Consider adding TS project references if this package depends on other workspaces.Since
composite: trueis enabled, references unlock faster incremental builds across workspaces.Would you like me to propose a
referencesblock once we confirm inter-package deps?Example:
{ "references": [{ "path": "../doom" }] }packages/export/src/html-export-pdf/core/printer.ts (3)
301-318: Path check may fail on Windows due to URL vs FS path differences.
pathnamefromURLisn’t an OS path on Windows (/C:/...), and may be percent-encoded. UsefileURLToPath(as shown above) to normalize beforepath.relative.
286-295: Prefer logging over writing raw output for missing browser instance.
process.stdout.write(red('Browser instance not found'))can be missed by consumers and lacks newline. Consider using your logger orconsole.warnwith newline.- process.stdout.write(red('Browser instance not found')) + console.warn(red('Browser instance not found'))
1-3: Minor: consider adding a debounce for concurrentsetup()calls.Two concurrent calls before
this.pageis set can launch two browsers. A simplesetupPromiseguard avoids this.packages/doom/src/cli/export.ts (2)
91-99: Potential type mismatch:portis a string from CLI; ensureGeneratePdfOptions.portaccepts string or cast to number.Commander options are strings by default. If
GeneratePdfOptions['port']is numeric, cast once to avoid implicit coercions later.- port: port!, + port: port ? Number(port) : undefined,
183-187: Out file name may contain illegal filename characters.When deriving from sidebar text, consider sanitizing to a safe filename (remove slashes, control chars).
- outFile: `${item.name || (foundSidebarItems.find((it) => it.link?.endsWith('/index')) ?? foundSidebarItems[0]).text}-${lang}.pdf`, + outFile: `${sanitizeFileName(item.name || (foundSidebarItems.find((it) => it.link?.endsWith('/index')) ?? foundSidebarItems[0]).text)}-${lang}.pdf`,Outside this hunk, you can add a small helper:
function sanitizeFileName(s: string) { return s.replace(/[\\\/:*?"<>|\u0000-\u001F]/g, '_').trim() }packages/export/src/export-pdf-core/utils/index.ts (1)
1-3: Naming consistency:mergePDF.tsvs camelCase.Minor: consider renaming to
mergePdf.tsfor consistency with typical file casing.packages/export/src/html-export-pdf/index.ts (1)
1-2: Consider explicitly curating the public API instead ofexport *barrels.Wildcard re-exports can leak internals and cause accidental API surface growth. Export named symbols from
./coreand./utilsto keep the surface stable.tsconfig.base.json (1)
12-15: Optional: confirmrewriteRelativeImportExtensionsusage.That flag is designed to work best with
.jsin source under NodeNext. If you move to Option A (use.js), keep this flag; if you choose Option B (use.ts), this flag becomes less useful.tsconfig.json (1)
6-10: Follow-up: ensure package subpath exports exist for consumers.Since you’ve introduced new barrels (e.g.,
html-export-pdf), make surepackages/export/package.jsonexposes subpath exports like"./html-export-pdf": { "types": "./lib/html-export-pdf/index.d.ts", "import": "./lib/html-export-pdf/index.js" }. Without that, consumers can’t import@alauda/doom-export/html-export-pdf.packages/export/src/html-export-pdf/utils/index.ts (1)
1-7: Optional: avoid star-exports to keep the utils surface stable.Consider explicitly re-exporting only the intended public helpers to prevent leaking internals and to aid tree-shaking.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (6)
packages/doom/assets/logo.svgis excluded by!**/*.svgpackages/export/pyodide/pyodide.asm.wasmis excluded by!**/*.wasmpackages/export/pyodide/pyodide.js.mapis excluded by!**/*.mappackages/export/pyodide/pyodide.mjs.mapis excluded by!**/*.mappackages/export/pyodide/python_stdlib.zipis excluded by!**/*.zipyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (30)
.changeset/dull-jeans-stare.md(1 hunks).github/workflows/pkg-pr-new.yml(1 hunks).prettierignore(1 hunks)eslint.config.js(1 hunks)package.json(3 hunks)packages/doom/package.json(1 hunks)packages/doom/src/cli/export.ts(1 hunks)packages/doom/tsconfig.json(1 hunks)packages/export/package.json(1 hunks)packages/export/src/export-pdf-core/generatePdf.ts(1 hunks)packages/export/src/export-pdf-core/index.ts(1 hunks)packages/export/src/export-pdf-core/utils/index.ts(1 hunks)packages/export/src/export-pdf-core/utils/mergePDF.ts(1 hunks)packages/export/src/helpers.ts(1 hunks)packages/export/src/html-export-pdf/core/index.ts(1 hunks)packages/export/src/html-export-pdf/core/printer.ts(1 hunks)packages/export/src/html-export-pdf/index.ts(1 hunks)packages/export/src/html-export-pdf/utils/getDirname.ts(1 hunks)packages/export/src/html-export-pdf/utils/index.ts(1 hunks)packages/export/src/index.ts(1 hunks)packages/export/src/merge-pdfs/index.ts(1 hunks)packages/export/tsconfig.json(1 hunks)src/cli/export-pdf-core/index.ts(0 hunks)src/cli/export-pdf-core/utils/index.ts(0 hunks)src/cli/html-export-pdf/core/index.ts(0 hunks)src/cli/html-export-pdf/index.ts(0 hunks)src/cli/html-export-pdf/utils/index.ts(0 hunks)src/tsconfig.json(0 hunks)tsconfig.base.json(1 hunks)tsconfig.json(1 hunks)
💤 Files with no reviewable changes (6)
- src/cli/export-pdf-core/index.ts
- src/cli/html-export-pdf/index.ts
- src/cli/export-pdf-core/utils/index.ts
- src/tsconfig.json
- src/cli/html-export-pdf/core/index.ts
- src/cli/html-export-pdf/utils/index.ts
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:10:41.010Z
Learning: The alauda/doom project uses yarn v4 as the package manager, not npm. Always reference yarn commands when suggesting package management operations.
📚 Learning: 2025-05-26T08:59:41.491Z
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from 'rspress/core/theme'` are valid even if ESLint shows resolution errors.
Applied to files:
packages/export/src/html-export-pdf/index.ts
📚 Learning: 2025-05-26T09:09:21.339Z
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `rspress/core/theme` work without any ESLint errors.
Applied to files:
.changeset/dull-jeans-stare.mdtsconfig.jsonpackages/export/package.jsonpackage.jsonpackages/doom/package.json
📚 Learning: 2025-05-12T11:11:41.048Z
Learnt from: JounQin
PR: alauda/doom#9
File: src/cli/load-config.ts:27-27
Timestamp: 2025-05-12T11:11:41.048Z
Learning: The yoctocolors package is used in the codebase for colored terminal output, with the cyan function imported in src/cli/load-config.ts.
Applied to files:
packages/export/src/merge-pdfs/index.ts
📚 Learning: 2025-06-09T03:10:41.010Z
Learnt from: JounQin
PR: alauda/doom#75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:10:41.010Z
Learning: The alauda/doom project uses yarn v4 as the package manager, not npm. Always reference yarn commands when suggesting package management operations.
Applied to files:
packages/export/package.jsonpackage.jsonpackages/doom/package.json
📚 Learning: 2025-05-29T16:25:28.086Z
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from 'rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Applied to files:
packages/export/src/html-export-pdf/utils/index.ts
📚 Learning: 2025-05-26T09:09:21.339Z
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for rspress/core subpath imports.
Applied to files:
package.jsonpackages/doom/package.json
📚 Learning: 2025-06-06T07:08:55.881Z
Learnt from: JounQin
PR: alauda/doom#69
File: package.json:101-101
Timestamp: 2025-06-06T07:08:55.881Z
Learning: When a package has peer dependencies that require TypeScript (like `eslint-react/eslint-plugin`), TypeScript should be moved from devDependencies to dependencies to satisfy the peer dependency requirement.
Applied to files:
package.json
🧬 Code graph analysis (1)
packages/export/src/helpers.ts (1)
packages/doom/src/utils/constants.ts (2)
BASE_DIR(4-4)PKG_DIR(6-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
- GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
- GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
🔇 Additional comments (13)
packages/export/src/helpers.ts (1)
8-9: Scope check: ensure this Node-only helper isn’t imported in browser bundles.
fileURLToPath(import.meta.url)assumes afile:URL and a Node ESM context. If any consumer bundles this module for browser runtimes, it will break. If it’s strictly used by the CLI/server-side export code, you’re good—just confirm usage boundaries.packages/export/src/merge-pdfs/index.ts (1)
5-6: Import path and asset inclusion verified
- Confirmed that
packages/export/pyodide/pyodide.js(and its.map) exist in the repository.- Verified that the
packages/export/package.json“files” array includes thepyodidedirectory, ensuring the asset will be published.All set for publishing.
packages/export/package.json (1)
24-31: Sanity-check: Playwright as a hard dependency.Given this package performs PDF exports headlessly, bundling playwright is reasonable but heavy. If you expect users to import only helpers without running the export, consider making playwright an optionalDependency with runtime checks. If export is the primary purpose, current placement is fine.
packages/doom/package.json (2)
16-25: Confirm intentional omission of root export in package.json
- Verified that no internal files import the package by its bare specifier (
@alauda/doom), so omitting the"."export doesn’t break any in-repo code.- If external consumers need to do
import '@alauda/doom', you’ll need to add a root export. Otherwise, keeping only subpath exports is fine.Recommended diff (if you want to support root imports):
"exports": { + ".": "./lib/index.js", "./config": "./lib/config.js", "./cspell": "./lib/cspell.js", "./eslint": "./lib/eslint.js", "./runtime": "./lib/runtime/index.js", "./theme": "./lib/theme.js", "./types": "./lib/types.js", "./package.json": "./package.json" }
26-31: global.d.ts presence confirmed in package files
- packages/doom/global.d.ts exists in the repository.
- "global.d.ts" is listed in the
filesarray of packages/doom/package.json (lines 26–31).No further action required.
package.json (3)
9-13: Monorepo scaffolding LGTM.private + workspaces + pinned Yarn v4 are set correctly. Matches prior Yarn v4 usage in this repo.
15-22: Script rewires look correct for the new layout.tsc -b at root and the dev/doom script paths now target packages/doom sources. Release via changesets is aligned with workspaces.
Also applies to: 28-28
66-74: Type coverage ignore patterns updated appropriately.Switching to globbing under packages/* ensures emitted d.ts and pyodide assets stay out of coverage. Good catch.
packages/doom/tsconfig.json (1)
1-10: Per-package tsconfig looks correct for composite buildsExtends the base, sets composite + outDir/lib + rootDir/src. This aligns with a Yarn v4 monorepo and tsc project references.
packages/export/src/html-export-pdf/core/printer.ts (1)
14-16: Switch to.tsspecifiers looks good; ensure TS config supports it.This relies on
allowImportingTsExtensions: truein your TS config (ideally the base config). See my tsconfig.json comment.packages/doom/src/cli/export.ts (1)
4-9: Verified: Dependency & TS Path Mapping Are Correct
packages/doom/package.jsondeclares"@alauda/doom-export": "^0.0.0"underdependencies, satisfying Yarn v4 PnP requirements.- Root
tsconfig.jsonincludes a"paths"mapping for"@alauda/doom-export"→["./packages/export/src/index.ts"], ensuring imports resolve to the local source during development.All checks pass—these changes are ready to merge.
packages/export/src/export-pdf-core/utils/index.ts (1)
1-3: Barrel looks good; confirm TS extension import support.Re-exports with
./*.tsrequireallowImportingTsExtensions. See tsconfig comment. If you don’t need to publish these as.tssubpaths, you could also drop the extensions in the source and let NodeNext resolution handle it.tsconfig.json (1)
6-10: Paths and project references look correct for the new monorepo.
- Path aliases point to per-package sources which is fine with project references.
- Reference order builds
exportbeforedoom, matching the dependency direction (doom → doom-export).Also applies to: 12-19
close #10
Summary by CodeRabbit
New Features
Chores
CI
Maintenance
Notes