MyGit

tollwerk/fractal-tenon

Fork: 0 Star: 12 (更新于 1970-01-01 00:00:00)

license: MIT

Language: JavaScript .

Fractal component library tool (http://fractal.build) plugin for accessibility testing against Tenon (http://tenon.io)

最后发布版本: v1.0.0 ( 2019-08-18 12:47:07)

官方网址 GitHub网址

fractal-tenon NPM version NPM downloads Dependency Status Development Dependency Status

is a Fractal add-on that let's you test your components against Tenon for accessibility issues.

Installation

To add Tenon support to your Fractal instance, run

npm install fractal-tenon --save

Configuration

To add the Tenon tab to your component view and enable accessibility testing, you need to add some lines to your fractal.js project configuration:

'use strict';

const fractal = module.exports = require('@frctl/fractal').create();

/* Regular project configuration here ... */

// Require the Fractal theme and Tenon add-on libraries
const mandelbrot = require('@frctl/mandelbrot');
const tenon = require('fractal-tenon');

// Explicitly create a theme instance
const theme = mandelbrot(/* {...} */);

// Configure Tenon support
tenon(theme, {
    apiKey: '<TENON_API_KEY>',
    publicUrl: 'http://fractal.example.com'
});

// Let Fractal use the configured theme
fractal.web.theme(theme);

You need to provide two parameters to configure Tenon support:

  1. Tenon API Key: You will find this one under the "API Key" section on your tenon.io dashboard (account required).
  2. Public URL: Your Fractal instance needs to be publicly available for Tenon to fetch and test your components. Provide the fully qualified URL (including scheme and port if necessary).

If configured correctly, Fractal should show you a new panel labelled "Tenon" in your component view.

Tenon panel in Fractal

You may control its position by explicitly configuring the panels option of your Fractal theme (e.g. Mandelbrot):

const theme = mandelbrot({
    panels: ['html', 'view', 'tenon', 'info']
});

Hitting the "Test with Tenon" button will call Tenon and display a short version the issues found for your component. You may view the full test results on tenon.io;

Important Note

Please be aware that, due to the nature of the Tenon API, you should never make your Tenon connected Fractal instance available to the public. Tenon requires your private API key to be sent with every request, so you basically expose your secret key to anyone having access to your Fractal instance. You have been warned!

Docker Image

We provide an experimental Dockerfile for build a Docker image running a Fractal instance with Tenon support.

Known Problems

  • The client JavaScript involved requires you to use a fairly recent browser version
  • The module is in a very early stage and might have bugs. Please let me know if you spot one!

To-Do

  • Add tests

Changelog

Please refer to the changelog for a complete release history.

Legal

Copyright © 2019 Joschi Kuphal joschi@kuphal.net / @jkphl. fractal-tenon is licensed under the terms of the MIT license.

最近版本更新:(数据更新于 1970-01-01 00:00:00)

2019-08-18 12:47:07 v1.0.0

2017-06-11 05:29:36 v0.1.0

主题(topics):

a11y, a11y-testing, accessibility, components, fractal, styleguide

tollwerk/fractal-tenon同语言 JavaScript最近更新仓库

2024-11-22 16:46:00 meshery/meshery

2024-11-21 23:03:24 bia-pain-bache/BPB-Worker-Panel

2024-11-21 22:46:48 MHSanaei/3x-ui

2024-11-21 07:00:59 nodejs/node

2024-11-21 00:49:46 FortAwesome/Font-Awesome

2024-11-18 14:26:02 projectdiscovery/nuclei-templates