From 25adc5da815ccb618ac6a5721205b39050cf43a2 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Tue, 18 Nov 2025 11:23:31 +1100 Subject: [PATCH] completing the migration of all files to es modules --- .vscode/tasks.json | 9 ++++----- eng/{create-collection.js => create-collection.mjs} | 10 +++++----- package.json | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) rename eng/{create-collection.js => create-collection.mjs} (95%) mode change 100755 => 100644 diff --git a/.vscode/tasks.json b/.vscode/tasks.json index bd51afe..364442e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -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", diff --git a/eng/create-collection.js b/eng/create-collection.mjs old mode 100755 new mode 100644 similarity index 95% rename from eng/create-collection.js rename to eng/create-collection.mjs index 28099be..0a67469 --- a/eng/create-collection.js +++ b/eng/create-collection.mjs @@ -1,9 +1,9 @@ #!/usr/bin/env node -const fs = require("fs"); -const path = require("path"); -const readline = require("readline"); -const { COLLECTIONS_DIR } = require("./constants"); +import fs from "fs"; +import path from "path"; +import readline from "readline"; +import { COLLECTIONS_DIR } from "./constants.mjs"; const rl = readline.createInterface({ input: process.stdin, @@ -166,7 +166,7 @@ display: console.log("\nšŸ“ Next steps:"); console.log("1. Edit the collection manifest to add your items"); console.log("2. Update the name, description, and tags as needed"); - console.log("3. Run 'npm run validate:collections' to validate"); + console.log("3. Run 'npm run collection:validate' to validate"); console.log("4. Run 'npm start' to generate documentation"); console.log("\nšŸ“„ Collection template contents:"); console.log(template); diff --git a/package.json b/package.json index 98a5522..4fc8d12 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "contributors:add": "all-contributors add", "contributors:generate": "all-contributors generate", "contributors:check": "all-contributors check", - "validate:collections": "node ./eng/validate-collections.mjs" + "collection:validate": "node ./eng/validate-collections.mjs", + "collection:create": "node ./eng/create-collection.mjs" }, "repository": { "type": "git",