mapicgc-gl-js 0.0.57 → 0.0.58

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.
@@ -14,7 +14,7 @@ jobs:
14
14
  - uses: actions/checkout@v3
15
15
  - uses: actions/setup-node@v3
16
16
  with:
17
- node-version: 16
17
+ node-version: 18
18
18
  - run: npm ci
19
19
  - run: npm test
20
20
 
@@ -25,8 +25,9 @@ jobs:
25
25
  - uses: actions/checkout@v3
26
26
  - uses: actions/setup-node@v3
27
27
  with:
28
- node-version: 16
29
- registry-url: https://registry.npmjs.org/
28
+ node-version: 18
29
+ registry-url: https://npm.pkg.github.com/
30
+ scope: '@unitatgeostart'
30
31
  - run: npm ci
31
32
  - run: npm publish
32
33
  env:
package/README.md CHANGED
@@ -25,6 +25,15 @@ Moreover, MapICGC GL JS provides well-documented and user-friendly wrapper funct
25
25
 
26
26
 
27
27
 
28
+ <br>
29
+
30
+ ## Documentation
31
+
32
+ Full documentation for this library is <a href="https://openicgc.github.io/mapicgc-doc/" target="_blank">available here</a>.
33
+
34
+ Check out the features through <a href="https://codepen.io/collection/mrvVZd" target="_blank">examples</a>.
35
+
36
+
28
37
  <br>
29
38
 
30
39
  ## Getting Started
@@ -76,14 +85,7 @@ Result:
76
85
  <a title="Link to CodePen" href="https://codepen.io/unitatgeostart/pen/eYXWyqd" target="_blank"><img src="https://tilemaps.icgc.cat/cdn//images/map1.png"></img></a></div>
77
86
  <br>
78
87
 
79
- ## Documentation
80
-
81
- Full documentation for this library is <a href="https://autogitlab.icgc.local/geostarters/icgc/mapicgc/mapicgc-doc" target="_blank">available here</a>.
82
88
 
83
- Check out the features through <a href="https://codepen.io/collection/mrvVZd" target="_blank">examples</a>.
84
-
85
-
86
- <br>
87
89
 
88
90
  ## Dependencies
89
91
 
@@ -102,4 +104,4 @@ MapICGC GL JS integrates the following libraries:
102
104
 
103
105
 
104
106
  ## License
105
- **MAPICGC GL JS** is licensed under the [3-Clause BSD license](./LICENSE.txt).
107
+ **MAPICGC GL JS** is licensed under the [3-Clause BSD license](./LICENSE.txt).
@@ -1,17 +1,67 @@
1
+ const fs = require('fs');
1
2
  const { exec } = require('child_process');
