Giter VIP home page Giter VIP logo

visible's Introduction

ci codecov Maintainability NPM

🚧 This project is still working in progress and is not guaranteed to work properly.

Visible

Visible is a framework that helps developers to build better websites from the perspective of accessibility.

Visible ― Web Accessibility, Validate & Fix

Try out the web version!

Features

  • 🔎 Validation ― Visible can run fully automated validation based on the web standard ACT (Accessibility Conformance Testing) just by putting the URL. The result always comes out with highlighted codes and detailed messages so you can immediately start fixing the problem.
  • 🤖 Suggestion ― Unlike other test tools, we also provide suggestions that may help you to understand the a11y more. Suggestions are so flexible that you can create your own algorithm such as generating caption with an AI.
  • 🤓 Extensible ― Visible supports plugins which has been inspired by ESLint so you can create your own configs, rules, suggestions or even browsers! Plugins can be published via npm so you can share your own tips to other developers.
  • 👗 First-class CSS support ― Thanks to the CDP (Chrome Devtools Protocol), Visible can also report CSS issues with a highlight indicating which CSS declaration has caused the problem. This can be combined with a suggestion of course!
  • 💻 GUI and CLI ― Visible is also available on both an online demo and a command line. You can check the issue instantly by the GUI, or customize CLI and built into the pipeline.

Goals

Visible is designed to be an alternative to existing tools to help beginners who are not familiar with accessibility issues, effects, and ways to fix to understand it correctly.

Accessibility standards such as WCAG is defined in behavioral aspects, while programmers code the procedures. Many of the existing tools are not able to close the gap between behaviors and procedures, and it is the biggest difficulty for understanding the accessibility problems.

By combining the CDP and existing linter technologies, Visible can discover the location of code that is actually causing the problem. This design not only helps knowing line numbers but also used for suggestions and enhancing CSS supports.

Additionally, while most of the existing tools are scripts running on the browsers, Visible is a Node.js package consists of extensible modules like ESLint so you can share configurations and plugins and contribute to the web accessibility.

Installation (CLI)

Make sure that you have installed Node.js (LTS) and npm and then run the following command.

npm i @visi/core @visi/cli

By default, @visi/cli does not install any additional rules or drivers. So if you want to use Puppeteer as a driver and WCAG as a rule, you'd also need to run the command below.

npm i @visi/plugin-puppeteer @visi/plugin-wcag

Then, create a .visiblerc file. See documentation of config for the detail.

{
  "plugins": [
    "@visi/plugin-puppeteer",
    "@visi/plugin-wcag",
  ],
  "driver": "@visi/plugin-puppeteer",
  "rules": ["@visi/plugin-wcag"],
}

Finally, you can run visible command. You can use --help to show helps.

visible --url https://example.com

Similar Projects

  • Axe ― Accessibility testing tool maintained by Deque. Although they only work with DOM, It is highly accurate and a lot of users and has also adopted by Lighthouse and Webhint. Axe has contributed to the web accessibility a lot through projects like ACT, and has inspired many web developers (including me!)
  • Wave ― Accessibility testing service developed by WebAIM. Wave comes with rich web interface so you can immediately comprehend the issues. Wave is not open sourced, but has a web API.
  • Alfa ― Accessibility testing framework maintained by Siteimprove. Alfa is built on top of ACT like Visible, and has compatibility to EARL. Alfa is a one of Horizon 2020 project and funded by the European Union.
  • Acot ─ Accessibility testing framework. Acot uses the latest web standard AOM (Accessibility Object Model) provided by Puppeteer to detect problems. Acot has a plugin for working on Storybook.

Contribution

See CONTRIBUTING.md

Code of Conduct

See CODE_OF_CONDUCT.md

License

See LICENSE

visible's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar neet avatar takanakahiko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visible's Issues

Bump core version on web-server

  • update domain model
  • bump version
  • capture feature
  • GHってどんなデータ構造でdiffを保存してるんだろうか

Add diff view to the web UI

要件 Requirements

Detailed Reasons for Errors

エラーの詳細な説明。なぜダメなのかの理由も加える。 related to #20

Diff views

diff hunkを使ってどの行にどういうpatchを当てればよいか教えてくれる。github reviewに近い概念モデル

