@massimo-cassandro/minimo 1.24.0 → 1.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev-tools/starter-kit/templates/package-tpl.json +1 -1
- package/dev-tools/update-version/README.md +1 -0
- package/dev-tools/update-version/convert-changelog.mjs +1 -1
- package/dev-tools/update-version/index.mjs +4 -4
- package/dev-tools/update-version/src/chooser-inquirer.mjs +7 -7
- package/dev-tools/update-version/src/get-cli-params.mjs +7 -0
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"eslint-check": "npx eslint app/ # or src/, frontend/src/ ...",
|
|
24
24
|
"create-favicons INIT": "npx create-favicons init",
|
|
25
25
|
"create-favicons": "npx create-favicons --dir=./favicons # o ./frontend/favicons",
|
|
26
|
-
"UPD-version": "npx update-version
|
|
26
|
+
"UPD-version": "npx update-version --noLogv0 # --log-file=./frontend/changelog.md --log-patch --pkg=alt/path/to/package.json",
|
|
27
27
|
"upd@m": "npx upd@m",
|
|
28
28
|
"launchChrome": "open -n -a 'Google Chrome' --args --profile-directory='Profile 3'",
|
|
29
29
|
"python server": "python3 -m http.server 8000 # --directory __dirname__ # 8000 = default port",
|
|
@@ -17,3 +17,4 @@ Options:
|
|
|
17
17
|
* `--pkg`: Path to the `package.json` file relative to the current directory (default: `./package.json`)
|
|
18
18
|
* `--log-file`: Path to the log file relative to the current directory (default: `./changelog.md`). If the file name ends with `.txt`, the log type is assumed to be the previous version of `update-version`, where each line is in the form `timestamp | version | description`
|
|
19
19
|
* `--log-patch`: If present, patch changes are also recorded in the log.
|
|
20
|
+
* `--noLogv0`: If `true` (default), the log is not written when the major version is `0`, except for the initial log entry created when the changelog file is first initialized. Pass `--noLogv0` to enable it explicitly, or `--noLogv0=false` to disable it from the command line.
|
|
@@ -29,7 +29,7 @@ async function run() {
|
|
|
29
29
|
|
|
30
30
|
// check package.json
|
|
31
31
|
if (!fs.existsSync(params.packageJsonFile)) {
|
|
32
|
-
console.error( styleText(['red'], `
|
|
32
|
+
console.error( styleText(['red'], `Error: ${params.packageJsonFile} not found.` ));
|
|
33
33
|
process.exit(1);
|
|
34
34
|
|
|
35
35
|
}
|
|
@@ -38,10 +38,10 @@ async function run() {
|
|
|
38
38
|
params.oldSemver = params.packageJsonObj.version;
|
|
39
39
|
|
|
40
40
|
if(!params.oldSemver) {
|
|
41
|
-
console.error( styleText(['red'], `
|
|
41
|
+
console.error( styleText(['red'], `Property 'version' of '${params.cfg.packageJsonFile}' not found` ));
|
|
42
42
|
|
|
43
43
|
} else {
|
|
44
|
-
console.log( styleText(['white', 'dim'], `
|
|
44
|
+
console.log( styleText(['white', 'dim'], `Current package.json version: ${params.oldSemver}` ) );
|
|
45
45
|
params.semverArray = params.oldSemver.split('.').map(i => isNaN(i) ? i : +i);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -95,7 +95,7 @@ async function run() {
|
|
|
95
95
|
' '.repeat(rowLength - text.length - 1) +
|
|
96
96
|
styleText(['yellow'], '│'),
|
|
97
97
|
|
|
98
|
-
outputString1 = `👍
|
|
98
|
+
outputString1 = `👍 Version updated: ${params.oldSemver} → ${params.newSemver}`,
|
|
99
99
|
outputString2 = params.logRow.fullText? `Log: ${params.logRow.fullText}` : '',
|
|
100
100
|
outputLenght = Math.max(outputString1.length, outputString2.length ) + 2, // 2 = spazi esterni
|
|
101
101
|
frameLine = '─'.repeat(outputLenght);
|
|
@@ -5,23 +5,23 @@ import { params } from './params.mjs';
|
|
|
5
5
|
|
|
6
6
|
export async function chooser() {
|
|
7
7
|
const choices = [
|
|
8
|
-
{ name: '
|
|
9
|
-
{ name: '
|
|
10
|
-
{ name: '
|
|
8
|
+
{ name: 'Update Patch version', value: 'patch' },
|
|
9
|
+
{ name: 'Update Minor version', value: 'minor' },
|
|
10
|
+
{ name: 'Update Major version', value: 'major' }
|
|
11
11
|
];
|
|
12
12
|
|
|
13
13
|
// Se il file di log non esiste, proponi l'inizializzazione
|
|
14
14
|
if (!fs.existsSync(params.logFile)) {
|
|
15
15
|
choices.unshift({
|
|
16
|
-
name: `
|
|
16
|
+
name: `Initialize Changelog (v${params.oldSemver})`,
|
|
17
17
|
value: 'init'
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
choices.push({ name: '
|
|
21
|
+
choices.push({ name: 'Cancel', value: null });
|
|
22
22
|
|
|
23
23
|
const answer = await select({
|
|
24
|
-
message:
|
|
24
|
+
message: `What do you want to update?${params.oldSemver ? ` (current version ${params.oldSemver})` : ''}`,
|
|
25
25
|
choices: choices
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ export async function chooser() {
|
|
|
29
29
|
|
|
30
30
|
if (answer && params.addLog) {
|
|
31
31
|
const descr = await input({
|
|
32
|
-
message: '
|
|
32
|
+
message: 'Description (optional): ',
|
|
33
33
|
default: answer === 'init'
|
|
34
34
|
? 'Setup'
|
|
35
35
|
: answer === 'patch'
|
|
@@ -24,5 +24,12 @@ export function getCliParams() {
|
|
|
24
24
|
if (!params.toLog.includes('patch')) params.toLog.push('patch');
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
// Disabilita il log per major version 0
|
|
28
|
+
if (arg === '--noLogv0') {
|
|
29
|
+
params.noLogv0 = true;
|
|
30
|
+
} else if (arg.startsWith('--noLogv0=')) {
|
|
31
|
+
params.noLogv0 = arg.split('=')[1].trim() !== 'false';
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
});
|
|
28
35
|
}
|