You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Salesforce CLI uses this package to ensure we don't break any of our --json output, which has been super useful, but I think I've found a bug in the library, I'm not sure where it is, but I think it's related to how a package defines exports in its package.json
so changing the type, but in a way that shouldn't matter since it's already an optional property. We then Pick a few properties off of that object for our final return type (that we use the parser to ensure remains the same) like
everything compiles in typescript, but when we run the generator on this, we get an error
Error: Invalid index "label"intype"any"
at /Users/william.ruemmele/projects/oclif/plugin-command-snapshot/node_modules/ts-json-schema-generator/src/NodeParser/IndexedAccessTypeNodeParser.ts:77:27
at Array.map (<anonymous>)
at IndexedAccessTypeNodeParser.createType (/Users/william.ruemmele/projects/oclif/plugin-command-snapshot/node_modules/ts-json-schema-generator/src/NodeParser/IndexedAccessTypeNodeParser.ts:62:42)
at ChainNodeParser.createType (/Users/william.ruemmele/projects/oclif/plugin-command-snapshot/node_modules/ts-json-schema-generator/src/ChainNodeParser.ts:35:54)
at /Users/william.ruemmele/projects/oclif/plugin-command-snapshot/node_modules/ts-json-schema-generator/src/NodeParser/MappedTypeNodeParser.ts:112:59
at Array.reduce (<anonymous>)
at MappedTypeNodeParser.getProperties (/Users/william.ruemmele/projects/oclif/plugin-command-snapshot/node_modules/ts-json-schema-generator/src/NodeParser/MappedTypeNodeParser.ts:111:14)
at MappedTypeNodeParser.createType (/Users/william.ruemmele/projects/oclif/plugin-command-snapshot/node_modules/ts-json-schema-generator/src/NodeParser/MappedTypeNodeParser.ts:42:22)
at ChainNodeParser.createType (/Users/william.ruemmele/projects/oclif/plugin-command-snapshot/node_modules/ts-json-schema-generator/src/ChainNodeParser.ts:35:54)
at TypeAliasNodeParser.createType (/Users/william.ruemmele/projects/oclif/plugin-command-snapshot/node_modules/ts-json-schema-generator/src/NodeParser/TypeAliasNodeParser.ts:40:43)
after lots of debugging, replacing values in node_modules, even reverting all changes and only changing the type file I haven't found a way past it.
The one thing I've found that works, is if I import from @salesforce/types/lib/metadata.js instead of @salesforce/types/metadata (this is the new package I've been moving things into)
The Salesforce CLI uses this package to ensure we don't break any of our
--json
output, which has been super useful, but I think I've found a bug in the library, I'm not sure where it is, but I think it's related to how a package definesexports
in itspackage.json
scenario:
we've been using this, in a node script
to generate our schemas. I've been moving types from one repo to another, these types are similar, except for a few minor differences, like changing
to
so changing the type, but in a way that shouldn't matter since it's already an optional property. We then
Pick
a few properties off of that object for our final return type (that we use the parser to ensure remains the same) likeeverything compiles in typescript, but when we run the generator on this, we get an error
after lots of debugging, replacing values in
node_modules
, even reverting all changes and only changing the type file I haven't found a way past it.The one thing I've found that works, is if I import from
@salesforce/types/lib/metadata.js
instead of@salesforce/types/metadata
(this is the new package I've been moving things into)this repo has
where as the original (working) repo, has no exports defined
The text was updated successfully, but these errors were encountered: