@Override
    public Node toNode() {
        ObjectNode.Builder builder = Node.objectNodeBuilder()
                .withMember(WARNING_STR, "")
                .withMember(VERSION_NAME, version)
                .withMember(CONFIG_HASH_NAME, configHash)
                .withMember(REPOSITORIES_LIST_NAME, ArrayNode.fromStrings(repositories));

        ObjectNode.Builder artifactNodeBuilder = Node.objectNodeBuilder();
        for (LockedArtifact artifact : artifacts.values()) {
            artifactNodeBuilder.withMember(artifact.coordinates, artifact.toNode());
        }
        builder.withMember(ARTIFACT_LIST_NAME, artifactNodeBuilder.build());

        return builder.build();
    }
Loads lockfile from path if it exists.

@param path path of file to load as a lockfile
@return Lockfile if it exists otherwise Optional.empty().
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/LockFile.java