cc6c47175a
Removes [yaml](https://github.com/eemeli/yaml). It's no longer used after updating ancestor dependencies [yaml](https://github.com/eemeli/yaml), [css-minimizer-webpack-plugin](https://github.com/webpack-contrib/css-minimizer-webpack-plugin), [stylelint](https://github.com/stylelint/stylelint) and [stylelint-config-standard-scss](https://github.com/stylelint-scss/stylelint-config-standard-scss). These dependencies need to be updated together. Removes `yaml` Updates `css-minimizer-webpack-plugin` from 4.2.2 to 5.0.0 - [Release notes](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/releases) - [Changelog](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/compare/v4.2.2...v5.0.0) Updates `stylelint` from 14.16.1 to 15.6.0 - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/14.16.1...15.6.0) Updates `stylelint-config-standard-scss` from 6.1.0 to 9.0.0 - [Release notes](https://github.com/stylelint-scss/stylelint-config-standard-scss/releases) - [Changelog](https://github.com/stylelint-scss/stylelint-config-standard-scss/blob/main/CHANGELOG.md) - [Commits](https://github.com/stylelint-scss/stylelint-config-standard-scss/compare/v6.1.0...v9.0.0) --- updated-dependencies: - dependency-name: yaml dependency-type: indirect - dependency-name: css-minimizer-webpack-plugin dependency-type: direct:production - dependency-name: stylelint dependency-type: direct:development - dependency-name: stylelint-config-standard-scss dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
---|---|---|
.github | ||
assets | ||
bin | ||
components | ||
docs | ||
static | ||
tests | ||
theme | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.nvmrc | ||
.stylelintignore | ||
.stylelintrc.json | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
LICENSE | ||
README.md | ||
fractal.config.js | ||
main.js | ||
netlify.toml | ||
package-lock.json | ||
package.json | ||
webpack.docs.build.config.js | ||
webpack.docs.static.config.js | ||
webpack.package.build.config.js | ||
webpack.package.static.config.js |
README.md
Mozilla Protocol
Protocol is a design system for Mozilla and Firefox websites. It establishes a common design language, provides reusable coded components, and outlines high level guidelines for content and accessibility.
Protocol is still an evolving project. Currently, it’s used primarily by the Mozilla Marketing Websites team as the front-end for www.mozilla.org. The long term goal is to provide a robust, unified design system that anyone at Mozilla can use to build an on-brand website.
If you’re interested in using Protocol on your project, let us know and we can help you. You can find us in #protocol-design-system on Mozilla’s Slack (for Mozillians) or in #protocol-design-system on Matrix (open to the public). Also feel free to file an issue on GitHub.
Getting Started
Protocol is built on the Node.js platform and published to NPM, so be sure to have both installed before proceeding.
Installation
To use Protocol in your website you can install the core package directly from NPM:
npm install @mozilla-protocol/core --save
Alternatively, you can also download the latest release from GitHub.
Usage
Once installed, the relevant CSS, JavaScript, and asset files will be available
in your project under ./node_modules/@mozilla-protocol/core/
.
The core CSS file is bundled as protocol.css
, which contains styling for things
such as basic elements and typography, as well as some global components like
navigation and a footer. Other component and layout CSS is bundled as
protocol-components.css
for convenience.
However, these pre-compiled CSS files include the entire pattern library, which you may not need. We recommend compiling your own styles from the source Sass files, also included in the published package. That allows you to configure Protocol to include just the styles and components you need for each page of your website.
Make it Run
To build Protocol from source and run the documentation site locally, you can clone the repo from GitHub:
$ git clone https://github.com/mozilla/protocol.git
$ cd protocol
$ npm install
Running npm install
will install dependencies. Then:
$ npm run webpack-docs
This will compile the Sass and copy assets into a local folder in preparation to run the server. It also starts a “watch” process that will watch those files and automatically recompile when they change.
In another command line console (and still within the Protocol folder), run:
$ npm start
This will build the site locally and start the development server at http://localhost:3000.
Building the website
To build the Protocol documentation site for deployment, run:
$ npm run build-docs
Building the NPM package
We use a Webpack configuration for building the contents of the NPM package ready for publishing. To build the package, run:
npm run build-package
This will install dependencies, lint CSS/JS files, and then build the package
content in the ./package/
directory.
Running tests
To perform the package build process above and then run front-end JS tests against the processed files:
npm test
Publishing to NPM
Protocol is published to NPM under the @mozilla-protocol/core
namespace/package
name. To publish a release to NPM, use the following steps:
- Before you start make sure the project's CHANGELOG.md is up to date.
- Update the package
version
number in assets/package/package.json (use Semantic Versioning to determine what the new version number should be). - Update the package README assets/package/README.md.
- Run
npm install
to update the package-lock.json file. - Submit a pull request with your changes (or commit directly to
main
if you have permission). Once the changes have been merged to main: - Tag a new release. You can do this either using Git tag, or directly on the GitHub website.
- Run
npm test
to run the build script and front-end tests. The package contents will be located in./package/
. - If the build is successful and all tests pass, publish to NPM using
npm publish ./package/
.
Deployment
Note: the following instructions assume the Mozilla repository is the remote
called origin
.
Pushing to production
Each time an updated package is published to NPM, https://protocol.mozilla.org/ should also be updated so the documentation site matches the NPM package features.
- Verify all is good on the staging site.
- Make sure your local
main
branch is up to date. - Push the
main
branch to theprod
branch:git push origin main:prod
.
A notice will be posted in #www-notify on Slack when the push has completed.
Pushing to demo
For previewing new components before they are merged to main
, two demo instances
are available.
- Push your branch to the
demo1
ordemo2
branches e.g.git push -f origin my-branch-name:demo1
- Your branch will be published:
A notice will be posted in #www-notify on Slack when the push has completed.