Skip to content

Commit bcaaf11

Browse files
devversionjosephperrott
authored andcommittedJan 2, 2018
build: missing overview files in docs-content (#9100)
1 parent 4302f04 commit bcaaf11

File tree

3 files changed

+70
-67
lines changed

3 files changed

+70
-67
lines changed
 

Diff for: ‎scripts/deploy/publish-docs-content.sh

+56-61
Original file line numberDiff line numberDiff line change
@@ -14,82 +14,77 @@ if [ -z ${MATERIAL2_DOCS_CONTENT_TOKEN} ]; then
1414
exit 1
1515
fi
1616

17-
docsPath="./dist/docs"
18-
packagePath="./dist/releases/material-examples"
19-
repoPath="/tmp/material2-docs-content"
20-
repoUrl="https://github.com/angular/material2-docs-content"
21-
examplesSource="./dist/docs/examples"
22-
2317
if [[ ! ${*} == *--no-build* ]]; then
2418
$(npm bin)/gulp material-examples:build-release:clean
2519
$(npm bin)/gulp docs
2620
fi
2721

28-
# Get git meta info for commit
29-
commitSha="$(git rev-parse --short HEAD)"
30-
commitAuthorName="$(git --no-pager show -s --format='%an' HEAD)"
31-
commitAuthorEmail="$(git --no-pager show -s --format='%ae' HEAD)"
32-
commitMessage="$(git log --oneline -n 1)"
33-
34-
# create directory and clone test repo
35-
rm -rf $repoPath
36-
mkdir -p $repoPath
37-
git clone $repoUrl $repoPath --depth 1
38-
39-
# Clean out repo directory and copy contents of dist/docs into it
40-
rm -rf $repoPath/*
41-
42-
# Create folders that will contain docs content files.
43-
mkdir $repoPath/{overview,guides,api,examples,stackblitz,examples-package}
44-
45-
# Copy api files over to $repoPath/api
46-
cp -r $docsPath/api/* $repoPath/api
47-
48-
# Copy the material-examples package to the docs content repository.
49-
cp -r $packagePath/* $repoPath/examples-package
50-
51-
# Flatten the markdown docs structure and move it into $repoPath/overview
52-
overviewFiles=$docsPath/markdown/
53-
for filename in $overviewFiles*
54-
do
55-
if [ -d $filename ]; then
56-
for _ in $filename/*
57-
do
58-
markdownFile=${filename#$overviewFiles}.html
59-
# Filename should be same as folder name with .html extension
60-
if [ -e $filename/$markdownFile ]; then
61-
cp -r $filename/$markdownFile $repoPath/overview/
62-
fi
63-
done
64-
fi
65-
done
22+
# Path to the directory that contains the generated docs output.
23+
docsDistPath="./dist/docs"
6624

67-
# Copy guide files over to $repoPath/guides
68-
for filename in $overviewFiles*
69-
do
70-
if [ -f $filename ]; then
71-
cp -r $filename $repoPath/guides
72-
fi
73-
done
25+
# Path to the release output of the @angular/material-examples package.
26+
examplesPackagePath="./dist/releases/material-examples"
27+
28+
# Path to the cloned docs-content repository.
29+
docsContentPath=./tmp/material2-docs-content
30+
31+
# Git clone URL for the material2-docs-content repository.
32+
docsContentRepoUrl="https://github.com/angular/material2-docs-content"
33+
34+
# Current version of Angular Material from the package.json file
35+
buildVersion=$(node -pe "require('./package.json').version")
36+
37+
# Additional information about the last commit for docs-content commits.
38+
commitSha=$(git rev-parse --short HEAD)
39+
commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)
40+
commitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD)
41+
commitMessage=$(git log --oneline -n 1)
42+
commitTag="${buildVersion}-${commitSha}"
43+
44+
# Remove the docs-content repository if the directory exists
45+
rm -Rf ${docsContentPath}
7446

75-
# Copy highlighted examples into $repoPath
76-
cp -r $examplesSource/* $repoPath/examples
47+
# Clone the docs-content repository.
48+
git clone ${docsContentRepoUrl} ${docsContentPath} --depth 1
7749

78-
# Copy example stackblitz assets
79-
cp -r $docsPath/stackblitz/* $repoPath/stackblitz
50+
# Remove everything inside of the docs-content repository.
51+
rm -Rf ${docsContentPath}/*
52+
53+
# Create all folders that need to exist in the docs-content repository.
54+
mkdir ${docsContentPath}/{overview,guides,api,examples,stackblitz,examples-package}
55+
56+
# Copy API and example files to the docs-content repository.
57+
cp -R ${docsDistPath}/api/* ${docsContentPath}/api
58+
cp -r ${docsDistPath}/examples/* ${docsContentPath}/examples
59+
cp -r ${docsDistPath}/stackblitz/* ${docsContentPath}/stackblitz
60+
61+
# Copy the @angular/material-examples package to the docs-content repository.
62+
cp -r ${examplesPackagePath}/* ${docsContentPath}/examples-package
63+
64+
# Copy the license file to the docs-content repository.
65+
cp ./LICENSE ${docsContentPath}
66+
67+
# Copy all immediate children of the markdown output the guides/ directory.
68+
for guidePath in $(find ${docsDistPath}/markdown/ -maxdepth 1 -type f); do
69+
cp ${guidePath} ${docsContentPath}/guides
70+
done
71+
72+
# All files that aren't immediate children of the markdown output are overview documents.
73+
for overviewPath in $(find ${docsDistPath}/markdown/ -mindepth 2 -type f); do
74+
cp ${overviewPath} ${docsContentPath}/overview
75+
done
8076

81-
# Copies assets over to the docs-content repository.
82-
cp LICENSE $repoPath/
77+
# Go into the repository directory.
78+
cd ${docsContentPath}
8379

84-
# Push content to repo
85-
cd $repoPath
80+
# Setup the Git configuration
8681
git config user.name "$commitAuthorName"
8782
git config user.email "$commitAuthorEmail"
8883
git config credential.helper "store --file=.git/credentials"
8984

9085
echo "https://${MATERIAL2_DOCS_CONTENT_TOKEN}:@github.com" > .git/credentials
9186

9287
git add -A
93-
git commit --allow-empty -m "$commitMessage"
94-
git tag "$commitSha"
88+
git commit --allow-empty -m "${commitMessage}"
89+
git tag "${commitTag}"
9590
git push origin master --tags

Diff for: ‎src/material-examples/example-module.ts

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {DialogContentExampleDialog,DialogContentExample} from './dialog-content/
4545
import {DialogDataExampleDialog,DialogDataExample} from './dialog-data/dialog-data-example';
4646
import {DialogElementsExampleDialog,DialogElementsExample} from './dialog-elements/dialog-elements-example';
4747
import {DialogOverviewExampleDialog,DialogOverviewExample} from './dialog-overview/dialog-overview-example';
48+
import {DividerOverviewExample} from './divider-overview/divider-overview-example';
4849
import {ElevationOverviewExample} from './elevation-overview/elevation-overview-example';
4950
import {ExpansionOverviewExample} from './expansion-overview/expansion-overview-example';
5051
import {ExpansionStepsExample} from './expansion-steps/expansion-steps-example';
@@ -321,6 +322,15 @@ export const EXAMPLE_COMPONENTS = {
321322
additionalFiles: ["dialog-overview-example-dialog.html"],
322323
selectorName: 'DialogOverviewExample, DialogOverviewExampleDialog'
323324
},
325+
<<<<<<< HEAD
326+
=======
327+
'divider-overview': {
328+
title: 'Basic divider',
329+
component: DividerOverviewExample,
330+
additionalFiles: null,
331+
selectorName: null
332+
},
333+
>>>>>>> c3d7cd96d... build: missing overview files in docs-content (#9100)
324334
'elevation-overview': {
325335
title: 'Elevation CSS classes',
326336
component: ElevationOverviewExample,

Diff for: ‎tools/package-tools/build-bundles.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,10 @@ export class PackageBundler {
9494
uglifyJsFile(config.umdDest, config.umdMinDest);
9595

9696
// Remaps the sourcemaps to be based on top of the original TypeScript source files.
97-
await Promise.all([
98-
remapSourcemap(config.esm2015Dest),
99-
remapSourcemap(config.esm5Dest),
100-
remapSourcemap(config.umdDest),
101-
remapSourcemap(config.umdMinDest),
102-
]);
97+
await remapSourcemap(config.esm2015Dest);
98+
await remapSourcemap(config.esm5Dest);
99+
await remapSourcemap(config.umdDest);
100+
await remapSourcemap(config.umdMinDest);
103101
}
104102

105103
/** Creates a rollup bundle of a specified JavaScript file.*/

0 commit comments

Comments
 (0)
Please sign in to comment.