Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use @arcblock/pm2.io instead of @pm2/io #1

Merged
merged 7 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: "🐛 Bug Report"
description: Report a bug
title: "[Bug]: Bug title"
labels: [bug]
assignees: []
body:
- type: textarea
id: description
attributes:
label: Describe the bug
description: What is the problem?
placeholder: A clear and concise description of the bug.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction Steps
description: Reproducible repository address, fast code, screenshot or screen recording, etc...
validations:
required: true
- type: textarea
id: observed-behavior
attributes:
label: Observed Behavior
description: |
What actually happened?

Please include full errors, uncaught exceptions, stack traces, and relevant logs.
If service responses are relevant, please include wire logs.
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: |
What did you expect to happen?
validations:
required: true
- type: textarea
id: solution
attributes:
label: Possible Solution
description: |
Suggest a fix/reason for the bug
validations:
required: false
- type: textarea
id: context
attributes:
label: Additional Information/Context
description: |
Anything else that might be relevant for troubleshooting this bug. Providing context helps us come up with a solution that is most useful in the real world.
validations:
required: false
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
blank_issues_enabled: false
contact_links:
- name: 💬 General Question
url: [email protected]
about: Please ask and answer questions as a discussion thread
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/discuss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: "💬 Discuss"
description: Start a discussion
title: "[Discuss]: Discuss title"
labels: [discuss]
assignees: []
body:
- type: textarea
id: description
attributes:
label: Discuss topic
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Screenshots
- type: textarea
id: observed-behavior
attributes:
label: Useful Links
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: "🚀 Feature"
description: Start a feature request
title: "[Feature]: Feature title"
labels: [feature]
assignees: []
body:
- type: textarea
id: Why
attributes:
label: Why you want this Feature?
description: What is the usage scenario?
validations:
required: true
- type: textarea
id: Use
attributes:
label: Describe the solution you'd like
description: How to use it?
- type: textarea
id: additional
attributes:
label: Additional context
20 changes: 20 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: check-pr-title

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
branches:
- master
- dev

jobs:
lint-title:
runs-on: ubuntu-latest
steps:
- uses: ArcBlock/action-lint-pull-request-title@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/publish-beta-to-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: publish-beta-to-npm

on:
push:
branches: [master]

jobs:
publish-beta-to-npm:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- name: Checkout release branch code
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
registry-url: "https://registry.npmjs.org"

- name: Install deps
run: npm install

- name: Build
run: npm run build

- name: Publish to NPM
run: |
node scripts/update-beta-package-version.js
cat package.json | grep version
npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: publish-to-npm

on:
push:
branches: [release]

jobs:
publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout release branch code
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
registry-url: "https://registry.npmjs.org"

- name: Install deps
run: npm install

- name: Build
run: npm run build

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/task-list-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: task-list-checker
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
task-list-checker:
runs-on: ubuntu-latest
steps:
- name: Check for incomplete task list items
uses: Shopify/task-list-checker@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"arcblock"
]
}
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/actions-fibonacci.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function fib(n) {
}


var axm = require('@pm2/io');
var axm = require('@arcblock/pm2.io');

axm.action('load:start', function(reply) {
fib(50000);
Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/custom_action.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var axm = require('@pm2/io');
var axm = require('@arcblock/pm2.io');

axm.action('getEnv', function(reply) {
reply(process.env);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var axm = require('@pm2/io');
var axm = require('@arcblock/pm2.io');

axm.action('refresh:db', { comment : 'Refresh the database' }, function(reply) {
console.log('Refreshing');
Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/event.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var axm = require('@pm2/io');
var axm = require('@arcblock/pm2.io');

setInterval(function() {

Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/http_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


var io = require('@pm2/io').init({ http : true });
var io = require('@arcblock/pm2.io').init({ http : true });
var probe = io.probe();

var http = require('http');
Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/http_transaction.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


var axm = require('@pm2/io');
var axm = require('@arcblock/pm2.io');

var probe = axm.probe();

Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/pm2_probe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var io = require('@pm2/io');
var io = require('@arcblock/pm2.io');
var pm2 = require('../..');
var fs = require('fs');
var path = require('path');
Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/probes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


var io = require('@pm2/io');
var io = require('@arcblock/pm2.io');

var users = {
'alex' : 'ok',
Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/process-transpose.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var Probe = require('@pm2/io').probe();
var Probe = require('@arcblock/pm2.io').probe();

var counter = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/scoped-actions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var io = require('@pm2/io');
var io = require('@arcblock/pm2.io');

io.scopedAction('simple test', function(data, emitter) {
var i = setInterval(function() {
Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/test-threshold.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var axm = require('@pm2/io');
var axm = require('@arcblock/pm2.io');


var users = 55
Expand Down
2 changes: 1 addition & 1 deletion examples/test-all-keymetrics-features/throw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var axm = require('@pm2/io');
var axm = require('@arcblock/pm2.io');

setTimeout(function() {
console.log('log message from echo auto kill');
Expand Down
2 changes: 1 addition & 1 deletion lib/API/Serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var url = require('url');
var path = require('path');
var debug = require('debug')('pm2:serve');

var probe = require('@pm2/io');
var probe = require('@arcblock/pm2.io');
var errorMeter = probe.meter({
name : '404/sec',
samples : 1,
Expand Down
2 changes: 1 addition & 1 deletion lib/ProcessUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports = {
injectModules: function() {
if (process.env.pmx !== 'false') {
const pmx = require('@pm2/io')
const pmx = require('@arcblock/pm2.io')

let conf = {}
const hasSpecificConfig = typeof process.env.io === 'string' || process.env.trace === 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Or on the PM2+ Web interface
## Example

```javascript
const io = require('@pm2/io')
const io = require('@arcblock/pm2.io')

const currentReq = io.counter({
name: 'CM: Current Processing',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

const io = require('@pm2/io')
const io = require('@arcblock/pm2.io')

// Straight Metric
var user_count = 10
Expand Down
Loading
Loading