[now-static-build][frameworks][examples] Fixes examples and adjust frameworks (#3584)

* [examples] Fix ionic-react example

* [examples] Fix vue example

* [examples] Fix mithril example

* [examples] Fix riot example

* Fix readmes

* [now-static-build] Add Zola

* Add tests

* [now-build-utils][frameworks] Adjust detect framework

* Move zola back

* Undo Hugo detection changes

* [examples] Fix Vue logo path

* [now-static-build] Use package.json script if defined instead of framework command

* [now-static-build] Add buildCommand everywhere

* Remove devCommand from frameworks.ts

* Fix type

* Change output directory

* [now-static-build] Remove minNodeRange

* Remove devCommand
This commit is contained in:
Andy
2020-01-16 00:12:55 +01:00
committed by GitHub
parent 0a63bd47e8
commit 96dbc6d348
145 changed files with 2051 additions and 3605 deletions

View File

@@ -23,18 +23,22 @@ async function matches(fs: DetectorFilesystem, framework: Framework) {
return false;
}
const check = async ({ file, matchContent }: FrameworkDetectionItem) => {
if (!file) {
const check = async ({ path, matchContent }: FrameworkDetectionItem) => {
if (!path) {
return false;
}
if ((await fs.exists(file)) === false) {
if ((await fs.hasPath(path)) === false) {
return false;
}
if (matchContent) {
if ((await fs.isFile(path)) === false) {
return false;
}
const regex = new RegExp(matchContent, 'gm');
const content = await fs.readFile(file);
const content = await fs.readFile(path);
if (!regex.test(content.toString())) {
return false;