@biomejs/biome 0.1.0-nightly.54e85a2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/bin/biome +67 -0
- package/configuration_schema.json +1706 -0
- package/package.json +1 -0
- package/scripts/postinstall.js +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/rome/brand/main/PNG/logo_white_yellow_transparent.png" width="700">
|
|
4
|
+
<img alt="Rome's logo depicting an ancient Roman arch with the word Rome to its side" src="https://raw.githubusercontent.com/rome/brand/main/PNG/logo_transparent.png" width="700">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<div align="center">
|
|
9
|
+
|
|
10
|
+
[![MIT licensed][mit-badge]][mit-url]
|
|
11
|
+
[![Discord chat][discord-badge]][discord-url]
|
|
12
|
+
[![CI on main][ci-badge]][ci-url]
|
|
13
|
+
[![npm version][npm-badge]][npm-url]
|
|
14
|
+
[![VSCode version][vscode-badge]][vscode-url]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg?color=brightgreen
|
|
18
|
+
[mit-url]: LICENSE
|
|
19
|
+
[discord-badge]: https://img.shields.io/discord/678763474494423051?logo=discord&label=discord&color=brightgreen
|
|
20
|
+
[discord-url]: https://discord.gg/rome
|
|
21
|
+
[ci-badge]: https://github.com/biomejs/biome/actions/workflows/main.yml/badge.svg
|
|
22
|
+
[ci-url]: https://github.com/biomejs/biome/actions/workflows/main.yml
|
|
23
|
+
[npm-badge]: https://img.shields.io/npm/v/rome/latest?color=brightgreen
|
|
24
|
+
[npm-url]: https://www.npmjs.com/package/rome/v/latest
|
|
25
|
+
[vscode-badge]: https://img.shields.io/visual-studio-marketplace/v/rome.rome?color=brightgreen&label=vscode
|
|
26
|
+
[vscode-url]: https://marketplace.visualstudio.com/items?itemName=rome.rome
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
**Rome** is a formatter, linter, bundler, and [more](https://rome.tools/) for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS.
|
|
31
|
+
|
|
32
|
+
**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.
|
|
33
|
+
|
|
34
|
+
**Rome** unifies functionality that has previously been separate tools. Building upon a shared base allows us to provide a cohesive experience for processing code, displaying errors, parallelizing work, caching, and configuration.
|
|
35
|
+
|
|
36
|
+
**Rome** has strong conventions and aims to have minimal configuration. Read more about our [project philosophy](https://docs.rome.tools/internals/philosophy/).
|
|
37
|
+
|
|
38
|
+
**Rome** is [written in Rust](https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust.html).
|
|
39
|
+
|
|
40
|
+
**Rome** has first-class IDE support, with a sophisticated parser that represents the source text in full fidelity
|
|
41
|
+
and top-notch error recovery.
|
|
42
|
+
|
|
43
|
+
**Rome** is [MIT licensed](https://github.com/biomejs/biome/tree/main/LICENSE) and moderated under the [Contributor Covenant Code of Conduct](https://github.com/biomejs/biome/tree/main/CODE_OF_CONDUCT.md).
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Documentation
|
|
47
|
+
|
|
48
|
+
Check out our [homepage](https://rome.tools) to learn more about Rome, or directly head to the [Getting Started guide](https://docs.rome.tools/guides/getting-started/) if you want to start using Rome.
|
|
49
|
+
|
|
50
|
+
## Technical documentation
|
|
51
|
+
|
|
52
|
+
Browse Rome's internal [Rust API Documentation] if you're interested to learn more about how Rome works.
|
|
53
|
+
|
|
54
|
+
[Rust API Documentation]: https://rustdocs.rome.tools/
|
|
55
|
+
|
package/bin/biome
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { platform, arch, env, version, release } = process;
|
|
3
|
+
|
|
4
|
+
const PLATFORMS = {
|
|
5
|
+
win32: {
|
|
6
|
+
x64: "@biomsjs/cli-win32-x64/rome.exe",
|
|
7
|
+
arm64: "@biomsjs/cli-win32-arm64/rome.exe",
|
|
8
|
+
},
|
|
9
|
+
darwin: {
|
|
10
|
+
x64: "@biomsjs/cli-darwin-x64/rome",
|
|
11
|
+
arm64: "@biomsjs/cli-darwin-arm64/rome",
|
|
12
|
+
},
|
|
13
|
+
linux: {
|
|
14
|
+
x64: "@biomsjs/cli-linux-x64/rome",
|
|
15
|
+
arm64: "@biomsjs/cli-linux-arm64/rome",
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const binPath = env.ROME_BINARY || PLATFORMS?.[platform]?.[arch];
|
|
20
|
+
if (binPath) {
|
|
21
|
+
const result = require("child_process").spawnSync(
|
|
22
|
+
require.resolve(binPath),
|
|
23
|
+
process.argv.slice(2),
|
|
24
|
+
{
|
|
25
|
+
shell: false,
|
|
26
|
+
stdio: "inherit",
|
|
27
|
+
env: {
|
|
28
|
+
...env,
|
|
29
|
+
JS_RUNTIME_VERSION: version,
|
|
30
|
+
JS_RUNTIME_NAME: release.name,
|
|
31
|
+
NODE_PACKAGE_MANAGER: detectPackageManager(),
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (result.error) {
|
|
37
|
+
throw result.error;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
process.exitCode = result.status;
|
|
41
|
+
} else {
|
|
42
|
+
console.error(
|
|
43
|
+
"The Biome CLI package doesn't ship with prebuilt binaries for your platform yet. " +
|
|
44
|
+
"You can still use the CLI by cloning the rome/tools repo from GitHub, " +
|
|
45
|
+
"and follow the instructions there to build the CLI for your platform.",
|
|
46
|
+
);
|
|
47
|
+
process.exitCode = 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* NPM, Yarn, and other package manager set the `npm_config_user_agent`. It has the following format:
|
|
52
|
+
*
|
|
53
|
+
* ```
|
|
54
|
+
* "npm/8.3.0 node/v16.13.2 win32 x64 workspaces/false
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @returns The package manager string (`npm/8.3.0`) or null if the user agent string isn't set.
|
|
58
|
+
*/
|
|
59
|
+
function detectPackageManager() {
|
|
60
|
+
const userAgent = env.npm_config_user_agent;
|
|
61
|
+
|
|
62
|
+
if (userAgent == null) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return userAgent.split(" ")[0];
|
|
67
|
+
}
|