From 065a068b723520453c9ae0e876d455e6b0665259 Mon Sep 17 00:00:00 2001 From: Dave Batiste Date: Tue, 23 Jun 2026 12:42:51 -0400 Subject: [PATCH 1/2] Use eslint-config-brightspace v4. --- .../default-content/templates/configured/_package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generators/default-content/templates/configured/_package.json b/src/generators/default-content/templates/configured/_package.json index 66d5a5e..53dff09 100644 --- a/src/generators/default-content/templates/configured/_package.json +++ b/src/generators/default-content/templates/configured/_package.json @@ -13,7 +13,7 @@ "devDependencies": { "@brightspace-ui/stylelint-config": "^2", "eslint": "^9", - "eslint-config-brightspace": "^3", + "eslint-config-brightspace": "^4", "stylelint": "^17" }, "files": [ From 35acc3c62190a64d20339bfb411ed60e9fd42500 Mon Sep 17 00:00:00 2001 From: Dave Batiste Date: Tue, 23 Jun 2026 12:43:54 -0400 Subject: [PATCH 2/2] Use import.meta.dirname. --- src/generators/default-content/index.js | 14 +++++++------- src/generators/demo/index.js | 6 +++--- src/generators/localization/index.js | 4 ++-- src/generators/release/index.js | 4 ++-- src/generators/static-site/index.js | 9 ++------- src/generators/test-reporting/index.js | 4 ++-- src/generators/test-unit-axe/index.js | 14 +++++++------- src/generators/test-vdiff/index.js | 14 +++++++------- src/generators/wc-lit-element/index.js | 4 ++-- 9 files changed, 34 insertions(+), 39 deletions(-) diff --git a/src/generators/default-content/index.js b/src/generators/default-content/index.js index 10ba870..eed8d7a 100644 --- a/src/generators/default-content/index.js +++ b/src/generators/default-content/index.js @@ -8,7 +8,7 @@ export function run(templateData) { replacementsPackage.locales += `,\n"${templateData.hyphenatedName}.serge.json"`; } copyFile( - `${__dirname}/templates/configured/_package.json`, + `${import.meta.dirname}/templates/configured/_package.json`, `${getDestinationPath(templateData.hyphenatedName)}/package.json` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/package.json`, replacementsPackage); @@ -29,34 +29,34 @@ export function run(templateData) { if (templateData.description) replacementsREADME.description = `\n${templateData.description}\n`; copyFile( - `${__dirname}/templates/configured/_README.md`, + `${import.meta.dirname}/templates/configured/_README.md`, `${getDestinationPath(templateData.hyphenatedName)}/README.md` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/README.md`, replacementsREADME); if (templateData.codeowners) { copyFile( - `${__dirname}/templates/configured/_CODEOWNERS`, + `${import.meta.dirname}/templates/configured/_CODEOWNERS`, `${getDestinationPath(templateData.hyphenatedName)}/.github/CODEOWNERS` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/.github/CODEOWNERS`, { codeowners: templateData.codeowners }); } copyFile( - `${__dirname}/templates/configured/LICENSE`, + `${import.meta.dirname}/templates/configured/LICENSE`, `${getDestinationPath(templateData.hyphenatedName)}/LICENSE` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/LICENSE`, { year: new Date().getFullYear().toString() }); copyFile( - `${__dirname}/templates/configured/_gitignore`, + `${import.meta.dirname}/templates/configured/_gitignore`, `${getDestinationPath(templateData.hyphenatedName)}/.gitignore` ); copyFile( - `${__dirname}/templates/configured/_npmrc`, + `${import.meta.dirname}/templates/configured/_npmrc`, `${getDestinationPath(templateData.hyphenatedName)}/.npmrc` ); - copyFilesInDir(`${__dirname}/templates/static`, getDestinationPath(templateData.hyphenatedName)); + copyFilesInDir(`${import.meta.dirname}/templates/static`, getDestinationPath(templateData.hyphenatedName)); } diff --git a/src/generators/demo/index.js b/src/generators/demo/index.js index 3a2c666..5d2fe97 100644 --- a/src/generators/demo/index.js +++ b/src/generators/demo/index.js @@ -2,16 +2,16 @@ import { copyFile, getDestinationPath, mergeJSON, mergeText, replaceText, sortJS export function run(templateData) { mergeJSON( - `${__dirname}/templates/_package.json`, + `${import.meta.dirname}/templates/_package.json`, `${getDestinationPath(templateData.hyphenatedName)}/package.json` ); mergeText( - `${__dirname}/templates/_README.md`, + `${import.meta.dirname}/templates/_README.md`, `${getDestinationPath(templateData.hyphenatedName)}/README.md` ); copyFile( - `${__dirname}/templates/index.html`, + `${import.meta.dirname}/templates/index.html`, `${getDestinationPath(templateData.hyphenatedName)}/demo/index.html` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/demo/index.html`, templateData); diff --git a/src/generators/localization/index.js b/src/generators/localization/index.js index a470fee..dceef94 100644 --- a/src/generators/localization/index.js +++ b/src/generators/localization/index.js @@ -14,11 +14,11 @@ export function run(templateData) { }\n` }; - copyFilesInDir(`${__dirname}/templates/static`, getDestinationPath(templateData.hyphenatedName)); + copyFilesInDir(`${import.meta.dirname}/templates/static`, getDestinationPath(templateData.hyphenatedName)); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/${templateData.hyphenatedName}.js`, replacements); copyFile( - `${__dirname}/templates/configured/_element.serge.json`, + `${import.meta.dirname}/templates/configured/_element.serge.json`, `${getDestinationPath(templateData.hyphenatedName)}/${templateData.hyphenatedName}.serge.json` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/${templateData.hyphenatedName}.serge.json`, templateData); diff --git a/src/generators/release/index.js b/src/generators/release/index.js index 36b1672..427b7e0 100644 --- a/src/generators/release/index.js +++ b/src/generators/release/index.js @@ -2,9 +2,9 @@ import { copyFilesInDir, getDestinationPath, mergeText } from '../../helper.js'; export function run(templateData) { mergeText( - `${__dirname}/templates/configured/_README.md`, + `${import.meta.dirname}/templates/configured/_README.md`, `${getDestinationPath(templateData.hyphenatedName)}/README.md` ); - copyFilesInDir(`${__dirname}/templates/static`, getDestinationPath(templateData.hyphenatedName)); + copyFilesInDir(`${import.meta.dirname}/templates/static`, getDestinationPath(templateData.hyphenatedName)); } diff --git a/src/generators/static-site/index.js b/src/generators/static-site/index.js index 446463e..605ee5c 100644 --- a/src/generators/static-site/index.js +++ b/src/generators/static-site/index.js @@ -1,9 +1,4 @@ -import { - copyAndProcessDir, - getDestinationPath, - movePlugin, - replaceTextPlugin -} from '../../helper.js'; +import { copyAndProcessDir, getDestinationPath, movePlugin, replaceTextPlugin } from '../../helper.js'; import path from 'path'; function genD2ldevReleaseTargetMessage(subdomain) { @@ -42,7 +37,7 @@ export function run(templateData) { d2ldevSubdomain } = templateData; - const templateRoot = path.join(__dirname, 'templates'); + const templateRoot = path.join(import.meta.dirname, 'templates'); const destinationRoot = getDestinationPath(hyphenatedName); const releaseTargetMessage = d2ldevSubdomain diff --git a/src/generators/test-reporting/index.js b/src/generators/test-reporting/index.js index ea2594f..59d16ef 100644 --- a/src/generators/test-reporting/index.js +++ b/src/generators/test-reporting/index.js @@ -7,11 +7,11 @@ export function run(templateData) { }; mergeText( - `${__dirname}/templates/configured/_gitignore`, + `${import.meta.dirname}/templates/configured/_gitignore`, `${getDestinationPath(templateData.hyphenatedName)}/.gitignore` ); copyFile( - `${__dirname}/templates/configured/_d2l-test-reporting.config.json`, + `${import.meta.dirname}/templates/configured/_d2l-test-reporting.config.json`, `${getDestinationPath(templateData.hyphenatedName)}/d2l-test-reporting.config.json` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/d2l-test-reporting.config.json`, templateData); diff --git a/src/generators/test-unit-axe/index.js b/src/generators/test-unit-axe/index.js index abcf6bd..f1538ca 100644 --- a/src/generators/test-unit-axe/index.js +++ b/src/generators/test-unit-axe/index.js @@ -2,34 +2,34 @@ import { copyFile, getDestinationPath, mergeJSON, mergeText, replaceText, sortJS export function run(templateData) { mergeJSON( - `${__dirname}/templates/configured/_package.json`, + `${import.meta.dirname}/templates/configured/_package.json`, `${getDestinationPath(templateData.hyphenatedName)}/package.json` ); mergeText( - `${__dirname}/templates/configured/_README.md`, + `${import.meta.dirname}/templates/configured/_README.md`, `${getDestinationPath(templateData.hyphenatedName)}/README.md` ); copyFile( - `${__dirname}/templates/configured/_element.test.js`, + `${import.meta.dirname}/templates/configured/_element.test.js`, `${getDestinationPath(templateData.hyphenatedName)}/test/${templateData.hyphenatedName}.test.js` ); copyFile( - `${__dirname}/templates/configured/_element.axe.js`, + `${import.meta.dirname}/templates/configured/_element.axe.js`, `${getDestinationPath(templateData.hyphenatedName)}/test/${templateData.hyphenatedName}.axe.js` ); if (templateData.testReporting) { mergeJSON( - `${__dirname}/templates/configured/_d2l-test-reporting.config.json`, + `${import.meta.dirname}/templates/configured/_d2l-test-reporting.config.json`, `${getDestinationPath(templateData.hyphenatedName)}/d2l-test-reporting.config.json` ); copyFile( - `${__dirname}/templates/static/.github/workflows/ci-test-reporting.yml`, + `${import.meta.dirname}/templates/static/.github/workflows/ci-test-reporting.yml`, `${getDestinationPath(templateData.hyphenatedName)}/.github/workflows/ci.yml` ); } else { copyFile( - `${__dirname}/templates/static/.github/workflows/ci.yml`, + `${import.meta.dirname}/templates/static/.github/workflows/ci.yml`, `${getDestinationPath(templateData.hyphenatedName)}/.github/workflows/ci.yml` ); } diff --git a/src/generators/test-vdiff/index.js b/src/generators/test-vdiff/index.js index 0dba782..2851714 100644 --- a/src/generators/test-vdiff/index.js +++ b/src/generators/test-vdiff/index.js @@ -2,36 +2,36 @@ import { copyFile, getDestinationPath, mergeJSON, mergeText, replaceText, sortJS export function run(templateData) { mergeJSON( - `${__dirname}/templates/configured/_package.json`, + `${import.meta.dirname}/templates/configured/_package.json`, `${getDestinationPath(templateData.hyphenatedName)}/package.json` ); mergeText( - `${__dirname}/templates/_README.md`, + `${import.meta.dirname}/templates/_README.md`, `${getDestinationPath(templateData.hyphenatedName)}/README.md` ); mergeText( - `${__dirname}/templates/_gitignore`, + `${import.meta.dirname}/templates/_gitignore`, `${getDestinationPath(templateData.hyphenatedName)}/.gitignore` ); copyFile( - `${__dirname}/templates/_element.vdiff.js`, + `${import.meta.dirname}/templates/_element.vdiff.js`, `${getDestinationPath(templateData.hyphenatedName)}/test/${templateData.hyphenatedName}.vdiff.js` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/test/${templateData.hyphenatedName}.vdiff.js`, templateData); if (templateData.testReporting) { mergeJSON( - `${__dirname}/templates/configured/_d2l-test-reporting.config.json`, + `${import.meta.dirname}/templates/configured/_d2l-test-reporting.config.json`, `${getDestinationPath(templateData.hyphenatedName)}/d2l-test-reporting.config.json` ); copyFile( - `${__dirname}/templates/static/.github/workflows/vdiff-test-reporting.yml`, + `${import.meta.dirname}/templates/static/.github/workflows/vdiff-test-reporting.yml`, `${getDestinationPath(templateData.hyphenatedName)}/.github/workflows/vdiff.yml` ); } else { copyFile( - `${__dirname}/templates/static/.github/workflows/vdiff.yml`, + `${import.meta.dirname}/templates/static/.github/workflows/vdiff.yml`, `${getDestinationPath(templateData.hyphenatedName)}/.github/workflows/vdiff.yml` ); } diff --git a/src/generators/wc-lit-element/index.js b/src/generators/wc-lit-element/index.js index 023aa86..6d574da 100644 --- a/src/generators/wc-lit-element/index.js +++ b/src/generators/wc-lit-element/index.js @@ -2,7 +2,7 @@ import { copyFile, getDestinationPath, mergeJSON, replaceText, sortJSONMembers } export function run(templateData) { mergeJSON( - `${__dirname}/templates/configured/_package.json`, + `${import.meta.dirname}/templates/configured/_package.json`, `${getDestinationPath(templateData.hyphenatedName)}/package.json` ); @@ -14,7 +14,7 @@ export function run(templateData) { templateDataElement.localizeResources = ''; } copyFile( - `${__dirname}/templates/configured/_element.js`, + `${import.meta.dirname}/templates/configured/_element.js`, `${getDestinationPath(templateData.hyphenatedName)}/${templateData.hyphenatedName}.js` ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/${templateData.hyphenatedName}.js`, templateDataElement);