function create_validator(options) {
	const { analyse_code, validate } = _create_validator(options);

	return {
		/**
		 * Checks a file content for problematic imports and things like `import.meta`
		 * @param {string} name
		 * @param {string} content
		 */
		analyse_code(name, content) {
			analyse_code(name, content);
		},
		validate() {
			/** @type {Record<string, any>} */
			const pkg = load_pkg_json(options.cwd);
			const warnings = validate(pkg);
			if (Object.keys(pkg).length === 0) {
				warnings.push(
					'No package.json found in the current directory. Please create one or run this command in a directory containing one.'
				);
			}

			// Just warnings, not errors, because
			// - would be annoying in watch mode (would have to restart the server)
			// - maybe there's a custom post-build script that fixes some of these
			if (warnings.length) {
				console.log(
					colors
						.bold()
						.yellow('@sveltejs/package found the following issues while packaging your library:')
				);
				for (const warning of warnings) {
					console.log(colors.yellow(`${warning}\n`));
				}
			}
		}
	};
}
@param {import("./types.js").Options} options