prettier-plugin-embed 0.4.4 → 0.4.5

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/dist/options.d.ts CHANGED
@@ -25,7 +25,7 @@ export declare const options: {
25
25
  readonly description: "This option turns off \"identifier`...`\" tag-based language identification for the specified identifiers.";
26
26
  };
27
27
  readonly preserveEmbeddedExteriorWhitespaces: {
28
- readonly category: "Config";
28
+ readonly category: "Embed";
29
29
  readonly type: "string";
30
30
  readonly array: true;
31
31
  readonly default: [{
@@ -137,7 +137,7 @@ export declare const options: {
137
137
  default: "json";
138
138
  description: string;
139
139
  choices: {
140
- value: "json" | "json-stringify" | "json5";
140
+ value: "json" | "json5" | "jsonc" | "json-stringify";
141
141
  description: string;
142
142
  }[];
143
143
  };
package/dist/parsers.d.ts CHANGED
@@ -17,5 +17,6 @@ export declare const parsers: {
17
17
  __babel_estree: import("prettier").Parser<any>;
18
18
  json: import("prettier").Parser<any>;
19
19
  json5: import("prettier").Parser<any>;
20
+ jsonc: import("prettier").Parser<any>;
20
21
  "json-stringify": import("prettier").Parser<any>;
21
22
  };
package/dist/types.d.ts CHANGED
@@ -1,14 +1,25 @@
1
- import type { Comment, Node as EsTreeNode, TemplateLiteral } from "estree";
1
+ import type { TemplateLiteral } from "estree";
2
2
  import type { AstPath, Doc, Options } from "prettier";
3
3
  import { makeIdentifiersOptionName, type AutocompleteStringList, type EmbeddedDefaultIdentifier, type EmbeddedLanguage, type PrettierPluginEmbedOptions } from "./embedded/index.js";
4
4
  import type { PrettierPluginGlobalOptions } from "./options.js";
5
- export type PrettierNode = EsTreeNode & {
6
- comments?: (Comment & {
5
+ declare module "estree" {
6
+ interface Comment {
7
7
  leading: boolean;
8
8
  trailing: boolean;
9
9
  nodeDescription: string;
10
- })[];
11
- };
10
+ }
11
+ interface BaseNode {
12
+ comments?: Comment[];
13
+ }
14
+ interface File extends BaseNode {
15
+ type: "File";
16
+ sourceType: "script" | "module";
17
+ program: Program;
18
+ }
19
+ interface NodeMap {
20
+ File: File;
21
+ }
22
+ }
12
23
  export type InternalPrintFun = (selector?: string | number | (string | number)[] | AstPath<TemplateLiteral>) => Doc;
13
24
  export interface EmbedderPayload {
14
25
  identifier: string;
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { type AstPath } from "prettier";
2
- import type { PrettierNode } from "./types.js";
3
- export declare const resolveEmbeddedOverrideOptions: (embeddedOverridesString: string | undefined, identifier: string, sourceFilePath?: string) => Promise<Omit<Omit<import("prettier").Options, keyof import("./index.js").PrettierPluginEmbedOptions> & Omit<import("./index.js").PrettierPluginEmbedOptions, "embeddedNoopIdentifiers" | "embeddedCssIdentifiers" | "embeddedEsIdentifiers" | "embeddedGlslIdentifiers" | "embeddedGraphqlIdentifiers" | "embeddedHtmlIdentifiers" | "embeddedIniIdentifiers" | "embeddedJsonIdentifiers" | "embeddedLatexIdentifiers" | "embeddedMarkdownIdentifiers" | "embeddedPhpIdentifiers" | "embeddedPropertiesIdentifiers" | "embeddedRubyIdentifiers" | "embeddedShIdentifiers" | "embeddedSqlIdentifiers" | "embeddedTomlIdentifiers" | "embeddedTsIdentifiers" | "embeddedXmlIdentifiers" | "embeddedYamlIdentifiers" | keyof import("./options.js").PrettierPluginGlobalOptions>, "parser" | "filepath" | "endOfLine" | "embeddedLanguageFormatting" | "printWidth" | "tabWidth" | "useTabs" | `__${string}`> | undefined>;
4
- export declare function getIdentifierFromComment({ node, parent }: AstPath<PrettierNode>, comments: string[], noIdentificationList: string[]): string | undefined;
5
- export declare function getIdentifierFromTag({ node, parent }: AstPath<PrettierNode>, tags: string[], noIdentificationList: string[]): string | undefined;
1
+ import type { Node } from "estree";
2
+ import { type AstPath, type Options } from "prettier";
3
+ export declare const resolveEmbeddedOverrideOptions: (embeddedOverridesString: string | undefined, identifier: string, sourceFilePath?: string) => Promise<Omit<Omit<Options, keyof import("./index.js").PrettierPluginEmbedOptions> & Omit<import("./index.js").PrettierPluginEmbedOptions, "embeddedNoopIdentifiers" | "embeddedCssIdentifiers" | "embeddedEsIdentifiers" | "embeddedGlslIdentifiers" | "embeddedGraphqlIdentifiers" | "embeddedHtmlIdentifiers" | "embeddedIniIdentifiers" | "embeddedJsonIdentifiers" | "embeddedLatexIdentifiers" | "embeddedMarkdownIdentifiers" | "embeddedPhpIdentifiers" | "embeddedPropertiesIdentifiers" | "embeddedRubyIdentifiers" | "embeddedShIdentifiers" | "embeddedSqlIdentifiers" | "embeddedTomlIdentifiers" | "embeddedTsIdentifiers" | "embeddedXmlIdentifiers" | "embeddedYamlIdentifiers" | keyof import("./options.js").PrettierPluginGlobalOptions>, "parser" | "filepath" | "endOfLine" | "embeddedLanguageFormatting" | "printWidth" | "tabWidth" | "useTabs" | `__${string}`> | undefined>;
4
+ export declare function getIdentifierFromComment({ node, parent }: AstPath<Node>, comments: string[], options: Options): string | undefined;
5
+ export declare function getIdentifierFromTag({ node, parent }: AstPath<Node>, tags: string[], options: Options): string | undefined;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "prettier-plugin-embed",
3
3
  "description": "A configurable Prettier plugin to format embedded languages in js/ts files.",
4
4
  "private": false,
5
- "version": "0.4.4",
5
+ "version": "0.4.5",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "./dist"
@@ -64,21 +64,21 @@
64
64
  "@commitlint/cli": "^18.4.4",
65
65
  "@commitlint/config-conventional": "^18.4.4",
66
66
  "@prettier/plugin-php": "^0.22.1",
67
- "@prettier/plugin-ruby": "^4.0.0",
68
- "@prettier/plugin-xml": "^3.1.0",
67
+ "@prettier/plugin-ruby": "^4.0.4",
68
+ "@prettier/plugin-xml": "^3.2.2",
69
69
  "@types/estree": "^1.0.5",
70
- "@types/node": "^20.10.7",
71
- "@typescript-eslint/eslint-plugin": "^6.18.0",
72
- "@typescript-eslint/parser": "^6.18.0",
73
- "@vitest/coverage-istanbul": "^1.1.3",
74
- "@vitest/ui": "^1.1.3",
70
+ "@types/node": "^20.11.0",
71
+ "@typescript-eslint/eslint-plugin": "^6.18.1",
72
+ "@typescript-eslint/parser": "^6.18.1",
73
+ "@vitest/coverage-istanbul": "^1.2.0",
74
+ "@vitest/ui": "^1.2.0",
75
75
  "@xml-tools/parser": "^1.0.11",
76
76
  "chevrotain": "7.1.1",
77
77
  "esbuild": "^0.19.11",
78
78
  "eslint": "^8.56.0",
79
79
  "fast-glob": "^3.3.2",
80
80
  "npm-check-updates": "^16.14.12",
81
- "prettier": "^3.0.0",
81
+ "prettier": "^3.2.1",
82
82
  "prettier-plugin-glsl": "^0.1.3",
83
83
  "prettier-plugin-ini": "^1.1.0",
84
84
  "prettier-plugin-jsdoc": "^1.3.0",
@@ -87,12 +87,12 @@
87
87
  "prettier-plugin-properties": "^0.3.0",
88
88
  "prettier-plugin-sh": "^0.13.1",
89
89
  "prettier-plugin-sql": "^0.18.0",
90
- "prettier-plugin-sql-cst": "^0.10.0",
90
+ "prettier-plugin-sql-cst": "^0.10.2",
91
91
  "prettier-plugin-toml": "^2.0.1",
92
92
  "tsx": "^4.7.0",
93
93
  "typescript": "^5.3.3",
94
94
  "vite": "^5.0.11",
95
- "vitest": "^1.1.3"
95
+ "vitest": "^1.2.0"
96
96
  },
97
97
  "dependencies": {
98
98
  "dedent": "^1.5.1",