2
-
3
- // Funció per fer un commit i fer push als repositoris remots
4
- function commitAndPush(commitMessage) {
5
- // Comandament per afegir tots els canvis a la zona d'espera
3
+
4
+ // Lee el archivo package.json para obtener el número de versión
5
+ function getVersionNumber() {
6
+ const packageJson = JSON.parse(fs.readFileSync('package.json'));
7
+ return packageJson.version;
8
+ }
9
+
10
+ // Función para añadir todos los cambios a la zona de espera
11
+ function afegirCanvis(callback) {
6
12
  const addCommand = 'git add .';
7
- // Comandament per fer un commit amb el missatge proporcionat
13
+ exec(addCommand, (error, stdout, stderr) => {
14
+ if (error) {
15
+ console.error(`Error: ${error.message}`);
16
+ return;
17
+ }
18
+ if (stderr) {
19
+ console.error(`stderr: ${stderr}`);
20
+ return;
21
+ }
22
+ console.log("Canvis afegits a la zona d'espera.");
23
+ callback();
24
+ });
25
+ }
26
+
27
+ // Función para fer un commit amb el missatge proporcionat
28
+ function ferCommit(commitMessage, callback) {
8
29
  const commitCommand = `git commit -m "${commitMessage}"`;
9
- // Comandament per fer push als repositoris remots
30
+ exec(commitCommand, (error, stdout, stderr) => {
31
+ if (error) {
32
+ console.error(`Error: ${error.message}`);
33
+ return;
34
+ }
35
+ if (stderr) {
36
+ console.error(`stderr: ${stderr}`);
37
+ return;
38
+ }
39
+ console.log(`Commit realitzat amb èxit: ${commitMessage}`);
40
+ callback();
41
+ });
42
+ }
43
+
44
+ // Función para fer push al primer repositori remot
45
+ function ferPushOrigin(callback) {
10
46
  const pushCommand1 = 'git push origin master';
47
+ exec(pushCommand1, (error, stdout, stderr) => {
48
+ if (error) {
49
+ console.error(`Error: ${error.message}`);
50
+ return;
51
+ }
52
+ if (stderr) {
53
+ console.error(`stderr: ${stderr}`);
54
+ return;
55
+ }
56
+ console.log("Push realitzat al repositori 'origin' amb èxit.");
57
+ callback();
58
+ });
59
+ }
60
+
61
+ // Función para fer push al segon repositori remot
62
+ function ferPushOrigin2() {
11
63
  const pushCommand2 = 'git push -u origin2 master';
12
- // Executar els comandaments en sèrie
13
- exec(`${addCommand} && ${commitCommand} && ${pushCommand1} && ${pushCommand2}`, (error, stdout, stderr) => {
14
-
64
+ exec(pushCommand2, (error, stdout, stderr) => {
15
65
  if (error) {
16
66
  console.error(`Error: ${error.message}`);
17
67
  return;
@@ -20,16 +70,42 @@ function commitAndPush(commitMessage) {
20
70
  console.error(`stderr: ${stderr}`);
21
71
  return;
22
72
  }
23
- console.log(`Commit realitzat amb èxit: ${commitMessage}`);
73
+ console.log("Push realitzat al repositori 'origin2' amb èxit.");
74
+ });
75
+ }
76
+
77
+ // Función para hacer una etiqueta (tag) con la versión actual del package.json
78
+ function etiquetarVersion(callback) {
79
+ const versionNumber = getVersionNumber();
80
+ const tagCommand = `git tag -a v${versionNumber} -m "Versió ${versionNumber}"`;
81
+ exec(tagCommand, (error, stdout, stderr) => {
82
+ if (error) {
83
+ console.error(`Error: ${error.message}`);
84
+ return;
85
+ }
86
+ if (stderr) {
87
+ console.error(`stderr: ${stderr}`);
88
+ return;
89
+ }
90
+ console.log(`Etiqueta (tag) creada amb èxit: v${versionNumber}`);
91
+ callback();
24
92
  });
25
93
  }
26
-
94
+
27
95
  // Utilitzar el primer argument de la línia de comandes com a missatge del commit
28
96
  const commitMessage = process.argv[2];
29
-
97
+
30
98
  // Comprovar si s'ha proporcionat un missatge de commit
31
99
  if (commitMessage) {
32
- commitAndPush(commitMessage);
100
+ afegirCanvis(() => {
101
+ ferCommit(commitMessage, () => {
102
+ etiquetarVersion(() => {
103
+ ferPushOrigin(() => {
104
+ ferPushOrigin2();
105
+ });
106
+ });
107
+ });
108
+ });
33
109
  } else {
34
110
  console.error('Cal proporcionar un missatge de commit com a argument.');
35
- }
111
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mapicgc-gl-js",
3
3
  "homepage": "https://autogitlab.icgc.local/geostarters/icgc/mapicgc/mapicgc-gl-js",
4
- "version": "0.0.57",
4
+ "version": "0.0.58",
5
5
  "description": "mapicgc-gl-js library",
6
6
  "author": "ICGC",
7
7
  "license": "BSD-3-Clause",