underpost 2.8.451 → 2.8.453
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/.github/workflows/ghpkg.yml +13 -46
- package/.github/workflows/npmpkg.yml +67 -0
- package/.github/workflows/publish.yml +5 -5
- package/.github/workflows/pwa-microservices-template.page.yml +3 -2
- package/.github/workflows/pwa-microservices-template.test.yml +2 -2
- package/bin/build.js +9 -3
- package/bin/deploy.js +1 -1
- package/bin/file.js +1 -0
- package/bin/index.js +9 -0
- package/docker-compose.yml +1 -1
- package/package.json +9 -3
- package/src/cli/image.js +1 -1
- package/src/cli/repository.js +5 -3
- package/src/index.js +1 -1
|
@@ -9,47 +9,6 @@ permissions:
|
|
|
9
9
|
packages: write
|
|
10
10
|
id-token: write
|
|
11
11
|
jobs:
|
|
12
|
-
pwa-microservices-template:
|
|
13
|
-
if: github.repository == 'underpostnet/engine' && startsWith(github.event.head_commit.message, 'ci(package-pwa-microservices-template)')
|
|
14
|
-
name: Update github repo package Jobs
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
permissions:
|
|
17
|
-
contents: write
|
|
18
|
-
packages: write
|
|
19
|
-
id-token: write
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v3
|
|
22
|
-
|
|
23
|
-
- uses: actions/setup-node@v4
|
|
24
|
-
with:
|
|
25
|
-
node-version: '22.x'
|
|
26
|
-
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: |
|
|
29
|
-
npm install
|
|
30
|
-
|
|
31
|
-
- name: Set git credentials
|
|
32
|
-
run: |
|
|
33
|
-
git config --global credential.helper ""
|
|
34
|
-
git config credential.helper ""
|
|
35
|
-
git config --global user.name 'underpostnet'
|
|
36
|
-
git config --global user.email 'development@underpost.net'
|
|
37
|
-
git config --global credential.interactive always
|
|
38
|
-
git config user.name 'underpostnet'
|
|
39
|
-
git config user.email 'development@underpost.net'
|
|
40
|
-
git config credential.interactive always
|
|
41
|
-
|
|
42
|
-
- name: Clone github package repository
|
|
43
|
-
run: |
|
|
44
|
-
cd .. && git clone https://github.com/underpostnet/pwa-microservices-template.git
|
|
45
|
-
cd engine
|
|
46
|
-
npm run update-template
|
|
47
|
-
cd ../pwa-microservices-template
|
|
48
|
-
git remote set-url origin git@github.com:underpostnet/pwa-microservices-template.git
|
|
49
|
-
git add .
|
|
50
|
-
git commit -m "ci(package-pwa-microservices-template-ghpkg): ⚙️ Update github repo package"
|
|
51
|
-
git push https://${{ secrets.GIT_AUTH_TOKEN }}@github.com/underpostnet/pwa-microservices-template.git
|
|
52
|
-
|
|
53
12
|
pwa-microservices-template-ghpk:
|
|
54
13
|
if: github.repository == 'underpostnet/pwa-microservices-template' && startsWith(github.event.head_commit.message, 'ci(package-pwa-microservices-template-ghpkg)')
|
|
55
14
|
name: Update github repo package Jobs
|
|
@@ -63,7 +22,7 @@ jobs:
|
|
|
63
22
|
|
|
64
23
|
- uses: actions/setup-node@v4
|
|
65
24
|
with:
|
|
66
|
-
node-version: '
|
|
25
|
+
node-version: '23.x'
|
|
67
26
|
|
|
68
27
|
# - name: Get npm root
|
|
69
28
|
# run: sudo npm root -g
|
|
@@ -82,13 +41,15 @@ jobs:
|
|
|
82
41
|
|
|
83
42
|
- name: Install dependencies and set repo configuration
|
|
84
43
|
run: |
|
|
85
|
-
npm install
|
|
44
|
+
npm install -g underpost
|
|
45
|
+
underpost config set GITHUB_TOKEN ${{ secrets.GIT_AUTH_TOKEN }}
|
|
46
|
+
underpost install
|
|
86
47
|
node ./bin/deploy rename-package @underpostnet/underpost
|
|
87
48
|
node ./bin/deploy set-repo underpostnet/pwa-microservices-template-ghpkg
|
|
88
49
|
|
|
89
50
|
- name: Clone github package repository
|
|
90
51
|
run: |
|
|
91
|
-
|
|
52
|
+
underpost clone --bare underpostnet/pwa-microservices-template-ghpkg
|
|
92
53
|
rm -rf ./.git
|
|
93
54
|
cp -rf -a ./pwa-microservices-template-ghpkg.git ./.git
|
|
94
55
|
rm -rf ./pwa-microservices-template-ghpkg.git
|
|
@@ -111,8 +72,14 @@ jobs:
|
|
|
111
72
|
git status
|
|
112
73
|
git remote set-url origin git@github.com:underpostnet/pwa-microservices-template-ghpkg.git
|
|
113
74
|
git add .
|
|
114
|
-
|
|
115
|
-
|
|
75
|
+
underpost cmt . ci package-pwa-microservices-template-ghpkg 'Update github repo package'
|
|
76
|
+
underpost push . underpostnet/pwa-microservices-template-ghpkg
|
|
77
|
+
|
|
78
|
+
# git clone --bare https://github.com/underpostnet/engine.git
|
|
79
|
+
# mkdir engine
|
|
80
|
+
# mv ./engine.git ./engine/.git
|
|
81
|
+
# cd engine
|
|
82
|
+
# git init
|
|
116
83
|
|
|
117
84
|
# git push -u origin https://${{ secrets.GIT_AUTH_TOKEN }}@github.com/underpostnet/pwa-microservices-template-ghpkg.git
|
|
118
85
|
# git push -u origin master
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: Update npm repo package
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: ['master']
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: ['master']
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
packages: write
|
|
10
|
+
id-token: write
|
|
11
|
+
jobs:
|
|
12
|
+
pwa-microservices-template:
|
|
13
|
+
if: github.repository == 'underpostnet/engine' && startsWith(github.event.head_commit.message, 'ci(package-pwa-microservices-template)')
|
|
14
|
+
name: Update npm repo package Jobs
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write
|
|
18
|
+
packages: write
|
|
19
|
+
id-token: write
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v3
|
|
22
|
+
|
|
23
|
+
- uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: '23.x'
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: |
|
|
29
|
+
npm install -g underpost
|
|
30
|
+
underpost config set GITHUB_TOKEN ${{ secrets.GIT_AUTH_TOKEN }}
|
|
31
|
+
underpost install
|
|
32
|
+
|
|
33
|
+
- name: Set git credentials
|
|
34
|
+
run: |
|
|
35
|
+
git config --global credential.helper ""
|
|
36
|
+
git config credential.helper ""
|
|
37
|
+
git config --global user.name 'underpostnet'
|
|
38
|
+
git config --global user.email 'development@underpost.net'
|
|
39
|
+
git config --global credential.interactive always
|
|
40
|
+
git config user.name 'underpostnet'
|
|
41
|
+
git config user.email 'development@underpost.net'
|
|
42
|
+
git config credential.interactive always
|
|
43
|
+
|
|
44
|
+
- name: Clone github package repository
|
|
45
|
+
run: |
|
|
46
|
+
cd .. && underpost clone underpostnet/pwa-microservices-template
|
|
47
|
+
cd engine
|
|
48
|
+
npm run update-template
|
|
49
|
+
cd ../pwa-microservices-template
|
|
50
|
+
git remote set-url origin git@github.com:underpostnet/pwa-microservices-template.git
|
|
51
|
+
git add .
|
|
52
|
+
underpost cmt . ci package-pwa-microservices-template-ghpkg 'Update npm repo package'
|
|
53
|
+
underpost push . underpostnet/pwa-microservices-template
|
|
54
|
+
# cd ../engine
|
|
55
|
+
# git commit --allow-empty -m "ci(engine-core-repo-build): ⚙️ Update engine core repository"
|
|
56
|
+
# git commit --allow-empty -m "ci(engine-cyberia-repo-build): ⚙️ Update engine cyberia repository"
|
|
57
|
+
# git commit --allow-empty -m "ci(engine-lampp-repo-build): ⚙️ Update engine lampp repository"
|
|
58
|
+
# git push https://${{ secrets.GIT_AUTH_TOKEN }}@github.com/underpostnet/engine.git
|
|
59
|
+
|
|
60
|
+
# git clone --bare https://github.com/underpostnet/engine.git
|
|
61
|
+
# mkdir engine
|
|
62
|
+
# mv ./engine.git ./engine/.git
|
|
63
|
+
# cd engine
|
|
64
|
+
# git init
|
|
65
|
+
|
|
66
|
+
# git push -u origin https://${{ secrets.GIT_AUTH_TOKEN }}@github.com/underpostnet/pwa-microservices-template-ghpkg.git
|
|
67
|
+
# git push -u origin master
|
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
- uses: actions/checkout@v4
|
|
15
15
|
- uses: actions/setup-node@v4
|
|
16
16
|
with:
|
|
17
|
-
node-version: '
|
|
17
|
+
node-version: '23.x'
|
|
18
18
|
registry-url: 'https://registry.npmjs.org'
|
|
19
19
|
|
|
20
20
|
- name: Install Dependencies
|
|
@@ -25,7 +25,7 @@ jobs:
|
|
|
25
25
|
# Publish to npm
|
|
26
26
|
- uses: actions/setup-node@v4
|
|
27
27
|
with:
|
|
28
|
-
node-version: '
|
|
28
|
+
node-version: '23.x'
|
|
29
29
|
registry-url: 'https://registry.npmjs.org'
|
|
30
30
|
# Defaults to the user or organization that owns the workflow file
|
|
31
31
|
# scope: '@underpostnet'
|
|
@@ -45,7 +45,7 @@ jobs:
|
|
|
45
45
|
- uses: actions/checkout@v4
|
|
46
46
|
- uses: actions/setup-node@v4
|
|
47
47
|
with:
|
|
48
|
-
node-version: '
|
|
48
|
+
node-version: '23.x'
|
|
49
49
|
registry-url: 'https://registry.npmjs.org'
|
|
50
50
|
|
|
51
51
|
- name: Install Dependencies
|
|
@@ -56,7 +56,7 @@ jobs:
|
|
|
56
56
|
# Publish to npm git hub package
|
|
57
57
|
- uses: actions/setup-node@v4
|
|
58
58
|
with:
|
|
59
|
-
node-version: '
|
|
59
|
+
node-version: '23.x'
|
|
60
60
|
registry-url: 'https://registry.npmjs.org'
|
|
61
61
|
# Defaults to the user or organization that owns the workflow file
|
|
62
62
|
scope: '@underpostnet'
|
|
@@ -70,7 +70,7 @@ jobs:
|
|
|
70
70
|
- name: Setup node to publish to GitHub Packages
|
|
71
71
|
uses: actions/setup-node@v4
|
|
72
72
|
with:
|
|
73
|
-
node-version:
|
|
73
|
+
node-version: 23.x
|
|
74
74
|
registry-url: 'https://npm.pkg.github.com'
|
|
75
75
|
# Defaults to the user or organization that owns the workflow file
|
|
76
76
|
scope: '@underpostnet'
|
|
@@ -38,11 +38,12 @@ jobs:
|
|
|
38
38
|
# run: git lfs checkout
|
|
39
39
|
- uses: actions/setup-node@v4
|
|
40
40
|
with:
|
|
41
|
-
node-version: '
|
|
41
|
+
node-version: '23.x'
|
|
42
42
|
|
|
43
43
|
- name: Build the site
|
|
44
44
|
run: |
|
|
45
|
-
npm install
|
|
45
|
+
npm install -g underpost
|
|
46
|
+
underpost install
|
|
46
47
|
node bin/deploy update-default-conf ghpkg
|
|
47
48
|
env-cmd -f .env.production node bin/deploy build-full-client github-pages underpostnet.github.io /pwa-microservices-template-ghpkg
|
|
48
49
|
# git lfs install
|
|
@@ -2,12 +2,12 @@ name: Test
|
|
|
2
2
|
on: [push]
|
|
3
3
|
jobs:
|
|
4
4
|
test:
|
|
5
|
-
if: (github.repository == 'underpostnet/pwa-microservices-template') || (github.repository == 'underpostnet/pwa-microservices-template-ghpkg')
|
|
5
|
+
# if: (github.repository == 'underpostnet/pwa-microservices-template') || (github.repository == 'underpostnet/pwa-microservices-template-ghpkg')
|
|
6
6
|
name: Node ${{ matrix.node }} on ${{ matrix.os }}
|
|
7
7
|
runs-on: ${{ matrix.os }}
|
|
8
8
|
strategy:
|
|
9
9
|
matrix:
|
|
10
|
-
node-version: [
|
|
10
|
+
node-version: [23.x]
|
|
11
11
|
os: [ubuntu-latest]
|
|
12
12
|
# os: [ubuntu-latest, windows-latest]
|
|
13
13
|
|
package/bin/build.js
CHANGED
|
@@ -292,16 +292,16 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
292
292
|
if (!fs.existsSync(`${basePath}/images`)) fs.mkdirSync(`${basePath}/images`);
|
|
293
293
|
|
|
294
294
|
const env = process.argv.includes('development') ? 'development' : 'production';
|
|
295
|
-
|
|
295
|
+
const deploymentsFiles = ['Dockerfile', 'proxy.yaml', 'deployment.yaml', 'secret.yaml'];
|
|
296
296
|
// remove engine-private of .dockerignore for local testing
|
|
297
297
|
|
|
298
|
-
{
|
|
298
|
+
if (process.argv.includes('engine')) {
|
|
299
299
|
fs.removeSync(`${basePath}/manifests/deployment`);
|
|
300
300
|
|
|
301
301
|
if (!fs.existsSync(`./manifests/deployment/${confName}-${env}`))
|
|
302
302
|
fs.mkdirSync(`./manifests/deployment/${confName}-${env}`);
|
|
303
303
|
|
|
304
|
-
for (const file of
|
|
304
|
+
for (const file of deploymentsFiles) {
|
|
305
305
|
if (fs.existsSync(`./engine-private/conf/${confName}/build/${env}/${file}`)) {
|
|
306
306
|
fs.copyFileSync(`./engine-private/conf/${confName}/build/${env}/${file}`, `${basePath}/${file}`);
|
|
307
307
|
fs.copyFileSync(
|
|
@@ -310,5 +310,11 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
+
} else {
|
|
314
|
+
for (const file of deploymentsFiles) {
|
|
315
|
+
if (fs.existsSync(`./manifests/deployment/${confName}-${env}/${file}`)) {
|
|
316
|
+
fs.copyFileSync(`./manifests/deployment/${confName}-${env}/${file}`, `${basePath}/${file}`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
313
319
|
}
|
|
314
320
|
}
|
package/bin/deploy.js
CHANGED
|
@@ -2,7 +2,6 @@ import fs from 'fs-extra';
|
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
|
|
4
4
|
import dotenv from 'dotenv';
|
|
5
|
-
import plantuml from 'plantuml';
|
|
6
5
|
|
|
7
6
|
import { pbcopy, shellCd, shellExec } from '../src/server/process.js';
|
|
8
7
|
import { loggerFactory } from '../src/server/logger.js';
|
|
@@ -591,6 +590,7 @@ try {
|
|
|
591
590
|
}
|
|
592
591
|
case 'build-uml':
|
|
593
592
|
{
|
|
593
|
+
const plantuml = await import('plantuml');
|
|
594
594
|
const folder = process.argv[3] ? process.argv[3] : `./src/client/public/default/plantuml`;
|
|
595
595
|
const confData = Config.default;
|
|
596
596
|
|
package/bin/file.js
CHANGED
package/bin/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { getNpmRootPath, loadConf } from '../src/server/conf.js';
|
|
|
8
8
|
import fs from 'fs-extra';
|
|
9
9
|
import { commitData } from '../src/client/components/core/CommonJs.js';
|
|
10
10
|
import UnderpostScript from '../src/cli/script.js';
|
|
11
|
+
import { shellExec } from '../src/server/process.js';
|
|
11
12
|
|
|
12
13
|
const npmRoot = getNpmRootPath();
|
|
13
14
|
const underpostRoot = `${npmRoot}/underpost/.env`;
|
|
@@ -28,6 +29,7 @@ program
|
|
|
28
29
|
program
|
|
29
30
|
.command('clone')
|
|
30
31
|
.argument(`<uri>`, 'e.g. username/repository')
|
|
32
|
+
.option('--bare', 'Clone only .git files')
|
|
31
33
|
.description('Clone github repository')
|
|
32
34
|
.action(Underpost.repo.clone);
|
|
33
35
|
|
|
@@ -130,6 +132,13 @@ program
|
|
|
130
132
|
.description('Pull underpost dockerfile images requirements')
|
|
131
133
|
.action(Underpost.image.dockerfile.pullBaseImages);
|
|
132
134
|
|
|
135
|
+
program
|
|
136
|
+
.command('install')
|
|
137
|
+
.description('Fast import underpost npm dependencies')
|
|
138
|
+
.action(() => {
|
|
139
|
+
fs.copySync(`${npmRoot}/underpost/node_modules`, './node_modules');
|
|
140
|
+
});
|
|
141
|
+
|
|
133
142
|
program
|
|
134
143
|
.command('script')
|
|
135
144
|
.argument('operator', `Options: ${Object.keys(UnderpostScript.API)}`)
|
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "underpost",
|
|
5
|
-
"version": "2.8.
|
|
5
|
+
"version": "2.8.453",
|
|
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",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"docs": "jsdoc -c jsdoc.json",
|
|
17
17
|
"install-global": "npm install -g pm2 && npm install -g jsdoc && npm install -g prettier && npm install -g env-cmd && npm install -g yarn && npm install -g auto-changelog",
|
|
18
18
|
"install-test": "npm install -g mocha && npm install -g c8 && npm install -g nyc && npm install -g coveralls",
|
|
19
|
+
"install-underpost": "cp -a $(npm root -g)/underpost/node_modules ./node_modules && npm install --only=dev --ignore-scripts",
|
|
19
20
|
"install": "npm run install-global && npm run install-test",
|
|
20
21
|
"docker:start": "docker-compose up",
|
|
21
22
|
"prettier": "prettier --write .",
|
|
@@ -105,12 +106,17 @@
|
|
|
105
106
|
"uglify-js": "^3.17.4",
|
|
106
107
|
"validator": "^13.11.0",
|
|
107
108
|
"vanilla-jsoneditor": "^2.3.2",
|
|
108
|
-
"winston": "^3.11.0"
|
|
109
|
+
"winston": "^3.11.0",
|
|
110
|
+
"clean-jsdoc-theme": "^4.3.0",
|
|
111
|
+
"easy-json-schema": "^0.0.2-beta",
|
|
112
|
+
"mocha": "^10.8.2",
|
|
113
|
+
"plantuml": "^0.0.2",
|
|
114
|
+
"swagger-autogen": "^2.23.7"
|
|
109
115
|
},
|
|
110
116
|
"devDependencies": {
|
|
111
117
|
"clean-jsdoc-theme": "^4.3.0",
|
|
112
118
|
"easy-json-schema": "^0.0.2-beta",
|
|
113
|
-
"mocha": "^10.
|
|
119
|
+
"mocha": "^10.8.2",
|
|
114
120
|
"plantuml": "^0.0.2",
|
|
115
121
|
"swagger-autogen": "^2.23.7"
|
|
116
122
|
},
|
package/src/cli/image.js
CHANGED
|
@@ -19,7 +19,7 @@ class UnderpostImage {
|
|
|
19
19
|
const imagesStoragePath = `./images`;
|
|
20
20
|
const tarFile = `${imagesStoragePath}/${imgName.replace(':', '_')}.tar`;
|
|
21
21
|
|
|
22
|
-
let secrets = '';
|
|
22
|
+
let secrets = ' ';
|
|
23
23
|
let secretDockerInput = '';
|
|
24
24
|
|
|
25
25
|
const envObj = dotenv.parse(fs.readFileSync(`${getNpmRootPath()}/underpost/.env`, 'utf8'));
|
package/src/cli/repository.js
CHANGED
|
@@ -11,11 +11,13 @@ const logger = loggerFactory(import.meta);
|
|
|
11
11
|
|
|
12
12
|
class UnderpostRepository {
|
|
13
13
|
static API = {
|
|
14
|
-
clone(gitUri = 'underpostnet/pwa-microservices-template') {
|
|
14
|
+
clone(gitUri = 'underpostnet/pwa-microservices-template', options = { bare: false }) {
|
|
15
15
|
const repoName = gitUri.split('/').pop();
|
|
16
16
|
if (fs.existsSync(`./${repoName}`)) fs.removeSync(`./${repoName}`);
|
|
17
17
|
return shellExec(
|
|
18
|
-
`git clone
|
|
18
|
+
`git clone ${options?.bare === true ? ` --bare ` : ''}https://${
|
|
19
|
+
process.env.GITHUB_TOKEN ? `${process.env.GITHUB_TOKEN}@` : ''
|
|
20
|
+
}github.com/${gitUri}.git`,
|
|
19
21
|
{
|
|
20
22
|
disableLog: true,
|
|
21
23
|
},
|
|
@@ -92,7 +94,7 @@ class UnderpostRepository {
|
|
|
92
94
|
if (fs.existsSync(`${destFolder}/node_modules`)) fs.removeSync(`${destFolder}/node_modules`);
|
|
93
95
|
fs.writeFileSync(`${destFolder}/.gitignore`, fs.readFileSync(`${exeRootPath}/.dockerignore`, 'utf8'), 'utf8');
|
|
94
96
|
shellExec(`cd ${destFolder} && git init && git add . && git commit -m "Base template implementation"`);
|
|
95
|
-
shellExec(`cd ${destFolder} &&
|
|
97
|
+
shellExec(`cd ${destFolder} && underpost install`);
|
|
96
98
|
shellExec(`cd ${destFolder} && npm run build`);
|
|
97
99
|
shellExec(`cd ${destFolder} && npm run dev`);
|
|
98
100
|
return resolve();
|