Skip to content

Commit

Permalink
Merge pull request #586 from carbon-design-system/dev
Browse files Browse the repository at this point in the history
`v1.25.0`
  • Loading branch information
SimonFinney authored Jun 3, 2020
2 parents cf0819c + 834b35c commit 8bd1e61
Show file tree
Hide file tree
Showing 60 changed files with 27,316 additions and 179 deletions.
14 changes: 7 additions & 7 deletions .achecker.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# https://www.npmjs.com/package/accessibility-checker#configuring-accessibility-checker

# optional - Specify the rule archive
# Default: latest
# Run `npx achecker archives` for a list of valid ruleArchive ids and policy ids
Expand All @@ -8,7 +10,7 @@ ruleArchive: latest
# i.e. Multiple policies: IBM_Accessibility,IBM_Accessibility_BETA
# Run `npx achecker archives` for a list of valid ruleArchive ids and policy ids
policies:
- IBM_Accessibility
- WCAG_2_1

# optional - Specify one or many violation levels on which to fail the test
# i.e. If specified violation then the testcase will only fail if
Expand All @@ -17,7 +19,7 @@ policies:
# i.e. failLevels: violation,potential violation or refer to below as a list
# Default: violation, potentialviolation
failLevels:
- violation
- violation

# optional - Specify one or many violation levels which should be reported
# i.e. If specified violation then in the report it would only contain
Expand All @@ -26,14 +28,14 @@ failLevels:
# Valid values: violation, potentialviolation, recommendation, potentialrecommendation, manual
# Default: violation, potentialviolation
reportLevels:
- violation
- potentialviolation
- potentialviolation
- violation

# Optional - Which type should the results be outputted to
# Valid values: json, csv
# Default: json
outputFormat:
- json
- json

# Optional - Specify labels that you would like associated to your scan
#
Expand All @@ -45,8 +47,6 @@ outputFormat:
# - V12
# - Linux
# Default: N/A
label:
- master

# optional - Where the scan results should be saved.
# Default: results
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/CARBON.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Carbon upgrade
about: Issue template for upgrading Carbon
---

## Upgrade to Carbon `vx.x.x`

### Description

Upgrade to the latest version of Carbon and manually verify that no issues were introduced:

- [ ] <!-- https://github.com/carbon-design-system/carbon/releases/tag/vx.x.x -->
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

# Generated directories.
coverage
css
/css
es
lib
node_modules
/scss
storybook-static

# Generated Gridish file.
# CSS Gridish.
src/globals/grid/css-gridish/css
src/globals/grid/css-gridish/bx-grid.sketch

# Logs.
Expand All @@ -27,4 +28,4 @@ src/globals/grid/css-gridish/bx-grid.sketch
package-lock.json

# AAT test results from DAP/Axe
results/
results/
Binary file added .yarn/offline-mirror/@types-node-14.0.6.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/accessibility-checker-3.0.2.tgz
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/extract-zip-1.6.7.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/extract-zip-1.7.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/fast-glob-3.1.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/fast-glob-3.2.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/fastq-1.6.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/fastq-1.8.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/fd-slicer-1.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/glob-parent-5.1.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/glob-parent-5.1.1.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/globby-10.0.2.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/graceful-fs-4.2.4.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/ignore-5.1.8.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/js-yaml-3.14.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/mime-2.4.6.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/minimist-1.2.5.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/mkdirp-0.5.5.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/picomatch-2.1.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/picomatch-2.2.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/proxy-from-env-1.0.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/proxy-from-env-1.1.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/readable-stream-2.3.7.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/request-2.88.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/rimraf-3.0.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/rimraf-3.0.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/yauzl-2.4.1.tgz
Binary file not shown.
9 changes: 8 additions & 1 deletion config/jest/matchers/toHaveNoDAPViolations.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
* LICENSE file in the root directory of this source tree.
*/

import aChecker from 'accessibility-checker';
let aChecker;

async function toHaveNoDAPViolations(node, label) {
// We defer initialization of AAT as it seems to have a race condition if
// we are running a test suite in node instead of jsdom. As a result, we only
// initialize it if this matcher is called
if (!aChecker) {
aChecker = require('accessibility-checker');
}

const results = await aChecker.getCompliance(node, label);
if (aChecker.assertCompliance(results.report) === 0) {
return {
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@carbon/ibm-security",
"version": "1.24.0",
"version": "1.25.0-prerelease.5",
"description": "Carbon for IBM Security",
"license": "Apache-2.0",
"main": "lib/index.js",
Expand Down Expand Up @@ -37,7 +37,7 @@
"lint-staged": "lint-staged",
"semantic-release": "semantic-release",
"start": "run-s build:pre:grid && start-storybook -p 3000 -s public",
"test": "yarn jest spec -ci",
"test": "yarn jest spec --ci -i",
"test:precommit": "yarn jest -b --passWithNoTests --testMatch src/**/*.spec.js --findRelatedTests",
"test:imports": "scripts/checkImports.sh",
"test:scss": "node scripts/scss",
Expand Down Expand Up @@ -104,7 +104,7 @@
"@testing-library/jest-dom": "4.2.4",
"@testing-library/react": "9.3.2",
"@testing-library/user-event": "8.1.0",
"accessibility-checker": "^3.0.2",
"accessibility-checker": "^3.0.4",
"autoprefixer": "^9.4.10",
"axe-core": "^3.4.1",
"babel-eslint": "^10.0.1",
Expand Down Expand Up @@ -181,7 +181,6 @@
"lib",
"dist",
"scss",
"storybook-static",
"macros"
],
"jest": {
Expand Down
20 changes: 20 additions & 0 deletions scripts/scss/compile/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @file SCSS compilation helpers.
* @copyright IBM Security 2020
*/

const { sync } = require('glob');
const { renderSync } = require('node-sass');

module.exports = {
compile: file =>
renderSync({
file,
includePaths: ['node_modules'],
outputStyle: 'expanded',
}),
forEachImport: callback =>
sync('src/**/*.scss', {
ignore: ['src/globals/grid/css-gridish/**/*'],
}).forEach(callback),
};
29 changes: 14 additions & 15 deletions scripts/scss/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
*/

const { bgGreen, bgRed, red } = require('colors');
const { sync } = require('glob');
const { render } = require('node-sass');

sync('src/**/*.scss').forEach(file =>
render(
{
file,
includePaths: ['node_modules'],
},
const { compile, forEachImport } = require('./compile');

error => {
console.log(`${error ? bgRed('FAIL') : bgGreen('PASS')} ${file}`);
forEachImport(file => {
let status;

if (error) {
console.error(`\n${red(error.formatted)}`);
}
try {
compile(file);
} catch (error) {
status = error;
} finally {
console.log(`${status ? bgRed('FAIL') : bgGreen('PASS')} ${file}`);

if (status) {
console.error(`\n${red(status.formatted)}`);
}
)
);
}
});
24 changes: 24 additions & 0 deletions src/__tests__/scss/SCSS.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @file SCSS tests.
* @copyright IBM Security 2020
*/

import { compile, forEachImport } from '../../../scripts/scss/compile';

describe('SCSS', () => {
test('Bundle', () => {
expect(
compile('src/index.scss')
.css.toString()
.replace(/'/g, '"')
).toMatchSnapshot();
});

describe('Imports', () => {
forEachImport(file => {
test(file, () => {
expect(compile(file)).not.toHaveProperty('message');
});
});
});
});
Loading

0 comments on commit 8bd1e61

Please sign in to comment.