Skip to content

Commit

Permalink
Merge branch 'feat/tabs/tabs' into feat/tabs/tab-scroller-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickrodee authored Jul 26, 2018
2 parents 8d660d9 + 7b6e49d commit 9cbad57
Show file tree
Hide file tree
Showing 142 changed files with 29,261 additions and 2,754 deletions.
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ matrix:
- node_js: 8
env:
- TEST_SUITE=screenshot
git:
depth: 200
script: npm run screenshot:test -- --no-fetch
before_install:
# Source the script to run it in the same shell process. This ensures that any environment variables set by the
# script are visible to subsequent Travis CLI commands.
# https://superuser.com/a/176788/62792
- source test/screenshot/commands/travis.sh
before_install:
# Source the script to run it in the same shell process. This ensures that any environment variables set by the
# script are visible to subsequent Travis CLI commands.
# https://superuser.com/a/176788/62792
- source test/screenshot/infra/commands/travis.sh
install:
- npm install
#- npm ls # Noisy output, but useful for debugging npm package dependency version issues
2 changes: 1 addition & 1 deletion demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<span class="demo-catalog-list-icon mdc-list-item__graphic"><img src="/images/ic_dialog_24px.svg" /></span>
<span class="mdc-list-item__text">
Dialog
<span class="mdc-list-item__secondary-text">Secondary text</span>
<span class="mdc-list-item__secondary-text">Implements a modal dialog window</span>
</span>
</a>
<a href="drawer/index.html" role="listitem" class="mdc-list-item">
Expand Down
98 changes: 46 additions & 52 deletions demos/list.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions demos/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
@import "../packages/mdc-form-field/mdc-form-field";
@import "../packages/mdc-list/mdc-list";
@import "../packages/mdc-ripple/mixins";
@import "../packages/mdc-typography/mixins";

a.material-icons {
text-decoration: none;
Expand Down
15 changes: 15 additions & 0 deletions demos/typography.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
padding: 24px;
border: 1px solid #ddd;
}

.demo-typography--heading-baseline {
margin-left: 24px;
}
</style>
</head>
<body class="mdc-typography">
Expand Down Expand Up @@ -77,6 +81,17 @@ <h6 class="mdc-typography--subtitle2">Subtitle 2</h6>
<div><span class="mdc-typography--overline">Overline text</span></div>

</section>

<h6 class="mdc-typography--headline6 demo-typography--heading-baseline">Baseline</h6>
<section class="demo-typography--section-baseline">
<h2 class="demo-typography__title mdc-typography--headline6">Our Changing Planet</h2>
<h3 class="demo-typography__subtitle mdc-typography--subtitle2">by Kurt Wagner</h3>
<div class="demo-typography__body mdc-typography--body2">Visit ten places on our planet that are undergoing the biggest changes today.</div>

<line class="demo-typography-line-1">+34px</line>
<line class="demo-typography-line-2">+22px</line>
<line class="demo-typography-line-3">+28px</line>
</section>
</main>
</body>
</html>
53 changes: 53 additions & 0 deletions demos/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,56 @@
//

@import "./common";
@import "../packages/mdc-typography/mixins";

$ruler-color: #FD2549;

.demo-typography--section-baseline {
position: relative;
margin: 24px;
padding: 0 24px 24px 24px;
border: 1px solid #ddd;
max-width: 350px;
}

.demo-typography__title {
@include mdc-typography-baseline-top(34px);
@include mdc-typography-baseline-bottom(22px);
}

.demo-typography__subtitle {
@include mdc-typography-baseline-top(22px);
@include mdc-typography-baseline-bottom(28px);

@include mdc-theme-prop(color, text-secondary-on-background);
}

.demo-typography__body {
@include mdc-typography-baseline-top(28px);
@include mdc-theme-prop(color, text-secondary-on-background);
}

