sh-ui-cli 0.111.0 → 0.112.0
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/data/changelog/versions.json +12 -0
- package/package.json +1 -1
- package/src/create/templateManifest.js +1 -0
- package/templates/monorepo/packages/eslint-config/package.json +2 -1
- package/templates/monorepo/packages/eslint-config/sh-ui-discipline.js +62 -0
- package/templates/nextjs-app/_arch/flat/eslint.config.js +2 -0
- package/templates/nextjs-app/_arch/mes/eslint.config.js +2 -0
- package/templates/nextjs-app/eslint.config.js +2 -0
- package/templates/vite-app/eslint.config.js +2 -1
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$description": "sh-ui 릴리즈 노트 단일 소스. docs(React)와 showcase(Flutter)가 함께 읽는다. 새 릴리즈마다 맨 앞에 추가.",
|
|
4
4
|
"versions": [
|
|
5
|
+
{
|
|
6
|
+
"version": "0.112.0",
|
|
7
|
+
"date": "2026-05-22",
|
|
8
|
+
"title": "template — sh-ui-discipline ESLint 룰을 모노레포 스캐폴드에 기본 박음",
|
|
9
|
+
"type": "minor",
|
|
10
|
+
"highlights": [
|
|
11
|
+
"**`@workspace/eslint-config/sh-ui-discipline` 신규 export** — 모노레포 스캐폴드 시 `packages/eslint-config/sh-ui-discipline.js` 가 함께 생성. `no-restricted-syntax` 로 native `<button>`·`<input>`·`<select>`·`<textarea>`·`<label>` JSX 금지 + `@workspace/ui-core` 의 대응 컴포넌트 안내. AI 가 시안 mimic 으로 native + Tailwind 를 쓰는 패턴을 lint 단계에서 자동 차단 — 디자인 시스템 우회를 시끄럽게 실패시킨다.",
|
|
12
|
+
"**`nextjs-app` (fsd/flat/mes 3 arch) + `vite-app` 의 `eslint.config.js` 가 자동 적용** — 스캐폴드 직후 새 앱이 즉시 룰을 받는다. 예외는 `// eslint-disable-next-line no-restricted-syntax -- <이유>` 인라인 override.",
|
|
13
|
+
"**severity** — 모노레포 기본 `eslint-plugin-only-warn` 이 error → warning 다운그레이드. CI hard-fail 은 lint 스크립트에서 `--max-warnings 0` 으로 강제."
|
|
14
|
+
],
|
|
15
|
+
"url": "https://github.com/sanghyeonKim0201/sh-ui/releases/tag/v0.112.0"
|
|
16
|
+
},
|
|
5
17
|
{
|
|
6
18
|
"version": "0.111.0",
|
|
7
19
|
"date": "2026-05-22",
|
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ export const TEMPLATE_MANIFEST = {
|
|
|
30
30
|
"packages/eslint-config/next.js",
|
|
31
31
|
"packages/eslint-config/package.json",
|
|
32
32
|
"packages/eslint-config/react-internal.js",
|
|
33
|
+
"packages/eslint-config/sh-ui-discipline.js",
|
|
33
34
|
"packages/typescript-config/base.json",
|
|
34
35
|
"packages/typescript-config/nextjs.json",
|
|
35
36
|
"packages/typescript-config/package.json",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sh-ui 컴포넌트 우선 — native JSX 요소 금지 ESLint config.
|
|
3
|
+
*
|
|
4
|
+
* 시안 HTML 의 raw `<button class="btn-primary">` 같은 패턴을 Tailwind 로
|
|
5
|
+
* 그대로 옮기지 말고 `@workspace/ui-core` 의 sh-ui 컴포넌트를 사용한다.
|
|
6
|
+
* AI 가 시안 mimic 으로 native 를 쓰는 패턴을 자동 차단 — 디자인 시스템의
|
|
7
|
+
* 우회를 lint 단계에서 시끄럽게 실패시킨다.
|
|
8
|
+
*
|
|
9
|
+
* 사용 (앱의 eslint.config.js 에서):
|
|
10
|
+
* import { shUiDisciplineConfig } from "@workspace/eslint-config/sh-ui-discipline"
|
|
11
|
+
* export default [ ...otherConfigs, ...shUiDisciplineConfig ]
|
|
12
|
+
*
|
|
13
|
+
* 적용 범위: `**\/*.tsx` (앱 코드만 — `packages/ui/ui-core` 의 컴포넌트는
|
|
14
|
+
* 정의상 native 를 감싸므로 자체 lint 또는 별도 설정으로 분리).
|
|
15
|
+
*
|
|
16
|
+
* 진짜 필요한 예외(file/hidden input, form action 등) 만 인라인 override:
|
|
17
|
+
* // eslint-disable-next-line no-restricted-syntax -- <구체적 이유>
|
|
18
|
+
* <button ...>
|
|
19
|
+
*
|
|
20
|
+
* severity: monorepo 기본 `eslint-plugin-only-warn` 이 error → warning
|
|
21
|
+
* 다운그레이드한다. CI 에서 hard fail 하려면 lint 스크립트에 `--max-warnings 0`.
|
|
22
|
+
*
|
|
23
|
+
* Link 가 button 처럼 보여야 하면: sh-ui Button 의 `buttonVariants` cva 를
|
|
24
|
+
* 재사용한 helper 컴포넌트를 만들어 `<Link>` 에 적용한다.
|
|
25
|
+
*
|
|
26
|
+
* @type {import("eslint").Linter.Config[]}
|
|
27
|
+
*/
|
|
28
|
+
export const shUiDisciplineConfig = [
|
|
29
|
+
{
|
|
30
|
+
files: ["**/*.tsx"],
|
|
31
|
+
rules: {
|
|
32
|
+
"no-restricted-syntax": [
|
|
33
|
+
"error",
|
|
34
|
+
{
|
|
35
|
+
selector: "JSXOpeningElement[name.name='button']",
|
|
36
|
+
message:
|
|
37
|
+
"native <button> 금지 — '@workspace/ui-core/components/button' 의 <Button> 사용. Link 가 button 처럼 보여야 하면 sh-ui Button 의 buttonVariants 를 재사용한 helper 컴포넌트. 예외 시 // eslint-disable-next-line no-restricted-syntax -- <이유> 주석.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
selector: "JSXOpeningElement[name.name='input']",
|
|
41
|
+
message:
|
|
42
|
+
"native <input> 금지 — '@workspace/ui-core/components/input' 의 <Input> 사용. type='hidden' 같은 예외는 // eslint-disable-next-line 주석.",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
selector: "JSXOpeningElement[name.name='select']",
|
|
46
|
+
message:
|
|
47
|
+
"native <select> 금지 — '@workspace/ui-core/components/select' 의 <Select> 사용.",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
selector: "JSXOpeningElement[name.name='textarea']",
|
|
51
|
+
message:
|
|
52
|
+
"native <textarea> 금지 — '@workspace/ui-core/components/textarea' 의 <Textarea> 사용.",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
selector: "JSXOpeningElement[name.name='label']",
|
|
56
|
+
message:
|
|
57
|
+
"native <label> 금지 — '@workspace/ui-core/components/label' 의 <Label> 사용.",
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { nextJsConfig } from "@workspace/eslint-config/next-js"
|
|
2
2
|
import { flatConfig } from "@workspace/eslint-config/flat"
|
|
3
|
+
import { shUiDisciplineConfig } from "@workspace/eslint-config/sh-ui-discipline"
|
|
3
4
|
|
|
4
5
|
export default [
|
|
5
6
|
{
|
|
@@ -7,4 +8,5 @@ export default [
|
|
|
7
8
|
},
|
|
8
9
|
...nextJsConfig,
|
|
9
10
|
...flatConfig,
|
|
11
|
+
...shUiDisciplineConfig,
|
|
10
12
|
]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { nextJsConfig } from "@workspace/eslint-config/next-js"
|
|
2
2
|
import { mesConfig } from "@workspace/eslint-config/mes"
|
|
3
|
+
import { shUiDisciplineConfig } from "@workspace/eslint-config/sh-ui-discipline"
|
|
3
4
|
|
|
4
5
|
export default [
|
|
5
6
|
{
|
|
@@ -7,4 +8,5 @@ export default [
|
|
|
7
8
|
},
|
|
8
9
|
...nextJsConfig,
|
|
9
10
|
...mesConfig,
|
|
11
|
+
...shUiDisciplineConfig,
|
|
10
12
|
]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { nextJsConfig } from "@workspace/eslint-config/next-js"
|
|
2
2
|
import { fsdConfig } from "@workspace/eslint-config/fsd"
|
|
3
|
+
import { shUiDisciplineConfig } from "@workspace/eslint-config/sh-ui-discipline"
|
|
3
4
|
|
|
4
5
|
export default [
|
|
5
6
|
{
|
|
@@ -7,4 +8,5 @@ export default [
|
|
|
7
8
|
},
|
|
8
9
|
...nextJsConfig,
|
|
9
10
|
...fsdConfig,
|
|
11
|
+
...shUiDisciplineConfig,
|
|
10
12
|
]
|