@jsrepo/transform-oxfmt 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 jsrepo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @jsrepo/transform-oxfmt
2
+
3
+ [![npm version](https://flat.badgen.net/npm/v/@jsrepo/transform-oxfmt)](https://npmjs.com/package/@jsrepo/transform-oxfmt)
4
+ [![npm downloads](https://flat.badgen.net/npm/dm/@jsrepo/transform-oxfmt)](https://npmjs.com/package/@jsrepo/transform-oxfmt)
5
+
6
+ A transform plugin for formatting registry items with oxfmt before they are added to your project.
7
+
8
+ ## Usage
9
+
10
+ Run the following command to install and add the transform to your config:
11
+
12
+ ```sh
13
+ jsrepo config transform @jsrepo/transform-oxfmt
14
+ ```
15
+
16
+ ### Manual Configuration
17
+
18
+ Install the transform plugin:
19
+
20
+ ```sh
21
+ pnpm install @jsrepo/transform-oxfmt -D
22
+ ```
23
+
24
+ Add the transform to your config:
25
+
26
+ ```ts
27
+ import { defineConfig } from "jsrepo";
28
+ import oxfmt from "@jsrepo/transform-oxfmt";
29
+
30
+ export default defineConfig({
31
+ transforms: [oxfmt()],
32
+ });
33
+ ```
34
+
35
+ ### Options
36
+
37
+ The transform accepts oxfmt's `FormatOptions` to customize formatting behavior:
38
+
39
+ ```ts
40
+ import { defineConfig } from "jsrepo";
41
+ import oxfmt from "@jsrepo/transform-oxfmt";
42
+
43
+ export default defineConfig({
44
+ transforms: [oxfmt({ semi: false })],
45
+ });
46
+ ```
@@ -0,0 +1,24 @@
1
+ import { FormatOptions } from "oxfmt";
2
+ import { Transform } from "jsrepo";
3
+
4
+ //#region src/index.d.ts
5
+
6
+ /**
7
+ * A transform plugin for jsrepo to format code with oxfmt.
8
+ * @example
9
+ * ```ts
10
+ * import { defineConfig } from "jsrepo";
11
+ * import oxfmt from "@jsrepo/transform-oxfmt";
12
+ *
13
+ * export default defineConfig({
14
+ * // ...
15
+ * transforms: [oxfmt()],
16
+ * });
17
+ * ```
18
+ *
19
+ * @param options - The options for the transform plugin.
20
+ */
21
+ declare function export_default(options?: FormatOptions): Transform;
22
+ //#endregion
23
+ export { export_default as default };
24
+ //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import{format as e}from"oxfmt";function t(e={}){return{transform:async({code:t,fileName:r})=>({code:await n(r,t,e)})}}async function n(t,n,r){try{let i=await e(t,n,r);return i.errors.length>0?void 0:i.code}catch{return}}export{t as default};
2
+ //# sourceMappingURL=index.mjs.map
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@jsrepo/transform-oxfmt",
3
+ "description": "A transform plugin for jsrepo to format code with oxfmt.",
4
+ "version": "1.0.0",
5
+ "license": "MIT",
6
+ "homepage": "https://jsrepo.dev",
7
+ "author": {
8
+ "name": "Aleksei Gurianov",
9
+ "url": "https://github.com/guria"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/jsrepojs/jsrepo"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/jsrepojs/jsrepo/issues"
17
+ },
18
+ "keywords": [
19
+ "jsrepo",
20
+ "transform",
21
+ "oxfmt",
22
+ "plugin"
23
+ ],
24
+ "type": "module",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.mts",
28
+ "default": "./dist/index.mjs"
29
+ }
30
+ },
31
+ "main": "./dist/index.mjs",
32
+ "files": [
33
+ "dist/**/*",
34
+ "!dist/**/*.map"
35
+ ],
36
+ "peerDependencies": {
37
+ "oxfmt": "0.x",
38
+ "jsrepo": "3.1.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^25.0.3",
42
+ "tsdown": "0.19.0-beta.3",
43
+ "typescript": "^5.9.3"
44
+ },
45
+ "scripts": {
46
+ "build": "tsdown",
47
+ "dev": "tsdown --watch",
48
+ "check": "tsc --noEmit",
49
+ "bundle-analyze": "FORCE_COLOR=1 node ../../bundle-analyzer/dist/index.mjs analyze ."
50
+ }
51
+ }