@dword-design/base-config-app 5.0.7 → 6.0.0
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/README.md +43 -43
- package/dist/docker-compose.d.ts +20 -0
- package/dist/docker-compose.js +10 -10
- package/dist/get-ecosystem-config.d.ts +15 -0
- package/dist/get-ecosystem-config.js +18 -18
- package/dist/get-nginx-config.d.ts +2 -0
- package/dist/get-nginx-config.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -25
- package/package.json +16 -9
package/README.md
CHANGED
|
@@ -3,49 +3,49 @@
|
|
|
3
3
|
<!-- /TITLE -->
|
|
4
4
|
|
|
5
5
|
<!-- BADGES/ -->
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://npmjs.org/package/@dword-design/base-config-app">
|
|
8
|
+
<img
|
|
9
|
+
src="https://img.shields.io/npm/v/@dword-design/base-config-app.svg"
|
|
10
|
+
alt="npm version"
|
|
11
|
+
>
|
|
12
|
+
</a><img src="https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue" alt="Linux macOS Windows compatible"><a href="https://github.com/dword-design/base-config-app/actions">
|
|
13
|
+
<img
|
|
14
|
+
src="https://github.com/dword-design/base-config-app/workflows/build/badge.svg"
|
|
15
|
+
alt="Build status"
|
|
16
|
+
>
|
|
17
|
+
</a><a href="https://codecov.io/gh/dword-design/base-config-app">
|
|
18
|
+
<img
|
|
19
|
+
src="https://codecov.io/gh/dword-design/base-config-app/branch/master/graph/badge.svg"
|
|
20
|
+
alt="Coverage status"
|
|
21
|
+
>
|
|
22
|
+
</a><a href="https://david-dm.org/dword-design/base-config-app">
|
|
23
|
+
<img src="https://img.shields.io/david/dword-design/base-config-app" alt="Dependency status">
|
|
24
|
+
</a><img src="https://img.shields.io/badge/renovate-enabled-brightgreen" alt="Renovate enabled"><br/><a href="https://gitpod.io/#https://github.com/dword-design/base-config-app">
|
|
25
|
+
<img
|
|
26
|
+
src="https://gitpod.io/button/open-in-gitpod.svg"
|
|
27
|
+
alt="Open in Gitpod"
|
|
28
|
+
width="114"
|
|
29
|
+
>
|
|
30
|
+
</a><a href="https://www.buymeacoffee.com/dword">
|
|
31
|
+
<img
|
|
32
|
+
src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg"
|
|
33
|
+
alt="Buy Me a Coffee"
|
|
34
|
+
width="114"
|
|
35
|
+
>
|
|
36
|
+
</a><a href="https://paypal.me/SebastianLandwehr">
|
|
37
|
+
<img
|
|
38
|
+
src="https://sebastianlandwehr.com/images/paypal.svg"
|
|
39
|
+
alt="PayPal"
|
|
40
|
+
width="163"
|
|
41
|
+
>
|
|
42
|
+
</a><a href="https://www.patreon.com/dworddesign">
|
|
43
|
+
<img
|
|
44
|
+
src="https://sebastianlandwehr.com/images/patreon.svg"
|
|
45
|
+
alt="Patreon"
|
|
46
|
+
width="163"
|
|
47
|
+
>
|
|
48
|
+
</a>
|
|
49
49
|
</p>
|
|
50
50
|
<!-- /BADGES -->
|
|
51
51
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
services: {
|
|
3
|
+
proxy: {
|
|
4
|
+
depends_on: string[];
|
|
5
|
+
image: string;
|
|
6
|
+
ports: string[];
|
|
7
|
+
volumes: string[];
|
|
8
|
+
};
|
|
9
|
+
web: {
|
|
10
|
+
command: string;
|
|
11
|
+
environment: string[];
|
|
12
|
+
image: string;
|
|
13
|
+
ports: string[];
|
|
14
|
+
volumes: string[];
|
|
15
|
+
working_dir: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
version: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
package/dist/docker-compose.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import nodejsVersion from
|
|
1
|
+
import nodejsVersion from "tagged-template-noop";
|
|
2
2
|
export default {
|
|
3
3
|
services: {
|
|
4
4
|
proxy: {
|
|
5
|
-
depends_on: [
|
|
6
|
-
image:
|
|
7
|
-
ports: [
|
|
8
|
-
volumes: [
|
|
5
|
+
depends_on: ["web"],
|
|
6
|
+
image: "nginx:1",
|
|
7
|
+
ports: ["80:80"],
|
|
8
|
+
volumes: ["./nginx:/etc/nginx/conf.d"]
|
|
9
9
|
},
|
|
10
10
|
web: {
|
|
11
11
|
command: 'bash -c "pnpm install --frozen-lockfile && pnpm dev"',
|
|
12
|
-
environment: [
|
|
12
|
+
environment: ["HOST=0.0.0.0"],
|
|
13
13
|
image: `node:${nodejsVersion`22`}`,
|
|
14
|
-
ports: [
|
|
15
|
-
volumes: [
|
|
16
|
-
working_dir:
|
|
14
|
+
ports: ["3000:3000"],
|
|
15
|
+
volumes: [".:/app", "/app/node_modules"],
|
|
16
|
+
working_dir: "/app"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
-
version:
|
|
19
|
+
version: "3"
|
|
20
20
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: (packageConfig: any, { cwd }?: {
|
|
2
|
+
cwd?: string | undefined;
|
|
3
|
+
}) => {
|
|
4
|
+
apps: {
|
|
5
|
+
args: string;
|
|
6
|
+
exec_mode: string;
|
|
7
|
+
instances: string;
|
|
8
|
+
name: any;
|
|
9
|
+
script: string;
|
|
10
|
+
}[];
|
|
11
|
+
deploy: {
|
|
12
|
+
production: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import pathLib from
|
|
2
|
-
import fs from
|
|
3
|
-
import hostedGitInfo from
|
|
4
|
-
import parseGitConfig from
|
|
5
|
-
import parsePackagejsonName from
|
|
1
|
+
import pathLib from "node:path";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import hostedGitInfo from "hosted-git-info";
|
|
4
|
+
import parseGitConfig from "parse-git-config";
|
|
5
|
+
import parsePackagejsonName from "parse-packagejson-name";
|
|
6
6
|
export default (packageConfig, {
|
|
7
|
-
cwd =
|
|
7
|
+
cwd = "."
|
|
8
8
|
} = {}) => {
|
|
9
|
-
const repositoryUrl = fs.existsSync(pathLib.join(cwd,
|
|
9
|
+
const repositoryUrl = fs.existsSync(pathLib.join(cwd, ".git")) ? parseGitConfig.sync({
|
|
10
10
|
cwd
|
|
11
|
-
})['remote "origin"']?.url :
|
|
11
|
+
})['remote "origin"']?.url : void 0;
|
|
12
12
|
const gitInfo = hostedGitInfo.fromUrl(repositoryUrl) || {};
|
|
13
|
-
if (repositoryUrl !==
|
|
14
|
-
throw new Error(
|
|
13
|
+
if (repositoryUrl !== void 0 && gitInfo.type !== "github") {
|
|
14
|
+
throw new Error("Only GitHub repositories are supported.");
|
|
15
15
|
}
|
|
16
16
|
const packageName = parsePackagejsonName(packageConfig.name).fullName;
|
|
17
17
|
return {
|
|
18
18
|
apps: [{
|
|
19
|
-
args:
|
|
20
|
-
exec_mode:
|
|
21
|
-
instances:
|
|
19
|
+
args: "start",
|
|
20
|
+
exec_mode: "cluster",
|
|
21
|
+
instances: "max",
|
|
22
22
|
name: packageName,
|
|
23
|
-
script:
|
|
23
|
+
script: "npm"
|
|
24
24
|
}],
|
|
25
25
|
deploy: {
|
|
26
26
|
production: {
|
|
27
|
-
host: [
|
|
27
|
+
host: ["sebastianlandwehr.com"],
|
|
28
28
|
path: `/var/www/${packageName}`,
|
|
29
|
-
user:
|
|
29
|
+
user: "root",
|
|
30
30
|
...(repositoryUrl && {
|
|
31
31
|
repo: `git@github.com:${gitInfo.user}/${gitInfo.project}.git`
|
|
32
32
|
}),
|
|
33
|
-
|
|
34
|
-
ref:
|
|
33
|
+
"post-deploy": "source ~/.nvm/nvm.sh && pnpm install --frozen-lockfile && pnpm checkUnknownFiles && pnpm prepublishOnly && pm2 startOrReload ecosystem.json",
|
|
34
|
+
ref: "origin/master"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
};
|
package/dist/get-nginx-config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import parsePackagejsonName from
|
|
1
|
+
import endent from "endent";
|
|
2
|
+
import parsePackagejsonName from "parse-packagejson-name";
|
|
3
3
|
export default packageConfig => {
|
|
4
4
|
const packageName = parsePackagejsonName(packageConfig.name).fullName;
|
|
5
|
-
return
|
|
5
|
+
return endent`
|
|
6
6
|
upstream web {
|
|
7
7
|
server web:3000;
|
|
8
8
|
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (config: any): any;
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
import getBaseConfigNuxt from
|
|
2
|
-
import packageName from
|
|
3
|
-
import { execaCommand } from
|
|
4
|
-
import loadPkg from
|
|
5
|
-
import outputFiles from
|
|
6
|
-
import yaml from
|
|
1
|
+
import getBaseConfigNuxt, { getEslintConfig } from "@dword-design/base-config-nuxt";
|
|
2
|
+
import packageName from "depcheck-package-name";
|
|
3
|
+
import { execaCommand } from "execa";
|
|
4
|
+
import loadPkg from "load-pkg";
|
|
5
|
+
import outputFiles from "output-files";
|
|
6
|
+
import yaml from "yaml";
|
|
7
7
|
import dockerCompose from "./docker-compose.js";
|
|
8
8
|
import getEcosystemConfig from "./get-ecosystem-config.js";
|
|
9
9
|
import getNginxConfig from "./get-nginx-config.js";
|
|
10
10
|
export default function (config) {
|
|
11
|
-
const packageConfig = loadPkg.sync(
|
|
11
|
+
const packageConfig = loadPkg.sync({
|
|
12
|
+
cwd: this.cwd
|
|
13
|
+
});
|
|
12
14
|
const baseConfigNuxt = getBaseConfigNuxt.call(this, config);
|
|
13
15
|
return {
|
|
14
16
|
...baseConfigNuxt,
|
|
15
|
-
allowedMatches: [...baseConfigNuxt.allowedMatches,
|
|
16
|
-
editorIgnore: [...baseConfigNuxt.editorIgnore,
|
|
17
|
-
|
|
17
|
+
allowedMatches: [...baseConfigNuxt.allowedMatches, "docker-compose.yml", "ecosystem.json", "nginx"],
|
|
18
|
+
editorIgnore: [...baseConfigNuxt.editorIgnore, "docker-compose.yml", "ecosystem.json", "nginx"],
|
|
19
|
+
eslintConfig: getEslintConfig({
|
|
20
|
+
ignore: ["ecosystem.json"],
|
|
21
|
+
virtualImports: config.virtualImports
|
|
22
|
+
}),
|
|
23
|
+
gitignore: [...baseConfigNuxt.gitignore, "/.ceilingrc.json", "/nginx/default.config"],
|
|
18
24
|
isLockFileFixCommitType: true,
|
|
19
25
|
npmPublish: false,
|
|
20
26
|
packageConfig: {
|
|
21
|
-
main:
|
|
27
|
+
main: "dist/index.js"
|
|
22
28
|
},
|
|
23
29
|
prepare: async () => {
|
|
24
30
|
await baseConfigNuxt.prepare();
|
|
25
31
|
return outputFiles(this.cwd, {
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
"docker-compose.yml": yaml.stringify(dockerCompose),
|
|
33
|
+
"ecosystem.json": JSON.stringify(getEcosystemConfig(packageConfig, {
|
|
28
34
|
cwd: this.cwd
|
|
29
|
-
}),
|
|
30
|
-
|
|
35
|
+
}), void 0, 2),
|
|
36
|
+
"nginx/default.config": getNginxConfig(packageConfig)
|
|
31
37
|
});
|
|
32
38
|
},
|
|
33
39
|
renovateConfig: {
|
|
34
|
-
ignorePaths: [
|
|
40
|
+
ignorePaths: ["docker-compose.yml"]
|
|
35
41
|
},
|
|
36
42
|
useJobMatrix: false,
|
|
37
43
|
...(!packageConfig.private && {
|
|
@@ -39,31 +45,31 @@ export default function (config) {
|
|
|
39
45
|
publishCmd: `${packageName`pm2`} deploy production --force`
|
|
40
46
|
}]],
|
|
41
47
|
preDeploySteps: [{
|
|
42
|
-
uses:
|
|
48
|
+
uses: "webfactory/ssh-agent@v0.5.1",
|
|
43
49
|
with: {
|
|
44
|
-
|
|
50
|
+
"ssh-private-key": "${{ secrets.SSH_PRIVATE_KEY }}"
|
|
45
51
|
}
|
|
46
52
|
}, {
|
|
47
|
-
run:
|
|
53
|
+
run: "ssh-keyscan sebastianlandwehr.com >> ~/.ssh/known_hosts"
|
|
48
54
|
}]
|
|
49
55
|
}),
|
|
50
56
|
commands: {
|
|
51
57
|
...baseConfigNuxt.commands,
|
|
52
58
|
pull: {
|
|
53
|
-
arguments:
|
|
59
|
+
arguments: "<endpoint>",
|
|
54
60
|
handler: endpoint => execaCommand(`ceiling pull ${endpoint}`, {
|
|
55
|
-
stdio:
|
|
61
|
+
stdio: "inherit"
|
|
56
62
|
})
|
|
57
63
|
},
|
|
58
64
|
push: {
|
|
59
|
-
arguments:
|
|
65
|
+
arguments: "<endpoint>",
|
|
60
66
|
handler: endpoint => execaCommand(`ceiling push ${endpoint}`, {
|
|
61
|
-
stdio:
|
|
67
|
+
stdio: "inherit"
|
|
62
68
|
})
|
|
63
69
|
},
|
|
64
70
|
setupDeploy: {
|
|
65
|
-
handler: () => execaCommand(
|
|
66
|
-
stdio:
|
|
71
|
+
handler: () => execaCommand("pm2 deploy production setup", {
|
|
72
|
+
stdio: "inherit"
|
|
67
73
|
})
|
|
68
74
|
}
|
|
69
75
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
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
8
|
"type": "module",
|
|
9
|
-
"exports":
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"default": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
10
17
|
"main": "dist/index.js",
|
|
11
18
|
"files": [
|
|
12
19
|
"dist"
|
|
@@ -22,11 +29,11 @@
|
|
|
22
29
|
"test": "base test"
|
|
23
30
|
},
|
|
24
31
|
"dependencies": {
|
|
25
|
-
"@dword-design/base-config-nuxt": "^
|
|
32
|
+
"@dword-design/base-config-nuxt": "^7.0.0",
|
|
26
33
|
"@semantic-release/exec": "^6.0.3",
|
|
27
34
|
"ceiling": "^4.0.0",
|
|
28
|
-
"dedent": "^1.6.0",
|
|
29
35
|
"depcheck-package-name": "^3.0.1",
|
|
36
|
+
"endent": "npm:@dword-design/endent@^1.4.1",
|
|
30
37
|
"execa": "^9.6.0",
|
|
31
38
|
"fs-extra": "^11.3.0",
|
|
32
39
|
"hosted-git-info": "^7.0.2",
|
|
@@ -39,12 +46,12 @@
|
|
|
39
46
|
"yaml": "^2.8.0"
|
|
40
47
|
},
|
|
41
48
|
"devDependencies": {
|
|
42
|
-
"@dword-design/base": "^
|
|
43
|
-
"@playwright/test": "^1.
|
|
49
|
+
"@dword-design/base": "^13.0.7",
|
|
50
|
+
"@playwright/test": "^1.53.0",
|
|
44
51
|
"get-port": "^7.1.0",
|
|
45
|
-
"nuxt-dev-ready": "^
|
|
46
|
-
"playwright": "^1.
|
|
47
|
-
"playwright-chromium": "^1.
|
|
52
|
+
"nuxt-dev-ready": "^4.0.1",
|
|
53
|
+
"playwright": "^1.53.0",
|
|
54
|
+
"playwright-chromium": "^1.53.0",
|
|
48
55
|
"tree-kill-promise": "^3.0.14"
|
|
49
56
|
},
|
|
50
57
|
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977",
|