@nosto/nosto-cli 1.2.2 → 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,6 +18,9 @@ jobs:
18
18
  - name: Install dependencies
19
19
  run: npm ci
20
20
 
21
+ - name: Audit dependencies
22
+ run: npm audit --audit-level=high
23
+
21
24
  - name: Run linting
22
25
  run: npm run lint
23
26
 
@@ -35,6 +38,9 @@ jobs:
35
38
  - name: Install dependencies
36
39
  run: npm ci
37
40
 
41
+ - name: Audit dependencies
42
+ run: npm audit --audit-level=high
43
+
38
44
  - name: Run TypeScript type checking
39
45
  run: npm run type-check
40
46
 
@@ -52,5 +58,8 @@ jobs:
52
58
  - name: Install dependencies
53
59
  run: npm ci
54
60
 
61
+ - name: Audit dependencies
62
+ run: npm audit --audit-level=high
63
+
55
64
  - name: Run tests
56
65
  run: npm run test
@@ -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"
@@ -31,11 +31,21 @@ jobs:
31
31
  - name: Install dependencies
32
32
  run: npm ci
33
33
 
34
+ - name: Audit dependencies
35
+ run: npm audit --audit-level=high
36
+
34
37
  - name: Run tests
35
38
  run: npm test
36
39
 
40
+ - name: Create GitHub App Token
41
+ id: app-token
42
+ uses: actions/create-github-app-token@b96fde71c0080358ed6e2d162f11c612c92a97d1
43
+ with:
44
+ app-id: ${{ secrets.APP_ID }}
45
+ private-key: ${{ secrets.APP_PRIVATE_KEY }}
46
+
37
47
  - name: Publish project
38
- uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0
48
+ uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90
39
49
  id: semantic
40
50
  with:
41
51
  semantic_version: 25.0.2
@@ -47,4 +57,4 @@ jobs:
47
57
  "main"
48
58
  ]
49
59
  env:
50
- GITHUB_TOKEN: ${{ secrets.RELEASE_PAT_TOKEN }}
60
+ GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosto/nosto-cli",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "main": "./src/index.ts",
5
5
  "bin": {
6
6
  "nosto": "./src/bootstrap.mjs"
@@ -45,7 +45,7 @@
45
45
  "@commitlint/cli": "^20.1.0",
46
46
  "@commitlint/config-conventional": "^20.0.0",
47
47
  "@eslint/js": "^9.37.0",
48
- "@types/node": "^24.7.2",
48
+ "@types/node": "^25.0.2",
49
49
  "@vitest/coverage-v8": "^4.0.6",
50
50
  "@vitest/ui": "^4.0.6",
51
51
  "eslint": "^9.37.0",
@@ -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))