This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 664
Add basic instructions to setup a Rome project #55
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,55 @@ | ||||||
# Getting Started | ||||||
|
||||||
Rome requires a project configuration in order to operate. This can take three possible forms. | ||||||
|
||||||
- A `rome.json` file | ||||||
- A `rome.rjson` file (What is RJSON? See [#13](https://github.com/facebookexperimental/rome/issues/13)) | ||||||
- A `rome` field on `package.json` | ||||||
|
||||||
This can just be an empty file. It's required in order for Rome to determine all the files in a project. This is important as when running the CLI, we build an in-memory file system listing in order to perform operations like module resolution. | ||||||
|
||||||
```bash | ||||||
$ mkdir hello-world | ||||||
$ cd hello-world | ||||||
$ echo '{}' >rome.json | ||||||
``` | ||||||
|
||||||
## Commands | ||||||
|
||||||
Rome has a dozen different commands. Documented below are some more useful ones when testing functionality. | ||||||
|
||||||
### `lint` | ||||||
|
||||||
This command will lint a file with a set of default lints and display the produced diagnostics. | ||||||
|
||||||
When ran with no arguments, all JavaScript files in a project are linted. | ||||||
|
||||||
``` | ||||||
$ rome lint file.js | ||||||
``` | ||||||
|
||||||
### `compile` | ||||||
|
||||||
This command will compile a file with a set of default transforms. There is currently no options for this command to specify a subset of transforms. | ||||||
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.
Suggested change
|
||||||
|
||||||
``` | ||||||
$ rome compile file.js | ||||||
``` | ||||||
|
||||||
### `parse` | ||||||
|
||||||
This command will parse a file and output a pretty formatted AST. | ||||||
|
||||||
``` | ||||||
$ rome parse file.js | ||||||
``` | ||||||
|
||||||
## Daemon | ||||||
|
||||||
Rome has an optional daemon. When starting the CLI, we'll check if there's a server running, and if there is, we'll connect to and that's where the request will be processed. | ||||||
|
||||||
You can run the daemon with `rome start`, and stop it with `rome stop`. | ||||||
|
||||||
The daemon allows Rome to maintain long lived memory caches which can drastically speed up operations. We intend to utilize this server for any LSP integration. | ||||||
|
||||||
When the CLI is ran without a running server, then we initialize a server inside the CLI process that's only used for the lifetime of the command. | ||||||
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.
Suggested change
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.