slicejs-cli 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/postInstall.js +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slicejs-cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Command client for developing web applications with Slice.js",
5
5
  "main": "client.js",
6
6
  "scripts": {
package/postInstall.js CHANGED
@@ -1,8 +1,14 @@
1
+
1
2
  import fs from 'fs';
3
+ import path from 'path';
4
+
5
+ const __dirname = path.dirname(new URL(import.meta.url).pathname);
2
6
 
3
- // Ruta al package.json del proyecto que está instalando tu paquete
4
- const projectPackageJsonPath = './package.json';
7
+ // Retrocede un directorio desde __dirname para llegar al directorio principal del proyecto
8
+ const projectDirectory = path.resolve(__dirname, '..');
5
9
 
10
+ // Ruta al package.json del proyecto
11
+ const projectPackageJsonPath = path.join(projectDirectory, 'package.json');
6
12
 
7
13
  // Lee el contenido del package.json del proyecto
8
14
  fs.promises.readFile(projectPackageJsonPath, 'utf8')