Doc for developing (or debugging) c2pa-js
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.
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)
@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).
- Run
pnpm link --globalinc2pa-js/packages/c2pa - 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) - Run the following in
examples/minimal-ts-vite(to make sure it worked) -pnpm link --global c2pa - Run the example with
npm run dev
@emensch may also be able to chime in tomorrow with a better way of accomplishing this.
@adobe export issue to Jira project CAI
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/CAI-3385 is successfully created for this GitHub issue.