Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Feat: add build command detection #92

Merged
merged 8 commits into from
Jan 7, 2021
Merged

Conversation

erezrokah
Copy link
Contributor

Fixes #63
Fixes #64

Changes:

  1. Moved the directory from watch to build (doesn't really makes sense to have it under watch).
  2. Added the relevant build command for existing frameworks.
  3. Added missing frameworks from our UI detection (some are very old/deprecated and I couldn't find the watch command nor install the framework so kept the watch empty).

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jan 6, 2021
@erezrokah erezrokah marked this pull request as ready for review January 6, 2021 17:50
@erezrokah erezrokah requested a review from ehmicky January 6, 2021 17:50
src/core.js Show resolved Hide resolved
"build": {
"command": "ng build",
"directory": "dist"
},
Copy link
Contributor

@ehmicky ehmicky Jan 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there some frameworks where the build directory might be different in watch mode vs normal mode?
Probably not, but asking just in case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build directory in watch mode isn't really a thing...
When you run a framework in development/watch mode it starts an http server and users (and the CLI) access it for content (maybe we should call it dev and not watch).
Sometimes that dev server writes content to the build dir and sometimes it doesn't (depending on the framework).
The CLI detectors code doesn't have that distinction too:
https://github.com/netlify/cli/blob/abcbd07528b6d847594266ff788575e990d8b24a/src/detectors/angular.js#L24

Please let me know if that makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking of watch mode in a more general sense. For example, some of our detectors are Gulp and Grunt, which do not necessarily use an HTTP server for the watch mode. For those, the watch mode is more likely to just re-run the build command on file updates, i.e. to re-populate the build directory.
I was wondering if there could be some frameworks or situation where that build directory in watch mode would use a separate directory.

I think I might be confused around the word "watch" which makes me think of filesystem watch mode, whereas what we actually mean might be "dev" as you mention, i.e. filesystem watch mode + serving files on a local HTTP server?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I might be confused around the word "watch" which makes me think of filesystem watch mode, whereas what we actually mean might be "dev" as you mention, i.e. filesystem watch mode + serving files on a local HTTP server?

Exactly - that's the difference. What the CLI needs is the dev command and port.
I can make another PR to rename watch to dev. We can have it under the major version bump.

Copy link
Contributor

@ehmicky ehmicky Jan 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think this renaming would help clear any confusion 👍
Also, it makes it clear that property is intended for netlify dev.

test/frameworks.js Outdated Show resolved Hide resolved
@erezrokah erezrokah merged commit 4d5c35e into master Jan 7, 2021
@erezrokah erezrokah deleted the feat/add_build_command branch January 7, 2021 11:16
@github-actions github-actions bot mentioned this pull request Jan 7, 2021
@erezrokah erezrokah mentioned this pull request Jan 7, 2021
@netlify-bot netlify-bot mentioned this pull request Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: add publish directory detection Feature: add build command detection
2 participants