Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/phetsims/chipper
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Sep 3, 2021
2 parents 0d18ba7 + 06987fa commit ee3ab31
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 40 deletions.
4 changes: 2 additions & 2 deletions js/grunt/checkNodeVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
const NODE_VERSION_STRING_PARTS = process.version.replace( 'v', '' ).split( '.' );
const NODE_MAJOR_VERSION = parseInt( NODE_VERSION_STRING_PARTS[ 0 ], 10 );
const NODE_MINOR_VERSION = parseInt( NODE_VERSION_STRING_PARTS[ 1 ], 10 );
if ( NODE_MAJOR_VERSION < 8 || ( NODE_MAJOR_VERSION === 8 && NODE_MINOR_VERSION < 10 ) ) {
throw new Error( 'Node 8.10 or greater is needed to run PhET build tools' );
if ( NODE_MAJOR_VERSION < 12 || ( NODE_MAJOR_VERSION === 12 && NODE_MINOR_VERSION < 13 ) ) {
throw new Error( 'Node 12.13 or greater is needed to run PhET build tools' );
}
2 changes: 1 addition & 1 deletion js/grunt/copySupplementalPhetioFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CONTRIB_DIR = 'contrib/';
// Make sure to add new files to the jsdoc generation list below also
const LIB_FILES = [
'../query-string-machine/js/QueryStringMachine.js', // must be first, other types use this
`../${WRAPPER_COMMON_FOLDER}/js/assert.js`,
'../assert/js/assert.js',
'../chipper/js/phet-io/phetioCompareAPIs.js',
`../${WRAPPER_COMMON_FOLDER}/js/WrapperTypes.js`,
'../tandem/js/PhetioIDUtils.js',
Expand Down
2 changes: 1 addition & 1 deletion js/grunt/generateTSConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015-2021, University of Colorado Boulder
// Copyright 2021, University of Colorado Boulder

/**
* Generates the tsconfig.json file for typescript compilation.
Expand Down
10 changes: 7 additions & 3 deletions js/grunt/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const _ = require( 'lodash' ); // eslint-disable-line require-statement-match
const { ESLint } = require( 'eslint' ); // eslint-disable-line
const fs = require( 'fs' );
const grunt = require( 'grunt' );
const md5 = require( 'md5' );
const crypto = require( 'crypto' );

// constants
const EXCLUDE_PATTERNS = [ // patterns that have no code that should be linted
Expand Down Expand Up @@ -51,7 +51,11 @@ const lint = async ( patterns, options ) => {
patterns = patterns.filter( pattern => !EXCLUDE_PATTERNS.includes( pattern ) &&
fs.existsSync( pattern ) );

// 1. Create an instance with the `fix` option.
const hash = crypto.createHmac( 'sha256', 'secretKey' )
.update( patterns.join( ',' ) )
.digest( 'hex' )
.substr( 0, 32 );

const eslintConfig = {

// optional auto-fix
Expand All @@ -63,7 +67,7 @@ const lint = async ( patterns, options ) => {
cache: options.cache,

// Where to store the target-specific cache file
cacheLocation: `../chipper/eslint/cache/${md5( patterns.join( ',' ) )}.eslintcache`,
cacheLocation: `../chipper/eslint/cache/${hash}.eslintcache`,

ignorePath: '../chipper/eslint/.eslintignore',

Expand Down
15 changes: 9 additions & 6 deletions js/grunt/webpackDevServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,18 @@ module.exports = async ( repos, port, devtool, openChrome = false ) => {
devtool: devtool
} );

const server = new WebpackDevServer( compiler, {
contentBase: path.join( __dirname, '../../../' ),
const server = new WebpackDevServer( {
static: {
directory: path.join( __dirname, '../../../' )
},
compress: true,
port: port,
publicPath: '/dist/',
hot: true
} );
devMiddleware: {
publicPath: '/dist/'
}
}, compiler );

server.listen( port, '0.0.0.0', () => {
server.startCallback( () => {
repos.forEach( repo => {
const URL = `http://localhost:${port}/dist/${repo}_phet.html?brand=phet&ea`;
console.log( URL );
Expand Down
51 changes: 24 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,32 @@
"url": "https://github.com/phetsims/chipper.git"
},
"devDependencies": {
"@babel/core": "~7.8.6",
"@babel/preset-env": "~7.8.6",
"@babel/core": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@types/lodash": "^4.14.172",
"archiver": "~3.1.1",
"babel-eslint": "^10.0.3",
"eslint": "~7.22.0",
"eslint-plugin-react": "^7.18.0",
"grunt": "~1.4.0",
"html-webpack-plugin": "^5.3.1",
"jimp": "^0.2.0",
"jpeg-js": "~0.4.3",
"jsdoc": "~3.6.3",
"archiver": "^5.3.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.32.0",
"eslint-plugin-react": "^7.25.1",
"grunt": "^1.4.1",
"html-webpack-plugin": "^5.3.2",
"jimp": "^0.16.1",
"jpeg-js": "^0.4.3",
"jsdoc": "^3.6.7",
"jsondiffpatch": "^0.4.1",
"lodash": "^4.17.10",
"marked": "^0.3.13",
"md5": "~2",
"memfs": "^3.0.3",
"node-html-encoder": "~0.0.2",
"pngjs": "~0.4.0",
"puppeteer": "^10.1.0",
"qunit": "~2.10.0",
"request": "^2.87.0",
"request-promise-native": "^1.0.7",
"taffydb": "^2.7.3",
"terser": "~4.6.4",
"typescript": "4.4.2",
"webpack": "^5.47.1",
"webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.11.2"
"lodash": "^4.17.21",
"marked": "^3.0.2",
"node-html-encoder": "^0.0.2",
"pngjs": "^6.0.0",
"puppeteer": "^10.2.0",
"qunit": "^2.16.0",
"request": "^2.88.2",
"request-promise-native": "^1.0.9",
"terser": "^4.6.4",
"typescript": "^4.4.2",
"webpack": "^5.51.2",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.1.0"
},
"eslintConfig": {
"extends": "../chipper/eslint/sim_eslintrc.js",
Expand Down

0 comments on commit ee3ab31

Please sign in to comment.