worsier 2.0.0 → 2.1.0
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 +7 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -9,13 +9,18 @@ Prebuilt Windows x64 binaries are temporarily unavailable while
|
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
11
|
pnpm add -D worsier
|
|
12
|
-
pnpm exec worsier --init
|
|
13
12
|
pnpm exec worsier --check .
|
|
14
13
|
pnpm exec worsier --write .
|
|
15
14
|
```
|
|
16
15
|
|
|
16
|
+
The CLI uses its opinionated defaults without a configuration file. An optional `worsier.jsonc`
|
|
17
|
+
can override them; run `pnpm exec worsier --init` to create the complete typed configuration.
|
|
18
|
+
|
|
17
19
|
```js
|
|
18
20
|
import { format } from 'worsier'
|
|
19
21
|
|
|
20
|
-
const output = await format('example.ts', "import{answer,type Value}from'pkg'"
|
|
22
|
+
const output = await format('example.ts', "import{answer,type Value}from'pkg'")
|
|
21
23
|
```
|
|
24
|
+
|
|
25
|
+
Pass an optional third `FormatConfig` argument to override the programmatic defaults. The
|
|
26
|
+
programmatic API does not discover configuration files.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FormatConfig } from './types.js';
|
|
2
2
|
export type { FormatConfig } from './types.js';
|
|
3
|
-
export declare function format(fileName: string, sourceText: string, config
|
|
3
|
+
export declare function format(fileName: string, sourceText: string, config?: FormatConfig): Promise<string>;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadBinding } from './binding.js';
|
|
2
|
-
export async function format(fileName, sourceText, config) {
|
|
2
|
+
export async function format(fileName, sourceText, config = {}) {
|
|
3
3
|
const configJson = JSON.stringify(config);
|
|
4
4
|
try {
|
|
5
5
|
return await loadBinding().format(fileName, sourceText, configJson);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worsier",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A focused JavaScript and TypeScript import and variable-boundary formatter powered by Rust",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
]
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
|
-
"worsier-darwin-arm64": "2.
|
|
52
|
-
"worsier-win32-arm64-msvc": "2.
|
|
53
|
-
"worsier-linux-arm64-gnu": "2.
|
|
54
|
-
"worsier-linux-arm64-musl": "2.
|
|
55
|
-
"worsier-darwin-x64": "2.
|
|
56
|
-
"worsier-linux-x64-gnu": "2.
|
|
57
|
-
"worsier-linux-x64-musl": "2.
|
|
51
|
+
"worsier-darwin-arm64": "2.1.0",
|
|
52
|
+
"worsier-win32-arm64-msvc": "2.1.0",
|
|
53
|
+
"worsier-linux-arm64-gnu": "2.1.0",
|
|
54
|
+
"worsier-linux-arm64-musl": "2.1.0",
|
|
55
|
+
"worsier-darwin-x64": "2.1.0",
|
|
56
|
+
"worsier-linux-x64-gnu": "2.1.0",
|
|
57
|
+
"worsier-linux-x64-musl": "2.1.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/node": "26.2.0",
|