Convert build scripts from CommonJS to ES Modules (#416)

* Convert build scripts from CommonJS to ES Modules

- Convert all eng/*.js files to ES Modules (.mjs)
- Update package.json scripts to reference .mjs files
- Fix ERR_REQUIRE_ESM error with vfile v6.0.3
- Add __dirname polyfills for ES Modules

* completing the migration of all files to es modules

---------

Co-authored-by: Lyubomir Filipov <lyubomir.filipov@jakala.com>
Co-authored-by: Aaron Powell <me@aaron-powell.com>
This commit is contained in:
spectatora
2025-11-18 02:23:51 +02:00
committed by GitHub
parent b147f8349c
commit 8440d151d3
7 changed files with 43 additions and 30 deletions

9
.vscode/tasks.json vendored
View File

@@ -12,19 +12,19 @@
{
"label": "generate-readme",
"type": "shell",
"command": "node ${workspaceFolder}/eng/update-readme.js",
"command": "npm run build",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Generates the README.md file using update-readme.js script.",
"detail": "Generates the README.md file using npm build run-script.",
"dependsOn": "npm install"
},
{
"label": "validate-collections",
"type": "shell",
"command": "node ${workspaceFolder}/eng/validate-collections.js",
"command": "npm run collection:validate",
"problemMatcher": [],
"group": "build",
"detail": "Validates all collection manifest files.",
@@ -33,9 +33,8 @@
{
"label": "create-collection",
"type": "shell",
"command": "node",
"command": "npm run collection:create",
"args": [
"${workspaceFolder}/eng/create-collection.js",
"--id",
"${input:collectionId}",
"--tags",