slicejs-cli 2.5.0 → 2.5.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.
package/client.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  import { program } from "commander";
3
3
  import inquirer from "inquirer";
4
4
  import initializeProject from "./commands/init/init.js";
@@ -34,8 +34,9 @@ async function checkNodeVersion() {
34
34
  * Verifica la estructura de directorios
35
35
  */
36
36
  async function checkDirectoryStructure() {
37
- const srcPath = path.join(process.cwd(), 'src');
38
- const apiPath = path.join(process.cwd(), 'api');
37
+ const projectRoot = path.join(__dirname, '../../../../');
38
+ const srcPath = path.join(projectRoot, 'src');
39
+ const apiPath = path.join(projectRoot, 'api');
39
40
 
40
41
  const srcExists = await fs.pathExists(srcPath);
41
42
  const apiExists = await fs.pathExists(apiPath);
@@ -62,7 +63,7 @@ async function checkDirectoryStructure() {
62
63
  * Verifica sliceConfig.json
63
64
  */
64
65
  async function checkConfig() {
65
- const configPath = path.join(process.cwd(), 'src', 'sliceConfig.json');
66
+ const configPath = path.join(__dirname, '../../../../src/sliceConfig.json');
66
67
 
67
68
  if (!await fs.pathExists(configPath)) {
68
69
  return {
@@ -100,7 +101,7 @@ async function checkConfig() {
100
101
  * Verifica disponibilidad del puerto
101
102
  */
102
103
  async function checkPort() {
103
- const configPath = path.join(process.cwd(), 'src', 'sliceConfig.json');
104
+ const configPath = path.join(__dirname, '../../../../src/sliceConfig.json');
104
105
  let port = 3000;
105
106
 
106
107
  try {
@@ -144,7 +145,7 @@ async function checkPort() {
144
145
  * Verifica dependencias en package.json
145
146
  */
146
147
  async function checkDependencies() {
147
- const packagePath = path.join(process.cwd(), 'package.json');
148
+ const packagePath = path.join(__dirname, '../../../../package.json');
148
149
 
149
150
  if (!await fs.pathExists(packagePath)) {
150
151
  return {
@@ -188,7 +189,8 @@ async function checkDependencies() {
188
189
  * Verifica integridad de componentes
189
190
  */
190
191
  async function checkComponents() {
191
- const configPath = path.join(process.cwd(), 'src', 'sliceConfig.json');
192
+ const configPath = path.join(__dirname, '../../../../src/sliceConfig.json');
193
+ const projectRoot = path.join(__dirname, '../../../../');
192
194
 
193
195
  if (!await fs.pathExists(configPath)) {
194
196
  return {
@@ -206,7 +208,7 @@ async function checkComponents() {
206
208
  let componentIssues = 0;
207
209
 
208
210
  for (const [category, { path: compPath }] of Object.entries(componentPaths)) {
209
- const fullPath = path.join(process.cwd(), 'src', compPath);
211
+ const fullPath = path.join(projectRoot, 'src', compPath);
210
212
 
211
213
  if (await fs.pathExists(fullPath)) {
212
214
  const items = await fs.readdir(fullPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slicejs-cli",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "Command client for developing web applications with Slice.js framework",
5
5
  "main": "client.js",
6
6
  "bin": {