@dword-design/base-config-app 2.0.16 → 2.0.18
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/dist/docker-compose.js +2 -10
- package/dist/get-ecosystem-config.js +36 -0
- package/dist/index.js +28 -47
- package/dist/nginx-config.js +7 -24
- package/package.json +7 -6
- package/dist/ecosystem.js +0 -54
package/dist/docker-compose.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
1
|
+
export default {
|
|
8
2
|
services: {
|
|
9
3
|
proxy: {
|
|
10
4
|
depends_on: ['web'],
|
|
@@ -22,6 +16,4 @@ var _default = {
|
|
|
22
16
|
}
|
|
23
17
|
},
|
|
24
18
|
version: '3'
|
|
25
|
-
};
|
|
26
|
-
exports.default = _default;
|
|
27
|
-
module.exports = exports.default;
|
|
19
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import hostedGitInfo from 'hosted-git-info';
|
|
3
|
+
import loadPkg from 'load-pkg';
|
|
4
|
+
import parseGitConfig from 'parse-git-config';
|
|
5
|
+
import parsePackagejsonName from 'parse-packagejson-name';
|
|
6
|
+
export default (() => {
|
|
7
|
+
var _parseGitConfig$sync$;
|
|
8
|
+
const repositoryUrl = fs.existsSync('.git') ? (_parseGitConfig$sync$ = parseGitConfig.sync()['remote "origin"']) === null || _parseGitConfig$sync$ === void 0 ? void 0 : _parseGitConfig$sync$.url : undefined;
|
|
9
|
+
const gitInfo = hostedGitInfo.fromUrl(repositoryUrl) || {};
|
|
10
|
+
if (repositoryUrl !== undefined && gitInfo.type !== 'github') {
|
|
11
|
+
throw new Error('Only GitHub repositories are supported.');
|
|
12
|
+
}
|
|
13
|
+
const packageConfig = loadPkg.sync();
|
|
14
|
+
const packageName = parsePackagejsonName(packageConfig.name).fullName;
|
|
15
|
+
return {
|
|
16
|
+
apps: [{
|
|
17
|
+
args: 'start',
|
|
18
|
+
exec_mode: 'cluster',
|
|
19
|
+
instances: 'max',
|
|
20
|
+
name: packageName,
|
|
21
|
+
script: 'npm'
|
|
22
|
+
}],
|
|
23
|
+
deploy: {
|
|
24
|
+
production: {
|
|
25
|
+
host: ['sebastianlandwehr.com'],
|
|
26
|
+
path: `/var/www/${packageName}`,
|
|
27
|
+
user: 'root',
|
|
28
|
+
...(repositoryUrl && {
|
|
29
|
+
repo: `git@github.com:${gitInfo.user}/${gitInfo.project}.git`
|
|
30
|
+
}),
|
|
31
|
+
'post-deploy': 'source ~/.nvm/nvm.sh && yarn --frozen-lockfile && yarn prepublishOnly && pm2 startOrReload ecosystem.json',
|
|
32
|
+
ref: 'origin/master'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
});
|
package/dist/index.js
CHANGED
|
@@ -1,53 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _outputFiles = _interopRequireDefault(require("output-files"));
|
|
17
|
-
|
|
18
|
-
var _yaml = _interopRequireDefault(require("yaml"));
|
|
19
|
-
|
|
20
|
-
var _dockerCompose = _interopRequireDefault(require("./docker-compose"));
|
|
21
|
-
|
|
22
|
-
var _ecosystem = _interopRequireDefault(require("./ecosystem"));
|
|
23
|
-
|
|
24
|
-
var _nginxConfig = _interopRequireDefault(require("./nginx-config"));
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
|
|
28
|
-
const packageConfig = _loadPkg.default.sync();
|
|
29
|
-
|
|
30
|
-
var _default = { ..._baseConfigNuxt.default,
|
|
31
|
-
allowedMatches: [..._baseConfigNuxt.default.allowedMatches, 'docker-compose.yml', 'ecosystem.json', 'nginx'],
|
|
32
|
-
editorIgnore: [..._baseConfigNuxt.default.editorIgnore, 'docker-compose.yml', 'ecosystem.json', 'nginx'],
|
|
33
|
-
gitignore: [..._baseConfigNuxt.default.gitignore, '/.ceilingrc.json', '/nginx/default.config'],
|
|
1
|
+
import baseConfigNuxt from '@dword-design/base-config-nuxt';
|
|
2
|
+
import packageName from 'depcheck-package-name';
|
|
3
|
+
import execa from 'execa';
|
|
4
|
+
import loadPkg from 'load-pkg';
|
|
5
|
+
import outputFiles from 'output-files';
|
|
6
|
+
import yaml from 'yaml';
|
|
7
|
+
import dockerCompose from "./docker-compose.js";
|
|
8
|
+
import getEcosystemConfig from "./get-ecosystem-config.js";
|
|
9
|
+
import nginxConfig from "./nginx-config.js";
|
|
10
|
+
const packageConfig = loadPkg.sync();
|
|
11
|
+
export default {
|
|
12
|
+
...baseConfigNuxt,
|
|
13
|
+
allowedMatches: [...baseConfigNuxt.allowedMatches, 'docker-compose.yml', 'ecosystem.json', 'nginx'],
|
|
14
|
+
editorIgnore: [...baseConfigNuxt.editorIgnore, 'docker-compose.yml', 'ecosystem.json', 'nginx'],
|
|
15
|
+
gitignore: [...baseConfigNuxt.gitignore, '/.ceilingrc.json', '/nginx/default.config'],
|
|
34
16
|
isLockFileFixCommitType: true,
|
|
35
17
|
npmPublish: false,
|
|
36
18
|
packageConfig: {
|
|
37
19
|
main: 'dist/index.js'
|
|
38
20
|
},
|
|
39
21
|
prepare: async () => {
|
|
40
|
-
await
|
|
41
|
-
return (
|
|
42
|
-
'docker-compose.yml':
|
|
43
|
-
'ecosystem.json': JSON.stringify(
|
|
44
|
-
'nginx/default.config': JSON.stringify(
|
|
22
|
+
await baseConfigNuxt.prepare();
|
|
23
|
+
return outputFiles({
|
|
24
|
+
'docker-compose.yml': yaml.stringify(dockerCompose),
|
|
25
|
+
'ecosystem.json': JSON.stringify(getEcosystemConfig(), undefined, 2),
|
|
26
|
+
'nginx/default.config': JSON.stringify(nginxConfig, undefined, 2)
|
|
45
27
|
});
|
|
46
28
|
},
|
|
47
29
|
useJobMatrix: false,
|
|
48
30
|
...(!packageConfig.private && {
|
|
49
|
-
deployPlugins: [[
|
|
50
|
-
publishCmd: `${
|
|
31
|
+
deployPlugins: [[packageName`@semantic-release/exec`, {
|
|
32
|
+
publishCmd: `${packageName`pm2`} deploy production --force`
|
|
51
33
|
}]],
|
|
52
34
|
preDeploySteps: [{
|
|
53
35
|
uses: 'webfactory/ssh-agent@v0.5.1',
|
|
@@ -58,25 +40,24 @@ var _default = { ..._baseConfigNuxt.default,
|
|
|
58
40
|
run: 'ssh-keyscan sebastianlandwehr.com >> ~/.ssh/known_hosts'
|
|
59
41
|
}]
|
|
60
42
|
}),
|
|
61
|
-
commands: {
|
|
43
|
+
commands: {
|
|
44
|
+
...baseConfigNuxt.commands,
|
|
62
45
|
pull: {
|
|
63
46
|
arguments: '<endpoint>',
|
|
64
|
-
handler: endpoint =>
|
|
47
|
+
handler: endpoint => execa.command(`ceiling pull ${endpoint}`, {
|
|
65
48
|
stdio: 'inherit'
|
|
66
49
|
})
|
|
67
50
|
},
|
|
68
51
|
push: {
|
|
69
52
|
arguments: '<endpoint>',
|
|
70
|
-
handler: endpoint =>
|
|
53
|
+
handler: endpoint => execa.command(`ceiling push ${endpoint}`, {
|
|
71
54
|
stdio: 'inherit'
|
|
72
55
|
})
|
|
73
56
|
},
|
|
74
57
|
setupDeploy: {
|
|
75
|
-
handler: () =>
|
|
58
|
+
handler: () => execa.command('pm2 deploy production setup', {
|
|
76
59
|
stdio: 'inherit'
|
|
77
60
|
})
|
|
78
61
|
}
|
|
79
62
|
}
|
|
80
|
-
};
|
|
81
|
-
exports.default = _default;
|
|
82
|
-
module.exports = exports.default;
|
|
63
|
+
};
|
package/dist/nginx-config.js
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _endent = _interopRequireDefault(require("@dword-design/functions/dist/endent"));
|
|
9
|
-
|
|
10
|
-
var _loadPkg = _interopRequireDefault(require("load-pkg"));
|
|
11
|
-
|
|
12
|
-
var _parsePackagejsonName = _interopRequireDefault(require("parse-packagejson-name"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
const packageConfig = _loadPkg.default.sync();
|
|
17
|
-
|
|
18
|
-
const packageName = (0, _parsePackagejsonName.default)(packageConfig.name).fullName;
|
|
19
|
-
|
|
20
|
-
var _default = (0, _endent.default)`
|
|
1
|
+
import endent from "@dword-design/functions/dist/endent.js";
|
|
2
|
+
import loadPkg from 'load-pkg';
|
|
3
|
+
import parsePackagejsonName from 'parse-packagejson-name';
|
|
4
|
+
const packageConfig = loadPkg.sync();
|
|
5
|
+
const packageName = parsePackagejsonName(packageConfig.name).fullName;
|
|
6
|
+
export default endent`
|
|
21
7
|
upstream web {
|
|
22
8
|
server web:3000;
|
|
23
9
|
}
|
|
@@ -33,7 +19,4 @@ var _default = (0, _endent.default)`
|
|
|
33
19
|
}
|
|
34
20
|
}
|
|
35
21
|
|
|
36
|
-
`;
|
|
37
|
-
|
|
38
|
-
exports.default = _default;
|
|
39
|
-
module.exports = exports.default;
|
|
22
|
+
`;
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-app",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18",
|
|
4
4
|
"repository": "dword-design/base-config-app",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Sebastian Landwehr <info@sebastianlandwehr.com>",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": "./dist/index.js",
|
|
8
10
|
"main": "dist/index.js",
|
|
9
11
|
"files": [
|
|
10
12
|
"dist"
|
|
@@ -12,6 +14,7 @@
|
|
|
12
14
|
"scripts": {
|
|
13
15
|
"checkUnknownFiles": "base checkUnknownFiles",
|
|
14
16
|
"commit": "base commit",
|
|
17
|
+
"depcheck": "base depcheck",
|
|
15
18
|
"dev": "base dev",
|
|
16
19
|
"lint": "base lint",
|
|
17
20
|
"prepare": "base prepare",
|
|
@@ -35,18 +38,16 @@
|
|
|
35
38
|
"yaml": "^1.10.0"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
|
-
"@dword-design/base": "^
|
|
39
|
-
"@dword-design/proxyquire": "^2.0.0",
|
|
41
|
+
"@dword-design/base": "^9.1.4",
|
|
40
42
|
"@dword-design/puppeteer": "^5.0.0",
|
|
41
43
|
"@dword-design/tester": "^2.0.9",
|
|
42
44
|
"@dword-design/tester-plugin-puppeteer": "^2.1.19",
|
|
43
45
|
"@dword-design/tester-plugin-tmp-dir": "^2.1.3",
|
|
44
46
|
"port-ready": "^0.1.0",
|
|
45
|
-
"tree-kill-promise": "^2.0.6"
|
|
46
|
-
"with-local-tmp-dir": "^4.0.0"
|
|
47
|
+
"tree-kill-promise": "^2.0.6"
|
|
47
48
|
},
|
|
48
49
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
50
|
+
"node": ">=14"
|
|
50
51
|
},
|
|
51
52
|
"publishConfig": {
|
|
52
53
|
"access": "public"
|
package/dist/ecosystem.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _fsExtra = require("fs-extra");
|
|
9
|
-
|
|
10
|
-
var _hostedGitInfo = _interopRequireDefault(require("hosted-git-info"));
|
|
11
|
-
|
|
12
|
-
var _loadPkg = _interopRequireDefault(require("load-pkg"));
|
|
13
|
-
|
|
14
|
-
var _parseGitConfig = _interopRequireDefault(require("parse-git-config"));
|
|
15
|
-
|
|
16
|
-
var _parsePackagejsonName = _interopRequireDefault(require("parse-packagejson-name"));
|
|
17
|
-
|
|
18
|
-
var _parseGitConfig$sync$;
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
const repositoryUrl = (0, _fsExtra.existsSync)('.git') ? (_parseGitConfig$sync$ = _parseGitConfig.default.sync()['remote "origin"']) === null || _parseGitConfig$sync$ === void 0 ? void 0 : _parseGitConfig$sync$.url : undefined;
|
|
23
|
-
const gitInfo = _hostedGitInfo.default.fromUrl(repositoryUrl) || {};
|
|
24
|
-
|
|
25
|
-
if (repositoryUrl !== undefined && gitInfo.type !== 'github') {
|
|
26
|
-
throw new Error('Only GitHub repositories are supported.');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const packageConfig = _loadPkg.default.sync();
|
|
30
|
-
|
|
31
|
-
const packageName = (0, _parsePackagejsonName.default)(packageConfig.name).fullName;
|
|
32
|
-
var _default = {
|
|
33
|
-
apps: [{
|
|
34
|
-
args: 'start',
|
|
35
|
-
exec_mode: 'cluster',
|
|
36
|
-
instances: 'max',
|
|
37
|
-
name: packageName,
|
|
38
|
-
script: 'npm'
|
|
39
|
-
}],
|
|
40
|
-
deploy: {
|
|
41
|
-
production: {
|
|
42
|
-
host: ['sebastianlandwehr.com'],
|
|
43
|
-
path: `/var/www/${packageName}`,
|
|
44
|
-
user: 'root',
|
|
45
|
-
...(repositoryUrl && {
|
|
46
|
-
repo: `git@github.com:${gitInfo.user}/${gitInfo.project}.git`
|
|
47
|
-
}),
|
|
48
|
-
'post-deploy': 'source ~/.nvm/nvm.sh && yarn --frozen-lockfile && yarn prepublishOnly && pm2 startOrReload ecosystem.json',
|
|
49
|
-
ref: 'origin/master'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
exports.default = _default;
|
|
54
|
-
module.exports = exports.default;
|