@kb-labs/devkit 1.4.0 → 2.6.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.
Files changed (231) hide show
  1. package/assets/claude/CLAUDE.md.snippet +30 -0
  2. package/assets/claude/manifest.json +47 -0
  3. package/assets/claude/skills/kb-labs-create-plugin/SKILL.md +144 -0
  4. package/assets/claude/skills/kb-labs-create-product/SKILL.md +144 -0
  5. package/assets/claude/skills/kb-labs-explore/SKILL.md +119 -0
  6. package/assets/claude/skills/kb-labs-quickstart/SKILL.md +72 -0
  7. package/assets/claude/skills/kb-labs-troubleshoot/SKILL.md +150 -0
  8. package/assets/claude/skills/kb-labs-update/SKILL.md +89 -0
  9. package/package.json +7 -6
  10. package/tsconfig/spa.json +7 -0
  11. package/vitest/node.js +8 -2
  12. package/vitest/react.js +8 -2
  13. package/.cursorrules +0 -32
  14. package/.github/CODEOWNERS +0 -2
  15. package/.github/actions/setup-node-pnpm/action.yml +0 -47
  16. package/.github/workflow-templates/ci.yml +0 -13
  17. package/.github/workflow-templates/deploy.yml +0 -28
  18. package/.github/workflow-templates/docker-build.yml +0 -25
  19. package/.github/workflow-templates/drift-check.yml +0 -10
  20. package/.github/workflow-templates/profiles-validate.yml +0 -16
  21. package/.github/workflow-templates/release.yml +0 -8
  22. package/.github/workflows/ci-reusable.yml +0 -131
  23. package/.github/workflows/deploy-reusable.yml +0 -110
  24. package/.github/workflows/docker-build-reusable.yml +0 -110
  25. package/.github/workflows/drift-check-reusable.yml +0 -23
  26. package/.github/workflows/fixtures.yml +0 -74
  27. package/.github/workflows/profiles-validate-reusable.yml +0 -67
  28. package/.github/workflows/release-reusable.yml +0 -50
  29. package/.vscode/settings.json +0 -23
  30. package/tsconfig/dist/__tests__/cache.spec.d.ts +0 -6
  31. package/tsconfig/dist/__tests__/cache.spec.d.ts.map +0 -1
  32. package/tsconfig/dist/__tests__/cache.spec.js +0 -85
  33. package/tsconfig/dist/__tests__/cache.spec.js.map +0 -1
  34. package/tsconfig/dist/__tests__/fs-atomic.spec.d.ts +0 -6
  35. package/tsconfig/dist/__tests__/fs-atomic.spec.d.ts.map +0 -1
  36. package/tsconfig/dist/__tests__/fs-atomic.spec.js +0 -153
  37. package/tsconfig/dist/__tests__/fs-atomic.spec.js.map +0 -1
  38. package/tsconfig/dist/__tests__/init-workspace.spec.d.ts +0 -6
  39. package/tsconfig/dist/__tests__/init-workspace.spec.d.ts.map +0 -1
  40. package/tsconfig/dist/__tests__/init-workspace.spec.js +0 -99
  41. package/tsconfig/dist/__tests__/init-workspace.spec.js.map +0 -1
  42. package/tsconfig/dist/__tests__/kb-error.spec.d.ts +0 -6
  43. package/tsconfig/dist/__tests__/kb-error.spec.d.ts.map +0 -1
  44. package/tsconfig/dist/__tests__/kb-error.spec.js +0 -190
  45. package/tsconfig/dist/__tests__/kb-error.spec.js.map +0 -1
  46. package/tsconfig/dist/__tests__/preset-lockfile.spec.d.ts +0 -6
  47. package/tsconfig/dist/__tests__/preset-lockfile.spec.d.ts.map +0 -1
  48. package/tsconfig/dist/__tests__/preset-lockfile.spec.js +0 -142
  49. package/tsconfig/dist/__tests__/preset-lockfile.spec.js.map +0 -1
  50. package/tsconfig/dist/__tests__/product-config-profiles.spec.d.ts +0 -6
  51. package/tsconfig/dist/__tests__/product-config-profiles.spec.d.ts.map +0 -1
  52. package/tsconfig/dist/__tests__/product-config-profiles.spec.js +0 -100
  53. package/tsconfig/dist/__tests__/product-config-profiles.spec.js.map +0 -1
  54. package/tsconfig/dist/__tests__/product-config.spec.d.ts +0 -6
  55. package/tsconfig/dist/__tests__/product-config.spec.d.ts.map +0 -1
  56. package/tsconfig/dist/__tests__/product-config.spec.js +0 -298
  57. package/tsconfig/dist/__tests__/product-config.spec.js.map +0 -1
  58. package/tsconfig/dist/__tests__/runtime.spec.d.ts +0 -2
  59. package/tsconfig/dist/__tests__/runtime.spec.d.ts.map +0 -1
  60. package/tsconfig/dist/__tests__/runtime.spec.js +0 -127
  61. package/tsconfig/dist/__tests__/runtime.spec.js.map +0 -1
  62. package/tsconfig/dist/__tests__/upsert-lockfile.spec.d.ts +0 -6
  63. package/tsconfig/dist/__tests__/upsert-lockfile.spec.d.ts.map +0 -1
  64. package/tsconfig/dist/__tests__/upsert-lockfile.spec.js +0 -251
  65. package/tsconfig/dist/__tests__/upsert-lockfile.spec.js.map +0 -1
  66. package/tsconfig/dist/__tests__/validate-config.spec.d.ts +0 -2
  67. package/tsconfig/dist/__tests__/validate-config.spec.d.ts.map +0 -1
  68. package/tsconfig/dist/__tests__/validate-config.spec.js +0 -14
  69. package/tsconfig/dist/__tests__/validate-config.spec.js.map +0 -1
  70. package/tsconfig/dist/api/init-workspace.d.ts +0 -10
  71. package/tsconfig/dist/api/init-workspace.d.ts.map +0 -1
  72. package/tsconfig/dist/api/init-workspace.js +0 -191
  73. package/tsconfig/dist/api/init-workspace.js.map +0 -1
  74. package/tsconfig/dist/api/product-config.d.ts +0 -21
  75. package/tsconfig/dist/api/product-config.d.ts.map +0 -1
  76. package/tsconfig/dist/api/product-config.js +0 -192
  77. package/tsconfig/dist/api/product-config.js.map +0 -1
  78. package/tsconfig/dist/api/read-config.d.ts +0 -22
  79. package/tsconfig/dist/api/read-config.d.ts.map +0 -1
  80. package/tsconfig/dist/api/read-config.js +0 -105
  81. package/tsconfig/dist/api/read-config.js.map +0 -1
  82. package/tsconfig/dist/api/upsert-lockfile.d.ts +0 -10
  83. package/tsconfig/dist/api/upsert-lockfile.d.ts.map +0 -1
  84. package/tsconfig/dist/api/upsert-lockfile.js +0 -63
  85. package/tsconfig/dist/api/upsert-lockfile.js.map +0 -1
  86. package/tsconfig/dist/cache/fs-cache.d.ts +0 -38
  87. package/tsconfig/dist/cache/fs-cache.d.ts.map +0 -1
  88. package/tsconfig/dist/cache/fs-cache.js +0 -142
  89. package/tsconfig/dist/cache/fs-cache.js.map +0 -1
  90. package/tsconfig/dist/errors/kb-error.d.ts +0 -32
  91. package/tsconfig/dist/errors/kb-error.d.ts.map +0 -1
  92. package/tsconfig/dist/errors/kb-error.js +0 -54
  93. package/tsconfig/dist/errors/kb-error.js.map +0 -1
  94. package/tsconfig/dist/fs/__tests__/fs.spec.d.ts +0 -2
  95. package/tsconfig/dist/fs/__tests__/fs.spec.d.ts.map +0 -1
  96. package/tsconfig/dist/fs/__tests__/fs.spec.js +0 -22
  97. package/tsconfig/dist/fs/__tests__/fs.spec.js.map +0 -1
  98. package/tsconfig/dist/fs/fs.d.ts +0 -6
  99. package/tsconfig/dist/fs/fs.d.ts.map +0 -1
  100. package/tsconfig/dist/fs/fs.js +0 -12
  101. package/tsconfig/dist/fs/fs.js.map +0 -1
  102. package/tsconfig/dist/fs/index.d.ts +0 -2
  103. package/tsconfig/dist/fs/index.d.ts.map +0 -1
  104. package/tsconfig/dist/fs/index.js +0 -2
  105. package/tsconfig/dist/fs/index.js.map +0 -1
  106. package/tsconfig/dist/hash/config-hash.d.ts +0 -17
  107. package/tsconfig/dist/hash/config-hash.d.ts.map +0 -1
  108. package/tsconfig/dist/hash/config-hash.js +0 -55
  109. package/tsconfig/dist/hash/config-hash.js.map +0 -1
  110. package/tsconfig/dist/index.d.ts +0 -5
  111. package/tsconfig/dist/index.d.ts.map +0 -1
  112. package/tsconfig/dist/index.js +0 -5
  113. package/tsconfig/dist/index.js.map +0 -1
  114. package/tsconfig/dist/lockfile/lockfile.d.ts +0 -54
  115. package/tsconfig/dist/lockfile/lockfile.d.ts.map +0 -1
  116. package/tsconfig/dist/lockfile/lockfile.js +0 -141
  117. package/tsconfig/dist/lockfile/lockfile.js.map +0 -1
  118. package/tsconfig/dist/logging/__tests__/logger.spec.d.ts +0 -2
  119. package/tsconfig/dist/logging/__tests__/logger.spec.d.ts.map +0 -1
  120. package/tsconfig/dist/logging/__tests__/logger.spec.js +0 -65
  121. package/tsconfig/dist/logging/__tests__/logger.spec.js.map +0 -1
  122. package/tsconfig/dist/logging/__tests__/redaction.spec.d.ts +0 -2
  123. package/tsconfig/dist/logging/__tests__/redaction.spec.d.ts.map +0 -1
  124. package/tsconfig/dist/logging/__tests__/redaction.spec.js +0 -34
  125. package/tsconfig/dist/logging/__tests__/redaction.spec.js.map +0 -1
  126. package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.d.ts +0 -2
  127. package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.d.ts.map +0 -1
  128. package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.js +0 -90
  129. package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.js.map +0 -1
  130. package/tsconfig/dist/logging/index.d.ts +0 -6
  131. package/tsconfig/dist/logging/index.d.ts.map +0 -1
  132. package/tsconfig/dist/logging/index.js +0 -6
  133. package/tsconfig/dist/logging/index.js.map +0 -1
  134. package/tsconfig/dist/logging/logger.d.ts +0 -9
  135. package/tsconfig/dist/logging/logger.d.ts.map +0 -1
  136. package/tsconfig/dist/logging/logger.js +0 -101
  137. package/tsconfig/dist/logging/logger.js.map +0 -1
  138. package/tsconfig/dist/logging/redaction.d.ts +0 -7
  139. package/tsconfig/dist/logging/redaction.d.ts.map +0 -1
  140. package/tsconfig/dist/logging/redaction.js +0 -23
  141. package/tsconfig/dist/logging/redaction.js.map +0 -1
  142. package/tsconfig/dist/logging/sinks/json.d.ts +0 -4
  143. package/tsconfig/dist/logging/sinks/json.d.ts.map +0 -1
  144. package/tsconfig/dist/logging/sinks/json.js +0 -23
  145. package/tsconfig/dist/logging/sinks/json.js.map +0 -1
  146. package/tsconfig/dist/logging/sinks/stdout.d.ts +0 -3
  147. package/tsconfig/dist/logging/sinks/stdout.d.ts.map +0 -1
  148. package/tsconfig/dist/logging/sinks/stdout.js +0 -24
  149. package/tsconfig/dist/logging/sinks/stdout.js.map +0 -1
  150. package/tsconfig/dist/logging/types/index.d.ts +0 -2
  151. package/tsconfig/dist/logging/types/index.d.ts.map +0 -1
  152. package/tsconfig/dist/logging/types/index.js +0 -2
  153. package/tsconfig/dist/logging/types/index.js.map +0 -1
  154. package/tsconfig/dist/logging/types/types.d.ts +0 -37
  155. package/tsconfig/dist/logging/types/types.d.ts.map +0 -1
  156. package/tsconfig/dist/logging/types/types.js +0 -2
  157. package/tsconfig/dist/logging/types/types.js.map +0 -1
  158. package/tsconfig/dist/merge/layered-merge.d.ts +0 -16
  159. package/tsconfig/dist/merge/layered-merge.d.ts.map +0 -1
  160. package/tsconfig/dist/merge/layered-merge.js +0 -97
  161. package/tsconfig/dist/merge/layered-merge.js.map +0 -1
  162. package/tsconfig/dist/preset/resolve-preset.d.ts +0 -29
  163. package/tsconfig/dist/preset/resolve-preset.d.ts.map +0 -1
  164. package/tsconfig/dist/preset/resolve-preset.js +0 -104
  165. package/tsconfig/dist/preset/resolve-preset.js.map +0 -1
  166. package/tsconfig/dist/repo/__tests__/repo.spec.d.ts +0 -2
  167. package/tsconfig/dist/repo/__tests__/repo.spec.d.ts.map +0 -1
  168. package/tsconfig/dist/repo/__tests__/repo.spec.js +0 -25
  169. package/tsconfig/dist/repo/__tests__/repo.spec.js.map +0 -1
  170. package/tsconfig/dist/repo/index.d.ts +0 -2
  171. package/tsconfig/dist/repo/index.d.ts.map +0 -1
  172. package/tsconfig/dist/repo/index.js +0 -2
  173. package/tsconfig/dist/repo/index.js.map +0 -1
  174. package/tsconfig/dist/repo/repo.d.ts +0 -6
  175. package/tsconfig/dist/repo/repo.d.ts.map +0 -1
  176. package/tsconfig/dist/repo/repo.js +0 -25
  177. package/tsconfig/dist/repo/repo.js.map +0 -1
  178. package/tsconfig/dist/runtime/index.d.ts +0 -2
  179. package/tsconfig/dist/runtime/index.d.ts.map +0 -1
  180. package/tsconfig/dist/runtime/index.js +0 -2
  181. package/tsconfig/dist/runtime/index.js.map +0 -1
  182. package/tsconfig/dist/runtime/runtime.d.ts +0 -46
  183. package/tsconfig/dist/runtime/runtime.d.ts.map +0 -1
  184. package/tsconfig/dist/runtime/runtime.js +0 -126
  185. package/tsconfig/dist/runtime/runtime.js.map +0 -1
  186. package/tsconfig/dist/tsconfig.tools.tsbuildinfo +0 -1
  187. package/tsconfig/dist/tsconfig.tsbuildinfo +0 -1
  188. package/tsconfig/dist/types/index.d.ts +0 -2
  189. package/tsconfig/dist/types/index.d.ts.map +0 -1
  190. package/tsconfig/dist/types/index.js +0 -2
  191. package/tsconfig/dist/types/index.js.map +0 -1
  192. package/tsconfig/dist/types/init.d.ts +0 -34
  193. package/tsconfig/dist/types/init.d.ts.map +0 -1
  194. package/tsconfig/dist/types/init.js +0 -6
  195. package/tsconfig/dist/types/init.js.map +0 -1
  196. package/tsconfig/dist/types/preset.d.ts +0 -27
  197. package/tsconfig/dist/types/preset.d.ts.map +0 -1
  198. package/tsconfig/dist/types/preset.js +0 -6
  199. package/tsconfig/dist/types/preset.js.map +0 -1
  200. package/tsconfig/dist/types/types.d.ts +0 -6
  201. package/tsconfig/dist/types/types.d.ts.map +0 -1
  202. package/tsconfig/dist/types/types.js +0 -2
  203. package/tsconfig/dist/types/types.js.map +0 -1
  204. package/tsconfig/dist/utils/__tests__/env.spec.d.ts +0 -2
  205. package/tsconfig/dist/utils/__tests__/env.spec.d.ts.map +0 -1
  206. package/tsconfig/dist/utils/__tests__/env.spec.js +0 -33
  207. package/tsconfig/dist/utils/__tests__/env.spec.js.map +0 -1
  208. package/tsconfig/dist/utils/env.d.ts +0 -7
  209. package/tsconfig/dist/utils/env.d.ts.map +0 -1
  210. package/tsconfig/dist/utils/env.js +0 -25
  211. package/tsconfig/dist/utils/env.js.map +0 -1
  212. package/tsconfig/dist/utils/fs-atomic.d.ts +0 -15
  213. package/tsconfig/dist/utils/fs-atomic.d.ts.map +0 -1
  214. package/tsconfig/dist/utils/fs-atomic.js +0 -45
  215. package/tsconfig/dist/utils/fs-atomic.js.map +0 -1
  216. package/tsconfig/dist/utils/index.d.ts +0 -3
  217. package/tsconfig/dist/utils/index.d.ts.map +0 -1
  218. package/tsconfig/dist/utils/index.js +0 -3
  219. package/tsconfig/dist/utils/index.js.map +0 -1
  220. package/tsconfig/dist/utils/paths.d.ts +0 -21
  221. package/tsconfig/dist/utils/paths.d.ts.map +0 -1
  222. package/tsconfig/dist/utils/paths.js +0 -32
  223. package/tsconfig/dist/utils/paths.js.map +0 -1
  224. package/tsconfig/dist/utils/product-normalize.d.ts +0 -27
  225. package/tsconfig/dist/utils/product-normalize.d.ts.map +0 -1
  226. package/tsconfig/dist/utils/product-normalize.js +0 -45
  227. package/tsconfig/dist/utils/product-normalize.js.map +0 -1
  228. package/tsconfig/dist/validation/validate-config.d.ts +0 -7
  229. package/tsconfig/dist/validation/validate-config.d.ts.map +0 -1
  230. package/tsconfig/dist/validation/validate-config.js +0 -22
  231. package/tsconfig/dist/validation/validate-config.js.map +0 -1
