@modernpoacher/deps 2.2.47 → 2.2.49

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.
@@ -42,6 +42,7 @@ import {
42
42
  import debug from '#deps/src/common/debug'
43
43
 
44
44
  import {
45
+ NVM,
45
46
  BIN,
46
47
  PLATFORM
47
48
  } from '#deps/src/common/env'
@@ -61,11 +62,10 @@ import {
61
62
  DIRECTORY,
62
63
  REGISTRY,
63
64
  AUTHOR,
64
- NVM,
65
65
  getRegistryParameter,
66
66
  getForceParameter,
67
- getExportPath,
68
- getNvm
67
+ getNvm,
68
+ getBin
69
69
  } from '#deps/src/common'
70
70
 
71
71
  const log = debug('@modernpoacher/deps')
@@ -92,11 +92,11 @@ rm -rf node_modules package-lock.json
92
92
 
93
93
  const getNpmiCommands = PLATFORM === 'win32'
94
94
  ? (registry = REGISTRY, force = false) => trim(tidy(getRegistryParameter(registry, getForceParameter(force, 'npm i'))))
95
- : (registry = REGISTRY, force = false) => trim(tidy(getExportPath(getNvm(getRegistryParameter(registry, getForceParameter(force, 'npm i'))))))
95
+ : (registry = REGISTRY, force = false) => trim(tidy(getBin(getNvm(getRegistryParameter(registry, getForceParameter(force, 'npm i'))))))
96
96
 
97
97
  const getDepsCommands = PLATFORM === 'win32'
98
98
  ? (registry = REGISTRY, force = false) => trim(tidy(getRegistryParameter(registry, getForceParameter(force, 'deps'))))
99
- : (registry = REGISTRY, force = false) => trim(tidy(getExportPath(getNvm(getRegistryParameter(registry, getForceParameter(force, 'deps'))))))
99
+ : (registry = REGISTRY, force = false) => trim(tidy(getBin(getNvm(getRegistryParameter(registry, getForceParameter(force, 'deps'))))))
100
100
 
101
101
  export const DEPS = PLATFORM === 'win32'
102
102
  ? `bash "${join(BIN, '.\\bash\\deps.sh')}"`
package/bin/deps.mjs CHANGED
@@ -48,7 +48,7 @@ const {
48
48
  async function app () {
49
49
  log('Deps')
50
50
 
51
- const commander = new Command()
51
+ const commander = new Command(NAME)
52
52
 
53
53
  const {
54
54
  argv
@@ -557,7 +557,7 @@ async function executePath (directory, registry, force, message, author) {
557
557
  async function app () {
558
558
  log('Deps')
559
559
 
560
- const commander = new Command()
560
+ const commander = new Command(NAME)
561
561
 
562
562
  const {
563
563
  argv
@@ -44,7 +44,7 @@ log(`\`install\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
44
44
  async function app () {
45
45
  log('Deps')
46
46
 
47
- const commander = new Command()
47
+ const commander = new Command(NAME)
48
48
 
49
49
  const {
50
50
  argv
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.2.47",
3
+ "version": "2.2.49",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -63,17 +63,17 @@
63
63
  },
64
64
  "devDependencies": {
65
65
  "@sequencemedia/eslint-config-standard": "^0.2.89",
66
- "@sequencemedia/eslint-config-typescript": "^0.1.152",
67
- "@sequencemedia/eslint-merge": "^0.0.54",
66
+ "@sequencemedia/eslint-config-typescript": "^0.1.153",
67
+ "@sequencemedia/eslint-merge": "^0.0.55",
68
68
  "@types/chai": "^5.2.2",
69
69
  "@types/debug": "^4.1.12",
70
70
  "@types/mocha": "^10.0.10",
71
- "@types/node": "^24.6.2",
72
- "@typescript-eslint/parser": "^8.45.0",
71
+ "@types/node": "^24.7.0",
72
+ "@typescript-eslint/parser": "^8.46.0",
73
73
  "chai": "^6.2.0",
74
74
  "cross-env": "^10.1.0",
75
75
  "eslint": "^9.37.0",
76
- "eslint-plugin-jsdoc": "^60.8.0",
76
+ "eslint-plugin-jsdoc": "^60.8.3",
77
77
  "globals": "^16.4.0",
78
78
  "husky": "^9.1.7",
79
79
  "mocha": "^11.7.4"
@@ -21,14 +21,15 @@ const {
21
21
  } = JSON.parse(readFileSync(join(PATH, 'package.json')).toString('utf8'))
22
22
 
23
23
  const PLATFORM = platform()
24
- const HOMEDIR = homedir()
25
24
 
26
25
  const {
27
26
  env: {
28
- HOME
27
+ HOME = homedir()
29
28
  }
30
29
  } = process
31
30
 
31
+ const NVM = join(PATH, 'nvm.sh')
32
+
32
33
  const BIN = PLATFORM === 'win32'
33
34
  ? join(PATH, '.\\bin') // \\bash')
34
35
  : join(PATH, './bin') // /bash')
@@ -41,7 +42,7 @@ export {
41
42
  NAME,
42
43
  VERSION,
43
44
  PLATFORM,
44
- HOMEDIR,
45
45
  HOME,
46
+ NVM,
46
47
  BIN
47
48
  }
@@ -1,10 +1,15 @@
1
1
  import stripAnsi from 'strip-ansi'
2
2
 
3
+ import {
4
+ normalize,
5
+ resolve
6
+ } from 'node:path'
7
+
3
8
  import debug from '#deps/src/common/debug'
4
9
 
5
10
  import {
6
11
  PLATFORM,
7
- HOMEDIR
12
+ HOME
8
13
  } from '#deps/src/common/env'
9
14
 
10
15
  const log = debug('@modernpoacher/deps')
@@ -31,8 +36,12 @@ export function formatAuthor (name, email) {
31
36
  * @type {(directory: string) => string}
32
37
  */
33
38
  export const formatDirectory = PLATFORM === 'win32'
34
- ? (directory) => directory
35
- : (directory) => directory.includes(HOMEDIR) ? directory.replace(HOMEDIR, '~') : directory
39
+ ? (directory) => resolve(normalize(directory)).trim()
40
+ : (directory) => {
41
+ const d = resolve(normalize(directory)).trim()
42
+ if (d.startsWith(HOME)) return d.replace(new RegExp('^' + HOME), '~')
43
+ return d
44
+ }
36
45
 
37
46
  const LF = String.fromCodePoint(10)
38
47
 
@@ -5,16 +5,11 @@
5
5
  * @typedef {DepsTypes.Configuration} Configuration
6
6
  */
7
7
 
8
- import {
9
- join
10
- } from 'node:path'
11
-
12
- import PATH from '#where-am-i'
13
-
14
8
  import debug from '#deps/src/common/debug'
15
9
 
16
10
  import {
17
- PLATFORM
11
+ PLATFORM,
12
+ NVM
18
13
  } from '#deps/src/common/env'
19
14
 
20
15
  import {
@@ -29,8 +24,6 @@ export const REGISTRY = 'https://registry.npmjs.org'
29
24
 
30
25
  export const AUTHOR = 'Modern Poacher Limited <modernpoacher@modernpoacher.com>'
31
26
 
32
- export const NVM = join(PATH, 'nvm.sh')
33
-
34
27
  const log = debug('@modernpoacher/deps')
35
28
 
36
29
  log('`common` is awake')
@@ -129,13 +122,13 @@ export function getSaveExactParameter (commands) {
129
122
  }
130
123
 
131
124
  /**
132
- * @function getExportPath
125
+ * @function getBin
133
126
  * @description
134
127
  * Get the export PATH shell script
135
128
  * @param {string} commands - Current commands string
136
129
  * @returns {string}
137
130
  */
138
- export function getExportPath (commands) {
131
+ export function getBin (commands) {
139
132
  return `
140
133
  export PATH=/usr/local/bin:$PATH &> /dev/null
141
134
  ${commands}
@@ -165,7 +158,7 @@ ${commands}
165
158
  */
166
159
  export const getCommands = PLATFORM === 'win32'
167
160
  ? (commands = 'npm i') => trim(tidy(commands))
168
- : (commands = 'npm i') => trim(tidy(getExportPath(getNvm(commands))))
161
+ : (commands = 'npm i') => trim(tidy(getBin(getNvm(commands))))
169
162
 
170
163
  /**
171
164
  * @function getProdDependencies