Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc for developing (or debugging) c2pa-js #46

Open
jingzhaoou opened this issue Jul 10, 2022 · 4 comments
Open

Doc for developing (or debugging) c2pa-js #46

jingzhaoou opened this issue Jul 10, 2022 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@jingzhaoou
Copy link

jingzhaoou commented Jul 10, 2022

I am interested in building things from scratch to get better understanding how things work together. For example, with the examples/react-ts-vite example, I hope to point to my local c2ps module by changing a few lines in package.json to look like the following

"dependencies": {
"@contentauth/react": "file:../../packages/react",
"c2pa": "file:../../packages/c2pa",
"c2pa-wc": "file:../../packages/c2pa-wc",
} ```
When running {**}yarn install{*}, it still forced me to install the official modules. Wonder if someone can give me some brief instructions how to do development with {*}c2pa-js{**}. Highly appreciated.
@jingzhaoou
Copy link
Author

I just tried yarn link and still no luck.

I first ran yarn link under c2pa-js/packages/c2pa. Then I ran yarn link c2pa under c2pa-js/examples/react-ts-vite. The c2pa folder under c2pa-js/examples/react-ts-vite/node_modules becomes a symbolic link. However, when I ran yarn dev, I got the following errors:

5:00:37 AM [vite] Internal server error: Failed to resolve entry for package "c2pa". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "c2pa". The package may have incorrect main/module/exports specified in its package.json.
  Plugin: vite:import-analysis
  File: /home/jou2019/workspace/c2pa-js/examples/react-ts-vite/src/main.tsx
      at packageEntryFailure (/home/jou2019/workspace/c2pa-js/examples/react-ts-vite/node_modules/vite/dist/node/chunks/dep-c9998dc6.js:40970:11)

@dkozma dkozma added the documentation Improvements or additions to documentation label Jul 11, 2022
@dkozma
Copy link

dkozma commented Jul 12, 2022

@jingzhaoou Thanks for bringing this up - we will be working on adding documentation for this. In order to get you moving forward, can you see if this works? (We recently switched from yarn/lerna to PNPM so some of the documentation may not be up to date).

  1. Run pnpm link --global in c2pa-js/packages/c2pa
  2. Clone our examples repo by running git clone [email protected]:contentauth/c2pa-js-examples.git (our current examples folder gets processed during the publishing step - will update the docs here as this can be confusing)
  3. Run the following in examples/minimal-ts-vite (to make sure it worked) - pnpm link --global c2pa
  4. Run the example with npm run dev

@emensch may also be able to chime in tomorrow with a better way of accomplishing this.

@crandmck
Copy link
Collaborator

@adobe export issue to Jira project CAI

@github-jira-sync-bot
Copy link
Collaborator

✅ Jira issue https://jira.corp.adobe.com/browse/CAI-3385 is successfully created for this GitHub issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants