Skip to content

Commit 3dcaa95

Browse files
feat: add format script support across all packages
- Add format task to turbo.json configuration with proper input patterns - Add 'format: prettier --write .' script to all package.json files - Update root format command to use 'turbo format --filter=./packages/*' - Include ReScript files (.res) in format task input patterns - Ensure consistent formatting workflow across TypeScript and ReScript packages This enables unified code formatting across the entire monorepo using turbo for parallel execution and caching.
1 parent 180253b commit 3dcaa95

File tree

10 files changed

+185
-180
lines changed

10 files changed

+185
-180
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"build:types": "turbo build:types --filter=./packages/*",
1818
"build:umd:cjs": "turbo build:umd:cjs --filter=./packages/*",
1919
"build": "turbo build --filter=./packages/*",
20-
"format": "prettier --write .",
20+
"format": "turbo format --filter=./packages/*",
2121
"lint": "turbo lint --filter=./packages/*",
2222
"prepare": "husky && npm run build",
2323
"release": "shipjs prepare",

packages/calculator-bigint/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"build:types": "node ../../scripts/build-types.mjs",
4040
"build:umd:cjs": "rollup --config",
4141
"lint": "node ../../scripts/lint.mjs --ext .js,.ts .",
42-
"test": "node ../../scripts/test.mjs --projects=./packages/calculator-bigint"
42+
"test": "node ../../scripts/test.mjs --projects=./packages/calculator-bigint",
43+
"format": "prettier --write ./src"
4344
},
4445
"dependencies": {
4546
"@dinero.js/core": "2.0.0-alpha.14"

packages/calculator-number/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"build:definitions": "tsc -b",
3939
"build:types": "node ../../scripts/build-types.mjs",
4040
"build:umd:cjs": "rollup --config",
41+
"format": "prettier --write ./src",
4142
"lint": "node ../../scripts/lint.mjs --ext .js,.ts .",
4243
"test": "node ../../scripts/test.mjs --projects=./packages/calculator-number"
4344
},

packages/core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"build:definitions": "tsc -b",
3737
"build:types": "node ../../scripts/build-types.mjs",
3838
"build:umd:cjs": "rollup --config",
39+
"format": "prettier --write ./src",
3940
"lint": "node ../../scripts/lint.mjs --ext .js,.ts .",
4041
"test": "node ../../scripts/test.mjs --projects=./packages/core"
4142
},

packages/currencies/etc/currencies.api.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
55
```ts
6-
76
// @public
87
export const AED: Currency<number>;
98

@@ -123,9 +122,9 @@ export const CUP: Currency<number>;
123122

124123
// @public (undocumented)
125124
export type Currency<TAmount> = {
126-
readonly code: string;
127-
readonly base: TAmount | readonly TAmount[];
128-
readonly exponent: TAmount;
125+
readonly code: string;
126+
readonly base: TAmount | readonly TAmount[];
127+
readonly exponent: TAmount;
129128
};
130129

131130
// @public
@@ -510,5 +509,4 @@ export const ZMW: Currency<number>;
510509
export const ZWL: Currency<number>;
511510

512511
// (No @packageDocumentation comment for this package)
513-
514512
```

packages/currencies/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@
5050
"res:format:check": "rescript format --check",
5151
"clean": "npm run build:clean && npm run res:clean",
5252
"dev": "npm run res:dev",
53-
"format": "npm run res:format",
53+
"format": "prettier --write .",
5454
"format:check": "npm run res:format:check",
5555
"lint": "rescript format --check"
5656
},
5757
"devDependencies": {
5858
"rescript": "^12.1.0"
59-
6059
}
6160
}

packages/currencies/rescript.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"basic": false
2626
}
2727
}
28-
}
28+
}

0 commit comments

Comments
 (0)