elcrm 1.1.34 → 1.1.36
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
|
@@ -5187,14 +5187,14 @@ async function cmdPublish(parsed) {
|
|
|
5187
5187
|
if (!existsSync20(pkgPath)) {
|
|
5188
5188
|
throw new Error(`\u041D\u0435\u0442 ${PKG_NAME} \u0432 ${cwd}`);
|
|
5189
5189
|
}
|
|
5190
|
-
if (!existsSync20(publicPath)) {
|
|
5191
|
-
throw new Error(`\u041D\u0435\u0442 ${PUBLIC_NAME} \u0432 ${cwd}
|
|
5192
|
-
` + `\u0421\u043E\u0437\u0434\u0430\u0439\u0442\u0435 \u043C\u0430\u043D\u0438\u0444\u0435\u0441\u0442 \u0431\u0435\u0437 scripts/devDependencies \u0434\u043B\u044F npm.`);
|
|
5193
|
-
}
|
|
5194
5190
|
const local = readPackageJson(cwd);
|
|
5195
5191
|
if (!local?.name || !local.version) {
|
|
5196
5192
|
throw new Error(`${PKG_NAME}: \u043D\u0443\u0436\u043D\u044B \u043F\u043E\u043B\u044F name \u0438 version`);
|
|
5197
5193
|
}
|
|
5194
|
+
if (!existsSync20(publicPath)) {
|
|
5195
|
+
await publishPlain(cwd, local, parsed, dry, noCheck);
|
|
5196
|
+
return;
|
|
5197
|
+
}
|
|
5198
5198
|
let pub;
|
|
5199
5199
|
try {
|
|
5200
5200
|
pub = JSON.parse(readFileSync28(publicPath, "utf8"));
|
|
@@ -5248,6 +5248,34 @@ async function cmdPublish(parsed) {
|
|
|
5248
5248
|
}
|
|
5249
5249
|
console.log(`[publish] \u0433\u043E\u0442\u043E\u0432\u043E: ${local.name}@${local.version}`);
|
|
5250
5250
|
}
|
|
5251
|
+
async function publishPlain(cwd, local, parsed, dry, noCheck) {
|
|
5252
|
+
const access = parsed.options.access || (typeof local.publishConfig?.access === "string" ? local.publishConfig.access : "public");
|
|
5253
|
+
console.log(`[publish] ${local.name}@${local.version}`);
|
|
5254
|
+
console.log(`[publish] \u0431\u0435\u0437 ${PUBLIC_NAME} \u2014 npm publish \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E ${PKG_NAME}`);
|
|
5255
|
+
if (!noCheck && !dry) {
|
|
5256
|
+
await runPreChecks(cwd, local.scripts);
|
|
5257
|
+
} else if (noCheck) {
|
|
5258
|
+
console.log("[publish] \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u044B (--no-check)");
|
|
5259
|
+
}
|
|
5260
|
+
const npmArgs = buildNpmArgs(parsed, access);
|
|
5261
|
+
console.log(`[publish] npm ${npmArgs.join(" ")}`);
|
|
5262
|
+
if (dry) {
|
|
5263
|
+
console.log("[publish] --dry: publish \u043D\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u043B\u0441\u044F");
|
|
5264
|
+
return;
|
|
5265
|
+
}
|
|
5266
|
+
const r = spawnSync3("npm", npmArgs, {
|
|
5267
|
+
cwd,
|
|
5268
|
+
stdio: "inherit",
|
|
5269
|
+
env: process.env
|
|
5270
|
+
});
|
|
5271
|
+
if (r.error) {
|
|
5272
|
+
console.error(r.error.message);
|
|
5273
|
+
}
|
|
5274
|
+
if ((r.status ?? 1) !== 0) {
|
|
5275
|
+
process.exit(r.status ?? 1);
|
|
5276
|
+
}
|
|
5277
|
+
console.log(`[publish] \u0433\u043E\u0442\u043E\u0432\u043E: ${local.name}@${local.version}`);
|
|
5278
|
+
}
|
|
5251
5279
|
async function runPreChecks(cwd, scripts) {
|
|
5252
5280
|
const list = scripts ?? {};
|
|
5253
5281
|
const chain = [];
|
|
@@ -5386,7 +5414,7 @@ function showHelp() {
|
|
|
5386
5414
|
build [--client] [--url=\u2026] [--name=\u2026] [--dir=\u2026] [--folder=\u2026]
|
|
5387
5415
|
postbuild [--dir=./dist]
|
|
5388
5416
|
publish [--dry] [--no-check] [--dir=\u2026] [--access=\u2026] [--tag=\u2026] [--otp=\u2026]
|
|
5389
|
-
package.public.json \
|
|
5417
|
+
npm publish; \u0435\u0441\u043B\u0438 \u0435\u0441\u0442\u044C package.public.json \u2014 \u043F\u043E\u0434\u043C\u0435\u043D\u0430 \u043C\u0430\u043D\u0438\u0444\u0435\u0441\u0442\u0430 \u0438 \u043E\u0442\u043A\u0430\u0442
|
|
5390
5418
|
uuid
|
|
5391
5419
|
|
|
5392
5420
|
\u0424\u043B\u0430\u0433\u0438: -v/--version, -h/--help
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elcrm",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.36",
|
|
4
4
|
"description": "CLI @elcrm/*: doctor --fix (порядок проекта), update, css, docs, cursor, kit, migrate, publish",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,18 +48,6 @@
|
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=18"
|
|
50
50
|
},
|
|
51
|
-
"scripts": {
|
|
52
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target bun --format esm && bun build ./src/vite/plugin-css-scoped.ts --outfile ./dist/vite/plugin-css-scoped.js --target node --format esm --packages external && bun build ./src/vite/discover-lib.ts --outfile ./dist/vite/discover-lib.js --target node --format esm --packages external && bun build ./src/vite/concat-css.ts --outfile ./dist/vite/concat-css.js --target node --format esm --packages external && bun build ./src/vite/check-tokens.ts --outfile ./dist/vite/check-tokens.js --target node --format esm --packages external && bun build ./src/vite/postbuild.ts --outfile ./dist/vite/postbuild.js --target node --format esm --packages external && bun build ./src/vite/minify-css-vars.ts --outfile ./dist/vite/minify-css-vars.js --target node --format esm --packages external && node ./scripts/chmod-bin.mjs && node ./scripts/copy-vite-dts.mjs",
|
|
53
|
-
"dev": "bun run ./src/index.ts",
|
|
54
|
-
"elcrm": "bun run ./src/index.ts",
|
|
55
|
-
"test": "bun test src/lib/migrate src/lib/tidy.test.ts src/lib/kit src/vite",
|
|
56
|
-
"demo": "bun run scripts/dev-template.ts",
|
|
57
|
-
"demo:panel": "bun run scripts/dev-template.ts panel",
|
|
58
|
-
"demo:orbit": "bun run scripts/dev-template.ts orbit",
|
|
59
|
-
"link:local": "bun run build && bun link",
|
|
60
|
-
"prepublishOnly": "bun run test && bun run build",
|
|
61
|
-
"publish:npm": "npm publish"
|
|
62
|
-
},
|
|
63
51
|
"keywords": [
|
|
64
52
|
"elcrm",
|
|
65
53
|
"cli",
|
|
@@ -74,6 +62,9 @@
|
|
|
74
62
|
"bugs": {
|
|
75
63
|
"url": "https://elgit.ru/lib/elCRM.cli/issues"
|
|
76
64
|
},
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
},
|
|
77
68
|
"peerDependencies": {
|
|
78
69
|
"vite": ">=5.0.0"
|
|
79
70
|
},
|
|
@@ -81,10 +72,5 @@
|
|
|
81
72
|
"vite": {
|
|
82
73
|
"optional": true
|
|
83
74
|
}
|
|
84
|
-
},
|
|
85
|
-
"devDependencies": {
|
|
86
|
-
"@types/bun": "^1.2.18",
|
|
87
|
-
"typescript": "^5.8.2",
|
|
88
|
-
"vite": "^5.4.2"
|
|
89
75
|
}
|
|
90
76
|
}
|
|
@@ -127,7 +127,7 @@ elcrm init --template panel
|
|
|
127
127
|
elcrm init --template orbit --force --no-install
|
|
128
128
|
elcrm build --client [--url=…] [--name=…] [--dir=…] [--folder=…]
|
|
129
129
|
elcrm postbuild [--dir=./dist] # lib: склейка CSS после vite build
|
|
130
|
-
elcrm publish [--dry] [--no-check] # lib: package.public.json →
|
|
130
|
+
elcrm publish [--dry] [--no-check] # npm publish; lib: package.public.json → откат
|
|
131
131
|
elcrm uuid
|
|
132
132
|
elcrm -v / --help
|
|
133
133
|
```
|
|
@@ -56,7 +56,7 @@ import type { PricingPlan, HealthmapData, NavTreeItem } from "@elcrm/components"
|
|
|
56
56
|
- **ChatSplit** — ряд `list` + `messages` (`--chat-split-gap`). Не `SplitPane` (нет resize).
|
|
57
57
|
- **PageHead** — title + actions. `sup` — текст или Badge сразу после title (надстрочно; `0` скрыт). `sticky` — шапка прилипает к верху скролла (фон `--shell-bg`). `children` — фильтры/поиск под заголовком, отступ `--shell-gap`.
|
|
58
58
|
- **Section** — блок контента / auth / подраздел. Корень по умолчанию `<section>` (не `<main>` — его даёт Layout). Тело: `direction` / `gap` / `columns` как у Stack. Ряд кнопок в `actions` — `<Stack direction="row">`.
|
|
59
|
-
- **Layout / Header** — оболочка приложения. `Layout sidebar={<Sidebar />}` — ряд: меню слева + контент. `fixed={["header", "footer", "sidebar"]}` (по умолчанию) — эти слоты не скроллятся, крутится только `children`. `fixed={[]}` — поток страницы. Высота каркаса: `--layout-height` (`100dvh`).
|
|
59
|
+
- **Layout / Header** — оболочка приложения. `Layout sidebar={<Sidebar />}` — ряд: меню слева + контент. `fixed={["header", "footer", "sidebar"]}` (по умолчанию) — эти слоты не скроллятся, крутится только `children`. `fixed={[]}` — поток страницы. Высота каркаса: `--layout-height` (`100dvh`). Header ≥ **0.5.3**: слот `search` (не класть поиск в `actions` — иначе сжимается).
|
|
60
60
|
- **Sidebar** — левое меню приложения. `variant="cards"` (карточки) или `"plain"` (плоский backoffice). Только `groups` + `value` / `defaultValue` + `onValueChange`. Подменю: у пункта `items` + `defaultOpen`. Контроль раскрытия: `open` / `onOpenChange`. Клик по родителю только раскрывает; выбор — у листьев. Слоты: `brand`, `extra`, `footer`. Меню аккаунта: `footer` + `footerItems` + `onFooterValueChange` — chip + панель в цветах темы (`Dropdown tone="account"`, токены `--sidebar-account-*`). `version` под chip. Отступ вложенных: `--sidebar-indent`.
|
|
61
61
|
- **NavSections** — сайдбар **страницы** + панель (не замена Sidebar в Layout). У группы обязателен `value`. Подменю как у Sidebar. Панель: `resolveSection` (lazy) **или** готовые `children`. Клик по родителю только раскрывает.
|
|
62
62
|
- **TabSections** — горизонтальные вкладки + панель (`resolveSection` или `children`). Только табы без панели — `Menu variant="line"`.
|
|
@@ -66,7 +66,7 @@ import type { PricingPlan, HealthmapData, NavTreeItem } from "@elcrm/components"
|
|
|
66
66
|
- **Healthmap** — теплокарта (`data.days`). Слоты `brandName` / `brandSub` / `unit` / `hint`; locale: `months` / `weekdays` / `locale` / `loadingLabel` / `lastYearLabel`. Токены `--healthmap-cell`, `--healthmap-gap`, `--healthmap-l0`…`l4`.
|
|
67
67
|
- **PanelInfo** — выезд справа. Desktop — `aside`; узкий (`max-width: 56rem`) — `dialog` + `aria-modal`, focus trap, Escape не перебивает вложенный Popover. `open` / `defaultOpen` + `onOpenChange` (`onClose` — alias). Слоты: `children`, `footer`, `headerExtra`, `close`. Токены `--panel-info-*`.
|
|
68
68
|
- **ActionGroup** — ряд иконок в карточке / строке: `label` + `actions` и/или `children` (не group-`items`). Кнопки — `@elcrm/button`.
|
|
69
|
-
- **Toolbar** — фильтры над списком. `size` — токены `data-size` + `useToolbar()` (не cloneElement). Поля `@elcrm/form` ≥ 0.1.20 и `Dropdown` читают контекст. `align` / `width`. Токены `--toolbar-gap`, `--select-height` на `data-size`. Не `ActionGroup`.
|
|
69
|
+
- **Toolbar** — фильтры над списком. `size` — токены `data-size` + `useToolbar()` (не cloneElement). Поля `@elcrm/form` ≥ 0.1.20 и `Dropdown` читают контекст. `align` / `width`. Токены `--toolbar-gap`, `--select-height` на `data-size`. Search в Toolbar — без `width="s"` (fit-content сжимает); пакет ≥ **0.5.3** задаёт `min-width`. Не `ActionGroup`.
|
|
70
70
|
- **Popover** — portal у якоря. Канон: `trigger={(api) => <button {...api.anchorProps}>…</button>}` (без cloneElement). Узел-trigger — клик/ARIA на обёртке.
|
|
71
71
|
- **TextGroup** — две строки: `title` + `description` (без аватара; с аватаром — AvatarName).
|
|
72
72
|
- **Text** — короткий текст. `tone="muted"` → `--shell-color-muted`. `as` — тег (`p`/`span`/…). Не `className="muted"` в приложении.
|