prettier 4.0.0-alpha.12 → 4.0.0-alpha.13
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 +7 -11
- package/THIRD-PARTY-NOTICES.md +1888 -302
- package/bin/prettier.cjs +15 -5
- package/doc.js +607 -362
- package/doc.mjs +608 -366
- package/index.cjs +106 -85
- package/index.d.ts +20 -9
- package/index.mjs +8686 -12160
- package/internal/experimental-cli-worker.mjs +2841 -0
- package/internal/experimental-cli.mjs +12790 -0
- package/internal/{cli.mjs → legacy-cli.mjs} +2851 -1540
- package/package.json +7 -7
- package/plugins/acorn.js +11 -10
- package/plugins/acorn.mjs +11 -10
- package/plugins/angular.js +4 -2
- package/plugins/angular.mjs +4 -2
- package/plugins/babel.d.ts +6 -7
- package/plugins/babel.js +10 -13
- package/plugins/babel.mjs +10 -13
- package/plugins/estree.js +40 -32
- package/plugins/estree.mjs +40 -32
- package/plugins/flow.js +16 -15
- package/plugins/flow.mjs +16 -15
- package/plugins/glimmer.js +29 -22
- package/plugins/glimmer.mjs +30 -23
- package/plugins/graphql.js +15 -16
- package/plugins/graphql.mjs +15 -16
- package/plugins/html.d.ts +1 -0
- package/plugins/html.js +23 -21
- package/plugins/html.mjs +23 -21
- package/plugins/markdown.js +53 -54
- package/plugins/markdown.mjs +53 -54
- package/plugins/meriyah.js +5 -4
- package/plugins/meriyah.mjs +5 -4
- package/plugins/postcss.js +41 -34
- package/plugins/postcss.mjs +41 -34
- package/plugins/typescript.js +16 -15
- package/plugins/typescript.mjs +16 -15
- package/plugins/yaml.js +91 -93
- package/plugins/yaml.mjs +91 -93
- package/standalone.js +31 -37
- package/standalone.mjs +31 -37
package/bin/prettier.cjs
CHANGED
|
@@ -60,13 +60,23 @@ if (typeof nodeModule.enableCompileCache === "function") {
|
|
|
60
60
|
var pleaseUpgradeNode = require_please_upgrade_node();
|
|
61
61
|
var packageJson = require("../package.json");
|
|
62
62
|
pleaseUpgradeNode(packageJson);
|
|
63
|
+
var shouldRunLegacyCli = !!process.env.PRETTIER_LEGACY_CLI;
|
|
64
|
+
var index = process.argv.indexOf("--legacy-cli");
|
|
65
|
+
if (index !== -1) {
|
|
66
|
+
process.argv.splice(index, 1);
|
|
67
|
+
shouldRunLegacyCli = true;
|
|
68
|
+
}
|
|
63
69
|
var dynamicImport = new Function("module", "return import(module)");
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
var promise;
|
|
71
|
+
if (shouldRunLegacyCli) {
|
|
72
|
+
promise = dynamicImport("../internal/legacy-cli.mjs").then(function runCli(cli) {
|
|
66
73
|
return cli.run();
|
|
67
74
|
});
|
|
68
|
-
module.exports.__promise = promise;
|
|
69
75
|
} else {
|
|
70
|
-
dynamicImport("
|
|
76
|
+
promise = dynamicImport("../internal/experimental-cli.mjs").then(
|
|
77
|
+
function(cli) {
|
|
78
|
+
return cli.__promise;
|
|
79
|
+
}
|
|
80
|
+
);
|
|
71
81
|
}
|
|
72
|
-
|
|
82
|
+
module.exports.__promise = promise;
|