You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/speakeasy-reference/generation/ts-config.mdx
+69Lines changed: 69 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,75 @@ typescript:
75
75
]}
76
76
/>
77
77
78
+
## Additional scripts
79
+
80
+
```yml
81
+
typescript:
82
+
additionalScripts:
83
+
format: "prettier --write src"
84
+
docs: "typedoc --out docs src"
85
+
custom-test: "vitest run --coverage"
86
+
```
87
+
88
+
<Table
89
+
data={[
90
+
{ name: "additionalScripts", required: "false", default: "{}", description: "Custom npm scripts to add to the `package.json` file. Scripts with the same name as default scripts will override them." }
91
+
]}
92
+
columns={[
93
+
{ key: "name", header: "Name" },
94
+
{ key: "required", header: "Required" },
95
+
{ key: "default", header: "Default Value" },
96
+
{ key: "description", header: "Description" }
97
+
]}
98
+
/>
99
+
100
+
### How scripts are merged
101
+
102
+
The feature uses an override strategy where additional scripts take precedence over default scripts:
103
+
104
+
1. **Default scripts** are generated automatically based on SDK configuration:
105
+
106
+
```json
107
+
{
108
+
"lint": "eslint --cache --max-warnings=0 src",
109
+
"build": "tsc",
110
+
"prepublishOnly": "npm run build"
111
+
}
112
+
```
113
+
114
+
2. **Test scripts** are added if tests are enabled:
115
+
116
+
```json
117
+
{
118
+
"test": "vitest run src --reporter=junit --outputFile=.speakeasy/reports/tests.xml --reporter=default",
119
+
"check": "npm run test && npm run lint"
120
+
}
121
+
```
122
+
123
+
3. **Additional scripts** override defaults if they have the same name:
0 commit comments