Feat/read actor json - #135
JuanGalilea wants to merge 8 commits into
Conversation
metalwarrior665
left a comment
There was a problem hiding this comment.
Let's debate once #129 is merged
|
|
||
| // #region schema | ||
|
|
||
| const TEST_UTILS_ACTOR_SCHEMA = z.object({ |
There was a problem hiding this comment.
These schemas should sync with #129, I like the way it is done there
| message: 'Expected only one of `dataset` or `datasets` to be set', | ||
| }); | ||
|
|
||
| export const ACTOR_JSON_SCHEMA = z.object({ |
There was a problem hiding this comment.
I don't see much reasons to parse the whole actor.json and also run some validations on it. The platform already validates it during build and it could get out of sync with us. We will just need a few fields that we can simply type
There was a problem hiding this comment.
yeah, we can reduce it. This is just a copy of the JsonSchema then turned into zod by clankers.
This one made me think tho, we might benefit of something like this being exposed as a library for our tools, since we read the actor.json in like 10 different places, and all of them have a different implementation of this.
There was a problem hiding this comment.
I think it is probably public if you ask Claude around apify-core
There was a problem hiding this comment.
yes, but not in a type-meaningful way 😭. Which a zod schema very much is
sort of refactor of the read flow.
Now reading the config also reads actor.json and adds it to the config for each one.
During that process all paths are also resolved so they can be just
readFile(whatever)instead of having to deal and think about how they behave relative to one another.Added a custom config file to
readConfigFilebut this is for ease of testing (which is still missing).Also added validation to files so we know for sure that they are correct and also what they may not have.
Structure is somewhat final (unless you disagree), so just roast the
bin/utils/*files as much as you want.TO-DO:
actor-config.ts