@dword-design/base-config-app 9.0.9 → 9.0.10
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.
|
@@ -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
|
@@ -20,10 +20,10 @@ export default defineBaseConfig(function (config) {
|
|
|
20
20
|
const baseConfigNuxt = getBaseConfigNuxt.call(this, config);
|
|
21
21
|
return {
|
|
22
22
|
...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"])],
|
|
23
|
+
allowedMatches: [...baseConfigNuxt.allowedMatches, "docker-compose.yml", "ecosystem.json", "nginx", "prod-entry.mjs", ...(packageConfig.private ? [] : ["playbook.yml", "requirements.yml"])],
|
|
24
|
+
editorIgnore: [...baseConfigNuxt.editorIgnore, "docker-compose.yml", "ecosystem.json", "nginx", "prod-entry.mjs", ...(packageConfig.private ? [] : ["playbook.yml", "requirements.yml"])],
|
|
25
25
|
eslintConfig: getEslintConfig({
|
|
26
|
-
ignore: ["ecosystem.json"],
|
|
26
|
+
ignore: ["ecosystem.json", "prod-entry.mjs"],
|
|
27
27
|
virtualImports: config.virtualImports
|
|
28
28
|
}),
|
|
29
29
|
gitignore: [...baseConfigNuxt.gitignore, "/.ceilingrc.json", "/nginx/default.config"],
|
|
@@ -33,8 +33,22 @@ export default defineBaseConfig(function (config) {
|
|
|
33
33
|
await baseConfigNuxt.prepare();
|
|
34
34
|
return outputFiles(this.cwd, {
|
|
35
35
|
"docker-compose.yml": yaml.stringify(dockerCompose),
|
|
36
|
-
"ecosystem.json": JSON.stringify(getEcosystemConfig(packageConfig), void 0, 2)
|
|
36
|
+
"ecosystem.json": `${JSON.stringify(getEcosystemConfig(packageConfig), void 0, 2)}
|
|
37
|
+
`,
|
|
37
38
|
"nginx/default.config": getNginxConfig(packageConfig),
|
|
39
|
+
"prod-entry.mjs": endent`
|
|
40
|
+
import { exec } from 'node:child_process';
|
|
41
|
+
import { promisify } from 'node:util';
|
|
42
|
+
|
|
43
|
+
const execAsync = promisify(exec);
|
|
44
|
+
|
|
45
|
+
const { stdout: envVariablesString } = await execAsync('dotenv-json-extended get');
|
|
46
|
+
const envVariables = JSON.parse(envVariablesString);
|
|
47
|
+
|
|
48
|
+
Object.assign(process.env, envVariables);
|
|
49
|
+
|
|
50
|
+
await import('./.output/server/index.mjs');
|
|
51
|
+
`,
|
|
38
52
|
...(!packageConfig.private && (await (async () => {
|
|
39
53
|
const [playbookYml, requirementsYml] = await Promise.all([fs.readFile(resolver.resolve("./playbook.yml"), "utf8"), fs.readFile(resolver.resolve("./requirements.yml"), "utf8")]);
|
|
40
54
|
return {
|
|
@@ -56,7 +70,7 @@ export default defineBaseConfig(function (config) {
|
|
|
56
70
|
run: "pnpm build"
|
|
57
71
|
}, {
|
|
58
72
|
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`
|
|
73
|
+
run: `tar -czf deploy.tgz .output${fs.existsSync(pathLib.join(this.cwd, ".env.schema.json")) ? " .env.schema.json" : ""} ecosystem.json prod-entry.mjs`
|
|
60
74
|
}, {
|
|
61
75
|
name: "Install Python",
|
|
62
76
|
uses: "actions/setup-python@v4",
|
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.10",
|
|
4
4
|
"repository": "dword-design/base-config-app",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
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
35
|
"ceiling": "^4.0.0",
|