.demo-typography-line-1,
.demo-typography-line-2,
.demo-typography-line-3 {
position: absolute;
border-top: 1px solid $ruler-color;
width: 100%;
left: 0;
right: 0;
color: $ruler-color;
font-size: 10px;
text-align: right;
}

.demo-typography-line-1 {
top: 34px;
}

.demo-typography-line-2 {
top: calc(34px + 22px);
}

.demo-typography-line-3 {
top: calc(34px + 22px + 28px);
}
41 changes: 21 additions & 20 deletions docs/open_source/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,13 @@ git commit -am "chore: Publish"

### For Pre-Releases and Patch Releases

Simply run the post-release script to update and commit the changelog and apply an annotated vX.Y.Z git tag:

```
./scripts/post-release.sh
```

Make sure that a CHANGELOG commit actually appears in your `git log`! If you need to retry the process:

```
git tag -d <tag> # Delete the tag that the script created
git reset --hard HEAD^ # Rewind to the previous commit
```

Alternatively, if you would like to be extra sure of the changelog, you can generate it manually prior to running the
post-release script, in which case it will skip `npm run changelog` and commit your local changes:
It's recommended to generate the changelog prior to running the post-release script so you can double-check the changes
before it creates a tag:

```
npm run changelog
git diff # Review the changelog and make sure it looks OK
./scripts/post-release.sh
./scripts/post-release.sh # This will commit the changelog diff and then create a tag
```

### For Minor Releases
Expand Down Expand Up @@ -188,13 +175,13 @@ You will need to temporarily alter Github's master branch protection in order to
1. Perform the process outlined in one of the sections below
1. Don't forget to re-enable "Include administrators" & click "Save changes" afterwards

### For Pre-releases and Feature/Breaking-Change Releases
### For Pre-releases and Minor Releases

`git push origin master && git push origin <tag>`

This will ensure the new commits *and* tag are pushed to the remote git repository.

### For Bugfix Releases
### For Patch Releases

`git push origin <tag>`

Expand All @@ -212,13 +199,27 @@ git push

## Update and Deploy Catalog Repository

We maintain a `next` branch on the MDC Web Catalog repository to keep ahead of breaking changes in new releases.
### For Patch Releases

1. Update the `material-components-web` dependency in the catalog's `package.json` to the new patch version
1. Run `npm start` and glance through the catalog pages to make sure everything looks normal
1. Send a PR for the dependency update, then run `npm deploy` once it's merged to master

### For Minor Releases

We typically maintain a `next` branch on the MDC Web Catalog repository which follows MDC Web pre-releases, to keep
ahead of breaking changes in new releases.

In the event no pre-releases were tagged, the above process for patch releases would be followed, but would require
checking for necessary updates to accommodate breaking changes in MDC Web.

Below is the process when a `next` branch is used:

1. Ensure you have the latest `master` checked out: `git checkout master && git pull`
1. Create a new branch, e.g.: `git checkout -b chore/0.36.0`
1. Merge `next` into the branch: `git merge next`
1. Deal with any conflicts if necessary
1. Update `package.json` to reference the newly-released final versions of MDC Web packages
1. Update `package.json` to reference the newly-released minor version of `material-components-web`
1. `rm -rf node_modules && npm i` to cause `package-lock.json` to update
1. `npm start` and test the catalog, in case any further breaking changes occurred since the last pre-release
1. `npm run build` to double-check that there are no unforeseen errors when building resources for deployment
Expand Down
116 changes: 84 additions & 32 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,87 @@ const webpackConfig = require('./webpack.config')[0];
const USING_TRAVISCI = Boolean(process.env.TRAVIS);
const USING_SL = Boolean(process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY);

