@moltium/world-cli 0.1.14 → 0.1.15

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/dist/index.js +8 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -45,7 +45,8 @@ function generateWorldConfig(options) {
45
45
  port: options.dbConfig.port,
46
46
  database: options.dbConfig.database,
47
47
  user: options.dbConfig.user,
48
- password: options.dbConfig.password
48
+ password: options.dbConfig.password,
49
+ ...options.dbConfig.ssl && { ssl: true }
49
50
  }
50
51
  },
51
52
  ...options.persistenceType === "redis" && options.dbConfig && {
@@ -121,6 +122,7 @@ DB_PORT=${options.dbConfig?.port || "5432"}
121
122
  DB_NAME=${options.dbConfig?.database || "moltium_world"}
122
123
  DB_USER=${options.dbConfig?.user || "postgres"}
123
124
  DB_PASSWORD=${options.dbConfig?.password || ""}
125
+ DB_SSL=${options.dbConfig?.ssl ? "true" : "false"}
124
126
  `;
125
127
  } else if (options.persistenceType === "redis") {
126
128
  env += `
@@ -177,6 +179,7 @@ async function main() {
177
179
  if (process.env.DB_NAME) config.persistence.postgres.database = process.env.DB_NAME;
178
180
  if (process.env.DB_USER) config.persistence.postgres.user = process.env.DB_USER;
179
181
  if (process.env.DB_PASSWORD) config.persistence.postgres.password = process.env.DB_PASSWORD;
182
+ if (process.env.DB_SSL === 'true') config.persistence.postgres.ssl = true;
180
183
  } else if (config.persistence.type === 'redis') {
181
184
  if (!config.persistence.redis) config.persistence.redis = { host: 'localhost', port: 6379 };
182
185
  if (process.env.DB_HOST) config.persistence.redis.host = process.env.DB_HOST;
@@ -435,7 +438,8 @@ var initCommand = new Command("init").description("Initialize a new world projec
435
438
  { type: "input", name: "port", message: "PostgreSQL port:", default: "5432", validate: (v) => !isNaN(Number(v)) || "Must be a number" },
436
439
  { type: "input", name: "database", message: "Database name:", default: "moltium_world" },
437
440
  { type: "input", name: "user", message: "Database user:", default: "postgres" },
438
- { type: "password", name: "password", message: "Database password:", mask: "*" }
441
+ { type: "password", name: "password", message: "Database password:", mask: "*" },
442
+ { type: "confirm", name: "ssl", message: "Enable SSL? (required for Neon, Supabase, etc.):", default: (answers2) => answers2.host !== "localhost" && answers2.host !== "127.0.0.1" }
439
443
  ]);
440
444
  dbConfig.port = parseInt(dbConfig.port);
441
445
  } else if (persistenceAnswers.persistenceType === "redis") {
@@ -522,7 +526,7 @@ var initCommand = new Command("init").description("Initialize a new world projec
522
526
  "deploy:contracts": "moltium-world deploy"
523
527
  },
524
528
  dependencies: {
525
- "@moltium/world-core": "^0.1.14",
529
+ "@moltium/world-core": "^0.1.15",
526
530
  dotenv: "^16.4.0",
527
531
  ...persistenceAnswers.persistenceType === "sqlite" ? { "better-sqlite3": "^11.0.0" } : {},
528
532
  ...persistenceAnswers.persistenceType === "redis" ? { "ioredis": "^5.3.0" } : {},
@@ -941,7 +945,7 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
941
945
 
942
946
  // src/index.ts
943
947
  var program = new Command5();
944
- program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.14");
948
+ program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.15");
945
949
  program.addCommand(initCommand);
946
950
  program.addCommand(tokenCommand);
947
951
  program.addCommand(startCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moltium/world-cli",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "CLI tool for creating and managing Moltium World SDK projects",
5
5
  "license": "MIT",
6
6
  "keywords": [