Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support specs.json for specification files #52

Closed
1 of 3 tasks
FGRCL opened this issue May 8, 2024 · 0 comments · Fixed by #57
Closed
1 of 3 tasks

Support specs.json for specification files #52

FGRCL opened this issue May 8, 2024 · 0 comments · Fixed by #57
Assignees
Labels
enhancement New feature or request

Comments

@FGRCL
Copy link
Member

FGRCL commented May 8, 2024

Description of the requested feature:

The app currently looks for specs files names specs_v1.json it should be changed to specs.json

Brief explanation on why you want/need said feature:

The specs file's name shouldn't contain the spec version

Do you intend on coding this feature yourself?

No

Which zetaforge components would be affected by this new feature:

  • client
  • anvil
  • driver

Share any code snippets related to the feature here(optional):

This is one expample of loading a spec file

export async function saveBlockSpecs(blockPath, specs) {
  const specsPath = path.join(blockPath, "specs_v1.json");

  removeConnections(specs.inputs)
  removeConnections(specs.outputs)

  specs.views.node.pos_x = 0
  specs.views.node.pos_y = 0

  await fs.writeFile(specsPath, JSON.stringify(specs, null, 2))
}

Provide an API design for the feature(optional):

  • Support specs.json only
  • Support specs_v1.json and specs.json
  • Support any file that starts with specs and ends with .json
  • Pick the first file in the directory the respects the specification format
  • Use a custom file extension
@FGRCL FGRCL added the enhancement New feature or request label May 8, 2024
@FGRCL FGRCL self-assigned this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant