Current behavior:
When running the following command on windows (power shell, or git bash), the file provided for customFieldTypesParserPath cannot be imported.
storyblok generate-typescript-typedefs \
--sourceFilePaths ./components.json \
--destinationFilePath ./components.d.ts \
--JSONSchemaToTSOptionsPath ./jsonSchema.json \
--customFieldTypesParserPath ./fieldTypeParser.js`);
Expected behavior:
The generate-typescript-typedefs command should also work on windows machines.
Steps to reproduce:
Run an example with the customFieldTypesParserPath attribute defined.
Related code:
The reason for the problem is a import(resolve(...)), that is used here.
The reason is, that for esm imports posix paths should be used. To fix this, you need to import resolve from node:path/posix like so
import { resolve } from 'node:path/posix';
// ...
const customTypeParser = await import(resolve(path));
// ...