prettier 3.0.0-alpha.6 → 3.0.0-alpha.8-for-vscode

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.
Files changed (55) hide show
  1. package/LICENSE +17 -17
  2. package/bin/prettier.cjs +0 -0
  3. package/doc.d.ts +2 -10
  4. package/doc.js +55 -246
  5. package/doc.mjs +51 -246
  6. package/index.cjs +1 -1
  7. package/index.d.ts +26 -8
  8. package/index.mjs +5920 -20834
  9. package/internal/cli.mjs +486 -478
  10. package/internal/{third-party.mjs → internal.mjs} +19 -14
  11. package/package.json +39 -28
  12. package/plugins/acorn.d.ts +6 -0
  13. package/plugins/acorn.js +13 -0
  14. package/plugins/acorn.mjs +13 -0
  15. package/plugins/angular.d.ts +5 -9
  16. package/plugins/angular.js +2 -2
  17. package/plugins/angular.mjs +2 -2
  18. package/plugins/babel.d.ts +14 -14
  19. package/plugins/babel.js +11 -11
  20. package/plugins/babel.mjs +11 -11
  21. package/plugins/estree.d.ts +0 -0
  22. package/plugins/estree.js +35 -0
  23. package/plugins/estree.mjs +35 -0
  24. package/plugins/flow.d.ts +2 -6
  25. package/plugins/flow.js +20 -20
  26. package/plugins/flow.mjs +20 -20
  27. package/plugins/glimmer.d.ts +2 -6
  28. package/plugins/glimmer.js +22 -17
  29. package/plugins/glimmer.mjs +22 -17
  30. package/plugins/graphql.d.ts +2 -6
  31. package/plugins/graphql.js +16 -7
  32. package/plugins/graphql.mjs +16 -7
  33. package/plugins/html.d.ts +5 -9
  34. package/plugins/html.js +19 -17
  35. package/plugins/html.mjs +19 -17
  36. package/plugins/markdown.d.ts +4 -8
  37. package/plugins/markdown.js +54 -33
  38. package/plugins/markdown.mjs +54 -33
  39. package/plugins/meriyah.d.ts +2 -6
  40. package/plugins/meriyah.js +5 -5
  41. package/plugins/meriyah.mjs +5 -5
  42. package/plugins/postcss.d.ts +4 -8
  43. package/plugins/postcss.js +45 -32
  44. package/plugins/postcss.mjs +45 -32
  45. package/plugins/typescript.d.ts +2 -6
  46. package/plugins/typescript.js +24 -20
  47. package/plugins/typescript.mjs +24 -20
  48. package/plugins/yaml.d.ts +2 -6
  49. package/plugins/yaml.js +130 -117
  50. package/plugins/yaml.mjs +130 -117
  51. package/standalone.js +27 -90
  52. package/standalone.mjs +27 -90
  53. package/plugins/acorn-and-espree.d.ts +0 -10
  54. package/plugins/acorn-and-espree.js +0 -13
  55. package/plugins/acorn-and-espree.mjs +0 -13
