npq 3.10.0 → 3.10.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.
@@ -0,0 +1,39 @@
1
+ name: automerge
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - labeled
6
+ - unlabeled
7
+ - synchronize
8
+ - opened
9
+ - edited
10
+ - ready_for_review
11
+ - reopened
12
+ - unlocked
13
+ pull_request_review:
14
+ types:
15
+ - submitted
16
+ check_suite:
17
+ types:
18
+ - completed
19
+ status: {}
20
+ jobs:
21
+ automerge:
22
+ runs-on: ubuntu-latest
23
+ permissions:
24
+ contents: write
25
+ pull-requests: write
26
+ steps:
27
+ - id: automerge
28
+ name: automerge
29
+ uses: "pascalgn/automerge-action@v0.16.4"
30
+ env:
31
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
32
+ # we only merge PRs with labels of "dependencies"
33
+ MERGE_LABELS: "automerge"
34
+ MERGE_REMOVE_LABELS: "automerge"
35
+ MERGE_METHOD: "squash"
36
+ MERGE_COMMIT_MESSAGE: "automatic"
37
+ MERGE_FORKS: "false"
38
+ MERGE_REQUIRED_APPROVALS: "0"
39
+ UPDATE_METHOD: "rebase"
@@ -9,7 +9,7 @@ const childProcess = require('child_process')
9
9
 
10
10
  jest.mock('child_process', () => {
11
11
  return {
12
- spawn: jest.fn((cmd, args, options) => {
12
+ spawn: jest.fn((cmd, options) => {
13
13
  return { pid: 12345 }
14
14
  })
15
15
  }
@@ -38,7 +38,7 @@ describe('NPQ_PKG_MGR Environment Variable Integration', () => {
38
38
  // Test that the package manager can spawn pnpm (which would be passed from CLI parsing)
39
39
  await packageManager.process('pnpm')
40
40
 
41
- expect(childProcess.spawn).toHaveBeenCalledWith('pnpm', ['install', 'fastify'], {
41
+ expect(childProcess.spawn).toHaveBeenCalledWith('pnpm install fastify', {
42
42
  stdio: 'inherit',
43
43
  shell: true
44
44
  })
@@ -49,7 +49,7 @@ describe('NPQ_PKG_MGR Environment Variable Integration', () => {
49
49
 
50
50
  await packageManager.process('yarn')
51
51
 
52
- expect(childProcess.spawn).toHaveBeenCalledWith('yarn', ['install', 'express', 'lodash'], {
52
+ expect(childProcess.spawn).toHaveBeenCalledWith('yarn install express lodash', {
53
53
  stdio: 'inherit',
54
54
  shell: true
55
55
  })
@@ -63,7 +63,7 @@ describe('NPQ_PKG_MGR Environment Variable Integration', () => {
63
63
 
64
64
  await packageManager.process(pm)
65
65
 
66
- expect(childProcess.spawn).toHaveBeenCalledWith(pm, ['install', 'test-package'], {
66
+ expect(childProcess.spawn).toHaveBeenCalledWith(`${pm} install test-package`, {
67
67
  stdio: 'inherit',
68
68
  shell: true
69
69
  })
@@ -53,9 +53,7 @@ test('package manager spawns successfully when provided array of packages to han
53
53
  await packageManager.process('npm')
54
54
  expect(childProcess.spawn).toHaveBeenCalled()
55
55
  expect(childProcess.spawn.mock.calls.length).toBe(1)
56
- expect(childProcess.spawn.mock.calls[0][0]).toBe('npm')
57
-
58
- expect(childProcess.spawn.mock.calls[0][1]).toEqual(['install', 'semver', 'express'])
56
+ expect(childProcess.spawn.mock.calls[0][0]).toEqual('npm install semver express')
59
57
  childProcess.spawn.mockReset()
60
58
  })
61
59
 
@@ -72,9 +70,7 @@ test("package manager spawns successfully and ignore npq's own internal commands
72
70
  await packageManager.process('npm')
73
71
  expect(childProcess.spawn).toHaveBeenCalled()
74
72
  expect(childProcess.spawn.mock.calls.length).toBe(1)
75
- expect(childProcess.spawn.mock.calls[0][0]).toBe('npm')
76
-
77
- expect(childProcess.spawn.mock.calls[0][1]).toEqual(['install', 'semver', 'express'])
73
+ expect(childProcess.spawn.mock.calls[0][0]).toEqual('npm install semver express')
78
74
  childProcess.spawn.mockReset()
79
75
  })
80
76
 
@@ -83,9 +79,7 @@ test('package manager spawns with yarn when provided as parameter', async () =>
83
79
  await packageManager.process('yarn')
84
80
  expect(childProcess.spawn).toHaveBeenCalled()
85
81
  expect(childProcess.spawn.mock.calls.length).toBe(1)
86
- expect(childProcess.spawn.mock.calls[0][0]).toBe('yarn')
87
-
88
- expect(childProcess.spawn.mock.calls[0][1]).toEqual(['install', 'express'])
82
+ expect(childProcess.spawn.mock.calls[0][0]).toEqual('yarn install express')
89
83
  childProcess.spawn.mockReset()
90
84
  })
91
85
 
@@ -94,8 +88,6 @@ test('package manager spawns with pnpm when provided as parameter', async () =>
94
88
  await packageManager.process('pnpm')
95
89
  expect(childProcess.spawn).toHaveBeenCalled()
96
90
  expect(childProcess.spawn.mock.calls.length).toBe(1)
97
- expect(childProcess.spawn.mock.calls[0][0]).toBe('pnpm')
98
-
99
- expect(childProcess.spawn.mock.calls[0][1]).toEqual(['install', 'lodash'])
91
+ expect(childProcess.spawn.mock.calls[0][0]).toEqual('pnpm install lodash')
100
92
  childProcess.spawn.mockReset()
101
93
  })
@@ -12,7 +12,6 @@ class packageManager {
12
12
 
13
13
  static spawnPackageManager(packageManagerOption) {
14
14
  let args = []
15
-
16
15
  args = args.concat(process.argv.slice(2)).filter((item) => {
17
16
  switch (item) {
18
17
  case '--packageManager':
@@ -24,7 +23,12 @@ class packageManager {
24
23
  }
25
24
  })
26
25
 
27
- const child = childProcess.spawn(packageManagerOption, args, {
26
+ let cmd = `${packageManagerOption}`
27
+ if (args.length > 0) {
28
+ cmd += ` ${args.join(' ')}`
29
+ }
30
+
31
+ const child = childProcess.spawn(cmd, {
28
32
  stdio: 'inherit',
29
33
  shell: true
30
34
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npq",
3
- "version": "3.10.0",
3
+ "version": "3.10.1",
4
4
  "description": "marshall your npm/npm package installs with high quality and class 🎖",
5
5
  "bin": {
6
6
  "npq": "./bin/npq.js",
@@ -1,17 +0,0 @@
1
- queue_rules:
2
- - name: Snyk PRs Queue
3
- conditions:
4
- - "check-success ~= .*"
5
-
6
- pull_request_rules:
7
- - name: Automatic merge Snyk PRs on Status Checks passing
8
- conditions:
9
- - title~=^\[Snyk\]
10
- - head~=^snyk-fix
11
- - base=main
12
- actions:
13
- queue:
14
- name: "Snyk PRs Queue"
15
- label:
16
- add:
17
- - "auto-merge"