Skip to content

Commit

Permalink
Renamed to "prettier", and re-exporting everything from "prettier" it…
Browse files Browse the repository at this point in the history
…self
  • Loading branch information
fabiospampinato committed Nov 30, 2023
1 parent 0ad6df7 commit 85ccff6
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"prettier.prettierPath": "./node_modules/prettier-internal",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
}
}
35 changes: 19 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

144 changes: 134 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,155 @@
{
"name": "@prettier/next",
"name": "prettier",
"repository": "github:prettier/prettier-cli",
"description": "A faster CLI for Prettier.",
"license": "MIT",
"version": "0.1.1",
"version": "4.0.0-alpha.0",
"type": "module",
"bin": {
"prettier": "dist/bin.js",
"prettier-next": "dist/bin.js"
},
"main": "dist/index.js",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"clean": "rm -rf dist",
"compile": "tsc --outDir dist",
"compile:watch": "tsc --outDir dist --watch",
"prepublishOnly": "npm run compile",
"typecheck": "tsc --noEmit"
},
"bin": "dist/bin.js",
"main": "./node_modules/prettier-internal/index.cjs",
"browser": "./node_modules/prettier-internal/standalone.js",
"unpkg": "./node_modules/prettier-internal/standalone.js",
"exports": {
".": {
"types": "./node_modules/prettier-internal/index.d.ts",
"require": "./node_modules/prettier-internal/index.cjs",
"browser": {
"import": "./node_modules/prettier-internal/standalone.mjs",
"default": "./node_modules/prettier-internal/standalone.js"
},
"default": "./node_modules/prettier-internal/index.mjs"
},
"./*": "./node_modules/prettier-internal/*",
"./doc": {
"types": "./node_modules/prettier-internal/doc.d.ts",
"require": "./node_modules/prettier-internal/doc.js",
"default": "./node_modules/prettier-internal/doc.mjs"
},
"./standalone": {
"types": "./node_modules/prettier-internal/standalone.d.ts",
"require": "./node_modules/prettier-internal/standalone.js",
"default": "./node_modules/prettier-internal/standalone.mjs"
},
"./plugins/estree": {
"types": "./node_modules/prettier-internal/plugins/estree.d.ts",
"require": "./node_modules/prettier-internal/plugins/estree.js",
"default": "./node_modules/prettier-internal/plugins/estree.mjs"
},
"./plugins/babel": {
"types": "./node_modules/prettier-internal/plugins/babel.d.ts",
"require": "./node_modules/prettier-internal/plugins/babel.js",
"default": "./node_modules/prettier-internal/plugins/babel.mjs"
},
"./plugins/flow": {
"types": "./node_modules/prettier-internal/plugins/flow.d.ts",
"require": "./node_modules/prettier-internal/plugins/flow.js",
"default": "./node_modules/prettier-internal/plugins/flow.mjs"
},
"./plugins/typescript": {
"types": "./node_modules/prettier-internal/plugins/typescript.d.ts",
"require": "./node_modules/prettier-internal/plugins/typescript.js",
"default": "./node_modules/prettier-internal/plugins/typescript.mjs"
},
"./plugins/acorn": {
"types": "./node_modules/prettier-internal/plugins/acorn.d.ts",
"require": "./node_modules/prettier-internal/plugins/acorn.js",
"default": "./node_modules/prettier-internal/plugins/acorn.mjs"
},
"./plugins/meriyah": {
"types": "./node_modules/prettier-internal/plugins/meriyah.d.ts",
"require": "./node_modules/prettier-internal/plugins/meriyah.js",
"default": "./node_modules/prettier-internal/plugins/meriyah.mjs"
},
"./plugins/angular": {
"types": "./node_modules/prettier-internal/plugins/angular.d.ts",
"require": "./node_modules/prettier-internal/plugins/angular.js",
"default": "./node_modules/prettier-internal/plugins/angular.mjs"
},
"./plugins/postcss": {
"types": "./node_modules/prettier-internal/plugins/postcss.d.ts",
"require": "./node_modules/prettier-internal/plugins/postcss.js",
"default": "./node_modules/prettier-internal/plugins/postcss.mjs"
},
"./plugins/graphql": {
"types": "./node_modules/prettier-internal/plugins/graphql.d.ts",
"require": "./node_modules/prettier-internal/plugins/graphql.js",
"default": "./node_modules/prettier-internal/plugins/graphql.mjs"
},
"./plugins/markdown": {
"types": "./node_modules/prettier-internal/plugins/markdown.d.ts",
"require": "./node_modules/prettier-internal/plugins/markdown.js",
"default": "./node_modules/prettier-internal/plugins/markdown.mjs"
},
"./plugins/glimmer": {
"types": "./node_modules/prettier-internal/plugins/glimmer.d.ts",
"require": "./node_modules/prettier-internal/plugins/glimmer.js",
"default": "./node_modules/prettier-internal/plugins/glimmer.mjs"
},
"./plugins/html": {
"types": "./node_modules/prettier-internal/plugins/html.d.ts",
"require": "./node_modules/prettier-internal/plugins/html.js",
"default": "./node_modules/prettier-internal/plugins/html.mjs"
},
"./plugins/yaml": {
"types": "./node_modules/prettier-internal/plugins/yaml.d.ts",
"require": "./node_modules/prettier-internal/plugins/yaml.js",
"default": "./node_modules/prettier-internal/plugins/yaml.mjs"
},
"./esm/standalone.mjs": "./node_modules/prettier-internal/standalone.mjs",
"./parser-babel": "./node_modules/prettier-internal/plugins/babel.js",
"./parser-babel.js": "./node_modules/prettier-internal/plugins/babel.js",
"./esm/parser-babel.mjs": "./node_modules/prettier-internal/plugins/babel.mjs",
"./parser-flow": "./node_modules/prettier-internal/plugins/flow.js",
"./parser-flow.js": "./node_modules/prettier-internal/plugins/flow.js",
"./esm/parser-flow.mjs": "./node_modules/prettier-internal/plugins/flow.mjs",
"./parser-typescript": "./node_modules/prettier-internal/plugins/typescript.js",
"./parser-typescript.js": "./node_modules/prettier-internal/plugins/typescript.js",
"./esm/parser-typescript.mjs": "./node_modules/prettier-internal/plugins/typescript.mjs",
"./parser-espree": "./node_modules/prettier-internal/plugins/acorn.js",
"./parser-espree.js": "./node_modules/prettier-internal/plugins/acorn.js",
"./esm/parser-espree.mjs": "./node_modules/prettier-internal/plugins/acorn.mjs",
"./parser-meriyah": "./node_modules/prettier-internal/plugins/meriyah.js",
"./parser-meriyah.js": "./node_modules/prettier-internal/plugins/meriyah.js",
"./esm/parser-meriyah.mjs": "./node_modules/prettier-internal/plugins/meriyah.mjs",
"./parser-angular": "./node_modules/prettier-internal/plugins/angular.js",
"./parser-angular.js": "./node_modules/prettier-internal/plugins/angular.js",
"./esm/parser-angular.mjs": "./node_modules/prettier-internal/plugins/angular.mjs",
"./parser-postcss": "./node_modules/prettier-internal/plugins/postcss.js",
"./parser-postcss.js": "./node_modules/prettier-internal/plugins/postcss.js",
"./esm/parser-postcss.mjs": "./node_modules/prettier-internal/plugins/postcss.mjs",
"./parser-graphql": "./node_modules/prettier-internal/plugins/graphql.js",
"./parser-graphql.js": "./node_modules/prettier-internal/plugins/graphql.js",
"./esm/parser-graphql.mjs": "./node_modules/prettier-internal/plugins/graphql.mjs",
"./parser-markdown": "./node_modules/prettier-internal/plugins/markdown.js",
"./parser-markdown.js": "./node_modules/prettier-internal/plugins/markdown.js",
"./esm/parser-markdown.mjs": "./node_modules/prettier-internal/plugins/markdown.mjs",
"./parser-glimmer": "./node_modules/prettier-internal/plugins/glimmer.js",
"./parser-glimmer.js": "./node_modules/prettier-internal/plugins/glimmer.js",
"./esm/parser-glimmer.mjs": "./node_modules/prettier-internal/plugins/glimmer.mjs",
"./parser-html": "./node_modules/prettier-internal/plugins/html.js",
"./parser-html.js": "./node_modules/prettier-internal/plugins/html.js",
"./esm/parser-html.mjs": "./node_modules/prettier-internal/plugins/html.mjs",
"./parser-yaml": "./node_modules/prettier-internal/plugins/yaml.js",
"./parser-yaml.js": "./node_modules/prettier-internal/plugins/yaml.js",
"./esm/parser-yaml.mjs": "./node_modules/prettier-internal/plugins/yaml.mjs"
},
"engines": {
"node": ">=14"
},
"dependencies": {
"atomically": "^2.0.2",
"ignore": "^5.3.0",
"js-yaml": "^4.1.0",
"json-sorted-stringify": "^1.0.0",
"pioppo": "^1.1.0",
"prettier": "3.1.0",
"prettier-internal": "npm:prettier@3.1.0",
"specialist": "^1.3.0",
"tiny-editorconfig": "^1.0.0",
"tiny-jsonc": "^1.0.1",
Expand Down
5 changes: 2 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ If you find any bugs, missing features, or unexpected slowness, please open an i
## Installation

```sh
npm uninstall prettier
npm install @prettier/next
npm install prettier@next
```

It should be largely backwards compatible:
Expand All @@ -22,5 +21,5 @@ prettier src --check # Like before, but faster
You can also try it via `npx`, though `npx` itself is pretty slow:

```sh
npx prettier-next src --check
npx prettier@next src --check
```
2 changes: 1 addition & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bin("prettier", "Prettier is an opinionated code formatter")
.autoExit(true)
.autoUpdateNotifier(false)
.colors(true)
.package("prettier", "3.1.0")
.package("prettier", "4.0.0-alpha.0")
/* USAGES */
.usage(`${color.cyan("prettier")} ${color.yellow("[file/dir/glob...]")} ${color.green("[options]")}`)
.usage(
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function run(options: Options): Promise<void> {
Known.addFolders(foldersExtraPaths);

const prettierVersion = "3.1.0"; //TODO: Hard-coding this is error-prone
const cliVersion = "0.1.0"; //TODO: Hard-coding this is error-prone
const cliVersion = "4.0.0-alpha.0"; //TODO: Hard-coding this is error-prone
const pluginsVersions = ""; //TODO
const editorConfigs = options.editorConfig ? await getEditorConfigsMap(foldersPathsTargets) : {};
const ignoreContents = await getIgnoresContentMap(foldersPathsTargets);
Expand Down
28 changes: 14 additions & 14 deletions src/prettier_serial.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { readFile, writeFile } from "atomically";
import prettier from "prettier/standalone";
import prettierAcorn from "prettier/plugins/acorn";
import prettierAngular from "prettier/plugins/angular";
import prettierBabel from "prettier/plugins/babel";
import prettierEstree from "prettier/plugins/estree";
import prettierFlow from "prettier/plugins/flow";
import prettierGlimmer from "prettier/plugins/glimmer";
import prettierGraphql from "prettier/plugins/graphql";
import prettierHtml from "prettier/plugins/html";
import prettierMarkdown from "prettier/plugins/markdown";
import prettierMeriyah from "prettier/plugins/meriyah";
import prettierPostcss from "prettier/plugins/postcss";
import prettierTypescript from "prettier/plugins/typescript";
import prettierYaml from "prettier/plugins/yaml";
import prettier from "prettier-internal/standalone";
import prettierAcorn from "prettier-internal/plugins/acorn";
import prettierAngular from "prettier-internal/plugins/angular";
import prettierBabel from "prettier-internal/plugins/babel";
import prettierEstree from "prettier-internal/plugins/estree";
import prettierFlow from "prettier-internal/plugins/flow";
import prettierGlimmer from "prettier-internal/plugins/glimmer";
import prettierGraphql from "prettier-internal/plugins/graphql";
import prettierHtml from "prettier-internal/plugins/html";
import prettierMarkdown from "prettier-internal/plugins/markdown";
import prettierMeriyah from "prettier-internal/plugins/meriyah";
import prettierPostcss from "prettier-internal/plugins/postcss";
import prettierTypescript from "prettier-internal/plugins/typescript";
import prettierYaml from "prettier-internal/plugins/yaml";
import type { FormatOptions } from "./types.js";

//TODO: Avoid loading plugins until they are actually needed
Expand Down

0 comments on commit 85ccff6

Please sign in to comment.