@dword-design/base-config-app 3.0.0 → 4.0.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/dist/get-ecosystem-config.js +1 -3
- package/dist/get-nginx-config.js +22 -0
- package/dist/index.js +56 -53
- package/package.json +7 -7
- package/dist/nginx-config.js +0 -22
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import hostedGitInfo from 'hosted-git-info';
|
|
3
|
-
import loadPkg from 'load-pkg';
|
|
4
3
|
import parseGitConfig from 'parse-git-config';
|
|
5
4
|
import parsePackagejsonName from 'parse-packagejson-name';
|
|
6
|
-
export default (
|
|
5
|
+
export default (packageConfig => {
|
|
7
6
|
var _parseGitConfig$sync$;
|
|
8
7
|
const repositoryUrl = fs.existsSync('.git') ? (_parseGitConfig$sync$ = parseGitConfig.sync()['remote "origin"']) === null || _parseGitConfig$sync$ === void 0 ? void 0 : _parseGitConfig$sync$.url : undefined;
|
|
9
8
|
const gitInfo = hostedGitInfo.fromUrl(repositoryUrl) || {};
|
|
10
9
|
if (repositoryUrl !== undefined && gitInfo.type !== 'github') {
|
|
11
10
|
throw new Error('Only GitHub repositories are supported.');
|
|
12
11
|
}
|
|
13
|
-
const packageConfig = loadPkg.sync();
|
|
14
12
|
const packageName = parsePackagejsonName(packageConfig.name).fullName;
|
|
15
13
|
return {
|
|
16
14
|
apps: [{
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import endent from "@dword-design/functions/dist/endent.js";
|
|
2
|
+
import parsePackagejsonName from 'parse-packagejson-name';
|
|
3
|
+
export default (packageConfig => {
|
|
4
|
+
const packageName = parsePackagejsonName(packageConfig.name).fullName;
|
|
5
|
+
return endent`
|
|
6
|
+
upstream web {
|
|
7
|
+
server web:3000;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
server {
|
|
11
|
+
listen 80;
|
|
12
|
+
server_name ${packageName}.test;
|
|
13
|
+
|
|
14
|
+
location / {
|
|
15
|
+
proxy_pass http://web;
|
|
16
|
+
proxy_set_header Host $host;
|
|
17
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
`;
|
|
22
|
+
});
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getBaseConfigNuxt from '@dword-design/base-config-nuxt';
|
|
2
2
|
import packageName from 'depcheck-package-name';
|
|
3
3
|
import { execaCommand } from 'execa';
|
|
4
4
|
import loadPkg from 'load-pkg';
|
|
@@ -6,58 +6,61 @@ import outputFiles from 'output-files';
|
|
|
6
6
|
import yaml from 'yaml';
|
|
7
7
|
import dockerCompose from "./docker-compose.js";
|
|
8
8
|
import getEcosystemConfig from "./get-ecosystem-config.js";
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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)
|
|
27
|
-
});
|
|
28
|
-
},
|
|
29
|
-
useJobMatrix: false,
|
|
30
|
-
...(!packageConfig.private && {
|
|
31
|
-
deployPlugins: [[packageName`@semantic-release/exec`, {
|
|
32
|
-
publishCmd: `${packageName`pm2`} deploy production --force`
|
|
33
|
-
}]],
|
|
34
|
-
preDeploySteps: [{
|
|
35
|
-
uses: 'webfactory/ssh-agent@v0.5.1',
|
|
36
|
-
with: {
|
|
37
|
-
'ssh-private-key': '${{ secrets.SSH_PRIVATE_KEY }}'
|
|
38
|
-
}
|
|
39
|
-
}, {
|
|
40
|
-
run: 'ssh-keyscan sebastianlandwehr.com >> ~/.ssh/known_hosts'
|
|
41
|
-
}]
|
|
42
|
-
}),
|
|
43
|
-
commands: {
|
|
44
|
-
...baseConfigNuxt.commands,
|
|
45
|
-
pull: {
|
|
46
|
-
arguments: '<endpoint>',
|
|
47
|
-
handler: endpoint => execaCommand(`ceiling pull ${endpoint}`, {
|
|
48
|
-
stdio: 'inherit'
|
|
49
|
-
})
|
|
9
|
+
import getNginxConfig from "./get-nginx-config.js";
|
|
10
|
+
export default (config => {
|
|
11
|
+
const baseConfigNuxt = getBaseConfigNuxt(config);
|
|
12
|
+
const packageConfig = loadPkg.sync();
|
|
13
|
+
return {
|
|
14
|
+
...baseConfigNuxt,
|
|
15
|
+
allowedMatches: [...baseConfigNuxt.allowedMatches, 'docker-compose.yml', 'ecosystem.json', 'nginx'],
|
|
16
|
+
editorIgnore: [...baseConfigNuxt.editorIgnore, 'docker-compose.yml', 'ecosystem.json', 'nginx'],
|
|
17
|
+
gitignore: [...baseConfigNuxt.gitignore, '/.ceilingrc.json', '/nginx/default.config'],
|
|
18
|
+
isLockFileFixCommitType: true,
|
|
19
|
+
npmPublish: false,
|
|
20
|
+
packageConfig: {
|
|
21
|
+
main: 'dist/index.js'
|
|
50
22
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
23
|
+
prepare: async () => {
|
|
24
|
+
await baseConfigNuxt.prepare();
|
|
25
|
+
return outputFiles({
|
|
26
|
+
'docker-compose.yml': yaml.stringify(dockerCompose),
|
|
27
|
+
'ecosystem.json': JSON.stringify(getEcosystemConfig(packageConfig), undefined, 2),
|
|
28
|
+
'nginx/default.config': JSON.stringify(getNginxConfig(packageConfig), undefined, 2)
|
|
29
|
+
});
|
|
56
30
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
31
|
+
useJobMatrix: false,
|
|
32
|
+
...(!packageConfig.private && {
|
|
33
|
+
deployPlugins: [[packageName`@semantic-release/exec`, {
|
|
34
|
+
publishCmd: `${packageName`pm2`} deploy production --force`
|
|
35
|
+
}]],
|
|
36
|
+
preDeploySteps: [{
|
|
37
|
+
uses: 'webfactory/ssh-agent@v0.5.1',
|
|
38
|
+
with: {
|
|
39
|
+
'ssh-private-key': '${{ secrets.SSH_PRIVATE_KEY }}'
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
run: 'ssh-keyscan sebastianlandwehr.com >> ~/.ssh/known_hosts'
|
|
43
|
+
}]
|
|
44
|
+
}),
|
|
45
|
+
commands: {
|
|
46
|
+
...baseConfigNuxt.commands,
|
|
47
|
+
pull: {
|
|
48
|
+
arguments: '<endpoint>',
|
|
49
|
+
handler: endpoint => execaCommand(`ceiling pull ${endpoint}`, {
|
|
50
|
+
stdio: 'inherit'
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
push: {
|
|
54
|
+
arguments: '<endpoint>',
|
|
55
|
+
handler: endpoint => execaCommand(`ceiling push ${endpoint}`, {
|
|
56
|
+
stdio: 'inherit'
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
setupDeploy: {
|
|
60
|
+
handler: () => execaCommand('pm2 deploy production setup', {
|
|
61
|
+
stdio: 'inherit'
|
|
62
|
+
})
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
65
|
+
};
|
|
66
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"repository": "dword-design/base-config-app",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"test": "base test"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dword-design/base-config-nuxt": "^
|
|
26
|
-
"@dword-design/functions": "^
|
|
27
|
-
"@semantic-release/exec": "^
|
|
28
|
-
"ceiling": "^
|
|
29
|
-
"depcheck-package-name": "^3.0.
|
|
25
|
+
"@dword-design/base-config-nuxt": "^5.0.0",
|
|
26
|
+
"@dword-design/functions": "^5.0.20",
|
|
27
|
+
"@semantic-release/exec": "^6.0.3",
|
|
28
|
+
"ceiling": "^4.0.0",
|
|
29
|
+
"depcheck-package-name": "^3.0.1",
|
|
30
30
|
"execa": "^7.1.1",
|
|
31
31
|
"fs-extra": "^11.1.1",
|
|
32
32
|
"hosted-git-info": "^6.1.1",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@dword-design/tester": "^2.0.9",
|
|
44
44
|
"@dword-design/tester-plugin-puppeteer": "^2.1.19",
|
|
45
45
|
"@dword-design/tester-plugin-tmp-dir": "^2.1.3",
|
|
46
|
-
"
|
|
46
|
+
"nuxt-dev-ready": "^2.0.1",
|
|
47
47
|
"tree-kill-promise": "^3.0.14"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
package/dist/nginx-config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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`
|
|
7
|
-
upstream web {
|
|
8
|
-
server web:3000;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
server {
|
|
12
|
-
listen 80;
|
|
13
|
-
server_name ${packageName}.test;
|
|
14
|
-
|
|
15
|
-
location / {
|
|
16
|
-
proxy_pass http://web;
|
|
17
|
-
proxy_set_header Host $host;
|
|
18
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
`;
|