@biomejs/js-api
Advanced tools
Comparing version 0.3.0-nightly.cfef948 to 0.3.0-nightly.efc084c
@@ -14,3 +14,3 @@ import type { Configuration, Diagnostic, PullDiagnosticsResult } from "@biomejs/wasm-nodejs"; | ||
* A virtual path of the file. You should add the extension, | ||
* so Rome knows how to parse the content | ||
* so Biome knows how to parse the content | ||
*/ | ||
@@ -50,7 +50,7 @@ filePath: string; | ||
* A virtual path of the file. You should add the extension, | ||
* so Rome knows how to parse the content | ||
* so Biome knows how to parse the content | ||
*/ | ||
filePath: string; | ||
} | ||
export interface RomeCreate { | ||
export interface BiomeCreate { | ||
distribution: Distribution; | ||
@@ -72,3 +72,3 @@ } | ||
} | ||
export declare class Rome { | ||
export declare class Biome { | ||
private readonly module; | ||
@@ -78,7 +78,7 @@ private readonly workspace; | ||
/** | ||
* It creates a new instance of the class {Rome}. | ||
* It creates a new instance of the class {Biome}. | ||
*/ | ||
static create(options: RomeCreate): Promise<Rome>; | ||
static create(options: BiomeCreate): Promise<Biome>; | ||
/** | ||
* Stop this instance of Rome | ||
* Stop this instance of Biome | ||
* | ||
@@ -85,0 +85,0 @@ * After calling `shutdown()` on this object, it should be considered |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Rome = exports.Distribution = void 0; | ||
exports.Biome = exports.Distribution = void 0; | ||
const wasm_1 = require("./wasm"); | ||
@@ -9,3 +9,3 @@ Object.defineProperty(exports, "Distribution", { enumerable: true, get: function () { return wasm_1.Distribution; } }); | ||
} | ||
class Rome { | ||
class Biome { | ||
constructor(module, workspace) { | ||
@@ -16,3 +16,3 @@ this.module = module; | ||
/** | ||
* It creates a new instance of the class {Rome}. | ||
* It creates a new instance of the class {Biome}. | ||
*/ | ||
@@ -22,6 +22,6 @@ static async create(options) { | ||
const workspace = new module.Workspace(); | ||
return new Rome(module, workspace); | ||
return new Biome(module, workspace); | ||
} | ||
/** | ||
* Stop this instance of Rome | ||
* Stop this instance of Biome | ||
* | ||
@@ -45,2 +45,3 @@ * After calling `shutdown()` on this object, it should be considered | ||
configuration, | ||
gitignore_matches: [], | ||
}); | ||
@@ -54,3 +55,3 @@ } | ||
try { | ||
const romePath = { | ||
const biomePath = { | ||
path, | ||
@@ -61,10 +62,10 @@ }; | ||
version: 0, | ||
path: romePath, | ||
path: biomePath, | ||
}); | ||
try { | ||
return func(romePath); | ||
return func(biomePath); | ||
} | ||
finally { | ||
this.workspace.closeFile({ | ||
path: romePath, | ||
path: biomePath, | ||
}); | ||
@@ -170,3 +171,3 @@ } | ||
} | ||
exports.Rome = Rome; | ||
exports.Biome = Biome; | ||
//# sourceMappingURL=index.js.map |
@@ -6,3 +6,3 @@ export declare type WasmBundler = typeof import("@biomejs/wasm-bundler"); | ||
/** | ||
* What kind of client Rome should use to communicate with the binary | ||
* What kind of client Biome should use to communicate with the binary | ||
*/ | ||
@@ -9,0 +9,0 @@ export declare enum Distribution { |
@@ -28,3 +28,3 @@ "use strict"; | ||
/** | ||
* What kind of client Rome should use to communicate with the binary | ||
* What kind of client Biome should use to communicate with the binary | ||
*/ | ||
@@ -31,0 +31,0 @@ var Distribution; |
@@ -1,1 +0,1 @@ | ||
{"name":"@biomejs/js-api","version":"0.3.0-nightly.cfef948","description":"JavaScript APIs for the Rome package","scripts":{"tsc":"tsc --noEmit","format":"cargo biome-cli-dev format ./ --write","ci":"cargo biome-cli-dev ci ./src && tsc --noEmit","check":"pnpm rome:check && tsc --noEmit","rome:check":"cargo biome-cli-dev check ./","check:apply":"cargo biome-cli-dev check ./ --apply-unsafe","build:wasm-bundler-dev":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-bundler --target bundler --dev --scope biomedev ../../../crates/rome_wasm","build:wasm-bundler":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-bundler --target bundler --release --scope biomedev ../../../crates/rome_wasm","build:wasm-node-dev":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-nodejs --target nodejs --dev --scope biomedev ../../../crates/rome_wasm","build:wasm-node":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-nodejs --target nodejs --release --scope biomedev ../../../crates/rome_wasm","build:wasm-web-dev":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-web --target web --dev --scope biomedev ../../../crates/rome_wasm","build:wasm-web":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-web --target web --release --scope biomedev ../../../crates/rome_wasm","test":"vitest","test:ci":"vitest --run","build":"tsc "},"files":["README.md","dist/"],"main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["JavaScript","bindings","APIs","biome"],"license":"MIT","homepage":"https://biomejs.dev","repository":{"type":"git","url":"https://github.com/biomejs/biome.git","directory":"packages/@biomejs/js-api"},"author":"Rome Tools Developers and Contributors","bugs":"https://github.com/biomejs/biome/issues","devDependencies":{"typescript":"^4.8.2","vitest":"^0.22.0","vite":"^3.0.8","@biomejs/wasm-bundler":"../wasm-bundler","@biomejs/wasm-nodejs":"../wasm-nodejs","@biomejs/wasm-web":"../wasm-web"},"peerDependencies":{"@biomejs/wasm-bundler":"^10.0.0","@biomejs/wasm-nodejs":"^10.0.0","@biomejs/wasm-web":"^10.0.0"},"peerDependenciesMeta":{"@biomejs/wasm-bundler":{"optional":true},"@biomejs/wasm-nodejs":{"optional":true},"@biomejs/wasm-web":{"optional":true}}} | ||
{"name":"@biomejs/js-api","version":"0.3.0-nightly.efc084c","description":"JavaScript APIs for the Biome package","scripts":{"tsc":"tsc --noEmit","format":"cargo biome-cli-dev format ./ --write","ci":"cargo biome-cli-dev ci ./src && tsc --noEmit","check":"pnpm biome:check && tsc --noEmit","biome:check":"cargo biome-cli-dev check ./","check:apply":"cargo biome-cli-dev check ./ --apply-unsafe","build:wasm-bundler-dev":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-bundler --target bundler --dev --scope biomedev ../../../crates/biome_wasm","build:wasm-bundler":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-bundler --target bundler --release --scope biomedev ../../../crates/biome_wasm","build:wasm-node-dev":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-nodejs --target nodejs --dev --scope biomedev ../../../crates/biome_wasm","build:wasm-node":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-nodejs --target nodejs --release --scope biomedev ../../../crates/biome_wasm","build:wasm-web-dev":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-web --target web --dev --scope biomedev ../../../crates/biome_wasm","build:wasm-web":"wasm-pack build --out-dir ../../packages/@biomejs/wasm-web --target web --release --scope biomedev ../../../crates/biome_wasm","test":"vitest","test:ci":"vitest --run","build":"tsc "},"files":["README.md","LICENSE-APACHE","LICENSE-MIT","ROME-LICENSE-MIT","dist/"],"main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["JavaScript","bindings","APIs","biome"],"license":"MIT OR Apache-2.0","homepage":"https://biomejs.dev","repository":{"type":"git","url":"https://github.com/biomejs/biome.git","directory":"packages/@biomejs/js-api"},"author":"Biome Developers and Contributors","bugs":"https://github.com/biomejs/biome/issues","devDependencies":{"typescript":"^4.8.2","vitest":"^0.22.0","vite":"^3.0.8","@biomejs/wasm-bundler":"../wasm-bundler","@biomejs/wasm-nodejs":"../wasm-nodejs","@biomejs/wasm-web":"../wasm-web"},"peerDependencies":{"@biomejs/wasm-bundler":"^10.0.0","@biomejs/wasm-nodejs":"^10.0.0","@biomejs/wasm-web":"^10.0.0"},"peerDependenciesMeta":{"@biomejs/wasm-bundler":{"optional":true},"@biomejs/wasm-nodejs":{"optional":true},"@biomejs/wasm-web":{"optional":true}}} |
@@ -1,4 +0,4 @@ | ||
# Rome JavaScript Bindings | ||
# Biome JavaScript Bindings | ||
Official JavaScript bindings for [Rome](https://rome.tools/) | ||
Official JavaScript bindings for [Biome](https://biomejs.dev/) | ||
@@ -11,7 +11,7 @@ > **Warning**: | ||
```shell | ||
npm i @rometools/js-api | ||
npm i @rometools/wasm-<dist> | ||
npm i @biomejs/js-api | ||
npm i @biomejs/wasm-<dist> | ||
``` | ||
You need to install one of the `@rometools/wasm-*` package as a **peer dependency** for this package to work correctly, out of the following distributions: | ||
You need to install one of the `@biomejs/wasm-*` package as a **peer dependency** for this package to work correctly, out of the following distributions: | ||
- `@biomejs/wasm-bundler`: Install this package if you're using a bundler that supports importing `*.wasm` files directly | ||
@@ -24,9 +24,9 @@ - `@biomejs/wasm-nodejs`: Install this package if you're using Node.js to load the WebAssembly bundle use the `fs` API | ||
```js | ||
import { Rome, Distribution } from "@biomejs/js-api"; | ||
import { Biome, Distribution } from "@biomejs/js-api"; | ||
const rome = await Rome.create({ | ||
const biome = await Biome.create({ | ||
distribution: Distribution.NODE, // Or BUNDLER / WEB depending on the distribution package you've installed | ||
}); | ||
const formatted = await rome.formatContent("function f (a, b) { return a == b; }", { | ||
const formatted = await biome.formatContent("function f (a, b) { return a == b; }", { | ||
filePath: "example.js", | ||
@@ -37,7 +37,7 @@ }); | ||
const result = await rome.lintContent(formatted.content, { | ||
const result = await biome.lintContent(formatted.content, { | ||
filePath: "example.js", | ||
}); | ||
const html = rome.printDiagnostics(result.diagnostics, { | ||
const html = biome.printDiagnostics(result.diagnostics, { | ||
filePath: "example.js", | ||
@@ -52,3 +52,3 @@ fileSource: formatted.content, | ||
The project philosophy can be found on our [website](https://docs.rome.tools/internals/philosophy/). | ||
The project philosophy can be found on our [website](https://biomejs.dev/internals/philosophy/). | ||
@@ -59,2 +59,2 @@ ## Community | ||
Additional project coordination and real-time discussion happens on our [Discord server](https://discord.gg/rome). Remember that all activity on the Discord server is still moderated and will be strictly enforced under the project's [Code of Conduct](../../CODE_OF_CONDUCT.md). | ||
Additional project coordination and real-time discussion happens on our [Discord server](https://discord.gg/BypW39g6Yc). Remember that all activity on the Discord server is still moderated and will be strictly enforced under the project's [Code of Conduct](../../CODE_OF_CONDUCT.md). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
37342
13
411
1