Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rfc/issue 355 no bundle development #417

Merged
merged 60 commits into from
Nov 12, 2020
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
46f048a
basic unbundled rendering of home page
thescientist13 Sep 16, 2020
f0804fe
got livereload working for all files
thescientist13 Sep 16, 2020
2e9456e
JSON support
thescientist13 Sep 17, 2020
aaa25a6
import CSS support
thescientist13 Sep 17, 2020
d2fbece
disable eslint complexity
thescientist13 Sep 17, 2020
10fcc2b
header working
thescientist13 Sep 17, 2020
4e9b020
ading banner and stylinh and fixed binary image loading
thescientist13 Sep 17, 2020
1e29db9
integrated evergreen deps
thescientist13 Sep 18, 2020
3631d06
fully restored the home page in develop mode
thescientist13 Sep 18, 2020
8a18552
wip getting serialization working
thescientist13 Sep 18, 2020
770178b
wip getting serialization working
thescientist13 Sep 18, 2020
af86832
clean up and refactor, serialize WIP
thescientist13 Sep 18, 2020
1beeb5f
upgrade puppeteer to latest
thescientist13 Sep 18, 2020
6930472
a bit hacky but home page is now being built for production
thescientist13 Sep 18, 2020
4702f6d
render header navigation from graph
thescientist13 Sep 25, 2020
6bd752a
page template working for site in development
thescientist13 Sep 29, 2020
a6bda80
all pages working in develop
thescientist13 Sep 29, 2020
c67559b
all pages serializing for prod
thescientist13 Sep 29, 2020
25c8392
sort header and shelf
thescientist13 Sep 30, 2020
d7dba58
shelf expansion and table of contents
thescientist13 Sep 30, 2020
4c743fc
label fallback handling
thescientist13 Sep 30, 2020
db2f97c
fix index page rendering
thescientist13 Sep 30, 2020
f27b3bd
clean up logging
thescientist13 Sep 30, 2020
f605dda
favicon support
thescientist13 Sep 30, 2020
61dd7eb
refactor server lifecycle to use compilation and expose devServer
thescientist13 Oct 1, 2020
b879792
built in serve command
thescientist13 Oct 1, 2020
396ca5c
serve docs
thescientist13 Oct 1, 2020
59b0b72
add support for app templates
thescientist13 Oct 3, 2020
bdc68de
pretty URLs
thescientist13 Oct 6, 2020
0b588a1
shelf working WIP
thescientist13 Oct 6, 2020
adbcffb
quick styling tweak for side nav
thescientist13 Oct 8, 2020
44a5451
copy assets and graph.json in copy lifecycle
thescientist13 Oct 11, 2020
698988a
basic support for css files
thescientist13 Oct 11, 2020
e7f12a6
fix copy error for nested folders
thescientist13 Oct 11, 2020
1729b94
call rollup from JS API
thescientist13 Oct 11, 2020
7b65990
rollup configuration sourced from compilation
thescientist13 Oct 11, 2020
f2ad06e
make sure to await Promise.all
thescientist13 Oct 15, 2020
f8a159b
Rfc/issue 355 organize serve lifecycle (#419)
hutchgrant Oct 15, 2020
4cf32de
linting
thescientist13 Oct 16, 2020
dd3cfa4
renable default tests and limited smoke tests
thescientist13 Oct 17, 2020
d9e92a2
disable all tests enable subset of tests
thescientist13 Oct 17, 2020
b59b6dc
meta specs
thescientist13 Oct 20, 2020
0cf35cb
enable custom title case
thescientist13 Oct 21, 2020
b7a1812
enable custom workspace spec
thescientist13 Oct 22, 2020
8c972da
track missing dev dep
thescientist13 Oct 22, 2020
c186ced
enabled workspace assets test case
thescientist13 Oct 23, 2020
5129a2f
fix link closing slash
thescientist13 Oct 23, 2020
d00edd9
content-outlet refactor
thescientist13 Oct 23, 2020
bbf1293
enabled getting started test case
thescientist13 Oct 23, 2020
6b58605
enable nested directory test case
thescientist13 Oct 24, 2020
e6851c5
enable app template case
thescientist13 Oct 24, 2020
cbe7bff
enable page template spec
thescientist13 Oct 24, 2020
c16e0cf
enable user directory mapping case
thescientist13 Oct 24, 2020
1280a34
update comments
thescientist13 Oct 24, 2020
02ce6ac
got code markdown rendering and added support for custom plugins from…
thescientist13 Nov 1, 2020
71e325d
markdown plugins working including prism
thescientist13 Nov 1, 2020
0d64e43
default markdown specs
thescientist13 Nov 2, 2020
e5683d1
enable all tests
thescientist13 Nov 2, 2020
fbfa261
rename markdown case
thescientist13 Nov 3, 2020
a28de1f
syntax highlighting markdown spec
thescientist13 Nov 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
enable page template spec
thescientist13 committed Oct 24, 2020
commit cbe7bffdd0beffd783547c8296441c88b0e2d976
10 changes: 9 additions & 1 deletion packages/cli/src/transforms/html.transform.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable complexity */
// TODO ^^
const acorn = require('acorn');
const { promises: fsp } = require('fs');
const fs = require('fs');
@@ -18,7 +20,7 @@ module.exports = filterHTML = async (ctx, config, userWorkspace) => {
// TODO filter out node modules, only page / user requests from brower
// TODO make sure this only happens for "pages", nor partials or fixtures, templates, et)
if (ctx.request.url.endsWith('/') || ctx.request.url.endsWith('.html')) {
// console.log('URL ends with /');
// console.log('URL ends with / or endsWith.html');
// TODO get port from compilation
// ctx.redirect(`http://localhost:1984${ctx.request.url}index.html`);
// }
@@ -104,6 +106,7 @@ module.exports = filterHTML = async (ctx, config, userWorkspace) => {
if (fm.attributes.template) {
contents = await fsp.readFile(`${userWorkspace}/templates/${fm.attributes.template}.html`, 'utf-8');
} else if (fs.existsSync(`${userWorkspace}/templates/page.html`)) {
// console.debug('has a page template!');
contents = await fsp.readFile(`${userWorkspace}/templates/page.html`, 'utf-8');
}

@@ -113,6 +116,11 @@ module.exports = filterHTML = async (ctx, config, userWorkspace) => {
}

contents = contents.replace(/\<content-outlet>(.*)<\/content-outlet>/s, processedMarkdown.contents);
} else if (fs.existsSync(`${userWorkspace}/templates/page.html`)) {
// console.debug('only has a page template');
const page = await fsp.readFile(`${userWorkspace}/templates/page.html`, 'utf-8');

contents = page.replace(/\<content-outlet>(.*)<\/content-outlet>/s, contents.match(/\<content-outlet>(.*)<\/content-outlet>/s)[0]);
}

const appTemplate = `${userWorkspace}/templates/app.html`;
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ const { JSDOM } = require('jsdom');
const path = require('path');
const TestBed = require('../../../../../test/test-bed');

xdescribe('Build Greenwood With: ', function() {
describe('Build Greenwood With: ', function() {
const LABEL = 'Default Greenwood Configuration and Workspace w/Custom Page Template';
let setup;

@@ -36,7 +36,8 @@ xdescribe('Build Greenwood With: ', function() {
await setup.runGreenwoodCommand('build');
});

runSmokeTest(['public', 'index', 'not-found', 'hello'], LABEL);
// TODO runSmokeTest(['public', 'index', 'not-found', 'hello'], LABEL);
runSmokeTest(['public', 'index'], LABEL);

describe('Custom Page Template', function() {
let dom;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en" prefix="og:http://ogp.me/ns#">

<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'/>
</head>

<body>

<div class='wrapper'>

<div class='page-template blog-content content owen-test'>
<content-outlet></content-outlet>
</div>

</div>

</body>

</html>