@apexhub/apex-ui-react-source 1.2.0 → 1.2.1
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/README.md +18 -4
- package/bin/apex-ui-react-source.mjs +208 -24
- package/dist/files/AGENTS.md +2 -2
- package/dist/files/alert/llm.txt +1 -1
- package/dist/files/apex-provider/llm.txt +1 -1
- package/dist/files/auto-complete/llm.txt +1 -1
- package/dist/files/avatar/llm.txt +1 -1
- package/dist/files/breadcrumb/llm.txt +1 -1
- package/dist/files/button/llm.txt +1 -1
- package/dist/files/card/llm.txt +1 -1
- package/dist/files/cascader/llm.txt +1 -1
- package/dist/files/checkbox/llm.txt +1 -1
- package/dist/files/collapse/llm.txt +1 -1
- package/dist/files/date-picker/llm.txt +1 -1
- package/dist/files/divider/llm.txt +1 -1
- package/dist/files/drawer/llm.txt +1 -1
- package/dist/files/dropdown/llm.txt +1 -1
- package/dist/files/form/llm.txt +1 -1
- package/dist/files/grid/llm.txt +1 -1
- package/dist/files/image/llm.txt +1 -1
- package/dist/files/input/llm.txt +1 -1
- package/dist/files/input-number/llm.txt +1 -1
- package/dist/files/layout/llm.txt +1 -1
- package/dist/files/menu/llm.txt +1 -1
- package/dist/files/message/llm.txt +1 -1
- package/dist/files/modal/llm.txt +1 -1
- package/dist/files/notification/llm.txt +1 -1
- package/dist/files/pagination/llm.txt +1 -1
- package/dist/files/popover/llm.txt +1 -1
- package/dist/files/progress/llm.txt +1 -1
- package/dist/files/radio/llm.txt +1 -1
- package/dist/files/rate/llm.txt +1 -1
- package/dist/files/select/llm.txt +1 -1
- package/dist/files/skeleton/llm.txt +1 -1
- package/dist/files/spin/llm.txt +1 -1
- package/dist/files/steps/llm.txt +1 -1
- package/dist/files/switch/llm.txt +1 -1
- package/dist/files/table/llm.txt +1 -1
- package/dist/files/tabs/llm.txt +1 -1
- package/dist/files/tag/llm.txt +1 -1
- package/dist/files/tooltip/llm.txt +1 -1
- package/dist/files/tree/llm.txt +1 -1
- package/dist/files/tree-select/llm.txt +1 -1
- package/dist/files/typography/llm.txt +1 -1
- package/dist/files/upload/llm.txt +1 -1
- package/dist/manifest.json +44 -44
- package/package.json +11 -24
- package/template/_gitignore +5 -0
- package/template/index.html +12 -0
- package/template/src/App.tsx +25 -0
- package/template/src/main.tsx +14 -0
- package/template/tsconfig.app.json +22 -0
- package/template/tsconfig.json +4 -0
- package/template/tsconfig.node.json +16 -0
- package/template/vite.config.ts +8 -0
package/README.md
CHANGED
|
@@ -12,14 +12,28 @@ change it directly.
|
|
|
12
12
|
|
|
13
13
|
## Requirements / 前提
|
|
14
14
|
|
|
15
|
-
- React 19 and React DOM 19 already installed
|
|
15
|
+
- Existing projects: React 19 and React DOM 19 already installed. New folders: use `create` below.
|
|
16
16
|
- Node.js 20.19+.
|
|
17
17
|
- Commit your work first, so you can review what `init` adds. 先提交现有改动,方便查看 `init` 新增了什么。
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Create a project / 新建项目
|
|
20
|
+
|
|
21
|
+
在只有 `AGENTS.md` 等 AI 配置、还没有 `package.json` 的文件夹里运行:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx @apexhub/apex-ui-react-source@latest create
|
|
25
|
+
npm run build
|
|
26
|
+
npm run dev
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`create` 会一次写好 Vite + React 项目、`@` 别名、组件源码、Provider 和中文亮色示例页,并安装依赖。
|
|
30
|
+
已有文件发生冲突时会停止,不会覆盖。英文用 `--locale en_US`,暗色用 `--theme dark`。
|
|
31
|
+
此命令需要发布包含 `create` 的新版源码包;旧版本没有 `create`,修改包名不会为旧版增加命令。
|
|
32
|
+
|
|
33
|
+
## Install into an existing project / 接入已有项目
|
|
20
34
|
|
|
21
35
|
```bash
|
|
22
|
-
npx @apexhub/apex-ui-react-source init
|
|
36
|
+
npx @apexhub/apex-ui-react-source@latest init
|
|
23
37
|
```
|
|
24
38
|
|
|
25
39
|
This will:
|
|
@@ -69,7 +83,7 @@ of the folder tells AI assistants how to use and change the code.
|
|
|
69
83
|
|
|
70
84
|
```bash
|
|
71
85
|
# Files this project modified, deleted or added since install (read-only)
|
|
72
|
-
npx @apexhub/apex-ui-react-source status
|
|
86
|
+
npx @apexhub/apex-ui-react-source@latest status
|
|
73
87
|
|
|
74
88
|
# Move to the latest version and keep the project's edits (--dry-run to preview)
|
|
75
89
|
npx @apexhub/apex-ui-react-source@latest update
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* npx @apexhub/apex-ui-react-source
|
|
4
|
-
* npx @apexhub/apex-ui-react-source
|
|
5
|
-
* npx @apexhub/apex-ui-react-source
|
|
3
|
+
* npx @apexhub/apex-ui-react-source@latest create [--theme light|dark] [--locale zh_CN|en_US]
|
|
4
|
+
* npx @apexhub/apex-ui-react-source@latest init [options]
|
|
5
|
+
* npx @apexhub/apex-ui-react-source@latest status [--json]
|
|
6
|
+
* npx @apexhub/apex-ui-react-source@latest info [--cwd <path>] [--dir <path>] [--json]
|
|
6
7
|
* npx @apexhub/apex-ui-react-source@latest update [--dry-run] [--json]
|
|
7
8
|
*
|
|
8
9
|
* Copies the Apex UI React source into the project (default src/components/apex),
|
|
@@ -27,13 +28,17 @@ import { fileURLToPath } from 'node:url'
|
|
|
27
28
|
|
|
28
29
|
const PKG_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
29
30
|
const DIST = join(PKG_ROOT, 'dist')
|
|
31
|
+
const TEMPLATE = join(PKG_ROOT, 'template')
|
|
30
32
|
const DEFAULT_DIR = 'src/components/apex'
|
|
31
33
|
// Keep detecting earlier package names so a rename cannot mix source and compiled modes.
|
|
32
34
|
const COMPILED_PACKAGES = ['@apexhub/apex-ui-react', '@apex-ui/react', '@frontend/apex-ui--react']
|
|
33
35
|
|
|
34
|
-
const HELP = `Usage: npx @apexhub/apex-ui-react-source <command> [options]
|
|
36
|
+
const HELP = `Usage: npx @apexhub/apex-ui-react-source@latest <command> [options]
|
|
35
37
|
|
|
36
38
|
Commands:
|
|
39
|
+
create Start a new Vite + React project with Apex UI in the current folder, in one
|
|
40
|
+
step: project files, the @ alias, ApexProvider, a sample page and a single
|
|
41
|
+
dependency install. For folders without a package.json.
|
|
37
42
|
init Copy the Apex UI React components into your project as source code
|
|
38
43
|
status List the component files this project modified, deleted or added
|
|
39
44
|
since they were installed (read-only)
|
|
@@ -47,6 +52,8 @@ Options:
|
|
|
47
52
|
--pm <name> Package manager: pnpm | npm | yarn | bun (default: detected from lockfile)
|
|
48
53
|
--no-install Copy files and write apex.json, but only print the install command
|
|
49
54
|
--dry-run Show what would happen; change nothing
|
|
55
|
+
--theme <name> create: light (default) or dark
|
|
56
|
+
--locale <name> create: zh_CN (default) or en_US
|
|
50
57
|
--json status / update / info: print the result as JSON
|
|
51
58
|
--base <path> update: folder with the files of the currently installed version, used to
|
|
52
59
|
merge edited files (default: downloaded from the registry)
|
|
@@ -69,6 +76,8 @@ function parseArgs(argv) {
|
|
|
69
76
|
pm: null,
|
|
70
77
|
install: true,
|
|
71
78
|
dryRun: false,
|
|
79
|
+
theme: 'light',
|
|
80
|
+
locale: 'zh_CN',
|
|
72
81
|
}
|
|
73
82
|
const rest = [...argv]
|
|
74
83
|
while (rest.length) {
|
|
@@ -78,7 +87,7 @@ function parseArgs(argv) {
|
|
|
78
87
|
else if (arg === '--no-install') args.install = false
|
|
79
88
|
else if (arg === '--dry-run') args.dryRun = true
|
|
80
89
|
else if (arg === '--json') args.json = true
|
|
81
|
-
else if (
|
|
90
|
+
else if (['--dir', '--cwd', '--pm', '--base', '--theme', '--locale'].includes(arg)) {
|
|
82
91
|
const value = rest.shift()
|
|
83
92
|
if (!value || value.startsWith('-')) fail(`${arg} needs a value`)
|
|
84
93
|
args[arg.slice(2)] = value
|
|
@@ -219,21 +228,7 @@ function init(args) {
|
|
|
219
228
|
}
|
|
220
229
|
|
|
221
230
|
// 4. Copy, record, install.
|
|
222
|
-
|
|
223
|
-
const out = join(targetDir, relative(join(DIST, 'files'), file))
|
|
224
|
-
mkdirSync(dirname(out), { recursive: true })
|
|
225
|
-
writeFileSync(out, readFileSync(file))
|
|
226
|
-
}
|
|
227
|
-
const record = {
|
|
228
|
-
name: manifest.name,
|
|
229
|
-
version: manifest.version,
|
|
230
|
-
framework: manifest.framework,
|
|
231
|
-
dir: displayDir,
|
|
232
|
-
installedAt: new Date().toISOString(),
|
|
233
|
-
dependencies: manifest.dependencies,
|
|
234
|
-
files: manifest.files,
|
|
235
|
-
}
|
|
236
|
-
writeFileSync(apexJson, `${JSON.stringify(record, null, 2)}\n`)
|
|
231
|
+
copyPayload({ manifest, files, targetDir, displayDir, apexJson })
|
|
237
232
|
console.log(`\n✔ Copied ${files.length} files to ${displayDir}/ and wrote apex.json`)
|
|
238
233
|
|
|
239
234
|
const printable = [cmd, ...cmdArgs].join(' ')
|
|
@@ -261,11 +256,198 @@ Next steps:
|
|
|
261
256
|
Next.js App Router: do this in a 'use client' providers.tsx.
|
|
262
257
|
3. Import components from their folder, e.g. ${displayDir}/button
|
|
263
258
|
AI assistants: read ${displayDir}/AGENTS.md first. When you fix a component, add an entry to
|
|
264
|
-
${displayDir}/CHANGES.md; \`npx @apexhub/apex-ui-react-source status\` lists the files that were changed.
|
|
259
|
+
${displayDir}/CHANGES.md; \`npx @apexhub/apex-ui-react-source@latest status\` lists the files that were changed.
|
|
265
260
|
A newer version later: npx @apexhub/apex-ui-react-source@latest update (keeps the project's edits).
|
|
266
261
|
`)
|
|
267
262
|
}
|
|
268
263
|
|
|
264
|
+
/** Copies the component source into targetDir and writes apex.json next to it. */
|
|
265
|
+
function copyPayload({ manifest, files, targetDir, displayDir, apexJson }) {
|
|
266
|
+
for (const file of files) {
|
|
267
|
+
const out = join(targetDir, relative(join(DIST, 'files'), file))
|
|
268
|
+
mkdirSync(dirname(out), { recursive: true })
|
|
269
|
+
writeFileSync(out, readFileSync(file))
|
|
270
|
+
}
|
|
271
|
+
const record = {
|
|
272
|
+
name: manifest.name,
|
|
273
|
+
version: manifest.version,
|
|
274
|
+
framework: manifest.framework,
|
|
275
|
+
dir: displayDir,
|
|
276
|
+
installedAt: new Date().toISOString(),
|
|
277
|
+
dependencies: manifest.dependencies,
|
|
278
|
+
files: manifest.files,
|
|
279
|
+
}
|
|
280
|
+
writeFileSync(apexJson, `${JSON.stringify(record, null, 2)}\n`)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** Versions the new-project template was built and checked with. */
|
|
284
|
+
const TEMPLATE_DEPENDENCIES = { react: '^19.3.1', 'react-dom': '^19.3.1' }
|
|
285
|
+
const TEMPLATE_DEV_DEPENDENCIES = {
|
|
286
|
+
'@types/node': '^24.19.2',
|
|
287
|
+
'@types/react': '^19.3.0',
|
|
288
|
+
'@types/react-dom': '^19.3.0',
|
|
289
|
+
'@vitejs/plugin-react': '^6.3.0',
|
|
290
|
+
typescript: '~7.0.2',
|
|
291
|
+
vite: '^8.3.8',
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** Text of the sample page and the entry, per locale. */
|
|
295
|
+
const TEMPLATE_TEXT = {
|
|
296
|
+
zh_CN: {
|
|
297
|
+
htmlLang: 'zh-CN',
|
|
298
|
+
title: 'Apex UI 已经装好',
|
|
299
|
+
intro: '这是示例首页。直接用一句话告诉 AI 想要什么页面,它会替换这里的内容。',
|
|
300
|
+
button: '点我试试',
|
|
301
|
+
toast: '按钮可以正常使用',
|
|
302
|
+
},
|
|
303
|
+
en_US: {
|
|
304
|
+
htmlLang: 'en',
|
|
305
|
+
title: 'Apex UI is ready',
|
|
306
|
+
intro: 'This is a sample home page. Tell the AI what page you want and it will replace this.',
|
|
307
|
+
button: 'Try me',
|
|
308
|
+
toast: 'The button works',
|
|
309
|
+
},
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/** Template file -> path in the new project. npm drops .gitignore from packages, hence _gitignore. */
|
|
313
|
+
const TEMPLATE_FILES = {
|
|
314
|
+
'index.html': 'index.html',
|
|
315
|
+
'vite.config.ts': 'vite.config.ts',
|
|
316
|
+
'tsconfig.json': 'tsconfig.json',
|
|
317
|
+
'tsconfig.app.json': 'tsconfig.app.json',
|
|
318
|
+
'tsconfig.node.json': 'tsconfig.node.json',
|
|
319
|
+
_gitignore: '.gitignore',
|
|
320
|
+
'src/main.tsx': 'src/main.tsx',
|
|
321
|
+
'src/App.tsx': 'src/App.tsx',
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function packageName(cwd) {
|
|
325
|
+
const name = cwd
|
|
326
|
+
.split(sep)
|
|
327
|
+
.pop()
|
|
328
|
+
.toLowerCase()
|
|
329
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
330
|
+
.replace(/^[-._]+|[-._]+$/g, '')
|
|
331
|
+
return name || 'apex-app'
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function renderTemplate(file, values) {
|
|
335
|
+
let text = readFileSync(join(TEMPLATE, file), 'utf8').replace(
|
|
336
|
+
/\{\{(\w+)\}\}/g,
|
|
337
|
+
(_, key) => values[key],
|
|
338
|
+
)
|
|
339
|
+
if (file === 'src/main.tsx') {
|
|
340
|
+
text = text.replace('theme="light"', `theme="${values.theme}"`)
|
|
341
|
+
if (values.locale === 'en_US') {
|
|
342
|
+
text = text
|
|
343
|
+
.replace(
|
|
344
|
+
"import zhCN from '@/components/apex/locale/zh_CN'",
|
|
345
|
+
"import enUS from '@/components/apex/locale/en_US'",
|
|
346
|
+
)
|
|
347
|
+
.replace('locale={zhCN}', 'locale={enUS}')
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return text
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* New project in the current folder in one step. Files that are already there (AGENTS.md,
|
|
355
|
+
* .agents/ from the skill installer, a README) are left alone; only a file the template
|
|
356
|
+
* would replace stops it.
|
|
357
|
+
*/
|
|
358
|
+
function create(args) {
|
|
359
|
+
if (!existsSync(join(DIST, 'manifest.json'))) {
|
|
360
|
+
fail(
|
|
361
|
+
'This package has no payload (dist/manifest.json is missing). Reinstall @apexhub/apex-ui-react-source.',
|
|
362
|
+
)
|
|
363
|
+
}
|
|
364
|
+
if (!['light', 'dark'].includes(args.theme))
|
|
365
|
+
fail(`--theme must be light or dark (got ${args.theme})`)
|
|
366
|
+
if (!TEMPLATE_TEXT[args.locale]) fail(`--locale must be zh_CN or en_US (got ${args.locale})`)
|
|
367
|
+
const manifest = readJson(join(DIST, 'manifest.json'))
|
|
368
|
+
const cwd = resolve(args.cwd)
|
|
369
|
+
mkdirSync(cwd, { recursive: true })
|
|
370
|
+
if (existsSync(join(cwd, 'package.json'))) {
|
|
371
|
+
fail('This folder already has a project (package.json).', [
|
|
372
|
+
'To add Apex UI to it, run: npx @apexhub/apex-ui-react-source@latest init',
|
|
373
|
+
])
|
|
374
|
+
}
|
|
375
|
+
const targetDir = resolve(cwd, args.dir)
|
|
376
|
+
const rel = relative(cwd, targetDir)
|
|
377
|
+
if (!rel || rel.startsWith('..') || rel.includes(`..${sep}`)) {
|
|
378
|
+
fail(`--dir must be a folder inside the project (got ${args.dir}).`)
|
|
379
|
+
}
|
|
380
|
+
const displayDir = rel.split(sep).join('/')
|
|
381
|
+
const apexJson = join(dirname(targetDir), 'apex.json')
|
|
382
|
+
const conflicts = Object.entries(TEMPLATE_FILES)
|
|
383
|
+
.filter(([, out]) => out !== '.gitignore' && existsSync(join(cwd, out)))
|
|
384
|
+
.map(([, out]) => out)
|
|
385
|
+
if (existsSync(targetDir) && readdirSync(targetDir).length > 0) conflicts.push(`${displayDir}/`)
|
|
386
|
+
if (existsSync(apexJson)) conflicts.push(relative(cwd, apexJson).split(sep).join('/'))
|
|
387
|
+
if (conflicts.length) {
|
|
388
|
+
fail('Nothing was changed: these files already exist and would be replaced.', [
|
|
389
|
+
...conflicts.map((file) => `- ${file}`),
|
|
390
|
+
'Move them away, or start in an empty folder.',
|
|
391
|
+
])
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const name = packageName(cwd)
|
|
395
|
+
const values = { ...TEMPLATE_TEXT[args.locale], name, theme: args.theme, locale: args.locale }
|
|
396
|
+
const pm = args.pm ?? detectPackageManager(cwd)
|
|
397
|
+
if (!['pnpm', 'npm', 'yarn', 'bun'].includes(pm)) fail(`Unsupported package manager: ${pm}`)
|
|
398
|
+
console.log(`\nNew project "${name}" with Apex UI ${manifest.version} (source mode)`)
|
|
399
|
+
console.log(` theme: ${args.theme}, locale: ${args.locale}, components: ${displayDir}/`)
|
|
400
|
+
if (args.dryRun) {
|
|
401
|
+
console.log('\nDry run: nothing was changed.\n')
|
|
402
|
+
return
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
const pkg = {
|
|
406
|
+
name,
|
|
407
|
+
private: true,
|
|
408
|
+
version: '0.0.0',
|
|
409
|
+
type: 'module',
|
|
410
|
+
scripts: { dev: 'vite', build: 'tsc -b && vite build', preview: 'vite preview' },
|
|
411
|
+
dependencies: Object.fromEntries(
|
|
412
|
+
Object.entries({ ...TEMPLATE_DEPENDENCIES, ...manifest.dependencies }).sort(([a], [b]) =>
|
|
413
|
+
a.localeCompare(b),
|
|
414
|
+
),
|
|
415
|
+
),
|
|
416
|
+
devDependencies: TEMPLATE_DEV_DEPENDENCIES,
|
|
417
|
+
}
|
|
418
|
+
writeFileSync(join(cwd, 'package.json'), `${JSON.stringify(pkg, null, 2)}\n`)
|
|
419
|
+
for (const [file, out] of Object.entries(TEMPLATE_FILES)) {
|
|
420
|
+
if (out === '.gitignore' && existsSync(join(cwd, out))) continue
|
|
421
|
+
mkdirSync(dirname(join(cwd, out)), { recursive: true })
|
|
422
|
+
writeFileSync(join(cwd, out), renderTemplate(file, values))
|
|
423
|
+
}
|
|
424
|
+
const files = walk(join(DIST, 'files'))
|
|
425
|
+
copyPayload({ manifest, files, targetDir, displayDir, apexJson })
|
|
426
|
+
console.log(`\n✔ Wrote the project files and copied ${files.length} files to ${displayDir}/`)
|
|
427
|
+
|
|
428
|
+
const printable = pm === 'yarn' ? 'yarn' : `${pm} install`
|
|
429
|
+
if (args.install) {
|
|
430
|
+
console.log(`\n$ ${printable}`)
|
|
431
|
+
const result = spawnSync(pm, pm === 'yarn' ? [] : ['install'], {
|
|
432
|
+
cwd,
|
|
433
|
+
stdio: 'inherit',
|
|
434
|
+
shell: process.platform === 'win32',
|
|
435
|
+
})
|
|
436
|
+
if (result.status !== 0) {
|
|
437
|
+
fail('Dependency installation failed. The project files are in place; run this yourself:', [
|
|
438
|
+
printable,
|
|
439
|
+
])
|
|
440
|
+
}
|
|
441
|
+
} else {
|
|
442
|
+
console.log(`\nInstall the dependencies:\n ${printable}`)
|
|
443
|
+
}
|
|
444
|
+
console.log(`
|
|
445
|
+
Done. Start it with: ${pm === 'npm' ? 'npm run dev' : `${pm} dev`}
|
|
446
|
+
Open the "Local:" address it prints (Vite picks another port when 5173 is taken).
|
|
447
|
+
AI assistants: the sample page is src/App.tsx; read ${displayDir}/AGENTS.md before building pages.
|
|
448
|
+
`)
|
|
449
|
+
}
|
|
450
|
+
|
|
269
451
|
/** Files the project keeps inside the component folder that are not part of Apex UI itself. */
|
|
270
452
|
const PROJECT_NOTES = new Set(['CHANGES.md'])
|
|
271
453
|
|
|
@@ -369,7 +551,7 @@ function status(args) {
|
|
|
369
551
|
const apexJson = join(dirname(resolve(cwd, args.dir)), 'apex.json')
|
|
370
552
|
if (!existsSync(apexJson)) {
|
|
371
553
|
fail(`No ${relative(cwd, apexJson).split(sep).join('/')} found.`, [
|
|
372
|
-
'Apex UI is not installed in source mode here. Run: npx @apexhub/apex-ui-react-source init',
|
|
554
|
+
'Apex UI is not installed in source mode here. Run: npx @apexhub/apex-ui-react-source@latest init',
|
|
373
555
|
'If the components are in another folder, pass --dir <that folder>.',
|
|
374
556
|
])
|
|
375
557
|
}
|
|
@@ -463,7 +645,7 @@ function update(args) {
|
|
|
463
645
|
const apexJson = join(dirname(resolve(cwd, args.dir)), 'apex.json')
|
|
464
646
|
if (!existsSync(apexJson)) {
|
|
465
647
|
fail(`No ${relative(cwd, apexJson).split(sep).join('/')} found.`, [
|
|
466
|
-
'Apex UI is not installed in source mode here. Run: npx @apexhub/apex-ui-react-source init',
|
|
648
|
+
'Apex UI is not installed in source mode here. Run: npx @apexhub/apex-ui-react-source@latest init',
|
|
467
649
|
'If the components are in another folder, pass --dir <that folder>.',
|
|
468
650
|
])
|
|
469
651
|
}
|
|
@@ -702,6 +884,8 @@ if (args.version) {
|
|
|
702
884
|
console.log(readJson(join(PKG_ROOT, 'package.json')).version)
|
|
703
885
|
} else if (args.help || !args.command) {
|
|
704
886
|
console.log(HELP)
|
|
887
|
+
} else if (args.command === 'create') {
|
|
888
|
+
create(args)
|
|
705
889
|
} else if (args.command === 'init') {
|
|
706
890
|
init(args)
|
|
707
891
|
} else if (args.command === 'status') {
|
|
@@ -712,6 +896,6 @@ if (args.version) {
|
|
|
712
896
|
update(args)
|
|
713
897
|
} else {
|
|
714
898
|
fail(`Unknown command: ${args.command}`, [
|
|
715
|
-
'Available: init, status, update, info. Run with --help to see the options.',
|
|
899
|
+
'Available: create, init, status, update, info. Run with --help to see the options.',
|
|
716
900
|
])
|
|
717
901
|
}
|
package/dist/files/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Apex UI source (React) — rules for AI assistants
|
|
2
2
|
|
|
3
|
-
This folder is Apex UI 1.2.
|
|
3
|
+
This folder is Apex UI 1.2.1, installed as source code by `@apexhub/apex-ui-react-source`.
|
|
4
4
|
The code now belongs to this project: you may edit it.
|
|
5
5
|
|
|
6
6
|
## Using components
|
|
@@ -28,7 +28,7 @@ The code now belongs to this project: you may edit it.
|
|
|
28
28
|
- `data-slot` attributes are a public contract; avoid renaming or removing them.
|
|
29
29
|
- After fixing a component, append an entry to `CHANGES.md` in this folder (create it if
|
|
30
30
|
missing): date, component, files, why, what changed. Future updates and feedback to Apex UI
|
|
31
|
-
rely on it. `npx @apexhub/apex-ui-react-source status` lists the files that differ from the
|
|
31
|
+
rely on it. `npx @apexhub/apex-ui-react-source@latest status` lists the files that differ from the
|
|
32
32
|
installed version.
|
|
33
33
|
- To move to a newer Apex UI version run `npx @apexhub/apex-ui-react-source@latest update`: it keeps
|
|
34
34
|
the project's edits and lists the files that need a manual merge. Do not re-run `init` or
|
package/dist/files/alert/llm.txt
CHANGED
package/dist/files/card/llm.txt
CHANGED
package/dist/files/form/llm.txt
CHANGED
package/dist/files/grid/llm.txt
CHANGED
package/dist/files/image/llm.txt
CHANGED
package/dist/files/input/llm.txt
CHANGED
package/dist/files/menu/llm.txt
CHANGED
package/dist/files/modal/llm.txt
CHANGED