page2pdf_server 1.1.0 → 1.1.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.
Files changed (39) hide show
  1. package/.babelrc +3 -3
  2. package/.eslintrc +32 -32
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +28 -28
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +15 -15
  5. package/.github/ISSUE_TEMPLATE/refactoring.md +15 -15
  6. package/.github/PULL_REQUEST_TEMPLATE.md +18 -18
  7. package/.github/stale.yml +17 -17
  8. package/.github/workflows/cd.yml +75 -75
  9. package/.github/workflows/ci.yml +36 -36
  10. package/.prettierrc +8 -8
  11. package/.vscode/settings.json +3 -3
  12. package/LICENSE +17 -17
  13. package/README.md +6 -1
  14. package/ecosystem.config.js +41 -41
  15. package/jest.config.js +35 -35
  16. package/nodemon.json +6 -6
  17. package/package.json +23 -15
  18. package/src/__tests__/UrltoPdf/generatePdf.test.d.ts +1 -0
  19. package/{__tests__ → src/__tests__}/UrltoPdf/generatePdf.test.ts +1 -1
  20. package/src/__tests__/UrltoPdf/pdfSplit.test.d.ts +1 -0
  21. package/{__tests__ → src/__tests__}/UrltoPdf/pdfSplit.test.ts +1 -1
  22. package/src/__tests__/helpers/index.d.ts +2 -0
  23. package/src/__tests__/home.test.d.ts +1 -0
  24. package/{__tests__ → src/__tests__}/home.test.ts +1 -1
  25. package/src/app.ts +1 -0
  26. package/src/components/home/controller.ts +6 -1
  27. package/src/components/home/pdfController.ts +2 -5
  28. package/src/components/home/splitController.ts +2 -5
  29. package/src/helpers/dataSanitizers.ts +1 -0
  30. package/src/helpers/loggers.ts +4 -2
  31. package/src/index.ts +2 -0
  32. package/src/types/request/config.ts +0 -95
  33. package/src/types.d.ts +97 -0
  34. package/src/utils/pdfgen.ts +3 -6
  35. package/tsconfig.json +44 -41
  36. package/tslint.json +22 -22
  37. package/.husky/pre-commit +0 -6
  38. package/.husky/pre-push +0 -4
  39. /package/{__tests__ → src/__tests__}/helpers/index.ts +0 -0
package/.babelrc CHANGED
@@ -1,3 +1,3 @@
1
- {
2
- "presets": ["@babel/preset-env", "@babel/preset-typescript"]
3
- }
1
+ {
2
+ "presets": ["@babel/preset-env", "@babel/preset-typescript"]
3
+ }
package/.eslintrc CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "root": true,
3
- "parser": "@typescript-eslint/parser",
4
- "parserOptions": {
5
- "ecmaVersion": "latest",
6
- "sourceType": "module",
7
- "project": "./tsconfig.json"
8
- },
9
- "plugins": ["import", "prettier"],
10
- "ignorePatterns": ["node_modules/*", "dist/*", ".*", "jest*", "ecosystem*" ],
11
- "extends": [
12
- "plugin:@typescript-eslint/recommended",
13
- "prettier"
14
- ],
15
- "rules": {
16
- "@typescript-eslint/explicit-module-boundary-types": "off",
17
- "@typescript-eslint/no-empty-interface": "off",
18
- "@typescript-eslint/ban-types": "off",
19
- "@typescript-eslint/ban-ts-comment": "off",
20
- "@typescript-eslint/no-non-null-assertion": "off",
21
- "@typescript-eslint/no-explicit-any": "off",
22
- "@typescript-eslint/no-unused-vars": ["error", {
23
- "argsIgnorePattern": "^_"
24
- }],
25
- "import/order": ["error"],
26
- "prettier/prettier": [
27
- "error",
28
- {
29
- "endOfLine": "auto"
30
- }
31
- ]
32
- }
1
+ {
2
+ "root": true,
3
+ "parser": "@typescript-eslint/parser",
4
+ "parserOptions": {
5
+ "ecmaVersion": "latest",
6
+ "sourceType": "module",
7
+ "project": "./tsconfig.json"
8
+ },
9
+ "plugins": ["import", "prettier"],
10
+ "ignorePatterns": ["node_modules/*", "dist/*", ".*", "jest*", "ecosystem*" ],
11
+ "extends": [
12
+ "plugin:@typescript-eslint/recommended",
13
+ "prettier"
14
+ ],
15
+ "rules": {
16
+ "@typescript-eslint/explicit-module-boundary-types": "off",
17
+ "@typescript-eslint/no-empty-interface": "off",
18
+ "@typescript-eslint/ban-types": "off",
19
+ "@typescript-eslint/ban-ts-comment": "off",
20
+ "@typescript-eslint/no-non-null-assertion": "off",
21
+ "@typescript-eslint/no-explicit-any": "off",
22
+ "@typescript-eslint/no-unused-vars": ["error", {
23
+ "argsIgnorePattern": "^_"
24
+ }],
25
+ "import/order": ["error"],
26
+ "prettier/prettier": [
27
+ "error",
28
+ {
29
+ "endOfLine": "auto"
30
+ }
31
+ ]
32
+ }
33
33
  }
