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

Investigate moving to Deno #396

Open
zepumph opened this issue Nov 4, 2024 · 5 comments
Open

Investigate moving to Deno #396

zepumph opened this issue Nov 4, 2024 · 5 comments

Comments

@zepumph
Copy link
Member

zepumph commented Nov 4, 2024

It is worth a chat now that we have made progress with tsx. Some issues we have encountered, like #389 may go away

phetsims/chipper#1272
phetsims/chipper#1206

@zepumph
Copy link
Member Author

zepumph commented Nov 4, 2024

chat about deno before the end of the iteration. cost/benefit analysis. what parts would be difficult to port?

@samreid
Copy link
Member

samreid commented Nov 8, 2024

Keep in mind that problems like the above would also go away when node --experimental-strip-types or equivalent goes into production.

@samreid
Copy link
Member

samreid commented Nov 10, 2024

While working on #404 I was checking the performance of grunt task vs sage run grunt/js/tasks/task and wanted to compare to deno. So I wrote this patch to get the clean task working in deno:

Subject: [PATCH] add node namespace, see https://github.com/phetsims/chipper/issues/1436
---
Index: chipper/js/grunt/tasks/clean.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/clean.ts b/chipper/js/grunt/tasks/clean.ts
--- a/chipper/js/grunt/tasks/clean.ts	(revision 0b48f85d61900691d449105bc445744bbb392cd3)
+++ b/chipper/js/grunt/tasks/clean.ts	(date 1731206829844)
@@ -6,8 +6,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import fs from 'fs';
-import * as grunt from 'grunt';
+import fs from 'node:fs';
 import getRepo from '../../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
 
 export const clean = ( async () => {
Index: perennial-alias/js/grunt/tasks/util/getRepo.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/util/getRepo.ts b/perennial-alias/js/grunt/tasks/util/getRepo.ts
--- a/perennial-alias/js/grunt/tasks/util/getRepo.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/util/getRepo.ts	(date 1731206547876)
@@ -1,11 +1,11 @@
 // Copyright 2013-2024, University of Colorado Boulder
 
-import assert from 'assert';
-import path from 'path';
-import process from 'process';
+import assert from 'node:assert';
+import path from 'node:path';
+import process from 'node:process';
 import { Repo } from '../../../common/PerennialTypes.js';
 import getOption from './getOption.js';
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 /**
  * Get the repo by processing from multiple locations (command line options and package).

Performance tests:

runtime time (s)
deno run --allow-all --unstable-sloppy-imports ../chipper/js/grunt/tasks/clean.ts 0.06
sage run ../chipper/js/grunt/tasks/clean.ts 0.23
grunt clean 0.46

@samreid
Copy link
Member

samreid commented Nov 11, 2024

Experimental hack/patch:

Subject: [PATCH] Avoid grunt, see https://github.com/phetsims/chipper/issues/1436
---
Index: perennial-alias/js/grunt/decaf/buildDecaf.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/decaf/buildDecaf.ts b/perennial-alias/js/grunt/decaf/buildDecaf.ts
--- a/perennial-alias/js/grunt/decaf/buildDecaf.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/decaf/buildDecaf.ts	(date 1731340123388)
@@ -7,7 +7,7 @@
  */
 
 import getPreloads from './getPreloads.js';
-import fs from 'fs';
+import fs from 'node:fs';
 
 const assert = require( 'assert' );
 const execute = require( '../../common/execute.js' );
Index: perennial-alias/js/common/perennialRepoUtils.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/common/perennialRepoUtils.ts b/perennial-alias/js/common/perennialRepoUtils.ts
--- a/perennial-alias/js/common/perennialRepoUtils.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/common/perennialRepoUtils.ts	(date 1731341633828)
@@ -1,12 +1,12 @@
 // Copyright 2024, University of Colorado Boulder
 
-import path from 'path';
+import path from 'node:path';
 
 /**
  * Collection of helper content for using perennial
  * @author Sam Reid (PhET Interactive Simulations)
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-const PERENNIAL_ROOT_PATH = `${__dirname}/../..`;
+const PERENNIAL_ROOT_PATH = `${import.meta.dirname}/../..`;
 export const PERENNIAL_ROOT = path.resolve( PERENNIAL_ROOT_PATH );
 export const PERENNIAL_REPO_NAME = PERENNIAL_ROOT.split( /[\\/]/ ).pop();
\ No newline at end of file
Index: website-common/test/userValidationTest.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-common/test/userValidationTest.js b/website-common/test/userValidationTest.js
--- a/website-common/test/userValidationTest.js	(revision 2bc3b1ba46e7c0c94f078d841dd43f83ad4f17af)
+++ b/website-common/test/userValidationTest.js	(date 1731340109861)
@@ -1,7 +1,7 @@
 // Copyright 2022-2023, University of Colorado Boulder
 
 
-import assert from 'assert';
+import assert from 'node:assert';
 import child_process from 'child_process';
 import * as dotenv from 'dotenv';
 import { clientEmailValidationStrategy } from '../users/clientEmailValidationStrategy.js';
Index: perennial-alias/js/grunt/tasks/dev.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/dev.ts b/perennial-alias/js/grunt/tasks/dev.ts
--- a/perennial-alias/js/grunt/tasks/dev.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/dev.ts	(date 1731340109799)
@@ -8,7 +8,7 @@
  * --message : An optional message that will be appended on version-change commits.
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import dev from '../dev.js';
 import getOption from './util/getOption.js';
Index: perennial-alias/js/grunt/tasks/deploy-decaf.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/deploy-decaf.ts b/perennial-alias/js/grunt/tasks/deploy-decaf.ts
--- a/perennial-alias/js/grunt/tasks/deploy-decaf.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/deploy-decaf.ts	(date 1731340109817)
@@ -5,7 +5,7 @@
  * --project : The name of the project to deploy
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import deployDecaf from '../decaf/deployDecaf.js';
 import getOption from './util/getOption.js';
 
Index: perennial-alias/js/grunt/tasks/production.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/production.ts b/perennial-alias/js/grunt/tasks/production.ts
--- a/perennial-alias/js/grunt/tasks/production.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/production.ts	(date 1731340109882)
@@ -10,7 +10,7 @@
  * --message : An optional message that will be appended on version-change commits.
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import markSimAsPublished from '../../common/markSimAsPublished.js';
 import production from '../production.js';
Index: perennial-alias/js/grunt/tasks/one-off.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/one-off.ts b/perennial-alias/js/grunt/tasks/one-off.ts
--- a/perennial-alias/js/grunt/tasks/one-off.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/one-off.ts	(date 1731340109986)
@@ -10,7 +10,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import getBranch from '../../common/getBranch.js';
 import dev from '../dev.js';
Index: perennial-alias/js/grunt/tasks/create-one-off.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/create-one-off.ts b/perennial-alias/js/grunt/tasks/create-one-off.ts
--- a/perennial-alias/js/grunt/tasks/create-one-off.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/create-one-off.ts	(date 1731340109793)
@@ -7,7 +7,7 @@
  * --message : An optional message that will be appended on version-change commits.
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import createOneOff from '../createOneOff.js';
 import getOption from './util/getOption.js';
Index: chipper/js/grunt/getPreloads.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getPreloads.ts b/chipper/js/grunt/getPreloads.ts
--- a/chipper/js/grunt/getPreloads.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getPreloads.ts	(date 1731340123312)
@@ -1,11 +1,11 @@
 // Copyright 2017-2024, University of Colorado Boulder
 
-import assert from 'assert';
+import assert from 'node:assert';
 import * as grunt from 'grunt';
 import * as _ from 'lodash';
 import ChipperStringUtils from '../common/ChipperStringUtils.js';
 import getPhetLibs from './getPhetLibs.js';
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 /**
  * Gets preload, the set of scripts to be preloaded in the .html file.
Index: scenery-stack-test/js/build.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scenery-stack-test/js/build.js b/scenery-stack-test/js/build.js
--- a/scenery-stack-test/js/build.js	(revision f1ab339320cf75022db7f82c5bec66b0df91818d)
+++ b/scenery-stack-test/js/build.js	(date 1731340148337)
@@ -19,8 +19,8 @@
 
 /* eslint-disable */
 
-import fs from 'fs';
-import path from 'path';
+import fs from 'node:fs';
+import path from 'node:path';
 import { default as webpackGlobalLibraries } from '../../chipper/js/common/webpackGlobalLibraries.js';
 import execute from '../../perennial-alias/js/common/execute.js';
 import _ from 'lodash';
Index: aqua/js/server/QuickServer.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/aqua/js/server/QuickServer.ts b/aqua/js/server/QuickServer.ts
--- a/aqua/js/server/QuickServer.ts	(revision fc02d14e66a740850b6a41af7b324b5600772501)
+++ b/aqua/js/server/QuickServer.ts	(date 1731340148359)
@@ -8,9 +8,9 @@
  * @author Chris Klusendorf (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import http from 'http';
-import path from 'path';
+import path from 'node:path';
 import url from 'url';
 import cloneMissingRepos from '../../../perennial/js/common/cloneMissingRepos.js';
 import deleteDirectory from '../../../perennial/js/common/deleteDirectory.js';
Index: chipper/js/scripts/commits-since.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/scripts/commits-since.ts b/chipper/js/scripts/commits-since.ts
--- a/chipper/js/scripts/commits-since.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/scripts/commits-since.ts	(date 1731340109873)
@@ -14,7 +14,7 @@
  * @author Chris Malley (PixelZoom, Inc.)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import execute from '../../../perennial-alias/js/common/execute.js';
 import getOption from '../../../perennial-alias/js/grunt/tasks/util/getOption.js';
 import getRepo from '../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
Index: perennial-alias/js/scripts/checkout-common-timestamp.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/scripts/checkout-common-timestamp.ts b/perennial-alias/js/scripts/checkout-common-timestamp.ts
--- a/perennial-alias/js/scripts/checkout-common-timestamp.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/scripts/checkout-common-timestamp.ts	(date 1731340109904)
@@ -8,7 +8,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import _ from 'lodash';
 import winston from 'winston';
 import getRepoList from '../common/getRepoList.js';
Index: website-meteor/imports/ui/components/phetTable/SortableTable.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/imports/ui/components/phetTable/SortableTable.tsx b/website-meteor/imports/ui/components/phetTable/SortableTable.tsx
--- a/website-meteor/imports/ui/components/phetTable/SortableTable.tsx	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/imports/ui/components/phetTable/SortableTable.tsx	(date 1731340110256)
@@ -7,7 +7,7 @@
  * @author Chris Klusendorf (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import _ from 'lodash';
 import React, { ReactNode, useEffect, useState } from 'react';
 import { IntentionalAny, JSXElementType } from '../../commonTypes';
Index: chipper/js/phet-io/formatPhetioAPI.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/phet-io/formatPhetioAPI.ts b/chipper/js/phet-io/formatPhetioAPI.ts
--- a/chipper/js/phet-io/formatPhetioAPI.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/phet-io/formatPhetioAPI.ts	(date 1731342307985)
@@ -10,7 +10,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-const assert = require( 'assert' );
+import assert from 'node:assert';
 import fixEOL from '../../../perennial-alias/js/common/fixEOL.js';
 
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.ts';
Index: perennial-alias/js/grunt/check.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/check.ts b/perennial-alias/js/grunt/check.ts
--- a/perennial-alias/js/grunt/check.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/check.ts	(date 1731341509124)
@@ -6,12 +6,12 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
-import { spawn } from 'child_process';
-import fs from 'fs';
-import _ from 'lodash';
-import os from 'os';
-import path from 'path';
+import assert from 'node:assert';
+import { spawn } from 'node:child_process';
+import fs from 'node:fs';
+import _ from 'npm:lodash';
+import os from 'node:os';
+import path from 'node:path';
 import fixEOL from '../common/fixEOL.js';
 import { PERENNIAL_ROOT } from '../common/perennialRepoUtils.js';
 import { Repo } from '../common/PerennialTypes.js';
Index: chipper/js/grunt/copyDirectory.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/copyDirectory.ts b/chipper/js/grunt/copyDirectory.ts
--- a/chipper/js/grunt/copyDirectory.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/copyDirectory.ts	(date 1731342342124)
@@ -9,9 +9,9 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-const _ = require( 'lodash' );
-const assert = require( 'assert' );
-const minify = require( './minify.js' );
+import _ from 'npm:lodash';
+import assert from 'node:assert';
+import minify from './minify.js';
 
 /**
  * @param src - the source directory
@@ -19,7 +19,7 @@
  * @param [filter] - rules for filtering files.  If returns falsy, then the file will be copied directly (helps with images)
  * @param [options]
  */
-module.exports = function( src: string, dst: string, filter?: ( filename: string, contents: string ) => string, options?: IntentionalAny ) {
+export default function( src: string, dst: string, filter?: ( filename: string, contents: string ) => string, options?: IntentionalAny ) {
 
   options = _.assignIn( {
     failOnExistingFiles: false,
Index: chipper/js/grunt/reportUnusedMedia.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/reportUnusedMedia.js b/chipper/js/grunt/reportUnusedMedia.js
--- a/chipper/js/grunt/reportUnusedMedia.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/reportUnusedMedia.js	(date 1731342822505)
@@ -16,14 +16,14 @@
  */
 
 // modules
-const ChipperConstants = require( '../../../chipper/js/common/ChipperConstants.js' );
-const grunt = require( 'grunt' );
+import ChipperConstants from '../../../chipper/js/common/ChipperConstants.js';
+import grunt from 'npm:grunt';
 
 /**
  * @param {string} repo - Name of the repo
  * @param {Array.<string>} usedModules - Used modules within the repo
  */
-module.exports = ( repo, usedModules ) => {
+export default ( repo, usedModules ) => {
 
   // on Windows, paths are reported with a backslash, normalize to forward slashes so this works everywhere
   const normalizedUsedModules = usedModules.map( module => module.split( '\\' ).join( '/' ) );
Index: chipper/js/grunt/packageRunnable.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/packageRunnable.js b/chipper/js/grunt/packageRunnable.js
--- a/chipper/js/grunt/packageRunnable.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/packageRunnable.js	(date 1731342803145)
@@ -8,13 +8,13 @@
 
 
 // modules
-const assert = require( 'assert' );
-const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
-const getTitleStringKey = require( './getTitleStringKey.js' );
-const grunt = require( 'grunt' );
-const pako = require( 'pako' );
-const fs = require( 'fs' );
-const nodeHtmlEncoder = require( 'node-html-encoder' );
+import assert from 'node:assert';
+import ChipperStringUtils from '../common/ChipperStringUtils.js';
+import getTitleStringKey from './getTitleStringKey.js';
+import grunt from 'npm:grunt';
+import pako from 'npm:pako';
+import fs from 'node:fs';
+import nodeHtmlEncoder from 'npm:node-html-encoder';
 
 /**
  * From a given set of config (including the JS and other required things), it creates an HTML file for a runnable.
@@ -23,7 +23,7 @@
  * @param {Object} config
  * @returns {string} - The HTML for the file.
  */
-module.exports = function( config ) {
+export default function( config ) {
 
   const encoder = new nodeHtmlEncoder.Encoder( 'entity' );
 
Index: perennial-alias/js/common/showCommandLineProgress.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/common/showCommandLineProgress.js b/perennial-alias/js/common/showCommandLineProgress.js
--- a/perennial-alias/js/common/showCommandLineProgress.js	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/common/showCommandLineProgress.js	(date 1731342139168)
@@ -14,7 +14,7 @@
  * @param {boolean} newline - if each new progress should give a new line, should be false during progress, and true when finally completed
  * @param {Object} [options]
  */
-module.exports = function showCommandLineProgress( progress, newline, options ) {
+export default function showCommandLineProgress( progress, newline, options ) {
   options = _.assignIn( {
     progressBarLength: 40 // in characters
   }, options );
Index: chipper/js/grunt/minify.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/minify.js b/chipper/js/grunt/minify.js
--- a/chipper/js/grunt/minify.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/minify.js	(date 1731342373349)
@@ -8,9 +8,9 @@
 
 
 // modules
-const _ = require( 'lodash' );
-const transpileForBuild = require( './transpileForBuild.js' );
-const terser = require( 'terser' );
+import _ from 'npm:lodash';
+import transpileForBuild from './transpileForBuild.js';
+import terser from 'npm:terser';
 
 const MINIFY_DEFAULTS = {
   minify: true,
@@ -100,4 +100,4 @@
  * @param {Object} [options]
  * @returns {string} - The minified code
  */
-module.exports = minify;
\ No newline at end of file
+export default minify;
\ No newline at end of file
Index: chipper/js/grunt/gruntMain.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/gruntMain.js b/chipper/js/grunt/gruntMain.js
--- a/chipper/js/grunt/gruntMain.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/gruntMain.js	(date 1731342307973)
@@ -11,11 +11,11 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-const assert = require( 'assert' );
+import assert from 'node:assert';
 require( './checkNodeVersion.js' );
 const registerTasks = require( '../../../perennial-alias/js/grunt/util/registerTasks.js' );
 const gruntSpawn = require( '../../../perennial-alias/js/grunt/util/gruntSpawn.js' );
-const _ = require( 'lodash' );
+import _ from 'npm:lodash';
 const { readFileSync } = require( 'fs' );
 
 const isOptionArg = arg => arg.startsWith( '--' );
@@ -35,7 +35,7 @@
   } );
 }
 
-module.exports = function( grunt ) {
+export default function( grunt ) {
   const packageObject = JSON.parse( readFileSync( 'package.json', 'utf8' ) );
 
   const repo = grunt.option( 'repo' ) || packageObject.name;
Index: chipper/js/grunt/getPrunedLocaleData.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getPrunedLocaleData.js b/chipper/js/grunt/getPrunedLocaleData.js
--- a/chipper/js/grunt/getPrunedLocaleData.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getPrunedLocaleData.js	(date 1731342747036)
@@ -6,16 +6,16 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-const _ = require( 'lodash' );
-const ChipperConstants = require( '../common/ChipperConstants.js' );
-const fs = require( 'fs' );
+import _ from 'npm:lodash';
+import ChipperConstants from '../common/ChipperConstants.js';
+import fs from 'node:fs';
 
 /**
  * Returns a subset of the localeData that should be included in the built simulation.
  *
  * @param localesWithTranslations - Array of locales that have translations
  */
-module.exports = localesWithTranslations => {
+export default localesWithTranslations => {
 
   // Load localeData
   const fullLocaleData = JSON.parse( fs.readFileSync( '../babel/localeData.json', 'utf8' ) );
Index: website-meteor/private/titleIReports/generateTitleIReport.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/private/titleIReports/generateTitleIReport.js b/website-meteor/private/titleIReports/generateTitleIReport.js
--- a/website-meteor/private/titleIReports/generateTitleIReport.js	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/private/titleIReports/generateTitleIReport.js	(date 1731340123272)
@@ -1,7 +1,7 @@
 // Copyright 2022, University of Colorado Boulder
 
 import { executePsqlQuery } from 'executePsqlQuery.js';
-import fs from 'fs';
+import fs from 'node:fs';
 import { getMongoSchoolsCollection } from 'getMongoSchoolsCollection.js';
 
 const localeClassMap = {
Index: website-meteor/private/titleIReports/generateTeacherReportWithTitleI.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/private/titleIReports/generateTeacherReportWithTitleI.js b/website-meteor/private/titleIReports/generateTeacherReportWithTitleI.js
--- a/website-meteor/private/titleIReports/generateTeacherReportWithTitleI.js	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/private/titleIReports/generateTeacherReportWithTitleI.js	(date 1731340123397)
@@ -1,6 +1,6 @@
 // Copyright 2022, University of Colorado Boulder
 
-import fs from 'fs';
+import fs from 'node:fs';
 import minimist from 'minimist';
 import { executePsqlQuery } from './executePsqlQuery.js';
 import { getMongoSchoolsCollection } from './getMongoSchoolsCollection.js';
Index: website-meteor/imports/api/schools/server/startup.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/imports/api/schools/server/startup.js b/website-meteor/imports/api/schools/server/startup.js
--- a/website-meteor/imports/api/schools/server/startup.js	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/imports/api/schools/server/startup.js	(date 1731340123450)
@@ -1,6 +1,6 @@
 // Copyright 2021, University of Colorado Boulder
 
-import { existsSync, readFileSync } from 'fs';
+import { existsSync, readFileSync } from 'node:fs';
 import 'meteor/aldeed:collection2';
 import { JsonRoutes } from 'meteor/simple:json-routes';
 import { Locations } from 'website-common/geo/countryState';
Index: chipper/js/data/localeInfo.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/data/localeInfo.js b/chipper/js/data/localeInfo.js
--- a/chipper/js/data/localeInfo.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/data/localeInfo.js	(date 1731342242457)
@@ -6,7 +6,7 @@
   * @author automatically generated by updateLocaleInfo.js
   */
 
-module.exports = {
+export default {
   aa: {
     name: 'Afar',
     localizedName: 'Qafar af',
Index: website-meteor/imports/api/activities/server/getFilePreviewAndThumbnail.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/imports/api/activities/server/getFilePreviewAndThumbnail.ts b/website-meteor/imports/api/activities/server/getFilePreviewAndThumbnail.ts
--- a/website-meteor/imports/api/activities/server/getFilePreviewAndThumbnail.ts	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/imports/api/activities/server/getFilePreviewAndThumbnail.ts	(date 1731340123413)
@@ -10,7 +10,7 @@
 import child_process from 'child_process';
 import { Meteor } from 'meteor/meteor';
 import { Activities } from '../Activities';
-import fs from 'fs';
+import fs from 'node:fs';
 
 type FilePreviewAndThumbnailType = {
   thumbnailFilename: string | null;
Index: rosetta/src/common/privateConfig.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/rosetta/src/common/privateConfig.js b/rosetta/src/common/privateConfig.js
--- a/rosetta/src/common/privateConfig.js	(revision 79dd1778555eed95d5e12fb66ff910ae129a966f)
+++ b/rosetta/src/common/privateConfig.js	(date 1731340148321)
@@ -6,9 +6,9 @@
  * @author Liam Mulhall <[email protected]>
  */
 
-import fs from 'fs';
+import fs from 'node:fs';
 import os from 'os';
-import path from 'path';
+import path from 'node:path';
 
 export const pathToConfig = path.join( os.homedir(), '.phet', 'rosetta-config.json' );
 
Index: website-meteor/private/titleIReports/addTitle1DataToMongoDb.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/private/titleIReports/addTitle1DataToMongoDb.js b/website-meteor/private/titleIReports/addTitle1DataToMongoDb.js
--- a/website-meteor/private/titleIReports/addTitle1DataToMongoDb.js	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/private/titleIReports/addTitle1DataToMongoDb.js	(date 1731340123429)
@@ -1,7 +1,7 @@
 // Copyright 2022, University of Colorado Boulder
 
 import csv from 'csv-parser';
-import fs from 'fs';
+import fs from 'node:fs';
 import minimist from 'minimist';
 import { MongoClient } from 'mongodb';
 
Index: website-meteor/imports/api/activities/server/getGoogleThumbnail.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/imports/api/activities/server/getGoogleThumbnail.ts b/website-meteor/imports/api/activities/server/getGoogleThumbnail.ts
--- a/website-meteor/imports/api/activities/server/getGoogleThumbnail.ts	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/imports/api/activities/server/getGoogleThumbnail.ts	(date 1731340123316)
@@ -12,7 +12,7 @@
 import { Meteor } from 'meteor/meteor';
 import { Activities } from '../Activities';
 import fsPromise from 'fs/promises';
-import fs from 'fs';
+import fs from 'node:fs';
 import fetch from 'node-fetch'; // TODO: use native fetch after Meteor 3.0 upgrade https://github.com/phetsims/website-meteor/issues/682
 
 export const getGoogleThumbnail = async (
Index: rosetta/src/server/app.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/rosetta/src/server/app.js b/rosetta/src/server/app.js
--- a/rosetta/src/server/app.js	(revision 79dd1778555eed95d5e12fb66ff910ae129a966f)
+++ b/rosetta/src/server/app.js	(date 1731340148374)
@@ -15,7 +15,7 @@
 import cors from 'cors';
 import express from 'express';
 import os from 'os';
-import path from 'path';
+import path from 'node:path';
 import { URL } from 'url';
 import privateConfig, { pathToConfig } from '../common/privateConfig.js';
 import publicConfig from '../common/publicConfig.js';
Index: perennial-alias/js/grunt/tasks/create-sim.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/create-sim.ts b/perennial-alias/js/grunt/tasks/create-sim.ts
--- a/perennial-alias/js/grunt/tasks/create-sim.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/create-sim.ts	(date 1731340109810)
@@ -8,7 +8,7 @@
  * --clean=true : (optional) deletes the repository directory if it exists
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import createSim from '../createSim.js';
 import getOption from './util/getOption.js';
Index: chipper/js/common/documentationToHTML.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/documentationToHTML.js b/chipper/js/common/documentationToHTML.js
--- a/chipper/js/common/documentationToHTML.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/documentationToHTML.js	(date 1731342242479)
@@ -319,7 +319,7 @@
 
   // Node.js-compatible definition
   if ( typeof module !== 'undefined' ) {
-    module.exports = documentationToHTML;
+    export default documentationToHTML;
   }
 
   // Browser direct definition (for testing)
Index: perennial-alias/js/grunt/tasks/build-decaf.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/build-decaf.ts b/perennial-alias/js/grunt/tasks/build-decaf.ts
--- a/perennial-alias/js/grunt/tasks/build-decaf.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/build-decaf.ts	(date 1731340109957)
@@ -6,7 +6,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import buildDecaf from '../decaf/buildDecaf.js';
 import getOption from './util/getOption.js';
 
Index: phet-info/sim-info/printReposPerDev.mjs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/phet-info/sim-info/printReposPerDev.mjs b/phet-info/sim-info/printReposPerDev.mjs
--- a/phet-info/sim-info/printReposPerDev.mjs	(revision 24cf36a429ea17d45afdadfde0e94d4d08a22fcc)
+++ b/phet-info/sim-info/printReposPerDev.mjs	(date 1731340123300)
@@ -1,6 +1,6 @@
 // Copyright 2021, University of Colorado Boulder
 
-import fs from 'fs';
+import fs from 'node:fs';
 
 /**
  * List repos per developer
Index: perennial-alias/js/grunt/tasks/checkout-timestamp.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/checkout-timestamp.ts b/perennial-alias/js/grunt/tasks/checkout-timestamp.ts
--- a/perennial-alias/js/grunt/tasks/checkout-timestamp.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/checkout-timestamp.ts	(date 1731340109866)
@@ -7,7 +7,7 @@
  * --skipNpmUpdate : If provided, will prevent the usual npm update
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import checkoutTimestamp from '../../common/checkoutTimestamp.js';
 import getOption from './util/getOption.js';
Index: perennial-alias/js/grunt/tasks/rc.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/rc.ts b/perennial-alias/js/grunt/tasks/rc.ts
--- a/perennial-alias/js/grunt/tasks/rc.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/rc.ts	(date 1731340109975)
@@ -10,7 +10,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import rc from '../rc.js';
 import getOption from './util/getOption.js';
Index: phet-info/sim-info/generateMarkdownOutput.mjs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/phet-info/sim-info/generateMarkdownOutput.mjs b/phet-info/sim-info/generateMarkdownOutput.mjs
--- a/phet-info/sim-info/generateMarkdownOutput.mjs	(revision 24cf36a429ea17d45afdadfde0e94d4d08a22fcc)
+++ b/phet-info/sim-info/generateMarkdownOutput.mjs	(date 1731340123355)
@@ -1,6 +1,6 @@
 // Copyright 2021, University of Colorado Boulder
 
-import fs from 'fs';
+import fs from 'node:fs';
 
 /**
  * List repos per developer
Index: kite/js/grunt/tasks/generate-svg-path-parser.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/kite/js/grunt/tasks/generate-svg-path-parser.ts b/kite/js/grunt/tasks/generate-svg-path-parser.ts
--- a/kite/js/grunt/tasks/generate-svg-path-parser.ts	(revision 41cb60d97081665384c3da5a435902da264ff36d)
+++ b/kite/js/grunt/tasks/generate-svg-path-parser.ts	(date 1731340123297)
@@ -5,7 +5,7 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-import fs from 'fs';
+import fs from 'node:fs';
 import pegjs from 'pegjs';
 
 const pegInput = fs.readFileSync( 'js/parser/svgPath.pegjs', 'utf8' );
Index: perennial-alias/js/grunt/tasks/util/getRepo.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/util/getRepo.ts b/perennial-alias/js/grunt/tasks/util/getRepo.ts
--- a/perennial-alias/js/grunt/tasks/util/getRepo.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/util/getRepo.ts	(date 1731340159271)
@@ -1,11 +1,11 @@
 // Copyright 2013-2024, University of Colorado Boulder
 
-import assert from 'assert';
-import path from 'path';
-import process from 'process';
+import assert from 'node:assert';
+import path from 'node:path';
+import process from 'node:process';
 import { Repo } from '../../../common/PerennialTypes.js';
 import getOption from './getOption.js';
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 /**
  * Get the repo by processing from multiple locations (command line options and package).
Index: rosetta/src/server/translationApi/getTranslationFormData.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/rosetta/src/server/translationApi/getTranslationFormData.js b/rosetta/src/server/translationApi/getTranslationFormData.js
--- a/rosetta/src/server/translationApi/getTranslationFormData.js	(revision 79dd1778555eed95d5e12fb66ff910ae129a966f)
+++ b/rosetta/src/server/translationApi/getTranslationFormData.js	(date 1731340123280)
@@ -10,7 +10,7 @@
  */
 
 // Uncomment this import of you want a local copy of translation form data.
-// import fs from 'fs';
+// import fs from 'node:fs';
 
 import privateConfig from '../../common/privateConfig.js';
 import publicConfig from '../../common/publicConfig.js';
Index: perennial-alias/js/grunt/tasks/util/getBrands.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/util/getBrands.ts b/perennial-alias/js/grunt/tasks/util/getBrands.ts
--- a/perennial-alias/js/grunt/tasks/util/getBrands.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/util/getBrands.ts	(date 1731340123346)
@@ -3,8 +3,8 @@
 /**
  * @author Sam Reid (PhET Interactive Simulations)
  */
-import assert from 'assert';
-import fs from 'fs';
+import assert from 'node:assert';
+import fs from 'node:fs';
 import buildLocal from '../../../common/buildLocal.js';
 import getOption from './getOption.js';
 
Index: perennial-alias/js/grunt/tasks/checkout-shas.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/checkout-shas.ts b/perennial-alias/js/grunt/tasks/checkout-shas.ts
--- a/perennial-alias/js/grunt/tasks/checkout-shas.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/checkout-shas.ts	(date 1731340123417)
@@ -7,11 +7,11 @@
  * --buildServer : If provided, it will read dependencies from the build-server temporary location (and will skip npm update)
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import checkoutDependencies from '../../common/checkoutDependencies.js';
 import getOption from './util/getOption.js';
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 ( async () => {
   assert( getOption( 'repo' ), 'Requires specifying a repository with --repo={{REPOSITORY}}' );
Index: perennial-alias/js/eslint/divideIntoBatches.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/eslint/divideIntoBatches.ts b/perennial-alias/js/eslint/divideIntoBatches.ts
--- a/perennial-alias/js/eslint/divideIntoBatches.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/eslint/divideIntoBatches.ts	(date 1731340081528)
@@ -1,6 +1,6 @@
 // Copyright 2024, University of Colorado Boulder
 
-import os from 'os';
+import os from 'node:os';
 import { Repo } from './getLintCLIOptions.js';
 
 const MAX_BATCH_SIZE = 50;
Index: perennial-alias/js/grunt/tasks/maintenance-create-patch.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/maintenance-create-patch.ts b/perennial-alias/js/grunt/tasks/maintenance-create-patch.ts
--- a/perennial-alias/js/grunt/tasks/maintenance-create-patch.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/maintenance-create-patch.ts	(date 1731340109926)
@@ -6,7 +6,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import winston from 'winston';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import Maintenance from '../../common/Maintenance.js';
Index: chipper/js/grunt/getPhetLibs.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getPhetLibs.ts b/chipper/js/grunt/getPhetLibs.ts
--- a/chipper/js/grunt/getPhetLibs.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getPhetLibs.ts	(date 1731340755881)
@@ -7,10 +7,9 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-const ChipperConstants = require( '../common/ChipperConstants.js' );
-
-import assert from 'assert';
-import { readFileSync } from 'fs';
+import ChipperConstants from '../common/ChipperConstants.js';
+import assert from 'node:assert';
+import { readFileSync } from 'node:fs';
 import _ from 'lodash';
 
 /**
Index: perennial-alias/js/grunt/tasks/cherry-pick.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/cherry-pick.ts b/perennial-alias/js/grunt/tasks/cherry-pick.ts
--- a/perennial-alias/js/grunt/tasks/cherry-pick.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/cherry-pick.ts	(date 1731340109893)
@@ -8,7 +8,7 @@
  *
  * TODO: ASK DEVS: Delete this grunt task, SR MK think it doesn't belong in formal API, https://github.com/phetsims/chipper/issues/1461
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import cherryPick from '../cherryPick.js';
 import getOption from './util/getOption.ts';
Index: chipper/js/scripts/print-dependencies.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/scripts/print-dependencies.ts b/chipper/js/scripts/print-dependencies.ts
--- a/chipper/js/scripts/print-dependencies.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/scripts/print-dependencies.ts	(date 1731340110345)
@@ -6,7 +6,7 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import getPhetLibs from '../grunt/getPhetLibs.js';
 
 assert( typeof process.argv[ 2 ] === 'string', 'Provide the repo name as the first parameter' );
Index: perennial-alias/js/grunt/tasks/prototype.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/prototype.ts b/perennial-alias/js/grunt/tasks/prototype.ts
--- a/perennial-alias/js/grunt/tasks/prototype.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/prototype.ts	(date 1731340109840)
@@ -10,7 +10,7 @@
  * --message : An optional message that will be appended on version-change commits.
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import production from '../production.js';
 import getOption from './util/getOption.js';
Index: perennial-alias/js/grunt/tasks/checkout-main.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/checkout-main.ts b/perennial-alias/js/grunt/tasks/checkout-main.ts
--- a/perennial-alias/js/grunt/tasks/checkout-main.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/checkout-main.ts	(date 1731340109830)
@@ -7,7 +7,7 @@
  *
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import checkoutMain from '../../common/checkoutMain.js';
 import getOption from './util/getOption.ts';
Index: perennial-alias/js/grunt/tasks/release-branch-list.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/release-branch-list.ts b/perennial-alias/js/grunt/tasks/release-branch-list.ts
--- a/perennial-alias/js/grunt/tasks/release-branch-list.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/release-branch-list.ts	(date 1731340109992)
@@ -7,7 +7,7 @@
  * @author Jonathan Olson <[email protected]>
  * */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import _ from 'lodash';
 import winston from 'winston';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
Index: perennial-alias/js/eslint/config/sim.eslint.config.mjs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/eslint/config/sim.eslint.config.mjs b/perennial-alias/js/eslint/config/sim.eslint.config.mjs
--- a/perennial-alias/js/eslint/config/sim.eslint.config.mjs	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/eslint/config/sim.eslint.config.mjs	(date 1731340109826)
@@ -1,6 +1,6 @@
 // Copyright 2018-2024, University of Colorado Boulder
 
-import assert from 'assert';
+import assert from 'node:assert';
 import { getBrowserConfiguration } from './browser.eslint.config.mjs';
 import rootEslintConfig from './root.eslint.config.mjs';
 
Index: chipper/js/scripts/hook-pre-commit-task.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/scripts/hook-pre-commit-task.ts b/chipper/js/scripts/hook-pre-commit-task.ts
--- a/chipper/js/scripts/hook-pre-commit-task.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/scripts/hook-pre-commit-task.ts	(date 1731340123294)
@@ -7,7 +7,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import fs from 'fs';
+import fs from 'node:fs';
 import CacheLayer from '../../../chipper/js/common/CacheLayer.js';
 import reportMedia from '../../../chipper/js/grunt/reportMedia.js';
 import getRepoList from '../../../perennial-alias/js/common/getRepoList.js';
Index: perennial-alias/js/grunt/tasks/create-release.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/create-release.ts b/perennial-alias/js/grunt/tasks/create-release.ts
--- a/perennial-alias/js/grunt/tasks/create-release.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/create-release.ts	(date 1731340110322)
@@ -9,7 +9,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import createRelease from '../createRelease.js';
 import getOption from './util/getOption.js';
Index: perennial-alias/js/grunt/tasks/checkout-target.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/checkout-target.ts b/perennial-alias/js/grunt/tasks/checkout-target.ts
--- a/perennial-alias/js/grunt/tasks/checkout-target.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/checkout-target.ts	(date 1731340110271)
@@ -8,7 +8,7 @@
  * --skipNpmUpdate : If provided, will prevent the usual npm update
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import checkoutTarget from '../../common/checkoutTarget.js';
 import getOption from './util/getOption.js';
Index: perennial-alias/js/eslint/lint-main.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/eslint/lint-main.ts b/perennial-alias/js/eslint/lint-main.ts
--- a/perennial-alias/js/eslint/lint-main.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/eslint/lint-main.ts	(date 1731340159276)
@@ -20,12 +20,12 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import { ESLint } from 'eslint';
-import fs from 'fs';
+import fs from 'node:fs';
 import _ from 'lodash';
-import path from 'path';
-import process from 'process';
+import path from 'node:path';
+import process from 'node:process';
 import { tscCleanRepo } from '../grunt/check.js';
 import { Repo } from './getLintCLIOptions.js';
 import { DEBUG_PHET_LINT } from './lint.js';
Index: chipper/js/phet-io/generatePhetioMacroAPI.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/phet-io/generatePhetioMacroAPI.ts b/chipper/js/phet-io/generatePhetioMacroAPI.ts
--- a/chipper/js/phet-io/generatePhetioMacroAPI.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/phet-io/generatePhetioMacroAPI.ts	(date 1731340109804)
@@ -8,7 +8,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import withServer from '../../../perennial-alias/js/common/withServer.js';
 import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
 import puppeteer from '../../../perennial-alias/js/npm-dependencies/puppeteer.js';
Index: perennial-alias/js/grunt/tasks/checkout-release.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/checkout-release.ts b/perennial-alias/js/grunt/tasks/checkout-release.ts
--- a/perennial-alias/js/grunt/tasks/checkout-release.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/checkout-release.ts	(date 1731340109781)
@@ -6,7 +6,7 @@
  * --skipNpmUpdate : If provided, will prevent the usual npm update
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import checkoutRelease from '../../common/checkoutRelease.js';
 import getOption from './util/getOption.ts';
Index: perennial-alias/js/eslint/lint.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/eslint/lint.ts b/perennial-alias/js/eslint/lint.ts
--- a/perennial-alias/js/eslint/lint.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/eslint/lint.ts	(date 1731341062136)
@@ -10,15 +10,22 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
-import { spawn } from 'child_process';
+import assert from 'node:assert';
+import { spawn } from 'node:child_process';
 import _ from 'lodash';
-import path from 'path';
+import path from 'node:path';
 import tsxCommand from '../common/tsxCommand.js';
 import divideIntoBatches from './divideIntoBatches.js';
 import { DEFAULT_MAX_PROCESSES, LintOptions, Repo } from './getLintCLIOptions.js';
 
-const lintMainPath = path.join( __dirname, 'lint-main.ts' );
+// __filename - use import.meta.filename instead.
+//
+//                                         __dirname - use import.meta.dirname instead.
+
+// const dirname = import.meta.dirname;
+const dirname = '/Users/samreid/phet/root/perennial-alias/js/eslint/';
+console.log( 'my dirname', dirname );
+const lintMainPath = path.join( dirname, 'lint-main.ts' );
 
 // TODO: Consider removing after review complete, see https://github.com/phetsims/chipper/issues/1520
 // This is primarily for debugging the options and making sure they pass through correctly
Index: perennial-alias/js/grunt/tasks/npm-update.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/grunt/tasks/npm-update.ts b/perennial-alias/js/grunt/tasks/npm-update.ts
--- a/perennial-alias/js/grunt/tasks/npm-update.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/grunt/tasks/npm-update.ts	(date 1731340109853)
@@ -7,7 +7,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import assertIsValidRepoName from '../../common/assertIsValidRepoName.js';
 import npmUpdate from '../../common/npmUpdate.js';
 import getOption from './util/getOption.js';
Index: chipper/js/grunt/generateTestHTML.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/generateTestHTML.ts b/chipper/js/grunt/generateTestHTML.ts
--- a/chipper/js/grunt/generateTestHTML.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/generateTestHTML.ts	(date 1731342242494)
@@ -11,7 +11,7 @@
 
 const generateDevelopmentHTML = require( './generateDevelopmentHTML.js' );
 
-module.exports = async ( repo: string, options: IntentionalAny ): Promise<void> => {
+export default async ( repo: string, options: IntentionalAny ): Promise<void> => {
   await generateDevelopmentHTML( repo, _.merge( {
 
     // Include QUnit CSS
Index: chipper/js/grunt/generateREADME.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/generateREADME.ts b/chipper/js/grunt/generateREADME.ts
--- a/chipper/js/grunt/generateREADME.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/generateREADME.ts	(date 1731340123282)
@@ -12,7 +12,7 @@
 import * as grunt from 'grunt';
 import fixEOL from '../../../perennial-alias/js/common/fixEOL.js';
 import getPhetLibs from './getPhetLibs.js';
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 const getTitleStringKey = require( './getTitleStringKey.js' );
 const writeFileAndGitAdd = require( '../../../perennial-alias/js/common/writeFileAndGitAdd.js' );
Index: chipper/js/phet-io/phetioCompareAPISets.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/phet-io/phetioCompareAPISets.js b/chipper/js/phet-io/phetioCompareAPISets.js
--- a/chipper/js/phet-io/phetioCompareAPISets.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/phet-io/phetioCompareAPISets.js	(date 1731342393936)
@@ -4,11 +4,11 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 const phetioCompareAPIs = require( './phetioCompareAPIs.js' );
-const _ = require( 'lodash' );
+import _ from 'npm:lodash';
 const jsondiffpatch = require( '../../../sherpa/lib/jsondiffpatch-v0.3.11.umd' ).create( {} );
-const assert = require( 'assert' );
+import assert from 'node:assert';
 
 /**
  * Compare two sets of APIs using phetioCompareAPIs.
@@ -18,7 +18,7 @@
  * @param {Object} [options]
  * @returns {Promise.<boolean>} ok
  */
-module.exports = async ( repos, proposedAPIs, options ) => {
+export default async ( repos, proposedAPIs, options ) => {
   let ok = true;
   options = _.assignIn( {
     delta: false,
Index: chipper/js/phet-io/phetioCompareAPIs.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/phet-io/phetioCompareAPIs.js b/chipper/js/phet-io/phetioCompareAPIs.js
--- a/chipper/js/phet-io/phetioCompareAPIs.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/phet-io/phetioCompareAPIs.js	(date 1731342242475)
@@ -495,7 +495,7 @@
   if ( typeof window === 'undefined' ) {
 
     // running in node
-    module.exports = _phetioCompareAPIs;
+    export default _phetioCompareAPIs;
   }
   else {
 
Index: rosetta/src/server/translationApi/getLocaleInfo.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/rosetta/src/server/translationApi/getLocaleInfo.js b/rosetta/src/server/translationApi/getLocaleInfo.js
--- a/rosetta/src/server/translationApi/getLocaleInfo.js	(revision 79dd1778555eed95d5e12fb66ff910ae129a966f)
+++ b/rosetta/src/server/translationApi/getLocaleInfo.js	(date 1731340123365)
@@ -7,7 +7,7 @@
  */
 
 // Uncomment this import if you want a local copy of locale info.
-// import fs from 'fs';
+// import fs from 'node:fs';
 
 import axios from 'axios';
 import privateConfig from '../../common/privateConfig.js';
Index: chipper/js/grunt/packageXHTML.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/packageXHTML.ts b/chipper/js/grunt/packageXHTML.ts
--- a/chipper/js/grunt/packageXHTML.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/packageXHTML.ts	(date 1731341893823)
@@ -8,12 +8,12 @@
 
 
 // modules
-const assert = require( 'assert' );
-const ChipperConstants = require( '../common/ChipperConstants.js' );
-const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
-const getTitleStringKey = require( './getTitleStringKey.js' );
-const grunt = require( 'grunt' );
-const nodeHtmlEncoder = require( 'node-html-encoder' );
+import assert from 'node:assert';
+import ChipperConstants from '../common/ChipperConstants.js';
+import ChipperStringUtils from '../common/ChipperStringUtils.js';
+import getTitleStringKey from './getTitleStringKey.js';
+import grunt from 'npm:grunt';
+import nodeHtmlEncoder from 'npm:node-html-encoder';
 
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.ts';
 
Index: chipper/js/scripts/precommit-hook-multi.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/scripts/precommit-hook-multi.js b/chipper/js/scripts/precommit-hook-multi.js
--- a/chipper/js/scripts/precommit-hook-multi.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/scripts/precommit-hook-multi.js	(date 1731342393933)
@@ -2,7 +2,7 @@
 const startTime = Date.now();
 
 const execute = require( '../../../perennial-alias/js/common/execute.js' );
-const fs = require( 'fs' );
+import fs from 'node:fs';
 const child_process = require( 'child_process' );
 const tsxCommand = require( '../../../perennial-alias/js/common/tsxCommand.js' );
 
Index: chipper/js/grunt/getThirdPartyLibEntries.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getThirdPartyLibEntries.ts b/chipper/js/grunt/getThirdPartyLibEntries.ts
--- a/chipper/js/grunt/getThirdPartyLibEntries.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getThirdPartyLibEntries.ts	(date 1731342458135)
@@ -10,13 +10,13 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 import getLicenseKeys from './getLicenseKeys.js';
 
 // modules
-const _ = require( 'lodash' );
-const assert = require( 'assert' );
-const grunt = require( 'grunt' );
+import _ from 'npm:lodash';
+import assert from 'node:assert';
+import grunt from 'npm:grunt';
 
 const THIRD_PARTY_LICENSES_FILENAME = '../sherpa/lib/license.json'; // contains third-party license info
 const LICENSES_DIRECTORY = '../sherpa/licenses/'; // contains third-party licenses themselves.
Index: chipper/js/grunt/getStringRepos.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getStringRepos.ts b/chipper/js/grunt/getStringRepos.ts
--- a/chipper/js/grunt/getStringRepos.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getStringRepos.ts	(date 1731342393955)
@@ -7,11 +7,11 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
 import getDependencies from './getDependencies.js';
 
-module.exports = async ( repo: string ): Promise<IntentionalAny> => {
+export default async ( repo: string ): Promise<IntentionalAny> => {
   return Object.keys( await getDependencies( repo ) ).filter( stringRepo => stringRepo !== 'comment' ).filter( stringRepo => {
     return fs.existsSync( `../${stringRepo}/${stringRepo}-strings_en.json` );
   } ).map( stringRepo => {
Index: chipper/js/grunt/webpackBuild.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/webpackBuild.ts b/chipper/js/grunt/webpackBuild.ts
--- a/chipper/js/grunt/webpackBuild.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/webpackBuild.ts	(date 1731342020309)
@@ -6,16 +6,16 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-import * as fs from 'fs';
-import * as _ from 'lodash';
-import * as path from 'path';
+import fs from 'node:fs';
+import _ from 'lodash';
+import path from 'node:path';
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
 import * as ChipperConstants from '../common/ChipperConstants.js';
+import webpackGlobalLibraries from '../common/webpackGlobalLibraries.js';
+import webpack from 'npm:webpack';
+import { ModifySourcePlugin, ConcatOperation } from 'npm:modify-source-webpack-plugin';
 
-const webpackGlobalLibraries = require( '../common/webpackGlobalLibraries.js' );
-const webpack = require( 'webpack' );
-const { ModifySourcePlugin, ConcatOperation } = require( 'modify-source-webpack-plugin' );
-
+const __dirname = import.meta.dirname;
 const activeRepos = fs.readFileSync( path.resolve( __dirname, '../../../perennial-alias/data/active-repos' ), 'utf-8' ).trim().split( /\r?\n/ ).map( s => s.trim() );
 const reposByNamespace: Record<string, string> = {};
 const aliases: Record<string, string> = {};
Index: chipper/js/grunt/getLicenseKeys.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getLicenseKeys.ts b/chipper/js/grunt/getLicenseKeys.ts
--- a/chipper/js/grunt/getLicenseKeys.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getLicenseKeys.ts	(date 1731342713604)
@@ -7,11 +7,11 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 import getPreloads from './getPreloads.js';
 
-const _ = require( 'lodash' );
-const webpackGlobalLibraries = require( '../common/webpackGlobalLibraries.js' );
+import _ from 'npm:lodash';
+import webpackGlobalLibraries from '../common/webpackGlobalLibraries.js';
 
 /**
  * Gets the license keys for sherpa (third-party) libs that are used.
Index: chipper/js/grunt/copySupplementalPhetioFiles.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/copySupplementalPhetioFiles.ts b/chipper/js/grunt/copySupplementalPhetioFiles.ts
--- a/chipper/js/grunt/copySupplementalPhetioFiles.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/copySupplementalPhetioFiles.ts	(date 1731342678888)
@@ -8,7 +8,7 @@
  * @author Matt Pennington (PhET Interactive Simulations)
  */
 
-import * as fs from 'fs';
+import * as fs from 'node:fs';
 import * as _ from 'lodash';
 import check from '../../../perennial-alias/js/grunt/check.ts';
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
@@ -18,18 +18,17 @@
 import getPhetLibs from './getPhetLibs.js';
 import webpackBuild from './webpackBuild.ts';
 
-const assert = require( 'assert' );
-const archiver = require( 'archiver' );
-const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
-const copyDirectory = require( '../grunt/copyDirectory.js' );
-const execute = require( '../../../perennial-alias/js/common/execute.js' );
-const grunt = require( 'grunt' );
+import assert from 'node:assert';
+import archiver from 'npm:archiver';
+import ChipperStringUtils from '../common/ChipperStringUtils.js';
+import copyDirectory from '../grunt/copyDirectory.js';
+import execute from '../../../perennial-alias/js/common/execute.js';
+import grunt from 'npm:grunt';
 
-const minify = require( '../grunt/minify.js' );
-const marked = require( 'marked' );
-
-const path = require( 'path' );
-const webpack = require( 'webpack' );
+import minify from '../grunt/minify.js';
+// import marked from 'npm:marked';
+import path from 'node:path';
+import webpack from 'npm:webpack';
 
 // constants
 const DEDICATED_REPO_WRAPPER_PREFIX = 'phet-io-wrapper-';
@@ -99,7 +98,7 @@
 
 const STUDIO_BUILT_FILENAME = 'studio.min.js';
 
-module.exports = async ( repo: string, version: string, simulationDisplayName: string, packageObject: IntentionalAny, generateMacroAPIFile = false, noTSC = false ) => {
+export default async ( repo: string, version: string, simulationDisplayName: string, packageObject: IntentionalAny, generateMacroAPIFile = false, noTSC = false ) => {
 
   const repoPhetLibs = getPhetLibs( repo, 'phet-io' );
   assert && assert( _.every( getPhetLibs( 'phet-io-wrappers' ), repo => repoPhetLibs.includes( repo ) ),
@@ -640,7 +639,8 @@
   assertNoConstAwait && assert && assert( !/^.*const.*await.*$/gm.test( clientGuideSource ),
     `use let instead of const when awaiting values in PhET-iO "${EXAMPLES_FILENAME}" files` );
 
-  const renderedClientGuide = marked.parse( clientGuideSource );
+  // const renderedClientGuide = marked.parse( clientGuideSource );
+  const renderedClientGuide = clientGuideSource;
 
   // link a stylesheet
   const clientGuideHTML = `<head>
Index: chipper/js/scripts/hook-pre-commit.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/scripts/hook-pre-commit.js b/chipper/js/scripts/hook-pre-commit.js
--- a/chipper/js/scripts/hook-pre-commit.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/scripts/hook-pre-commit.js	(date 1731342475671)
@@ -22,7 +22,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-const path = require( 'path' );
+import path from 'node:path';
 const execute = require( '../../../perennial-alias/js/common/execute.js' );
 const phetTimingLog = require( '../../../perennial-alias/js/common/phetTimingLog.js' );
 const tsxCommand = require( '../../../perennial-alias/js/common/tsxCommand.js' );
Index: chipper/js/grunt/getAllThirdPartyEntries.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getAllThirdPartyEntries.ts b/chipper/js/grunt/getAllThirdPartyEntries.ts
--- a/chipper/js/grunt/getAllThirdPartyEntries.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getAllThirdPartyEntries.ts	(date 1731342196107)
@@ -14,7 +14,7 @@
  * NOTE: This pulls entries from some of the chipper globals. Should be done only after the build
  */
 // TODO: type alias for TLicenseEntry, see https://github.com/phetsims/chipper/issues/1465
-module.exports = function( repo: string, brand: string, licenseEntries?: Record<string, Record<string, { projectURL: string }>> ) {
+export default function( repo: string, brand: string, licenseEntries?: Record<string, Record<string, { projectURL: string }>> ) {
   const thirdPartyEntries: Record<string, IntentionalAny> = {
     lib: getThirdPartyLibEntries( repo, brand )
   };
Index: chipper/js/common/getLicenseEntry.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/getLicenseEntry.js b/chipper/js/common/getLicenseEntry.js
--- a/chipper/js/common/getLicenseEntry.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/getLicenseEntry.js	(date 1731341196221)
@@ -18,7 +18,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 
 /**
  * Retrieves the license entry for a media file from license.json.
@@ -62,4 +62,4 @@
   return entry;
 }
 
-module.exports = getLicenseEntry;
\ No newline at end of file
+export default getLicenseEntry;
\ No newline at end of file
Index: chipper/js/data/updateLocaleInfo.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/data/updateLocaleInfo.js b/chipper/js/data/updateLocaleInfo.js
--- a/chipper/js/data/updateLocaleInfo.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/data/updateLocaleInfo.js	(date 1731342393928)
@@ -10,7 +10,7 @@
  */
 
 const child_process = require( 'child_process' );
-const fs = require( 'fs' );
+import fs from 'node:fs';
 
 /**
  * Converts locale data from babel/localeData.json into legacy formats used by rosetta and the website.
@@ -71,7 +71,7 @@
 
 `;
 
-const newCommonJSSouceCode = `${commonDocumentation}module.exports = ${localeInfoSnippet};`;
+const newCommonJSSouceCode = `${commonDocumentation}export default ${localeInfoSnippet};`;
 fs.writeFileSync( './localeInfo.js', newCommonJSSouceCode );
 
 console.log( 'locale info files updated' );
Index: chipper/js/common/mipmapDownscale.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/mipmapDownscale.js b/chipper/js/common/mipmapDownscale.js
--- a/chipper/js/common/mipmapDownscale.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/mipmapDownscale.js	(date 1731342242513)
@@ -93,4 +93,4 @@
   };
 }
 
-module.exports = mipmapDownscale;
\ No newline at end of file
+export default mipmapDownscale;
\ No newline at end of file
Index: chipper/js/common/CacheLayer.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/CacheLayer.js b/chipper/js/common/CacheLayer.js
--- a/chipper/js/common/CacheLayer.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/CacheLayer.js	(date 1731342393949)
@@ -10,7 +10,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 
 const readCacheLayerJSON = () => {
   try {
@@ -27,7 +27,7 @@
   fs.writeFileSync( '../chipper/dist/cache-layer.json', JSON.stringify( json, null, 2 ) );
 };
 
-module.exports = {
+export default {
 
   // When the watch process exits, invalidate the caches until the watch process resumes
   clearLastChangedTimestamp() {
Index: chipper/js/common/ChipperConstants.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/ChipperConstants.js b/chipper/js/common/ChipperConstants.js
--- a/chipper/js/common/ChipperConstants.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/ChipperConstants.js	(date 1731340769113)
@@ -32,4 +32,4 @@
   BUILD_DIR: 'build'
 };
 
-module.exports = ChipperConstants;
\ No newline at end of file
+export default ChipperConstants;
\ No newline at end of file
Index: chipper/js/common/loadFileAsDataURI.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/loadFileAsDataURI.js b/chipper/js/common/loadFileAsDataURI.js
--- a/chipper/js/common/loadFileAsDataURI.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/loadFileAsDataURI.js	(date 1731342393972)
@@ -6,7 +6,7 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 
 /**
  * @param {string} filename
@@ -39,4 +39,4 @@
   return base64;
 }
 
-module.exports = loadFileAsDataURI;
\ No newline at end of file
+export default loadFileAsDataURI;
\ No newline at end of file
Index: chipper/js/common/extractDocumentation.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/extractDocumentation.js b/chipper/js/common/extractDocumentation.js
--- a/chipper/js/common/extractDocumentation.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/extractDocumentation.js	(date 1731342242484)
@@ -590,7 +590,7 @@
 
   // Node.js-compatible definition
   if ( typeof module !== 'undefined' ) {
-    module.exports = extractDocumentation;
+    export default extractDocumentation;
   }
 
   // Browser direct definition (for testing)
Index: chipper/js/common/ChipperStringUtils.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/ChipperStringUtils.js b/chipper/js/common/ChipperStringUtils.js
--- a/chipper/js/common/ChipperStringUtils.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/ChipperStringUtils.js	(date 1731341692776)
@@ -7,12 +7,11 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-const assert = require( 'assert' );
-const _ = require( 'lodash' );
-
 // What divides the repo prefix from the rest of the string key, like `FRICTION/friction.title`
 const NAMESPACE_PREFIX_DIVIDER = '/';
 const A11Y_MARKER = 'a11y.';
+import assert from 'node:assert';
+import _ from 'lodash';
 
 const ChipperStringUtils = {
 
@@ -223,4 +222,4 @@
  * Object with StringObjects throughout the object structure (as supported in English JSON string files).
  */
 
-module.exports = ChipperStringUtils;
\ No newline at end of file
+export default ChipperStringUtils;
\ No newline at end of file
Index: rosetta/src/server/translationApi/translationReport/getTranslationInfo.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/rosetta/src/server/translationApi/translationReport/getTranslationInfo.js b/rosetta/src/server/translationApi/translationReport/getTranslationInfo.js
--- a/rosetta/src/server/translationApi/translationReport/getTranslationInfo.js	(revision 79dd1778555eed95d5e12fb66ff910ae129a966f)
+++ b/rosetta/src/server/translationApi/translationReport/getTranslationInfo.js	(date 1731340123320)
@@ -65,7 +65,7 @@
 };
 
 // Uncomment this code if you want a local copy of translation info.
-// import fs from 'fs';
+// import fs from 'node:fs';
 //
 // ( async () => {
 //   const translationInfo = await getTranslationInfo();
Index: chipper/js/common/transpile.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/transpile.ts b/chipper/js/common/transpile.ts
--- a/chipper/js/common/transpile.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/transpile.ts	(date 1731342845957)
@@ -1,10 +1,10 @@
 // Copyright 2024, University of Colorado Boulder
 
-import assert from 'assert';
-import { spawn } from 'child_process';
-import fs from 'fs';
+import assert from 'node:assert';
+import { spawn } from 'node:child_process';
+import fs from 'node:fs';
 import _ from 'lodash';
-import path from 'path';
+import path from 'node:path';
 import getActiveRepos from '../../../perennial-alias/js/common/getActiveRepos.js';
 import { Repo } from '../../../perennial-alias/js/common/PerennialTypes.js';
 import getOption, { isOptionKeyProvided } from '../../../perennial-alias/js/grunt/tasks/util/getOption.js';
@@ -52,7 +52,7 @@
 
   // We can't use --delete-dir-on-start, because we are operating multiple swc instances in child processes.
   if ( options.clean ) {
-    const distPath = path.resolve( __dirname, '../../../chipper/dist/js' );
+    const distPath = path.resolve( import.meta.dirname, '../../../chipper/dist/js' );
     if ( fs.existsSync( distPath ) ) {
       fs.rmSync( distPath, { recursive: true, force: true } );
     }
@@ -112,7 +112,7 @@
  * NOTE: Adding a new brand requires restarting the watch process
  */
 function getBrands(): string[] {
-  const pathForBrand = path.resolve( __dirname, '../../../brand/' );
+  const pathForBrand = path.resolve( import.meta.dirname, '../../../brand/' );
   const brands = fs.readdirSync( pathForBrand ).filter( file => fs.statSync( path.join( pathForBrand, file ) ).isDirectory() );
 
   const omitDirectories = [ 'node_modules', '.github', 'js', '.git' ];
@@ -145,7 +145,7 @@
 function spawnCommand( command: string, args: string[] ): Promise<void> {
   return new Promise( ( resolve, reject ) => {
     const child = spawn( command, args, {
-      cwd: path.resolve( __dirname, '../../../' ),
+      cwd: path.resolve( import.meta.dirname, '../../../' ),
       shell: true, // Important for windows.
       stdio: 'inherit' // Inherit stdio to display output directly
     } );
Index: chipper/js/grunt/transpileForBuild.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/transpileForBuild.js b/chipper/js/grunt/transpileForBuild.js
--- a/chipper/js/grunt/transpileForBuild.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/transpileForBuild.js	(date 1731341788731)
@@ -8,7 +8,7 @@
 
 
 // modules
-const babel = require( '@babel/core' ); // eslint-disable-line phet/require-statement-match
+import babel from 'npm:@babel/core';
 
 /**
  * Transpile some code to be compatible with the browsers specified below
@@ -18,7 +18,7 @@
  * @param {boolean} [forIE=false] - whether the jsInput should be transpiled for Internet Explorer
  * @returns {string} - The transpiled code
  */
-module.exports = function( jsInput, forIE = false ) {
+export default function( jsInput, forIE = false ) {
 
   // This list specifies the target browsers for Babel. Its format is described at https://browsersl.ist.
   // Note that this is related to System Requirements advertised on the PhET website, so should be modified with care.
Index: chipper/js/common/showCommandLineProgress.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/showCommandLineProgress.js b/chipper/js/common/showCommandLineProgress.js
--- a/chipper/js/common/showCommandLineProgress.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/showCommandLineProgress.js	(date 1731342265722)
@@ -6,7 +6,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-const _ = require( 'lodash' );
+import _ from 'npm:lodash';
 
 /**
  * See https://jagascript.com/how-to-build-a-textual-progress-bar-for-cli-and-terminal-apps/
@@ -14,7 +14,7 @@
  * @param {boolean} newline - if each new progress should give a new line, should be false during progress, and true when finally completed
  * @param {Object} [options]
  */
-module.exports = function showCommandLineProgress( progress, newline, options ) {
+export default function showCommandLineProgress( progress, newline, options ) {
   options = _.assignIn( {
     progressBarLength: 40 // in characters
   }, options );
Index: chipper/js/common/pascalCase.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/pascalCase.js b/chipper/js/common/pascalCase.js
--- a/chipper/js/common/pascalCase.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/pascalCase.js	(date 1731342265752)
@@ -1,12 +1,12 @@
 // Copyright 2022-2024, University of Colorado Boulder
 
-const _ = require( 'lodash' );
+import _ from 'npm:lodash';
 
 /**
  * Convert a string to PascalCase
  * @author Chris Klusendorf (PhET Interactive Simulations)
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
-module.exports = function pascalCase( string ) {
+export default function pascalCase( string ) {
   return `${_.startCase( _.camelCase( string ) ).split( ' ' ).join( '' )}`;
 };
\ No newline at end of file
Index: rosetta/src/server/builtReactAppServer/builtReactAppServer.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/rosetta/src/server/builtReactAppServer/builtReactAppServer.js b/rosetta/src/server/builtReactAppServer/builtReactAppServer.js
--- a/rosetta/src/server/builtReactAppServer/builtReactAppServer.js	(revision 79dd1778555eed95d5e12fb66ff910ae129a966f)
+++ b/rosetta/src/server/builtReactAppServer/builtReactAppServer.js	(date 1731340148350)
@@ -8,7 +8,7 @@
 
 import express from 'express';
 import os from 'os';
-import path from 'path';
+import path from 'node:path';
 import { URL } from 'url';
 
 const builtReactAppServer = express();
Index: perennial-alias/js/common/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/common/package.json b/perennial-alias/js/common/package.json
new file mode 100644
--- /dev/null	(date 1731340518696)
+++ b/perennial-alias/js/common/package.json	(date 1731340518696)
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
\ No newline at end of file
Index: perennial-alias/js/common/fixEOL.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/common/fixEOL.ts b/perennial-alias/js/common/fixEOL.ts
--- a/perennial-alias/js/common/fixEOL.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/common/fixEOL.ts	(date 1731341612128)
@@ -8,6 +8,6 @@
  */
 
 // modules
-const os = require( 'os' );
+import os from 'node:os';
 
 export default ( string: string ): string => string.split( '\r' ).join( '' ).split( '\n' ).join( os.EOL );
\ No newline at end of file
Index: rosetta/scripts/js/make-public-config-file.mjs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/rosetta/scripts/js/make-public-config-file.mjs b/rosetta/scripts/js/make-public-config-file.mjs
--- a/rosetta/scripts/js/make-public-config-file.mjs	(revision 79dd1778555eed95d5e12fb66ff910ae129a966f)
+++ b/rosetta/scripts/js/make-public-config-file.mjs	(date 1731340123269)
@@ -12,7 +12,7 @@
  * @author Liam Mulhall <[email protected]>
  */
 
-import fs from 'fs';
+import fs from 'node:fs';
 import privateConfig from '../../src/common/privateConfig.js';
 
 // These are the keys whose values we want to extract from the private config file.
Index: chipper/js/grunt/getTitleStringKey.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getTitleStringKey.js b/chipper/js/grunt/getTitleStringKey.js
--- a/chipper/js/grunt/getTitleStringKey.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getTitleStringKey.js	(date 1731341907746)
@@ -6,7 +6,7 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 /**
  * Returns the string key for the title of a runnable.
@@ -14,7 +14,7 @@
  *
  * @param {string} repo
  */
-module.exports = function getPhetLibs( repo ) {
+export default function getPhetLibs( repo ) {
   const packageObject = JSON.parse( readFileSync( `../${repo}/package.json`, 'utf8' ) );
 
   return `${packageObject.phet.requirejsNamespace}/${repo}.title`;
Index: chipper/js/grunt/getStringMap.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getStringMap.js b/chipper/js/grunt/getStringMap.js
--- a/chipper/js/grunt/getStringMap.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getStringMap.js	(date 1731342475680)
@@ -8,14 +8,15 @@
  */
 
 
-const _ = require( 'lodash' );
-const assert = require( 'assert' );
-const ChipperConstants = require( '../common/ChipperConstants.js' );
-const pascalCase = require( '../common/pascalCase.js' );
-const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
-const fs = require( 'fs' );
-const grunt = require( 'grunt' );
-const path = require( 'path' );
+import assert from 'node:assert';
+import fs from 'node:fs';
+import _ from 'npm:lodash';
+import ChipperConstants from '../common/ChipperConstants.js';
+import ChipperStringUtils from '../common/ChipperStringUtils.js';
+import pascalCase from '../common/pascalCase.js';
+
+import grunt from 'npm:grunt';
+import path from 'node:path';
 
 const localeData = JSON.parse( fs.readFileSync( '../babel/localeData.json', 'utf8' ) );
 
@@ -94,7 +95,7 @@
  *
  * @returns {Object} - map[locale][stringKey] => {string}
  */
-module.exports = function getStringMap( mainRepo, locales, phetLibs, usedModules ) {
+export default function getStringMap( mainRepo, locales, phetLibs, usedModules ) {
 
   assert( locales.indexOf( ChipperConstants.FALLBACK_LOCALE ) !== -1, 'fallback locale is required' );
 
Index: chipper/js/scripts/profile-file-size.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/scripts/profile-file-size.ts b/chipper/js/scripts/profile-file-size.ts
--- a/chipper/js/scripts/profile-file-size.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/scripts/profile-file-size.ts	(date 1731340123260)
@@ -17,7 +17,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import fs from 'fs';
+import fs from 'node:fs';
 import _ from 'lodash';
 import zlib from 'zlib';
 import getRepo from '../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
Index: chipper/js/grunt/tasks/update.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/update.ts b/chipper/js/grunt/tasks/update.ts
--- a/chipper/js/grunt/tasks/update.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/update.ts	(date 1731342265736)
@@ -12,11 +12,11 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import * as fs from 'fs';
+import * as fs from 'node:fs';
 import * as grunt from 'grunt';
 import getRepo from '../../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
 import generateREADME from '../generateREADME.js';
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 const generateDevelopmentHTML = require( '../generateDevelopmentHTML.js' );
 const generateA11yViewHTML = require( '../generateA11yViewHTML.js' );
@@ -28,7 +28,7 @@
 
 const packageObject = JSON.parse( readFileSync( `../${repo}/package.json`, 'utf8' ) );
 
-const _ = require( 'lodash' );
+import _ from 'npm:lodash';
 
 // support repos that don't have a phet object
 if ( !packageObject.phet ) {
Index: chipper/js/grunt/tasks/build.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/build.ts b/chipper/js/grunt/tasks/build.ts
--- a/chipper/js/grunt/tasks/build.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/build.ts	(date 1731341469085)
@@ -24,8 +24,8 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
-import * as grunt from 'grunt';
+import assert from 'node:assert';
+import grunt from 'grunt';
 import check from '../../../../perennial-alias/js/grunt/check.js';
 import getBrands from '../../../../perennial-alias/js/grunt/tasks/util/getBrands.js';
 import getOption from '../../../../perennial-alias/js/grunt/tasks/util/getOption.js';
@@ -35,12 +35,12 @@
 import buildRunnable from '../buildRunnable.js';
 import buildStandalone from '../buildStandalone.js';
 import getPhetLibs from '../getPhetLibs.js';
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
-const minify = require( '../minify.js' );
-const path = require( 'path' );
-const fs = require( 'fs' );
-const phetTimingLog = require( '../../../../perennial-alias/js/common/phetTimingLog.js' );
+import minify from '../minify.js';
+import path from 'node:path';
+import fs from 'node:fs';
+import phetTimingLog from '../../../../perennial-alias/js/common/phetTimingLog.js';
 
 const repo = getRepo();
 
Index: perennial-alias/js/scripts/reopen-issues-from-todos.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/scripts/reopen-issues-from-todos.ts b/perennial-alias/js/scripts/reopen-issues-from-todos.ts
--- a/perennial-alias/js/scripts/reopen-issues-from-todos.ts	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/scripts/reopen-issues-from-todos.ts	(date 1731340159263)
@@ -1,9 +1,9 @@
 // Copyright 2024, University of Colorado Boulder
 
 import Octokit from '@octokit/rest';
-import fs from 'fs';
+import fs from 'node:fs';
 import _ from 'lodash';
-import process from 'process';
+import process from 'node:process';
 import buildLocal from '../common/buildLocal.js';
 import createDirectory from '../common/createDirectory.js';
 import lint from '../eslint/lint.js';
Index: chipper/js/common/getSimList.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/getSimList.ts b/chipper/js/common/getSimList.ts
--- a/chipper/js/common/getSimList.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/getSimList.ts	(date 1731340123339)
@@ -6,7 +6,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import fs from 'fs';
+import fs from 'node:fs';
 
 export default function(): string[] {
   const args = process.argv.slice( 2 );
Index: chipper/js/common/stringEncoding.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/stringEncoding.js b/chipper/js/common/stringEncoding.js
--- a/chipper/js/common/stringEncoding.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/stringEncoding.js	(date 1731341822776)
@@ -30,8 +30,8 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-const _ = require( 'lodash' );
-const toLessEscapedString = require( './toLessEscapedString.js' );
+import _ from 'lodash';
+import toLessEscapedString from './toLessEscapedString.js';
 
 const PUSH_TOKEN = '\u0001'; // push string on the stack
 const PUSH_TOKEN_SLASH = '\u0002'; // push `${string}/` on the stack
@@ -474,7 +474,7 @@
 // Given a stringMap (map[ locale ][ stringKey ] => string), returns a JS expression string that will decode to it.
 const encodeStringMapToJS = stringMap => `(${smallDecodeStringMapString})(${toLessEscapedString( encodeStringMap( stringMap ) )})`;
 
-module.exports = {
+export default {
   encodeStringMap: encodeStringMap,
   decodeStringMap: decodeStringMap,
   encodeStringMapToJS: encodeStringMapToJS
Index: chipper/js/grunt/reportMedia.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/reportMedia.ts b/chipper/js/grunt/reportMedia.ts
--- a/chipper/js/grunt/reportMedia.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/reportMedia.ts	(date 1731341247560)
@@ -20,12 +20,12 @@
  */
 
 
-const ChipperConstants = require( '../common/ChipperConstants.js' );
-const getLicenseEntry = require( '../common/getLicenseEntry.js' );
-import * as grunt from 'grunt';
+import ChipperConstants from '../common/ChipperConstants.js';
+import getLicenseEntry from '../common/getLicenseEntry.js';
+import grunt from 'npm:grunt';
 import getPhetLibs from '../grunt/getPhetLibs.js';
 
-const path = require( 'path' );
+import path from 'node:path';
 
 export default async ( repo: string ): Promise<boolean> => {
 
Index: chipper/js/common/webpackGlobalLibraries.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/webpackGlobalLibraries.js b/chipper/js/common/webpackGlobalLibraries.js
--- a/chipper/js/common/webpackGlobalLibraries.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/webpackGlobalLibraries.js	(date 1731341972709)
@@ -17,4 +17,4 @@
   himalaya: 'sherpa/lib/himalaya-1.1.0.js'
 };
 
-module.exports = webpackGlobalLibraries;
\ No newline at end of file
+export default webpackGlobalLibraries;
\ No newline at end of file
Index: chipper/js/common/toLessEscapedString.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/toLessEscapedString.js b/chipper/js/common/toLessEscapedString.js
--- a/chipper/js/common/toLessEscapedString.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/common/toLessEscapedString.js	(date 1731341831301)
@@ -30,4 +30,4 @@
   return `'${result}'`;
 };
 
-module.exports = toLessEscapedString;
\ No newline at end of file
+export default toLessEscapedString;
\ No newline at end of file
Index: website-meteor/imports/api/context/context.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/imports/api/context/context.js b/website-meteor/imports/api/context/context.js
--- a/website-meteor/imports/api/context/context.js	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/imports/api/context/context.js	(date 1731340123381)
@@ -1,7 +1,7 @@
 // Copyright 2021, University of Colorado Boulder
 
 import child_process from 'child_process';
-import fs from 'fs';
+import fs from 'node:fs';
 import convert from 'xml-js';
 
 let tomcatContext;
Index: chipper/js/grunt/tasks/generate-development-strings.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/generate-development-strings.ts b/chipper/js/grunt/tasks/generate-development-strings.ts
--- a/chipper/js/grunt/tasks/generate-development-strings.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/generate-development-strings.ts	(date 1731342393967)
@@ -3,7 +3,7 @@
 import getRepo from '../../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
 import generateDevelopmentStrings from '../generateDevelopmentStrings.js';
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 
 /**
  * To support locales=* in unbuilt mode, generate a conglomerate JSON file for each repo with translations in babel. Run on all repos via:
Index: chipper/js/grunt/tasks/default.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/default.ts b/chipper/js/grunt/tasks/default.ts
--- a/chipper/js/grunt/tasks/default.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/default.ts	(date 1731339883156)
@@ -17,7 +17,8 @@
 
   if ( getOption( 'lint' ) !== false ) {
     console.log( '\nRunning "lint-all"' );
-    await ( await import( './lint-all.js' ) ).lintAll;
+    const myLint = await import( './lint-all.js' );
+    await myLint.lintAll;
   }
 
   if ( getOption( 'report-media' ) !== false ) {
Index: chipper/js/grunt/tasks/generate-phet-io-api.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/generate-phet-io-api.ts b/chipper/js/grunt/tasks/generate-phet-io-api.ts
--- a/chipper/js/grunt/tasks/generate-phet-io-api.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/generate-phet-io-api.ts	(date 1731340123329)
@@ -1,6 +1,6 @@
 // Copyright 2013-2024, University of Colorado Boulder
 
-import fs from 'fs';
+import fs from 'node:fs';
 import getOption from '../../../../perennial-alias/js/grunt/tasks/util/getOption.js';
 import getRepo from '../../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
 import getSimList from '../../common/getSimList.js';
Index: website-meteor/imports/api/strings/useStrings.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/website-meteor/imports/api/strings/useStrings.tsx b/website-meteor/imports/api/strings/useStrings.tsx
--- a/website-meteor/imports/api/strings/useStrings.tsx	(revision b7d11bbf7198df2824c61b6426520767293057dd)
+++ b/website-meteor/imports/api/strings/useStrings.tsx	(date 1731340110201)
@@ -1,6 +1,6 @@
 // Copyright 2023, University of Colorado Boulder
 
-import assert from 'assert';
+import assert from 'node:assert';
 import { useEffect, useState } from 'react';
 import { JSONStringsType } from '../../ui/commonTypes';
 import { useLocale } from '../../ui/root/localized/LocaleContext';
Index: chipper/js/grunt/tasks/modulify.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/modulify.ts b/chipper/js/grunt/tasks/modulify.ts
--- a/chipper/js/grunt/tasks/modulify.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/modulify.ts	(date 1731340123376)
@@ -1,5 +1,5 @@
 // Copyright 2013-2024, University of Colorado Boulder
-import * as fs from 'fs';
+import * as fs from 'node:fs';
 import getRepo from '../../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
 import generateDevelopmentStrings from '../generateDevelopmentStrings.js';
 
Index: chipper/js/grunt/tasks/clean.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/clean.ts b/chipper/js/grunt/tasks/clean.ts
--- a/chipper/js/grunt/tasks/clean.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/clean.ts	(date 1731340123291)
@@ -6,7 +6,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import fs from 'fs';
+import fs from 'node:fs';
 import getRepo from '../../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
 
 export const clean = ( async () => {
Index: chipper/js/grunt/tasks/generate-used-strings-file.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/generate-used-strings-file.ts b/chipper/js/grunt/tasks/generate-used-strings-file.ts
--- a/chipper/js/grunt/tasks/generate-used-strings-file.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/generate-used-strings-file.ts	(date 1731342393969)
@@ -7,7 +7,7 @@
 import getPhetLibs from '../getPhetLibs.js';
 import webpackBuild from '../webpackBuild.js';
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 const ChipperConstants = require( '../../common/ChipperConstants.js' );
 
 const getStringMap = require( '../getStringMap.js' );
Index: perennial-alias/js/common/getDataFile.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/common/getDataFile.js b/perennial-alias/js/common/getDataFile.js
--- a/perennial-alias/js/common/getDataFile.js	(revision 3a9a361ab3e623c6784d4a8f30346b769b7f9b9e)
+++ b/perennial-alias/js/common/getDataFile.js	(date 1731340340993)
@@ -5,7 +5,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 
 /**
  * @public
@@ -13,7 +13,7 @@
  * @param {string} listName - name of the perennial data file
  * @returns {string[]} - list of the items in the perennial list
  */
-module.exports = listName => {
+export default listName => {
 
   return fs.readFileSync( `../perennial/data/${listName}`, 'utf-8' ).trim().split( /\r?\n/ ).map( sim => sim.trim() );
 };
\ No newline at end of file
Index: chipper/js/grunt/modulify.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/modulify.ts b/chipper/js/grunt/modulify.ts
--- a/chipper/js/grunt/modulify.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/modulify.ts	(date 1731342475678)
@@ -7,20 +7,20 @@
  * @author Jonathan Olson (PhET Interactive Simulations)
  */
 
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.ts';
 import createMipmap from './createMipmap.js';
 import getCopyrightLine from './getCopyrightLine.js';
 
-const _ = require( 'lodash' );
-const fs = require( 'fs' );
-const path = require( 'path' );
-const grunt = require( 'grunt' );
+import _ from 'npm:lodash';
+import fs from 'node:fs';
+import path from 'node:path';
+import grunt from 'npm:grunt';
 const loadFileAsDataURI = require( '../common/loadFileAsDataURI.js' );
 const pascalCase = require( '../common/pascalCase.js' );
 const os = require( 'os' );
 const toLessEscapedString = require( '../common/toLessEscapedString.js' );
-const assert = require( 'assert' );
+import assert from 'node:assert';
 const writeFileAndGitAdd = require( '../../../perennial-alias/js/common/writeFileAndGitAdd.js' );
 const svgo = require( 'svgo' );
 
Index: chipper/js/grunt/getA11yViewHTMLFromTemplate.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getA11yViewHTMLFromTemplate.ts b/chipper/js/grunt/getA11yViewHTMLFromTemplate.ts
--- a/chipper/js/grunt/getA11yViewHTMLFromTemplate.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getA11yViewHTMLFromTemplate.ts	(date 1731342700692)
@@ -6,17 +6,17 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-const ChipperConstants = require( '../common/ChipperConstants.js' );
-const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
-import * as grunt from 'grunt';
+import ChipperConstants from '../common/ChipperConstants.js';
+import ChipperStringUtils from '../common/ChipperStringUtils.js';
+import grunt from 'npm:grunt';
 import fixEOL from '../../../perennial-alias/js/common/fixEOL.js';
 
-const getTitleStringKey = require( './getTitleStringKey.js' );
+import getTitleStringKey from './getTitleStringKey.js';
 
 /**
  * @returns - the html string, filled in from the template.
  */
-module.exports = function( repo: string ): string {
+export default function( repo: string ): string {
 
   let html = grunt.file.read( '../chipper/templates/sim-a11y-view.html' ); // the template file
 
Index: chipper/js/grunt/generateA11yViewHTML.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/generateA11yViewHTML.ts b/chipper/js/grunt/generateA11yViewHTML.ts
--- a/chipper/js/grunt/generateA11yViewHTML.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/generateA11yViewHTML.ts	(date 1731342242487)
@@ -15,7 +15,7 @@
 import ChipperConstants from '../common/ChipperConstants.js';
 import ChipperStringUtils from '../common/ChipperStringUtils.js';
 
-module.exports = async function( repo: string ) {
+export default async function( repo: string ) {
 
   let html = getA11yViewHTMLFromTemplate( repo );
   html = ChipperStringUtils.replaceFirst( html, '{{PHET_REPOSITORY}}', repo );
Index: chipper/js/grunt/buildStandalone.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/buildStandalone.ts b/chipper/js/grunt/buildStandalone.ts
--- a/chipper/js/grunt/buildStandalone.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/buildStandalone.ts	(date 1731342411481)
@@ -6,18 +6,18 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.ts';
 import getLocalesFromRepository from './getLocalesFromRepository.js';
 import getPhetLibs from './getPhetLibs.js';
 import webpackBuild from './webpackBuild.js';
 
-const assert = require( 'assert' );
-const fs = require( 'fs' );
-const minify = require( './minify.js' );
-const _ = require( 'lodash' );
-const getStringMap = require( './getStringMap.js' );
-const ChipperConstants = require( '../common/ChipperConstants.js' );
+import assert from 'node:assert';
+import fs from 'node:fs';
+import minify from './minify.js';
+import _ from 'npm:lodash';
+import getStringMap from './getStringMap.js';
+import ChipperConstants from '../common/ChipperConstants.js';
 
 /**
  * Builds standalone JS deliverables (e.g. dot/kite/scenery)
Index: chipper/js/grunt/createMipmap.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/createMipmap.ts b/chipper/js/grunt/createMipmap.ts
--- a/chipper/js/grunt/createMipmap.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/createMipmap.ts	(date 1731340123421)
@@ -1,6 +1,6 @@
 // Copyright 2017-2024, University of Colorado Boulder
 
-import * as fs from 'fs';
+import * as fs from 'node:fs';
 import * as grunt from 'grunt';
 import getOption from '../../../perennial-alias/js/grunt/tasks/util/getOption.js';
 
Index: chipper/js/grunt/getInitializationScript.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getInitializationScript.ts b/chipper/js/grunt/getInitializationScript.ts
--- a/chipper/js/grunt/getInitializationScript.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getInitializationScript.ts	(date 1731341731650)
@@ -10,13 +10,13 @@
  */
 
 // modules
-const assert = require( 'assert' );
-const ChipperConstants = require( '../common/ChipperConstants.js' );
-const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
-const fs = require( 'fs' );
-const grunt = require( 'grunt' );
-const transpileForBuild = require( './transpileForBuild.js' );
-const stringEncoding = require( '../common/stringEncoding.js' );
+import assert from 'node:assert';
+import ChipperConstants from '../common/ChipperConstants.js';
+import ChipperStringUtils from '../common/ChipperStringUtils.js';
+import fs from 'node:fs';
+import grunt from 'npm:grunt';
+import transpileForBuild from './transpileForBuild.js';
+import stringEncoding from '../common/stringEncoding.js';
 
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.ts';
 
Index: chipper/js/grunt/generateDevelopmentHTML.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/generateDevelopmentHTML.ts b/chipper/js/grunt/generateDevelopmentHTML.ts
--- a/chipper/js/grunt/generateDevelopmentHTML.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/generateDevelopmentHTML.ts	(date 1731342458150)
@@ -13,14 +13,14 @@
 import fixEOL from '../../../perennial-alias/js/common/fixEOL.js';
 import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
 import getPreloads from './getPreloads.js';
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
 const getStringRepos = require( './getStringRepos.js' );
 const writeFileAndGitAdd = require( '../../../perennial-alias/js/common/writeFileAndGitAdd.js' );
-const grunt = require( 'grunt' );
+import grunt from 'npm:grunt';
 
-module.exports = async function( repo: string, options: IntentionalAny ): Promise<void> {
+export default async function( repo: string, options: IntentionalAny ): Promise<void> {
 
   const {
     stylesheets = '',
Index: chipper/js/grunt/tasks/compare-phet-io-api.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/compare-phet-io-api.ts b/chipper/js/grunt/tasks/compare-phet-io-api.ts
--- a/chipper/js/grunt/tasks/compare-phet-io-api.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/compare-phet-io-api.ts	(date 1731342393939)
@@ -22,7 +22,7 @@
 import generatePhetioMacroAPI from '../../phet-io/generatePhetioMacroAPI.js';
 import getPhetLibs from '../getPhetLibs.js';
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 
 const repo = getRepo();
 const sims: string[] = getSimList().length === 0 ? [ repo ] : getSimList();
Index: chipper/js/grunt/tasks/lint-all.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/lint-all.ts b/chipper/js/grunt/tasks/lint-all.ts
--- a/chipper/js/grunt/tasks/lint-all.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/lint-all.ts	(date 1731340017411)
@@ -6,7 +6,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import * as grunt from 'grunt';
+import * as grunt from 'npm:grunt';
 import getLintCLIOptions from '../../../../perennial-alias/js/eslint/getLintCLIOptions.js';
 import lint from '../../../../perennial-alias/js/eslint/lint.js';
 import getBrands from '../../../../perennial-alias/js/grunt/tasks/util/getBrands.js';
Index: chipper/js/grunt/tasks/report-third-party.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/tasks/report-third-party.ts b/chipper/js/grunt/tasks/report-third-party.ts
--- a/chipper/js/grunt/tasks/report-third-party.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/tasks/report-third-party.ts	(date 1731340123303)
@@ -1,7 +1,7 @@
 // Copyright 2015-2024, University of Colorado Boulder
 
-import assert from 'assert';
-import fs, { readFileSync } from 'fs';
+import assert from 'node:assert';
+import fs, { readFileSync } from 'node:fs';
 import grunt from 'grunt';
 import https from 'https';
 import _ from 'lodash';
Index: chipper/js/grunt/buildRunnable.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/buildRunnable.ts b/chipper/js/grunt/buildRunnable.ts
--- a/chipper/js/grunt/buildRunnable.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/buildRunnable.ts	(date 1731342117948)
@@ -6,7 +6,7 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-import fs, { readFileSync } from 'fs';
+import fs, { readFileSync } from 'node:fs';
 import _ from 'lodash';
 import * as ChipperConstants from '../common/ChipperConstants.js';
 import generateThumbnails from './generateThumbnails.js';
@@ -20,27 +20,28 @@
 import reportUnusedStrings from './reportUnusedStrings.js';
 import webpackBuild from './webpackBuild.js';
 
-const assert = require( 'assert' );
-const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
-const getLicenseEntry = require( '../common/getLicenseEntry.js' );
-const copyDirectory = require( './copyDirectory.js' );
-const copySupplementalPhetioFiles = require( './copySupplementalPhetioFiles.js' );
-const getA11yViewHTMLFromTemplate = require( './getA11yViewHTMLFromTemplate.js' );
-const getAllThirdPartyEntries = require( './getAllThirdPartyEntries.js' );
-const getPrunedLocaleData = require( './getPrunedLocaleData.js' );
-const getStringMap = require( './getStringMap.js' );
-const getTitleStringKey = require( './getTitleStringKey.js' );
-const grunt = require( 'grunt' );
-const jimp = require( 'jimp' );
-const loadFileAsDataURI = require( '../common/loadFileAsDataURI.js' );
-const minify = require( './minify.js' );
-const nodeHtmlEncoder = require( 'node-html-encoder' );
-const packageRunnable = require( './packageRunnable.js' );
+import assert from 'node:assert';
+import ChipperStringUtils from '../common/ChipperStringUtils.js';
+import getLicenseEntry from '../common/getLicenseEntry.js';
+import copyDirectory from './copyDirectory.js';
+import copySupplementalPhetioFiles from './copySupplementalPhetioFiles.js';
+import getA11yViewHTMLFromTemplate from './getA11yViewHTMLFromTemplate.js';
+import getAllThirdPartyEntries from './getAllThirdPartyEntries.js';
+import getPrunedLocaleData from './getPrunedLocaleData.js';
+import getTitleStringKey from './getTitleStringKey.js';
+import grunt from 'npm:grunt';
+import jimp from 'npm:jimp';
+import loadFileAsDataURI from '../common/loadFileAsDataURI.js';
+import minify from './minify.js';
+import nodeHtmlEncoder from 'npm:node-html-encoder';
+import packageRunnable from './packageRunnable.js';
 
-const reportUnusedMedia = require( './reportUnusedMedia.js' );
+import reportUnusedMedia from './reportUnusedMedia.js';
 
-const zlib = require( 'zlib' );
-const phetTimingLog = require( '../../../perennial-alias/js/common/phetTimingLog.js' );
+import zlib from 'node:zlib';
+import phetTimingLog from '../../../perennial-alias/js/common/phetTimingLog.js';
+
+import getStringMap from './getStringMap.js';
 
 const recordTime = async <T>( name: string, asyncCallback: () => Promise<T>, timeCallback: ( time: number, result: T ) => void ): Promise<T> => {
   const beforeTime = Date.now();
Index: aqua/js/grunt/tasks/ct-node-client.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/aqua/js/grunt/tasks/ct-node-client.ts b/aqua/js/grunt/tasks/ct-node-client.ts
--- a/aqua/js/grunt/tasks/ct-node-client.ts	(revision fc02d14e66a740850b6a41af7b324b5600772501)
+++ b/aqua/js/grunt/tasks/ct-node-client.ts	(date 1731340109834)
@@ -10,7 +10,7 @@
  * @author Sam Reid (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import sleep from '../../../../perennial/js/common/sleep.js';
 import getOption from '../../../../perennial/js/grunt/tasks/util/getOption.js';
 import winston from '../../../../perennial/js/npm-dependencies/winston.js';
Index: chipper/js/grunt/getDependencies.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getDependencies.ts b/chipper/js/grunt/getDependencies.ts
--- a/chipper/js/grunt/getDependencies.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getDependencies.ts	(date 1731341662999)
@@ -7,12 +7,12 @@
  * @author Jonathan Olson <[email protected]>
  */
 
-const assert = require( 'assert' );
-const ChipperStringUtils = require( '../common/ChipperStringUtils.js' );
-const execute = require( '../../../perennial-alias/js/common/execute.js' );
-const grunt = require( 'grunt' );
+import assert from 'node:assert';
+import ChipperStringUtils from '../common/ChipperStringUtils.js';
+import execute from '../../../perennial-alias/js/common/execute.js';
+import grunt from 'npm:grunt';
 
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 import getPhetLibs from './getPhetLibs.js';
 
 // Our definition of an allowed simName is defined in the buildServer: https://github.com/phetsims/perennial/blob/78025b7ae6064e9ab5260cea5e532f3bf24c3ec8/js/build-server/taskWorker.js#L99-L98
Index: chipper/js/grunt/generateDevelopmentStrings.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/generateDevelopmentStrings.ts b/chipper/js/grunt/generateDevelopmentStrings.ts
--- a/chipper/js/grunt/generateDevelopmentStrings.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/generateDevelopmentStrings.ts	(date 1731342475674)
@@ -10,8 +10,8 @@
  */
 
 // imports
-const fs = require( 'fs' );
-const path = require( 'path' );
+import fs from 'node:fs';
+import path from 'node:path';
 
 /**
  * @param repo - repo to generate strings for
Index: chipper/js/phet-io/phetioCompareAPIsTests.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/phet-io/phetioCompareAPIsTests.js b/chipper/js/phet-io/phetioCompareAPIsTests.js
--- a/chipper/js/phet-io/phetioCompareAPIsTests.js	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/phet-io/phetioCompareAPIsTests.js	(date 1731342307982)
@@ -6,9 +6,9 @@
 
 
 const qunit = require( 'qunit' );
-const assert = require( 'assert' );
+import assert from 'node:assert';
 const phetioCompareAPIs = require( './phetioCompareAPIs.js' );
-const _ = require( 'lodash' );
+import _ from 'npm:lodash';
 
 qunit.module( 'phetioCompareAPIs' );
 
Index: chipper/js/grunt/getLocalesFromRepository.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/getLocalesFromRepository.ts b/chipper/js/grunt/getLocalesFromRepository.ts
--- a/chipper/js/grunt/getLocalesFromRepository.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/getLocalesFromRepository.ts	(date 1731341856705)
@@ -1,7 +1,7 @@
 // Copyright 2017-2024, University of Colorado Boulder
 
-const assert = require( 'assert' );
-const grunt = require( 'grunt' );
+import assert from 'node:assert';
+import grunt from 'npm:grunt';
 
 /**
  * Gets the locales from a repository, by inspecting the names of the string files in babel for that repository.
Index: aqua/js/grunt/tasks/continuous-server.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/aqua/js/grunt/tasks/continuous-server.ts b/aqua/js/grunt/tasks/continuous-server.ts
--- a/aqua/js/grunt/tasks/continuous-server.ts	(revision fc02d14e66a740850b6a41af7b324b5600772501)
+++ b/aqua/js/grunt/tasks/continuous-server.ts	(date 1731340109846)
@@ -10,7 +10,7 @@
  * @author Michael Kauzmann (PhET Interactive Simulations)
  */
 
-import assert from 'assert';
+import assert from 'node:assert';
 import getOption from '../../../../perennial/js/grunt/tasks/util/getOption.js';
 import _ from '../../../../perennial/js/npm-dependencies/lodash.js';
 import winston from '../../../../perennial/js/npm-dependencies/winston.js';
Index: chipper/js/grunt/updateCopyrightDate.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/updateCopyrightDate.ts b/chipper/js/grunt/updateCopyrightDate.ts
--- a/chipper/js/grunt/updateCopyrightDate.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/updateCopyrightDate.ts	(date 1731342393942)
@@ -9,7 +9,7 @@
 
 import getCopyrightLine from './getCopyrightLine.js';
 
-const fs = require( 'fs' );
+import fs from 'node:fs';
 
 /**
  * @param repo - The repository of the file to update (should be a git root)
Index: chipper/js/grunt/reportUnusedStrings.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/reportUnusedStrings.ts b/chipper/js/grunt/reportUnusedStrings.ts
--- a/chipper/js/grunt/reportUnusedStrings.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/reportUnusedStrings.ts	(date 1731341926320)
@@ -1,6 +1,6 @@
 // Copyright 2015-2024, University of Colorado Boulder
 
-import { readFileSync } from 'fs';
+import { readFileSync } from 'node:fs';
 
 /**
  * Report which translatable strings from a sim were not used in the simulation with a require statement.
@@ -14,7 +14,7 @@
  * @author Jesse Greenberg (PhET Interactive Simulations)
  */
 
-const grunt = require( 'grunt' );
+import grunt from 'npm:grunt';
 
 /**
  * @param repo
Index: chipper/js/grunt/fixEOL.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/fixEOL.ts b/chipper/js/grunt/fixEOL.ts
--- a/chipper/js/grunt/fixEOL.ts	(revision 4f78db0fa6669a81b7baa656cd2ea6e284822c14)
+++ b/chipper/js/grunt/fixEOL.ts	(date 1731341388356)
@@ -8,6 +8,6 @@
  */
 
 // modules
-const os = require( 'os' );
+import os from 'node:os';
 
 export default ( string: string ): string => string.split( '\r' ).join( '' ).split( '\n' ).join( os.EOL );
\ No newline at end of file

@zepumph
Copy link
Member Author

zepumph commented Nov 15, 2024

Today we were happy to see that node:fs imports work in tsx. This can help us bridge to deno potentially.

Also, we are in control of sage run, and so could start using that to run deno secretly for certain tasks.

TOE DIPS

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

No branches or pull requests

2 participants