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

Add basic instructions to setup a Rome project #55

Merged
merged 1 commit into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ $ scripts/dev-rome --help

No dependency installation step is required as we check in our `node_modules` folder that contains only a copy of TypeScript and some definitions.

Refer to [Getting Started](../docs/getting-started.md) for more usage documentation.

## Testing

You can run the test suite with the following command:
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ See [CONTRIBUTING](.github/CONTRIBUTING.md) for more information.

The current area of focus is **linting**. See the umbrella task [#20](https://github.com/facebookexperimental/rome/issues/20) for tracking.

## Getting Started

To setup Rome in a project, all you need is a `rome.json` file.

```bash
$ mkdir hello-world
$ cd hello-world
$ echo '{}' >rome.json
```

This file is used to configure Rome and indicates the boundaries of your project.

See [Getting Started](docs/getting-started.md) for more usage instructions.

## Philosophy

This list includes general ethos the project should abide by. This list is not comprehensive. Some of these are obvious but are stated for completeness.
Expand All @@ -62,4 +76,6 @@ This list includes general ethos the project should abide by. This list is not c

## Community

Contribution and development instructions can be found in [CONTRIBUTING](.github/CONTRIBUTING.md).

Additional project coordination and realtime discussion happens on our [Discord server](https://discord.gg/9WxHa5d). Remember that all activity on the Discord is still moderated and will be strictly enforced under the project's [Code of Conduct](.github/CODE_OF_CONDUCT.md).
55 changes: 55 additions & 0 deletions docs/getting-started.md
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When ran with no arguments, all JavaScript files in a project are linted.
When run 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.
Copy link

Choose a reason for hiding this comment

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

Suggested change
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.
This command will compile a file with a set of default transforms. There are currently no options for this command to specify a subset of transforms.


```
$ 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
When the CLI is run without a server running, we initialize a server inside the CLI process that's only used for the lifetime of the command.