basklee-react 0.8.0 → 0.9.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/README.md CHANGED
@@ -43,7 +43,7 @@ page, or leaves the app on the first page. With `@capacitor/filesystem` and
43
43
  `@capacitor/share`, a purchased file is saved in the app and opened from the
44
44
  Android share sheet. Without the variable the website
45
45
  build is unchanged. Setup, build and release steps:
46
- [Android app guide](https://orionmarket.place/en/sandbox/android-app?framework=react).
46
+ [Android app guide](https://basklee.com/en/sandbox/android-app?framework=react).
47
47
 
48
48
  ```bash
49
49
  BASKLEE_APP_ORIGIN=https://shop.example.com npx next build
@@ -61,7 +61,7 @@ keyboard focus.
61
61
  ## Quick start from zero
62
62
 
63
63
  Your personal backend domain is already provided in your account at
64
- [orionmarket.place](https://orionmarket.place). You can change it there.
64
+ [basklee.com](https://basklee.com). You can change it there.
65
65
  Replace `your-project.orionplace.app` below with that domain and
66
66
  `shop.example.com` with the public domain of your own storefront.
67
67
  With Node.js 20.9+ and npm installed, run this from the parent folder;
@@ -354,10 +354,10 @@ storefront on your server; see [Install on your server](#install-on-your-server)
354
354
 
355
355
  Prepare a Linux server once with the Basklee server script: it installs
356
356
  Node.js, nginx and certbot and adds the `basklee` command
357
- ([server guide](https://orionmarket.place/en/sandbox/install)).
357
+ ([server guide](https://basklee.com/en/sandbox/install)).
358
358
 
359
359
  ```bash
360
- curl -fsSLo basklee.sh https://orionmarket.place/downloads/basklee.sh
360
+ curl -fsSLo basklee.sh https://basklee.com/downloads/basklee.sh
361
361
  sudo sh basklee.sh setup
362
362
  ```
363
363
 
@@ -378,7 +378,7 @@ certificate. Run it again after code or package updates; the service keeps its
378
378
  port. Options: `--name <service>`, `--port <port>`, `--user <user>`,
379
379
  `--no-build` (install the build already in the folder), `--no-domains`, `--yes`,
380
380
  `--dry-run`. Full guide:
381
- [Install a storefront](https://orionmarket.place/en/sandbox/install/storefront?framework=react).
381
+ [Install a storefront](https://basklee.com/en/sandbox/install/storefront?framework=react).
382
382
 
383
383
  ### Manage the service
384
384
 
@@ -597,28 +597,10 @@ Updates require the existing `basklee/settings.json` and `.generated.json`.
597
597
  Conflicting untracked files stop the source update before any writes. If dependency
598
598
  installation fails after source generation, run `npm install` and retry `update`.
599
599
 
600
- ### Projects made with orionplace-react
601
-
602
- The package was called `orionplace-react` until November 2026. In such a project
603
- run the same command:
604
-
605
- ```bash
606
- npx basklee-react update
607
- ```
608
-
609
- Before the usual update it renames the project's own files: the `orionplace/`
610
- folders, `Orionplace*` components, types and composables, `--orionplace-*` CSS
611
- variables, `ORIONPLACE_*` keys in `.env`, the `orionplace:*` scripts and the
612
- dependency in `package.json`. Files you edited stay edited; every file it changes
613
- is copied first, at its old path, into `.basklee-backup-<date>/`. Your
614
- `*.orionplace.app` backend address keeps its name. `--dry-run` lists the
615
- renames without changing anything. A server set up before the rename keeps its
616
- `orionplace` service names.
617
-
618
600
  ## Documentation
619
601
 
620
- - [Create a Next.js frontend](https://orionmarket.place/en/sandbox/new-project/react)
621
- - [Marketplace API documentation](https://orionmarket.place/en/sandbox/)
602
+ - [Create a Next.js frontend](https://basklee.com/en/sandbox/new-project/react)
603
+ - [Marketplace API documentation](https://basklee.com/en/sandbox/)
622
604
 
623
605
  ## Development
624
606
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { setupProject } from '../src/setup.mjs';
3
3
  import { updateProject } from '../src/update.mjs';
4
- import { installService } from '../src/install.mjs';
4
+ import { installService, serverName } from '../src/install.mjs';
5
5
  import { SERVICE_ACTIONS, SERVICE_ALIASES, controlService, findApp, printService } from '../src/service.mjs';
6
6
  import { sitemapCommand } from '../src/sitemap.mjs';
7
7
  import { readFile } from 'node:fs/promises';
@@ -18,7 +18,7 @@ From zero (Node.js 20.9+ with npm; run from the parent folder):
18
18
  npx basklee-react add frontend shop.example.com
19
19
  npm run dev
20
20
 
21
- Replace the backend with the domain from your orionmarket.place profile,
21
+ Replace the backend with the domain from your basklee.com profile,
22
22
  and the frontend with your storefront domain. Open Next.js's local URL;
23
23
  the storefront opens after Application Load succeeds.
24
24
 
@@ -40,7 +40,7 @@ On your Linux server (run from the project root):
40
40
  Builds the storefront, installs it as a system service (systemd or OpenRC)
41
41
  and, when the basklee server tool is set up, connects its domains with
42
42
  nginx and HTTPS. Run it again after changes or an update to rebuild and restart.
43
- Server tool: https://orionmarket.place/downloads/basklee.sh
43
+ Server tool: https://basklee.com/downloads/basklee.sh
44
44
 
45
45
  Manage the installed service (from the project root, or name it with --name):
46
46
  npx basklee-react status service, autostart, port and home page answer
@@ -113,7 +113,7 @@ try {
113
113
  console.log(`Domains: ${done.frontends.join(', ') || 'none yet'} -> ${done.backend || 'no backend yet'}`);
114
114
  console.log(`\n${done.unitPath}:\n${done.unit}`);
115
115
  } else {
116
- console.log(`\nInstalled basklee-${done.name} (port ${done.port}, user ${done.user}).`);
116
+ console.log(`\nInstalled ${serverName}-${done.name} (port ${done.port}, user ${done.user}).`);
117
117
  for (const domain of done.frontends) {
118
118
  if (!install.domains) console.log(` - ${domain}: not connected (--no-domains)`);
119
119
  else if (!done.connected) console.log(` - ${domain}: not connected to nginx (see above)`);
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "basklee-react",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Next.js 16 storefront for your Basklee marketplace: setup CLI, server API gateway, typed store and ready-made catalog, cart, checkout and account components in English, Russian and Spanish, plus an Android app build.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Basklee",
8
- "homepage": "https://orionmarket.place/en/sandbox/new-project/react",
8
+ "homepage": "https://basklee.com/en/sandbox/new-project/react",
9
9
  "keywords": [
10
10
  "react",
11
11
  "next",
package/src/install.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // Installs the built storefront as a system service on a Linux server and
2
2
  // connects its domains through the "basklee" server tool
3
- // (https://orionmarket.place/downloads/basklee.sh) when that tool is set up.
3
+ // (https://basklee.com/downloads/basklee.sh) when that tool is set up.
4
4
  import { spawn } from 'node:child_process';
5
5
  import { mkdir, readFile, readdir, rename, stat, writeFile } from 'node:fs/promises';
6
6
  import { existsSync } from 'node:fs';
@@ -19,13 +19,10 @@ export const framework = {
19
19
  environment: {},
20
20
  };
21
21
 
22
- // Servers set up before the rename to Basklee (2026-11) keep their names: /etc/orionplace, /srv/orionplace,
23
- // orionplace-<app> services and the "orionplace" server tool. New servers use basklee.
24
- export const serverName = (process.env.ORIONPLACE_ETC
25
- || (!process.env.BASKLEE_ETC && !existsSync('/etc/basklee') && existsSync('/etc/orionplace'))) ? 'orionplace' : 'basklee';
22
+ export const serverName = 'basklee';
26
23
 
27
24
  export const defaultPaths = {
28
- etc: process.env.BASKLEE_ETC || process.env.ORIONPLACE_ETC || `/etc/${serverName}`,
25
+ etc: process.env.BASKLEE_ETC || `/etc/${serverName}`,
29
26
  systemd: '/etc/systemd/system',
30
27
  openrc: '/etc/init.d',
31
28
  logs: `/var/log/${serverName}`,
@@ -214,7 +211,7 @@ async function ensureDomains(root, { yes }) {
214
211
  const ask = process.stdin.isTTY && !yes;
215
212
  if (!settings.backend) {
216
213
  if (!ask) throw new Error(`Set the personal backend first: npx basklee-${framework.id} set backend my-shop.orionplace.app`);
217
- log('Your personal backend is shown in your orionmarket.place profile, for example my-shop.orionplace.app.');
214
+ log('Your personal backend is shown in your basklee.com profile, for example my-shop.orionplace.app.');
218
215
  await setupProject({ cwd: root, field: 'backend', value: await prompt('Personal backend domain: ') });
219
216
  settings = await read();
220
217
  }
@@ -324,7 +321,7 @@ export async function installService({
324
321
  const owned = await run('chown', ['-R', `${account.uid}:${account.gid}`, root], { capture: true });
325
322
  if (owned.code) throw new Error(`Could not give ${root} to ${account.name}:\n${owned.output}`);
326
323
 
327
- log(`\n==> Installing the service basklee-${service} on port ${chosen}`);
324
+ log(`\n==> Installing the service ${serverName}-${service} on port ${chosen}`);
328
325
  await writeAtomic(unitPath, unit, systemd ? 0o644 : 0o755);
329
326
  await writeAtomic(join(paths.etc, 'apps', `${service}.conf`), conf);
330
327
  const steps = systemd
@@ -354,7 +351,7 @@ export async function installService({
354
351
  }
355
352
  } else if (domains) {
356
353
  log('\nThe basklee server tool is not set up, so nginx and HTTPS were not configured. Prepare the server:');
357
- log(' curl -fsSLo basklee.sh https://orionmarket.place/downloads/basklee.sh && sudo sh basklee.sh setup');
354
+ log(' curl -fsSLo basklee.sh https://basklee.com/downloads/basklee.sh && sudo sh basklee.sh setup');
358
355
  log(`Then run this install again. Or proxy your HTTPS site to http://127.0.0.1:${chosen} as basklee/README.md describes.`);
359
356
  }
360
357
  return { name: service, port: chosen, user: account.name, unitPath, frontends: settings.frontends, failed, connected: domains && Boolean(tool) };
@@ -5,7 +5,7 @@ export function projectReadme(settings, base = '') {
5
5
  return `# Your Basklee React integration
6
6
 
7
7
  This folder contains the integration source for your Next.js storefront.
8
- Your personal backend API is provided in your account at https://orionmarket.place.
8
+ Your personal backend API is provided in your account at https://basklee.com.
9
9
  You can change that backend domain in your account, then update this project.
10
10
 
11
11
  ## Quick start from zero
@@ -23,7 +23,7 @@ npm run dev
23
23
  \`\`\`
24
24
 
25
25
  Replace \`your-project.orionplace.app\` with the personal backend domain shown in
26
- your profile at [orionmarket.place](https://orionmarket.place), and
26
+ your profile at [basklee.com](https://basklee.com), and
27
27
  \`shop.example.com\` with your storefront domain. The first frontend also becomes
28
28
  the local MIMIC domain.
29
29
 
@@ -299,7 +299,7 @@ The shared client renews the token for the next action and returns the failed
299
299
  request; the customer retries explicitly. After confirmed login/logout, reset and refresh Application Load; these actions
300
300
  change application data and do not log in/out or delete cookies.
301
301
 
302
- [Cookie lifecycle and browser request example](https://orionmarket.place/en/sandbox/appload/react#session-cookies)
302
+ [Cookie lifecycle and browser request example](https://basklee.com/en/sandbox/appload/react#session-cookies)
303
303
 
304
304
  ### Rendering, navigation and failures
305
305
 
@@ -353,7 +353,7 @@ If installation fails after source generation, run \`npm install\` and retry.
353
353
  The quickest way: prepare the server with the Basklee server script,
354
354
  then run \`sudo npx basklee-react install\` in this folder. It builds the
355
355
  project, runs it as a system service and connects your domains with nginx and
356
- HTTPS. Steps: [Install a storefront](https://orionmarket.place/en/sandbox/install/storefront?framework=react).
356
+ HTTPS. Steps: [Install a storefront](https://basklee.com/en/sandbox/install/storefront?framework=react).
357
357
  Then manage it from this folder: \`npx basklee-react status\`, \`sudo npx basklee-react restart\`,
358
358
  \`sudo npx basklee-react stop\`, \`sudo npx basklee-react start\` and \`sudo npx basklee-react logs\`.
359
359
  \`sudo npx basklee-react uninstall\` (or \`cleanup\`) stops and removes the service; this folder stays.
@@ -427,7 +427,7 @@ Deploy the website first, then build the app with Capacitor 8. With
427
427
  client-only and sends every API request to that storefront through Capacitor's
428
428
  native HTTP (\`lib/basklee/nativeApp.ts\`). Without the variable the
429
429
  website build is unchanged. Steps:
430
- [Android app guide](https://orionmarket.place/en/sandbox/android-app?framework=react).
430
+ [Android app guide](https://basklee.com/en/sandbox/android-app?framework=react).
431
431
 
432
432
  \`\`\`bash
433
433
  BASKLEE_APP_ORIGIN=https://shop.example.com npx next build
@@ -436,7 +436,7 @@ npx cap sync android
436
436
 
437
437
  ## More documentation
438
438
 
439
- - [React package installation and domain setup](https://orionmarket.place/en/sandbox/new-project/react)
440
- - [Application Load](https://orionmarket.place/en/sandbox)
439
+ - [React package installation and domain setup](https://basklee.com/en/sandbox/new-project/react)
440
+ - [Application Load](https://basklee.com/en/sandbox)
441
441
  `;
442
442
  }
package/src/update.mjs CHANGED
@@ -1,16 +1,7 @@
1
1
  import { spawn } from 'node:child_process';
2
- import { readFileSync } from 'node:fs';
3
2
  import { resolve } from 'node:path';
4
- import { migrateLegacyProject } from './migrate.mjs';
5
3
  import { setupProject } from './setup.mjs';
6
4
 
7
- const PACKAGE = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
8
-
9
- function printMigration(done, dryRun) {
10
- console.log(`${dryRun ? 'Would rename' : 'Renamed'} this project from the old orionplace names to Basklee (${done.files.length} files changed, ${done.moved} moved; dependency ${done.dependency}).`);
11
- if (done.backup) console.log(`Backup of every changed file, at its old path: ${done.backup}/ (delete it after checking).`);
12
- }
13
-
14
5
  export function runNpm(args, cwd) {
15
6
  const npmCli = process.env.npm_execpath;
16
7
  const command = npmCli ? process.execPath : 'npm';
@@ -26,24 +17,15 @@ export function runNpm(args, cwd) {
26
17
 
27
18
  export async function updateProject({ cwd = process.cwd(), dryRun = false, local = false, npm = runNpm } = {}) {
28
19
  cwd = resolve(cwd);
29
- // A project made before the rename to Basklee is renamed first (migrate.mjs); the latest CLI does it.
30
- const legacy = await migrateLegacyProject({ cwd, dryRun: true, packageName: PACKAGE.name, version: PACKAGE.version });
31
20
  // Validate before downloading or writing; the latest CLI repeats preflight with its own templates.
32
- const preview = legacy ? null : await setupProject({ cwd, action: 'update', dryRun: true });
21
+ const preview = await setupProject({ cwd, action: 'update', dryRun: true });
33
22
  if (!local) {
34
23
  console.log('Checking the latest Basklee React release…');
35
24
  await npm(['exec', '--yes', '--prefer-online', '--package=basklee-react@latest', '--',
36
25
  'basklee-react', 'update', '--local', '--cwd', cwd, ...(dryRun ? ['--dry-run'] : [])], cwd);
37
26
  return null; // The latest CLI reports its own changes.
38
27
  }
39
- if (legacy && dryRun) {
40
- printMigration(legacy, true);
41
- for (const file of legacy.files) console.log(` ${file}`);
42
- console.log('The template update is planned after the rename: run update without --dry-run, then update --dry-run again.');
43
- return null;
44
- }
45
28
  if (dryRun) return preview;
46
- if (legacy) printMigration(await migrateLegacyProject({ cwd, packageName: PACKAGE.name, version: PACKAGE.version }), false);
47
29
  const result = await setupProject({ cwd, action: 'update' });
48
30
  try {
49
31
  await npm(['install', '--no-audit', '--no-fund'], cwd);
@@ -20,13 +20,13 @@ The API response tables also explain the following contracts / Таблицы о
20
20
 
21
21
  | API | Contract / Контракт |
22
22
  | --- | --- |
23
- | [cart_guest_get](https://orionmarket.place/en/sandbox/api/cart_guest_get) · [RU](https://orionmarket.place/ru/sandbox/api/cart_guest_get) | Checkout options and saved choices / Опции оформления и сохранённый выбор |
24
- | [invoices_get](https://orionmarket.place/en/sandbox/api/invoices_get) · [RU](https://orionmarket.place/ru/sandbox/api/invoices_get) | Transaction direction and refunds / Направление платежей и возвраты |
25
- | [subscriptions_get](https://orionmarket.place/en/sandbox/api/subscriptions_get) · [RU](https://orionmarket.place/ru/sandbox/api/subscriptions_get) | Subscription state, renewal and service data / Состояние подписки, продление и данные сервиса |
26
- | [profile_promocodes_get](https://orionmarket.place/en/sandbox/api/profile_promocodes_get) · [RU](https://orionmarket.place/ru/sandbox/api/profile_promocodes_get) | Issued codes and promotion conditions / Выданные коды и условия акций |
27
- | [orders_create](https://orionmarket.place/en/sandbox/api/orders_create) · [RU](https://orionmarket.place/ru/sandbox/api/orders_create) | Failure fields and recovery / Поля ошибок и исправление |
28
- | [profile_orders_get](https://orionmarket.place/en/sandbox/api/profile_orders_get) · [RU](https://orionmarket.place/ru/sandbox/api/profile_orders_get) | Ordered options, returns and downloads / Купленные опции, возвраты и загрузки |
29
- | [subscriptions_guest_search](https://orionmarket.place/en/sandbox/api/subscriptions_guest_search) · [RU](https://orionmarket.place/ru/sandbox/api/subscriptions_guest_search) | Plan parameters, units and headings / Параметры тарифа, единицы и подписи |
23
+ | [cart_guest_get](https://basklee.com/en/sandbox/api/cart_guest_get) · [RU](https://basklee.com/ru/sandbox/api/cart_guest_get) | Checkout options and saved choices / Опции оформления и сохранённый выбор |
24
+ | [invoices_get](https://basklee.com/en/sandbox/api/invoices_get) · [RU](https://basklee.com/ru/sandbox/api/invoices_get) | Transaction direction and refunds / Направление платежей и возвраты |
25
+ | [subscriptions_get](https://basklee.com/en/sandbox/api/subscriptions_get) · [RU](https://basklee.com/ru/sandbox/api/subscriptions_get) | Subscription state, renewal and service data / Состояние подписки, продление и данные сервиса |
26
+ | [profile_promocodes_get](https://basklee.com/en/sandbox/api/profile_promocodes_get) · [RU](https://basklee.com/ru/sandbox/api/profile_promocodes_get) | Issued codes and promotion conditions / Выданные коды и условия акций |
27
+ | [orders_create](https://basklee.com/en/sandbox/api/orders_create) · [RU](https://basklee.com/ru/sandbox/api/orders_create) | Failure fields and recovery / Поля ошибок и исправление |
28
+ | [profile_orders_get](https://basklee.com/en/sandbox/api/profile_orders_get) · [RU](https://basklee.com/ru/sandbox/api/profile_orders_get) | Ordered options, returns and downloads / Купленные опции, возвраты и загрузки |
29
+ | [subscriptions_guest_search](https://basklee.com/en/sandbox/api/subscriptions_guest_search) · [RU](https://basklee.com/ru/sandbox/api/subscriptions_guest_search) | Plan parameters, units and headings / Параметры тарифа, единицы и подписи |
30
30
 
31
31
  ## Cart loading / Загрузка корзины
32
32
 
@@ -157,7 +157,7 @@ The following tables describe the response and the supplied composition’s foll
157
157
  | Выбрать пункт выдачи | Запрос `cart_customer_delivery_points_get` получает те же ID отправления и типа, возвращая `page_data.items`. Передайте выбранный объект `point`, включая код, код города и адрес, вместе с этими ID в `cart_customer_delivery_pickup_set`. |
158
158
  | После успешного сохранения | Ответ содержит `page_data.delivery_price_is_estimate`, без обновлённого отправления. Контроллер корзины закрывает выбор и вызывает `cart_guest_get`, чтобы получить подтверждённые способ, адрес, даты и итоги. При отказе показывается ошибка. Если не удалась только повторная загрузка, обновите корзину без повторения успешного сохранения. |
159
159
 
160
- [English guide](https://orionmarket.place/en/sandbox/components/react/cart-delivery-selector) · [Русский](https://orionmarket.place/ru/sandbox/components/react/cart-delivery-selector)
160
+ [English guide](https://basklee.com/en/sandbox/components/react/cart-delivery-selector) · [Русский](https://basklee.com/ru/sandbox/components/react/cart-delivery-selector)
161
161
 
162
162
  ## Parent cart loading / Загрузка корзины
163
163
 
@@ -169,4 +169,4 @@ The following tables describe the response and the supplied composition’s foll
169
169
  | `option_group_required` | True помечает группу обязательной. Для текста нужен непустой сохранённый текст, для файла — сохранённое имя, для товарной группы — опция с положительным количеством. |
170
170
  | Очистка | `cart_customer_option_cleanup_additional` получает `option_group_id: group.id` и очищает сохранённые текст/файл. Ошибка сохранения сохраняет локальный ввод; подтверждённое сохранение обновляет корзину. |
171
171
 
172
- [English guide](https://orionmarket.place/en/sandbox/components/react/cart-item-options) · [Русский](https://orionmarket.place/ru/sandbox/components/react/cart-item-options)
172
+ [English guide](https://basklee.com/en/sandbox/components/react/cart-item-options) · [Русский](https://basklee.com/ru/sandbox/components/react/cart-item-options)
@@ -135,4 +135,4 @@ The following tables describe the response and the supplied composition’s foll
135
135
  | Удаление в CHECKOUT | Передайте `product.dlf_id` как `dlf_item_id` в `cart_customer_remove_by_dlf_item`. После подтверждения загрузите все отправки и суммы корзины заново. |
136
136
  | Недоступные или неполные данные | `unavailable` скрывает редактирование количества. Если суммы позиции отправки/корзины отсутствуют, выводится `product.product_price_dict`; эта цена не подтверждает итог оформления. |
137
137
 
138
- [English guide](https://orionmarket.place/en/sandbox/components/react/cart-line-item) · [Русский](https://orionmarket.place/ru/sandbox/components/react/cart-line-item)
138
+ [English guide](https://basklee.com/en/sandbox/components/react/cart-line-item) · [Русский](https://basklee.com/ru/sandbox/components/react/cart-line-item)
@@ -89,4 +89,4 @@ The following tables describe the response and the supplied composition’s foll
89
89
  | Полученные `link` и `link_type` | Описывают следующую страницу оплаты. Родитель при необходимости передаёт их в `PaymentPanel` и загружает `profile_orders_get`. Пустая ссылка может означать, что внешняя страница не нужна; результат подтверждает обновлённое состояние платежа/заказа. |
90
90
  | `onCancel` / `pending` | Cancel без данных просит родителя закрыть форму. Pending блокирует выбор и обе кнопки. Ошибка сохранения оставляет форму и выбранный способ для исправления. |
91
91
 
92
- [English guide](https://orionmarket.place/en/sandbox/components/react/order-payment-form) · [Русский](https://orionmarket.place/ru/sandbox/components/react/order-payment-form)
92
+ [English guide](https://basklee.com/en/sandbox/components/react/order-payment-form) · [Русский](https://basklee.com/ru/sandbox/components/react/order-payment-form)
@@ -111,4 +111,4 @@ The following tables describe the response and the supplied composition’s foll
111
111
  | `onRefresh` | Событие без данных при проверке состояния. Кошелёк обновляет платежи и баланс профиля; страница заказов загружает `profile_orders_get`. |
112
112
  | `onClose` | Событие без данных. Готовый родитель скрывает панель и обновляет те же данные кошелька или заказа. Закрытие меняет видимость панели, а завершение оплаты определяется полученным состоянием платежа/заказа. |
113
113
 
114
- [English guide](https://orionmarket.place/en/sandbox/components/react/payment-panel) · [Русский](https://orionmarket.place/ru/sandbox/components/react/payment-panel)
114
+ [English guide](https://basklee.com/en/sandbox/components/react/payment-panel) · [Русский](https://basklee.com/ru/sandbox/components/react/payment-panel)
@@ -180,4 +180,4 @@ The following tables describe the response and the supplied composition’s foll
180
180
  | Отмена продления | Подписка активна, `cancelled_date` отсутствует, у тарифа есть периоды или уже настроено продление. |
181
181
  | После подтверждённого изменения | Загрузите `subscriptions_get` и `profile_get`: используйте полученные тариф, даты, продление, признак ожидания и баланс. Если обновление не удалось, повторите его до следующего действия с оплатой. |
182
182
 
183
- [English guide](https://orionmarket.place/en/sandbox/components/react/subscriptions) · [Русский](https://orionmarket.place/ru/sandbox/components/react/subscriptions)
183
+ [English guide](https://basklee.com/en/sandbox/components/react/subscriptions) · [Русский](https://basklee.com/ru/sandbox/components/react/subscriptions)
@@ -113,4 +113,4 @@ The following tables describe the response and the supplied composition’s foll
113
113
  | `sales_module`, `blog_module`, `qr_module` | Логические признаки модулей продаж, блога и QR-маркировки остатков. Справочник встроенных параметров находится в `subscriptions_guest_search`. |
114
114
  | Параметр уже показан рядом с использованием | Его предел исключается из отдельного списка параметров тарифа, чтобы выводиться один раз. |
115
115
 
116
- [English guide](https://orionmarket.place/en/sandbox/components/react/subscription-plan) · [Русский](https://orionmarket.place/ru/sandbox/components/react/subscription-plan)
116
+ [English guide](https://basklee.com/en/sandbox/components/react/subscription-plan) · [Русский](https://basklee.com/ru/sandbox/components/react/subscription-plan)
@@ -114,7 +114,7 @@ The following tables describe the response and the supplied composition’s foll
114
114
  | Пример пакета | `host: shop.example` и `enabled: false` дают две строки. Вложенный объект `settings` по умолчанию не выводится. Явный список fields только с `host` оставляет лишь это сведение. |
115
115
  | Собственные сведения | `renderDetails(data, entries)` получает исходные данные сервиса и отфильтрованные записи. Выберите поля для отображения. |
116
116
 
117
- [English guide](https://orionmarket.place/en/sandbox/components/react/subscription-remote) · [Русский](https://orionmarket.place/ru/sandbox/components/react/subscription-remote)
117
+ [English guide](https://basklee.com/en/sandbox/components/react/subscription-remote) · [Русский](https://basklee.com/ru/sandbox/components/react/subscription-remote)
118
118
 
119
119
  ## Initial service setup / Первичная настройка сервиса
120
120
 
@@ -106,4 +106,4 @@ The following tables describe the response and the supplied composition’s foll
106
106
  | Нет доступного оплаченного периода; средств недостаточно | Настройка продления успешно сохраняется, но период не покупается. Покажите текущую дату окончания и баланс; для оплаты продления покупателю нужно пополнить баланс. |
107
107
  | После `onSubmit` | Родитель отправляет запрос и загружает `subscriptions_get` и `profile_get`. `renew_period` подтверждает настройку; `active_until` и признак синхронизации определяют состояние доступа. Успех сам по себе подтверждает сохранение настройки, но не новый оплаченный доступ. |
108
108
 
109
- [English guide](https://orionmarket.place/en/sandbox/components/react/subscription-renewal) · [Русский](https://orionmarket.place/ru/sandbox/components/react/subscription-renewal)
109
+ [English guide](https://basklee.com/en/sandbox/components/react/subscription-renewal) · [Русский](https://basklee.com/ru/sandbox/components/react/subscription-renewal)
@@ -151,4 +151,4 @@ The following tables describe the response and the supplied composition’s foll
151
151
  | `refunds[].status.int` | Позиция возврата описывает операцию возврата. Завершение подтверждает только `EInvoiceStatus.COMPLETED`; `to_balance` указывает возврат на баланс или исходный способ оплаты. |
152
152
  | Проверка состояния или закрытие | Готовый кошелёк загружает `invoices_get` и `profile_get`, затем берёт баланс из `wallet` текущего профиля. Оплату подтверждает полученное состояние; открытие или закрытие `PaymentPanel` само по себе её не подтверждает. |
153
153
 
154
- [English guide](https://orionmarket.place/en/sandbox/components/react/wallet) · [Русский](https://orionmarket.place/ru/sandbox/components/react/wallet)
154
+ [English guide](https://basklee.com/en/sandbox/components/react/wallet) · [Русский](https://basklee.com/ru/sandbox/components/react/wallet)
package/src/migrate.mjs DELETED
@@ -1,124 +0,0 @@
1
- // Projects made before the rename to Basklee (2026-11) use the orionplace-<framework> package, the orionplace/
2
- // folders, Orionplace* names and ORIONPLACE_* settings. update renames them in the project's own files first, so
3
- // the template update that follows sees an ordinary Basklee project. Domains *.orionplace.app keep their name.
4
- import { createHash } from 'node:crypto';
5
- import { existsSync } from 'node:fs';
6
- import { mkdir, readdir, readFile, rm, rmdir, stat, writeFile } from 'node:fs/promises';
7
- import { dirname, join, relative, sep } from 'node:path';
8
-
9
- const OLD_DIR = 'orionplace';
10
- const SKIP_DIRS = new Set(['node_modules', '.git', '.nuxt', '.output', '.next', '.svelte-kit', '.vercel', '.netlify',
11
- 'dist', 'build', '.gradle', '.cache', '.turbo']);
12
- const MAX_BYTES = 5 * 1024 * 1024;
13
- const RULES = [
14
- [/Orion ?Marketplace(?!\.app\b)/g, 'Basklee'], // the product's old name in comments copied from the templates
15
- [/ORIONPLACE(?!\.APP\b)/g, 'BASKLEE'],
16
- [/Orionplace(?!\.app\b)/g, 'Basklee'],
17
- [/orionplace(?!\.app\b)/g, 'basklee'],
18
- ];
19
-
20
- const hash = (text) => createHash('sha256').update(text).digest('hex');
21
- const rename = (text) => RULES.reduce((out, [re, to]) => out.replace(re, to), text);
22
- const toPosix = (path) => path.split(sep).join('/');
23
-
24
- async function isLegacy(root) {
25
- if (existsSync(join(root, OLD_DIR, '.generated.json'))) return true;
26
- try {
27
- const pkg = JSON.parse(await readFile(join(root, 'package.json'), 'utf8'));
28
- return Object.keys({ ...pkg.dependencies, ...pkg.devDependencies }).some((name) => /^orionplace-(nuxt|react|svelte)$/.test(name));
29
- } catch {
30
- return false;
31
- }
32
- }
33
-
34
- async function walk(root, dir = root, files = []) {
35
- for (const entry of await readdir(dir, { withFileTypes: true })) {
36
- if (entry.isDirectory()) {
37
- if (SKIP_DIRS.has(entry.name) || entry.name.startsWith('.basklee-backup-')) continue;
38
- await walk(root, join(dir, entry.name), files);
39
- } else if (entry.isFile()) {
40
- files.push(toPosix(relative(root, join(dir, entry.name))));
41
- }
42
- }
43
- return files;
44
- }
45
-
46
- /**
47
- * Renames an old project in place. Returns null for a project that needs nothing, else
48
- * { files, moved, backup, dependency } — with dryRun nothing is written.
49
- * version: the version of the new package written into package.json.
50
- */
51
- export async function migrateLegacyProject({ cwd, dryRun = false, packageName, version }) {
52
- if (!(await isLegacy(cwd))) return null;
53
- const changes = new Map(); // old relative path -> { to, content (string | Buffer), changed }
54
- for (const path of await walk(cwd)) {
55
- const to = path.split('/').map(rename).join('/');
56
- const info = await stat(join(cwd, path));
57
- let content = null;
58
- if (info.size <= MAX_BYTES) {
59
- const buf = await readFile(join(cwd, path));
60
- if (!buf.subarray(0, 8000).includes(0)) {
61
- const text = buf.toString('utf8');
62
- const next = rename(text);
63
- if (next !== text) content = next;
64
- }
65
- }
66
- if (to !== path || content !== null) changes.set(path, { to, content });
67
- }
68
-
69
- // Generated-file record: a file still equal to what the package wrote stays "unchanged" after the rename, so the
70
- // template update may replace it; a file the owner edited stays edited.
71
- const oldRecord = join(OLD_DIR, '.generated.json');
72
- if (existsSync(join(cwd, oldRecord))) {
73
- const previous = JSON.parse(await readFile(join(cwd, oldRecord), 'utf8'));
74
- const record = {};
75
- for (const [name, sum] of Object.entries(previous)) {
76
- const newName = name.split('/').map(rename).join('/');
77
- let current = null;
78
- try { current = await readFile(join(cwd, name), 'utf8'); } catch { /* removed by the owner */ }
79
- record[newName] = current !== null && hash(current) === sum ? hash(rename(current)) : sum;
80
- }
81
- changes.set(oldRecord, { to: rename(oldRecord), content: JSON.stringify(record, null, 2) + '\n' });
82
- }
83
-
84
- // package.json: the new package at the running version (the old pin names a version the new package lacks).
85
- const pkgPath = 'package.json';
86
- if (existsSync(join(cwd, pkgPath))) {
87
- const text = changes.get(pkgPath)?.content ?? await readFile(join(cwd, pkgPath), 'utf8');
88
- const pkg = JSON.parse(text);
89
- for (const field of ['dependencies', 'devDependencies']) {
90
- if (pkg[field]?.[packageName] !== undefined && version) pkg[field][packageName] = version;
91
- }
92
- changes.set(pkgPath, { to: pkgPath, content: JSON.stringify(pkg, null, 2) + '\n' });
93
- }
94
-
95
- const files = [...changes].filter(([, c]) => c.content !== null).map(([from, c]) => c.to === from ? from : `${from} -> ${c.to}`);
96
- const moved = [...changes].filter(([from, c]) => c.to !== from).length;
97
- const backup = `.basklee-backup-${new Date().toISOString().replace(/[-:]/g, '').slice(0, 15)}`;
98
- if (dryRun) return { files, moved, backup: null, dependency: `${packageName}@${version}` };
99
-
100
- // Backup of every file the migration touches, at its old path.
101
- for (const [from] of changes) {
102
- const target = join(cwd, backup, from);
103
- await mkdir(dirname(target), { recursive: true });
104
- await writeFile(target, await readFile(join(cwd, from)));
105
- }
106
- for (const [from, { to, content }] of changes) {
107
- const source = join(cwd, from);
108
- const target = join(cwd, to);
109
- const data = content ?? await readFile(source);
110
- await mkdir(dirname(target), { recursive: true });
111
- await writeFile(target, data, { mode: (await stat(source)).mode });
112
- if (to !== from) await rm(source);
113
- }
114
- // Folders left empty by the moves (deepest first).
115
- const dirs = new Set();
116
- for (const [from, { to }] of changes) {
117
- if (to === from) continue;
118
- for (let dir = dirname(from); dir !== '.'; dir = dirname(dir)) dirs.add(dir);
119
- }
120
- for (const dir of [...dirs].sort((a, b) => b.split('/').length - a.split('/').length)) {
121
- try { await rmdir(join(cwd, dir)); } catch { /* not empty: holds files the migration did not move */ }
122
- }
123
- return { files, moved, backup, dependency: `${packageName}@${version}` };
124
- }