Skip to content
Branch: master
Find file History
Latest commit cc39eec Jan 15, 2020
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
utils refactor: remove cli logo dep Nov 19, 2019
README.md Fix Prettier (second round) Oct 28, 2019
brunch.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
cra.js
docusaurus.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
eleventy.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
ember.js fix detector comment Jan 12, 2020
expo.js
gatsby.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
gridsome.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
hexo.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
hugo.js
jekyll.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
middleman.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
next.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
nuxt.js fix: change dist Jan 16, 2020
parcel.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
phenomic.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
quasar-v0.17.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
quasar.js
react-static.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
sapper.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
stencil.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
svelte.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
vue.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019
vuepress.js Fix: Fixing prettier issues, and add to scripts test:prettier Sep 17, 2019

README.md

writing a detector

  • write as many checks as possible to fit your project
  • return false if its not your project
  • if it definitely is, return an object with this shape:
{
    type: String, // e.g. gatsby, vue-cli
    command: String, // e.g. yarn, npm
    port: Number, // e.g. 8888
    proxyPort: Number, // e.g. 3000
    env: Object, // env variables, see examples
    possibleArgsArrs: [[String]], // e.g [['run develop]], so that the combined command is 'npm run develop', but we allow for multiple
    urlRegexp: RegExp, // see examples
    dist: String, // static folder where a _redirect file would be placed, e.g. 'public' or 'static'. NOT the build output folder
}

things to note

detector notes

not sure if we want to support gitbook yet

requires a global install: https://github.com/GitbookIO/gitbook/blob/master/docs/setup.md

const { hasRequiredDeps, hasRequiredFiles, getYarnOrNPMCommand, scanScripts } = require('./utils/jsdetect')
module.exports = function() {
  // REQUIRED FILES
  if (!hasRequiredFiles(['README.md', 'SUMMARY.md'])) return false
  // // REQUIRED DEPS
  // if (!hasRequiredDeps(["hexo"])) return false;

  /** everything below now assumes that we are within gatsby */

  const possibleArgsArrs = [['gitbook', 'serve']]
  // scanScripts({
  //   preferredScriptsArr: ["start", "dev", "develop"],
  //   preferredCommand: "hexo server"
  // });

  return {
    type: 'gitbook',
    command: getYarnOrNPMCommand(),
    port: 8888,
    proxyPort: 4000,
    env: { ...process.env },
    possibleArgsArrs,
    urlRegexp: new RegExp(`(http://)([^:]+:)${4000}(/)?`, 'g'),
    dist: 'public'
  }
}
You can’t perform that action at this time.