prettier-plugin-embed 0.4.15 → 0.5.1

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/README.md CHANGED
@@ -1112,6 +1112,7 @@ Bug fixes, new language support and tests are welcome. Please have a look at the
1112
1112
  <tr>
1113
1113
  <td align="center" valign="top" width="14.28%"><a href="https://upleveled.io"><img src="https://avatars.githubusercontent.com/u/1935696?v=4?s=100" width="100px;" alt="Karl Horky"/><br /><sub><b>Karl Horky</b></sub></a><br /><a href="#code-karlhorky" title="Code">💻</a> <a href="#doc-karlhorky" title="Documentation">📖</a></td>
1114
1114
  <td align="center" valign="top" width="14.28%"><a href="https://math-atlas.vercel.app"><img src="https://avatars.githubusercontent.com/u/64682375?v=4?s=100" width="100px;" alt="Kelvin Soh"/><br /><sub><b>Kelvin Soh</b></sub></a><br /><a href="#code-kelvinsjk" title="Code">💻</a></td>
1115
+ <td align="center" valign="top" width="14.28%"><a href="https://www.1stg.me"><img src="https://avatars.githubusercontent.com/u/8336744?v=4?s=100" width="100px;" alt="JounQin"/><br /><sub><b>JounQin</b></sub></a><br /><a href="#code-JounQin" title="Code">💻</a></td>
1115
1116
  </tr>
1116
1117
  </tbody>
1117
1118
  </table>
@@ -1,3 +1,3 @@
1
1
  export * from "./register.js";
2
- export type { EmbeddedDefaultComment, EmbeddedDefaultTag, EmbeddedEmbedders, EmbeddedLanguage, EmbeddedOptions, EmbeddedParsers, EmbeddedComment, EmbeddedTag, PluginEmbedOptions, } from "./types.js";
3
- export { makeIdentifiersOptionName, makeCommentsOptionName, makeTagsOptionName, fallbackIndicator, type AutocompleteStringList, } from "./utils.js";
2
+ export type { EmbeddedComment, EmbeddedDefaultComment, EmbeddedDefaultTag, EmbeddedEmbedders, EmbeddedLanguage, EmbeddedOptions, EmbeddedParsers, EmbeddedTag, PluginEmbedOptions, } from "./types.js";
3
+ export { type AutocompleteStringList, fallbackIndicator, makeCommentsOptionName, makeIdentifiersOptionName, makeTagsOptionName, } from "./utils.js";
@@ -5,9 +5,9 @@ export declare const embeddedEmbedders: EmbeddedEmbedders;
5
5
  export declare const embeddedOptions: EmbeddedOptions;
6
6
  import * as __glob__0_0 from "./css/index.js";
7
7
  import * as __glob__0_1 from "./es/index.js";
8
- import * as __glob__0_2 from "./glsl/index.js";
9
- import * as __glob__0_3 from "./graphql/index.js";
10
- import * as __glob__0_4 from "./html/index.js";
8
+ import * as __glob__0_2 from "./graphql/index.js";
9
+ import * as __glob__0_3 from "./html/index.js";
10
+ import * as __glob__0_4 from "./glsl/index.js";
11
11
  import * as __glob__0_5 from "./ini/index.js";
12
12
  import * as __glob__0_6 from "./java/index.js";
13
13
  import * as __glob__0_7 from "./json/index.js";
@@ -18,8 +18,8 @@ import * as __glob__0_11 from "./nginx/index.js";
18
18
  import * as __glob__0_12 from "./noop/index.js";
19
19
  import * as __glob__0_13 from "./pegjs/index.js";
20
20
  import * as __glob__0_14 from "./php/index.js";
21
- import * as __glob__0_15 from "./prisma/index.js";
22
- import * as __glob__0_16 from "./properties/index.js";
21
+ import * as __glob__0_15 from "./properties/index.js";
22
+ import * as __glob__0_16 from "./prisma/index.js";
23
23
  import * as __glob__0_17 from "./pug/index.js";
