-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use js/npm-dependencies to share npm modules across repos #372
Comments
This won't work until we have better entry point coverage. Here is a patch: Subject: [PATCH] Rename import-shared => npm-dependencies, see https://github.com/phetsims/perennial/issues/372
---
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 d71149fdc1a1dce159a383e90ca9464fbae3e854)
+++ b/aqua/js/grunt/tasks/ct-node-client.ts (date 1729024366708)
@@ -13,7 +13,7 @@
import assert from 'assert';
import getOption from '../../../../perennial/js/grunt/tasks/util/getOption';
import winston from '../../../../perennial/js/npm-dependencies/winston';
-import playwright from '../../../../perennial/node_modules/playwright';
+import playwright from '../../../../perennial/js/npm-dependencies/playwright';
import runNextTest from '../../node-client/runNextTest';
winston.default.transports.console.level = 'info';
Index: aqua/js/node-client/runTest.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/aqua/js/node-client/runTest.js b/aqua/js/node-client/runTest.js
--- a/aqua/js/node-client/runTest.js (revision d71149fdc1a1dce159a383e90ca9464fbae3e854)
+++ b/aqua/js/node-client/runTest.js (date 1729026420232)
@@ -8,7 +8,8 @@
const _ = require( 'lodash' );
const sendTestResult = require( './sendTestResult' );
-const puppeteer = require( '../../../perennial/node_modules/puppeteer' );
+// eslint-disable-next-line phet/no-property-in-require-statement
+const puppeteer = require( '../../../perennial/js/npm-dependencies/puppeteer' ).default;
const browserPageLoad = require( '../../../perennial/js/common/browserPageLoad' );
const winston = require( 'winston' );
const path = require( 'path' );
Index: perennial/js/npm-dependencies/playwright.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial/js/npm-dependencies/playwright.js b/perennial/js/npm-dependencies/playwright.js
new file mode 100644
--- /dev/null (date 1729024370310)
+++ b/perennial/js/npm-dependencies/playwright.js (date 1729024370310)
@@ -0,0 +1,11 @@
+// Copyright 2024, University of Colorado Boulder
+
+/**
+ * To be used when trying to import playwright from other repos.
+ *
+ * @author Michael Kauzmann (PhET Interactive Simulations)
+ */
+
+import playwright from 'playwright';
+
+export default playwright;
\ No newline at end of file
Index: phet-info/project-management/reportEpicIssuesNotInSpreadsheet.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/phet-info/project-management/reportEpicIssuesNotInSpreadsheet.js b/phet-info/project-management/reportEpicIssuesNotInSpreadsheet.js
--- a/phet-info/project-management/reportEpicIssuesNotInSpreadsheet.js (revision 9cfcb3e641fc5bf02cc89054365259cf74c1b29f)
+++ b/phet-info/project-management/reportEpicIssuesNotInSpreadsheet.js (date 1729026163032)
@@ -20,7 +20,8 @@
* @author Michael Kauzmann (PhET Interactive Simulations)
*/
-const _ = require( '../../perennial/node_modules/lodash' );
+// eslint-disable-next-line phet/no-property-in-require-statement
+const _ = require( '../../perennial/js/npm-dependencies/lodash' ).default;
const buildLocal = require( '../../perennial/js/common/buildLocal' );
const https = require( 'https' );
Index: aqua/js/server/playwrightCTClient.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/aqua/js/server/playwrightCTClient.js b/aqua/js/server/playwrightCTClient.js
--- a/aqua/js/server/playwrightCTClient.js (revision d71149fdc1a1dce159a383e90ca9464fbae3e854)
+++ b/aqua/js/server/playwrightCTClient.js (date 1729026109777)
@@ -9,7 +9,8 @@
const assert = require( 'assert' );
const playwrightLoad = require( '../../../perennial/js/common/playwrightLoad' );
const { parentPort } = require( 'worker_threads' ); // eslint-disable-line phet/require-statement-match
-const playwright = require( '../../../perennial/node_modules/playwright' );
+// eslint-disable-next-line phet/no-property-in-require-statement
+const playwright = require( '../../../perennial/js/npm-dependencies/playwright' ).default;
process.on( 'SIGINT', () => process.exit() );
Index: perennial/js/npm-dependencies/axios.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial/js/npm-dependencies/axios.js b/perennial/js/npm-dependencies/axios.js
new file mode 100644
--- /dev/null (date 1729024467523)
+++ b/perennial/js/npm-dependencies/axios.js (date 1729024467523)
@@ -0,0 +1,11 @@
+// Copyright 2024, University of Colorado Boulder
+
+/**
+ * To be used when trying to import axios from other repos.
+ *
+ * @author Michael Kauzmann (PhET Interactive Simulations)
+ */
+
+import axios from 'axios';
+
+export default axios;
\ No newline at end of file
Index: perennial/js/npm-dependencies/puppeteer.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial/js/npm-dependencies/puppeteer.js b/perennial/js/npm-dependencies/puppeteer.js
new file mode 100644
--- /dev/null (date 1729024427352)
+++ b/perennial/js/npm-dependencies/puppeteer.js (date 1729024427352)
@@ -0,0 +1,11 @@
+// Copyright 2024, University of Colorado Boulder
+
+/**
+ * To be used when trying to import puppeteer from other repos.
+ *
+ * @author Michael Kauzmann (PhET Interactive Simulations)
+ */
+
+import puppeteer from 'puppeteer';
+
+export default puppeteer;
\ No newline at end of file
Index: phet-io/js/scripts/print-public-sim-versions.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/phet-io/js/scripts/print-public-sim-versions.js b/phet-io/js/scripts/print-public-sim-versions.js
--- a/phet-io/js/scripts/print-public-sim-versions.js (revision 2d13454302d40e6a9b5258d1c07f34e85a9a0f79)
+++ b/phet-io/js/scripts/print-public-sim-versions.js (date 1729024636251)
@@ -20,7 +20,8 @@
const ReleaseBranch = require( '../../../perennial/js/common/ReleaseBranch' );
const gitCheckoutDirectory = require( '../../../perennial/js/common/gitCheckoutDirectory' );
const loadJSON = require( '../../../perennial/js/common/loadJSON' );
-const _ = require( '../../../perennial/node_modules/lodash' );
+// eslint-disable-next-line phet/no-property-in-require-statement
+const _ = require( '../../../perennial/js/npm-dependencies/lodash' ).default;
( async () => {
Index: phet-info/github-labels/update-repos-list.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/phet-info/github-labels/update-repos-list.js b/phet-info/github-labels/update-repos-list.js
--- a/phet-info/github-labels/update-repos-list.js (revision 9cfcb3e641fc5bf02cc89054365259cf74c1b29f)
+++ b/phet-info/github-labels/update-repos-list.js (date 1729026134453)
@@ -6,7 +6,8 @@
// a newline separated list of all repos in the phetsims organization.
// @author Matt Pennington (PhET Interactive Simulations)
-const axios = require( '../../perennial/node_modules/axios' );
+// eslint-disable-next-line phet/no-property-in-require-statement
+const axios = require( '../../perennial/js/npm-dependencies/axios' ).default;
const buildLocal = require( '../../perennial/js/common/buildLocal' );
const fs = require( 'fs' );
We get this kind of problem:
|
Seems very reasonable. On hold until we are done with phetsims/chipper#1481. |
I'm working on this for puppeteer right now. |
This should not be a lint error:
Updating the rule now. |
After removing axios and puppeteer, most remaining chipper dependencies are appropriate - single usage and not declared in other repos elsewhere. One exception is "lodash" but removing lodash from package.json then running rm -rf node_modules and npm i node_modules brings back lodash anyways, perhaps a different npm dependency brings it along? |
I'm struggling with lodash: Subject: [PATCH] Use perennial-alias puppeteer, see https://github.com/phetsims/perennial/issues/372
---
Index: js/grunt/generateTestHTML.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/generateTestHTML.ts b/js/grunt/generateTestHTML.ts
--- a/js/grunt/generateTestHTML.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/generateTestHTML.ts (date 1730946693368)
@@ -6,7 +6,7 @@
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
const generateDevelopmentHTML = require( './generateDevelopmentHTML.js' );
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
Index: js/phet-io/phetioCompareAPISets.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/phet-io/phetioCompareAPISets.js b/js/phet-io/phetioCompareAPISets.js
--- a/js/phet-io/phetioCompareAPISets.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/phet-io/phetioCompareAPISets.js (date 1730946837427)
@@ -6,7 +6,7 @@
const fs = require( 'fs' );
const phetioCompareAPIs = require( './phetioCompareAPIs.js' );
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const jsondiffpatch = require( '../../../sherpa/lib/jsondiffpatch-v0.3.11.umd' ).create( {} );
const assert = require( 'assert' );
Index: js/grunt/tasks/update.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/tasks/update.ts b/js/grunt/tasks/update.ts
--- a/js/grunt/tasks/update.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/tasks/update.ts (date 1730946837424)
@@ -16,6 +16,7 @@
import * as grunt from 'grunt';
import getRepo from '../../../../perennial-alias/js/grunt/tasks/util/getRepo';
import generateREADME from '../generateREADME';
+import _ from '../../../../perennial-alias/js/npm-dependencies/lodash.js';
const generateDevelopmentHTML = require( '../generateDevelopmentHTML.js' );
const generateA11yViewHTML = require( '../generateA11yViewHTML.js' );
@@ -27,8 +28,6 @@
const packageObject = grunt.file.readJSON( `../${repo}/package.json` );
-const _ = require( 'lodash' );
-
// support repos that don't have a phet object
if ( !packageObject.phet ) {
Index: js/grunt/getThirdPartyLibEntries.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/getThirdPartyLibEntries.ts b/js/grunt/getThirdPartyLibEntries.ts
--- a/js/grunt/getThirdPartyLibEntries.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/getThirdPartyLibEntries.ts (date 1730946693385)
@@ -13,7 +13,7 @@
import getLicenseKeys from './getLicenseKeys';
// modules
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const assert = require( 'assert' );
const grunt = require( 'grunt' );
Index: js/grunt/copyDirectory.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/copyDirectory.js b/js/grunt/copyDirectory.js
--- a/js/grunt/copyDirectory.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/copyDirectory.js (date 1730946693377)
@@ -7,7 +7,7 @@
* @author Sam Reid (PhET Interactive Simulations)
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const assert = require( 'assert' );
const grunt = require( 'grunt' );
const minify = require( './minify.js' );
Index: js/grunt/webpackBuild.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/webpackBuild.ts b/js/grunt/webpackBuild.ts
--- a/js/grunt/webpackBuild.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/webpackBuild.ts (date 1730946837417)
@@ -7,7 +7,7 @@
*/
import * as fs from 'fs';
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import * as path from 'path';
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
import * as ChipperConstants from '../common/ChipperConstants.js';
Index: js/common/Transpiler.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/Transpiler.js b/js/common/Transpiler.js
--- a/js/common/Transpiler.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/common/Transpiler.js (date 1730946693434)
@@ -22,7 +22,7 @@
const webpackGlobalLibraries = require( './webpackGlobalLibraries.js' );
const core = require( '@babel/core' );
const assert = require( 'assert' );
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
// Cache status is stored in chipper/dist so if you wipe chipper/dist you also wipe the cache
const statusPath = '../chipper/dist/js-cache-status.json';
Index: js/grunt/profileFileSize.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/profileFileSize.ts b/js/grunt/profileFileSize.ts
--- a/js/grunt/profileFileSize.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/profileFileSize.ts (date 1730946693373)
@@ -14,7 +14,7 @@
const fs = require( 'fs' );
const zlib = require( 'zlib' );
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
export default async function( repo: string ): Promise<void> {
const file = fs.readFileSync( `../${repo}/build/phet/${repo}_all_phet.html`, 'utf-8' );
Index: js/common/stringEncoding.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/stringEncoding.js b/js/common/stringEncoding.js
--- a/js/common/stringEncoding.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/common/stringEncoding.js (date 1730946693418)
@@ -30,7 +30,7 @@
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const toLessEscapedString = require( './toLessEscapedString.js' );
const PUSH_TOKEN = '\u0001'; // push string on the stack
Index: js/grunt/getLicenseKeys.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/getLicenseKeys.ts b/js/grunt/getLicenseKeys.ts
--- a/js/grunt/getLicenseKeys.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/getLicenseKeys.ts (date 1730946693414)
@@ -9,7 +9,7 @@
import getPreloads from './getPreloads.js';
-const _ = require( 'lodash' );
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
const webpackGlobalLibraries = require( '../common/webpackGlobalLibraries.js' );
const grunt = require( 'grunt' );
Index: js/grunt/copySupplementalPhetioFiles.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/copySupplementalPhetioFiles.ts b/js/grunt/copySupplementalPhetioFiles.ts
--- a/js/grunt/copySupplementalPhetioFiles.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/copySupplementalPhetioFiles.ts (date 1730946693364)
@@ -9,7 +9,7 @@
*/
import * as fs from 'fs';
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
import webpackBuild from './webpackBuild.ts';
import buildStandalone from './buildStandalone.ts';
Index: js/grunt/minify.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/minify.js b/js/grunt/minify.js
--- a/js/grunt/minify.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/minify.js (date 1730946693429)
@@ -8,7 +8,7 @@
// modules
-const _ = require( 'lodash' );
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
const transpileForBuild = require( './transpileForBuild.js' );
const terser = require( 'terser' );
Index: js/test-browser-lint.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/test-browser-lint.ts b/js/test-browser-lint.ts
--- a/js/test-browser-lint.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/test-browser-lint.ts (date 1730946530002)
@@ -19,6 +19,6 @@
console.log( process );
// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-require-imports,no-undef
- const lodash = require( 'lodash' );
+ const lodash = require( '../../perennial-alias/js/npm-dependencies/lodash.js' );
console.log( lodash );
} )();
\ No newline at end of file
Index: js/grunt/getPreloads.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/getPreloads.ts b/js/grunt/getPreloads.ts
--- a/js/grunt/getPreloads.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/getPreloads.ts (date 1730946693388)
@@ -1,6 +1,6 @@
// Copyright 2017-2024, University of Colorado Boulder
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import assert from 'assert';
import * as grunt from 'grunt';
import ChipperStringUtils from '../common/ChipperStringUtils';
Index: js/grunt/gruntMain.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/gruntMain.js b/js/grunt/gruntMain.js
--- a/js/grunt/gruntMain.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/gruntMain.js (date 1730946693393)
@@ -15,7 +15,7 @@
require( './checkNodeVersion' );
const registerTasks = require( '../../../perennial-alias/js/grunt/util/registerTasks.js' );
const gruntSpawn = require( '../../../perennial-alias/js/grunt/util/gruntSpawn.js' );
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
// Allow other Gruntfiles to potentially handle exiting and errors differently
if ( !global.processEventOptOut ) {
Index: js/grunt/getPrunedLocaleData.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/getPrunedLocaleData.js b/js/grunt/getPrunedLocaleData.js
--- a/js/grunt/getPrunedLocaleData.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/getPrunedLocaleData.js (date 1730946693410)
@@ -6,7 +6,7 @@
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const ChipperConstants = require( '../common/ChipperConstants.js' );
const fs = require( 'fs' );
Index: js/scripts/transpile-swc.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/scripts/transpile-swc.ts b/js/scripts/transpile-swc.ts
--- a/js/scripts/transpile-swc.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/scripts/transpile-swc.ts (date 1730946837404)
@@ -12,7 +12,7 @@
*/
import { spawn } from 'child_process';
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import path from 'path';
import getActiveRepos from '../../../perennial-alias/js/common/getActiveRepos';
Index: package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/package.json b/package.json
--- a/package.json (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/package.json (date 1730946399458)
@@ -33,7 +33,6 @@
"jimp": "~0.16.1",
"jpeg-js": "~0.4.3",
"jsdoc": "~3.6.7",
- "lodash": "~4.17.21",
"marked": "~4.0.1",
"modify-source-webpack-plugin": "~4.1.0",
"node-html-encoder": "~0.0.2",
Index: js/common/ChipperStringUtils.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/ChipperStringUtils.js b/js/common/ChipperStringUtils.js
--- a/js/common/ChipperStringUtils.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/common/ChipperStringUtils.js (date 1730946529997)
@@ -8,7 +8,7 @@
*/
const assert = require( 'assert' );
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
// What divides the repo prefix from the rest of the string key, like `FRICTION/friction.title`
const NAMESPACE_PREFIX_DIVIDER = '/';
Index: js/grunt/transpile.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/transpile.ts b/js/grunt/transpile.ts
--- a/js/grunt/transpile.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/transpile.ts (date 1730946837421)
@@ -1,7 +1,7 @@
// Copyright 2024, University of Colorado Boulder
import assert from 'assert';
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import { Repo } from '../../../perennial-alias/js/common/PerennialTypes.js';
import getOption from '../../../perennial-alias/js/grunt/tasks/util/getOption.js';
import getRepo, { getRepos } from '../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
Index: js/grunt/modulify.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/modulify.ts b/js/grunt/modulify.ts
--- a/js/grunt/modulify.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/modulify.ts (date 1730946837410)
@@ -11,7 +11,8 @@
import getCopyrightLine from './getCopyrightLine';
import createMipmap from './createMipmap.js';
-const _ = require( 'lodash' );
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
+
const fs = require( 'fs' );
const path = require( 'path' );
const grunt = require( 'grunt' );
@@ -338,6 +339,7 @@
return Object.keys( spec[ regionAndCulture ] );
} ) ).sort();
+ // @ts-expect-error
const imageFiles: string[] = _.uniq( providedRegionsAndCultures.flatMap( regionAndCulture => {
return Object.values( spec[ regionAndCulture ] );
} ) ).sort();
Index: js/grunt/buildStandalone.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/buildStandalone.ts b/js/grunt/buildStandalone.ts
--- a/js/grunt/buildStandalone.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/buildStandalone.ts (date 1730946693422)
@@ -10,12 +10,12 @@
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.ts';
import getLocalesFromRepository from './getLocalesFromRepository';
import getPhetLibs from './getPhetLibs.js';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
const assert = require( 'assert' );
const fs = require( 'fs' );
const grunt = require( 'grunt' );
const minify = require( './minify.js' );
-const _ = require( 'lodash' );
const getStringMap = require( './getStringMap.js' );
const ChipperConstants = require( '../common/ChipperConstants.js' );
Index: js/grunt/generateDevelopmentHTML.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/generateDevelopmentHTML.ts b/js/grunt/generateDevelopmentHTML.ts
--- a/js/grunt/generateDevelopmentHTML.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/generateDevelopmentHTML.ts (date 1730946693439)
@@ -9,7 +9,7 @@
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
import fixEOL from '../../../perennial-alias/js/common/fixEOL.js';
import getPreloads from './getPreloads';
Index: js/common/showCommandLineProgress.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/showCommandLineProgress.js b/js/common/showCommandLineProgress.js
--- a/js/common/showCommandLineProgress.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/common/showCommandLineProgress.js (date 1730946693339)
@@ -6,7 +6,7 @@
* @author Michael Kauzmann (PhET Interactive Simulations)
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
/**
* See https://jagascript.com/how-to-build-a-textual-progress-bar-for-cli-and-terminal-apps/
Index: js/common/pascalCase.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/pascalCase.js b/js/common/pascalCase.js
--- a/js/common/pascalCase.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/common/pascalCase.js (date 1730946693426)
@@ -1,6 +1,6 @@
// Copyright 2022-2024, University of Colorado Boulder
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
/**
* Convert a string to PascalCase
Index: js/grunt/reportThirdParty.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/reportThirdParty.js b/js/grunt/reportThirdParty.js
--- a/js/grunt/reportThirdParty.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/reportThirdParty.js (date 1730946693382)
@@ -19,7 +19,7 @@
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const assert = require( 'assert' );
const ChipperConstants = require( '../common/ChipperConstants.js' );
const fs = require( 'fs' );
Index: js/grunt/buildRunnable.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/buildRunnable.ts b/js/grunt/buildRunnable.ts
--- a/js/grunt/buildRunnable.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/buildRunnable.ts (date 1730946693399)
@@ -7,7 +7,7 @@
*/
import fs from 'fs';
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import * as ChipperConstants from '../common/ChipperConstants';
import generateThumbnails from './generateThumbnails';
import generateTwitterCard from './generateTwitterCard';
Index: js/grunt/updateCopyrightDates.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/updateCopyrightDates.ts b/js/grunt/updateCopyrightDates.ts
--- a/js/grunt/updateCopyrightDates.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/updateCopyrightDates.ts (date 1730946837430)
@@ -8,7 +8,7 @@
*/
import * as grunt from 'grunt';
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import updateCopyrightDate from './updateCopyrightDate';
const unsupportedExtensions = [ '.json', 'md' ];
Index: js/grunt/sortImports.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/sortImports.js b/js/grunt/sortImports.js
--- a/js/grunt/sortImports.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/sortImports.js (date 1730946718390)
@@ -13,7 +13,7 @@
// 3rd-party packages
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const fs = require( 'fs' );
// constants
Index: js/grunt/getPhetLibs.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/getPhetLibs.ts b/js/grunt/getPhetLibs.ts
--- a/js/grunt/getPhetLibs.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/getPhetLibs.ts (date 1730946693404)
@@ -9,7 +9,7 @@
const ChipperConstants = require( '../common/ChipperConstants.js' );
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import assert from 'assert';
import * as grunt from 'grunt';
Index: js/phet-io/phetioCompareAPIsTests.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/phet-io/phetioCompareAPIsTests.js b/js/phet-io/phetioCompareAPIsTests.js
--- a/js/phet-io/phetioCompareAPIsTests.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/phet-io/phetioCompareAPIsTests.js (date 1730946837437)
@@ -8,7 +8,7 @@
const qunit = require( 'qunit' );
const assert = require( 'assert' );
const _phetioCompareAPIs = require( './phetioCompareAPIs' ); // eslint-disable-line phet/require-statement-match
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
qunit.module( 'phetioCompareAPIs' );
Index: js/grunt/getStringMap.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/getStringMap.js b/js/grunt/getStringMap.js
--- a/js/grunt/getStringMap.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/getStringMap.js (date 1730946693354)
@@ -8,7 +8,7 @@
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const assert = require( 'assert' );
const ChipperConstants = require( '../common/ChipperConstants.js' );
const pascalCase = require( '../common/pascalCase.js' );
Index: js/grunt/test-node-lint.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/test-node-lint.ts b/js/grunt/test-node-lint.ts
--- a/js/grunt/test-node-lint.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/js/grunt/test-node-lint.ts (date 1730946837413)
@@ -18,6 +18,6 @@
console.log( process );
- const lodash = require( 'lodash' );
- console.log( lodash );
+ const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
+ console.log( _ );
} )();
\ No newline at end of file
And I'm not convinced the call site is better, especially since there are so many.
|
It works better if I change lodash.js from import to require (oops one tsc error sneaked in): Subject: [PATCH] Use perennial-alias puppeteer, see https://github.com/phetsims/perennial/issues/372
---
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/generateTestHTML.ts (date 1730946693368)
@@ -6,7 +6,7 @@
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
const generateDevelopmentHTML = require( './generateDevelopmentHTML.js' );
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/phet-io/phetioCompareAPISets.js (date 1730946837427)
@@ -6,7 +6,7 @@
const fs = require( 'fs' );
const phetioCompareAPIs = require( './phetioCompareAPIs.js' );
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const jsondiffpatch = require( '../../../sherpa/lib/jsondiffpatch-v0.3.11.umd' ).create( {} );
const assert = require( 'assert' );
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/tasks/update.ts (date 1730947235223)
@@ -17,6 +17,8 @@
import getRepo from '../../../../perennial-alias/js/grunt/tasks/util/getRepo';
import generateREADME from '../generateREADME';
+const _ = require( '../../../../perennial-alias/js/npm-dependencies/lodash.js' );
+
const generateDevelopmentHTML = require( '../generateDevelopmentHTML.js' );
const generateA11yViewHTML = require( '../generateA11yViewHTML.js' );
const generateTestHTML = require( '../generateTestHTML.js' );
@@ -27,8 +29,6 @@
const packageObject = grunt.file.readJSON( `../${repo}/package.json` );
-const _ = require( 'lodash' );
-
// support repos that don't have a phet object
if ( !packageObject.phet ) {
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/getThirdPartyLibEntries.ts (date 1730946693385)
@@ -13,7 +13,7 @@
import getLicenseKeys from './getLicenseKeys';
// modules
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const assert = require( 'assert' );
const grunt = require( 'grunt' );
Index: chipper/js/grunt/copyDirectory.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/copyDirectory.js b/chipper/js/grunt/copyDirectory.js
--- a/chipper/js/grunt/copyDirectory.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/copyDirectory.js (date 1730946693377)
@@ -7,7 +7,7 @@
* @author Sam Reid (PhET Interactive Simulations)
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const assert = require( 'assert' );
const grunt = require( 'grunt' );
const minify = require( './minify.js' );
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/webpackBuild.ts (date 1730946837417)
@@ -7,7 +7,7 @@
*/
import * as fs from 'fs';
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import * as path from 'path';
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
import * as ChipperConstants from '../common/ChipperConstants.js';
Index: chipper/js/common/Transpiler.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/common/Transpiler.js b/chipper/js/common/Transpiler.js
--- a/chipper/js/common/Transpiler.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/common/Transpiler.js (date 1730946693434)
@@ -22,7 +22,7 @@
const webpackGlobalLibraries = require( './webpackGlobalLibraries.js' );
const core = require( '@babel/core' );
const assert = require( 'assert' );
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
// Cache status is stored in chipper/dist so if you wipe chipper/dist you also wipe the cache
const statusPath = '../chipper/dist/js-cache-status.json';
Index: chipper/js/grunt/profileFileSize.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/profileFileSize.ts b/chipper/js/grunt/profileFileSize.ts
--- a/chipper/js/grunt/profileFileSize.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/profileFileSize.ts (date 1730946693373)
@@ -14,7 +14,7 @@
const fs = require( 'fs' );
const zlib = require( 'zlib' );
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
export default async function( repo: string ): Promise<void> {
const file = fs.readFileSync( `../${repo}/build/phet/${repo}_all_phet.html`, 'utf-8' );
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/common/stringEncoding.js (date 1730946693418)
@@ -30,7 +30,7 @@
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const toLessEscapedString = require( './toLessEscapedString.js' );
const PUSH_TOKEN = '\u0001'; // push string on the stack
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/getLicenseKeys.ts (date 1730947330685)
@@ -9,7 +9,7 @@
import getPreloads from './getPreloads.js';
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const webpackGlobalLibraries = require( '../common/webpackGlobalLibraries.js' );
const grunt = require( 'grunt' );
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/copySupplementalPhetioFiles.ts (date 1730946693364)
@@ -9,7 +9,7 @@
*/
import * as fs from 'fs';
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
import webpackBuild from './webpackBuild.ts';
import buildStandalone from './buildStandalone.ts';
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/minify.js (date 1730947235244)
@@ -8,7 +8,7 @@
// modules
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const transpileForBuild = require( './transpileForBuild.js' );
const terser = require( 'terser' );
Index: chipper/js/test-browser-lint.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/test-browser-lint.ts b/chipper/js/test-browser-lint.ts
--- a/chipper/js/test-browser-lint.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/test-browser-lint.ts (date 1730946530002)
@@ -19,6 +19,6 @@
console.log( process );
// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-require-imports,no-undef
- const lodash = require( 'lodash' );
+ const lodash = require( '../../perennial-alias/js/npm-dependencies/lodash.js' );
console.log( lodash );
} )();
\ No newline at end of file
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/getPreloads.ts (date 1730946693388)
@@ -1,6 +1,6 @@
// Copyright 2017-2024, University of Colorado Boulder
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import assert from 'assert';
import * as grunt from 'grunt';
import ChipperStringUtils from '../common/ChipperStringUtils';
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/gruntMain.js (date 1730946693393)
@@ -15,7 +15,7 @@
require( './checkNodeVersion' );
const registerTasks = require( '../../../perennial-alias/js/grunt/util/registerTasks.js' );
const gruntSpawn = require( '../../../perennial-alias/js/grunt/util/gruntSpawn.js' );
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
// Allow other Gruntfiles to potentially handle exiting and errors differently
if ( !global.processEventOptOut ) {
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/getPrunedLocaleData.js (date 1730946693410)
@@ -6,7 +6,7 @@
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const ChipperConstants = require( '../common/ChipperConstants.js' );
const fs = require( 'fs' );
Index: chipper/js/scripts/transpile-swc.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/scripts/transpile-swc.ts b/chipper/js/scripts/transpile-swc.ts
--- a/chipper/js/scripts/transpile-swc.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/scripts/transpile-swc.ts (date 1730946837404)
@@ -12,7 +12,7 @@
*/
import { spawn } from 'child_process';
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import path from 'path';
import getActiveRepos from '../../../perennial-alias/js/common/getActiveRepos';
Index: chipper/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/package.json b/chipper/package.json
--- a/chipper/package.json (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/package.json (date 1730946399458)
@@ -33,7 +33,6 @@
"jimp": "~0.16.1",
"jpeg-js": "~0.4.3",
"jsdoc": "~3.6.7",
- "lodash": "~4.17.21",
"marked": "~4.0.1",
"modify-source-webpack-plugin": "~4.1.0",
"node-html-encoder": "~0.0.2",
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/common/ChipperStringUtils.js (date 1730946529997)
@@ -8,7 +8,7 @@
*/
const assert = require( 'assert' );
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
// What divides the repo prefix from the rest of the string key, like `FRICTION/friction.title`
const NAMESPACE_PREFIX_DIVIDER = '/';
Index: chipper/js/grunt/transpile.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/transpile.ts b/chipper/js/grunt/transpile.ts
--- a/chipper/js/grunt/transpile.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/transpile.ts (date 1730946837421)
@@ -1,7 +1,7 @@
// Copyright 2024, University of Colorado Boulder
import assert from 'assert';
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import { Repo } from '../../../perennial-alias/js/common/PerennialTypes.js';
import getOption from '../../../perennial-alias/js/grunt/tasks/util/getOption.js';
import getRepo, { getRepos } from '../../../perennial-alias/js/grunt/tasks/util/getRepo.js';
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/modulify.ts (date 1730947235212)
@@ -11,7 +11,8 @@
import getCopyrightLine from './getCopyrightLine';
import createMipmap from './createMipmap.js';
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
+
const fs = require( 'fs' );
const path = require( 'path' );
const grunt = require( 'grunt' );
@@ -338,6 +339,7 @@
return Object.keys( spec[ regionAndCulture ] );
} ) ).sort();
+ // @ts-expect-error
const imageFiles: string[] = _.uniq( providedRegionsAndCultures.flatMap( regionAndCulture => {
return Object.values( spec[ regionAndCulture ] );
} ) ).sort();
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/buildStandalone.ts (date 1730947235237)
@@ -11,11 +11,12 @@
import getLocalesFromRepository from './getLocalesFromRepository';
import getPhetLibs from './getPhetLibs.js';
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
+
const assert = require( 'assert' );
const fs = require( 'fs' );
const grunt = require( 'grunt' );
const minify = require( './minify.js' );
-const _ = require( 'lodash' );
const getStringMap = require( './getStringMap.js' );
const ChipperConstants = require( '../common/ChipperConstants.js' );
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/generateDevelopmentHTML.ts (date 1730946693439)
@@ -9,7 +9,7 @@
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/
-import * as _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import IntentionalAny from '../../../phet-core/js/types/IntentionalAny.js';
import fixEOL from '../../../perennial-alias/js/common/fixEOL.js';
import getPreloads from './getPreloads';
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/common/showCommandLineProgress.js (date 1730946693339)
@@ -6,7 +6,7 @@
* @author Michael Kauzmann (PhET Interactive Simulations)
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
/**
* See https://jagascript.com/how-to-build-a-textual-progress-bar-for-cli-and-terminal-apps/
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/common/pascalCase.js (date 1730946693426)
@@ -1,6 +1,6 @@
// Copyright 2022-2024, University of Colorado Boulder
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
/**
* Convert a string to PascalCase
Index: chipper/js/grunt/reportThirdParty.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/reportThirdParty.js b/chipper/js/grunt/reportThirdParty.js
--- a/chipper/js/grunt/reportThirdParty.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/reportThirdParty.js (date 1730946693382)
@@ -19,7 +19,7 @@
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const assert = require( 'assert' );
const ChipperConstants = require( '../common/ChipperConstants.js' );
const fs = require( 'fs' );
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/buildRunnable.ts (date 1730946693399)
@@ -7,7 +7,7 @@
*/
import fs from 'fs';
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import * as ChipperConstants from '../common/ChipperConstants';
import generateThumbnails from './generateThumbnails';
import generateTwitterCard from './generateTwitterCard';
Index: chipper/js/grunt/updateCopyrightDates.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/updateCopyrightDates.ts b/chipper/js/grunt/updateCopyrightDates.ts
--- a/chipper/js/grunt/updateCopyrightDates.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/updateCopyrightDates.ts (date 1730946837430)
@@ -8,7 +8,7 @@
*/
import * as grunt from 'grunt';
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import updateCopyrightDate from './updateCopyrightDate';
const unsupportedExtensions = [ '.json', 'md' ];
Index: chipper/js/grunt/sortImports.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/sortImports.js b/chipper/js/grunt/sortImports.js
--- a/chipper/js/grunt/sortImports.js (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/sortImports.js (date 1730946718390)
@@ -13,7 +13,7 @@
// 3rd-party packages
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const fs = require( 'fs' );
// constants
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/getPhetLibs.ts (date 1730946693404)
@@ -9,7 +9,7 @@
const ChipperConstants = require( '../common/ChipperConstants.js' );
-import _ from 'lodash';
+import _ from '../../../perennial-alias/js/npm-dependencies/lodash.js';
import assert from 'assert';
import * as grunt from 'grunt';
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/phet-io/phetioCompareAPIsTests.js (date 1730946837437)
@@ -8,7 +8,7 @@
const qunit = require( 'qunit' );
const assert = require( 'assert' );
const _phetioCompareAPIs = require( './phetioCompareAPIs' ); // eslint-disable-line phet/require-statement-match
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
qunit.module( 'phetioCompareAPIs' );
Index: perennial-alias/js/npm-dependencies/lodash.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/perennial-alias/js/npm-dependencies/lodash.js b/perennial-alias/js/npm-dependencies/lodash.js
--- a/perennial-alias/js/npm-dependencies/lodash.js (revision d02f4e95a59fa44b705530f27c97d98324737ab5)
+++ b/perennial-alias/js/npm-dependencies/lodash.js (date 1730947295137)
@@ -5,6 +5,9 @@
* @author Michael Kauzmann (PhET Interactive Simulations)
*/
-import lodash from 'lodash';
+// import lodash from 'lodash';
+const lodash = require( 'lodash' );
+
+module.exports = lodash;
-export default lodash;
\ No newline at end of file
+// export default lodash;
\ No newline at end of file
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 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/getStringMap.js (date 1730946693354)
@@ -8,7 +8,7 @@
*/
-const _ = require( 'lodash' );
+const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
const assert = require( 'assert' );
const ChipperConstants = require( '../common/ChipperConstants.js' );
const pascalCase = require( '../common/pascalCase.js' );
Index: chipper/js/grunt/test-node-lint.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/chipper/js/grunt/test-node-lint.ts b/chipper/js/grunt/test-node-lint.ts
--- a/chipper/js/grunt/test-node-lint.ts (revision 89723c241ab3c408e7b404b93c22a70cbb9eea75)
+++ b/chipper/js/grunt/test-node-lint.ts (date 1730946837413)
@@ -18,6 +18,6 @@
console.log( process );
- const lodash = require( 'lodash' );
- console.log( lodash );
+ const _ = require( '../../../perennial-alias/js/npm-dependencies/lodash.js' );
+ console.log( _ );
} )();
\ No newline at end of file
It tests ok with |
How do we do this for types?
|
From phetsims/chipper#1464 we worked on a pattern to limit the propagation of the same npm modules across repos. Since we already support perennial-alias for imports from build tools like chipper/, it makes sense for them to be here.
Go through usages of
devDependencies
anddependencies
to see what can just live in perennial and be used elsewhere (aqua/alpenglow/monday/chipper/etc).Look at usages of importing from
perennial/node_modules
directly (and alias). This pattern supercedes that one.Can we import lodash from perennial-alias in sims instead of using the global? That seems scary, but we should run an experiment to see if it is buggy. Hopefully it throws a loud error.
Note this issue is in the general them of moving code from chipper to perennial, like in #364 and phetsims/chipper#1489
The text was updated successfully, but these errors were encountered: