Skip to content

Commit

Permalink
Release v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Sep 29, 2021
1 parent 13f87ba commit fa3096c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions dist/w3c-html-validator.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! W3C HTML Validator v0.7.9 ~ github.com/center-key/w3c-html-validator ~ MIT License
//! w3c-html-validator v0.8.0 ~ https://github.com/center-key/w3c-html-validator ~ MIT License

export declare type ValidatorOptions = {
html?: string;
Expand Down Expand Up @@ -36,8 +36,8 @@ export declare type ValidatorResults = {
};
export declare type ValidatorResultsOutput = ValidatorResults['output'];
export declare type ReporterOptions = {
maxMessageLen?: number;
title?: string;
maxMessageLen?: number | null;
title?: string | null;
};
declare const w3cHtmlValidator: {
version: string;
Expand Down
4 changes: 2 additions & 2 deletions dist/w3c-html-validator.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! W3C HTML Validator v0.7.9 ~ github.com/center-key/w3c-html-validator ~ MIT License
//! w3c-html-validator v0.8.0 ~ https://github.com/center-key/w3c-html-validator ~ MIT License

import { readFileSync } from 'fs';
import chalk from 'chalk';
import log from 'fancy-log';
import request from 'superagent';
const w3cHtmlValidator = {
version: '0.7.9',
version: '0.8.0',
validate(options) {
const defaults = {
checkUrl: 'https://validator.w3.org/nu/',
Expand Down
12 changes: 6 additions & 6 deletions dist/w3c-html-validator.umd.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! W3C HTML Validator v0.7.9 ~ github.com/center-key/w3c-html-validator ~ MIT License
//! w3c-html-validator v0.8.0 ~ https://github.com/center-key/w3c-html-validator ~ MIT License

var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
Expand All @@ -20,7 +20,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
const fancy_log_1 = __importDefault(require("fancy-log"));
const superagent_1 = __importDefault(require("superagent"));
const w3cHtmlValidator = {
version: '0.7.9',
version: '0.8.0',
validate(options) {
const defaults = {
checkUrl: 'https://validator.w3.org/nu/',
Expand All @@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
if (settings.output !== 'json' && settings.output !== 'html')
throw Error('Option "output" must be "json" or "html".');
const mode = settings.html ? 'html' : settings.filename ? 'filename' : 'website';
const readFile = () => settings.filename ? fs_1.readFileSync(settings.filename, 'utf8') : null;
const readFile = () => settings.filename ? (0, fs_1.readFileSync)(settings.filename, 'utf8') : null;
const inputHtml = settings.html || readFile();
const makePostRequest = () => superagent_1.default.post(settings.checkUrl)
.set('Content-Type', 'text/html; encoding=utf-8')
Expand Down Expand Up @@ -90,7 +90,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
const title = settings.title ?? results.title;
const fail = 'fail (messages: ' + messages.length + ')';
const status = results.validates ? chalk_1.default.green('pass') : chalk_1.default.red.bold(fail);
fancy_log_1.default(chalk_1.default.blue.bold(title), chalk_1.default.gray('validation:'), status);
(0, fancy_log_1.default)(chalk_1.default.blue.bold(title), chalk_1.default.gray('validation:'), status);
const typeColorMap = {
error: chalk_1.default.red.bold,
warning: chalk_1.default.yellow.bold,
Expand All @@ -102,9 +102,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
const location = `line ${message.lastLine}, column ${message.firstColumn}:`;
const lineText = message.extract?.replace(/\n/g, '\\n');
const maxLen = settings.maxMessageLen ?? undefined;
fancy_log_1.default(typeColor('HTML ' + type + ':'), message.message.substring(0, maxLen));
(0, fancy_log_1.default)(typeColor('HTML ' + type + ':'), message.message.substring(0, maxLen));
if (message.lastLine)
fancy_log_1.default(chalk_1.default.gray(location), chalk_1.default.cyan(lineText));
(0, fancy_log_1.default)(chalk_1.default.gray(location), chalk_1.default.cyan(lineText));
};
messages.forEach(logMessage);
return results;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "w3c-html-validator",
"version": "0.7.9",
"version": "0.8.0",
"description": "A package for testing HTML files or URLs against the W3C validator (written in TypeScript)",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion w3c-html-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export type ReporterOptions = {

const w3cHtmlValidator = {

version: '{{{version}}}',
version: '~~~version~~~',

validate(options: ValidatorOptions): Promise<ValidatorResults> {
const defaults = {
Expand Down

0 comments on commit fa3096c

Please sign in to comment.