More release tweaks
MODIFY
internal/cli/cli.ts
internal/cli/cli.ts
@@ -13,6 +13,7 @@ import {
DEFAULT_CLIENT_FLAGS,
DEFAULT_CLIENT_REQUEST_FLAGS,
PLATFORMS,
+ REQUIRED_NODE_VERSION_RANGE,
USER_CONFIG_DIRECTORY,
VERSION,
localCommands,
@@ -36,6 +37,8 @@ import {
} from "@internal/markup";
import {JSONObject, stringifyJSON} from "@internal/codec-json";
import {getEnvVar} from "@internal/cli-environment";
+import {satisfiesSemver} from "@internal/codec-semver";
+import {Reporter} from "@internal/cli-reporter";
type CLIFlags = {
logs: boolean;
@@ -54,6 +57,22 @@ type CLIFlags = {
export default async function cli() {
setProcessTitle("cli");
+
+ // Verify correct Node version
+ if (
+ !satisfiesSemver(
+ process.version,
+ REQUIRED_NODE_VERSION_RANGE,
+ {loose: true},
+ )
+ ) {
+ const reporter = Reporter.fromProcess();
+ reporter.error(
+ markup`Node <emphasis>${REQUIRED_NODE_VERSION_RANGE}</emphasis> is required, but you are on <emphasis>${process.version}</emphasis>`,
+ );
+ process.exit(1);
+ }
+
const p = parseCLIFlagsFromProcess({
programName: getEnvVar("ROME_DEV").type === "ENABLED" ? "dev-rome" : "rome",
usage: "[command] [flags]",
@@ -323,6 +342,8 @@ export default async function cli() {
let commandFlags: JSONObject = {};
let args: Array<string> = [];
+ const isRelease = getEnvVar("ROME_DEV").type !== "ENABLED";
+
// Create command handlers. We use a set here since we may have some conflicting server and local command names. We always want the local command to take precedence.
const commandNames = new Set([
...localCommands.keys(),
@@ -339,7 +360,7 @@ export default async function cli() {
ignoreFlags: local.ignoreFlags,
examples: local.examples,
usage: local.usage,
- hidden: local.hidden,
+ hidden: isRelease && local.hidden,
callback(_commandFlags) {
commandFlags = _commandFlags;
args = p.getArgs();
@@ -359,7 +380,7 @@ export default async function cli() {
ignoreFlags: server.ignoreFlags,
usage: server.usage,
examples: server.examples,
- hidden: server.hidden,
+ hidden: isRelease && server.hidden,
callback(_commandFlags) {
commandFlags = _commandFlags;
args = p.getArgs();

MODIFY
internal/core/common/constants.ts
internal/core/common/constants.ts
@@ -34,6 +34,8 @@ export const MAX_WORKER_COUNT = Math.min(CPU_COUNT, 4);
// Verson constants
export let VERSION = String(packageJson.version);
+export let REQUIRED_NODE_VERSION_RANGE = String(packageJson.engines.node);
+
// Vendor Rome and Trunk Rome could have the same version number if there was no release in between
// Ensure they are properly namespaced to avoid having daemon socket conflicts
if (getEnvVar("ROME_DEV").type === "ENABLED") {

MODIFY
internal/core/server/ServerRequest.ts
internal/core/server/ServerRequest.ts
@@ -1302,6 +1302,7 @@ export default class ServerRequest {
onSearchNoMatch: async (path) => {
if (!opts.ignoreArgumentMisses) {
const location = argToLocation.get(path) ?? {};
+ await this.server.projectManager.assertProject(path, location);
await globUnmatched(this, opts, path, location);
}
},

MODIFY
internal/core/server/commands/ci.ts
internal/core/server/commands/ci.ts
@@ -21,6 +21,7 @@ export default createServerCommand({
category: commandCategories.CODE_QUALITY,
description: markup`run lint and tests`,
usage: "",
+ hidden: true,
examples: [],
defineFlags(consumer: Consumer): Flags {
return {

MODIFY
internal/core/server/commands/init.ts
internal/core/server/commands/init.ts
@@ -147,7 +147,7 @@ export default createServerCommand<Flags>({
...config,
...partial,
};
- await writeFile(configPath, stringifyRJSON(config, comments));
+ await writeFile(configPath, stringifyRJSON(config, comments) + "\n");
}
// Create initial project config

MODIFY
internal/core/server/commands/test.ts
internal/core/server/commands/test.ts
@@ -21,6 +21,7 @@ type Flags = Omit<TestServerRunnerOptions, "verboseDiagnostics">;
export default createServerCommand({
category: commandCategories.CODE_QUALITY,
description: markup`run tests`,
+ hidden: true,
usage: "",
examples: [],
defineFlags(c: Consumer): Flags {

MODIFY
internal/core/server/fs/RecoveryStore.ts
internal/core/server/fs/RecoveryStore.ts
@@ -152,7 +152,7 @@ export default class RecoveryStore {
paths.push([path, timestamp]);
}
- paths.sort((a, b) => a[1] - b[1]);
+ paths.sort((a, b) => b[1] - a[1]);
return new AbsoluteFilePathSet(paths.map(([path]) => path));
}

MODIFY
internal/core/server/fs/glob.ts
internal/core/server/fs/glob.ts
@@ -266,7 +266,16 @@ class GlobberWatcher {
async init(): Promise<EventSubscription> {
const {memoryFs} = this;
const subs = this.setupEvents();
+ const finalSubs = mergeEventSubscriptions([
+ ...subs,
+ {
+ unsubscribe: async () => {
+ await this.flushLock.waitLockDrained();
+ },
+ },
+ ]);
+ try {
const promises: Array<Promise<unknown>> = [];
const batchPaths = new AbsoluteFilePathSet();
this.batchPaths = batchPaths;
@@ -284,14 +293,12 @@ class GlobberWatcher {
await Promise.all(promises);
this.batchPaths = undefined;
await this.flush(batchPaths, true);
+ await this.globber.get(true);
- return mergeEventSubscriptions([
- ...subs,
- {
- unsubscribe: async () => {
- await this.flushLock.waitLockDrained();
- },
- },
- ]);
+ return finalSubs;
+ } catch (err) {
+ await finalSubs.unsubscribe();
+ throw err;
+ }
}
}

MODIFY
package.json
package.json
"license": "MIT",
"version": "10.0.0-beta",
"engines": {
- "node": ">=12.0.0"
+ "node": ">=12.10.0"
},
"//": "Look! No deps!",
"dependencies": {},

MODIFY
public-packages/rome/package.json
public-packages/rome/package.json
},
"scripts": {
"postinstall": "echo \"Thanks for using Rome! This space reserved for future sustainability announcements. See https://github.com/romefrontend/rome/pull/198 for context.\""
+ },
+ "engines": {
+ "node": ">=12.10.0"
}
}

MODIFY
public-packages/vscode-extension/package.json
public-packages/vscode-extension/package.json
{
"name": "vscode-rome",
+ "publisher": "rome",
"displayName": "Rome",
"description": "Rome LSP VSCode extension",
"version": "0.0.1",

MODIFY
website/.eleventy.js
website/.eleventy.js
@@ -209,6 +209,18 @@ module.exports = function(eleventyConfig) {
},
);
+ eleventyConfig.addFilter(
+ "titlify",
+ function(title) {
+ title = (title || "").trim();
+ if (title !== "") {
+ title += " \u2014 ";
+ }
+ title += "Rome Frontend Toolchain";
+ return title;
+ },
+ );
+
eleventyConfig.addFilter(
"kebabCase",
function(string) {

MODIFY
website/src/_includes/docs/linting.md
website/src/_includes/docs/linting.md
@@ -65,7 +65,7 @@ rome check --review
### Rules
-We have support for over 100 rules, including the most common rules needed working with TypeScript and React. Check the full [list of rules](/docs/lint/rules). All rules are enabled by default, and cannot be disabled. [Suppressions](#suppressions) can be used to hide specific lint errors.
+We have support for over 100 rules, including the most common rules needed working with TypeScript and React. See the full [list of rules](/docs/lint/rules). All rules are enabled by default, and cannot be disabled. [Suppressions](#suppressions) can be used to hide specific lint errors.
### Formatting
@@ -181,7 +181,7 @@ Get the most out of Rome by integrating it with your editor. You will get diagno
Rome implements the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) supported by [various editors](https://microsoft.github.io/language-server-protocol/implementors/tools/). We have official extensions available for:
-- [VSCode](#)
+- [VSCode](- [VSCode](https://marketplace.visualstudio.com/items?itemName=rome.rome))
Once an editor extension has been installed, the version of Rome in your project will be automatically found and used. As we improve Rome and add new functionality any changes will automatically work with your editor!

MODIFY
website/src/blog/posts/2020-08-08_introducing_rome.md
website/src/blog/posts/2020-08-08_introducing_rome.md
@@ -11,29 +11,29 @@ permalink: /blog/2020/08/08/introducing-rome.html
layout: layouts/blog.liquid
---
-We're excited to announce the first release and general availability of the **Rome** linter for JavaScript and TypeScript.
+We're excited to announce the first beta release and general availability of the **Rome** linter for JavaScript and TypeScript.
-This is only the beginning. Rome is not only linter but also a compiler, bundler, test runner, and [more](/#development-status), for JavaScript, TypeScript, HTML, JSON, Markdown, and CSS. We aim to unify the entire frontend development toolchain.
+This is just the beginning. Rome is not only linter, but also a compiler, bundler, test runner, and [more](/#development-status), for JavaScript, TypeScript, HTML, JSON, Markdown, and CSS. We aim to unify the entire frontend development toolchain.
Rome is a [monolithic](https://en.wikipedia.org/wiki/Monolithic_application) tool containing functionality that has traditionally been separate tools in the frontend ecosystem. We call this a toolchain. It is **not** a collection of existing tools, but completely custom, built [largely](/credits) from scratch, contained entirely in a single package and codebase.
Rome is designed to replace [Babel](https://babeljs.io/), [ESLint](https://eslint.org/), [Webpack](https://webpack.js.org/), [Prettier](https://prettier.io/), [Jest](https://jestjs.io/), and others.
+We have significant implementations already for most components, including compiling, bundling, and testing, all using the same core abstractions and internal libraries. Rome is even [self-hosted](https://en.wikipedia.org/wiki/Self-hosting_(compilers)) and we use them to build and develop Rome itself! Once usage as a linter has stabilized, we will move onto the unreleased features to prepare and generalize them for public usage.
+
<!-- DESCRIPTION_END -->
Linting is an excellent low-risk way for us to mature and validate shared functionality like editor integration, configuration, parallelization, caching, parsing, and dependency analysis. It is not in the critical build path for development so is relatively straight forward and safe to adopt.
-We believe that Rome is one of the best linters available for JavaScript. With excellent errors including recommendations and suggestions, terminal interface, and the ability to automatically fix most issues, we believe it stands alone despite our large scope.
-
{% include docs/cli-screenshots/check.md %}
-Since open sourcing, at the beginning of the year, we have received contributions from over [70 contributors](https://github.com/romefrontend/rome/graphs/contributors) and [600 pull requests](https://github.com/romefrontend/rome/pulls?q=is%3Apr+is%3Amerged). We have an established [team](/credits#team), a formal [governance model](https://github.com/romefrontend/rome/blob/main/GOVERNANCE.md), and a [code of conduct](https://github.com/romefrontend/rome/blob/main/CODE_OF_CONDUCT.md) enforcement policy. This ensures transparency around project decisions, moderation, and direction.
+Even though this is a beta, we have support for over 100 lint rules, including the most common rules needed when working with TypeScript and React. See the full [list of rules](/docs/lint/rules). You can expect a full featured experience, however may still encounter bugs. With most of the feature development out of the way we will be focusing primarily on stability.
-We have significant implementations already for most components, including compiling, bundling, and testing, all using the same core abstractions and internal libraries. Rome is even [self-hosted](https://en.wikipedia.org/wiki/Self-hosting_(compilers)) and we use them to build and develop Rome itself! Once usage as a linter has stabilized, we will move onto the unreleased features to prepare and generalize them for public usage.
+Since open sourcing, at the beginning of the year, we have received contributions from over [70 contributors](https://github.com/romefrontend/rome/graphs/contributors) and [600 pull requests](https://github.com/romefrontend/rome/pulls?q=is%3Apr+is%3Amerged). We have an established [team](/credits#team), a formal [governance model](https://github.com/romefrontend/rome/blob/main/GOVERNANCE.md), and a [code of conduct](https://github.com/romefrontend/rome/blob/main/CODE_OF_CONDUCT.md) enforcement policy. This ensures transparency around project decisions, moderation, and direction.
You can read more about Rome, including how to get started, in our [documentation](/). If you would like to get involved, check out our [contributing instructions](https://github.com/romefrontend/rome/blob/main/CONTRIBUTING.md). If you are interested in reading more about the history and rationale for the project, you can continue reading below.
-&mdash; [Sebastian McKenzie](https://twitter.com/sebmck)
+{% include action-links.liquid %}
## History
@@ -65,8 +65,10 @@ Language tooling maintainers spend so much time working on the same things. Proc
A linter in the JavaScript ecosystem is exactly the same as a compiler. They both consume code, then produce compiled code and errors. What the compiled code is varies. In the case of a linter, the compiled code is formatted source code with automatic fixes applied. The more powerful your compilation infrastructure, the more theoretically powerful your linter could be. These commonalities extend to pretty much anything that involves language processing. We can build more powerful tools using a shared base that is easily adaptable.
-Rome is the spiritual successor of that idea, except rather than exposing a large public API for other tools to be built on, we are building them all in one place, with batteries included. We support frontend languages other than JavaScript too, those that can benefit the most from tight integration.
-
I had always maintained private repos where I would experiment with ideas, but the original code that would become Rome was started at the beginning of 2017 while I was working for Facebook in my free time. I continued iterating and experimenting on the idea and building out all the different pieces, until 2019, when I was given the opportunity to work on and explore using it at Facebook full-time.
I eventually left Facebook and the project became open source in February 2020 where I would continue it as an independent community-driven project.
+
+Rome is the spiritual successor of Babel. I've taken the lessons I learnt, and refined the mission. Rather than exposing a large public API for other tools to be built on, we are building them all in one place, with batteries included. I'm excited to be trying something new that the JavaScript and web ecosystem haven't seen before.
+
+&mdash; [Sebastian McKenzie](https://twitter.com/sebmck)

More release tweaks (#959)