@massimo-cassandro/minimo 1.8.4 → 1.9.1
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/README.md +9 -2
- package/dev-tools/README.md +31 -0
- package/dev-tools/create-favicons/README.md +101 -0
- package/dev-tools/create-favicons/index.mjs +70 -0
- package/dev-tools/create-favicons/src/create-favicons.mjs +37 -0
- package/dev-tools/create-favicons/src/create-ico.OLD.mjs +32 -0
- package/dev-tools/create-favicons/src/create-ico.mjs +18 -0
- package/dev-tools/create-favicons/src/create-png.mjs +21 -0
- package/dev-tools/create-favicons/src/create-snippet.mjs +64 -0
- package/dev-tools/create-favicons/src/create-svg.mjs +15 -0
- package/dev-tools/create-favicons/src/create-webmanifest.mjs +64 -0
- package/dev-tools/create-favicons/src/default-params.mjs +91 -0
- package/dev-tools/create-favicons/src/init.mjs +52 -0
- package/dev-tools/create-favicons/src/parse-params.mjs +61 -0
- package/dev-tools/create-favicons/src/print-frame.mjs +56 -0
- package/dev-tools/create-favicons/src/print-result.mjs +60 -0
- package/dev-tools/create-favicons/src/remove-homedir-string.mjs +9 -0
- package/dev-tools/svg-icons-tools/README.md +75 -0
- package/dev-tools/svg-icons-tools/index.mjs +51 -0
- package/dev-tools/svg-icons-tools/src/config-manager.mjs +23 -0
- package/dev-tools/svg-icons-tools/src/create-dest-folder.mjs +20 -0
- package/dev-tools/svg-icons-tools/src/default-config.mjs +343 -0
- package/dev-tools/svg-icons-tools/src/homedir-path-to-tilde.mjs +9 -0
- package/dev-tools/svg-icons-tools/src/init.mjs +38 -0
- package/dev-tools/svg-icons-tools/src/jsx-icon-file-builder.mjs +62 -0
- package/dev-tools/svg-icons-tools/src/parse-svg-filename.mjs +19 -0
- package/dev-tools/svg-icons-tools/src/parse-svg-files.mjs +82 -0
- package/dev-tools/svg-icons-tools/src/parse-svg-markup.mjs +75 -0
- package/dev-tools/svg-icons-tools/src/print-result.mjs +26 -0
- package/dev-tools/svg-icons-tools/src/start.mjs +23 -0
- package/dev-tools/svg-icons-tools/src/svg-to-jsx.mjs +82 -0
- package/dev-tools/svg-icons-tools/src/svg-to-optimized.mjs +44 -0
- package/dev-tools/svg-icons-tools/src/svg-to-scss.mjs +72 -0
- package/dev-tools/svg-icons-tools/src/svg-to-symbols.mjs +70 -0
- package/dev-tools/svg-icons-tools/src/symbols-demo-tpl.html +110 -0
- package/dev-tools/upd@m/README.md +9 -0
- package/dev-tools/upd@m/index.mjs +72 -0
- package/dev-tools/update-version/README.md +19 -0
- package/dev-tools/update-version/convert-changelog.mjs +67 -0
- package/dev-tools/update-version/index.mjs +110 -0
- package/dev-tools/update-version/src/chooser-inquirer.mjs +43 -0
- package/dev-tools/update-version/src/create-log-row.mjs +25 -0
- package/dev-tools/update-version/src/get-cli-params.mjs +28 -0
- package/dev-tools/update-version/src/params.mjs +26 -0
- package/dev-tools/update-version/src/update-log-file.mjs +17 -0
- package/dev-tools/update-version/src/update-packageJson.mjs +10 -0
- package/dev-tools/update-version/src/update-semver.mjs +29 -0
- package/package.json +25 -7
- package/src/components/unsplash-page/fetch-unsplash-data.js +2 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/* eslint-disable no-console */
|
|
4
|
+
/* eslint-env node */
|
|
5
|
+
|
|
6
|
+
// run npm update for all packeges inside `node_modules/@massimo-cassandro` folder
|
|
7
|
+
|
|
8
|
+
import * as fs from 'fs';
|
|
9
|
+
import {execSync} from 'child_process';
|
|
10
|
+
// https://nodejs.org/api/util.html#utilstyletextformat-text-options
|
|
11
|
+
import { styleText } from 'node:util';
|
|
12
|
+
|
|
13
|
+
const folder = './node_modules/@massimo-cassandro',
|
|
14
|
+
packages = {};
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
|
|
18
|
+
if(!fs.existsSync(folder)) {
|
|
19
|
+
throw `${folder} non presente.`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let maxLength = [];
|
|
23
|
+
|
|
24
|
+
fs.readdirSync(folder).forEach(item => {
|
|
25
|
+
let stats = fs.statSync(`${folder}/${item}`); // stats.isFile() / stats.isDirectory()
|
|
26
|
+
if(stats.isDirectory()) {
|
|
27
|
+
|
|
28
|
+
const packageJsonFile = `${folder}/${item}/package.json`;
|
|
29
|
+
|
|
30
|
+
if(!fs.existsSync(packageJsonFile)) {
|
|
31
|
+
throw `File 'package.json' in '${item}' non presente.`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const packageJsonContent = JSON.parse(fs.readFileSync(packageJsonFile, 'utf8'));
|
|
35
|
+
|
|
36
|
+
packages[packageJsonContent.name] = {
|
|
37
|
+
file : packageJsonFile,
|
|
38
|
+
oldVers : packageJsonContent.version
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
maxLength = Math.max(maxLength, packageJsonContent.name.length);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if(Object.keys(packages).length) {
|
|
46
|
+
execSync(`npm update --save ${Object.keys(packages).join(' ')}`, {stdio: 'inherit'});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// lettura versioni aggiornate
|
|
50
|
+
Object.keys(packages).forEach(p => {
|
|
51
|
+
const packageJsonContent = JSON.parse(fs.readFileSync(packages[p].file, 'utf8'));
|
|
52
|
+
packages[p].newVers = packageJsonContent.version;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
console.log( '\n' +
|
|
57
|
+
Object.keys(packages).map(p =>
|
|
58
|
+
styleText(
|
|
59
|
+
[packages[p].oldVers === packages[p].newVers? 'green' : 'yellow'],
|
|
60
|
+
` • ${p.padEnd(' ', maxLength)}` +
|
|
61
|
+
' : ' +
|
|
62
|
+
`${packages[p].oldVers} => ${packages[p].newVers}`
|
|
63
|
+
)
|
|
64
|
+
).join('\n')
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
console.log( '\n' + styleText(['bold', 'bgGreen'], ' Aggiornamento completato. ' ) + '\n');
|
|
68
|
+
|
|
69
|
+
} catch(e) {
|
|
70
|
+
|
|
71
|
+
console.log( styleText(['red'], `\n${e}\n` ) );
|
|
72
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Update Version
|
|
2
|
+
|
|
3
|
+
Reads the version stored in `package.json`, updates it, and maintains a log file.
|
|
4
|
+
|
|
5
|
+
Each update adds a line to the `changelog.md` file located at the project root. Each line contains the date, the updated version, and optionally, a descriptive text.
|
|
6
|
+
|
|
7
|
+
The updated version number and descriptive text are copied to the clipboard to speed up commenting for any subsequent commits.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx update-version <options>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
|
|
17
|
+
* `--pkg`: Path to the `package.json` file relative to the current directory (default: `./package.json`)
|
|
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
|
+
* `--log-patch`: If present, patch changes are also recorded in the log.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/* global process */
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
|
|
6
|
+
import fs from 'fs';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
9
|
+
// crea un file `changelog-converted.md` dal precedente `changelog.txt`
|
|
10
|
+
|
|
11
|
+
const changelogPath = path.join(process.cwd(), 'changelog.txt');
|
|
12
|
+
|
|
13
|
+
// Verifica se il parametro --include-patch è stato passato
|
|
14
|
+
// se presente vengono conservati anche i log delle patch
|
|
15
|
+
const includePatch = process.argv.includes('--include-patch');
|
|
16
|
+
|
|
17
|
+
let changelogContent;
|
|
18
|
+
|
|
19
|
+
if (fs.existsSync(changelogPath)) {
|
|
20
|
+
changelogContent = fs.readFileSync(changelogPath, 'utf-8');
|
|
21
|
+
|
|
22
|
+
// Processa ogni riga del changelog
|
|
23
|
+
const md = changelogContent.trim().split('\n').reduce((prev, curr) => {
|
|
24
|
+
// Splitta la riga in tre parti (timestamp | versione | descrizione)
|
|
25
|
+
const parts = curr.split('|').map(part => part.trim());
|
|
26
|
+
|
|
27
|
+
if (parts.length !== 3) {
|
|
28
|
+
return prev;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const [timestamp, version, description] = parts;
|
|
32
|
+
|
|
33
|
+
// Estrae i numeri di major, minor, patch dalla versione semver (es: 1.0.1)
|
|
34
|
+
const versionParts = version.split('.').map(Number);
|
|
35
|
+
const [,, patch] = versionParts;
|
|
36
|
+
|
|
37
|
+
// Determina il tipo di update
|
|
38
|
+
// Se patch è 0, è un major/minor update e va sempre incluso
|
|
39
|
+
// Se patch > 0, è un patch update e va incluso solo con --include-patch
|
|
40
|
+
const isPatchUpdate = patch > 0;
|
|
41
|
+
const shouldInclude = !isPatchUpdate || includePatch;
|
|
42
|
+
|
|
43
|
+
if (shouldInclude) {
|
|
44
|
+
// Aggiunge alla lista la versione e la descrizione
|
|
45
|
+
prev.push(
|
|
46
|
+
`* ${version} (${new Date(timestamp).toLocaleString('it-IT', {
|
|
47
|
+
year: 'numeric',
|
|
48
|
+
month: 'short',
|
|
49
|
+
day: '2-digit'
|
|
50
|
+
})})` +
|
|
51
|
+
`${description? ' - ' + description: ''}`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return prev;
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
fs.writeFileSync(path.join(process.cwd(), 'changelog-converted.md'),
|
|
59
|
+
'# Changelog\n\n' +
|
|
60
|
+
md.join('\n') + '\n')
|
|
61
|
+
;
|
|
62
|
+
|
|
63
|
+
} else {
|
|
64
|
+
console.log('File changelog.txt non trovato nella directory attuale');
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/* eslint-disable no-console */
|
|
4
|
+
/* global process */
|
|
5
|
+
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
|
|
9
|
+
import { params } from './src/params.mjs';
|
|
10
|
+
import { chooser } from './src/chooser-inquirer.mjs';
|
|
11
|
+
import { getCliParams } from './src/get-cli-params.mjs';
|
|
12
|
+
import { updateSemver } from './src/update-semver.mjs';
|
|
13
|
+
import { createLogRow } from './src/create-log-row.mjs';
|
|
14
|
+
import { updateLogFile } from './src/update-log-file.mjs';
|
|
15
|
+
import { updatePackageJson } from './src/update-packageJson.mjs';
|
|
16
|
+
|
|
17
|
+
import clipboard from 'clipboardy';
|
|
18
|
+
|
|
19
|
+
// https://nodejs.org/api/util.html#utilstyletextformat-text-options
|
|
20
|
+
import { styleText } from 'node:util';
|
|
21
|
+
|
|
22
|
+
async function run() {
|
|
23
|
+
// parametri da riga di comando
|
|
24
|
+
getCliParams();
|
|
25
|
+
|
|
26
|
+
// risoluzione percorsi assoluti rispetto alla dir corrente
|
|
27
|
+
params.packageJsonFile = path.resolve(process.cwd(), params.packageJsonFile);
|
|
28
|
+
params.logFile = path.resolve(process.cwd(), params.logFile);
|
|
29
|
+
|
|
30
|
+
// check package.json
|
|
31
|
+
if (!fs.existsSync(params.packageJsonFile)) {
|
|
32
|
+
console.error( styleText(['red'], `Errore: ${params.packageJsonFile} non trovato.` ));
|
|
33
|
+
process.exit(1);
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
params.packageJsonObj = JSON.parse(fs.readFileSync(params.packageJsonFile, 'utf8'));
|
|
38
|
+
params.oldSemver = params.packageJsonObj.version;
|
|
39
|
+
|
|
40
|
+
if(!params.oldSemver) {
|
|
41
|
+
console.error( styleText(['red'], `Proprietà 'version' di '${params.cfg.packageJsonFile}' non presente` ));
|
|
42
|
+
|
|
43
|
+
} else {
|
|
44
|
+
console.log( styleText(['white', 'dim'], `Versione package.json attuale: ${params.oldSemver}` ) );
|
|
45
|
+
params.semverArray = params.oldSemver.split('.').map(i => isNaN(i) ? i : +i);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//
|
|
49
|
+
const choice = await chooser();
|
|
50
|
+
|
|
51
|
+
if(choice) {
|
|
52
|
+
params.updateMode = choice; // modalità scelta (init, major, minor o patch)
|
|
53
|
+
updateSemver();
|
|
54
|
+
|
|
55
|
+
params.logRow.vers = params.newSemver;
|
|
56
|
+
|
|
57
|
+
// Scrive il log, se richiesto
|
|
58
|
+
if(params.addLog) {
|
|
59
|
+
createLogRow();
|
|
60
|
+
|
|
61
|
+
if(!params.debug) {
|
|
62
|
+
updateLogFile();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Aggiorna package.json SOLO se non è una inizializzazione
|
|
67
|
+
if (params.updateMode !== 'init' && !params.debug) {
|
|
68
|
+
updatePackageJson();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// END
|
|
72
|
+
|
|
73
|
+
if(params.debug) {
|
|
74
|
+
console.log(params);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
clipboard.writeSync(
|
|
78
|
+
('v.' + params.newSemver) +
|
|
79
|
+
(params.logRow.descr
|
|
80
|
+
? ' - ' + params.logRow.descr
|
|
81
|
+
: params.updateMode === 'patch'
|
|
82
|
+
? ' - Upd / Fix / Dependencies upd'
|
|
83
|
+
: '')
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
const setOutputRow = (text, rowLength, dim = false) =>
|
|
88
|
+
styleText(['yellow'], '│ ') +
|
|
89
|
+
styleText(['yellow', ...(dim? ['dim'] : [])], text) +
|
|
90
|
+
' '.repeat(rowLength - text.length - 1) +
|
|
91
|
+
styleText(['yellow'], '│'),
|
|
92
|
+
|
|
93
|
+
outputString1 = `👍 Versione aggiornata: ${params.oldSemver} → ${params.newSemver}`,
|
|
94
|
+
outputString2 = params.logRow.fullText? `Log: ${params.logRow.fullText}` : '',
|
|
95
|
+
outputLenght = Math.max(outputString1.length, outputString2.length ) + 2, // 2 = spazi esterni
|
|
96
|
+
frameLine = '─'.repeat(outputLenght);
|
|
97
|
+
|
|
98
|
+
console.log( styleText(['yellow'], '\n┌' + frameLine + '┐' ));
|
|
99
|
+
|
|
100
|
+
console.log( setOutputRow(outputString1, outputLenght));
|
|
101
|
+
|
|
102
|
+
if(outputString2) {
|
|
103
|
+
console.log( setOutputRow(outputString2, outputLenght, true));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
console.log( styleText(['yellow'], '└' + frameLine + '┘\n' ));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
run().catch(console.error);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import select from '@inquirer/select';
|
|
2
|
+
import input from '@inquirer/input';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import { params } from './params.mjs';
|
|
5
|
+
|
|
6
|
+
export async function chooser() {
|
|
7
|
+
const choices = [
|
|
8
|
+
{ name: 'Aggiorna Patch version', value: 'patch' },
|
|
9
|
+
{ name: 'Aggiorna Minor version', value: 'minor' },
|
|
10
|
+
{ name: 'Aggiorna Major version', value: 'major' }
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
// Se il file di log non esiste, proponi l'inizializzazione
|
|
14
|
+
if (!fs.existsSync(params.logFile)) {
|
|
15
|
+
choices.unshift({
|
|
16
|
+
name: `Inizializza Changelog (v${params.oldSemver})`,
|
|
17
|
+
value: 'init'
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
choices.push({ name: 'Annulla', value: null });
|
|
22
|
+
|
|
23
|
+
const answer = await select({
|
|
24
|
+
message: 'Cosa vuoi aggiornare?',
|
|
25
|
+
choices: choices
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
params.addLog = params.toLog.indexOf(answer) !== -1 || answer === 'init';
|
|
29
|
+
|
|
30
|
+
if (answer && params.addLog) {
|
|
31
|
+
const descr = await input({
|
|
32
|
+
message: 'Descrizione (opzionale): ',
|
|
33
|
+
default: answer === 'init'
|
|
34
|
+
? 'Setup'
|
|
35
|
+
: answer === 'patch'
|
|
36
|
+
? 'Upd / Fix / Dependencies upd'
|
|
37
|
+
: ''
|
|
38
|
+
});
|
|
39
|
+
params.logRow.descr = descr.trim() || null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return answer;
|
|
43
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { params } from './params.mjs';
|
|
2
|
+
|
|
3
|
+
export function createLogRow() {
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
if (params.markdownLog) {
|
|
7
|
+
|
|
8
|
+
const dateStr = params.logRow.date.toLocaleString(params.locale, {
|
|
9
|
+
year: 'numeric', month: 'short', day: '2-digit'
|
|
10
|
+
});
|
|
11
|
+
params.logRow.fullText = `* ${params.logRow.vers} (${dateStr})${params.logRow.descr ? ' - ' + params.logRow.descr : ''}`;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
} else {
|
|
15
|
+
|
|
16
|
+
const dateStr = params.logRow.date.toISOString();
|
|
17
|
+
params.logRow.fullText = `${dateStr} | ${(' '.repeat(16) + params.logRow.vers).slice(-16)} | ${params.logRow.descr || ''}`;
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* global process */
|
|
2
|
+
|
|
3
|
+
import { params } from './params.mjs';
|
|
4
|
+
|
|
5
|
+
export function getCliParams() {
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
|
|
8
|
+
args.forEach(arg => {
|
|
9
|
+
|
|
10
|
+
// Percorso package.json
|
|
11
|
+
if (arg.startsWith('--pkg=')) {
|
|
12
|
+
params.packageJsonFile = arg.split('=')[1].trim();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Percorso file di log
|
|
16
|
+
if (arg.startsWith('--log-file=')) {
|
|
17
|
+
params.logFile = arg.split('=')[1].trim();
|
|
18
|
+
// Se il file finisce in .txt, disabilita markdownLog
|
|
19
|
+
if (params.logFile.endsWith('.txt')) params.markdownLog = false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Abilita log anche per le patch
|
|
23
|
+
if (arg === '--log-patch') {
|
|
24
|
+
if (!params.toLog.includes('patch')) params.toLog.push('patch');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const params = {
|
|
2
|
+
// Valori di default
|
|
3
|
+
|
|
4
|
+
packageJsonFile: './package.json',
|
|
5
|
+
logFile: './changelog.md',
|
|
6
|
+
markdownLog: true,
|
|
7
|
+
toLog: ['major', 'minor'], // opzionale 'patch'
|
|
8
|
+
locale: 'it-IT',
|
|
9
|
+
|
|
10
|
+
debug: false, // solo sviluppo, non aggiorna nulla ma mostra l'output finale
|
|
11
|
+
|
|
12
|
+
addLog: true, // modificato in base alla scelta del tipo di aggironamento e del valore di toLog
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// preRealeaseTags: ['alpha', 'beta', 'rc'],
|
|
16
|
+
logRow: {
|
|
17
|
+
vers: null,
|
|
18
|
+
date: new Date(),
|
|
19
|
+
descr: null,
|
|
20
|
+
fullText: ''
|
|
21
|
+
},
|
|
22
|
+
oldSemver: null,
|
|
23
|
+
newSemver: null,
|
|
24
|
+
semverArray: [],
|
|
25
|
+
updateMode: null
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import { params } from './params.mjs';
|
|
3
|
+
|
|
4
|
+
export function updateLogFile() {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
if(params.logRow.fullText) {
|
|
8
|
+
|
|
9
|
+
let text = params.logRow.fullText;
|
|
10
|
+
|
|
11
|
+
if(params.updateMode === 'init' && params.markdownLog) {
|
|
12
|
+
text = '# Changelog\n\n' + params.logRow.fullText;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
fs.appendFileSync(params.logFile, text + '\n');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
|
|
4
|
+
import { params } from './params.mjs';
|
|
5
|
+
|
|
6
|
+
export function updatePackageJson() {
|
|
7
|
+
|
|
8
|
+
params.packageJsonObj.version = params.newSemver;
|
|
9
|
+
fs.writeFileSync(params.packageJsonFile, JSON.stringify(params.packageJsonObj, null, ' '));
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { params } from './params.mjs';
|
|
2
|
+
|
|
3
|
+
export function updateSemver() {
|
|
4
|
+
// Se stiamo solo inizializzando il log, la nuova versione è uguale alla vecchia
|
|
5
|
+
if (params.updateMode === 'init') {
|
|
6
|
+
params.newSemver = params.oldSemver;
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// ... logica esistente per major, minor, patch ...
|
|
11
|
+
if (params.semverArray.length < 3) while (params.semverArray.length < 3) params.semverArray.push(0);
|
|
12
|
+
|
|
13
|
+
switch (params.updateMode) {
|
|
14
|
+
case 'major':
|
|
15
|
+
params.semverArray[0]++;
|
|
16
|
+
params.semverArray[1] = 0;
|
|
17
|
+
params.semverArray[2] = 0;
|
|
18
|
+
break;
|
|
19
|
+
case 'minor':
|
|
20
|
+
params.semverArray[1]++;
|
|
21
|
+
params.semverArray[2] = 0;
|
|
22
|
+
break;
|
|
23
|
+
case 'patch':
|
|
24
|
+
params.semverArray[2]++;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
params.newSemver = params.semverArray.join('.');
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@massimo-cassandro/minimo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "Light css framework & utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -15,9 +15,16 @@
|
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/massimo-cassandro/minimo/issues"
|
|
17
17
|
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
18
21
|
"bin": {
|
|
19
22
|
"buildTokens": "./design-tokens/utilities/build-tokens.mjs",
|
|
20
|
-
"checkUnresolvedProps": "./design-tokens/utilities/check-unresolved-custom-props.mjs"
|
|
23
|
+
"checkUnresolvedProps": "./design-tokens/utilities/check-unresolved-custom-props.mjs",
|
|
24
|
+
"update-version": "./dev-tools/update-version/index.mjs",
|
|
25
|
+
"upd@m": "./dev-tools/upd@m/index.mjs",
|
|
26
|
+
"svgIconsTools": "./dev-tools/svg-icons-tools/index.mjs",
|
|
27
|
+
"create-favicons": "./dev-tools/create-favicons/index.mjs"
|
|
21
28
|
},
|
|
22
29
|
"repository": {
|
|
23
30
|
"type": "git",
|
|
@@ -34,29 +41,40 @@
|
|
|
34
41
|
},
|
|
35
42
|
"license": "MIT",
|
|
36
43
|
"author": "Massimo Cassandro",
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
|
-
},
|
|
40
44
|
"sideEffects": [
|
|
41
45
|
"**/s-datatable-component/**/*"
|
|
42
46
|
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">= 18.0.0",
|
|
49
|
+
"npm": ">= 9.0.0"
|
|
50
|
+
},
|
|
43
51
|
"files": [
|
|
44
52
|
"./index.js",
|
|
45
53
|
"src/**/*.{js,mjs,css,svg,md}",
|
|
46
54
|
"design-tokens/tokens/**/*.{tokens.json,tokens.jsonc}",
|
|
47
55
|
"design-tokens/_src/**/*.{tokens.json,tokens.jsonc,mjs,js,md}",
|
|
48
56
|
"design-tokens/utilities/**/*.{mjs,md}",
|
|
49
|
-
"charts/**/*.{js,md}"
|
|
57
|
+
"charts/**/*.{js,md}",
|
|
58
|
+
"dev-tools/**/*.{js,mjs,md,html}"
|
|
50
59
|
],
|
|
51
60
|
"peerDependenciesMeta": {
|
|
52
61
|
"@svgdotjs/svg.js": {
|
|
53
62
|
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"style-dictionary": {
|
|
65
|
+
"optional": true
|
|
54
66
|
}
|
|
55
67
|
},
|
|
56
68
|
"devDependencies": {
|
|
57
|
-
"@massimo-cassandro/dev-updater": "^3.0.7",
|
|
58
69
|
"@massimo-cassandro/eslint-config": "^3.0.11",
|
|
59
70
|
"@massimo-cassandro/stylelint-config": "^2.3.11",
|
|
60
71
|
"style-dictionary": "^5.5.0"
|
|
72
|
+
},
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"@inquirer/input": "^5.1.2",
|
|
75
|
+
"@inquirer/select": "^5.2.1",
|
|
76
|
+
"clipboardy": "^5.3.1",
|
|
77
|
+
"sharp": "^0.35.3",
|
|
78
|
+
"sharp-ico": "^0.1.5"
|
|
61
79
|
}
|
|
62
80
|
}
|
|
@@ -59,7 +59,7 @@ export async function fetchUnsplashData(settings) {
|
|
|
59
59
|
width : data.width,
|
|
60
60
|
height : data.height,
|
|
61
61
|
// description : data.description,
|
|
62
|
-
// location : data.location
|
|
62
|
+
// location : data.location?.name,
|
|
63
63
|
alt_description : data.alt_description,
|
|
64
64
|
date : data.created_at,
|
|
65
65
|
base_url : data.urls.raw,
|
|
@@ -68,7 +68,7 @@ export async function fetchUnsplashData(settings) {
|
|
|
68
68
|
author_profile : data.user.links.html,
|
|
69
69
|
blur_hash : data.blur_hash,
|
|
70
70
|
image_description : (() => {
|
|
71
|
-
let location = data.location
|
|
71
|
+
let location = data.location?.name,
|
|
72
72
|
description = data.description?? data.alt_description;
|
|
73
73
|
if(data.description && location) {
|
|
74
74
|
location = (new RegExp(location, 'i')).test(description)? null : location;
|