Skip to content

Commit

Permalink
Improve website build process (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpoitch authored Aug 18, 2022
1 parent f0f6b69 commit d580de7
Show file tree
Hide file tree
Showing 48 changed files with 178 additions and 90,596 deletions.
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
assets/demo/mobiledoc.js
assets/demo/mobiledoc.css

# Logs
logs
*.log
Expand Down Expand Up @@ -52,7 +49,6 @@ Session.vim
keys.txt
export.sh
/dist
/website
/tmp
/docs

server.sh
server.sh
310 changes: 150 additions & 160 deletions README.md

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions bin/build-website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ echo "Clearing $(pwd)/website"
rm -rf website
mkdir website

echo "Copying $(pwd)/assets/* to $(pwd)/website/"
cp -R assets/* website/
echo "Copying demo code to website"
cp -r demo website

echo "Copying $(pwd)/dist/* to $(pwd)/website/"
cp -R dist/* website/
echo "Copying build files to demo"
cp -r dist/mobiledoc.* website/demo

echo "Copying $(pwd)/docs to $(pwd)/website/demo/docs"
mkdir -p website/demo/docs
cp -R docs/* website/demo/docs/

CURRENT_SHA="$(git rev-parse HEAD)"
git add website/
git commit -m "built website from $CURRENT_SHA"
echo "Built and committed as $CURRENT_SHA"
echo "Copying docs to website"
cp -r dist/docs website/demo
9 changes: 9 additions & 0 deletions bin/deploy-website.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

git branch -D gh-pages
git checkout -b gh-pages

CURRENT_SHA="$(git rev-parse HEAD)"
git add website/ -f
git commit -m "Built website from $CURRENT_SHA"

git push origin `git subtree split --prefix website`:gh-pages --force
echo "Deployed to http://bustle.github.io/mobiledoc-kit/demo/"

git checkout master
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"test": "npm run format && npm run build && testem ci -f testem.js",
"lint": "prettier src/**/*.{js,ts} --check && eslint src/**/*.{js,ts}",
"format": "prettier src --write",
"clean": "rm -rf dist",
"build": "rollup -c",
"build:docs": "typedoc",
"build:website": "npm run build:docs && npm run build && ./bin/build-website.sh",
Expand Down Expand Up @@ -77,9 +78,5 @@
"printWidth": 120,
"semi": false,
"singleQuote": true
},
"volta": {
"node": "12.14.1",
"yarn": "1.22.4"
}
}
14 changes: 9 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ function commonPlugins() {
export default args => [
{
input: 'src/js/index.ts',
plugins: commonPlugins(),
plugins: [
...commonPlugins(),
copy({
targets: [{ src: 'src/css/mobiledoc-kit.css', dest: 'dist', rename: 'mobiledoc.css' }],
}),
],
output: {
file: 'dist/mobiledoc.js',
format: 'es',
Expand All @@ -53,14 +58,13 @@ export default args => [
}),
copy({
targets: [
{ src: 'dist/mobiledoc.js', dest: 'assets/demo' },
{ src: 'src/css/mobiledoc-kit.css', dest: 'dist', rename: 'mobiledoc.css' },
{ src: 'src/css/mobiledoc-kit.css', dest: 'assets/demo/', rename: 'mobiledoc.css' },
{ src: 'demo', dest: 'website' },
{ src: 'dist/*', dest: 'website/demo' },
],
}),
args.watch &&
serve({
contentBase: '',
contentBase: 'website',
// eslint-disable-next-line no-process-env
port: process.env.PORT || 4200,
}),
Expand Down
2 changes: 1 addition & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"entryPoints": ["src/js/index.ts"],
"out": "website/demo/docs",
"out": "dist/docs",
"excludePrivate": true
}
22 changes: 0 additions & 22 deletions website/demo/debug.css

This file was deleted.

68 changes: 0 additions & 68 deletions website/demo/debug.html

This file was deleted.

Loading

0 comments on commit d580de7

Please sign in to comment.