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 build package (used by sde dev and sde bundle) currently generates a {model}.json listing file (generated internally by sde generate --list) every time the model is compiled. This file is optional and not needed for most projects, but will be needed in cases where you want to provide custom lookup or gaming inputs at runtime (since it is used to determine the index/spec info for each variable you want to access).
The file can currently be accessed by reaching into the sde-prep/build directory, or copied to a location of your choice like this using a custom build plugin:
plugins: [// Copy the generated model listing to the app so that it can be loaded// at runtime{postGenerate: asynccontext=>{constsrcPath=joinPath(context.config.prepDir,'build','processed.json')constdstName='listing.json'conststagedFilePath=context.prepareStagedFile('model',dstName,generatedFilePath(),dstName)awaitcopyFile(srcPath,stagedFilePath)returntrue}}]
It would be better if we had a proper option in UserConfig that copies the file automatically in a post-generate step, so that the complex code above is not needed. Something like this:
/** * If defined, a JSON file that lists all dimensions and variables in the model will be * written to the provided path. This can be an absolute path, or if it is a relative * path it will be resolved relative to the `rootDir` for the project. */
outListingFile?: string
Using this option, the config above can be simplified down to:
outListingFile: 'src/generated/listing.json'
And the build process will take care of copying the generated file to the requested location.
The text was updated successfully, but these errors were encountered:
The build package (used by
sde dev
andsde bundle
) currently generates a{model}.json
listing file (generated internally bysde generate --list
) every time the model is compiled. This file is optional and not needed for most projects, but will be needed in cases where you want to provide custom lookup or gaming inputs at runtime (since it is used to determine the index/spec info for each variable you want to access).The file can currently be accessed by reaching into the
sde-prep/build
directory, or copied to a location of your choice like this using a custom build plugin:It would be better if we had a proper option in
UserConfig
that copies the file automatically in a post-generate step, so that the complex code above is not needed. Something like this:Using this option, the config above can be simplified down to:
outListingFile: 'src/generated/listing.json'
And the build process will take care of copying the generated file to the requested location.
The text was updated successfully, but these errors were encountered: