Skip to content

Commit e6621fd

Browse files
authored
Updated with changes for CI/CD for patternfly doc core. (patternfly#4649)
* chore: Setup site folder and doc core. chore: Added generated content typescript node script. chore: Fixed build issue with generating files. chore: updated to remove dist folder. chore: updated gitignore. package.json updates. fix: Added CI/CD code. fix: removed _template.md chore: Updated to remove generate content. chore: updated to fix bad import. chore: clean up. chore: clean up. chore: Added about patternfly. chore: Updates to get started chore: updated lerna.json chore: Updated upload-staging.sh * chore: Updated yarn.lock conflicts.
1 parent 58fb30f commit e6621fd

37 files changed

Lines changed: 9859 additions & 78 deletions

.github/upload-staging.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ aws cloudfront create-invalidation --distribution-id EQE4NPRH0CQXJ --paths "/*"
1818

1919
if [ -d "packages/site/dist" ]; then
2020
aws s3 rm --recursive s3://patternfly-org-preview
21+
aws s3 sync packages/site/dist s3://patternfly-org-preview --exclude "*" \
22+
--include "*.html" \
23+
--include "*.json" \
24+
--exclude "static/**/*.json" \
25+
--include "sw.js" \
26+
--cache-control "public, max-age=0, must-revalidate"
27+
2128
aws s3 sync packages/site/dist s3://patternfly-org-preview --include "*" \
29+
--exclude "*.html" \
30+
--exclude "*.json" \
31+
--include "static/**/*.json" \
32+
--exclude "sw.js" \
2233
--cache-control "public, max-age=31536000, immutable"
34+
35+
aws cloudfront create-invalidation --distribution-id E2IXSH9IWFQCUC --paths "/*"
2336
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public
2626
static
2727
.cache
2828
/build
29+
packages/site/src/generated
30+
dist
2931

3032
# IDE - VSCode
3133
.vscode

lerna.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
"packages": [
1414
"packages/ast-helpers",
1515
"packages/documentation-framework",
16-
"packages/documentation-site"
16+
"packages/documentation-site",
17+
"packages/site"
1718
],
1819
"version": "independent",
1920
"allowBranch": ["main", "v4", "v5"]
2021
}
22+
git

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
"scripts": {
99
"analyze": "yarn workspace patternfly-org analyze",
1010
"develop": "yarn workspace patternfly-org develop",
11+
"dev": "yarn workspace site dev",
1112
"develop:extensions": "EXTENSIONS_ONLY=true PRERELEASE=true yarn develop",
1213
"build:analyze": "yarn workspace patternfly-org build:analyze && yarn copy",
13-
"build": "yarn workspace patternfly-org build && yarn copy",
14+
"build": "yarn workspace patternfly-org build && yarn workspace site build && yarn copy",
1415
"build:extensions": "EXTENSIONS_ONLY=true PRERELEASE=true yarn build",
1516
"copy": "rm -rf build/patternfly-org/site && mkdir -p build/patternfly-org && cp -r packages/documentation-site/public build/patternfly-org/site",
1617
"clean": "lerna run clean && rm -rf build",

packages/documentation-site/patternfly-docs/content/design-guidelines/_template.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/site/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Patternfly site built with doc core

packages/site/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "site",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"clean": "rm -rf src/generated",
7+
"generate:content": "patternfly-doc-core convert-to-mdx ../documentation-site/patternfly-docs/content/",
8+
"dev": "patternfly-doc-core start",
9+
"build": "patternfly-doc-core build",
10+
"serve": "patternfly-doc-core serve",
11+
"sync": "patternfly-doc-core sync",
12+
"init:docs": "patternfly-doc-core init"
13+
},
14+
"dependencies": {
15+
"@patternfly/patternfly-doc-core": "^1.9.0",
16+
"astro": "^5.7.13"
17+
},
18+
"devDependencies": {
19+
"tsx": "^4.19.0"
20+
}
21+
}

packages/site/pf-docs.config.mjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export const config = {
2+
content: [
3+
// example content entry for local content, this would feed all markdown files in the content directory to the
4+
// documentation core with a content identifier of 'content':
5+
{
6+
base: 'src/',
7+
pattern: "**/*.{md,mdx}",
8+
name: 'content'
9+
},
10+
//
11+
// example content entry for remote content, this would fetch all markdown files matching the glob in 'pattern'
12+
// from the specified npm package and serve them with a content identifier of 'react-component-docs':
13+
// {
14+
// packageName: "@patternfly/react-core",
15+
// pattern: "**/components/**/*.md",
16+
// name: "react-component-docs",
17+
// },
18+
],
19+
navSectionOrder: [],
20+
outputDir: './dist',
21+
propsGlobs: [
22+
// {
23+
// include: ['*/@patternfly/react-core/src/**/*.tsx'],
24+
// exclude: [
25+
// '/**/examples/**',
26+
// '/**/__mocks__/**',
27+
// '/**/__tests__/**',
28+
// '/**/*.test.tsx',
29+
// ],
30+
// },
31+
],
32+
}

packages/site/rename-md-to-mdx.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Find all .md files in the src directory and its subdirectories
4+
find src -name "*.md" | while read -r file; do
5+
# Create the new filename by replacing .md with .mdx
6+
new_file="${file%.md}.mdx"
7+
8+
# Only rename if the file exists and hasn't been renamed already
9+
if [ -f "$file" ] && [ ! -f "$new_file" ]; then
10+
echo "Renaming: $file -> $new_file"
11+
mv "$file" "$new_file"
12+
fi
13+
done
14+
15+
echo "Renaming complete!"

0 commit comments

Comments
 (0)