Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix build with pnpm #312

Closed
wants to merge 1 commit into from
Closed

Conversation

ntnyq
Copy link
Contributor

@ntnyq ntnyq commented Jan 14, 2025

This PR fixes using pnpm as a package manager to install dependencies and build the project.

Without public-hoist-pattern, it would fail at prepare script when install dependencies with pnpm.

Shell output
> @eslint/[email protected] prepare /Users/ntnyq/Desktop/github/eslint/markdown
> node ./npm-prepare.cjs && npm run build


> @eslint/[email protected] build
> npm run build:rules && rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:update-rules-docs


> @eslint/[email protected] build:rules
> node tools/build-rules.js

Recommended rules generated successfully.
Rules import file generated successfully.

src/index.js → dist/esm/index.js...
(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
mdast-util-from-markdown (imported by "src/language/markdown-language.js" and "src/processor.js")
mdast-util-gfm (imported by "src/language/markdown-language.js")
micromark-extension-gfm (imported by "src/language/markdown-language.js")
@eslint/plugin-kit (imported by "src/language/markdown-source-code.js")
created dist/esm/index.js in 51ms

> @eslint/[email protected] build:dedupe-types
> node tools/dedupe-types.js dist/esm/index.js

dist/esm/index.js:19:22 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

19 /** @typedef {import("mdast").Node} Node */
                        ~~~~~~~

dist/esm/index.js:20:22 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

20 /** @typedef {import("mdast").Parent} ParentNode */
                        ~~~~~~~

dist/esm/index.js:21:22 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

21 /** @typedef {import("mdast").Code} CodeNode */
                        ~~~~~~~

dist/esm/index.js:22:22 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

22 /** @typedef {import("mdast").Html} HtmlNode */
                        ~~~~~~~

dist/esm/index.js:379:27 - error TS2339: Property 'position' does not exist on type 'Block'.

379  const blockStart = block.position.start.line;
                              ~~~~~~~~

dist/esm/index.js:391:19 - error TS2339: Property 'position' does not exist on type 'Block'.

391     column: block.position.start.column,
                      ~~~~~~~~

dist/esm/index.js:515:22 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

515 /** @typedef {import("mdast").Root} RootNode */
                         ~~~~~~~

dist/esm/index.js:516:22 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

516 /** @typedef {import("mdast").Node} MarkdownNode */
                         ~~~~~~~

dist/esm/index.js:517:22 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

517 /** @typedef {import("mdast").Html} HTMLNode */
                         ~~~~~~~

dist/esm/index.js:1293:22 - error TS2307: Cannot find module 'unist' or its corresponding type declarations.

1293 /** @typedef {import("unist").Position} Position */
                          ~~~~~~~

dist/esm/index.js:1294:22 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

1294 /** @typedef {import("mdast").Text} TextNode */
                          ~~~~~~~

dist/esm/types.ts:1:27 - error TS2307: Cannot find module 'mdast' or its corresponding type declarations.

1 import type { Node } from "mdast";
                            ~~~~~~~


Found 12 errors in 2 files.

Errors  Files
    11  dist/esm/index.js:19
     1  dist/esm/types.ts:1
 ELIFECYCLE  Command failed with exit code 2.

@nzakas
Copy link
Member

nzakas commented Jan 14, 2025

This project doesn't use pnpm. You should use npm when building this project.

@nzakas nzakas closed this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants