-- 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): string
	local version = package:FindFirstChild(constants.PACKAGE_VERSION_NAME)

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

	return version.Value
end
