Replies: 4 comments 13 replies
-
Hey! The source of the function is here. There isn't any meaningful external dependency. |
Beta Was this translation helpful? Give feedback.
-
I've been attempting to build this using rollup and I'm running into an issue. I've installed rollup and rollup-plugin-typescript2 via npm. I made a rollup.config.js file that has the target of the oasUnusedComponent.ts file and a tsconfig-custom.build.json file that is similar to tsconfig.json but specifying an es2020 module rather than CommonJS. When I run 'npx rollup -c' in the repo, I get an error about '/karma/fsevents.ts' not being found. The file exists in the base repo but it is empty. In the package-lock.json file there is a reference to fsevents being installed as a node module but it is marked as optional. Fsevents isn't in the node_modules folder created when running rollup. I am testing with release v6.6.0. I pulled the fsevents package from the url in package-lock.json (the NPM registry) and it has a fsevents.d.ts file. Is it intdended to copy these contents into fsevents.ts? Or is there customized content for the package that needs to be used for the spectral build? This also appears to be an optional package from the package-lock.json file, so why is the rollup command failing on the missing file? |
Beta Was this translation helpful? Give feedback.
-
I've done some digging and learned the fsevents is only compatible with Mac-OS and will cause failures on other systems. I noticed that in the package-lock that while fsevents is marked as optional, there are other packages that have it as a requirement (chokidar, jest-haste-map, and rollup itself). I tried changing dependencies to optional for both fsevents, and the packages that had it listed as a dependency. I tried using yarn to install the packages and rollup as well and achieved the same error as before. I then tried clearing both yarn and npm caches, deleting the package-lock.json file, and tried again and still hit the same error. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
-
@P0lip we had discussed in our meeting about raising an issue for the conflict error I was getting when importing the oas ruleset at a specific version. I haven't seen that posted here and was curious if that had seen any progress? Thanks! |
Beta Was this translation helpful? Give feedback.
-
This is building off of my previous issue I posted here: #2323
I have a custom function and I am wanting to use a function included in the oas ruleset provided with spectral inside the custom function. I found a solution using the require() function for linting with spectral-cli by doing the following:
const {oasUnusedComponent} = require('@stoplight/spectral-rulesets/dist/oas/functions');
I'm also needing this to be functional in the browser however and since require() is a Node.js function, this solution does not work there. I'm aware that the oas ruleset exists in the js delivered to the browser, but it has been minified, so the path to calling the function is obfuscated and I'm not sure there's a reliable way to call it from there. Any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions