@dword-design/base-config-app 9.0.9 → 9.0.11
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.d.ts +2 -1
- package/dist/get-ecosystem-config.js +3 -2
- package/dist/index.js +21 -25
- package/package.json +2 -4
|
@@ -3,11 +3,12 @@ export default packageConfig => {
|
|
|
3
3
|
const packageName = parsePackagejsonName(packageConfig.name).fullName;
|
|
4
4
|
return {
|
|
5
5
|
apps: [{
|
|
6
|
-
args: "-- node .output/server/index.mjs",
|
|
7
6
|
exec_mode: "cluster",
|
|
8
7
|
instances: "max",
|
|
8
|
+
kill_timeout: 1e4,
|
|
9
|
+
listen_timeout: 2e4,
|
|
9
10
|
name: packageName,
|
|
10
|
-
script: "
|
|
11
|
+
script: "./prod-entry.mjs"
|
|
11
12
|
}]
|
|
12
13
|
};
|
|
13
14
|
};
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { defineBaseConfig } from "@dword-design/base";
|
|
|
4
4
|
import getBaseConfigNuxt, { getEslintConfig } from "@dword-design/base-config-nuxt";
|
|
5
5
|
import packageName from "depcheck-package-name";
|
|
6
6
|
import endent from "endent";
|
|
7
|
-
import { execaCommand } from "execa";
|
|
8
7
|
import fs from "fs-extra";
|
|
9
8
|
import outputFiles from "output-files";
|
|
10
9
|
import { readPackageSync } from "read-pkg";
|
|
@@ -20,21 +19,35 @@ export default defineBaseConfig(function (config) {
|
|
|
20
19
|
const baseConfigNuxt = getBaseConfigNuxt.call(this, config);
|
|
21
20
|
return {
|
|
22
21
|
...baseConfigNuxt,
|
|
23
|
-
allowedMatches: [...baseConfigNuxt.allowedMatches, "docker-compose.yml", "ecosystem.json", "nginx", ...(packageConfig.private ? [] : ["playbook.yml", "requirements.yml"])],
|
|
24
|
-
editorIgnore: [...baseConfigNuxt.editorIgnore, "docker-compose.yml", "ecosystem.json", "nginx", ...(packageConfig.private ? [] : ["playbook.yml", "requirements.yml"])],
|
|
22
|
+
allowedMatches: [...baseConfigNuxt.allowedMatches, "docker-compose.yml", "ecosystem.json", "nginx", "prod-entry.mjs", ...(packageConfig.private ? [] : ["playbook.yml", "requirements.yml"])],
|
|
23
|
+
editorIgnore: [...baseConfigNuxt.editorIgnore, "docker-compose.yml", "ecosystem.json", "nginx", "prod-entry.mjs", ...(packageConfig.private ? [] : ["playbook.yml", "requirements.yml"])],
|
|
25
24
|
eslintConfig: getEslintConfig({
|
|
26
|
-
ignore: ["ecosystem.json"],
|
|
25
|
+
ignore: ["ecosystem.json", "prod-entry.mjs"],
|
|
27
26
|
virtualImports: config.virtualImports
|
|
28
27
|
}),
|
|
29
|
-
gitignore: [...baseConfigNuxt.gitignore, "
|
|
28
|
+
gitignore: [...baseConfigNuxt.gitignore, "/nginx/default.config"],
|
|
30
29
|
isLockFileFixCommitType: true,
|
|
31
30
|
npmPublish: false,
|
|
32
31
|
prepare: async () => {
|
|
33
32
|
await baseConfigNuxt.prepare();
|
|
34
33
|
return outputFiles(this.cwd, {
|
|
35
34
|
"docker-compose.yml": yaml.stringify(dockerCompose),
|
|
36
|
-
"ecosystem.json": JSON.stringify(getEcosystemConfig(packageConfig), void 0, 2)
|
|
35
|
+
"ecosystem.json": `${JSON.stringify(getEcosystemConfig(packageConfig), void 0, 2)}
|
|
36
|
+
`,
|
|
37
37
|
"nginx/default.config": getNginxConfig(packageConfig),
|
|
38
|
+
"prod-entry.mjs": endent`
|
|
39
|
+
import { exec } from 'node:child_process';
|
|
40
|
+
import { promisify } from 'node:util';
|
|
41
|
+
|
|
42
|
+
const execAsync = promisify(exec);
|
|
43
|
+
|
|
44
|
+
const { stdout: envVariablesString } = await execAsync('dotenv-json-extended get');
|
|
45
|
+
const envVariables = JSON.parse(envVariablesString);
|
|
46
|
+
|
|
47
|
+
Object.assign(process.env, envVariables);
|
|
48
|
+
|
|
49
|
+
await import('./.output/server/index.mjs');
|
|
50
|
+
`,
|
|
38
51
|
...(!packageConfig.private && (await (async () => {
|
|
39
52
|
const [playbookYml, requirementsYml] = await Promise.all([fs.readFile(resolver.resolve("./playbook.yml"), "utf8"), fs.readFile(resolver.resolve("./requirements.yml"), "utf8")]);
|
|
40
53
|
return {
|
|
@@ -56,7 +69,7 @@ export default defineBaseConfig(function (config) {
|
|
|
56
69
|
run: "pnpm build"
|
|
57
70
|
}, {
|
|
58
71
|
name: "Create deploy artifact",
|
|
59
|
-
run: `tar -czf deploy.tgz .output${fs.existsSync(pathLib.join(this.cwd, ".env.schema.json")) ? " .env.schema.json" : ""} ecosystem.json`
|
|
72
|
+
run: `tar -czf deploy.tgz .output${fs.existsSync(pathLib.join(this.cwd, ".env.schema.json")) ? " .env.schema.json" : ""} ecosystem.json prod-entry.mjs`
|
|
60
73
|
}, {
|
|
61
74
|
name: "Install Python",
|
|
62
75
|
uses: "actions/setup-python@v4",
|
|
@@ -87,23 +100,6 @@ export default defineBaseConfig(function (config) {
|
|
|
87
100
|
EOF
|
|
88
101
|
`
|
|
89
102
|
}]
|
|
90
|
-
})
|
|
91
|
-
commands: {
|
|
92
|
-
...baseConfigNuxt.commands,
|
|
93
|
-
pull: {
|
|
94
|
-
arguments: "<endpoint>",
|
|
95
|
-
handler: endpoint => execaCommand(`ceiling pull ${endpoint}`, {
|
|
96
|
-
cwd: this.cwd,
|
|
97
|
-
stdio: "inherit"
|
|
98
|
-
})
|
|
99
|
-
},
|
|
100
|
-
push: {
|
|
101
|
-
arguments: "<endpoint>",
|
|
102
|
-
handler: endpoint => execaCommand(`ceiling push ${endpoint}`, {
|
|
103
|
-
cwd: this.cwd,
|
|
104
|
-
stdio: "inherit"
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
}
|
|
103
|
+
})
|
|
108
104
|
};
|
|
109
105
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-app",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.11",
|
|
4
4
|
"repository": "dword-design/base-config-app",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,13 +29,11 @@
|
|
|
29
29
|
"verify": "base verify"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@dword-design/base": "^16.
|
|
32
|
+
"@dword-design/base": "^16.2.6",
|
|
33
33
|
"@dword-design/base-config-nuxt": "^9.0.1",
|
|
34
34
|
"@semantic-release/exec": "^7.1.0",
|
|
35
|
-
"ceiling": "^4.0.0",
|
|
36
35
|
"depcheck-package-name": "^4.0.1",
|
|
37
36
|
"endent": "npm:@dword-design/endent@^1.4.7",
|
|
38
|
-
"execa": "^9.6.1",
|
|
39
37
|
"fs-extra": "^11.3.2",
|
|
40
38
|
"output-files": "^3.0.0",
|
|
41
39
|
"parse-packagejson-name": "npm:@dword-design/parse-packagejson-name-fork@^0.0.2",
|