@simplysm/sd-cli 14.0.78 → 14.0.79

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/sd-cli",
3
- "version": "14.0.78",
3
+ "version": "14.0.79",
4
4
  "description": "Simplysm package - CLI tool",
5
5
  "author": "simplysm",
6
6
  "license": "Apache-2.0",
@@ -45,9 +45,9 @@
45
45
  "ws": "^8.20.1",
46
46
  "yaml": "^2.9.0",
47
47
  "yargs": "^18.0.0",
48
- "@simplysm/core-common": "14.0.78",
49
- "@simplysm/storage": "14.0.78",
50
- "@simplysm/core-node": "14.0.78"
48
+ "@simplysm/storage": "14.0.79",
49
+ "@simplysm/core-node": "14.0.79",
50
+ "@simplysm/core-common": "14.0.79"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/semver": "^7.7.1",
@@ -1,8 +1,8 @@
1
1
  import { describe, it, expect, vi, beforeEach } from "vitest";
2
- import * as coreCommon from "@simplysm/core-common";
3
2
 
4
- // eslint은 외부 npm으로 ESM namespace immutable — vi.mock 유지
5
- const { mockLintFiles, mockLoadFormatter, MockESLintClass } = vi.hoisted(() => {
3
+ // lint-with-program.ts module-level 에서 createLogger 호출하므로
4
+ // import 평가 전에 mock 적용되어야 한다 — vi.mock 사용 (hoist 됨).
5
+ const { mockLintFiles, mockLoadFormatter, MockESLintClass, mockLintLogger } = vi.hoisted(() => {
6
6
  const lintFilesFn = vi.fn();
7
7
  const loadFormatterFn = vi.fn();
8
8
  const ESLintCls = vi.fn().mockImplementation(function () {
@@ -11,21 +11,31 @@ const { mockLintFiles, mockLoadFormatter, MockESLintClass } = vi.hoisted(() => {
11
11
  loadFormatter: loadFormatterFn,
12
12
  };
13
13
  });
14
- return { mockLintFiles: lintFilesFn, mockLoadFormatter: loadFormatterFn, MockESLintClass: ESLintCls };
14
+ const logger = {
15
+ debug: vi.fn(),
16
+ info: vi.fn(),
17
+ warn: vi.fn(),
18
+ error: vi.fn(),
19
+ };
20
+ return {
21
+ mockLintFiles: lintFilesFn,
22
+ mockLoadFormatter: loadFormatterFn,
23
+ MockESLintClass: ESLintCls,
24
+ mockLintLogger: logger,
25
+ };
15
26
  });
16
27
 
17
28
  vi.mock("eslint", () => ({
18
29
  ESLint: MockESLintClass,
19
30
  }));
20
31
 
21
- const mockLintLogger = {
22
- debug: vi.fn(),
23
- info: vi.fn(),
24
- warn: vi.fn(),
25
- error: vi.fn(),
26
- };
27
-
28
- vi.spyOn(coreCommon, "createLogger").mockReturnValue(mockLintLogger as any);
32
+ vi.mock("@simplysm/core-common", async () => {
33
+ const actual = await vi.importActual<typeof import("@simplysm/core-common")>("@simplysm/core-common");
34
+ return {
35
+ ...actual,
36
+ createLogger: vi.fn(() => mockLintLogger),
37
+ };
38
+ });
29
39
 
30
40
  import { LintWithProgramRunner } from "../../src/lint/lint-with-program";
31
41