mapicgc-gl-js 0.0.56 → 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.
@@ -0,0 +1,34 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 18
18
+ - run: npm ci
19
+ - run: npm test
20
+
21
+ publish-npm:
22
+ needs: build
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v3
26
+ - uses: actions/setup-node@v3
27
+ with:
28
+ node-version: 18
29
+ registry-url: https://npm.pkg.github.com/
30
+ scope: '@unitatgeostart'
31
+ - run: npm ci
32
+ - run: npm publish
33
+ env:
34
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
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).
@@ -0,0 +1,111 @@
1
+ const fs = require('fs');
2
+ const { exec } = require('child_process');
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) {
12
+ const addCommand = 'git add .';
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) {
29
+ const commitCommand = `git commit -m "${commitMessage}"`;
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) {
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() {
63
+ const pushCommand2 = 'git push -u origin2 master';
64
+ exec(pushCommand2, (error, stdout, stderr) => {
65
+ if (error) {
66
+ console.error(`Error: ${error.message}`);
67
+ return;
68
+ }
69
+ if (stderr) {
70
+ console.error(`stderr: ${stderr}`);
71
+ return;
72
+ }
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();
92
+ });
93
+ }
94
+
95
+ // Utilitzar el primer argument de la línia de comandes com a missatge del commit
96
+ const commitMessage = process.argv[2];
97
+
98
+ // Comprovar si s'ha proporcionat un missatge de commit
99
+ if (commitMessage) {
100
+ afegirCanvis(() => {
101
+ ferCommit(commitMessage, () => {
102
+ etiquetarVersion(() => {
103
+ ferPushOrigin(() => {
104
+ ferPushOrigin2();
105
+ });
106
+ });
107
+ });
108
+ });
109
+ } else {
110
+ console.error('Cal proporcionar un missatge de commit com a argument.');
111
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
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.56",
4
+ "version": "0.0.58",
5
5
  "description": "mapicgc-gl-js library",
6
6
  "author": "ICGC",
7
7
  "license": "BSD-3-Clause",
8
- "keywords": [
8
+ "keywords": [
9
9
  "map",
10
10
  "js",
11
11
  "webmap",
@@ -36,7 +36,7 @@
36
36
  "build-all": "npm-run-all build && node nodeDeploy.js",
37
37
  "build": "vite build",
38
38
  "preview": "vite preview",
39
- "publish": "npm publish --access public",
39
+ "publish": "npm publish --access public",
40
40
  "setConfig": "node nodeSetConfig.js"
41
41
  },
42
42
  "devDependencies": {
@@ -1,12 +1,12 @@
1
-
2
- const Styles = {
3
- TOPO: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",
4
- ORTO: "https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json",
5
- ORTO3D: "https://tilemaps.icgc.cat/cdn/styles/icgc_orto_3d.json",
6
- ADMIN: "https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json",
7
- DARK: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json",
8
- LIGHT: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json",
9
- GEOLOGY: "https://geoserveis.icgc.cat/contextmaps/icgc_geologic_informacio.json",
10
- };
11
-
12
- export default Styles;
1
+
2
+ const Styles = {
3
+ TOPO: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",
4
+ ORTO: "https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json",
5
+ ORTO3D: "https://tilemaps.icgc.cat/cdn/styles/icgc_orto_3d.json",
6
+ ADMIN: "https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json",
7
+ DARK: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json",
8
+ LIGHT: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json",
9
+ GEOLOGY: "https://geoserveis.icgc.cat/contextmaps/icgc_geologic_informacio.json",
10
+ };
11
+
12
+ export default Styles;
@@ -1,7 +1,7 @@
1
-
2
- const Terrains = {
3
- ICGC5M: "https://tilemaps.icgc.cat/tileserver/tileserver/terreny-5m-30m-rgb-extent/{z}/{x}/{y}.png",
4
- WORLD30M: "https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png",
5
- };
6
-
7
- export default Terrains;
1
+
2
+ const Terrains = {
3
+ ICGC5M: "https://tilemaps.icgc.cat/tileserver/tileserver/terreny-5m-30m-rgb-extent/{z}/{x}/{y}.png",
4
+ WORLD30M: "https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png",
5
+ };
6
+
7
+ export default Terrains;