24
24
  import * as __glob__0_18 from "./ruby/index.js";
25
25
  import * as __glob__0_19 from "./sh/index.js";
@@ -59,7 +59,7 @@ export declare const options: {
59
59
  default: "sqlite";
60
60
  description: string;
61
61
  choices: {
62
- value: "bigquery" | "mariadb" | "mysql" | "postgresql" | "sqlite";
62
+ value: "sqlite" | "bigquery" | "mysql" | "mariadb" | "postgresql";
63
63
  description: string;
64
64
  }[];
65
65
  };
@@ -1,13 +1,20 @@
1
1
  import type { Comment, Expression, TemplateLiteral } from "estree";
2
- import type { AstPath, Doc } from "prettier";
2
+ import type { AstPath, Doc, Options } from "prettier";
3
3
  import { builders } from "prettier/doc";
4
4
  import type { LiteralUnion, OmitIndexSignature, UnionToIntersection } from "type-fest";
5
5
  import type { InternalPrintFun } from "../types.js";
6
6
  export declare function printTemplateExpression(path: AstPath<Expression & {
7
7
  comments?: Comment[];
8
- }>, print: InternalPrintFun): builders.Doc[];
9
- export declare function printTemplateExpressions(path: AstPath<TemplateLiteral>, print: InternalPrintFun): builders.Doc[][];
10
- export declare function simpleRehydrateDoc(doc: Doc, placeholderRegex: RegExp, expressionDocs: Doc[], replaceLiteralNewlinesToHardlines?: boolean): builders.Doc[] | builders.DocCommand;
8
+ }>, print: InternalPrintFun, templateLiteral: TemplateLiteral, index: number, tabWidth: number): builders.Group;
9
+ export declare function printTemplateExpressions(path: AstPath<TemplateLiteral>, print: InternalPrintFun, options?: Options): builders.Group[];
10
+ export declare function simpleRehydrateDoc(doc: Doc, placeholderRegex: RegExp, expressionDocs: Doc[],
11
+ /**
12
+ * How to handle newlines in the formatted content:
13
+ * - false: keep newlines as-is (default)
14
+ * - "hardline": replace newlines with hardline (adds indentation)
15
+ * - "literalline": replace newlines with literalline via replaceEndOfLine (preserves original indentation)
16
+ */
17
+ newlineHandling?: false | "hardline" | "literalline"): builders.Doc[] | builders.DocCommand;
11
18
  export declare function insertLanguage(languages: string[], language: string, firstLanguage: string): void;
12
19
  export declare const randomUUID: () => string;
13
20
  export declare function preparePlaceholder(leading?: string, trailing?: string): {
@@ -1,10 +1,11 @@
1
1
  // @ts-nocheck
2
- import type { CstNode } from "chevrotain";
3
2
  import type { Parser } from "prettier";
4
3
  import { language } from "./language.js";
5
- export declare const parser: Parser<CstNode>;
4
+ type SimplifiedNode = Record<string, unknown>;
5
+ export declare const parser: Parser<SimplifiedNode>;
6
6
  declare module "../types.js" {
7
7
  interface EmbeddedParsers {
8
8
  [language]: Parser;
9
9
  }
10
10
  }
11
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- export { options } from "./options.js";
2
- export { parsers } from "./parsers.js";
3
- export { printers } from "./printers.js";
4
- export type { PluginEmbedOptions } from "./embedded/index.js";
5
- export type { EmbeddedOverride } from "./types.js";
6
- export type {
1
+ export type { PluginEmbedOptions,
7
2
  /**
8
3
  * @deprecated Renamed to `PluginEmbedOptions`
9
4
  */
10
5
  PluginEmbedOptions as PrettierPluginEmbedOptions, } from "./embedded/index.js";
6
+ export { options } from "./options.js";
7
+ export { parsers } from "./parsers.js";
8
+ export { printers } from "./printers.js";
9
+ export type { EmbeddedOverride } from "./types.js";