@@ -1,28 +1,28 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ""
5
- labels: "bug"
6
- assignees: ""
7
- ---
8
-
9
- # Description
10
-
11
- _A clear and concise description of what the bug is._
12
-
13
- # Reproduction
14
-
15
- _Steps to reproduce the behavior:_
16
-
17
- _1. Go to '...'_
18
- _2. Click on '....'_
19
- _3. Scroll down to '....'_
20
- _4. See error_
21
-
22
- # Expected
23
-
24
- _A clear and concise description of what you expected to happen._
25
-
26
- # Screenshots
27
-
28
- _If applicable, add screenshots to help explain your problem._
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ""
5
+ labels: "bug"
6
+ assignees: ""
7
+ ---
8
+
9
+ # Description
10
+
11
+ _A clear and concise description of what the bug is._
12
+
13
+ # Reproduction
14
+
15
+ _Steps to reproduce the behavior:_
16
+
17
+ _1. Go to '...'_
18
+ _2. Click on '....'_
19
+ _3. Scroll down to '....'_
20
+ _4. See error_
21
+
22
+ # Expected
23
+
24
+ _A clear and concise description of what you expected to happen._
25
+
26
+ # Screenshots
27
+
28
+ _If applicable, add screenshots to help explain your problem._
@@ -1,15 +1,15 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
- title: ""
5
- labels: "implementation"
6
- assignees: ""
7
- ---
8
-
9
- # Request
10
-
11
- _A clear and concise description of what the problem is._
12
-
13
- # Suggestion
14
-
15
- _A clear and concise description of what you want to happen._
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ""
5
+ labels: "implementation"
6
+ assignees: ""
7
+ ---
8
+
9
+ # Request
10
+
11
+ _A clear and concise description of what the problem is._
12
+
13
+ # Suggestion
14
+
15
+ _A clear and concise description of what you want to happen._
@@ -1,15 +1,15 @@
1
- ---
2
- name: Refactoring
3
- about: Add content to be refactored
4
- title: ""
5
- labels: "refactoring"
6
- assignees: ""
7
- ---
8
-
9
- # Refactor description
10
-
11
- _A clear and concise description of the related Content._
12
-
13
- # Refactor suggestion
14
-
15
- _A clear and concise description of any alternative solutions or features you've considered._
1
+ ---
2
+ name: Refactoring
3
+ about: Add content to be refactored
4
+ title: ""
5
+ labels: "refactoring"
6
+ assignees: ""
7
+ ---
8
+
9
+ # Refactor description
10
+
11
+ _A clear and concise description of the related Content._
12
+
13
+ # Refactor suggestion
14
+
15
+ _A clear and concise description of any alternative solutions or features you've considered._
@@ -1,18 +1,18 @@
1
- # Description
2
-
3
- _Explain briefly about the purpose & context of this PR_
4
-
5
- # Screenshots
6
-
7
- _If possible add a screenshot and/or gif_
8
-
9
- # Example | Usage
10
-
11
- _Please share examples and how to reproduce_
12
-
13
- ---
14
-
15
- # Related Issues | Pr
16
-
17
- _`close`|`resolve` <ISSUE> (ex. `resolve #20`)_
18
- _link issues to close automatically_
1
+ # Description
2
+
3
+ _Explain briefly about the purpose & context of this PR_
4
+
5
+ # Screenshots
6
+
7
+ _If possible add a screenshot and/or gif_
8
+
9
+ # Example | Usage
10
+
11
+ _Please share examples and how to reproduce_
12
+
13
+ ---
14
+
15
+ # Related Issues | Pr
16
+
17
+ _`close`|`resolve` <ISSUE> (ex. `resolve #20`)_
18
+ _link issues to close automatically_
package/.github/stale.yml CHANGED
@@ -1,17 +1,17 @@
1
- # Number of days of inactivity before an issue becomes stale
2
- daysUntilStale: 100
3
- # Number of days of inactivity before a stale issue is closed
4
- daysUntilClose: 7
5
- # Issues with these labels will never be considered stale
6
- exemptLabels:
7
- - pinned
8
- - security
9
- # Label to use when marking an issue as stale
10
- staleLabel: wontfix
11
- # Comment to post when marking an issue as stale. Set to `false` to disable
12
- markComment: >
13
- This issue has been automatically marked as stale because it has not had
14
- recent activity. It will be closed if no further activity occurs. Thank you
15
- for your contributions.
16
- # Comment to post when closing a stale issue. Set to `false` to disable
17
- closeComment: false
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 100
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: 7
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - pinned
8
+ - security
9
+ # Label to use when marking an issue as stale
10
+ staleLabel: wontfix
11
+ # Comment to post when marking an issue as stale. Set to `false` to disable
12
+ markComment: >
13
+ This issue has been automatically marked as stale because it has not had
14
+ recent activity. It will be closed if no further activity occurs. Thank you
15
+ for your contributions.
16
+ # Comment to post when closing a stale issue. Set to `false` to disable
17
+ closeComment: false
@@ -1,75 +1,75 @@
1
- name: CD
2
-
3
- on:
4
- push:
5
- branches: [ main, develop ]
6
-
7
- jobs:
8
- test:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - name: Checkout repository
12
- uses: actions/checkout@v2.3.4
13
-
14
- - name: Set up Node.js
15
- uses: actions/setup-node@v2.4.1
16
- with:
17
- node-version: 16
18
-
19
- - name: Install Dependencies
20
- run: yarn
21
-
22
- - name: Run Lint
23
- run: yarn lint
24
-
25
- - name: Build module
26
- run: yarn build
27
-
28
- - name: Run Test code
29
- run: yarn test
30
-
31
- # ↓↓↓↓ Please edit below according your environment ↓↓↓↓
32
- # deploy:
33
- # runs-on: ubuntu-latest
34
- # needs: test
35
- # steps:
36
- # - name: Checkout repository
37
- # uses: actions/checkout@v2.3.4
38
-
39
- # - name: Deploy DEVELOPMENT
40
- # uses: appleboy/ssh-action@v0.1.4
41
- # if: github.ref == 'refs/heads/develop'
42
- # with:
43
- # key: ${{ secrets.DEV_PEM_KEY }}
44
- # host: ${{ secrets.DEV_HOST }}
45
- # username: ubuntu
46
- # script: |
47
- # cd /home/ubuntu/source
48
- # git checkout develop
49
- # git fetch --all
50
- # git reset --hard origin/develop
51
- # git pull origin develop
52
- # yarn
53
- # yarn build
54
- # export NODE_ENV=development && pm2 startOrReload ecosystem.config.js
55
- # pm2 set pm2:autodump true
56
- # pm2 save
57
-
58
- # - name: Deploy PRODUCTION
59
- # uses: appleboy/ssh-action@v0.1.4
60
- # if: github.ref == 'refs/heads/main'
61
- # with:
62
- # key: ${{ secrets.PROD_PEM_KEY }}
63
- # host: ${{ secrets.PROD_HOST }}
64
- # username: ubuntu
65
- # script: |
66
- # cd /home/ubuntu/source
67
- # git checkout main
68
- # git fetch --all
69
- # git reset --hard origin/main
70
- # git pull origin main
71
- # yarn
72
- # yarn build
73
- # export NODE_ENV=production && pm2 startOrReload ecosystem.config.js
74
- # pm2 set pm2:autodump true
75
- # pm2 save
1
+ name: CD
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout repository
12
+ uses: actions/checkout@v2.3.4
13
+
14
+ - name: Set up Node.js
15
+ uses: actions/setup-node@v2.4.1
16
+ with:
17
+ node-version: 16
18
+
19
+ - name: Install Dependencies
20
+ run: yarn
21
+
22
+ - name: Run Lint
23
+ run: yarn lint
24
+
25
+ - name: Build module
26
+ run: yarn build
27
+
28
+ - name: Run Test code
29
+ run: yarn test
30
+
31
+ # ↓↓↓↓ Please edit below according your environment ↓↓↓↓
32
+ # deploy:
33
+ # runs-on: ubuntu-latest
34
+ # needs: test
35
+ # steps:
36
+ # - name: Checkout repository
37
+ # uses: actions/checkout@v2.3.4
38
+
39
+ # - name: Deploy DEVELOPMENT
40
+ # uses: appleboy/ssh-action@v0.1.4
41
+ # if: github.ref == 'refs/heads/develop'
42
+ # with:
43
+ # key: ${{ secrets.DEV_PEM_KEY }}
44
+ # host: ${{ secrets.DEV_HOST }}
45
+ # username: ubuntu
46
+ # script: |
47
+ # cd /home/ubuntu/source
48
+ # git checkout develop
49
+ # git fetch --all
50
+ # git reset --hard origin/develop
51
+ # git pull origin develop
52
+ # yarn
53
+ # yarn build
54
+ # export NODE_ENV=development && pm2 startOrReload ecosystem.config.js
55
+ # pm2 set pm2:autodump true
56
+ # pm2 save
57
+
58
+ # - name: Deploy PRODUCTION
59
+ # uses: appleboy/ssh-action@v0.1.4
60
+ # if: github.ref == 'refs/heads/main'
61
+ # with:
62
+ # key: ${{ secrets.PROD_PEM_KEY }}
63
+ # host: ${{ secrets.PROD_HOST }}
64
+ # username: ubuntu
65
+ # script: |
66
+ # cd /home/ubuntu/source
67
+ # git checkout main
68
+ # git fetch --all
69
+ # git reset --hard origin/main
70
+ # git pull origin main
71
+ # yarn
72
+ # yarn build
73
+ # export NODE_ENV=production && pm2 startOrReload ecosystem.config.js
74
+ # pm2 set pm2:autodump true
75
+ # pm2 save
@@ -1,36 +1,36 @@
1
- name: CI
2
-
3
- on:
4
- pull_request:
5
- types: [ opened, synchronize, reopened ]
6
-
7
- jobs:
8
- test:
9
- runs-on: ubuntu-latest
10
-
11
- strategy:
12
- matrix:
13
- node-version: [ '16' ]
14
-
15
- steps:
16
- - name: Checkout repository
17
- uses: actions/checkout@v2.3.4
18
-
19
- - name: Set up Node.js ${{ matrix.node-version }}
20
- uses: actions/setup-node@v2.4.1
21
- with:
22
- node-version: ${{ matrix.node-version }}
23
-
24
- - name: Install Dependencies
25
- run: yarn
26
-
27
- - name: Run Lint
28
- run: yarn lint
29
-
30
- - name: Run Test code
31
- run: yarn test
32
-
33
- - name: Build module
34
- run: yarn build
35
-
36
-
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ types: [ opened, synchronize, reopened ]
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+
11
+ strategy:
12
+ matrix:
13
+ node-version: [ '16' ]
14
+
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v2.3.4
18
+
19
+ - name: Set up Node.js ${{ matrix.node-version }}
20
+ uses: actions/setup-node@v2.4.1
21
+ with:
22
+ node-version: ${{ matrix.node-version }}
23
+
24
+ - name: Install Dependencies
25
+ run: yarn
26
+
27
+ - name: Run Lint
28
+ run: yarn lint
29
+
30
+ - name: Run Test code
31
+ run: yarn test
32
+
33
+ - name: Build module
34
+ run: yarn build
35
+
36
+
package/.prettierrc CHANGED
@@ -1,8 +1,8 @@
1
- {
2
- "parser": "typescript",
3
- "semi": true,
4
- "singleQuote": false,
5
- "tabWidth": 2,
6
- "trailingComma": "all",
7
- "printWidth": 80
8
- }
1
+ {
2
+ "parser": "typescript",
3
+ "semi": true,
4
+ "singleQuote": false,
5
+ "tabWidth": 2,
6
+ "trailingComma": "all",
7
+ "printWidth": 80
8
+ }
@@ -1,3 +1,3 @@
1
- {
2
- "editor.stickyScroll.enabled": true
3
- }
1
+ {
2
+ "editor.stickyScroll.enabled": true
3
+ }
package/LICENSE CHANGED
@@ -1,18 +1,18 @@
1
- Copyright (c) 2021, Filoscoder
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of
4
- this software and associated documentation files (the "Software"), to deal in
5
- the Software without restriction, including without limitation the rights to
6
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
- the Software, and to permit persons to whom the Software is furnished to do so,
8
- subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1
+ Copyright (c) 2021, Filoscoder
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
+ the Software, and to permit persons to whom the Software is furnished to do so,
8
+ subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
18
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -64,7 +64,7 @@ chrome-remote-interface不会为您启动Chrome。本来想用chrome-remote-inte
64
64
  - Set your `git remote add origin` path
