Skip to content

Commit

Permalink
Merge pull request #73 from jessety/december2022
Browse files Browse the repository at this point in the history
Offline Installation Bugfixes
  • Loading branch information
jessety committed Dec 2, 2022
2 parents ec9ff4a + 9576b82 commit f90a984
Show file tree
Hide file tree
Showing 32 changed files with 401 additions and 212 deletions.
14 changes: 8 additions & 6 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Description**
A clear and concise description of what the bug is.
## Description

<!-- A clear and concise description of what the bug is. -->

## Steps to Reproduce

**Steps to Reproduce**
1.
2.
3.

**Environment**
[Execute `npm run info` and paste the result here]
## Environment

<!-- [Execute `npm run info` and paste the result here] -->
16 changes: 9 additions & 7 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
## Is your feature request related to a problem? Please describe

<!-- A clear and concise description of what the problem is. -->

## Describe the solution you'd like

<!-- A clear and concise description of what you want to happen. -->

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
## Additional context

**Additional context**
Add any other context about the feature request here.
<!-- Add any other context about the feature request here. -->
10 changes: 5 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Description

> What has changed in this PR?
<!-- What has changed in this PR? -->

## Type
## Testing

> Does this fix bugs or add new features? Link any appropriate issues
<!-- Which environments has this change been tested in? -->

## Testing
## Fixes or features?

> Which environments has this change been tested in?
<!-- Does this fix bugs or add new features? Link any appropriate issues -->
18 changes: 9 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "daily"
interval: 'daily'
allow:
- dependency-type: "production"
- dependency-type: 'production'
reviewers:
- "jessety"
- package-ecosystem: "github-actions"
directory: "/"
- 'jessety'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "daily"
interval: 'daily'
reviewers:
- "jessety"
- 'jessety'
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: ci
on: [push]

jobs:

lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -12,7 +11,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- name: Install development dependencies
run: npm install --only=dev
- name: Lint
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
name: release
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ RELEASE.md
bundle.json
bundle.tar.gz
bundle.zip
package.dependencies.json
package.devDependencies.json
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@jessety/prettier-config"
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,21 @@ There are a couple additional challenges when installing on a fresh Windows mach

