A design system for Mozilla websites.
Перейти к файлу
dependabot[bot] cc6c47175a
Bump yaml, css-minimizer-webpack-plugin, stylelint and stylelint-config-standard-scss (#870)
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>
2023-05-01 13:27:22 -07:00
.github Update dependencies 2023-01-13 12:51:53 +00:00
assets PR revision 2023-03-27 16:06:04 +11:00
bin Add build command for deploying the docs (Issue #746) (#756) 2021-12-15 07:57:02 -08:00
components Remove aria-disabled from disabled input docs and example (fixes #823) (#831) 2022-12-14 10:50:03 -08:00
docs clean up 2023-03-28 10:41:48 +11:00
static Migrate newsletter form 2022-06-21 15:08:28 -07:00
tests Add webpack config for building Fractal (#771) 2022-03-28 15:54:03 -07:00
theme pr revisions 2023-03-28 10:41:48 +11:00
.editorconfig Tidy component code and docs, improve consistency (#808) 2022-07-05 08:50:50 -07:00
.eslintignore Add webpack config for building Fractal (#771) 2022-03-28 15:54:03 -07:00
.eslintrc.js Add direction toggle 2022-06-22 14:43:01 +01:00
.gitignore Update Fractal branch to 16.0.1 2022-06-24 11:35:00 -07:00
.nvmrc Move CSS/JS linting to NPM scripts (Fixes #745) (#747) 2021-12-07 17:25:37 -08:00
.stylelintignore Add webpack config for building Fractal (#771) 2022-03-28 15:54:03 -07:00
.stylelintrc.json update stylelint to match github comment 2022-09-08 10:35:59 -07:00
CHANGELOG.md moved 404 pag to /docs 2023-03-28 10:41:48 +11:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct file 2019-03-30 15:24:04 +00:00
LICENSE Setting up Fractal 2022-01-18 11:29:38 -08:00
README.md Update contributing doc, add usage docs, general doc tidying (#807) 2022-06-29 07:48:12 -07:00
fractal.config.js Add webpack config for building Fractal (#771) 2022-03-28 15:54:03 -07:00
main.js Setting up Fractal 2022-01-18 11:29:38 -08:00
netlify.toml pr revisions 2023-03-28 10:41:48 +11:00
package-lock.json Bump yaml, css-minimizer-webpack-plugin, stylelint and stylelint-config-standard-scss (#870) 2023-05-01 13:27:22 -07:00
package.json Bump yaml, css-minimizer-webpack-plugin, stylelint and stylelint-config-standard-scss (#870) 2023-05-01 13:27:22 -07:00
webpack.docs.build.config.js Add direction toggle 2022-06-22 14:43:01 +01:00
webpack.docs.static.config.js clean up 2023-03-28 10:41:48 +11:00
webpack.package.build.config.js Add webpack config for building Fractal (#771) 2022-03-28 15:54:03 -07:00
webpack.package.static.config.js Add webpack config for building Fractal (#771) 2022-03-28 15:54:03 -07:00

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.

https://protocol.mozilla.org/

Protocol is still an evolving project. Currently, its 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 youre interested in using Protocol on your project, let us know and we can help you. You can find us in #protocol-design-system on Mozillas Slack (for Mozillians) or in #protocol-design-system on Matrix (open to the public). Also feel free to file an issue on GitHub.

Current npm package version. Total downloads on npm. Pull requests welcome!

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:

  1. Before you start make sure the project's CHANGELOG.md is up to date.
  2. Update the package version number in assets/package/package.json (use Semantic Versioning to determine what the new version number should be).
  3. Update the package README assets/package/README.md.
  4. Run npm install to update the package-lock.json file.
  5. Submit a pull request with your changes (or commit directly to main if you have permission). Once the changes have been merged to main:
  6. Tag a new release. You can do this either using Git tag, or directly on the GitHub website.
  7. Run npm test to run the build script and front-end tests. The package contents will be located in ./package/.
  8. 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.

  1. Verify all is good on the staging site.
  2. Make sure your local main branch is up to date.
  3. Push the main branch to the prod 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.

  1. Push your branch to the demo1 or demo2 branches e.g. git push -f origin my-branch-name:demo1
  2. Your branch will be published:

A notice will be posted in #www-notify on Slack when the push has completed.