module Primer::Static

def self.dump(stats)

Generates the requested stat hash and outputs it to a file.
def self.dump(stats)
  File.open(File.join(DEFAULT_STATIC_PATH, FILE_NAMES[stats]), "w") do |f|
    f.write(JSON.pretty_generate(send("generate_#{stats}")))
    f.write($INPUT_RECORD_SEPARATOR)
  end
end

def self.generate_arguments

with their value, data type, and docstring.
a list of the arguments accepted by the component's constructor. Arguments are enumerated
Returns an array of hashes, one per Primer component, that contains some metadata and
def self.generate_arguments
  Static::GenerateArguments.call
end

def self.generate_audited_at

an accessibility audit.
Returns a hash mapping component names to the date on which the component passed
def self.generate_audited_at
  Static::GenerateAuditedAt.call
end

def self.generate_constants

the component's class.
Returns a hash mapping component names to an array of the constants defined inside
def self.generate_constants
  Static::GenerateConstants.call
end

def self.generate_info_arch

for the new primer.style docsite.
Returns an array of hashes, one per Primer component, that contains all the data needed
def self.generate_info_arch
  Static::GenerateInfoArch.call
end

def self.generate_previews

to each preview and its name.
an array of all the component's previews. The preview data contains the Lookbook URL
Returns an array of hashes, one per Primer component, that contains some metadata and
def self.generate_previews
  Static::GeneratePreviews.call
end

def self.generate_statuses

sorted alphabetically by the component name.
Returns a hash mapping component names to component statuses (alpha, beta, etc),
def self.generate_statuses
  Static::GenerateStatuses.call
end

def self.read(stats)

Returns the contents of the stat file.
def self.read(stats)
  File.read(File.join(DEFAULT_STATIC_PATH, FILE_NAMES[stats]))
end