@nosto/nosto-cli 1.2.3 → 1.2.4

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.
@@ -17,4 +17,8 @@ updates:
17
17
  vitest:
18
18
  patterns:
19
19
  - "@vitest/*"
20
- - "vitest"
20
+ - "vitest"
21
+ commitlint:
22
+ patterns:
23
+ - "@commitlint/*"
24
+ - "commitlint"
@@ -18,12 +18,12 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
20
  - name: Checkout current branch
21
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
22
22
  with:
23
23
  persist-credentials: false
24
24
 
25
25
  - name: Setup NodeJS
26
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v4.0.0
26
+ uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
27
27
  with:
28
28
  node-version: 24
29
29
  cache: "npm"
@@ -45,7 +45,7 @@ jobs:
45
45
  private-key: ${{ secrets.APP_PRIVATE_KEY }}
46
46
 
47
47
  - name: Publish project
48
- uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0
48
+ uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90
49
49
  id: semantic
50
50
  with:
51
51
  semantic_version: 25.0.2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosto/nosto-cli",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "main": "./src/index.ts",
5
5
  "bin": {
6
6
  "nosto": "./src/bootstrap.mjs"
@@ -4,7 +4,7 @@ import { cleanUrl } from "#api/utils.ts"
4
4
  import { Logger } from "#console/logger.ts"
5
5
  import { MissingConfigurationError } from "#errors/MissingConfigurationError.ts"
6
6
 
7
- import { authFileExists, getAuthFileMissingError, parseAuthFile } from "./authConfig.ts"
7
+ import { parseAuthFile } from "./authConfig.ts"
8
8
  import { getEnvConfig } from "./envConfig.ts"
9
9
  import { parseConfigFile } from "./fileConfig.ts"
10
10
  import {
@@ -48,10 +48,7 @@ export async function loadConfig({ projectPath, options, allowIncomplete }: Load
48
48
 
49
49
  const fullPath = resolve(projectPath)
50
50
  Logger.debug(`Loading configuration from folder: ${fullPath}`)
51
- if (!allowIncomplete && !authFileExists()) {
52
- throw getAuthFileMissingError()
53
- }
54
- const authConfig = parseAuthFile({ allowIncomplete })
51
+
55
52
  const searchTemplatesConfig = await parseSearchTemplatesConfigFile({ projectPath })
56
53
  const fileConfig = parseConfigFile({ projectPath, allowIncomplete })
57
54
  const envConfig = getEnvConfig()
@@ -63,6 +60,9 @@ export async function loadConfig({ projectPath, options, allowIncomplete }: Load
63
60
  ...fileConfig,
64
61
  ...envConfig
65
62
  }
63
+
64
+ const authConfig = parseAuthFile({ allowIncomplete: allowIncomplete || !!combinedConfig.apiKey })
65
+
66
66
  if (!combinedConfig.merchant && !allowIncomplete) {
67
67
  throw new MissingConfigurationError("Invalid configuration: Missing merchant ID")
68
68
  }
@@ -68,4 +68,9 @@ describe("Config", () => {
68
68
  /not implemented/
69
69
  )
70
70
  })
71
+
72
+ it("does not throw if auth file is missing while an api key is provided", async () => {
73
+ fs.mockConfigFile({ apiKey: "test-api-key" })
74
+ await expect(loadConfig({ projectPath: ".", options: {} })).resolves.not.toThrow()
75
+ })
71
76
  })
@@ -48,7 +48,6 @@ export function setupMockFileSystem() {
48
48
  const content = {
49
49
  ...getDefaultConfig(),
50
50
  merchant: "test-merchant",
51
- apiKey: "test-api-key",
52
51
  ...overrides
53
52
  }
54
53
  writeFileContent(".nosto.json", JSON.stringify(content))