-
Notifications
You must be signed in to change notification settings - Fork 22
Add svelte and sapper to list of detectors #201
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const { | ||
hasRequiredDeps, | ||
hasRequiredFiles, | ||
getYarnOrNPMCommand, | ||
scanScripts | ||
} = require("./utils/jsdetect"); | ||
|
||
module.exports = function() { | ||
// REQUIRED FILES | ||
if (!hasRequiredFiles(["package.json"])) return false; | ||
// REQUIRED DEPS | ||
if (!hasRequiredDeps(["sapper"])) return false; | ||
|
||
/** everything below now assumes that we are within vue */ | ||
|
||
const possibleArgsArrs = scanScripts({ | ||
preferredScriptsArr: ["dev", "start"], | ||
preferredCommand: "sapper dev" | ||
}); | ||
|
||
if (possibleArgsArrs.length === 0) { | ||
// ofer to run it when the user doesnt have any scripts setup! 🤯 | ||
possibleArgsArrs.push(["sapper", "dev"]); | ||
} | ||
|
||
return { | ||
type: "vue-cli", | ||
command: getYarnOrNPMCommand(), | ||
port: 8888, | ||
proxyPort: 3000, | ||
env: { ...process.env }, | ||
possibleArgsArrs, | ||
urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, "g"), | ||
dist: "dist" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed |
||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const { | ||
hasRequiredDeps, | ||
hasRequiredFiles, | ||
getYarnOrNPMCommand, | ||
scanScripts | ||
} = require("./utils/jsdetect"); | ||
|
||
module.exports = function() { | ||
// REQUIRED FILES | ||
if (!hasRequiredFiles(["package.json"])) return false; | ||
// REQUIRED DEPS | ||
if (!hasRequiredDeps(["svelte"])) return false; | ||
|
||
/** everything below now assumes that we are within vue */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pedantic copy/paste leftover in comment. :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh |
||
|
||
const possibleArgsArrs = scanScripts({ | ||
preferredScriptsArr: ["dev", "start", "run"], | ||
preferredCommand: "npm run dev" | ||
}); | ||
|
||
if (possibleArgsArrs.length === 0) { | ||
// ofer to run it when the user doesnt have any scripts setup! 🤯 | ||
possibleArgsArrs.push(["npm", "dev"]); | ||
} | ||
|
||
return { | ||
type: "svelte", | ||
command: getYarnOrNPMCommand(), | ||
port: 8888, | ||
proxyPort: 5000, | ||
env: { ...process.env }, | ||
possibleArgsArrs, | ||
urlRegexp: new RegExp(`(http://)([^:]+:)${5000}(/)?`, "g"), | ||
dist: "dist" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this PR is merged already, but I was just wondering about the choice of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm not that familiar with svelte, i didnt really check it. i have never liked the choice of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for looking at this. The sapper location would be static which you updated correctly, but the Svelte default is |
||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
sapper
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed