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

feat(apidom-converter): add example plugin #3743

Closed
wants to merge 1 commit into from

Conversation

kowalczyk-krzysztof
Copy link
Contributor

@kowalczyk-krzysztof kowalczyk-krzysztof commented Jan 26, 2024

Scaffolding an example of converter code. Need some feedback @char0n

I'm also running into some issues with npm run build locally, specifically npm run build:umd:browser.
It seems to be caused by the import below (removing this import fixes browser build):

import { parse } from '@swagger-api/apidom-parser-adapter-yaml-1-2';

Build logs:

ERROR in ../../node_modules/web-tree-sitter/tree-sitter.js 1:686-709
Module not found: Error: Can't resolve 'path' in '/Users/krzysztof.kowalczyk/Desktop/apidom/node_modules/web-tree-sitter'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
 @ ../apidom-parser-adapter-yaml-1-2/es/lexical-analysis/browser.mjs 2:0-37 20:21-32 20:46-66 21:33-39
 @ ../apidom-parser-adapter-yaml-1-2/es/adapter-browser.mjs 1:0-61 4:0-46 7:22-37 16:20-35
 @ ./src/index.ts 1:0-68 5:23-28

ERROR in ../../node_modules/web-tree-sitter/tree-sitter.js 1:760-773
Module not found: Error: Can't resolve 'fs' in '/Users/krzysztof.kowalczyk/Desktop/apidom/node_modules/web-tree-sitter'
 @ ../apidom-parser-adapter-yaml-1-2/es/lexical-analysis/browser.mjs 2:0-37 20:21-32 20:46-66 21:33-39
 @ ../apidom-parser-adapter-yaml-1-2/es/adapter-browser.mjs 1:0-61 4:0-46 7:22-37 16:20-35
 @ ./src/index.ts 1:0-68 5:23-28

ERROR in ../../node_modules/web-tree-sitter/tree-sitter.wasm 1:0
Module parse failed: Unexpected character '' (1:0)
The module seem to be a WebAssembly module, but module is not flagged as WebAssembly module for webpack.
BREAKING CHANGE: Since webpack 5 WebAssembly is not enabled by default and flagged as experimental feature.
You need to enable one of the WebAssembly experiments via 'experiments.asyncWebAssembly: true' (based on async modules) or 'experiments.syncWebAssembly: true' (like webpack 4, deprecated).
For files that transpile to WebAssembly, make sure to set the module type in the 'module.rules' section of the config (e. g. 'type: "webassembly/async"').
(Source code omitted for this binary file)
 @ ../apidom-parser-adapter-yaml-1-2/es/lexical-analysis/browser-patch.mjs 4:0-62 13:42-56
 @ ../apidom-parser-adapter-yaml-1-2/es/lexical-analysis/browser.mjs 1:0-29
 @ ../apidom-parser-adapter-yaml-1-2/es/adapter-browser.mjs 1:0-61 4:0-46 7:22-37 16:20-35
 @ ./src/index.ts 1:0-68 5:23-28

ERROR in ../apidom-parser-adapter-yaml-1-2/wasm/tree-sitter-yaml.wasm 1:0
Module parse failed: Unexpected character '' (1:0)
The module seem to be a WebAssembly module, but module is not flagged as WebAssembly module for webpack.
BREAKING CHANGE: Since webpack 5 WebAssembly is not enabled by default and flagged as experimental feature.
You need to enable one of the WebAssembly experiments via 'experiments.asyncWebAssembly: true' (based on async modules) or 'experiments.syncWebAssembly: true' (like webpack 4, deprecated).
For files that transpile to WebAssembly, make sure to set the module type in the 'module.rules' section of the config (e. g. 'type: "webassembly/async"').
(Source code omitted for this binary file)
 @ ../apidom-parser-adapter-yaml-1-2/es/lexical-analysis/browser.mjs 6:0-62 20:67-81
 @ ../apidom-parser-adapter-yaml-1-2/es/adapter-browser.mjs 1:0-61 4:0-46 7:22-37 16:20-35
 @ ./src/index.ts 1:0-68 5:23-28

@kowalczyk-krzysztof kowalczyk-krzysztof force-pushed the converter-template branch 6 times, most recently from 9c7ace8 to 53933fd Compare January 27, 2024 13:20
@char0n
Copy link
Member

char0n commented Jan 30, 2024

Superseeded by #3755

@char0n char0n closed this Jan 30, 2024
char0n added a commit that referenced this pull request Jan 30, 2024
@char0n char0n deleted the converter-template branch October 19, 2024 18:25
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