Skip to content

Commit 0cf2c77

Browse files
committed
docs: add prettier ignore & update minification status
1 parent 96c38d9 commit 0cf2c77

26 files changed

+239
-132
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ root = true
44
indent_size = 2
55
end_of_line = lf
66
insert_final_newline = true
7+
trim_trailing_whitespace = true

.prettierignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
tests/__snapshots__
2-
docs/reference/config-options.md
3-
docs/zh-CN/reference/config-options.md

docs/.vitepress/scripts/docs-generate.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function runTypedoc(tsconfigPath: string): Promise<void> {
3434
* Type definitions for file operations
3535
*/
3636
type FileOperation = {
37-
type: 'delete-lines' | 'replace'
37+
type: 'delete-lines' | 'replace' | 'prepend' | 'append'
3838
lineStart?: number
3939
lineEnd?: number
4040
pattern?: string | RegExp
@@ -93,6 +93,10 @@ class FileMapper {
9393
new RegExp(op.pattern, 'g'),
9494
op.replacement,
9595
)
96+
} else if (op.type === 'prepend' && op.replacement !== undefined) {
97+
content = `${op.replacement}\n${content}`
98+
} else if (op.type === 'append' && op.replacement !== undefined) {
99+
content = `${content}\n${op.replacement}\n`
96100
}
97101
}
98102

@@ -146,8 +150,16 @@ class FileMapper {
146150
additionalOps: FileOperation[] = [],
147151
): void {
148152
// Common operation: remove first 6 lines
149-
const operations = [
150-
{ type: 'delete-lines' as const, lineStart: 1, lineEnd: 6 },
153+
const operations: FileOperation[] = [
154+
{ type: 'delete-lines', lineStart: 1, lineEnd: 6 },
155+
{
156+
type: 'prepend',
157+
replacement: '<!-- prettier-ignore-start -->',
158+
},
159+
{
160+
type: 'append',
161+
replacement: '<!-- prettier-ignore-end -->',
162+
},
151163
...additionalOps,
152164
]
153165
this.modifyFile(filePath, operations)

docs/guide/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Getting Started
22

33
:::warning 🚧 Beta Software
4-
[Rolldown](https://rolldown.rs) is currently in beta status. While it can already handle most production use cases, there may still be bugs and rough edges. Most notably, the built-in minification feature is still a work in progress.
4+
[Rolldown](https://rolldown.rs) is currently in beta status. While it can already handle most production use cases, there may still be bugs and rough edges.
55
:::
66

77
## Installation

docs/options/minification.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ You can enable minification in `tsdown` using the `--minify` option:
88
tsdown --minify
99
```
1010

11-
> [!WARNING]
12-
> The minification feature is currently **experimental**. While it can be used, it may not handle all edge cases perfectly. Use it with caution, and thoroughly test your output in production environments.
11+
> [!NOTE]
12+
> The minification feature is based on [Oxc](https://oxc.rs/docs/contribute/minifier), which is currently in alpha and can still have bugs. We recommend thoroughly testing your output in production environments.
1313
1414
### Example
1515

docs/options/target.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The `target` setting determines which JavaScript and CSS features are downlevele
44

55
For example, an arrow function `() => this` will be transformed into an equivalent `function` expression if the target is `es5` or lower.
66

7-
> [!WARNING] Syntax Downgrade Only
7+
> [!WARNING] Syntax Downgrade Only
88
> The `target` option only affects syntax transformations. It does not include runtime polyfills or shims for APIs that may not exist in the target environment. For example, if your code uses `Promise`, it will not be polyfilled for environments that lack native `Promise` support.
99
1010
## Default Target Behavior

docs/recipes/vue-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ npm install -D unplugin-vue vue-tsc
3333
- **`unplugin-vue`** compiles `.vue` single-file components into JavaScript and extracts CSS, making them ready for bundling.
3434
- **`rolldown-plugin-dts`** (with `vue: true`) and **`vue-tsc`** work together to generate accurate TypeScript declaration files for your Vue components, ensuring consumers of your library get full type support.
3535

36-
> [!TIP]
36+
> [!TIP]
3737
> Set `platform: 'neutral'` to maximize compatibility for libraries that may be used in both browser and Node.js environments.

docs/reference/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ All contents of the `public` directory will be copied to your output directory (
177177

178178
## `--public-dir <dir>`
179179

180-
An alias for `--copy`.
180+
An alias for `--copy`.
181181
**Deprecated:** Please use `--copy` instead for better clarity and consistency.
182182

183183
## `--exports`

0 commit comments

Comments
 (0)