forked from prettier/prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
document/public.js
to export public apis, remove internal utils (…
- Loading branch information
Showing
22 changed files
with
125 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
#### [BREAKING] `prettier.doc.builders.concat` has been removed (#13203 by @fisker) | ||
#### [BREAKING] Update `prettier.doc` (#13203, #14456 by @fisker) | ||
|
||
`prettier.doc.builders.concat` [was deprecated in v2.3.0](https://prettier.io/blog/2021/05/09/2.3.0.html#use-arrays-instead-of-concat-9733httpsgithubcomprettierprettierpull9733-by-fiskerhttpsgithubcomfisker-thorn0httpsgithubcomthorn0), now it's removed. | ||
|
||
The following apis are never documented, they mean to only use internally, now they are removed. | ||
|
||
- `prettier.doc.utils.getDocParts` | ||
- `prettier.doc.utils.propagateBreaks` | ||
- `prettier.doc.utils.cleanDoc` | ||
- `prettier.doc.utils.getDocType` | ||
- `prettier.doc.debug.printDocToDebug` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { | ||
join, | ||
line, | ||
softline, | ||
hardline, | ||
literalline, | ||
group, | ||
conditionalGroup, | ||
fill, | ||
lineSuffix, | ||
lineSuffixBoundary, | ||
cursor, | ||
breakParent, | ||
ifBreak, | ||
trim, | ||
indent, | ||
indentIfBreak, | ||
align, | ||
addAlignmentToDoc, | ||
markAsRoot, | ||
dedentToRoot, | ||
dedent, | ||
hardlineWithoutBreakParent, | ||
literallineWithoutBreakParent, | ||
label, | ||
} from "./builders.js"; | ||
import { printDocToString } from "./printer.js"; | ||
import { | ||
willBreak, | ||
traverseDoc, | ||
findInDoc, | ||
mapDoc, | ||
removeLines, | ||
stripTrailingHardline, | ||
replaceEndOfLine, | ||
canBreak, | ||
} from "./utils.js"; | ||
|
||
export const builders = { | ||
join, | ||
line, | ||
softline, | ||
hardline, | ||
literalline, | ||
group, | ||
conditionalGroup, | ||
fill, | ||
lineSuffix, | ||
lineSuffixBoundary, | ||
cursor, | ||
breakParent, | ||
ifBreak, | ||
trim, | ||
indent, | ||
indentIfBreak, | ||
align, | ||
addAlignmentToDoc, | ||
markAsRoot, | ||
dedentToRoot, | ||
dedent, | ||
hardlineWithoutBreakParent, | ||
literallineWithoutBreakParent, | ||
label, | ||
// TODO: Remove this in v4 | ||
concat: (parts) => parts, | ||
}; | ||
export const printer = { printDocToString }; | ||
export const utils = { | ||
willBreak, | ||
traverseDoc, | ||
findInDoc, | ||
mapDoc, | ||
removeLines, | ||
stripTrailingHardline, | ||
replaceEndOfLine, | ||
canBreak, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ import { | |
} from "../utils/index.js"; | ||
|
||
import { | ||
concat, | ||
line, | ||
hardline, | ||
softline, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import * as doc from "../../../../src/document"; | ||
import * as doc from "../../../../src/document/public.js"; | ||
|
||
doc.builders.dedent; | ||
doc.printer.printDocToString; | ||
doc.debug.printDocToDebug; | ||
doc.utils.mapDoc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.