diff --git a/scripts/deploy/publish-docs-content.sh b/scripts/deploy/publish-docs-content.sh index 64b3c45c099c..0eee3efc2fed 100755 --- a/scripts/deploy/publish-docs-content.sh +++ b/scripts/deploy/publish-docs-content.sh @@ -14,75 +14,70 @@ if [ -z ${MATERIAL2_DOCS_CONTENT_TOKEN} ]; then exit 1 fi -docsPath="./dist/docs" -packagePath="./dist/releases/material-examples" -repoPath="/tmp/material2-docs-content" -repoUrl="https://github.com/angular/material2-docs-content" -examplesSource="./dist/docs/examples" - if [[ ! ${*} == *--no-build* ]]; then $(npm bin)/gulp material-examples:build-release:clean $(npm bin)/gulp docs fi -# Get git meta info for commit -commitSha="$(git rev-parse --short HEAD)" -commitAuthorName="$(git --no-pager show -s --format='%an' HEAD)" -commitAuthorEmail="$(git --no-pager show -s --format='%ae' HEAD)" -commitMessage="$(git log --oneline -n 1)" - -# create directory and clone test repo -rm -rf $repoPath -mkdir -p $repoPath -git clone $repoUrl $repoPath --depth 1 - -# Clean out repo directory and copy contents of dist/docs into it -rm -rf $repoPath/* - -# Create folders that will contain docs content files. -mkdir $repoPath/{overview,guides,api,examples,stackblitz,examples-package} - -# Copy api files over to $repoPath/api -cp -r $docsPath/api/* $repoPath/api - -# Copy the material-examples package to the docs content repository. -cp -r $packagePath/* $repoPath/examples-package - -# Flatten the markdown docs structure and move it into $repoPath/overview -overviewFiles=$docsPath/markdown/ -for filename in $overviewFiles* -do - if [ -d $filename ]; then - for _ in $filename/* - do - markdownFile=${filename#$overviewFiles}.html - # Filename should be same as folder name with .html extension - if [ -e $filename/$markdownFile ]; then - cp -r $filename/$markdownFile $repoPath/overview/ - fi - done - fi -done +# Path to the directory that contains the generated docs output. +docsDistPath="./dist/docs" -# Copy guide files over to $repoPath/guides -for filename in $overviewFiles* -do - if [ -f $filename ]; then - cp -r $filename $repoPath/guides - fi -done +# Path to the release output of the @angular/material-examples package. +examplesPackagePath="./dist/releases/material-examples" + +# Path to the cloned docs-content repository. +docsContentPath=./tmp/material2-docs-content + +# Git clone URL for the material2-docs-content repository. +docsContentRepoUrl="https://github.com/angular/material2-docs-content" + +# Current version of Angular Material from the package.json file +buildVersion=$(node -pe "require('./package.json').version") + +# Additional information about the last commit for docs-content commits. +commitSha=$(git rev-parse --short HEAD) +commitAuthorName=$(git --no-pager show -s --format='%an' HEAD) +commitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD) +commitMessage=$(git log --oneline -n 1) +commitTag="${buildVersion}-${commitSha}" + +# Remove the docs-content repository if the directory exists +rm -Rf ${docsContentPath} -# Copy highlighted examples into $repoPath -cp -r $examplesSource/* $repoPath/examples +# Clone the docs-content repository. +git clone ${docsContentRepoUrl} ${docsContentPath} --depth 1 -# Copy example stackblitz assets -cp -r $docsPath/stackblitz/* $repoPath/stackblitz +# Remove everything inside of the docs-content repository. +rm -Rf ${docsContentPath}/* + +# Create all folders that need to exist in the docs-content repository. +mkdir ${docsContentPath}/{overview,guides,api,examples,stackblitz,examples-package} + +# Copy API and example files to the docs-content repository. +cp -R ${docsDistPath}/api/* ${docsContentPath}/api +cp -r ${docsDistPath}/examples/* ${docsContentPath}/examples +cp -r ${docsDistPath}/stackblitz/* ${docsContentPath}/stackblitz + +# Copy the @angular/material-examples package to the docs-content repository. +cp -r ${examplesPackagePath}/* ${docsContentPath}/examples-package + +# Copy the license file to the docs-content repository. +cp ./LICENSE ${docsContentPath} + +# Copy all immediate children of the markdown output the guides/ directory. +for guidePath in $(find ${docsDistPath}/markdown/ -maxdepth 1 -type f); do + cp ${guidePath} ${docsContentPath}/guides +done + +# All files that aren't immediate children of the markdown output are overview documents. +for overviewPath in $(find ${docsDistPath}/markdown/ -mindepth 2 -type f); do + cp ${overviewPath} ${docsContentPath}/overview +done -# Copies assets over to the docs-content repository. -cp LICENSE $repoPath/ +# Go into the repository directory. +cd ${docsContentPath} -# Push content to repo -cd $repoPath +# Setup the Git configuration git config user.name "$commitAuthorName" git config user.email "$commitAuthorEmail" git config credential.helper "store --file=.git/credentials" @@ -90,6 +85,6 @@ git config credential.helper "store --file=.git/credentials" echo "https://${MATERIAL2_DOCS_CONTENT_TOKEN}:@github.com" > .git/credentials git add -A -git commit --allow-empty -m "$commitMessage" -git tag "$commitSha" +git commit --allow-empty -m "${commitMessage}" +git tag "${commitTag}" git push origin master --tags diff --git a/src/material-examples/example-module.ts b/src/material-examples/example-module.ts index 7d37bfcf0a5d..5f13784757cf 100644 --- a/src/material-examples/example-module.ts +++ b/src/material-examples/example-module.ts @@ -45,6 +45,7 @@ import {DialogContentExampleDialog,DialogContentExample} from './dialog-content/ import {DialogDataExampleDialog,DialogDataExample} from './dialog-data/dialog-data-example'; import {DialogElementsExampleDialog,DialogElementsExample} from './dialog-elements/dialog-elements-example'; import {DialogOverviewExampleDialog,DialogOverviewExample} from './dialog-overview/dialog-overview-example'; +import {DividerOverviewExample} from './divider-overview/divider-overview-example'; import {ElevationOverviewExample} from './elevation-overview/elevation-overview-example'; import {ExpansionOverviewExample} from './expansion-overview/expansion-overview-example'; import {ExpansionStepsExample} from './expansion-steps/expansion-steps-example'; @@ -127,7 +128,6 @@ import {ToolbarMultirowExample} from './toolbar-multirow/toolbar-multirow-exampl import {ToolbarOverviewExample} from './toolbar-overview/toolbar-overview-example'; import {TooltipOverviewExample} from './tooltip-overview/tooltip-overview-example'; import {TooltipPositionExample} from './tooltip-position/tooltip-position-example'; -import {DividerOverviewExample} from './divider-overview/divider-overview-example'; export const EXAMPLE_COMPONENTS = { 'autocomplete-display': { @@ -323,7 +323,7 @@ export const EXAMPLE_COMPONENTS = { selectorName: 'DialogOverviewExample, DialogOverviewExampleDialog' }, 'divider-overview': { - title: 'Divider Overview', + title: 'Basic divider', component: DividerOverviewExample, additionalFiles: null, selectorName: null diff --git a/tools/package-tools/build-bundles.ts b/tools/package-tools/build-bundles.ts index 7d1628c0b64a..057d44724c2a 100644 --- a/tools/package-tools/build-bundles.ts +++ b/tools/package-tools/build-bundles.ts @@ -94,12 +94,10 @@ export class PackageBundler { uglifyJsFile(config.umdDest, config.umdMinDest); // Remaps the sourcemaps to be based on top of the original TypeScript source files. - await Promise.all([ - remapSourcemap(config.esm2015Dest), - remapSourcemap(config.esm5Dest), - remapSourcemap(config.umdDest), - remapSourcemap(config.umdMinDest), - ]); + await remapSourcemap(config.esm2015Dest); + await remapSourcemap(config.esm5Dest); + await remapSourcemap(config.umdDest); + await remapSourcemap(config.umdMinDest); } /** Creates a rollup bundle of a specified JavaScript file.*/