-- Prunes any stories and test files that are included with the DevModule. These
-- are not needed at runtime.

local function prune(instance: Instance)
    for _, descendant in ipairs(instance:GetDescendants()) do
        local name = descendant.Name
        if name:match(".story$") or name:match(".spec$") then
            descendant:Destroy()
        end
    end
end

local function getPackageVersion(package: ModuleScript)
    local version: StringValue = package:FindFirstChild(PACKAGE_VERSION_NAME)

    assert(version and version:IsA("StringValue"), PACKAGE_VERSION_OBJECT_MISSING
        :format(package.Name, PACKAGE_VERSION_NAME, package:GetFullName()))
    assert(version.Value ~= "", PACKAGE_VERSION_EMPTY:format(package.Name, version:GetFullName()))

    return version.Value
end
