ebely 0.0.1 → 0.0.2

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/package.json CHANGED
@@ -1,18 +1,37 @@
1
1
  {
2
2
  "name": "ebely",
3
3
  "license": "MIT",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
- "scripts": {
9
- "build": "tsup index.ts --format cjs,esm --dts",
10
- "release": "pnpm run build && changeset publish",
11
- "lint": "tsc"
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "bin": {
16
+ "ebely": "bin/ebely.mjs"
12
17
  },
18
+ "files": [
19
+ "dist",
20
+ "bin",
21
+ "skills"
22
+ ],
23
+ "sideEffects": false,
13
24
  "devDependencies": {
14
25
  "@changesets/cli": "^2.26.0",
26
+ "@types/node": "^25.8.0",
15
27
  "tsup": "^6.5.0",
16
- "typescript": "^4.9.4"
28
+ "tsx": "^4.22.1",
29
+ "typescript": "^6.0.3"
30
+ },
31
+ "scripts": {
32
+ "build": "tsup index.ts --format cjs,esm --dts",
33
+ "release": "pnpm run build && changeset publish",
34
+ "lint": "tsc",
35
+ "test": "tsx --test src/response.test.ts src/hooks.test.ts src/generator/render.test.ts"
17
36
  }
18
- }
37
+ }
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: ebely-setup
3
+ description: Первичная настройка библиотеки ebely в проекте пользователя — установка конфига, генерация типизированного клиента из swagger, создание стора переменных и хуков. Запускать один раз при старте работы с ebely.
4
+ ---
5
+
6
+ # ebely-setup
7
+
8
+ Скилл первичной настройки `ebely` в проекте. Помогает пользователю с нуля
9
+ подготовить всё необходимое, чтобы дальше писать тесты бэкенда через
10
+ типизированный клиент.
11
+
12
+ > ЗАГЛУШКА. Подробные инструкции будут дописаны позже.
13
+
14
+ ## Что этот скилл должен сделать (TODO)
15
+
16
+ - [ ] Найти/спросить источник swagger-схемы (URL или путь к `swagger.json`).
17
+ - [ ] Создать конфиг `ebely/ebely.ts` (`EbelyConfig`): `mode`, `baseUrl`,
18
+ `swaggerSource`, `worldStore`, хуки.
19
+ - [ ] Создать скрипт генерации клиента и сгенерировать `ebely/generated.ts`.
20
+ - [ ] Создать `userStore.ts` (`BaseStore<Vars, WorldApi>`) и при необходимости
21
+ `worldStore.ts`.
22
+ - [ ] Создать `hooks.ts` (типизированные before/after хуки).
23
+ - [ ] Добавить npm-скрипты `client:generate` и `test`.
24
+ - [ ] Кратко объяснить пользователю, что получилось и как этим пользоваться.
25
+
26
+ ## Ссылки
27
+
28
+ - Архитектура: `ARCHITECTURE.md` в пакете `ebely`.
29
+ - Пример рабочей настройки: `examples/simple/test-with-ebely`.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: ebely-write-tests
3
+ description: Написание тестов бэкенда через библиотеку ebely. Использовать каждый раз, когда нужно добавить или изменить тест-сценарий поверх сгенерированного клиента (world/store/хуки). Это основной рабочий скилл после ebely-setup.
4
+ ---
5
+
6
+ # ebely-write-tests
7
+
8
+ Основной рабочий скилл: пишет тесты бэкенда через `ebely` поверх уже
9
+ сгенерированного типизированного клиента и стора переменных.
10
+
11
+ > ЗАГЛУШКА. Подробные инструкции будут дописаны позже.
12
+
13
+ ## Что этот скилл должен делать (TODO)
14
+
15
+ - [ ] Прочитать сгенерированный клиент (`ebely/generated.ts`) и стор
16
+ (`userStore.ts`), чтобы знать доступные операции и переменные.
17
+ - [ ] По запросу пользователя сформировать тест-сценарий: вызовы операций,
18
+ сохранение переменных в стор, ассерты через `ApiResponse.assert`.
19
+ - [ ] Переиспользовать методы-сценарии стора (например `fullRegister`) вместо
20
+ дублирования шагов.
21
+ - [ ] При необходимости подсказать, что нужно перегенерировать клиент
22
+ (`client:generate`), если схема изменилась.
23
+ - [ ] Запустить тесты и показать результат.
24
+
25
+ ## Ссылки
26
+
27
+ - Архитектура и формат тестов: `ARCHITECTURE.md` в пакете `ebely`.
28
+ - Пример теста: `examples/simple/test-with-ebely/tests/test1.ts`.
@@ -1,8 +0,0 @@
1
- # Changesets
2
-
3
- Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
- with multi-package repos, or single-package repos to help you version and publish your code. You can
5
- find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
-
7
- We have a quick list of common questions to get you started engaging with this project in
8
- [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "public",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
@@ -1,5 +0,0 @@
1
- ---
2
- "my-package": patch
3
- ---
4
-
5
- Added the add function
@@ -1,21 +0,0 @@
1
- name: CI
2
- on:
3
- push:
4
- branches:
5
- - "**"
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v3
12
- - uses: pnpm/action-setup@v2
13
- with:
14
- version: 7
15
- - uses: actions/setup-node@v3
16
- with:
17
- node-version: 16.x
18
- cache: "pnpm"
19
-
20
- - run: pnpm install --frozen-lockfile
21
- - run: pnpm run lint && pnpm run build
@@ -1,36 +0,0 @@
1
- name: Publish
2
- on:
3
- workflow_run:
4
- workflows: [CI]
5
- branches: [main]
6
- types: [completed]
7
-
8
- concurrency: ${{ github.workflow }}-${{ github.ref }}
9
-
10
- permissions:
11
- contents: write
12
- pull-requests: write
13
-
14
- jobs:
15
- publish:
16
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
17
- runs-on: ubuntu-latest
18
- steps:
19
- - uses: actions/checkout@v3
20
- - uses: pnpm/action-setup@v2
21
- with:
22
- version: 7
23
- - uses: actions/setup-node@v3
24
- with:
25
- node-version: 16.x
26
- cache: "pnpm"
27
-
28
- - run: pnpm install --frozen-lockfile
29
- - name: Create Release Pull Request or Publish
30
- id: changesets
31
- uses: changesets/action@v1
32
- with:
33
- publish: pnpm run release
34
- env:
35
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
package/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export const add = (a: number, b: number) => {
2
- return a + b
3
- }
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Base Options: */
4
- "esModuleInterop": true,
5
- "skipLibCheck": true,
6
- "target": "es2022",
7
- "verbatimModuleSyntax": true,
8
- "allowJs": true,
9
- "resolveJsonModule": true,
10
- "moduleDetection": "force",
11
- /* Strictness */
12
- "strict": true,
13
- "noUncheckedIndexedAccess": true,
14
- /* If NOT transpiling with TypeScript: */
15
- "moduleResolution": "Bundler",
16
- "module": "ESNext",
17
- "noEmit": true,
18
- /* If your code runs in the DOM: */
19
- "lib": ["es2022", "dom", "dom.iterable"],
20
- }
21
- }