From ffea894324da8f3a993319e98a4bd652e8145a15 Mon Sep 17 00:00:00 2001 From: Matt Rosno Date: Thu, 25 Apr 2019 09:09:58 -0500 Subject: [PATCH 1/2] docs(spec): north star spec reporting --- docs/component-specs.md | 3 +++ docs/component-status.md | 37 +++++++++++++++++++++++++++++++++++++ docs/components/button.md | 29 +++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 docs/component-specs.md create mode 100644 docs/component-status.md create mode 100644 docs/components/button.md diff --git a/docs/component-specs.md b/docs/component-specs.md new file mode 100644 index 0000000..26259cb --- /dev/null +++ b/docs/component-specs.md @@ -0,0 +1,3 @@ +# To do + +A giant page of all component spec rules so you can anchor link to failing tests here diff --git a/docs/component-status.md b/docs/component-status.md new file mode 100644 index 0000000..a591828 --- /dev/null +++ b/docs/component-status.md @@ -0,0 +1,37 @@ +# Components + +## Core components + +| | Vanilla | React | Angular | Vue | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| Package | [@carbon/components](https://www.npmjs.com/package/carbon-components) | [@carbon/react](https://www.npmjs.com/package/carbon-components-react) | [@carbon/angular](https://www.npmjs.com/package/carbon-components-angular) | [@carbon/vue](https://www.npmjs.com/package/@carbon/vue) | +| Status | ![Carbon Vanilla](https://img.shields.io/npm/dw/carbon-components.svg)
![Carbon Button](https://img.shields.io/npm/v/carbon-components.svg) | ![Carbon React](https://img.shields.io/npm/dw/carbon-components-react.svg)
![Carbon Button React](https://img.shields.io/npm/v/carbon-components-react.svg) | ![Carbon Angular](https://img.shields.io/npm/dw/carbon-components-angular.svg)
![Carbon Button Angular](https://img.shields.io/npm/v/carbon-components-angular.svg) | ![Carbon Vue](https://img.shields.io/npm/dw/@carbon/vue.svg)
![Carbon Button Vue](https://img.shields.io/npm/v/@carbon/vue.svg) | +| Maintainers | [@carbon-design-system/core-team]() | [@carbon-design-system/core-team]() | [@carbon-design-system/angular-team](), [@user1]() | [@user2]() | + +| | Specification | Vanilla | React | Angular | Vue | +| -------------------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | +| [Accordion](/components/accordion.md) | ![WCAG 2.0 Level A](https://img.shields.io/badge/spec-a-blue.svg) | ![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | ![Spec passing with warnings](https://img.shields.io/badge/spec-warning-yellow.svg) | ![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | ![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | +| [Breadcrumb](/componentsbreadcrumb.md) | ![WCAG 2.0 Level AA](https://img.shields.io/badge/spec-aa-blue.svg) | ![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | ![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | | ![Spec failing](https://img.shields.io/badge/spec-failing-red.svg) | +| [Button](/components/button.md) | ![WCAG 2.0 Level A](https://img.shields.io/badge/spec-a-blue.svg) | ![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | ![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | ![Status new](https://img.shields.io/badge/status-new-blueviolet.svg)
![Spec passing with warnings](https://img.shields.io/badge/spec-warning-yellow.svg) | ![Spec failing](https://img.shields.io/badge/spec-failing-red.svg) | + +## Community components + +| | Specification | Vanilla | React | Angular | Vue | +| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --- | +| [Carousel](/components/carousel.md) | ![Status deprecated](https://img.shields.io/badge/status-deprecated-4c4c4c.svg) | | ![Status deprecated](https://img.shields.io/badge/status-deprecated-4c4c4c.svg)
![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | | | +| [Hero](/components/hero.md) | ![Status experimental](https://img.shields.io/badge/status-experimental-orange.svg)
![WCAG 2.0 Level A](https://img.shields.io/badge/spec-a-blue.svg) | | | ![Status new](https://img.shields.io/badge/status-new-blueviolet.svg)
![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | | + +## Legend + +| Mark | Description | +| ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| ![Status draft](https://img.shields.io/badge/status-draft-lightgray.svg) | Specification or implementation is under construction | +| ![Status deprecated](https://img.shields.io/badge/status-deprecated-4c4c4c.svg) | Specification or implementation is no longer supported; will get removed in next major version | +| ![Status experimental](https://img.shields.io/badge/status-experimental-orange.svg) | Specification or implementation can be used but is not considered stable; changes may occur | +| ![Status new](https://img.shields.io/badge/status-new-blueviolet.svg) | Specification or implementation is new in the last major version | +| ![WCAG 2.0 level A](https://img.shields.io/badge/spec-a-blue.svg) | Implementation conforms to WCAG 2.0 Level A if passing all specification tests | +| ![WCAG 2.0 level AA](https://img.shields.io/badge/spec-aa-blue.svg) | Implementation conforms to WCAG 2.0 Level AA if passing all specification tests | +| ![WCAG 2.0 level AAA](https://img.shields.io/badge/spec-aaa-blue.svg) | Implementation conforms to WCAG 2.0 Level AAA if passing all specification tests | +| ![Spec passing](https://img.shields.io/badge/spec-passing-brightgreen.svg) | All specification tests are passing | +| ![Spec passing with warnings](https://img.shields.io/badge/spec-warning-yellow.svg) | All specification tests are passing but there are warnings | +| ![Spec failing](https://img.shields.io/badge/spec-failing-red.svg) | At least one specification test is failing | diff --git a/docs/components/button.md b/docs/components/button.md new file mode 100644 index 0000000..1e4dd9f --- /dev/null +++ b/docs/components/button.md @@ -0,0 +1,29 @@ +# Button + +## Specification + +![WCAG 2.0 level A](https://img.shields.io/badge/spec-a-blue.svg) + +- **Category**: [Core component](../component-status.md#core-components) +- **Maintainers**: [@carbon-design-system/core-team](), [@user1](), [@user2]() + +## Packages + +| | Vanilla | React | Angular | Vue | +| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | +| Package | [@carbon/button](#link) | [@carbon/button-react](#link) | [@carbon/button-angular](#link) | [@carbon/button-vue](#link) | +| Status | ![Carbon Button](https://img.shields.io/npm/dw/carbon-components.svg)
![Carbon Button](https://img.shields.io/npm/v/carbon-components.svg) | ![Carbon Button React](https://img.shields.io/npm/dw/carbon-components-react.svg)
![Carbon Button React](https://img.shields.io/npm/v/carbon-components-react.svg) | ![Carbon Button Angular](https://img.shields.io/npm/dw/carbon-components-angular.svg)
![Carbon Button Angular](https://img.shields.io/npm/v/carbon-components-angular.svg)
![Status new](https://img.shields.io/badge/status-new-blueviolet.svg) | ![Carbon Button Vue](https://img.shields.io/npm/dw/@carbon/vue.svg)
![Carbon Button Vue](https://img.shields.io/npm/v/@carbon/vue.svg) | +| Maintainers | [@carbon-design-system/core-team]() | [@carbon-design-system/core-team]() | [@carbon-design-system/angular-team](), [@user1]() | [@user2]() | + +## Specification test results + +| | Type | Vanilla | React | Angular | Vue | +| --------- | -------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| General | - | ![](https://img.shields.io/badge/spec-%E2%9C%94%209-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%209-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%209-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%209-brightgreen.svg) | +| Primary | variant | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | +| Secondary | variant | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | +| Tertiary | variant | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | +| Ghost | variant | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | +| Danger | variant | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%201-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%98%201-red.svg) | +| Small | modifier | ![](https://img.shields.io/badge/spec-%E2%9C%94%202-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%202-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%202-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%98%202-red.svg) | +| Disabled | state | ![](https://img.shields.io/badge/spec-%E2%9C%94%202-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%202-brightgreen.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%202%20%7C%20!%201-yellow.svg) | ![](https://img.shields.io/badge/spec-%E2%9C%94%202-brightgreen.svg) | From d4cabbe03fc1d79d3fb285c3b422fbe1e09bdb8e Mon Sep 17 00:00:00 2001 From: Matt Rosno Date: Mon, 29 Apr 2019 13:47:38 -0500 Subject: [PATCH 2/2] docs(spec): accordion files --- docs/dependencies.md | 33 --------- packages/accordion-react/package.json | 0 .../accordion-react/test/spec-results.json | 0 packages/accordion-spec/README.md | 0 packages/accordion-spec/_mixins.scss | 0 packages/accordion-spec/_variables.scss | 0 packages/accordion-spec/a11y.md | 0 packages/accordion-spec/config.js | 0 packages/accordion-spec/demo.js | 0 packages/accordion-spec/index.js | 0 packages/accordion-spec/index.scss | 0 packages/accordion-spec/package.json | 19 ++++++ packages/accordion-spec/requirements.js | 0 packages/accordion-spec/requirements.md | 0 packages/accordion-spec/selectors.js | 0 packages/accordion-spec/ux.md | 0 src/__tests__/runner-test.js | 36 ---------- src/error.js | 8 --- src/index.js | 10 --- src/rules/accordion.js | 19 ------ src/rules/index.js | 10 --- src/runner.js | 52 -------------- tasks/jest/cssTransform.js | 21 ------ tasks/jest/fileTransform.js | 19 ------ tasks/jest/jsTransform.js | 33 --------- tasks/jest/setup.js | 12 ---- tasks/rollup/config.js | 68 ------------------- 27 files changed, 19 insertions(+), 321 deletions(-) delete mode 100644 docs/dependencies.md create mode 100644 packages/accordion-react/package.json create mode 100644 packages/accordion-react/test/spec-results.json create mode 100644 packages/accordion-spec/README.md create mode 100644 packages/accordion-spec/_mixins.scss create mode 100644 packages/accordion-spec/_variables.scss create mode 100644 packages/accordion-spec/a11y.md create mode 100644 packages/accordion-spec/config.js create mode 100644 packages/accordion-spec/demo.js create mode 100644 packages/accordion-spec/index.js create mode 100644 packages/accordion-spec/index.scss create mode 100644 packages/accordion-spec/package.json create mode 100644 packages/accordion-spec/requirements.js create mode 100644 packages/accordion-spec/requirements.md create mode 100644 packages/accordion-spec/selectors.js create mode 100644 packages/accordion-spec/ux.md delete mode 100644 src/__tests__/runner-test.js delete mode 100644 src/error.js delete mode 100644 src/index.js delete mode 100644 src/rules/accordion.js delete mode 100644 src/rules/index.js delete mode 100644 src/runner.js delete mode 100644 tasks/jest/cssTransform.js delete mode 100644 tasks/jest/fileTransform.js delete mode 100644 tasks/jest/jsTransform.js delete mode 100644 tasks/jest/setup.js delete mode 100644 tasks/rollup/config.js diff --git a/docs/dependencies.md b/docs/dependencies.md deleted file mode 100644 index 01af59c..0000000 --- a/docs/dependencies.md +++ /dev/null @@ -1,33 +0,0 @@ -# Installing dependencies - -> Guidelines for how to install dependencies in this project - - - - -## Table of Contents - -- [Overview](#overview) -- [Continuous Integration](#continuous-integration) -- [FAQ](#faq) - - [How do I install a dependency?](#how-do-i-install-a-dependency) - - - - -# Overview - -In light of potential `npm` security issues [[1]](https://blog.npmjs.org/post/175824896885/incident-report-npm-inc-operations-incident-of) [[2]](https://eslint.org/blog/2018/07/postmortem-for-malicious-package-publishes), we are addressing some of the issues with installing dependencies from a live registry by taking advantage of [Yarn's offline feature](https://yarnpkg.com/blog/2016/11/24/offline-mirror/). The majority of steps taken are inspired by [this tweet](https://twitter.com/leeb/status/1017607265115750400) from Lee Byron. - -# Continuous Integration - -We specify a `.yarnc` file in this project that sets the path for Yarn's offline mirror to the folder `.yarn-offline-mirror`. This folder contains all the tarballs for the packages that the project uses. What this allows us to do is run `yarn install --offline` in our Continuous Integration environment so that we don't have to fetch from the live registry in our builds. - -# FAQ - -## How do I install a dependency? - -When installing a dependency, you can just do `yarn add ` as -normal. The only difference now is that you also will check in the corresponding -tarball entry in `.yarn-offline-mirror` as well so that we don't have to fetch -this dependency from the live registry during Continuous Integration builds. diff --git a/packages/accordion-react/package.json b/packages/accordion-react/package.json new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-react/test/spec-results.json b/packages/accordion-react/test/spec-results.json new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/README.md b/packages/accordion-spec/README.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/_mixins.scss b/packages/accordion-spec/_mixins.scss new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/_variables.scss b/packages/accordion-spec/_variables.scss new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/a11y.md b/packages/accordion-spec/a11y.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/config.js b/packages/accordion-spec/config.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/demo.js b/packages/accordion-spec/demo.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/index.js b/packages/accordion-spec/index.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/index.scss b/packages/accordion-spec/index.scss new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/package.json b/packages/accordion-spec/package.json new file mode 100644 index 0000000..de90dc1 --- /dev/null +++ b/packages/accordion-spec/package.json @@ -0,0 +1,19 @@ +{ + "name": "@carbon/accordion-spec", + "private": true, + "description": "The accordion specification for the Carbon Design System", + "version": "0.0.0", + "license": "Apache-2.0", + "carbon": { + "createdAt": "9.0.0", + "deprecatedAt": "10.0.0", + "maintainers": [ + "@carbon-design-system/core-team", + "@user1", + "@user2" + ], + "status": "draft", + "type": "core", + "wcag20": "a" + } +} diff --git a/packages/accordion-spec/requirements.js b/packages/accordion-spec/requirements.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/requirements.md b/packages/accordion-spec/requirements.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/selectors.js b/packages/accordion-spec/selectors.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/accordion-spec/ux.md b/packages/accordion-spec/ux.md new file mode 100644 index 0000000..e69de29 diff --git a/src/__tests__/runner-test.js b/src/__tests__/runner-test.js deleted file mode 100644 index 4eb19dc..0000000 --- a/src/__tests__/runner-test.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - * - * @jest-environment node - */ - -import { createRunner } from '../runner'; - -describe('createRunner', () => { - it('should call beforeEach and afterEach for each rule check', () => { - const calls = []; - const beforeEach = jest.fn(() => { - calls.push('before'); - }); - const afterEach = jest.fn(() => { - calls.push('after'); - }); - const runner = createRunner([ - { - context: {}, - validate: jest.fn(() => { - calls.push('validate'); - }), - }, - ]); - - runner.beforeEach(beforeEach); - runner.afterEach(afterEach); - - runner.run(); - expect(calls).toEqual(['before', 'validate', 'after']); - }); -}); diff --git a/src/error.js b/src/error.js deleted file mode 100644 index 478570d..0000000 --- a/src/error.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -export class ValidationError extends Error {} diff --git a/src/index.js b/src/index.js deleted file mode 100644 index c1f5c5c..0000000 --- a/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -export * from './error'; -export * from './rules'; -export * from './runner'; diff --git a/src/rules/accordion.js b/src/rules/accordion.js deleted file mode 100644 index 317d0b6..0000000 --- a/src/rules/accordion.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -const rules = [ - { - id: 'a.rule.identifier', - description: 'A rule description', - origin: 'some.location', - validate(node) { - // - }, - }, -]; - -export default rules; diff --git a/src/rules/index.js b/src/rules/index.js deleted file mode 100644 index 406aa19..0000000 --- a/src/rules/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -import accordion from './accordion'; - -export const rules = [...accordion]; diff --git a/src/runner.js b/src/runner.js deleted file mode 100644 index 6e07220..0000000 --- a/src/runner.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -import { ValidationError } from './error'; -import { rules } from './rules'; - -/** - * @typedef Runner - * @property {Function} beforeEach - * @property {Function} afterEach - * @property {Function} run - */ - -/** - * Create a runner for the given collection of rules - * @param {Array} rules - * @return Runner - */ -export function createRunner(rules) { - let _beforeEach; - let _afterEach; - return { - beforeEach(fn) { - _beforeEach = fn; - }, - afterEach(fn) { - _afterEach = fn; - }, - run() { - const violations = []; - - for (const rule of rules) { - const node = _beforeEach(rule.context); - const result = rule.validate(node, rule.context); - - if (result instanceof ValidationError) { - violations.push(result); - } - - _afterEach(node); - } - - return violations; - }, - }; -} - -export const Runner = createRunner(rules); diff --git a/tasks/jest/cssTransform.js b/tasks/jest/cssTransform.js deleted file mode 100644 index 97d4c76..0000000 --- a/tasks/jest/cssTransform.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -// This is a custom Jest transformer turning style imports into empty objects. -// http://facebook.github.io/jest/docs/tutorial-webpack.html - -module.exports = { - process() { - return 'module.exports = {};'; - }, - getCacheKey() { - // The output is always the same. - return 'cssTransform'; - }, -}; diff --git a/tasks/jest/fileTransform.js b/tasks/jest/fileTransform.js deleted file mode 100644 index c6d5c6b..0000000 --- a/tasks/jest/fileTransform.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -const path = require('path'); - -// This is a custom Jest transformer turning file imports into filenames. -// http://facebook.github.io/jest/docs/tutorial-webpack.html - -module.exports = { - process(src, filename) { - return `module.exports = ${JSON.stringify(path.basename(filename))};`; - }, -}; diff --git a/tasks/jest/jsTransform.js b/tasks/jest/jsTransform.js deleted file mode 100644 index 4953d5c..0000000 --- a/tasks/jest/jsTransform.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -const { createTransformer } = require('babel-jest'); - -const babelOptions = { - presets: [ - [ - '@babel/preset-env', - { - targets: { - browsers: ['last 1 version', 'ie >= 11', 'Firefox ESR'], - }, - }, - ], - ], - plugins: [ - [ - '@babel/plugin-transform-runtime', - { - regenerator: true, - }, - ], - ], -}; - -module.exports = createTransformer(babelOptions); diff --git a/tasks/jest/setup.js b/tasks/jest/setup.js deleted file mode 100644 index 6b89a4e..0000000 --- a/tasks/jest/setup.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -global.requestAnimationFrame = function requestAnimationFrame(callback) { - setTimeout(callback); -}; diff --git a/tasks/rollup/config.js b/tasks/rollup/config.js deleted file mode 100644 index a66ea11..0000000 --- a/tasks/rollup/config.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright IBM Corp. 2018, 2019 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -const path = require('path'); -const babel = require('rollup-plugin-babel'); -const commonjs = require('rollup-plugin-commonjs'); -const nodeResolve = require('rollup-plugin-node-resolve'); - -const baseConfig = { - input: path.resolve(__dirname, '../../src/index.js'), - plugins: [ - nodeResolve({ - jsnext: true, - main: true, - module: true, - }), - commonjs({ - include: ['node_modules/**'], - extensions: ['.js'], - }), - babel({ - exclude: 'node_modules/**', - babelrc: false, - presets: [ - [ - '@babel/preset-env', - { - modules: false, - targets: { - browsers: ['last 1 version', 'ie >= 11', 'Firefox ESR'], - }, - }, - ], - ], - }), - ], -}; - -module.exports = [ - { - ...baseConfig, - output: { - format: 'esm', - file: path.join('es', 'index.js'), - }, - }, - { - ...baseConfig, - output: { - format: 'cjs', - file: path.join('lib', 'index.js'), - }, - }, - { - ...baseConfig, - output: { - format: 'umd', - file: path.join('umd', 'index.js'), - name: 'CarbonSpec', - }, - }, -];