const SL_LAUNCHERS = {
const LOCAL_LAUNCHERS = {
/** See https://github.com/travis-ci/travis-ci/issues/8836#issuecomment-348248951 */
'ChromeHeadlessNoSandbox': {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
};

const SAUCE_LAUNCHERS = {
/*
* Chrome (desktop)
*/

'sl-chrome-stable': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest',
platform: 'macOS 10.12',
extendedDebugging: true,
},
'sl-chrome-beta': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'dev',
platform: 'macOS 10.12',
},
'sl-chrome-previous': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest-1',
platform: 'macOS 10.12',
},
// 'sl-chrome-beta': {
// base: 'SauceLabs',
// browserName: 'chrome',
// version: 'dev',
// platform: 'macOS 10.12',
// extendedDebugging: true,
// },
// 'sl-chrome-previous': {
// base: 'SauceLabs',
// browserName: 'chrome',
// version: 'latest-1',
// platform: 'macOS 10.12',
// extendedDebugging: true,
// },

/*
* Firefox
*/

'sl-firefox-stable': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest',
platform: 'Windows 10',
extendedDebugging: true,
},
'sl-firefox-previous': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest-1',
platform: 'Windows 10',
},
// 'sl-firefox-previous': {
// base: 'SauceLabs',
// browserName: 'firefox',
// version: 'latest-1',
// platform: 'Windows 10',
// extendedDebugging: true,
// },

/*
* IE
*/

'sl-ie': {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '11',
platform: 'Windows 8.1',
},

/*
* Edge
*/

// TODO(sgomes): Re-enable Edge and Safari after Sauce Labs problems are fixed.
// 'sl-edge': {
// base: 'SauceLabs',
// browserName: 'microsoftedge',
// version: 'latest',
// platform: 'Windows 10',
// },

/*
* Safari (desktop)
*/

// 'sl-safari-stable': {
// base: 'SauceLabs',
// browserName: 'safari',
Expand All @@ -76,6 +113,11 @@ const SL_LAUNCHERS = {
// version: '9.0',
// platform: 'OS X 10.11',
// },

/*
* Safari (mobile)
*/

'sl-ios-safari-latest': {
base: 'SauceLabs',
deviceName: 'iPhone Simulator',
Expand All @@ -92,6 +134,9 @@ const SL_LAUNCHERS = {
// },
};

const getLaunchers = () => USING_SL ? SAUCE_LAUNCHERS : LOCAL_LAUNCHERS;
const getBrowsers = () => USING_TRAVISCI ? Object.keys(getLaunchers()) : ['Chrome'];

module.exports = function(config) {
config.set({
basePath: '',
Expand All @@ -106,12 +151,12 @@ module.exports = function(config) {
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browsers: determineBrowsers(),
browsers: getBrowsers(),
browserDisconnectTimeout: 40000,
browserNoActivityTimeout: 120000,
captureTimeout: 240000,
concurrency: USING_SL ? 4 : Infinity,
customLaunchers: SL_LAUNCHERS,
customLaunchers: getLaunchers(),

coverageReporter: {
dir: 'coverage',
Expand All @@ -126,6 +171,10 @@ module.exports = function(config) {
mocha: {
reporter: 'html',
ui: 'qunit',

// Number of milliseconds to wait for an individual `test(...)` function to complete.
// The default is 2000.
timeout: 10000,
},
},

Expand All @@ -152,23 +201,26 @@ module.exports = function(config) {
},
});

// See https://github.com/karma-runner/karma-sauce-launcher/issues/73
if (USING_TRAVISCI) {
config.set({
sauceLabs: {
if (USING_SL) {
const sauceLabsConfig = {
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
};

if (USING_TRAVISCI) {
// See https://github.com/karma-runner/karma-sauce-launcher/issues/73
Object.assign(sauceLabsConfig, {
testName: 'Material Components Web Unit Tests - CI',
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
startConnect: false,
},
});
}

config.set({
sauceLabs: sauceLabsConfig,
// Attempt to de-flake Sauce Labs tests on TravisCI.
transports: ['polling'],
browserDisconnectTolerance: 3,
});
}
};

function determineBrowsers() {
return USING_SL ? Object.keys(SL_LAUNCHERS) : ['Chrome'];
}
Loading

0 comments on commit 9cbad57

Please sign in to comment.