-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rfc/issue 355 no bundle development (#417)
* basic unbundled rendering of home page * got livereload working for all files * JSON support * import CSS support * disable eslint complexity * header working * ading banner and stylinh and fixed binary image loading * integrated evergreen deps * fully restored the home page in develop mode * wip getting serialization working * wip getting serialization working * clean up and refactor, serialize WIP * upgrade puppeteer to latest * a bit hacky but home page is now being built for production * render header navigation from graph * page template working for site in development * all pages working in develop * all pages serializing for prod * sort header and shelf * shelf expansion and table of contents * label fallback handling * fix index page rendering * clean up logging * favicon support * refactor server lifecycle to use compilation and expose devServer * built in serve command * serve docs * add support for app templates * pretty URLs * shelf working WIP * quick styling tweak for side nav * copy assets and graph.json in copy lifecycle * basic support for css files * fix copy error for nested folders * call rollup from JS API * rollup configuration sourced from compilation * make sure to await Promise.all * Rfc/issue 355 organize serve lifecycle (#419) * task: organize serve * fix: remove ctx from resolve * fix: refactor further * task: scope filters by file * linting * renable default tests and limited smoke tests * disable all tests enable subset of tests * meta specs * enable custom title case * enable custom workspace spec * track missing dev dep * enabled workspace assets test case * fix link closing slash * content-outlet refactor * enabled getting started test case * enable nested directory test case * enable app template case * enable page template spec * enable user directory mapping case * update comments * got code markdown rendering and added support for custom plugins from config * markdown plugins working including prism * default markdown specs * enable all tests * rename markdown case * syntax highlighting markdown spec Co-authored-by: Grant Hutchinson <[email protected]>
- Loading branch information
1 parent
d1b14b9
commit c1a3260
Showing
124 changed files
with
3,468 additions
and
8,096 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
spec: path.join(__dirname, 'packages/**/test/**/**/**/*.spec.js'), | ||
// TODO spec: path.join(__dirname, 'packages/**/test/**/**/**/*.spec.js'), | ||
spec: path.join(__dirname, 'packages/**/test/cases/**/**/*.spec.js'), | ||
timeout: 30000 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const bundleCompilation = require('../lifecycles/bundle'); | ||
const copyAssets = require('../lifecycles/copy'); | ||
const fs = require('fs'); | ||
const generateCompilation = require('../lifecycles/compile'); | ||
const serializeCompilation = require('../lifecycles/serialize'); | ||
const { devServer } = require('../lifecycles/serve'); | ||
|
||
module.exports = runProductionBuild = async () => { | ||
|
||
return new Promise(async (resolve, reject) => { | ||
|
||
try { | ||
const compilation = await generateCompilation(); | ||
const port = compilation.config.devServer.port; | ||
const outputDir = compilation.context.outputDir; | ||
|
||
devServer(compilation).listen(port); | ||
|
||
if (!fs.existsSync(outputDir)) { | ||
fs.mkdirSync(outputDir); | ||
} | ||
|
||
await serializeCompilation(compilation); | ||
await bundleCompilation(compilation); | ||
await copyAssets(compilation); | ||
|
||
resolve(); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const generateCompilation = require('../lifecycles/compile'); | ||
const livereload = require('livereload'); | ||
const { devServer } = require('../lifecycles/serve'); | ||
|
||
module.exports = runDevServer = async () => { | ||
|
||
return new Promise(async (resolve, reject) => { | ||
|
||
try { | ||
const compilation = await generateCompilation(); | ||
const { port } = compilation.config.devServer; | ||
const { userWorkspace } = compilation.context; | ||
|
||
devServer(compilation).listen(port, () => { | ||
console.info(`Started local development at localhost:${port}`); | ||
const liveReloadServer = livereload.createServer({ | ||
exts: ['html', 'css', 'js', 'md'], | ||
applyCSSLive: false // https://github.com/napcs/node-livereload/issues/33#issuecomment-693707006 | ||
}); | ||
|
||
liveReloadServer.watch(userWorkspace, () => { | ||
console.info(`Now watching directory "${userWorkspace}" for changes.`); | ||
}); | ||
}); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
|
||
}); | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const generateCompilation = require('../lifecycles/compile'); | ||
const { prodServer } = require('../lifecycles/serve'); | ||
|
||
module.exports = runProdServer = async () => { | ||
|
||
return new Promise(async (resolve, reject) => { | ||
|
||
try { | ||
const compilation = await generateCompilation(); | ||
const port = 8080; | ||
|
||
prodServer(compilation).listen(port, () => { | ||
console.info(`Started production test server at localhost:${port}`); | ||
}); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
|
||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
plugins: { | ||
'postcss-preset-env': {}, // stage 2+ | ||
'postcss-nested': {}, | ||
'cssnano': {} | ||
} | ||
// plugins: { | ||
// 'postcss-preset-env': {}, // stage 2+ | ||
// 'postcss-nested': {}, | ||
// 'cssnano': {} | ||
// } | ||
}; |
Oops, something went wrong.