References

provides external links or hints for further information. such as a webpage of w3c

@visi/cli was not published at latest version

Hi 👋

I want to try visible via CLI but install @visi/cli was failed. The @visi/cli/dist/index.js was not included at published directory.

$ npm i -g @visi/cli
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/@visi/cli/dist/index.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/@visi/cli/dist/index.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

Now latest version is 0.0.1-rc1.
I hope that this project becomes more bigger and tell people importance of accessibility in web. Thank you!

Better API for @visi/core

Current Issues

  • Since Node.js and the browser processes are completely independent, we cannot send/receive any data but JSON-serializable ones.
  • Thus even if you could resolve plugin names from a config, we cannot send the module to the browser.

API draft

import { Rule } from "@visi/core";

export default {
  config: {},
  rules: [],
};

class MyRule extends Rule {
  audit(options = {}) {
    const config = this.getConfig();
    return {};
  }

  fix(options = {}) {
    const providers = this.getConfig().providers;
    return {};
  }
}

Introduce aggregation of DDD

By using aggregation concept from DDD I can use transaction feature of SQL with abstraction

Aggregation Roots

  • Source
  • Rule
  • Diagnosis
    • Report
      • Location
      • Pointer

in the future..

  • Rule
  • Diagnosis
    • Source
      • Report
        • Location

Allow configuring plugin per rule

Currently, we cannot resolve rule by names (requires new) so it is needed to add static properties to rules.

  • Level of error
  • Enable plugin per rule

Implement fixer API

Look of the API

It would be useful if I can implement fixer by using AST rather than the DOM because the problem is not always caused by the DOM, sometimes we may need to fix CSS issues too. So AST fixer may provide a consistency.

fix(ast: Node) {
  ast.push(anotherNode);
  return ast;
}

Provider

For fixing issues such as img-alt, we need to provide the way to convert media to another form. We do not guarantee that there's a matched provider because they're all optional.

interface Provider {
  imageToString(url: string): string;
}

class Rule {
  fixer() {
    this.provider.imageToString(...);
  }
}

できればASTとかwalkerとは疎結合にしたい & 言語またいで共通のAPIを提供したいけど、コスト高そう。

プロトコル間でASTのインスタンスを渡すのは難しいから、やっぱりpluginの仕様を考え直したほうが良いかもしれない。ソースコードを持てるのはNode.js側だから自ずとNode.js側にfixerが属することになる。

もしくは抽象化した操作だけを提供するとかかなぁ。

Draft: Mapping JSX to HTML

@kyasbal-1994 さんに未踏ジュニアの面談で訊かれたので

JSX Pragma

JSX Pragma(マジックコメント)でJSXを解釈する関数を入れ替えられる、emotionとかがやってる方法がある

そいつをファイルの先頭につけてマウントすれば、visible側でReactのマウント処理をフックできるから、マウント先のDOM⇆マウントされたJSXがマッピングできるはず

ネックになりそうなのはそのJSXをどうやって.jsxに紐づけるかだけど、CDPにスタックから元のファイルの行数を調べる機能があったはずなので、

  1. visibleでJSXの先頭にJSX PragmaをつけてReactの処理をフック
  2. ルール実行、レポートには普通にXpathでDOMの位置を書く
  3. Postprocessorとして、XpathからDOMを探して、DOMがキャッシュしてるマップにヒットするか確認
  4. ヒットしたらその関数のスタックを見て元のjsxの行数を当ててる(たぶん開発者ツール同様にソースマップも効くはず)
  5. レポートのpointerプロパティを書き換える

Plugin for popular Accessibility Requirements

  • WCAG 2.1 @visi/config-wcag
  • WAI-ARIA 1.1 @visi/config-wai-aria
  • HTML 5.2 @visi/config-html
  • EPUB Accessibility 1.0 @visi/config-epub
  • BBC HTML Accessibility Standards v2.0 @visi/config-bbc

@visi/web-ui is not rendered on the server-side

Decoupled components of web-ui is being not rendered, since Babel does not compile modules from node_modules and this means we cannot use styled components plugin of Babel

We can fix this problem by compiling packages from node_modules by nextjs’ Babel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.