Restructure package files, add exports#13530
Merged
fisker merged 35 commits intoprettier:nextfrom Oct 6, 2022
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
exports to package.jsonexports
| const PRETTIER_DIR = IS_PULL_REQUEST | ||
| ? DIST_DIR | ||
| : path.dirname(require.resolve("prettier")); | ||
| : url.fileURLToPath(new URL("../node_modules/prettier", import.meta.url)); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Member
Author
There was a problem hiding this comment.
Problem is not about resolve, require.resolve resolves to dev version, don't know why. But it will resolve to stable version if I remove exports.
Member
Author
There was a problem hiding this comment.
Co-authored-by: Sosuke Suzuki <[email protected]>
sosukesuzuki
approved these changes
Oct 5, 2022
thorn0
approved these changes
Oct 5, 2022
4 tasks
medikoo
pushed a commit
to medikoo/prettier-elastic
that referenced
this pull request
Feb 5, 2024
Co-authored-by: Sosuke Suzuki <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
exportsfor developmentpackage.json{ ".": { "require": "./src/index.cjs", "default": "./src/index.js" }, "./*": "./" }exportsfor productionpackage.json{ ".": { "require": "./index.cjs", "default": "./index.mjs" }, "./*": "./", "./doc": { "require": "./doc.js", "default": "./doc.mjs" }, "./standalone": { "require": "./standalone.js", "default": "./standalone.mjs" }, "./plugins/babel": { "require": "./plugins/babel.js", "default": "./plugins/babel.mjs" }, "./plugins/flow": { "require": "./plugins/flow.js", "default": "./plugins/flow.mjs" }, "./plugins/typescript": { "require": "./plugins/typescript.js", "default": "./plugins/typescript.mjs" }, "./plugins/acorn-and-espree": { "require": "./plugins/acorn-and-espree.js", "default": "./plugins/acorn-and-espree.mjs" }, "./plugins/meriyah": { "require": "./plugins/meriyah.js", "default": "./plugins/meriyah.mjs" }, "./plugins/angular": { "require": "./plugins/angular.js", "default": "./plugins/angular.mjs" }, "./plugins/postcss": { "require": "./plugins/postcss.js", "default": "./plugins/postcss.mjs" }, "./plugins/graphql": { "require": "./plugins/graphql.js", "default": "./plugins/graphql.mjs" }, "./plugins/markdown": { "require": "./plugins/markdown.js", "default": "./plugins/markdown.mjs" }, "./plugins/glimmer": { "require": "./plugins/glimmer.js", "default": "./plugins/glimmer.mjs" }, "./plugins/html": { "require": "./plugins/html.js", "default": "./plugins/html.mjs" }, "./plugins/yaml": { "require": "./plugins/yaml.js", "default": "./plugins/yaml.mjs" }, // legacy entries "./esm/standalone.mjs": "./standalone.mjs", "./parser-babel": "./plugins/babel.js", "./parser-babel.js": "./plugins/babel.js", "./esm/parser-babel.mjs": "./plugins/babel.mjs", "./parser-flow": "./plugins/flow.js", "./parser-flow.js": "./plugins/flow.js", "./esm/parser-flow.mjs": "./plugins/flow.mjs", "./parser-typescript": "./plugins/typescript.js", "./parser-typescript.js": "./plugins/typescript.js", "./esm/parser-typescript.mjs": "./plugins/typescript.mjs", "./parser-espree": "./plugins/acorn-and-espree.js", "./parser-espree.js": "./plugins/acorn-and-espree.js", "./esm/parser-espree.mjs": "./plugins/acorn-and-espree.mjs", "./parser-meriyah": "./plugins/meriyah.js", "./parser-meriyah.js": "./plugins/meriyah.js", "./esm/parser-meriyah.mjs": "./plugins/meriyah.mjs", "./parser-angular": "./plugins/angular.js", "./parser-angular.js": "./plugins/angular.js", "./esm/parser-angular.mjs": "./plugins/angular.mjs", "./parser-postcss": "./plugins/postcss.js", "./parser-postcss.js": "./plugins/postcss.js", "./esm/parser-postcss.mjs": "./plugins/postcss.mjs", "./parser-graphql": "./plugins/graphql.js", "./parser-graphql.js": "./plugins/graphql.js", "./esm/parser-graphql.mjs": "./plugins/graphql.mjs", "./parser-markdown": "./plugins/markdown.js", "./parser-markdown.js": "./plugins/markdown.js", "./esm/parser-markdown.mjs": "./plugins/markdown.mjs", "./parser-glimmer": "./plugins/glimmer.js", "./parser-glimmer.js": "./plugins/glimmer.js", "./esm/parser-glimmer.mjs": "./plugins/glimmer.mjs", "./parser-html": "./plugins/html.js", "./parser-html.js": "./plugins/html.js", "./esm/parser-html.mjs": "./plugins/html.mjs", "./parser-yaml": "./plugins/yaml.js", "./parser-yaml.js": "./plugins/yaml.js", "./esm/parser-yaml.mjs": "./plugins/yaml.mjs" }Make sense?
Fixes #8772
Checklist
docs/directory).changelog_unreleased/*/XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md.✨Try the playground for this PR✨