Open philsturgeon opened 2 years ago
This works somewhat as expected, although the expected behavior might be indeed not the most of folks would expect.
Basically anytime you load a ruleset over http/https, all imports you have in your ruleset must have http/https
either, so they need to go through some CDN service, etc. This is in line with how ESM works in the browser.
However, we do make one exception - @stoplight/spectral-*
imports can be loaded without http/https
as they are treated a bit differently.
I'll have a look at it tomorrow to see if we can handle that in a better way.
I'm not sure your reply lines up with what my understanding of the problem is. You are talking about what happens when you load the ruleset right? But we have not yet loaded the ruleset, it cannot even find the ruleset.
I am trying to load:
https://unpkg.com/@apisyouwonthate/style-guide@1.1/dist/ruleset.js
As you can see using the httpie example above (or use curl) that GET request is redirecting to:
https://unpkg.com/@apisyouwonthate/style-guide@1.1.4/dist/ruleset.js
Sadly Spectral isn't following that redirect.
I meant the error here Error #1: Could not load https://unpkg.com/@apisyouwonthate/style-guide@1.1.4/dist/@stoplight/types (imported by https://unpkg.com/@apisyouwonthate/style-guide@1.1.4/dist/ruleset.js): Error fetching https://unpkg.com/@apisyouwonthate/style-guide@1.1.4/dist/@stoplight/types: Not Found
or is there something else happening?
Error being reported over here https://github.com/stoplightio/spectral-owasp-ruleset/issues/14
Describe the bug
When using Unpkg (which I need to do to use my NPM-based style guide in CLI, VS Code, and Studio) I am getting Not Found if I use a version alias, possiibly because it's not following redirects.
This will let me set a version requirement that I am happy with, instead of having to update the patch number every time a bug fix is made.
To Reproduce
.spectral.yaml
with `extends: ["https://unpkg.com/@apisyouwonthate/style-guide@1.1/dist/ruleset.js"]Expected behavior
I would expect it to follow the redirect.