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

Update generated package.jsons #308

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/new-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ ElmjutsuDumMyM0DuL3.elm
const licenseArgs = options.forTests ? '--name "Test User" --year 2020' : '';
lishaduck marked this conversation as resolved.
Show resolved Hide resolved
try {
childProcess.execSync(
// TODO(@lishaduck): Evaluate calling the API instead.
Copy link
Contributor Author

@lishaduck lishaduck Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pros:

  • Direct call (perf)
  • Clearer dependency chain (sorta con, see below)
  • Works even if npx isn't on path
  • Fewer Windows gotchas

Cons:

  • Would show up as unmaintained on socket, etc (which is true, it is)
  • Depends on deprecated packages (which is true, we do)
  • Bloats node_modules for 99% of users

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also inline the functionality of the package: support only the common ones and let the user opt-out if they want a different one.

`npx license ${license} --projectName "${authorName}/${packageName}" ${licenseArgs}`,
{
cwd: dir,
Expand Down Expand Up @@ -445,6 +446,7 @@ elm-review --template ${authorName}/${packageName}/example
function packageJson(options, packageName) {
return {
name: packageName,
private: true,
scripts: {
test: 'npm-run-all --print-name --silent --sequential test:make test:format test:run test:review test:package',
'test:make': 'elm make --docs=docs.json',
Expand All @@ -459,11 +461,14 @@ function packageJson(options, packageName) {
'update-examples': 'node maintenance/update-examples-from-preview.js',
postinstall: 'elm-tooling install'
},
dependencies: {
engines: {
node: '>=14.21.3'
},
lishaduck marked this conversation as resolved.
Show resolved Hide resolved
devDependencies: {
lishaduck marked this conversation as resolved.
Show resolved Hide resolved
'elm-doc-preview': '^5.0.5',
'elm-review': `^${options.packageJsonVersion}`,
'elm-test': '^0.19.1-revision10',
'elm-tooling': '^1.13.1',
'elm-test': '^0.19.1-revision12',
'elm-tooling': '^1.15.1',
lishaduck marked this conversation as resolved.
Show resolved Hide resolved
'fs-extra': '^9.0.0',
lishaduck marked this conversation as resolved.
Show resolved Hide resolved
glob: '^9.3.1',
lishaduck marked this conversation as resolved.
Show resolved Hide resolved
'npm-run-all': '^4.1.5'
lishaduck marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "elm-review-something",
"private": true,
"scripts": {
"test": "npm-run-all --print-name --silent --sequential test:make test:format test:run test:review test:package",
"test:make": "elm make --docs=docs.json",
Expand All @@ -13,11 +14,14 @@
"update-examples": "node maintenance/update-examples-from-preview.js",
"postinstall": "elm-tooling install"
},
"dependencies": {
"engines": {
"node": ">=14.21.3"
},
"devDependencies": {
"elm-doc-preview": "^5.0.5",
"elm-review": "^2.12.0",
"elm-test": "^0.19.1-revision10",
"elm-tooling": "^1.13.1",
"elm-test": "^0.19.1-revision12",
"elm-tooling": "^1.15.1",
"fs-extra": "^9.0.0",
"glob": "^9.3.1",
"npm-run-all": "^4.1.5"
Expand Down
10 changes: 7 additions & 3 deletions test/run-snapshots/elm-review-something/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "elm-review-something",
"private": true,
"scripts": {
"test": "npm-run-all --print-name --silent --sequential test:make test:format test:run test:review test:package",
"test:make": "elm make --docs=docs.json",
Expand All @@ -13,11 +14,14 @@
"update-examples": "node maintenance/update-examples-from-preview.js",
"postinstall": "elm-tooling install"
},
"dependencies": {
"engines": {
"node": ">=14.21.3"
},
"devDependencies": {
"elm-doc-preview": "^5.0.5",
"elm-review": "^2.12.0",
"elm-test": "^0.19.1-revision10",
"elm-tooling": "^1.13.1",
"elm-test": "^0.19.1-revision12",
"elm-tooling": "^1.15.1",
"fs-extra": "^9.0.0",
"glob": "^9.3.1",
"npm-run-all": "^4.1.5"
Expand Down