@@ -1,110 +0,0 @@
1
- name: reusable-deploy
2
-
3
- # Reusable workflow: deploy to VPS via SSH + docker compose
4
- #
5
- # Usage in orchestrator repo (e.g. kb-labs root):
6
- # jobs:
7
- # call:
8
- # uses: KirillBaranov/kb-labs-devkit/.github/workflows/deploy-reusable.yml@main
9
- # with:
10
- # image-tag: release-1.0.0
11
- # compose-file: docker-compose.production.yml
12
- # secrets: inherit
13
- #
14
- # Required secrets in calling repo:
15
- # VPS_HOST, VPS_USER, VPS_SSH_KEY
16
-
17
- on:
18
- workflow_call:
19
- inputs:
20
- image-tag:
21
- description: Docker image tag to deploy (e.g. release-1.0.0)
22
- required: true
23
- type: string
24
- compose-file:
25
- description: Path to docker-compose file on VPS
26
- required: false
27
- default: docker-compose.production.yml
28
- type: string
29
- deploy-dir:
30
- description: Working directory on VPS
31
- required: false
32
- default: /opt/kb-labs
33
- type: string
34
- registry:
35
- description: Container registry host
36
- required: false
37
- default: ghcr.io
38
- type: string
39
- health-check-url:
40
- description: URL to check after deploy (e.g. http://localhost:5050/api/v1/health)
41
- required: false
42
- default: ''
43
- type: string
44
- health-check-wait:
45
- description: Seconds to wait before health check
46
- required: false
47
- default: '15'
48
- type: string
49
- secrets:
50
- VPS_HOST:
51
- required: true
52
- VPS_USER:
53
- required: true
54
- VPS_SSH_KEY:
55
- required: true
56
-
57
- jobs:
58
- deploy:
59
- name: Deploy to VPS
60
- runs-on: ubuntu-latest
61
- environment: production
62
-
63
- steps:
64
- - name: Deploy via SSH
65
- uses: appleboy/ssh-action@v1
66
- env:
67
- DEPLOY_TAG: ${{ inputs.image-tag }}
68
- DEPLOY_REGISTRY: ${{ inputs.registry }}/${{ github.repository_owner }}
69
- with:
70
- host: ${{ secrets.VPS_HOST }}
71
- username: ${{ secrets.VPS_USER }}
72
- key: ${{ secrets.VPS_SSH_KEY }}
73
- envs: DEPLOY_TAG,DEPLOY_REGISTRY
74
- script: |
75
- set -euo pipefail
76
- cd ${{ inputs.deploy-dir }}
77
-
78
- echo "→ Deploying tag: $DEPLOY_TAG"
79
- echo "→ Registry: $DEPLOY_REGISTRY"
80
-
81
- # Save current tag for rollback
82
- [ -f .current-tag ] && cp .current-tag .previous-tag
83
- echo "$DEPLOY_TAG" > .current-tag
84
-
85
- # Pull new images
86
- TAG="$DEPLOY_TAG" REGISTRY="$DEPLOY_REGISTRY" \
87
- docker compose -f ${{ inputs.compose-file }} pull
88
-
89
- # Rolling update
90
- TAG="$DEPLOY_TAG" REGISTRY="$DEPLOY_REGISTRY" \
91
- docker compose -f ${{ inputs.compose-file }} up -d --remove-orphans
92
-
93
- echo "→ Containers started, waiting ${{ inputs.health-check-wait }}s..."
94
- sleep ${{ inputs.health-check-wait }}
95
-
96
- # Show status
97
- docker compose -f ${{ inputs.compose-file }} ps
98
-
99
- # Health check (if URL provided)
100
- if [ -n "${{ inputs.health-check-url }}" ]; then
101
- echo "→ Health check: ${{ inputs.health-check-url }}"
102
- wget -qO- "${{ inputs.health-check-url }}" \
103
- && echo "✓ Health check passed" \
104
- || { echo "✗ Health check failed!"; exit 1; }
105
- fi
106
-
107
- # Cleanup old images
108
- docker image prune -f > /dev/null 2>&1 || true
109
-
110
- echo "✓ Deploy complete: $DEPLOY_TAG"
@@ -1,110 +0,0 @@
1
- name: reusable-docker-build
2
-
3
- # Reusable workflow: build Docker image and push to ghcr.io
4
- #
5
- # Usage in consumer repo:
6
- # jobs:
7
- # call:
8
- # uses: KirillBaranov/kb-labs-devkit/.github/workflows/docker-build-reusable.yml@main
9
- # with:
10
- # image-name: kb-labs-rest-api
11
- # dockerfile: Dockerfile
12
- # secrets: inherit
13
-
14
- on:
15
- workflow_call:
16
- inputs:
17
- image-name:
18
- description: Docker image name (e.g. kb-labs-rest-api)
19
- required: true
20
- type: string
21
- dockerfile:
22
- description: Path to Dockerfile (relative to context)
23
- required: false
24
- default: Dockerfile
25
- type: string
26
- context:
27
- description: Docker build context (default is repo root)
28
- required: false
29
- default: .
30
- type: string
31
- build-args:
32
- description: Build args as multiline string (KEY=VALUE per line)
33
- required: false
34
- default: ''
35
- type: string
36
- platforms:
37
- description: Target platforms (e.g. linux/amd64,linux/arm64)
38
- required: false
39
- default: linux/amd64
40
- type: string
41
- registry:
42
- description: Container registry host
43
- required: false
44
- default: ghcr.io
45
- type: string
46
- outputs:
47
- image-tag:
48
- description: Full image tag that was pushed
49
- value: ${{ jobs.build.outputs.image-tag }}
50
- short-sha:
51
- description: Short commit SHA used as tag
52
- value: ${{ jobs.build.outputs.short-sha }}
53
-
54
- jobs:
55
- build:
56
- name: Build & Push
57
- runs-on: ubuntu-latest
58
- permissions:
59
- contents: read
60
- packages: write
61
-
62
- outputs:
63
- image-tag: ${{ steps.meta.outputs.version }}
64
- short-sha: ${{ steps.sha.outputs.short }}
65
-
66
- steps:
67
- - name: Checkout
68
- uses: actions/checkout@v4
69
- with:
70
- submodules: recursive
71
-
72
- - name: Get short SHA
73
- id: sha
74
- run: echo "short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
75
-
76
- - name: Log in to Container Registry
77
- uses: docker/login-action@v3
78
- with:
79
- registry: ${{ inputs.registry }}
80
- username: ${{ github.actor }}
81
- password: ${{ secrets.GITHUB_TOKEN }}
82
-
83
- - name: Set up Docker Buildx
84
- uses: docker/setup-buildx-action@v3
85
-
86
- - name: Docker metadata
87
- id: meta
88
- uses: docker/metadata-action@v5
89
- with:
90
- images: ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.image-name }}
91
- tags: |
92
- # rc branch → rc-<sha>
93
- type=raw,value=rc-${{ steps.sha.outputs.short }},enable=${{ github.ref == 'refs/heads/rc' }}
94
- # release tag → release-1.0.0
95
- type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/release-') }}
96
- # always tag latest on release
97
- type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/release-') }}
98
-
99
- - name: Build and push
100
- uses: docker/build-push-action@v6
101
- with:
102
- context: ${{ inputs.context }}
103
- file: ${{ inputs.dockerfile }}
104
- platforms: ${{ inputs.platforms }}
105
- push: true
106
- tags: ${{ steps.meta.outputs.tags }}
107
- labels: ${{ steps.meta.outputs.labels }}
108
- build-args: ${{ inputs.build-args }}
109
- cache-from: type=gha,scope=${{ inputs.image-name }}
110
- cache-to: type=gha,mode=max,scope=${{ inputs.image-name }}
@@ -1,23 +0,0 @@
1
- name: reusable-drift-check
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- node-version:
7
- default: '20'
8
- type: string
9
-
10
- jobs:
11
- drift:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: KirillBaranov/kb-labs-devkit/.github/actions/setup-node-pnpm@main
16
- with:
17
- node-version: ${{ inputs.node-version }}
18
- - run: pnpm i --frozen-lockfile
19
- - name: DevKit drift check
20
- run: |
21
- pnpm -s devkit:check || \
22
- node scripts/devkit-sync.mjs --check || \
23
- ./node_modules/.bin/kb-devkit-sync --check
@@ -1,74 +0,0 @@
1
- name: DevKit Fixtures
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- paths-ignore:
7
- - '**/*.md'
8
- - '**/.vscode/**'
9
- - '**/.idea/**'
10
- pull_request:
11
- types: [opened, synchronize, reopened]
12
- workflow_dispatch: {}
13
- schedule:
14
- - cron: '0 3 * * 1' # weekly canary (Mon 03:00 UTC)
15
-
16
- permissions:
17
- contents: read
18
-
19
- concurrency:
20
- group: devkit-fixtures-${{ github.event.pull_request.number || github.sha }}
21
- cancel-in-progress: true
22
-
23
- jobs:
24
- fixtures:
25
- name: Run fixtures (all)
26
- runs-on: ubuntu-latest
27
- env:
28
- CI: true
29
-
30
- steps:
31
- - uses: actions/checkout@v4
32
- with: { fetch-depth: 0 }
33
-
34
- - uses: KirillBaranov/kb-labs-devkit/.github/actions/setup-node-pnpm@main
35
- with:
36
- node-version: '20'
37
-
38
- - name: Cache pnpm store
39
- uses: actions/cache@v4
40
- with:
41
- path: ~/.pnpm-store
42
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43
- restore-keys: |
44
- ${{ runner.os }}-pnpm-store-
45
-
46
- - name: Install DevKit deps
47
- run: pnpm i --frozen-lockfile
48
-
49
- - name: Clean fixtures
50
- run: pnpm fixtures:clean || true
51
-
52
- - name: Bootstrap fixtures
53
- run: pnpm fixtures:bootstrap
54
-
55
- - name: Run fixtures (smart check)
56
- shell: bash
57
- run: |
58
- if [ "${{ github.event_name }}" = "pull_request" ] && [ -n "${{ github.base_ref }}" ]; then
59
- echo "Running differential fixtures check since origin/${{ github.base_ref }}"
60
- pnpm fixtures -- --action=check --since=origin/${{ github.base_ref }}
61
- else
62
- echo "Running full fixtures check"
63
- pnpm fixtures:check
64
- fi
65
-
66
- - name: Upload artifacts (optional)
67
- if: always()
68
- uses: actions/upload-artifact@v4
69
- with:
70
- name: fixtures-artifacts
71
- path: |
72
- fixtures/**/coverage/**
73
- fixtures/**/dist/**
74
- if-no-files-found: ignore
@@ -1,67 +0,0 @@
1
- name: profiles-validate
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- node_version:
7
- type: string
8
- default: '20'
9
- soft_fail:
10
- type: boolean
11
- default: true # don't fail, while profiles are in development
12
- working_directory:
13
- type: string
14
- default: '.' # for monorepo — can specify the package path
15
- log_level:
16
- type: string
17
- default: 'info' # debug|info|warn|error
18
- fixtures_dir:
19
- type: string
20
- default: '' # optional, if there are presets/fixtures
21
-
22
- jobs:
23
- validate:
24
- runs-on: ubuntu-latest
25
-
26
- steps:
27
- - uses: actions/checkout@v4
28
-
29
- - name: Detect .kb/profiles
30
- id: detect
31
- shell: bash
32
- run: |
33
- ROOT="${{ inputs.working_directory }}"
34
- if [ -d "$ROOT/.kb/profiles" ]; then
35
- echo "found=true" >> "$GITHUB_OUTPUT"
36
- echo "[profiles] found at $ROOT/.kb/profiles"
37
- else
38
- echo "found=false" >> "$GITHUB_OUTPUT"
39
- echo "[profiles] not found, skip"
40
- fi
41
-
42
- - name: Setup Node & pnpm
43
- if: steps.detect.outputs.found == 'true'
44
- uses: KirillBaranov/kb-labs-devkit/.github/actions/setup-node-pnpm@main
45
- with:
46
- node-version: ${{ inputs.node_version }}
47
-
48
- - name: Install deps
49
- if: steps.detect.outputs.found == 'true'
50
- run: pnpm i --frozen-lockfile
51
- working-directory: ${{ inputs.working_directory }}
52
-
53
- - name: Validate profiles
54
- if: steps.detect.outputs.found == 'true'
55
- continue-on-error: ${{ inputs.soft_fail }}
56
- env:
57
- LOG_LEVEL: ${{ inputs.log_level }}
58
- KB_PROFILES_FIXTURES: ${{ inputs.fixtures_dir }}
59
- shell: bash
60
- run: |
61
- # if kb-CLI is available, use it, otherwise use the package schemas
62
- if pnpm -s kb --help >/dev/null 2>&1; then
63
- pnpm -s kb profiles validate
64
- else
65
- pnpm -F @kb-labs/profile-schemas -s run schemas:check
66
- fi
67
- working-directory: ${{ inputs.working_directory }}
@@ -1,50 +0,0 @@
1
- name: reusable-release
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- publish:
7
- description: Publish to npm
8
- required: false
9
- default: false
10
- type: boolean
11
- node-version:
12
- default: '20'
13
- type: string
14
- secrets:
15
- NPM_TOKEN:
16
- required: false
17
-
18
- jobs:
19
- release:
20
- runs-on: ubuntu-latest
21
- permissions:
22
- contents: write
23
- steps:
24
- - uses: actions/checkout@v4
25
-
26
- # Composite action: pnpm + Node + cache
27
- - uses: KirillBaranov/kb-labs-devkit/.github/actions/setup-node-pnpm@main
28
- with:
29
- node-version: ${{ inputs['node-version'] }}
30
-
31
- # Add registry for npm publish (separate step — так надёжнее)
32
- - uses: actions/setup-node@v4
33
- with:
34
- node-version: ${{ inputs['node-version'] }}
35
- cache: pnpm
36
- registry-url: 'https://registry.npmjs.org'
37
-
38
- - run: pnpm i --frozen-lockfile
39
- - run: pnpm build || true
40
-
41
- - name: Create GitHub Release
42
- uses: softprops/action-gh-release@v2
43
- with:
44
- generate_release_notes: true
45
-
46
- - name: Publish to npm
47
- if: ${{ inputs.publish == true }}
48
- env:
49
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50
- run: pnpm -r publish --access public --no-git-checks
@@ -1,23 +0,0 @@
1
- {
2
- "editor.tabSize": 2,
3
- "editor.insertSpaces": true,
4
- "editor.formatOnSave": true,
5
- "files.eol": "\n",
6
- // ESLint (flat config)
7
- "eslint.useFlatConfig": true,
8
- "eslint.experimental.useFlatConfig": true,
9
- "eslint.validate": [
10
- "javascript",
11
- "javascriptreact",
12
- "typescript",
13
- "typescriptreact",
14
- "vue"
15
- ],
16
- // Prettier
17
- "prettier.requireConfig": true,
18
- // TypeScript: использовать локальную версию в репозитории
19
- "typescript.tsdk": "node_modules/typescript/lib",
20
- // Vitest
21
- "vitest.enable": true,
22
- "vitest.disableWorkspaceWarning": true
23
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * @module @kb-labs/core/config/__tests__/cache.spec.ts
3
- * Tests for filesystem cache functionality
4
- */
5
- export {};
6
- //# sourceMappingURL=cache.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.spec.d.ts","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/__tests__/cache.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,85 +0,0 @@
1
- /**
2
- * @module @kb-labs/core/config/__tests__/cache.spec.ts
3
- * Tests for filesystem cache functionality
4
- */
5
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
6
- import { promises as fsp } from 'node:fs';
7
- import path from 'node:path';
8
- import { tmpdir } from 'node:os';
9
- import { fsCache, clearCaches } from '../cache/fs-cache';
10
- import { readConfigFile } from '../api/read-config';
11
- describe('Filesystem Cache', () => {
12
- let testDir;
13
- beforeEach(async () => {
14
- testDir = path.join(tmpdir(), `kb-labs-cache-test-${Date.now()}`);
15
- await fsp.mkdir(testDir, { recursive: true });
16
- clearCaches();
17
- });
18
- afterEach(async () => {
19
- await fsp.rm(testDir, { recursive: true, force: true });
20
- clearCaches();
21
- });
22
- describe('Cache Operations', () => {
23
- it('should cache file reads', async () => {
24
- const configPath = path.join(testDir, 'test-config.json');
25
- const configData = { test: 'value' };
26
- await fsp.writeFile(configPath, JSON.stringify(configData, null, 2));
27
- // First read - should not be cached
28
- const result1 = await readConfigFile(configPath);
29
- expect(result1.data).toEqual(configData);
30
- // Second read - should be cached
31
- const result2 = await readConfigFile(configPath);
32
- expect(result2.data).toEqual(configData);
33
- });
34
- it('should invalidate cache on file change', async () => {
35
- const configPath = path.join(testDir, 'test-config.json');
36
- const configData1 = { test: 'value1' };
37
- const configData2 = { test: 'value2' };
38
- await fsp.writeFile(configPath, JSON.stringify(configData1, null, 2));
39
- // First read
40
- const result1 = await readConfigFile(configPath);
41
- expect(result1.data).toEqual(configData1);
42
- // Small delay to ensure mtime changes
43
- await new Promise(resolve => setTimeout(resolve, 10));
44
- // Modify file
45
- await fsp.writeFile(configPath, JSON.stringify(configData2, null, 2));
46
- // Second read - should get new data
47
- const result2 = await readConfigFile(configPath);
48
- expect(result2.data).toEqual(configData2);
49
- });
50
- it('should clear caches', async () => {
51
- const configPath = path.join(testDir, 'test-config.json');
52
- const configData = { test: 'value' };
53
- await fsp.writeFile(configPath, JSON.stringify(configData, null, 2));
54
- // Read to populate cache
55
- await readConfigFile(configPath);
56
- // Clear cache
57
- clearCaches();
58
- // Verify cache is cleared by checking stats
59
- const stats = fsCache.getStats();
60
- expect(stats.size).toBe(0);
61
- });
62
- it('should handle YAML files', async () => {
63
- const configPath = path.join(testDir, 'test-config.yaml');
64
- const configData = { test: 'value', nested: { key: 'value' } };
65
- await fsp.writeFile(configPath, `test: value\nnested:\n key: value`);
66
- const result = await readConfigFile(configPath);
67
- expect(result.format).toBe('yaml');
68
- expect(result.data).toEqual(configData);
69
- });
70
- });
71
- describe('Cache Statistics', () => {
72
- it('should track cache size', async () => {
73
- const configPath1 = path.join(testDir, 'config1.json');
74
- const configPath2 = path.join(testDir, 'config2.json');
75
- await fsp.writeFile(configPath1, JSON.stringify({ test1: 'value1' }));
76
- await fsp.writeFile(configPath2, JSON.stringify({ test2: 'value2' }));
77
- // Read both files
78
- await readConfigFile(configPath1);
79
- await readConfigFile(configPath2);
80
- const stats = fsCache.getStats();
81
- expect(stats.size).toBeGreaterThan(0);
82
- });
83
- });
84
- });
85
- //# sourceMappingURL=cache.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.spec.js","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/__tests__/cache.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,OAAe,CAAC;IAEpB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,OAAO,GAAG,IAAI,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AQ,EAAE,CAAC,CAAC,CAAC;YAEtE,kBAAkB;YAClB,MAAM,cAAc,CAAC,WAAW,CAAC,CAAC;YAClC,MAAM,cAAc,CAAC,WAAW,CAAC,CAAC;YAElC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;YACjC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * @module @kb-labs/core/config/__tests__/fs-atomic.spec.ts
3
- * Tests for atomic file operations and workspace validation
4
- */
5
- export {};
6
- //# sourceMappingURL=fs-atomic.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs-atomic.spec.d.ts","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/__tests__/fs-atomic.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG"}