question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add @netlify/heuristics package

See original GitHub issue

We need a nice way to figure out different information about a project from its source code.

@netlify/heuristics (working title) would be the module that detects what kind of a project the repo is, including:

Any information that we need to:

  1. Use in the scaffolding flow
  2. Use in netlify dev
  3. Use in netlify build. Plugins might want to have this heuristic information

Currently there is https://github.com/netlify/cli/tree/master/src/detectors living in the CLI and https://github.com/netlify/netlify-build/tree/master/packages/%40netlify-build/src/heuristics inside the build package.

Todo:

  • Extract this into a package in this repo
  • Include & potentially refactor detectors
  • Include additional information we have access to listed above & any other ideas that we think would be handy for consumers (in build, build plugins, & netlify dev)
  • Use dependency in CLI

Notes: https://github.com/netlify/cli/tree/master/src/detectors is using alot of sync calls and the API might need to be revisited to avoid false positives.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
erquhartcommented, May 13, 2020

Super late here, but good point @lesliecdubs. Ideally we wouldn’t have two different implementations of the same logic. Want to start exploring CLI and UI parity and code reuse more.

1reaction
lesliecdubscommented, Jan 8, 2020

FYI in case this is useful, we already have some very basic heuristics set up in the app. As swyx mentioned, we only use them right now to detect a user’s build command and publish folder in the “create a new site” flow once a repo is linked.

https://github.com/netlify/netlify-react-ui/blob/master/src/lib/heuristics/automation.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

netlify-setup-heuristics - npm
This module lets CLI tools and UIs on top of netlify run heuristics to automatically guess the continuous deployment settings based on the ......
Read more >
️ [DEPRECATED] Setup heuristics used by netlify-cli and ...
This module lets CLI tools and UIs on top of netlify run heuristics to automatically guess the continuous deployment settings based on the...
Read more >
Netlify Dev
Netlify Dev brings the power of Netlify's Edge Logic layer, serverless functions and add-on ecosystem to your local machine. It runs Netlify's production ......
Read more >
Manage build dependencies | Netlify Docs
Specify dependencies for your project so that our platform can install required languages and software before running a build.
Read more >
A Step-by-Step Guide: Assemble on Netlify
Netlify will use the information in package.json to identify which ... also uses package.json to know which uninstalled dependencies to add ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found