Skip to content

Commit

Permalink
feat: allow filtering MDN data by status (microsoft#4164)
Browse files Browse the repository at this point in the history
# Description

<!--- Describe your changes. -->
This allows the filtering of MDN data by it's status, the default export of MDN data from the tooling is filtered to only include "standard" MDN CSS.

## Issue type checklist

<!--- What type of change are you submitting? Put an x in the box that applies: -->

- [ ] **Chore**: A change that does not impact distributed packages.
- [ ] **Bug fix**: A change that fixes an issue, link to the issue above.
- [x] **New feature**: A change that adds functionality.

**Is this a breaking change?**
- [ ] This change causes current functionality to break.

<!--- If yes, describe the impact. -->

**Adding or modifying component(s) in `@microsoft/fast-components` checklist**

<!-- Do your changes add or modify components in the @microsoft/fast-components package? Put an x in the box that applies: -->

- [ ] I have added a new component
- [ ] I have modified an existing component
- [ ] I have updated the [definition file](https://github.com/Microsoft/fast/blob/master/packages/web-components/fast-components/CONTRIBUTING.md#definition)
- [ ] I have updated the [configuration file](https://github.com/Microsoft/fast/blob/master/packages/web-components/fast-components/CONTRIBUTING.md#configuration)

## Process & policy checklist

<!--- Review the list and check the boxes that apply. -->

- [x] I have added tests for my changes.
- [x] I have tested my changes.
- [ ] I have updated the project documentation to reflect my changes.
- [x] I have read the [CONTRIBUTING](https://github.com/Microsoft/fast/blob/master/CONTRIBUTING.md) documentation and followed the [standards](https://www.fast.design/docs/community/code-of-conduct/#our-standards) for this project.

<!---
Formatting guidelines:

Accepted peer review title format:
<type>: <description>

Example titles:
    chore: add unit tests for all components
    feat: add a border radius to button
    fix: update design system to use 3px border radius

    <type> is required to be one of the following:

        - chore: A change that does not impact distributed packages.
        - fix: A change which fixes an issue.
        - feat: A that adds functionality.

    <description> is required for the CHANGELOG and speaks to what the user gets from this PR:

        - Be concise.
        - Use all lowercase characters. 
        - Use imperative, present tense (e.g. `add` not `adds`.)
        - Do not end your description with a period.
        - Avoid redundant words.

For additional information regarding working on FAST, check out our documentation site:
https://www.fast.design/docs/community/contributor-guide
-->
  • Loading branch information
janechu authored Dec 4, 2020
1 parent b54ac1b commit dc58c34
Show file tree
Hide file tree
Showing 8 changed files with 714 additions and 6,119 deletions.
30 changes: 20 additions & 10 deletions packages/tooling/fast-tooling/build/generate-mdn-data-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ const comment = `/**

(function () {
if (yargs.argv.test) {
const updatedCSSProperties = mapCSSProperties({
properties: mdnCSS.properties,
syntaxes: mdnCSS.syntaxes,
types: mdnCSS.types,
});
const updatedCSSProperties = mapCSSProperties(
{
properties: mdnCSS.properties,
syntaxes: mdnCSS.syntaxes,
types: mdnCSS.types,
},
{
status: "standard",
}
);

if (isEqual(updatedCSSProperties, properties)) {
console.log(
Expand All @@ -52,11 +57,16 @@ const comment = `/**
fs.writeFile(
outFilePath,
`${comment}export const properties = ${JSON.stringify(
mapCSSProperties({
properties: mdnCSS.properties,
syntaxes: mdnCSS.syntaxes,
types: mdnCSS.types,
}),
mapCSSProperties(
{
properties: mdnCSS.properties,
syntaxes: mdnCSS.syntaxes,
types: mdnCSS.types,
},
{
status: "standard",
}
),
null,
4
)}\n\nexport const syntaxes = ${JSON.stringify(
Expand Down
Loading

0 comments on commit dc58c34

Please sign in to comment.