@dotpi/tools 2.12.0 → 2.12.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/module",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "dotpi module management",
5
5
  "type": "module",
6
6
  "exports": {
@@ -13,5 +13,5 @@
13
13
  "globby": "^14.0.2",
14
14
  "pnpm": "^12.18.0"
15
15
  },
16
- "gitHead": "5e9245f39f6461239a7082bd749229a598474c92"
16
+ "gitHead": "a0e9b7158609d564e8696a93f6e86c00dcfdf29e"
17
17
  }
@@ -9,6 +9,8 @@ import * as echo from '@dotpi/javascript/echo.js';
9
9
  import { dotpiConfigurationGet } from './configuration.js';
10
10
  import { definitionGet } from './definition.js';
11
11
 
12
+ import { createRequire } from 'node:module';
13
+
12
14
  export function installCommandDefine({program}) {
13
15
  program
14
16
  .command('install [modules...]')
@@ -90,9 +92,17 @@ export async function install(modules = [], {
90
92
  path.join(dotpiModulesDestination, 'dotpi_modules')
91
93
  );
92
94
 
93
- const moduleDefinition = await definitionGet(moduleToInstall);
94
- const { name: moduleName } = moduleDefinition;
95
+ // Resolve pnpm's package.json, then read its "bin" entry
96
+ const require = createRequire(import.meta.url);
97
+ const pnpmPackagePath = require.resolve('pnpm/package.json');
98
+ const pnpmPackage = require(pnpmPackagePath);
99
+ const pnpmExecutableRelativePath = (typeof pnpmPackage.bin === 'string'
100
+ ? pnpmPackage.bin
101
+ : pnpmPackage.bin.pnpm
102
+ );
103
+ const pnpmExecutable = path.join(path.dirname(pnpmPackagePath), pnpmExecutableRelativePath);
95
104
 
105
+ // There is no prefix for pnpm install, use cwd of command
96
106
  cwd = dotpiModulesDestination;
97
107
  output = await $({
98
108
  cwd,
@@ -100,10 +110,10 @@ export async function install(modules = [], {
100
110
  verbose: (verbose === 'full' ? 'full' : 'none'),
101
111
  // full install with postinstall scripts for each request
102
112
  })`
103
- npx pnpm install
104
- --prod
105
- --dangerously-allow-all-builds
106
- --
113
+ ${pnpmExecutable} install
114
+ --prod
115
+ --dangerously-allow-all-builds
116
+ --
107
117
  ${moduleToInstall}
108
118
  `;
109
119
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/module-module",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "dotpi module management",
5
5
  "type": "module",
6
6
  "bin": "./bin/dotpi_module",
@@ -11,8 +11,8 @@
11
11
  "license": "BSD-3-clause",
12
12
  "dependencies": {
13
13
  "@dotpi/javascript": "^1.6.3",
14
- "@dotpi/module": "^1.11.0",
14
+ "@dotpi/module": "^1.11.1",
15
15
  "commander": "^12.1.0"
16
16
  },
17
- "gitHead": "5e9245f39f6461239a7082bd749229a598474c92"
17
+ "gitHead": "a0e9b7158609d564e8696a93f6e86c00dcfdf29e"
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/tools",
3
- "version": "2.12.0",
3
+ "version": "2.12.1",
4
4
  "description": "Set of scripts for managing dotpi fleets of Raspberry Pi",
5
5
  "author": "Jean-Philippe Lambert",
6
6
  "contributors": [
@@ -37,7 +37,7 @@
37
37
  "license": "BSD-3-Clause",
38
38
  "dependencies": {
39
39
  "@dotpi/javascript": "^1.6.3",
40
- "@dotpi/module": "^1.11.0",
40
+ "@dotpi/module": "^1.11.1",
41
41
  "chalk": "^5.3.0",
42
42
  "commander": "^12.1.0",
43
43
  "prompts": "^2.4.2",
@@ -46,5 +46,5 @@
46
46
  "devDependencies": {
47
47
  "lerna": "^8.2.4"
48
48
  },
49
- "gitHead": "5e9245f39f6461239a7082bd749229a598474c92"
49
+ "gitHead": "a0e9b7158609d564e8696a93f6e86c00dcfdf29e"
50
50
  }