@@ -74,7 +74,7 @@ var require_resolve_from = __commonJS({
74
74
  "use strict";
75
75
  var path = __require("path");
76
76
  var Module = __require("module");
77
- var fs = __require("fs");
77
+ var fs2 = __require("fs");
78
78
  var resolveFrom = (fromDir, moduleId, silent) => {
79
79
  if (typeof fromDir !== "string") {
80
80
  throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``);
@@ -83,7 +83,7 @@ var require_resolve_from = __commonJS({
83
83
  throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
84
84
  }
85
85
  try {
86
- fromDir = fs.realpathSync(fromDir);
86
+ fromDir = fs2.realpathSync(fromDir);
87
87
  } catch (err) {
88
88
  if (err.code === "ENOENT") {
89
89
  fromDir = path.resolve(fromDir);
@@ -5553,13 +5553,13 @@ var require_path_type = __commonJS({
5553
5553
  "node_modules/path-type/index.js"(exports) {
5554
5554
  "use strict";
5555
5555
  var { promisify } = __require("util");
5556
- var fs = __require("fs");
5556
+ var fs2 = __require("fs");
5557
5557
  async function isType(fsStatType, statsMethodName, filePath) {
5558
5558
  if (typeof filePath !== "string") {
5559
5559
  throw new TypeError(`Expected a string, got ${typeof filePath}`);
5560
5560
  }
5561
5561
  try {
5562
- const stats = await promisify(fs[fsStatType])(filePath);
5562
+ const stats = await promisify(fs2[fsStatType])(filePath);
5563
5563
  return stats[statsMethodName]();
5564
5564
  } catch (error) {
5565
5565
  if (error.code === "ENOENT") {
@@ -5573,7 +5573,7 @@ var require_path_type = __commonJS({
5573
5573
  throw new TypeError(`Expected a string, got ${typeof filePath}`);
5574
5574
  }
5575
5575
  try {
5576
- return fs[fsStatType](filePath)[statsMethodName]();
5576
+ return fs2[fsStatType](filePath)[statsMethodName]();
5577
5577
  } catch (error) {
5578
5578
  if (error.code === "ENOENT") {
5579
5579
  return false;
@@ -5958,9 +5958,9 @@ var require_find_parent_dir = __commonJS({
5958
5958
  "node_modules/find-parent-dir/index.js"(exports, module) {
5959
5959
  "use strict";
5960
5960
  var path = __require("path");
5961
- var fs = __require("fs");
5962
- var exists = fs.exists || path.exists;
5963
- var existsSync = fs.existsSync || path.existsSync;
5961
+ var fs2 = __require("fs");
5962
+ var exists = fs2.exists || path.exists;
5963
+ var existsSync = fs2.existsSync || path.existsSync;
5964
5964
  function splitPath(path2) {
5965
5965
  var parts = path2.split(/(\/|\\)/);
5966
5966
  if (!parts.length)
@@ -6388,9 +6388,10 @@ var require_ci_info = __commonJS({
6388
6388
  }
6389
6389
  });
6390
6390
 
6391
- // src/common/third-party.js
6391
+ // src/common/mockable.js
6392
6392
  var import_cosmiconfig = __toESM(require_dist(), 1);
6393
6393
  var import_find_parent_dir = __toESM(require_find_parent_dir(), 1);
6394
+ import fs from "fs/promises";
6394
6395
 
6395
6396
  // node_modules/get-stdin/index.js
6396
6397
  var { stdin } = process;
@@ -6418,15 +6419,19 @@ getStdin.buffer = async () => {
6418
6419
  return Buffer.concat(result, length);
6419
6420
  };
6420
6421
 
6421
- // src/common/third-party.js
6422
+ // src/common/mockable.js
6422
6423
  var import_ci_info = __toESM(require_ci_info(), 1);
6423
- var thirdParty = {
6424
+ function writeFormattedFile(file, data) {
6425
+ return fs.writeFile(file, data);
6426
+ }
6427
+ var mockable = {
6424
6428
  cosmiconfig: import_cosmiconfig.cosmiconfig,
6425
6429
  findParentDir: import_find_parent_dir.sync,
6426
6430
  getStdin,
6427
- isCI: () => import_ci_info.isCI
6431
+ isCI: () => import_ci_info.isCI,
6432
+ writeFormattedFile
6428
6433
  };
6429
- var third_party_default = thirdParty;
6434
+ var mockable_default = mockable;
6430
6435
  export {
6431
- third_party_default as default
6436
+ mockable_default as default
6432
6437
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prettier",
3
- "version": "3.0.0-alpha.6",
3
+ "version": "3.0.0-alpha.8-for-vscode",
4
4
  "description": "Prettier is an opinionated code formatter",
5
5
  "bin": "./bin/prettier.cjs",
6
6
  "repository": "prettier/prettier",
@@ -13,79 +13,84 @@
13
13
  "unpkg": "./standalone.js",
14
14
  "exports": {
15
15
  ".": {
16
- "require": "./index.cjs",
17
16
  "types": "./index.d.ts",
17
+ "require": "./index.cjs",
18
18
  "default": "./index.mjs"
19
19
  },
20
20
  "./*": "./*",
21
21
  "./doc": {
22
- "require": "./doc.js",
23
22
  "types": "./doc.d.ts",
23
+ "require": "./doc.js",
24
24
  "default": "./doc.mjs"
25
25
  },
26
26
  "./standalone": {
27
- "require": "./standalone.js",
28
27
  "types": "./standalone.d.ts",
28
+ "require": "./standalone.js",
29
29
  "default": "./standalone.mjs"
30
30
  },
31
+ "./plugins/estree": {
32
+ "types": "./plugins/estree.d.ts",
33
+ "require": "./plugins/estree.js",
34
+ "default": "./plugins/estree.mjs"
35
+ },
31
36
  "./plugins/babel": {
32
- "require": "./plugins/babel.js",
33
37
  "types": "./plugins/babel.d.ts",
38
+ "require": "./plugins/babel.js",
34
39
  "default": "./plugins/babel.mjs"
35
40
  },
36
41
  "./plugins/flow": {
37
- "require": "./plugins/flow.js",
38
42
  "types": "./plugins/flow.d.ts",
43
+ "require": "./plugins/flow.js",
39
44
  "default": "./plugins/flow.mjs"
40
45
  },
41
46
  "./plugins/typescript": {
42
- "require": "./plugins/typescript.js",
43
47
  "types": "./plugins/typescript.d.ts",
48
+ "require": "./plugins/typescript.js",
44
49
  "default": "./plugins/typescript.mjs"
45
50
  },
46
- "./plugins/acorn-and-espree": {
47
- "require": "./plugins/acorn-and-espree.js",
48
- "types": "./plugins/acorn-and-espree.d.ts",
49
- "default": "./plugins/acorn-and-espree.mjs"
51
+ "./plugins/acorn": {
52
+ "types": "./plugins/acorn.d.ts",
53
+ "require": "./plugins/acorn.js",
54
+ "default": "./plugins/acorn.mjs"
50
55
  },
51
56
  "./plugins/meriyah": {
52
- "require": "./plugins/meriyah.js",
53
57
  "types": "./plugins/meriyah.d.ts",
58
+ "require": "./plugins/meriyah.js",
54
59
  "default": "./plugins/meriyah.mjs"
55
60
  },
56
61
  "./plugins/angular": {
57
- "require": "./plugins/angular.js",
58
62
  "types": "./plugins/angular.d.ts",
63
+ "require": "./plugins/angular.js",
59
64
  "default": "./plugins/angular.mjs"
60
65
  },
61
66
  "./plugins/postcss": {
62
- "require": "./plugins/postcss.js",
63
67
  "types": "./plugins/postcss.d.ts",
68
+ "require": "./plugins/postcss.js",
64
69
  "default": "./plugins/postcss.mjs"
65
70
  },
66
71
  "./plugins/graphql": {
67
- "require": "./plugins/graphql.js",
68
72
  "types": "./plugins/graphql.d.ts",
73
+ "require": "./plugins/graphql.js",
69
74
  "default": "./plugins/graphql.mjs"
70
75
  },
71
76
  "./plugins/markdown": {
72
- "require": "./plugins/markdown.js",
73
77
  "types": "./plugins/markdown.d.ts",
78
+ "require": "./plugins/markdown.js",
74
79
  "default": "./plugins/markdown.mjs"
75
80
  },
76
81
  "./plugins/glimmer": {
77
- "require": "./plugins/glimmer.js",
78
82
  "types": "./plugins/glimmer.d.ts",
83
+ "require": "./plugins/glimmer.js",
79
84
  "default": "./plugins/glimmer.mjs"
80
85
  },
81
86
  "./plugins/html": {
82
- "require": "./plugins/html.js",
83
87
  "types": "./plugins/html.d.ts",
88
+ "require": "./plugins/html.js",
84
89
  "default": "./plugins/html.mjs"
85
90
  },
86
91
  "./plugins/yaml": {
87
- "require": "./plugins/yaml.js",
88
92
  "types": "./plugins/yaml.d.ts",
93
+ "require": "./plugins/yaml.js",
89
94
  "default": "./plugins/yaml.mjs"
90
95
  },
91
96
  "./esm/standalone.mjs": "./standalone.mjs",
@@ -98,9 +103,9 @@
98
103
  "./parser-typescript": "./plugins/typescript.js",
99
104
  "./parser-typescript.js": "./plugins/typescript.js",
100
105
  "./esm/parser-typescript.mjs": "./plugins/typescript.mjs",
101
- "./parser-espree": "./plugins/acorn-and-espree.js",
102
- "./parser-espree.js": "./plugins/acorn-and-espree.js",
103
- "./esm/parser-espree.mjs": "./plugins/acorn-and-espree.mjs",
106
+ "./parser-espree": "./plugins/acorn.js",
107
+ "./parser-espree.js": "./plugins/acorn.js",
108
+ "./esm/parser-espree.mjs": "./plugins/acorn.mjs",
104
109
  "./parser-meriyah": "./plugins/meriyah.js",
105
110
  "./parser-meriyah.js": "./plugins/meriyah.js",
106
111
  "./esm/parser-meriyah.mjs": "./plugins/meriyah.mjs",
@@ -141,17 +146,20 @@
141
146
  "index.d.ts",
142
147
  "index.mjs",
143
148
  "internal/cli.mjs",
144
- "internal/third-party.mjs",
149
+ "internal/internal.mjs",
145
150
  "package.json",
146
- "plugins/acorn-and-espree.d.ts",
147
- "plugins/acorn-and-espree.js",
148
- "plugins/acorn-and-espree.mjs",
151
+ "plugins/acorn.d.ts",
152
+ "plugins/acorn.js",
153
+ "plugins/acorn.mjs",
149
154
  "plugins/angular.d.ts",
150
155
  "plugins/angular.js",
151
156
  "plugins/angular.mjs",
152
157
  "plugins/babel.d.ts",
153
158
  "plugins/babel.js",
154
159
  "plugins/babel.mjs",
160
+ "plugins/estree.d.ts",
161
+ "plugins/estree.js",
162
+ "plugins/estree.mjs",
155
163
  "plugins/flow.d.ts",
156
164
  "plugins/flow.js",
157
165
  "plugins/flow.mjs",
@@ -182,5 +190,8 @@
182
190
  "standalone.d.ts",
183
191
  "standalone.js",
184
192
  "standalone.mjs"
185
- ]
186
- }
193
+ ],
194
+ "scripts": {
195
+ "prepublishOnly": "node -e \"assert.equal(require('.').version, require('..').version)\""
196
+ }
197
+ }
@@ -0,0 +1,6 @@
1
+ import { Parser } from "../index.js";
2
+
3
+ export declare const parsers: {
4
+ acorn: Parser;
5
+ espree: Parser;
6
+ };