Skip to content

Commit ac053d7

Browse files
committed
Stop generating a LICENSE file automatically
1 parent f11a86e commit ac053d7

9 files changed

Lines changed: 36 additions & 94 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Made import cycle error look better for modules with names that are only a single character.
99
- Fix prepare-offline help text.
1010
- Breaking change for local dev testing: Replaced `LOCAL_ELM_REVIEW_SRC=/path/to/elm-review/src` by `LOCAL_ELM_REVIEW=/path/to/elm-review`.
11+
- When running `elm-review new-package`, the `LICENSE` file will now not be generated automatically. Instead, a manual step has been added in the generated `MAINTENANCE.md` file.
1112

1213
## [2.13.5] - 2025-12-30
1314

lib/new-package.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* @import {Options, RuleType} from './types/options';
66
* @import {Path} from './types/path';
77
*/
8-
const childProcess = require('node:child_process');
98
const path = require('node:path');
109
const chalk = require('chalk');
1110
const prompts = require('prompts');
@@ -302,29 +301,6 @@ ElmjutsuDumMyM0DuL3.elm
302301
['ISSUE_TEMPLATE/new-rule-idea.md', 'workflows/test.yml']
303302
);
304303

305-
Spinner.succeedAndNowDo(
306-
`Adding LICENSE ${chalk.grey(`npx license ${license}`)}`,
307-
options.report
308-
);
309-
const licenseArgs = options.forTests ? '--name "Test User" --year 2020' : '';
310-
try {
311-
childProcess.execSync(
312-
// TODO(@lishaduck): Evaluate calling the API instead.
313-
`npx license ${license} --projectName "${authorName}/${packageName}" ${licenseArgs}`,
314-
{
315-
cwd: dir,
316-
stdio: ['ignore', 'ignore', 'pipe']
317-
}
318-
);
319-
} catch (error) {
320-
console.log(chalk.red('FAILED adding a license'));
321-
if (options.debug) {
322-
console.log(error);
323-
} else {
324-
console.log(error.message);
325-
}
326-
}
327-
328304
Spinner.succeedAndNowDo('Adding elm-review configuration', options.report);
329305
await Init.createFromTemplate(
330306
options,

new-package/maintenance/MAINTENANCE.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,24 @@ git add --all
3535
git commit --message="Initialize project"
3636
```
3737

38-
### 3. Replace REPLACEME
38+
### 3. Add a license file
39+
40+
I recommend using the `license` npm tool to generate one.
41+
You should choose the same license as in your `elm.json` file.
42+
43+
```bash
44+
npx license
45+
```
46+
47+
### 4. Replace REPLACEME
3948

4049
In some of the files, notably `elm.json`, `README.md` and the rule files that were created for you, you will find a few `REPLACEME`. You will need to replace all of these and by things that make sense in their individual context.
4150

4251
Again, you can do this step at a later time if you prefer, but you will have to do these before publishing. You will be reminded to do this when running the tests.
4352

4453
Note that you will also have to supply the `summary` field in the `elm.json`, which should be close to the same thing that you will write in the README.
4554

46-
### 4. (Can be done later) Create the project on GitHub
55+
### 5. (Can be done later) Create the project on GitHub
4756

4857
You can do this step at a later time if you prefer.
4958
When you do, consider to

test/run-snapshots/elm-review-something-for-new-rule/LICENSE

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/run-snapshots/elm-review-something-for-new-rule/maintenance/MAINTENANCE.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,24 @@ git add --all
3535
git commit --message="Initialize project"
3636
```
3737

38-
### 3. Replace REPLACEME
38+
### 3. Add a license file
39+
40+
I recommend using the `license` npm tool to generate one.
41+
You should choose the same license as in your `elm.json` file.
42+
43+
```bash
44+
npx license
45+
```
46+
47+
### 4. Replace REPLACEME
3948

4049
In some of the files, notably `elm.json`, `README.md` and the rule files that were created for you, you will find a few `REPLACEME`. You will need to replace all of these and by things that make sense in their individual context.
4150

4251
Again, you can do this step at a later time if you prefer, but you will have to do these before publishing. You will be reminded to do this when running the tests.
4352

4453
Note that you will also have to supply the `summary` field in the `elm.json`, which should be close to the same thing that you will write in the README.
4554

46-
### 4. (Can be done later) Create the project on GitHub
55+
### 5. (Can be done later) Create the project on GitHub
4756

4857
You can do this step at a later time if you prefer.
4958
When you do, consider to

test/run-snapshots/elm-review-something-for-new-rule/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@
2525
"fs-extra": "^9.0.0",
2626
"npm-run-all": "^4.1.5",
2727
"tinyglobby": "^0.2.10"
28-
},
29-
"license": "BSD-3-Clause"
28+
}
3029
}

test/run-snapshots/elm-review-something/LICENSE

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/run-snapshots/elm-review-something/maintenance/MAINTENANCE.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,24 @@ git add --all
3535
git commit --message="Initialize project"
3636
```
3737

38-
### 3. Replace REPLACEME
38+
### 3. Add a license file
39+
40+
I recommend using the `license` npm tool to generate one.
41+
You should choose the same license as in your `elm.json` file.
42+
43+
```bash
44+
npx license
45+
```
46+
47+
### 4. Replace REPLACEME
3948

4049
In some of the files, notably `elm.json`, `README.md` and the rule files that were created for you, you will find a few `REPLACEME`. You will need to replace all of these and by things that make sense in their individual context.
4150

4251
Again, you can do this step at a later time if you prefer, but you will have to do these before publishing. You will be reminded to do this when running the tests.
4352

4453
Note that you will also have to supply the `summary` field in the `elm.json`, which should be close to the same thing that you will write in the README.
4554

46-
### 4. (Can be done later) Create the project on GitHub
55+
### 5. (Can be done later) Create the project on GitHub
4756

4857
You can do this step at a later time if you prefer.
4958
When you do, consider to

test/run-snapshots/elm-review-something/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@
2525
"fs-extra": "^9.0.0",
2626
"npm-run-all": "^4.1.5",
2727
"tinyglobby": "^0.2.10"
28-
},
29-
"license": "BSD-3-Clause"
28+
}
3029
}

0 commit comments

Comments
 (0)