@pantoia/ui 0.8.0 → 0.10.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/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawnSync } from 'node:child_process';
3
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
4
- import { dirname, join } from 'node:path';
3
+ import { existsSync, lstatSync, mkdirSync, readFileSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
4
+ import { dirname, join, relative } from 'node:path';
5
5
  import { argv, cwd, exit, platform, stdin, stdout } from 'node:process';
6
6
  import { createInterface } from 'node:readline/promises';
7
7
  const HERE = join(import.meta.dirname, '..');
8
8
  const CONFIG = 'components.json';
9
- const AGENTS = 'agents/pantoia-ui.md';
10
- const AGENTS_TARGET = '.claude/agents/pantoia-ui.md';
9
+ const SKILL = 'node_modules/@pantoia/ui/skills/pantoia-design';
10
+ const SKILL_TARGET = '.claude/skills/pantoia-design';
11
11
  const STYLES = '@import "@pantoia/ui/tailwind.css";';
12
12
  const TAILWIND = /^@import\s+["']tailwindcss["'][^;]*;\s*$/;
13
13
  const IMPORTED = /@import\s+["']@pantoia\/ui\//;
@@ -124,19 +124,33 @@ async function copy(item, base, force) {
124
124
  }
125
125
  return skipped;
126
126
  }
127
- async function copyAgents() {
128
- const source = readFileSync(join(HERE, AGENTS), 'utf8');
129
- const target = join(cwd(), AGENTS_TARGET);
130
- if (existsSync(target) && readFileSync(target, 'utf8') === source)
131
- return version();
132
- if (!await confirm(`Claude Code 에이전트 파일 ${AGENTS_TARGET}을 만들까요?`, true))
133
- return undefined;
134
- if (existsSync(target) && !await confirm(`${AGENTS_TARGET} 파일이 이미 있어요. 덮어쓸까요?`))
135
- return undefined;
136
- mkdirSync(dirname(target), { recursive: true });
137
- writeFileSync(target, source);
138
- console.log(`${AGENTS_TARGET}을 만들었어요.`);
139
- return version();
127
+ function present(path) {
128
+ try {
129
+ lstatSync(path);
130
+ return true;
131
+ }
132
+ catch {
133
+ return false;
134
+ }
135
+ }
136
+ async function linkSkill() {
137
+ const target = join(cwd(), SKILL_TARGET);
138
+ const source = relative(dirname(target), join(cwd(), SKILL));
139
+ if (present(target) && lstatSync(target).isSymbolicLink() && readlinkSync(target) === source)
140
+ return;
141
+ if (!await confirm(`Claude Code 스킬 ${SKILL_TARGET}을 만들까요?`, true))
142
+ return;
143
+ if (present(target) && !await confirm(`${SKILL_TARGET}이 이미 있어요. 링크로 바꿀까요?`))
144
+ return;
145
+ try {
146
+ rmSync(target, { recursive: true, force: true });
147
+ mkdirSync(dirname(target), { recursive: true });
148
+ symlinkSync(source, target, 'dir');
149
+ console.log(`${SKILL_TARGET}을 만들었어요. ${SKILL}에 연결돼요.`);
150
+ }
151
+ catch {
152
+ console.log(`${SKILL_TARGET}을 만들지 못했어요. Windows에서는 개발자 모드를 켜고 다시 실행하세요.`);
153
+ }
140
154
  }
141
155
  function detect() {
142
156
  return LAYOUTS.find(layout => existsSync(join(cwd(), layout.css))) ?? LAYOUTS[0];
@@ -228,8 +242,8 @@ async function commandInit(args) {
228
242
  const { head, tail } = additions(text, fonts);
229
243
  const needed = head.length > 0 || tail.length > 0;
230
244
  const added = needed && await importStyles(css, head, tail);
231
- const agents = await copyAgents();
232
- writeConfig({ path, css, agents, components: {} });
245
+ await linkSkill();
246
+ writeConfig({ path, css, components: {} });
233
247
  if (stdin.isTTY)
234
248
  console.log('');
235
249
  console.log(`${CONFIG}을 만들었어요. 컴포넌트는 ${path}에 저장돼요.`);
@@ -349,9 +363,6 @@ async function commandDiff(args) {
349
363
  show(shown, readFileSync(target, 'utf8'), readFileSync(join(HERE, file.path), 'utf8'));
350
364
  }
351
365
  }
352
- const agents = join(cwd(), AGENTS_TARGET);
353
- if (names.length === 0 && config.agents && existsSync(agents))
354
- show(AGENTS_TARGET, readFileSync(agents, 'utf8'), readFileSync(join(HERE, AGENTS), 'utf8'));
355
366
  if (changed === 0)
356
367
  console.log('달라진 파일이 없어요.');
357
368
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pantoia/ui",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Pantoia Design System",
5
5
  "homepage": "https://design.pantoia.com",
6
6
  "repository": {
@@ -13,7 +13,7 @@
13
13
  "pantoia-ui": "./dist/index.js"
14
14
  },
15
15
  "files": [
16
- "agents/pantoia-ui.md",
16
+ "skills/pantoia-design/SKILL.md",
17
17
  "*/index.tsx",
18
18
  "*/index.module.css",
19
19
  "dist",
package/palette.css CHANGED
@@ -3,9 +3,9 @@
3
3
  --pds-gray-400:#b0b8c1; --pds-gray-500:#8b95a1; --pds-gray-600:#6b7684; --pds-gray-700:#4e5968;
4
4
  --pds-gray-800:#333d4b; --pds-gray-900:#191f28;
5
5
 
6
- --pds-brand-50:#f5f1fd; --pds-brand-100:#e4d6ff; --pds-brand-200:#ceb0ff; --pds-brand-300:#bb8ffa;
7
- --pds-brand-400:#aa74f2; --pds-brand-500:#9c63e4; --pds-brand-600:#8750c9; --pds-brand-700:#7543b0;
8
- --pds-brand-800:#633997; --pds-brand-900:#54317f;
6
+ --pds-brand-50:#e4ebf6; --pds-brand-100:#c7daf7; --pds-brand-200:#9fc1f8; --pds-brand-300:#78a7f9;
7
+ --pds-brand-400:#5c90f9; --pds-brand-500:#4c7bf7; --pds-brand-600:#4569ed; --pds-brand-700:#3e5eda;
8
+ --pds-brand-800:#3653c3; --pds-brand-900:#2e48aa;
9
9
 
10
10
  --pds-blue-50:#e8f3ff; --pds-blue-100:#c9e2ff; --pds-blue-200:#90c2ff; --pds-blue-300:#64a8ff;
11
11
  --pds-blue-400:#4593fc; --pds-blue-500:#3182f6; --pds-blue-600:#2272eb; --pds-blue-700:#1b64da;
@@ -29,9 +29,9 @@
29
29
  --pds-gray-400:#62626d; --pds-gray-500:#7e7e87; --pds-gray-600:#9e9ea4; --pds-gray-700:#c3c3c6;
30
30
  --pds-gray-800:#e4e4e5; --pds-gray-900:#ffffff;
31
31
 
32
- --pds-brand-50:#362949; --pds-brand-100:#462e66; --pds-brand-200:#583682; --pds-brand-300:#6b3fa0;
33
- --pds-brand-400:#8451c4; --pds-brand-500:#9c63e4; --pds-brand-600:#ad75f7; --pds-brand-700:#c094ff;
34
- --pds-brand-800:#d6baff; --pds-brand-900:#eadeff;
32
+ --pds-brand-50:#222f4e; --pds-brand-100:#23396f; --pds-brand-200:#29448e; --pds-brand-300:#3051af;
33
+ --pds-brand-400:#3d67d5; --pds-brand-500:#4c7bf7; --pds-brand-600:#6290ff; --pds-brand-700:#86aaff;
34
+ --pds-brand-800:#b1c8ff; --pds-brand-900:#d9e5ff;
35
35
 
36
36
  --pds-blue-50:#202c4d; --pds-blue-100:#23386a; --pds-blue-200:#25478c; --pds-blue-300:#265ab3;
37
37
  --pds-blue-400:#2970d9; --pds-blue-500:#3485fa; --pds-blue-600:#449bff; --pds-blue-700:#61b0ff;
@@ -1,6 +1,6 @@
1
1
  ---
2
- name: pantoia-ui
3
- description: PANTOIA Design System(@pantoia/ui)으로 화면을 만들거나 고칠 때 쓴다. 컴포넌트 고르기, 토큰과 클래스, 커스텀 값 추가, 컴포넌트 내려받기를 다룬다
2
+ name: pantoia-design
3
+ description: PANTOIA Design System(@pantoia/ui)으로 화면을 만들거나 고칠 때 쓴다. 컴포넌트 고르기, 토큰과 클래스, 커스텀 값 추가, 컴포넌트 내려받기를 다룬다. 사용자가 PANTOIA를 말하지 않아도 이 프로젝트에서 React 화면, 폼, 버튼, 색, 간격을 다루면 쓴다
4
4
  ---
5
5
 
6
6
  # @pantoia/ui