@underpostnet/underpost 2.98.0 → 2.98.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/.vscode/settings.json +7 -8
- package/README.md +2 -2
- package/bin/build.js +21 -5
- package/bin/deploy.js +1 -0
- package/bin/file.js +2 -1
- package/bin/util.js +0 -17
- package/cli.md +2 -2
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
- package/package.json +2 -4
- package/scripts/rocky-setup.sh +12 -39
- package/src/api/document/document.service.js +1 -1
- package/src/cli/cluster.js +5 -9
- package/src/cli/repository.js +9 -9
- package/src/cli/run.js +108 -106
- package/src/client/components/core/Content.js +50 -2
- package/src/client/components/core/Panel.js +91 -22
- package/src/client/components/core/PanelForm.js +1 -0
- package/src/client/components/core/Translate.js +8 -0
- package/src/client/services/default/default.management.js +324 -136
- package/src/index.js +58 -20
- package/src/client/components/core/ObjectLayerEngine.js +0 -1520
- package/src/client/components/core/ObjectLayerEngineModal.js +0 -1245
- package/src/client/components/core/ObjectLayerEngineViewer.js +0 -880
- package/src/server/object-layer.js +0 -335
package/.vscode/settings.json
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"explorer.compactFolders": false,
|
|
5
5
|
"javascript.preferences.importModuleSpecifierEnding": "js",
|
|
6
6
|
"[javascript]": {
|
|
7
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
7
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
8
8
|
},
|
|
9
9
|
"[python]": {
|
|
10
|
-
"editor.defaultFormatter": "ms-python.python"
|
|
10
|
+
"editor.defaultFormatter": "ms-python.python",
|
|
11
11
|
},
|
|
12
12
|
"cSpell.words": [
|
|
13
13
|
"adminer",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"htmls",
|
|
41
41
|
"inet",
|
|
42
42
|
"inlt",
|
|
43
|
-
"ipfs",
|
|
44
43
|
"Itemledger",
|
|
45
44
|
"jsonld",
|
|
46
45
|
"lampp",
|
|
@@ -72,16 +71,16 @@
|
|
|
72
71
|
"webroot",
|
|
73
72
|
"xampp",
|
|
74
73
|
"xfwd",
|
|
75
|
-
"youtu"
|
|
74
|
+
"youtu",
|
|
76
75
|
],
|
|
77
76
|
"[php]": {
|
|
78
|
-
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
|
|
77
|
+
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client",
|
|
79
78
|
},
|
|
80
79
|
"[xml]": {
|
|
81
|
-
"editor.defaultFormatter": "redhat.vscode-xml"
|
|
80
|
+
"editor.defaultFormatter": "redhat.vscode-xml",
|
|
82
81
|
},
|
|
83
82
|
|
|
84
83
|
"files.watcherExclude": {
|
|
85
|
-
"**/target": true
|
|
86
|
-
}
|
|
84
|
+
"**/target": true,
|
|
85
|
+
},
|
|
87
86
|
}
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- badges -->
|
|
20
20
|
|
|
21
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.98.1) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
22
22
|
|
|
23
23
|
<!-- end-badges -->
|
|
24
24
|
|
|
@@ -66,7 +66,7 @@ Run dev client server
|
|
|
66
66
|
npm run dev
|
|
67
67
|
```
|
|
68
68
|
<!-- -->
|
|
69
|
-
## underpost ci/cd cli v2.98.
|
|
69
|
+
## underpost ci/cd cli v2.98.1
|
|
70
70
|
|
|
71
71
|
### Usage: `underpost [options] [command]`
|
|
72
72
|
```
|
package/bin/build.js
CHANGED
|
@@ -159,6 +159,7 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
159
159
|
recursive: true,
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
+
const originPackageJson = JSON.parse(fs.readFileSync(`./package.json`, 'utf8'));
|
|
162
163
|
const packageJson = JSON.parse(fs.readFileSync(`${basePath}/package.json`, 'utf8'));
|
|
163
164
|
packageJson.name = repoName.replace('engine-', '');
|
|
164
165
|
|
|
@@ -171,16 +172,31 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
171
172
|
);
|
|
172
173
|
delete packageJson.bin.underpost;
|
|
173
174
|
packageJson.bin.cyberia = 'bin/index.js';
|
|
174
|
-
packageJson.keywords = [
|
|
175
|
+
packageJson.keywords = [
|
|
176
|
+
'cyberia',
|
|
177
|
+
'object-layer',
|
|
178
|
+
'game-engine',
|
|
179
|
+
'assets-management',
|
|
180
|
+
'web3',
|
|
181
|
+
'atlas-sprite-sheet',
|
|
182
|
+
];
|
|
175
183
|
packageJson.description = 'Cyberia Engine - Object Layer and Assets Management Microservice';
|
|
184
|
+
packageJson.dependencies = originPackageJson.dependencies;
|
|
185
|
+
packageJson.dependencies['maxrects-packer'] = '^2.7.3';
|
|
186
|
+
packageJson.dependencies['pngjs'] = '^7.0.0';
|
|
187
|
+
packageJson.dependencies['jimp'] = '^1.6.0';
|
|
188
|
+
packageJson.dependencies['sharp'] = '^0.32.5';
|
|
176
189
|
fs.writeFileSync(`${basePath}/bin/index.js`, fs.readFileSync(`./bin/cyberia.js`, 'utf8'), 'utf8');
|
|
177
190
|
fs.copyFileSync(`./src/api/object-layer/README.md`, `${basePath}/README.md`);
|
|
178
191
|
fs.copySync(`./hardhat`, `${basePath}/hardhat`);
|
|
179
192
|
fs.copySync(`./hardhat/white-paper.md`, `${basePath}/white-paper.md`);
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
193
|
+
for (const path of [
|
|
194
|
+
'/src/client/ssr/pages/CyberiaServerMetrics.js',
|
|
195
|
+
'/src/server/object-layer.js',
|
|
196
|
+
'/src/server/atlas-sprite-sheet-generator.js',
|
|
197
|
+
])
|
|
198
|
+
fs.copySync(`.${path}`, `${basePath}${path}`);
|
|
199
|
+
|
|
184
200
|
default:
|
|
185
201
|
break;
|
|
186
202
|
}
|
package/bin/deploy.js
CHANGED
|
@@ -462,6 +462,7 @@ try {
|
|
|
462
462
|
`./engine-private/conf/${deployId}/build/development/proxy.yaml`,
|
|
463
463
|
`./manifests/deployment/${deployId}-development/proxy.yaml`,
|
|
464
464
|
);
|
|
465
|
+
shellExec(`node bin new --dev --default-conf --deploy-id ${deployId}`);
|
|
465
466
|
}
|
|
466
467
|
shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
|
|
467
468
|
shellExec(`node bin new --deploy-id dd-default`);
|
package/bin/file.js
CHANGED
|
@@ -99,9 +99,10 @@ try {
|
|
|
99
99
|
'./manifests/deployment/dd-cyberia-development',
|
|
100
100
|
'./manifests/deployment/dd-core-development',
|
|
101
101
|
'./manifests/deployment/dd-template-development',
|
|
102
|
+
'./src/server/object-layer.js',
|
|
103
|
+
'./src/server/atlas-sprite-sheet-generator.js',
|
|
102
104
|
'bin/web3.js',
|
|
103
105
|
'bin/cyberia.js',
|
|
104
|
-
'bin/cyberia0.js',
|
|
105
106
|
]) {
|
|
106
107
|
if (fs.existsSync(deletePath)) fs.removeSync('../pwa-microservices-template/' + deletePath);
|
|
107
108
|
}
|
package/bin/util.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
|
-
import si from 'systeminformation';
|
|
3
2
|
import * as dir from 'path';
|
|
4
3
|
|
|
5
4
|
import { loggerFactory } from '../src/server/logger.js';
|
|
@@ -19,22 +18,6 @@ try {
|
|
|
19
18
|
console.log(fs.readFileSync(process.argv[3], 'utf8'));
|
|
20
19
|
break;
|
|
21
20
|
|
|
22
|
-
case 'system-info':
|
|
23
|
-
await (async () => {
|
|
24
|
-
for (const infoKey of Object.keys(si)) {
|
|
25
|
-
if (typeof si[infoKey] === 'function') {
|
|
26
|
-
// 'dockerInfo', 'vboxInfo'
|
|
27
|
-
if (!['osInfo', 'graphics', 'cpu'].includes(infoKey)) continue;
|
|
28
|
-
try {
|
|
29
|
-
const infoInstance = await si[infoKey]();
|
|
30
|
-
logger.info(infoKey, infoInstance);
|
|
31
|
-
} catch (error) {
|
|
32
|
-
logger.info('Not valid info function', infoKey);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
})();
|
|
37
|
-
break;
|
|
38
21
|
case 'delete-empty-folder':
|
|
39
22
|
function cleanEmptyFoldersRecursively(folder) {
|
|
40
23
|
if (!fs.existsSync(folder)) {
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.98.
|
|
1
|
+
## underpost ci/cd cli v2.98.1
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -802,7 +802,7 @@ Options:
|
|
|
802
802
|
Runs specified scripts using various runners.
|
|
803
803
|
|
|
804
804
|
Arguments:
|
|
805
|
-
runner-id The runner ID to run. Options:
|
|
805
|
+
runner-id The runner ID to run. Options: dev-cluster, metadata, svc-ls, svc-rm, ssh-cluster-info, dev-hosts-expose, dev-hosts-restore, cluster-build, template-deploy, template-deploy-image, clean, pull, release-deploy, ssh-deploy, ide, sync, stop, ssh-deploy-stop, tz, cron, get-proxy, instance-promote, instance, ls-deployments, host-update, dd-container, ip-info, monitor, db-client, git-conf, promote, metrics, cluster, deploy, disk-clean, disk-usage, dev, service, sh, log, ps, ptls, release-cmt, deploy-test, sync-replica, tf-vae-test, spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, deploy-job.
|
|
806
806
|
path The input value, identifier, or path for the operation.
|
|
807
807
|
|
|
808
808
|
Options:
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.98.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.98.1
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -100,7 +100,7 @@ spec:
|
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
102
|
- name: dd-default-development-green
|
|
103
|
-
image: localhost/rockylinux9-underpost:v2.98.
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.98.1
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -18,7 +18,7 @@ spec:
|
|
|
18
18
|
spec:
|
|
19
19
|
containers:
|
|
20
20
|
- name: dd-test-development-blue
|
|
21
|
-
image: localhost/rockylinux9-underpost:v2.98.
|
|
21
|
+
image: localhost/rockylinux9-underpost:v2.98.1
|
|
22
22
|
|
|
23
23
|
command:
|
|
24
24
|
- /bin/sh
|
|
@@ -103,7 +103,7 @@ spec:
|
|
|
103
103
|
spec:
|
|
104
104
|
containers:
|
|
105
105
|
- name: dd-test-development-green
|
|
106
|
-
image: localhost/rockylinux9-underpost:v2.98.
|
|
106
|
+
image: localhost/rockylinux9-underpost:v2.98.1
|
|
107
107
|
|
|
108
108
|
command:
|
|
109
109
|
- /bin/sh
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "@underpostnet/underpost",
|
|
5
|
-
"version": "2.98.
|
|
5
|
+
"version": "2.98.1",
|
|
6
6
|
"description": "pwa api rest template",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"express-fileupload": "^1.4.3",
|
|
73
73
|
"express-rate-limit": "^8.1.0",
|
|
74
74
|
"express-slow-down": "^3.0.0",
|
|
75
|
+
"fast-json-stable-stringify": "^2.1.0",
|
|
75
76
|
"favicons": "^7.2.0",
|
|
76
77
|
"fs-extra": "^11.1.1",
|
|
77
78
|
"fullcalendar": "^6.1.15",
|
|
@@ -80,7 +81,6 @@
|
|
|
80
81
|
"http-proxy-middleware": "^2.0.6",
|
|
81
82
|
"ignore-walk": "^6.0.4",
|
|
82
83
|
"iovalkey": "^0.2.1",
|
|
83
|
-
"jimp": "^1.6.0",
|
|
84
84
|
"json-colorizer": "^2.2.2",
|
|
85
85
|
"jsonwebtoken": "^9.0.2",
|
|
86
86
|
"mariadb": "^3.2.2",
|
|
@@ -95,7 +95,6 @@
|
|
|
95
95
|
"prom-client": "^15.1.2",
|
|
96
96
|
"read": "^2.1.0",
|
|
97
97
|
"rrule": "^2.8.1",
|
|
98
|
-
"sharp": "^0.32.5",
|
|
99
98
|
"shelljs": "^0.8.5",
|
|
100
99
|
"sitemap": "^7.1.1",
|
|
101
100
|
"socket.io": "^4.8.0",
|
|
@@ -103,7 +102,6 @@
|
|
|
103
102
|
"split-file": "^2.3.0",
|
|
104
103
|
"swagger-autogen": "^2.23.7",
|
|
105
104
|
"swagger-ui-express": "^5.0.0",
|
|
106
|
-
"systeminformation": "^5.23.7",
|
|
107
105
|
"uglify-js": "^3.17.4",
|
|
108
106
|
"validator": "^13.11.0",
|
|
109
107
|
"vanilla-jsoneditor": "^2.3.2",
|
package/scripts/rocky-setup.sh
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
# Script to install a recommended base package set on Rocky Linux.
|
|
6
5
|
# Usage examples:
|
|
7
|
-
# sudo ./scripts/rocky-setup.sh #
|
|
8
|
-
# sudo ./scripts/rocky-setup.sh --install-dev #
|
|
6
|
+
# sudo ./scripts/rocky-setup.sh # install base packages
|
|
7
|
+
# sudo ./scripts/rocky-setup.sh --install-dev # install base packages + Development Tools
|
|
9
8
|
# INSTALL_DEV=1 sudo ./scripts/rocky-setup.sh # same as --install-dev
|
|
10
|
-
# sudo ./scripts/rocky-setup.sh --yes # skip prompts and assume defaults
|
|
11
9
|
|
|
12
10
|
PACKAGES=(
|
|
13
11
|
dnf-plugins-core
|
|
@@ -39,7 +37,6 @@ PACKAGES=(
|
|
|
39
37
|
|
|
40
38
|
# Defaults
|
|
41
39
|
INSTALL_DEV=0
|
|
42
|
-
ASSUME_YES=0
|
|
43
40
|
|
|
44
41
|
# Parse CLI args (simple)
|
|
45
42
|
while [[ $# -gt 0 ]]; do
|
|
@@ -52,10 +49,6 @@ while [[ $# -gt 0 ]]; do
|
|
|
52
49
|
INSTALL_DEV=0
|
|
53
50
|
shift
|
|
54
51
|
;;
|
|
55
|
-
--yes|-y|--assume-yes)
|
|
56
|
-
ASSUME_YES=1
|
|
57
|
-
shift
|
|
58
|
-
;;
|
|
59
52
|
--help|-h)
|
|
60
53
|
cat <<EOF
|
|
61
54
|
Usage: sudo ./scripts/rocky-setup.sh [options]
|
|
@@ -63,7 +56,6 @@ Usage: sudo ./scripts/rocky-setup.sh [options]
|
|
|
63
56
|
Options:
|
|
64
57
|
--install-dev, --yes-dev Install Development Tools group (gcc, make, etc.)
|
|
65
58
|
--no-install-dev Explicitly skip Development Tools
|
|
66
|
-
--yes, -y, --assume-yes Assume defaults / non-interactive
|
|
67
59
|
--help, -h Show this help and exit
|
|
68
60
|
|
|
69
61
|
You can also set the environment variable INSTALL_DEV=1 to enable development tools.
|
|
@@ -82,52 +74,34 @@ if [[ "${INSTALL_DEV:-}" =~ ^(1|y|yes|true)$ ]]; then
|
|
|
82
74
|
INSTALL_DEV=1
|
|
83
75
|
fi
|
|
84
76
|
|
|
85
|
-
# Helper: prompt unless ASSUME_YES
|
|
86
|
-
prompt_install_dev() {
|
|
87
|
-
if [[ $ASSUME_YES -eq 1 ]]; then
|
|
88
|
-
return 1 # means do NOT prompt (we treat ASSUME_YES as 'no' for optional install unless INSTALL_DEV set)
|
|
89
|
-
fi
|
|
90
|
-
|
|
91
|
-
read -r -p "Do you want to install the 'Development Tools' group (gcc, make, etc.)? [y/N]: " answer
|
|
92
|
-
if [[ "${answer,,}" == "y" || "${answer,,}" == "yes" ]]; then
|
|
93
|
-
return 0
|
|
94
|
-
fi
|
|
95
|
-
return 1
|
|
96
|
-
}
|
|
97
|
-
|
|
98
77
|
# Refresh cache and install basic packages
|
|
99
78
|
echo "[+] Refreshing DNF cache..."
|
|
100
|
-
|
|
79
|
+
dnf makecache --refresh -y
|
|
101
80
|
|
|
102
81
|
echo "[+] Installing dnf-plugins-core and epel-release (if not present)..."
|
|
103
|
-
|
|
82
|
+
dnf install dnf-plugins-core epel-release -y
|
|
104
83
|
|
|
105
84
|
echo "[+] Refreshing DNF cache after enabling repositories..."
|
|
106
|
-
|
|
85
|
+
dnf makecache --refresh -y
|
|
107
86
|
|
|
108
87
|
echo "[+] Installing base packages: ${#PACKAGES[@]} packages"
|
|
109
|
-
|
|
88
|
+
dnf install "${PACKAGES[@]}" -y
|
|
110
89
|
|
|
111
90
|
# Decide on Development Tools
|
|
112
91
|
if [[ $INSTALL_DEV -eq 1 ]]; then
|
|
113
|
-
echo "[+] Installing Development Tools
|
|
114
|
-
|
|
92
|
+
echo "[+] Installing Development Tools..."
|
|
93
|
+
dnf groupinstall "Development Tools" -y
|
|
115
94
|
else
|
|
116
|
-
|
|
117
|
-
echo "[+] Installing Development Tools (prompt confirmed)..."
|
|
118
|
-
sudo dnf -y groupinstall "Development Tools"
|
|
119
|
-
else
|
|
120
|
-
echo "[+] Skipping Development Tools. To auto-enable, run with --install-dev or set INSTALL_DEV=1"
|
|
121
|
-
fi
|
|
95
|
+
echo "[+] Skipping Development Tools. To enable, run with --install-dev or set INSTALL_DEV=1"
|
|
122
96
|
fi
|
|
123
97
|
|
|
124
98
|
echo "[+] Updating all packages to latest versions..."
|
|
125
|
-
|
|
99
|
+
dnf update -y --skip-broken --nobest
|
|
126
100
|
|
|
127
101
|
# Cleanup
|
|
128
102
|
echo "[+] Cleanup: remove unnecessary packages and old metadata"
|
|
129
|
-
|
|
130
|
-
|
|
103
|
+
dnf autoremove -y
|
|
104
|
+
dnf clean all
|
|
131
105
|
|
|
132
106
|
cat <<EOF
|
|
133
107
|
|
|
@@ -139,7 +113,6 @@ Installation complete.
|
|
|
139
113
|
Examples:
|
|
140
114
|
sudo ./scripts/rocky-setup.sh --install-dev
|
|
141
115
|
INSTALL_DEV=1 sudo ./scripts/rocky-setup.sh
|
|
142
|
-
sudo ./scripts/rocky-setup.sh --yes
|
|
143
116
|
|
|
144
117
|
Customize PACKAGES=(...) inside this script according to your needs (docker, podman, kube, mssql-tools, etc.).
|
|
145
118
|
EOF
|
|
@@ -129,7 +129,7 @@ const DocumentService = {
|
|
|
129
129
|
return filteredDoc;
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
-
return { data: sanitizedData
|
|
132
|
+
return { data: sanitizedData };
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
// OPTIMIZATION: Split search query into individual terms for multi-term matching
|
package/src/cli/cluster.js
CHANGED
|
@@ -249,15 +249,11 @@ class UnderpostCluster {
|
|
|
249
249
|
} else {
|
|
250
250
|
// Kind cluster initialization (if not using kubeadm or k3s)
|
|
251
251
|
logger.info('Initializing Kind cluster...');
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
options?.dev === true ? '-dev' : ''
|
|
258
|
-
}.yaml`,
|
|
259
|
-
);
|
|
260
|
-
}
|
|
252
|
+
shellExec(
|
|
253
|
+
`cd ${underpostRoot}/manifests && kind create cluster --config kind-config${
|
|
254
|
+
options?.dev === true ? '-dev' : ''
|
|
255
|
+
}.yaml`,
|
|
256
|
+
);
|
|
261
257
|
UnderpostCluster.API.chown('kind'); // Pass 'kind' to chown
|
|
262
258
|
}
|
|
263
259
|
} else if (options.worker === true) {
|
package/src/cli/repository.js
CHANGED
|
@@ -31,13 +31,13 @@ class UnderpostRepository {
|
|
|
31
31
|
/**
|
|
32
32
|
* Clones a Git repository from GitHub.
|
|
33
33
|
* @param {string} [gitUri=`${process.env.GITHUB_USERNAME}/pwa-microservices-template`] - The URI of the GitHub repository (e.g., "username/repository").
|
|
34
|
-
* @param {object} [options={ bare: false,
|
|
34
|
+
* @param {object} [options={ bare: false, G8: false }] - Cloning options.
|
|
35
35
|
* @param {boolean} [options.bare=false] - If true, performs a bare clone.
|
|
36
36
|
* @param {boolean} [options.g8=false] - If true, uses the .g8 extension.
|
|
37
37
|
* @memberof UnderpostRepository
|
|
38
38
|
*/
|
|
39
|
-
clone(gitUri = `${process.env.GITHUB_USERNAME}/pwa-microservices-template`, options = { bare: false,
|
|
40
|
-
const gExtension = options.
|
|
39
|
+
clone(gitUri = `${process.env.GITHUB_USERNAME}/pwa-microservices-template`, options = { bare: false, G8: false }) {
|
|
40
|
+
const gExtension = options.G8 === true ? '.g8' : '.git';
|
|
41
41
|
const repoName = gitUri.split('/').pop();
|
|
42
42
|
if (fs.existsSync(`./${repoName}`)) fs.removeSync(`./${repoName}`);
|
|
43
43
|
shellExec(
|
|
@@ -53,16 +53,16 @@ class UnderpostRepository {
|
|
|
53
53
|
* Pulls updates from a GitHub repository.
|
|
54
54
|
* @param {string} [repoPath='./'] - The local path to the repository.
|
|
55
55
|
* @param {string} [gitUri=`${process.env.GITHUB_USERNAME}/pwa-microservices-template`] - The URI of the GitHub repository.
|
|
56
|
-
* @param {object} [options={
|
|
56
|
+
* @param {object} [options={ G8: false }] - Pulling options.
|
|
57
57
|
* @param {boolean} [options.g8=false] - If true, uses the .g8 extension.
|
|
58
58
|
* @memberof UnderpostRepository
|
|
59
59
|
*/
|
|
60
60
|
pull(
|
|
61
61
|
repoPath = './',
|
|
62
62
|
gitUri = `${process.env.GITHUB_USERNAME}/pwa-microservices-template`,
|
|
63
|
-
options = {
|
|
63
|
+
options = { G8: false },
|
|
64
64
|
) {
|
|
65
|
-
const gExtension = options.
|
|
65
|
+
const gExtension = options.G8 === true ? '.g8' : '.git';
|
|
66
66
|
shellExec(
|
|
67
67
|
`cd ${repoPath} && git pull https://${
|
|
68
68
|
process.env.GITHUB_TOKEN ? `${process.env.GITHUB_TOKEN}@` : ''
|
|
@@ -201,7 +201,7 @@ class UnderpostRepository {
|
|
|
201
201
|
* Pushes commits to a remote GitHub repository.
|
|
202
202
|
* @param {string} [repoPath='./'] - The local path to the repository.
|
|
203
203
|
* @param {string} [gitUri=`${process.env.GITHUB_USERNAME}/pwa-microservices-template`] - The URI of the GitHub repository.
|
|
204
|
-
* @param {object} [options={ f: false,
|
|
204
|
+
* @param {object} [options={ f: false, G8: false }] - Push options.
|
|
205
205
|
* @param {boolean} [options.f=false] - If true, forces the push.
|
|
206
206
|
* @param {boolean} [options.g8=false] - If true, uses the .g8 extension.
|
|
207
207
|
* @memberof UnderpostRepository
|
|
@@ -209,9 +209,9 @@ class UnderpostRepository {
|
|
|
209
209
|
push(
|
|
210
210
|
repoPath = './',
|
|
211
211
|
gitUri = `${process.env.GITHUB_USERNAME}/pwa-microservices-template`,
|
|
212
|
-
options = { f: false,
|
|
212
|
+
options = { f: false, G8: false },
|
|
213
213
|
) {
|
|
214
|
-
const gExtension = options.
|
|
214
|
+
const gExtension = options.G8 === true ? '.g8' : '.git';
|
|
215
215
|
shellExec(
|
|
216
216
|
`cd ${repoPath} && git push https://${process.env.GITHUB_TOKEN}@github.com/${gitUri}${gExtension}${
|
|
217
217
|
options?.f === true ? ' --force' : ''
|