`pm2-installer` includes two additional scripts to automatically fix the above issues. Invoking `npm run configure` will create the `C:\ProgramData\npm\`, and set `npm` to use `prefix` and `cache` locations in that directory. Running `npm run configure-policy` checks the machine's PowerShell execution policy and if it is either `undefined` or `Restricted`, updates it to `RemoteSigned`.

Open an elevated terminal (e.g. right click and select "Run as Admin") and run the following commands:
Open an elevated terminal (e.g. right click and select "Run as Admin") and run the following commands first:

```pwsh
npm run configure
npm run configure-policy
npm run setup
```

Then, run `npm run setup` to install the pm2 service.

#### Additional context for Windows installations

- The `pm2` service runs as the `Local Service` user. To interact with `pm2`, you need to use an elevated terminal (e.g. right click and select "Run as Admin") before running any commands that interface with the service, e.g. `pm2 list`.
- If you update node and npm, make sure to either manually re-configure your npm & node installations or run `npm run configure` again.
- This project does not currently support nvm for windows. It requires a standard node installation.

## Removal

To remove the pm2 service, run:
Expand Down
57 changes: 31 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"name": "pm2-installer",
"version": "3.4.0",
"version": "3.4.1-BETA-7",
"description": "Install pm2 offline as a service on Windows or Linux",
"license": "MIT",
"author": "Jesse Youngblood",
"homepage": "https://github.com/jessety/pm2-installer#readme",
"bugs": {
"url": "https://github.com/jessety/pm2-installer/issues"
Expand All @@ -16,46 +14,53 @@
"type": "github",
"url": "https://github.com/sponsors/jessety"
},
"license": "MIT",
"author": "Jesse Youngblood",
"scripts": {
"preinstall": "echo WARNING: Running install in this project is not necessary. See README.",
"lint": "eslint . && editorconfig-checker .",
"info": "node ./src/bundle-info/current.js",
"info-config": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\info-config.ps1",
"info-service": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\info-service.ps1",
"bundle": "node ./src/tools/script-for-os.js",
"bundle:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\bundle.ps1",
"bundle:unix": "bash ./src/unix/bundle.sh",
"bundle:default": "echo 'ERROR: Could not detect host platform'",
"unbundle": "node ./src/tools/script-for-os.js",
"unbundle:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\unbundle.ps1",
"unbundle:unix": "bash ./src/unix/unbundle.sh",
"unbundle:default": "echo 'ERROR: Could not detect host platform'",
"bundle:unix": "bash ./src/unix/bundle.sh",
"bundle:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\bundle.ps1",
"configure": "node ./src/tools/script-for-os.js",
"configure:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\configure-setup.ps1",
"configure:default": "echo 'Altering npm configuration not necessary for this platform.';",
"configure-policy": "node ./src/tools/script-for-os.js",
"configure-policy:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\configure-policy-shell.ps1",
"configure-policy:default": "echo 'Altering PowerShell execution policy not necessary for this platform.';",
"configure-policy:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\configure-policy-shell.ps1",
"configure:default": "echo 'Altering npm configuration not necessary for this platform.';",
"configure:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\configure-setup.ps1",
"deconfigure": "node ./src/tools/script-for-os.js",
"deconfigure:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\configure-remove.ps1",
"deconfigure:default": "echo 'Altering npm configuration not necessary for this platform.';",
"setup": "node ./src/tools/script-for-os.js",
"setup:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\setup.ps1",
"setup:unix": "bash ./src/unix/setup.sh",
"setup:default": "echo 'ERROR: Could not detect host platform'",
"deconfigure:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\configure-remove.ps1",
"format": "sort-package-json && prettier --write '**/*.{ts,js,mjs,cjs,json,yml,md}' && eslint --fix .",
"info": "node ./src/bundle-info/current.js",
"info-config": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\info-config.ps1",
"info-service": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\info-service.ps1",
"preinstall": "echo WARNING: Running install in this project is not necessary to install or bundle pm2. See README.",
"postinstall": "echo WARNING: Running install in this project is not necessary to install or bundle pm2. See README.",
"lint": "eslint . && editorconfig-checker .",
"remove": "node ./src/tools/script-for-os.js",
"remove:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\remove.ps1",
"remove:default": "echo 'ERROR: Could not detect host platform'",
"remove:unix": "bash ./src/unix/remove.sh",
"remove:default": "echo 'ERROR: Could not detect host platform'"
"remove:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\remove.ps1",
"setup": "node ./src/tools/script-for-os.js",
"setup:default": "echo 'ERROR: Could not detect host platform'",
"setup:unix": "bash ./src/unix/setup.sh",
"setup:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\setup.ps1",
"unbundle": "node ./src/tools/script-for-os.js",
"unbundle:default": "echo 'ERROR: Could not detect host platform'",
"unbundle:unix": "bash ./src/unix/unbundle.sh",
"unbundle:windows": "PowerShell -NoProfile -ExecutionPolicy Bypass src\\windows\\unbundle.ps1"
},
"dependencies": {
"@jessety/pm2-logrotate": "^2.7.1",
"node-windows": "1.0.0-beta.6",
"pm2": "5.2.2"
},
"devDependencies": {
"@jessety/eslint-config": "^1.0.8",
"@jessety/eslint-config": "^2.4.0",
"@jessety/prettier-config": "^1.2.0",
"editorconfig-checker": "^4.0.2",
"eslint": "^8.14.0"
"eslint": "^8.28.0",
"prettier": "^2.7.1",
"sort-package-json": "^2.1.0"
}
}
Loading

0 comments on commit f90a984

Please sign in to comment.