65
65
  - 用户电脑也需要做些安装的:
66
66
  只需要本工程目录的 /config, /dist, 文书打印转换器.bat,新/pdfs目录, 并且页已经node.js, nodemon;
67
- 还必须要安装工程目录/package.json; /module-alias/的目录全部依赖包的。
67
+ 还必须要安装工程目录 package-lock.json /module-alias/的目录全部依赖包的。
68
68
  -
69
69
  ```bash
70
70
  git remote add origin ${forked-and-cloned-path}
@@ -252,8 +252,13 @@ If you have any question or suggestion, don't hesitate to contact me:
252
252
  {"name":"D4", "css": "10.4in 12.6in","w": 10.4,"h": 12.6}
253
253
  ]
254
254
  }
255
+
255
256
  # 拒绝连接的
256
257
  对Chrome 右键 点选 以管理员身份运行;
258
+ 前提需 有npm 就是 node环境的;
259
+ 复制目录+ 还需安装 npm ci --only=production
260
+ 新版本需无头的 "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9872 --headless
261
+
257
262
  # 动态布局问题
258
263
  只用css做动态的组件和用了js脚本做动态布局的组件在打印时刻不同,比如"customize-easy-ui-component"库的LineColumnFlex和LineColumn的差别即使这样,
259
264
  前者在打印时刻需要约束浏览器窗口的宽度为纸张输出的宽度差不多的大小,后者可打印页数就可能和内容页数不一致,后者只用css的就不会有这个麻烦。
@@ -1,41 +1,41 @@
1
- module.exports = {
2
- apps: [
3
- {
4
- name: '<app-name>',
5
- script: 'dist/src/index.js',
6
- // Options reference: https://pm2.keymetrics.io/docs/usage/application-declaration/
7
- exec_mode: 'cluster',
8
- instances: 2,
9
- kill_timeout: 5000,
10
- autorestart: true,
11
- max_restarts: 10,
12
- watch: true,
13
- watch_options: {
14
- followSymlinks: false,
15
- },
16
- max_memory_restart: '1G',
17
- env: {
18
- NODE_ENV: 'development',
19
- },
20
- env_production: {
21
- NODE_ENV: 'production',
22
- port: 8080,
23
- },
24
- merge_logs: true,
25
- log_date_format: 'YYYY-MM-DDTHH:mm:ss.sssZ',
26
- },
27
- ],
28
- // https://pm2.keymetrics.io/docs/usage/deployment/
29
- deploy: {
30
- production: {
31
- key: process.env.EC2_PEM_PATH,
32
- host: process.env.EC2_HOST,
33
- user: 'ubuntu',
34
- ref: 'origin/main',
35
- repo: 'git@github.com:<username>/<repo-name>.git',
36
- path: '/home/ubuntu',
37
- 'post-deploy':
38
- 'yarn && yarn clean && yarn build && pm2 startOrRestart ecosystem.config.js --env production && pm2 set pm2:autodump true && pm2 save',
39
- },
40
- },
41
- };
1
+ module.exports = {
2
+ apps: [
3
+ {
4
+ name: '<app-name>',
5
+ script: 'dist/src/index.js',
6
+ // Options reference: https://pm2.keymetrics.io/docs/usage/application-declaration/
7
+ exec_mode: 'cluster',
8
+ instances: 2,
9
+ kill_timeout: 5000,
10
+ autorestart: true,
11
+ max_restarts: 10,
12
+ watch: true,
13
+ watch_options: {
14
+ followSymlinks: false,
15
+ },
16
+ max_memory_restart: '1G',
17
+ env: {
18
+ NODE_ENV: 'development',
19
+ },
20
+ env_production: {
21
+ NODE_ENV: 'production',
22
+ port: 8080,
23
+ },
24
+ merge_logs: true,
25
+ log_date_format: 'YYYY-MM-DDTHH:mm:ss.sssZ',
26
+ },
27
+ ],
28
+ // https://pm2.keymetrics.io/docs/usage/deployment/
29
+ deploy: {
30
+ production: {
31
+ key: process.env.EC2_PEM_PATH,
32
+ host: process.env.EC2_HOST,
33
+ user: 'ubuntu',
34
+ ref: 'origin/main',
35
+ repo: 'git@github.com:<username>/<repo-name>.git',
36
+ path: '/home/ubuntu',
37
+ 'post-deploy':
38
+ 'yarn && yarn clean && yarn build && pm2 startOrRestart ecosystem.config.js --env production && pm2 set pm2:autodump true && pm2 save',
39
+ },
40
+ },
41
+ };