fix(cmd): point bundle-check aliases at pkg/spec/src

This commit is contained in:
pj committed 2026-06-06 13:07:10 +05:30
1 parent 3a8eea78fd
commit da9455cd5a
1 file changed
+12 -9
+12 -9
View File
@@ -9,6 +9,17 @@ import (
"github.com/priyanshujain/sanderling/internal/bundler" "github.com/priyanshujain/sanderling/internal/bundler"
) )
func bundleSpec(specSrc, entryFile string) (bundler.Result, error) {
return bundler.Bundle(bundler.Options{
EntryFile: entryFile,
Aliases: map[string]string{
"@sanderling/spec": filepath.Join(specSrc, "index.ts"),
"@sanderling/spec/defaults": filepath.Join(specSrc, "defaults/index.ts"),
"@sanderling/spec/defaults/properties": filepath.Join(specSrc, "defaults/properties.ts"),
},
})
}
func main() { func main() {
if len(os.Args) < 2 { if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "usage: bundle-check <spec.ts>") fmt.Fprintln(os.Stderr, "usage: bundle-check <spec.ts>")
@@ -26,16 +37,8 @@ func main() {
fmt.Fprintf(os.Stderr, "getwd: %v\n", err) fmt.Fprintf(os.Stderr, "getwd: %v\n", err)
os.Exit(1) os.Exit(1)
} }
specApiPath := filepath.Join(repoRoot, "pkg/spec-api/src/index.ts")
defaultPropertiesPath := filepath.Join(repoRoot, "pkg/spec-api/src/defaults/properties.ts")
result, err := bundler.Bundle(bundler.Options{ result, err := bundleSpec(filepath.Join(repoRoot, "pkg/spec/src"), entryFile)
EntryFile: entryFile,
Aliases: map[string]string{
"@sanderling/spec": specApiPath,
"@sanderling/spec/defaults/properties": defaultPropertiesPath,
},
})
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "bundle: %v\n", err) fmt.Fprintf(os.Stderr, "bundle: %v\n", err)
os.Exit(1) os.Exit(1)