Closed bahmutov closed 3 years ago
Hey @bahmutov, this is an excellent question! The answer for now is no, there isn't a way to consume our SDKs via JS. You're free to do what you've posted above, but I fully expect all of the internals of our SDKs to change before 1.x. The only API we're currently committed to keeping the same is the CLI interface (and the Percy agent server).
1.x will absolutely make what you're wanting to do much easier. Right now @percy/agent
is a bit of a confused package. It's mostly a node CLI package but its default export is a browser DOM lib, which is why you have to do a deep require (require('@percy/agent/dist/services/agent-service')
). Soon this will be much better and everything will make a lot more sense (with docs too! 😃 )
Great, this is good plan, appreciate the response.
Hey @bahmutov! I know it's been a while, but we've got a new package for you to accomplish this: https://github.com/percy/cli/tree/master/packages/core
Percy agent will soon be deprecated and we'll be moving to @percy/cli
Nice!
Sent from my iPhone
On Jan 13, 2021, at 11:27, Robert DeLuca notifications@github.com wrote:
Hey @bahmutov! I know it's been a while, but we've got a new package for you to accomplish this: https://github.com/percy/cli/tree/master/packages/core
Percy agent will soon be deprecated and we'll be moving to @percy/cli
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Hi,
We have made https://github.com/cypress-io/netlify-plugin-cypress for Netlify testing, and already would like to run our static site and get visual Percy screenshots too. BUT we cannot do
percy exec --
because we are calling Cypress via its module API http://on.cypress.io/module-apiSo I looked at Percy Agent source and hacked this little example https://github.com/bahmutov/run-percy-via-module-api which works https://percy.io/cypress-io/jsnation-example/builds/4732333
You can see the code in https://github.com/bahmutov/run-percy-via-module-api/blob/master/index.js but it looks like this right now
But of course I would love to see an official documented way of using Percy from other Node modules