[astro-seo-schema] change build system to tsup#1283
Conversation
🦋 Changeset detectedLatest commit: d4d8a0c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
📝 WalkthroughWalkthroughRemoves the astro-build package and its CLI/build modules, migrates astro-seo-schema to tsup with updated package exports and type checks, updates devDependencies, deletes renovate.json, adds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/astro-seo-schema/package.json`:
- Around line 35-42: The package exports map only exposes ".", so imports like
"astro-seo-schema/jsonld" and direct imports of .astro components will fail;
update the package.json "exports" map to add a "./jsonld" entry that points to
the built jsonld artifacts (e.g., map "./jsonld": { "import":
"./dist/jsonld.js", "types": "./dist/jsonld.d.ts" }) and add subpath exports for
the distributed .astro components (e.g., map "./<name>.astro" or a components/*
pattern to the corresponding "./dist/*.astro" files) so consumers can resolve
the built jsonld (from src/jsonld.ts) and the copied .astro files; ensure the
referenced files (./dist/jsonld.js, ./dist/jsonld.d.ts, and ./dist/*.astro) are
produced by the tsup build.
🧹 Nitpick comments (3)
packages/astro-seo-schema/tsup.config.ts (2)
8-8: Consider disabling minification for a library package.Minifying a library makes it harder for consumers to debug issues and read stack traces. Sourcemaps help but aren't always loaded. Most library packages ship unminified code and leave minification to the consuming application's bundler.
Suggested change
- minify: true, + minify: false,
13-13:dts: false— type declarations rely on thetypecheckscript, notbuild.Since
dtsis disabled, running the package'sbuildscript alone won't produce.d.tsfiles. Declarations are only emitted as a side effect oftsc --declaration --emitDeclarationOnlyin thetypecheckscript. This works in the full turbo pipeline (turbo run build && turbo run typecheck), but localpnpm buildwithin the package directory won't produce a completedist/.Consider either enabling
dts: truein tsup, or moving declaration generation into thebuildscript to make the package self-contained.packages/astro-seo-schema/package.json (1)
22-27: Build script doesn't generate type declarations.As noted in the tsup config review, the
buildscript only runstsup, which hasdts: false. Declaration files (.d.ts) are generated bycheck-typesundertypecheck. This means the package'sbuildscript alone doesn't produce a publishabledist/— it relies ontypecheckbeing run afterward.Consider adding declaration generation to the
buildscript:Suggested change
- "build": "tsup", + "build": "tsup && tsc --declaration --emitDeclarationOnly",
| "exports": { | ||
| ".": { | ||
| "import": { | ||
| "types": "./dist/index.d.ts", | ||
| "default": "./dist/index.mjs" | ||
| "default": "./dist/index.js" | ||
| } | ||
| } | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check what's exported from index.ts — does it re-export jsonld?
echo "=== index.ts ==="
cat packages/astro-seo-schema/src/index.ts 2>/dev/null || echo "File not found"
echo ""
echo "=== jsonld.ts ==="
cat packages/astro-seo-schema/src/jsonld.ts 2>/dev/null || echo "File not found"
echo ""
echo "=== .astro files ==="
fd -e astro . packages/astro-seo-schema/src/ 2>/dev/null || echo "No .astro files found"
echo ""
echo "=== Full package.json exports section and build config ==="
sed -n '/"exports"/,/^ }/p' packages/astro-seo-schema/package.json 2>/dev/null || echo "Could not extract"
echo ""
echo "=== Check for tsup config ==="
cat packages/astro-seo-schema/tsup.config.ts 2>/dev/null || echo "Not found"
test -f packages/astro-seo-schema/tsup.config.js && cat packages/astro-seo-schema/tsup.config.js || echo "tsup.config.js not found"
echo ""
echo "=== Check package.json for tsup/build config in scripts or config section ==="
cat packages/astro-seo-schema/package.json | head -60Repository: codiume/orbit
Length of output: 4702
Missing export entries for jsonld and .astro files.
tsup is configured to build src/jsonld.ts as a separate entry point and copy .astro files to dist/, but the exports map only defines ".". Consumers using strict exports-based resolution (e.g., Node.js or modern bundlers) won't be able to import astro-seo-schema/jsonld or the Astro components directly. The check-exports script suppresses internal-resolution-error warnings, indicating these resolution failures are already known.
Since jsonld.ts is intentionally separate from index.ts (not re-exported), it needs an explicit export entry. Add corresponding export entries for both:
Suggested exports map
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
- }
+ },
+ "./jsonld": {
+ "import": {
+ "types": "./dist/jsonld.d.ts",
+ "default": "./dist/jsonld.js"
+ }
+ },
+ "./*.astro": "./dist/*.astro"
},🤖 Prompt for AI Agents
In `@packages/astro-seo-schema/package.json` around lines 35 - 42, The package
exports map only exposes ".", so imports like "astro-seo-schema/jsonld" and
direct imports of .astro components will fail; update the package.json "exports"
map to add a "./jsonld" entry that points to the built jsonld artifacts (e.g.,
map "./jsonld": { "import": "./dist/jsonld.js", "types": "./dist/jsonld.d.ts" })
and add subpath exports for the distributed .astro components (e.g., map
"./<name>.astro" or a components/* pattern to the corresponding "./dist/*.astro"
files) so consumers can resolve the built jsonld (from src/jsonld.ts) and the
copied .astro files; ensure the referenced files (./dist/jsonld.js,
./dist/jsonld.d.ts, and ./dist/*.astro) are produced by the tsup build.
There was a problem hiding this comment.
we don't want to expose "astro-seo-schema/jsonld"
Summary by CodeRabbit
New Features
Refactor
Chores
Documentation