Conversation
Before this change: ```sh $ node .config/do.mjs test Error: ENOENT: no such file or directory, open './docs/specs/readme.md' ``` Tested on Linux (Manjaro, arch-based)
| // Also allow text paragraphs to be wrapped. Though wrapping the whole | ||
| // file at once will mess it up. |
There was a problem hiding this comment.
Not sure why adding the Zig entry below causes this error but I was running into this error:
./core/Parsing.Documents.fs(231,9): (232,42) info FSHARP: XML comment is not placed on a valid language element. (code 3520)
| [<EntryPoint>] | ||
| let main argv = | ||
| let norm (s: String) = s.ToLower().Replace('\\', '/') | ||
| let norm (s: String) = s.Replace('\\', '/') |
There was a problem hiding this comment.
This fixes the tests trying to read differing cased files.
Before this change:
$ node .config/do.mjs test
Error: ENOENT: no such file or directory, open './docs/specs/readme.md'The actual file name is docs/specs/README.md
Tested on Linux (Manjaro, arch-based)
| "eslint": "^8.9.0", | ||
| "log-update": "^5.0.0", | ||
| "parcel": "^2.3.2", | ||
| "parcel": "^2.10.2", |
There was a problem hiding this comment.
Updated parcel to fix the errors when trying to package things with Node.js 18
See parcel-bundler/parcel#8005
Before this change:
$ node .config/do.mjs package
Bundling Core tests with Parcel...
@parcel/optimizer-terser: You must provide the URL of lib/mappings.wasm by
calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using
SourceMapConsumer
Error: You must provide the URL of lib/mappings.wasm by calling
SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using
SourceMapConsumer
at readWasm
(/home/eric/Documents/github/vscode-rewrap/node_modules/terser/node_modules/source-map/lib/read-wasm.js:8:13)
at wasm
(/home/eric/Documents/github/vscode-rewrap/node_modules/terser/node_modules/source-map/lib/wasm.js:25:16)
at
/home/eric/Documents/github/vscode-rewrap/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js:264:14
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SourceMap
(/home/eric/Documents/github/vscode-rewrap/node_modules/terser/dist/bundle.min.js:19362:20)
at async minify
(/home/eric/Documents/github/vscode-rewrap/node_modules/terser/dist/bundle.min.js:27714:41)
at async Object.optimize
(/home/eric/Documents/github/vscode-rewrap/node_modules/@parcel/optimizer-terser/lib/TerserOptimizer.js:131:16)
at async PackagerRunner.optimize
(/home/eric/Documents/github/vscode-rewrap/node_modules/@parcel/core/lib/PackagerRunner.js:364:20)
at async PackagerRunner.getBundleResult
(/home/eric/Documents/github/vscode-rewrap/node_modules/@parcel/core/lib/PackagerRunner.js:255:15)
at async PackagerRunner.getBundleInfo
(/home/eric/Documents/github/vscode-rewrap/node_modules/@parcel/core/lib/PackagerRunner.js:239:9)
Error running: npx --silent parcel build core/test --cache-dir .obj/parcel
@parcel/optimizer-terser: You must provide the URL of lib/mappings.wasm by
calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using
SourceMapConsumer
Error: You must provide the URL of lib/mappings.wasm by calling
SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using
SourceMapConsumer
at readWasm
(/home/eric/Documents/github/vscode-rewrap/node_modules/terser/node_modules/source-map/lib/read-wasm.js:8:13)
at wasm
(/home/eric/Documents/github/vscode-rewrap/node_modules/terser/node_modules/source-map/lib/wasm.js:25:16)
at
/home/eric/Documents/github/vscode-rewrap/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js:264:14
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SourceMap
(/home/eric/Documents/github/vscode-rewrap/node_modules/terser/dist/bundle.min.js:19362:20)
at async minify
(/home/eric/Documents/github/vscode-rewrap/node_modules/terser/dist/bundle.min.js:27714:41)
at async Object.optimize
(/home/eric/Documents/github/vscode-rewrap/node_modules/@parcel/optimizer-terser/lib/TerserOptimizer.js:131:16)
at async PackagerRunner.optimize
(/home/eric/Documents/github/vscode-rewrap/node_modules/@parcel/core/lib/PackagerRunner.js:364:20)
at async PackagerRunner.getBundleResult
(/home/eric/Documents/github/vscode-rewrap/node_modules/@parcel/core/lib/PackagerRunner.js:255:15)
at async PackagerRunner.getBundleInfo
(/home/eric/Documents/github/vscode-rewrap/node_modules/@parcel/core/lib/PackagerRunner.js:239:9)
Packaging & Optimizing...
🚨 Build failed.I fixed the VSCode Rewrap plugin fixed for Zig in stkb/Rewrap#389
migrated from stkb#389 --------- * Fix tests trying to read differing cased files Before this change: ```sh $ node .config/do.mjs test Error: ENOENT: no such file or directory, open './docs/specs/readme.md' ``` Tested on Linux (Manjaro, arch-based) * Add support for Zig comments Fix stkb#388 * Update `parcel` to fix packaging errors with Node.js 18 See parcel-bundler/parcel#8005 * build: package-lock.json * ci: meaningless change to debug workflow --------- Co-authored-by: Eric Eastwood <contact@ericeastwood.com>
|
Since this repository is dead, I forked rewrap and published it to the vscode marketplace. I migrated this PR to the new repository and merged it to master. The changes are working for me in Zig. After some more testing, I'll publish this in a pre-release version. |
|
Thanks for the follow-up @dnut 🙂 |
Add Zig support, https://ziglang.org/documentation/0.11.0/#Comments
Fix #388
Tests pass and tested the extension in VSCode ✅
Dev notes
Setup
Using Node.js
v18.16.0Install depdencies
Make sure
dotnetis installed (see section below for more details)Testing
$ node .config/do.mjs testBuilding
Install the extension in VSCode (this will just overwrite whatever version of Rewrap you already have installed):
Other build commands for reference:
Installing
dotnetdependency$PATHenvironment variable so you can accessdotnetfrom the CLI:.bashrc