stevekuznetsov
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Gotcha, I'll try looking into that. Thank you so much for your help today
49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Or a good blog post to read ... ?
49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Assuming I'm a super-noob and don't know how to "transpile everything and run plain js files" - is there some equivalent to
npx ts-node
to run?49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
What is the slower way to run this script without
ts-node
?49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
I haven't learned enough to switch to anything else 😉
49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Is there some "slower" way to write the script (not using
ts-node
) that could re-use the babel
config?49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
So is it that
ts-node
is somehow doing transpilation on the fly, and not using babel
under the hood?49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Thank you so much - if you had to describe the interaction between
expo
, ts-node
and babel
in one sentence, what would that be? I am kind of totally lost on how these big picture things work49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Another dev on this project really liked the abolute imports from the babel config, instead of relative ones, but I am totally ambivalent.
49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
It would be nice to not have to collapse the entire module into one
.ts
file, but /shrug49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
That worked!
49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
One sec - originally it was failing to find the module itself since I was using an absolute import. I've switched it to use a relative import, which seems to work, but now it's failing on the absolute imports between files in that module. I'm removing those imports right now to see if it will work if the schemas module has no imports inside of it
49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
They're in a separate
schemas.ts
file that only imports zod
right now and some enums from an enums.ts
file next to it49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
I'm sorry, I don't know enough to answer either question, really - but as long as there's some reasonably-simple way to get both the script and the rest of the React Native project importing one common set of schemas, I don't have any other requirements on how those schemas are or are not separate
49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Do you mean separate the script from the rest of the repo, or separate the
.ts
file with schema definitions from the rest of the React Native?49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Sorry, could you be more precise? What I'm trying to do is to write a stand-alone script, but import the
zod
schema from the rest of the project to validate it49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
Is there something specific I need to do to get
ts-node
to honor this to allow imports to work as expected?49 replies
TTCTheo's Typesafe Cult
•Created by stevekuznetsov on 6/17/2023 in #questions
Validating Zod Schemas Against Static Data
@nyx (Rustular DevRel) thank you! I have written something simple, but am getting a module resolution error from
npx ts-node
... we've got this Babel config from whatever template:
49 replies