Skip to content

Commit

Permalink
Merge pull request #4566 from uswds/release-3.0.0-beta.3
Browse files Browse the repository at this point in the history
USWDS 3.0.0 Beta 3
  • Loading branch information
thisisdano committed Mar 8, 2022
2 parents f0a2914 + 8e36721 commit dac00f1
Show file tree
Hide file tree
Showing 793 changed files with 41,359 additions and 38,956 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
snyk: snyk/snyk@0.0.12
snyk: snyk/snyk@1.1.2

references:
container: &container
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build/

# ignore compiled storybook directory
storybook-static/
_site/

# ignore gulp-generated vendor files
src/stylesheets/lib
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!dist/
!src/

_site/
build/
coverage/
.github/
Expand Down
16 changes: 10 additions & 6 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ module.exports = {
core: {
builder: "webpack5",
},
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
stories: [
"../src/**/*.stories.mdx",
"../src/**/**/*.stories.@(js|jsx|ts|tsx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-a11y",
"@whitespace/storybook-addon-html",
],
staticDirs: ['../dist'],
webpackFinal: async (config, { configType }) => {
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
// You can change the configuration based on that.
Expand All @@ -47,11 +51,11 @@ module.exports = {
use: "twigjs-loader",
resolve: {
alias: {
'@components': path.resolve(__dirname, '../src/components'),
'@templates': path.resolve(__dirname, '../src/templates'),
'@compare': path.resolve(__dirname, '../src/compare')
}
}
"@components": path.resolve(__dirname, "../src/components"),
"@templates": path.resolve(__dirname, "../src/templates"),
"@compare": path.resolve(__dirname, "../src/compare"),
},
},
},
{
test: /\.s(c|a)ss$/i,
Expand Down
12 changes: 11 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ export const parameters = {
date: /Date$/,
},
},
}
options: {
storySort: {
order: [
"Design Tokens",
"Components",
"Patterns",
"Pages",
],
},
},
};
3 changes: 1 addition & 2 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": [
"stylelint-config-recommended-scss",
"stylelint-prettier/recommended"
"@18f/identity-stylelint-config"
],
"rules": {
"unit-no-unknown": null,
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ How you implement the design system depends on the needs of your project and you

### Download and install

1. Download the [USWDS zip file](https://github.com/uswds/uswds/releases/download/v2.12.2/uswds-2.12.2.zip) from the latest USWDS release and open that file.
1. Download the [USWDS zip file](https://github.com/uswds/uswds/releases/download/v2.13.1/uswds-2.13.1.zip) from the latest USWDS release and open that file.

After extracting the zip file you should see the following file and folder structure:

```
uswds-2.12.2/
uswds-2.13.1/
├── css/
│   ├── uswds.min.css.map
│   ├── uswds.min.css
Expand Down Expand Up @@ -101,7 +101,7 @@ How you implement the design system depends on the needs of your project and you
```
example-project/
├── assets/
│   ├── uswds-2.12.2/
│   ├── uswds-2.13.1/
│   ├── stylesheets/
│   ├── images/
│   └── javascript/
Expand All @@ -121,11 +121,11 @@ How you implement the design system depends on the needs of your project and you
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My Example Project</title>
<script src="assets/uswds-2.12.2/js/uswds-init.min.js"></script>
<link rel="stylesheet" href="assets/uswds-2.12.2/css/uswds.min.css" />
<script src="assets/uswds-2.13.1/js/uswds-init.min.js"></script>
<link rel="stylesheet" href="assets/uswds-2.13.1/css/uswds.min.css" />
</head>
<body>
<script src="assets/uswds-2.12.2/js/uswds.min.js"></script>
<script src="assets/uswds-2.13.1/js/uswds.min.js"></script>
</body>
</html>
```
Expand All @@ -140,7 +140,7 @@ And that’s it — you should now be able to copy our code samples into your `i

1. Install `Node/npm`. Below is a link to find the install method that coincides with your operating system:

- Node v12.13.0 (current LTS), [Installation guides](https://nodejs.org/en/download/)
- Node v12.13.1 (current LTS), [Installation guides](https://nodejs.org/en/download/)

**Note for Windows users:** If you are using Windows and are unfamiliar with `Node` or `npm`, we recommend following [Team Treehouse's tutorial](http://blog.teamtreehouse.com/install-node-js-npm-windows) for more information.

Expand Down
2 changes: 0 additions & 2 deletions _config.yml

This file was deleted.

1 change: 1 addition & 0 deletions docs/WHO_IS_USING_USWDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Below are a list of websites and applications currently using the U.S. Web Desig
- [Department of Commerce](https://commerce.gov/)
- [Department of Homeland Security](https://www.dhs.gov/)
- [Dietary Guidelines - USDA](https://www.dietaryguidelines.gov/)
- [Dietary Supplement Label Database](https://dsld.od.nih.gov/)
- [Digital Acquisition Accelerator](https://pages.18f.gov/digitalaccelerator/)
- [Digital Analytics Dashboard](https://analytics.usa.gov)
- [Digital Service Playbook — U.S. Digital Service](https://playbook.cio.gov)
Expand Down
69 changes: 28 additions & 41 deletions gulp-tasks/lint.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const { src, lastRun } = require('gulp');
const { formatters } = require("stylelint");
const gulpStylelint = require('gulp-stylelint');
const eslint = require('gulp-eslint');
const dutil = require('./utils/doc-util');
const cFlags = require("./utils/cflags");
const childProcess = require("child_process");
const stylelint = require("stylelint");
const dutil = require("./utils/doc-util");

const IGNORE_STRING = "This file is ignored";
const PROJECT_SASS_SRC = "src/stylesheets";

function ignoreStylelintIgnoreWarnings(lintResults) {
return formatters.string(
Expand All @@ -24,47 +23,35 @@ function ignoreStylelintIgnoreWarnings(lintResults) {
);
}

// Lint Sass based on .stylelintrc.json config.
function lintSass() {
const stylelintOptions = {
failAfterError: true,
reporters: [
{
formatter: ignoreStylelintIgnoreWarnings,
console: true,
},
],
syntax: "scss",
};

return src(
"./src/stylesheets/**/*.scss",
{ since: lastRun(lintSass) }
)
.pipe(gulpStylelint(stylelintOptions))
.on('error', function handleError(error) {
dutil.logError(error);
this.emit('end');
function typecheck() {
return new Promise((resolve, reject) => {
childProcess
.spawn("./node_modules/.bin/tsc", { stdio: "inherit" })
.on("error", reject)
.on("exit", (code) => {
if (code === 0) {
dutil.logMessage("typecheck", "TypeScript likes our code!");
resolve();
} else {
reject(new Error("TypeScript failed, see output for details!"));
}
});
});
}
};

function lintJS(done) {
if (!cFlags.test) {
dutil.logMessage("eslint", "Skipping linting of JavaScript files.");
return done();
}
async function lintSass(callback) {
const { errored, output } = await stylelint.lint({
files: [
`${PROJECT_SASS_SRC}/**/*.scss`,
`!${PROJECT_SASS_SRC}/uswds/**/*.scss`,
],
formatter: "string",
});

return src(["src/**/**/*.js"])
.pipe(
eslint({
fix: true,
})
)
.pipe(eslint.format())
.pipe(eslint.failAfterError());
callback(errored ? new Error(output) : null);
}

module.exports = {
lintSass,
lintJS
typecheck
};
16 changes: 6 additions & 10 deletions gulp-tasks/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ const { src, dest } = require("gulp");
const postcss = require("gulp-postcss");
const replace = require("gulp-replace");
const rename = require("gulp-rename");
const sass = require("gulp-dart-scss");
const sass = require("gulp-sass")(require("sass"));
const sourcemaps = require("gulp-sourcemaps");
const dutil = require("./utils/doc-util");
const pkg = require("../package.json");


sass.compiler = require("sass");

module.exports = {
compileSass() {
dutil.logMessage("sass", "Compiling Sass");
Expand All @@ -23,12 +20,11 @@ module.exports = {
.pipe(sourcemaps.init({ largeFile: true }))
.pipe(
sass({
outputStyle: "expanded",
})
.on("error", function handleError(error) {
dutil.logError(error);
this.emit('end');
})
outputStyle: "expanded",
}).on("error", function handleError(error) {
dutil.logError(error);
this.emit("end");
})
)
.pipe(postcss(pluginsProcess))
.pipe(replace(/\buswds @version\b/g, `uswds v${pkg.version}`))
Expand Down
9 changes: 4 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { noCleanup, noTest } = require("./gulp-tasks/flags");
const { buildSprite } = require("./gulp-tasks/svg-sprite");
const { compileJS, typeCheck } = require("./gulp-tasks/javascript");
const { unitTests, sassTests, cover } = require("./gulp-tasks/test");
const { lintSass, lintJS } = require("./gulp-tasks/lint");
const { lintSass, typecheck } = require("./gulp-tasks/lint");
const { build } = require("./gulp-tasks/build");
const { release } = require("./gulp-tasks/release");
const { watch } = require("./gulp-tasks/watch");
Expand All @@ -32,8 +32,8 @@ exports.cleanDist = cleanDist;
* *Lint tasks*
*/
exports.lintSass = lintSass;
exports.lintJS = lintJS;
exports.lint = parallel(lintSass, lintJS);
exports.typecheck = typecheck;
exports.lint = parallel(lintSass, typecheck);

/**
* *Test tasks*
Expand All @@ -49,7 +49,6 @@ exports.sassTests = sassTests;
exports.unitTests = unitTests;
exports.test = series(
typeCheck,
lintJS,
lintSass,
sassTests,
unitTests,
Expand All @@ -64,7 +63,7 @@ exports.test = series(
*/
exports.buildSprite = buildSprite;
exports.buildSass = series(lintSass, copyVendor, compileSass);
exports.buildJS = series(typeCheck, lintJS, compileJS);
exports.buildJS = series(typeCheck, compileJS);
exports.buildUSWDS = build;
exports.release = release;

Expand Down

0 comments on commit dac00f1

Please sign in to comment.