go-duck-cli 1.3.37 → 1.3.351

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.
@@ -2,11 +2,6 @@ import fs from 'fs-extra';
2
2
  import path from 'path';
3
3
  import chalk from 'chalk';
4
4
 
5
- const toKebabCase = (str) => {
6
- if (!str) return '';
7
- return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
8
- };
9
-
10
5
  export const generateConfigLoader = async (outputDir, configObj) => {
11
6
  const configDir = path.join(outputDir, 'config');
12
7
  await fs.ensureDir(configDir);
@@ -248,7 +243,7 @@ func LoadConfig() (*Config, error) {
248
243
  // Default values
249
244
  v.SetDefault("go-duck.server.rest.port", 8080)
250
245
  v.SetDefault("go-duck.server.rest.protocol", "json")
251
- v.SetDefault("go-duck.server.rest.api-path-prefix", "/${toKebabCase(configObj.name) || 'api'}/api")
246
+ v.SetDefault("go-duck.server.rest.api-path-prefix", "/${configObj.name || 'api'}/api")
252
247
  v.SetDefault("go-duck.security.rate-limit.rps", 100.0)
253
248
  v.SetDefault("go-duck.security.rate-limit.burst", 200)
254
249
  v.SetDefault("go-duck.logging.datadog.enabled", false)
@@ -18,7 +18,7 @@ export const generatePostmanCollection = async (config, entities, outputDir, ope
18
18
  item: [],
19
19
  variable: [
20
20
  { key: "host", value: "localhost", type: "string" },
21
- { key: "port", value: String(config.server?.rest?.port || 8080), type: "string" },
21
+ { key: "port", value: String(config.server?.port || 8080), type: "string" },
22
22
  { key: "tenant", value: "tenant_1", type: "string" },
23
23
  { key: "token", value: "", type: "string" },
24
24
  { key: "keycloak_url", value: config.security?.['keycloak-host'] || "http://localhost:8180", type: "string" },
@@ -17,7 +17,7 @@ export const generateSwaggerDocs = async (config, entities, outputDir, openEntit
17
17
  description: `Generated documentation for ${config.name} microservice`
18
18
  },
19
19
  servers: [
20
- { url: `http://localhost:${config.server?.rest?.port || 8080}`, description: 'Local Development Server' }
20
+ { url: `http://localhost:${config.server?.port || 8080}`, description: 'Local Development Server' }
21
21
  ],
22
22
  paths: {},
23
23
  components: {
package/index.js CHANGED
@@ -875,21 +875,13 @@ const generateYAMLConfigs = async (config, outputDir) => {
875
875
  delete cleanConfig.datasource['multitenancy-databases'];
876
876
  }
877
877
 
878
- const toKebabCase = (str) => {
879
- if (!str) return '';
880
- return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
881
- };
882
-
883
- const rawApiPrefix = cleanConfig.server?.rest?.['api-path-prefix'] || `/${cleanConfig.name || 'api'}/api`;
884
- const kebabApiPrefix = rawApiPrefix.split('/').map(segment => toKebabCase(segment)).join('/');
885
-
886
878
  const extendedConfig = {
887
879
  ...cleanConfig,
888
880
  server: {
889
881
  rest: {
890
882
  port: cleanConfig.server?.rest?.port || cleanConfig.server?.port || 8080,
891
883
  protocol: cleanConfig.server?.rest?.protocol || 'json',
892
- 'api-path-prefix': kebabApiPrefix
884
+ 'api-path-prefix': cleanConfig.server?.rest?.['api-path-prefix'] || `/${cleanConfig.name || 'api'}/api`
893
885
  },
894
886
  'read-timeout': cleanConfig.server?.['read-timeout'] || '30s',
895
887
  'write-timeout': cleanConfig.server?.['write-timeout'] || '30s',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "go-duck-cli",
3
- "version": "1.3.37",
3
+ "version": "1.3.351",
4
4
  "description": "The Ultimate Evolutionary Go Microservice Scaffolder.",
5
5
  "main": "index.js",
6
6
  "type": "module",