@dotpi/tools 2.12.0 → 2.12.2

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.2",
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": "8e3d88682521a27d6e8b57e16b8292421db5a749"
17
17
  }
@@ -1,4 +1,3 @@
1
- import fs from 'node:fs/promises';
2
1
  import path from 'node:path';
3
2
 
4
3
  import { $ } from 'execa';
@@ -7,7 +6,8 @@ import { symlink } from '@dotpi/javascript/filesystem.js';
7
6
  import * as echo from '@dotpi/javascript/echo.js';
8
7
 
9
8
  import { dotpiConfigurationGet } from './configuration.js';
10
- import { definitionGet } from './definition.js';
9
+
10
+ import { pnpmExecutable } from './pnpm.js';
11
11
 
12
12
  export function installCommandDefine({program}) {
13
13
  program
@@ -90,9 +90,7 @@ export async function install(modules = [], {
90
90
  path.join(dotpiModulesDestination, 'dotpi_modules')
91
91
  );
92
92
 
93
- const moduleDefinition = await definitionGet(moduleToInstall);
94
- const { name: moduleName } = moduleDefinition;
95
-
93
+ // There is no prefix for pnpm install, use cwd of command
96
94
  cwd = dotpiModulesDestination;
97
95
  output = await $({
98
96
  cwd,
@@ -100,10 +98,10 @@ export async function install(modules = [], {
100
98
  verbose: (verbose === 'full' ? 'full' : 'none'),
101
99
  // full install with postinstall scripts for each request
102
100
  })`
103
- npx pnpm install
104
- --prod
105
- --dangerously-allow-all-builds
106
- --
101
+ ${pnpmExecutable} install
102
+ --prod
103
+ --dangerously-allow-all-builds
104
+ --
107
105
  ${moduleToInstall}
108
106
  `;
109
107
 
@@ -0,0 +1,16 @@
1
+ import { createRequire } from 'node:module';
2
+ import path from 'node:path';
3
+
4
+ // Resolve pnpm's package.json, then read its "bin" entry
5
+ const require = createRequire(import.meta.url);
6
+ const pnpmPackagePath = require.resolve('pnpm/package.json');
7
+ const pnpmPackage = require(pnpmPackagePath);
8
+ const pnpmExecutableRelativePath = (typeof pnpmPackage.bin === 'string'
9
+ ? pnpmPackage.bin
10
+ : pnpmPackage.bin.pnpm
11
+ );
12
+
13
+ export const pnpmExecutable = path.join(
14
+ path.dirname(pnpmPackagePath),
15
+ pnpmExecutableRelativePath,
16
+ );
@@ -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 { pnpmExecutable } from './pnpm.js';
13
+
12
14
  export async function uninstallCommandDefine({program}) {
13
15
  program
14
16
  .command('uninstall [modules...]')
@@ -161,7 +163,7 @@ export async function uninstall(modules = [], {
161
163
  env: { FORCE_COLOR: 'true' }, // do not remove colors
162
164
  verbose: (verbose === 'full' ? 'full' : 'none'),
163
165
  })`
164
- npx pnpm
166
+ ${pnpmExecutable}
165
167
  remove
166
168
  --
167
169
  ${moduleName}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/module-module",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
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.2",
15
15
  "commander": "^12.1.0"
16
16
  },
17
- "gitHead": "5e9245f39f6461239a7082bd749229a598474c92"
17
+ "gitHead": "8e3d88682521a27d6e8b57e16b8292421db5a749"
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.2",
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.2",
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": "8e3d88682521a27d6e8b57e16b8292421db5a749"
50
50
  }