mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
fix(cmd): point bundle-check aliases at pkg/spec/src
This commit is contained in:
1 parent
3a8eea78fd
commit
da9455cd5a
1 file changed
+12
-9
@@ -9,6 +9,17 @@ import (
|
||||
"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() {
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Fprintln(os.Stderr, "usage: bundle-check <spec.ts>")
|
||||
@@ -26,16 +37,8 @@ func main() {
|
||||
fmt.Fprintf(os.Stderr, "getwd: %v\n", err)
|
||||
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{
|
||||
EntryFile: entryFile,
|
||||
Aliases: map[string]string{
|
||||
"@sanderling/spec": specApiPath,
|
||||
"@sanderling/spec/defaults/properties": defaultPropertiesPath,
|
||||
},
|
||||
})
|
||||
result, err := bundleSpec(filepath.Join(repoRoot, "pkg/spec/src"), entryFile)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "bundle: %v\n", err)
|
||||
os.Exit(1)
|
||||
|
||||
Reference in new issue
Block a user