phetsims / perennial

Maintenance tools that won't change with different versions of chipper checked out
MIT License
2 stars 5 forks source link

`grunt create-sim` fails with valid repo name. #234

Closed pixelzoom closed 3 years ago

pixelzoom commented 3 years ago

What am I doing wrong here? "foo" is certainly a repo name that meets the requirements.

% cd perennial
% grunt create-sim --repo="foo" --author="CM" --title="Foo"
Running "create-sim" task
(Forwarding task to perennial)
Running "create-sim" task
Fatal error: Perennial task failed:
AssertionError [ERR_ASSERTION]: repo name should be composed of lowercase a-z characters, optionally with dashes used as separators
    at assertIsValidRepoName (/Users/cmalley/PhET/GitHub/perennial/js/common/assertIsValidRepoName.js:18:3)
    at /Users/cmalley/PhET/GitHub/perennial/js/grunt/Gruntfile.js:468:7
    at Object.<anonymous> (/Users/cmalley/PhET/GitHub/perennial/js/grunt/Gruntfile.js:91:13)
    at Object.thisTask.fn (/Users/cmalley/PhET/GitHub/perennial/node_modules/grunt/lib/grunt/task.js:70:16)
    at Object.<anonymous> (/Users/cmalley/PhET/GitHub/perennial/node_modules/grunt/lib/util/task.js:294:30)
    at Task.runTaskFn (/Users/cmalley/PhET/GitHub/perennial/node_modules/grunt/lib/util/task.js:244:24)
    at Task.<anonymous> (/Users/cmalley/PhET/GitHub/perennial/node_modules/grunt/lib/util/task.js:293:12)
    at Task.start (/Users/cmalley/PhET/GitHub/perennial/node_modules/grunt/lib/util/task.js:302:5)
    at Object.grunt.tasks (/Users/cmalley/PhET/GitHub/perennial/node_modules/grunt/lib/grunt.js:173:8)
    at Liftoff.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:66:13)
Full Error details:
AssertionError [ERR_ASSERTION]: repo name should be composed of lowercase a-z characters, optionally with dashes used as separators
Fatal error: perennial grunt "--repo=foo" "create-sim" "--repo=foo" "--author=CM" "--title=Foo" failed with code 1
pixelzoom commented 3 years ago

error: perennial grunt "--repo=foo" "create-sim" "--repo=foo" "--author=CM" "--title=Foo" failed with code 1

Wondering why "--repo=foo" is shown twice in this error message?

pixelzoom commented 3 years ago

Interesting... If I run the same command from annual, it works:

% cd annual
% grunt create-sim --repo="foo" --author="CM" --title="Foo"
pixelzoom commented 3 years ago

The sim generated by annual fails at startup with:

foo_en.html:115 GET http://localhost/~cmalley/GitHub/chipper/js/dual/SimVersion.js net::ERR_ABORTED 404 (Not Found)
loadURL @ foo_en.html:115
(anonymous) @ foo_en.html:122
(anonymous) @ foo_en.html:122
updateCheck.js:17 Uncaught TypeError: Cannot read property 'chipper' of undefined
    at updateCheck.js:17
(anonymous) @ updateCheck.js:17

chipper/js/dual/SimVersion.js does not exist in GitHub.

pixelzoom commented 3 years ago

Apparently I was missing something in my local copy. After another pull-all.sh, this is working from perennial and annual. Though I'm not sure why I should be able to run grunt create-sim from both.

zepumph commented 3 years ago

Though I'm not sure why I should be able to run grunt create-sim from both.

It is not recommended to run any grunt commands from annual. At all. That said it is just a copy of perennial, so we don't have enforcement.