sparkzen 1.2.0 → 1.2.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/dist/cli/index.js CHANGED
@@ -5,13 +5,14 @@ import { Command as Command5 } from "commander";
5
5
 
6
6
  // package.json
7
7
  var name = "sparkzen";
8
- var version = "1.2.0";
8
+ var version = "1.2.1";
9
9
 
10
10
  // src/cli/commands/app/build.ts
11
11
  import { Command } from "commander";
12
12
  import { bgGreenBright, bold } from "logfy-x";
13
13
  import { execSync } from "child_process";
14
14
  var build = new Command().name("build").description("Build the project").action(() => {
15
+ process.env.NODE_ENV = "production";
15
16
  const projectPath = process.cwd();
16
17
  console.log(`${bgGreenBright(bold(" \u{1F4E6} BUILD "))} Building the project...
17
18
  `);
@@ -32,6 +33,7 @@ import { bgBlue, bold as bold2 } from "logfy-x";
32
33
  import { execSync as execSync2 } from "child_process";
33
34
  import path from "path";
34
35
  var dev = new Command2().name("dev").description("Run the project in development mode").action(() => {
36
+ process.env.NODE_ENV = "dev";
35
37
  const projectPath = process.cwd();
36
38
  const tsxPath = path.join(projectPath, "node_modules", ".bin", process.platform === "win32" ? "tsx.cmd" : "tsx");
37
39
  console.log(`
package/dist/index.js CHANGED
@@ -28,17 +28,19 @@ var packageConfigs = {
28
28
 
29
29
  // src/core/functions/getConfig.ts
30
30
  var config = defaultConfig;
31
+ var isDev = process.env.NODE_ENV !== "production";
31
32
  var getConfig = async () => {
32
33
  return config;
33
34
  };
34
35
  var setConfig = async () => {
35
36
  if (await configFileExists()) {
36
- const fileConfig = await import(pathToFileURL(path.resolve(process.cwd(), packageConfigs.configFileName)).href);
37
+ const configPath = isDev ? path.resolve(process.cwd(), packageConfigs.configFileName.replace(".js", ".ts")) : path.resolve(process.cwd(), "dist", packageConfigs.configFileName);
38
+ const fileConfig = await import(pathToFileURL(configPath).href);
37
39
  config = { ...defaultConfig, ...fileConfig.config };
38
40
  }
39
41
  };
40
42
  var configFileExists = async () => {
41
- const filePath = path.resolve(process.cwd(), packageConfigs.configFileName);
43
+ const filePath = isDev ? path.resolve(process.cwd(), packageConfigs.configFileName.replace(".js", ".ts")) : path.resolve(process.cwd(), "dist", packageConfigs.configFileName);
42
44
  return await exists(filePath);
43
45
  };
44
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparkzen",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "license": "MIT",
5
5
  "author": "Matheus dos Santos Paixão",
6
6
  "type": "module",