opencroc 0.1.7 → 0.3.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.en.md +37 -6
- package/README.ja.md +37 -6
- package/README.md +37 -6
- package/README.zh-CN.md +37 -6
- package/dist/cli/index.js +1936 -42
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +335 -26
- package/dist/index.js +2621 -45
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/README.en.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/opencroc"><img src="https://img.shields.io/npm/v/opencroc?color=green" alt="npm version" /></a>
|
|
13
|
+
<a href="https://github.com/opencroc/opencroc/actions/workflows/ci.yml"><img src="https://github.com/opencroc/opencroc/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
|
|
13
14
|
<a href="https://github.com/opencroc/opencroc/blob/main/LICENSE"><img src="https://img.shields.io/github/license/opencroc/opencroc" alt="MIT License" /></a>
|
|
14
15
|
<a href="https://opencroc.com"><img src="https://img.shields.io/badge/docs-opencroc.com-blue" alt="Documentation" /></a>
|
|
15
16
|
</p>
|
|
@@ -179,6 +180,32 @@ Test Failure
|
|
|
179
180
|
-> Commit or Rollback
|
|
180
181
|
```
|
|
181
182
|
|
|
183
|
+
## Real-World Validation
|
|
184
|
+
|
|
185
|
+
OpenCroc has been validated against a **production-scale RBAC system** (multi-tenant enterprise permission management) with 100+ Sequelize models, 75+ Express controllers, and embedded associations:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
$ npx tsx examples/rbac-system/smoke-test.ts
|
|
189
|
+
|
|
190
|
+
Modules : 5 (default, aigc, data-platform, integration, workflow)
|
|
191
|
+
ER Diagrams : 5
|
|
192
|
+
[default] 102 tables, 65 relations
|
|
193
|
+
[aigc] 6 tables, 0 relations
|
|
194
|
+
[data-platform] 4 tables, 0 relations
|
|
195
|
+
[integration] 14 tables, 0 relations
|
|
196
|
+
[workflow] 2 tables, 0 relations
|
|
197
|
+
Chain Plans : 5
|
|
198
|
+
[aigc] 78 chains, 150 steps
|
|
199
|
+
Generated Files: 78
|
|
200
|
+
Duration : 1153ms
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Key findings:
|
|
204
|
+
- **102 tables** and **65 foreign key relations** correctly extracted from flat model layout
|
|
205
|
+
- **Embedded associations** (`.belongsTo()` / `.hasMany()` inside model files) detected without dedicated association files
|
|
206
|
+
- **78 test files** generated across 5 modules in just over 1 second
|
|
207
|
+
- Handles both flat (`models/*.ts`) and nested (`models/module/*.ts`) directory structures
|
|
208
|
+
|
|
182
209
|
## Configuration
|
|
183
210
|
|
|
184
211
|
```typescript
|
|
@@ -233,10 +260,10 @@ export default defineConfig({
|
|
|
233
260
|
|
|
234
261
|
| Layer | Supported | Planned |
|
|
235
262
|
|---|---|---|
|
|
236
|
-
| **ORM** | Sequelize
|
|
263
|
+
| **ORM** | Sequelize, TypeORM, Prisma | Drizzle |
|
|
237
264
|
| **Framework** | Express | NestJS, Fastify, Koa |
|
|
238
265
|
| **Test Runner** | Playwright | — |
|
|
239
|
-
| **LLM** | OpenAI, ZhiPu (GLM)
|
|
266
|
+
| **LLM** | OpenAI, ZhiPu (GLM), Ollama (local) | Anthropic |
|
|
240
267
|
| **Database** | MySQL, PostgreSQL | SQLite, MongoDB |
|
|
241
268
|
|
|
242
269
|
## Comparison
|
|
@@ -259,12 +286,16 @@ export default defineConfig({
|
|
|
259
286
|
- [x] Controlled self-healing loop
|
|
260
287
|
- [x] Log-driven completion detection
|
|
261
288
|
- [x] Failure chain attribution + impact analysis
|
|
262
|
-
- [
|
|
289
|
+
- [x] TypeORM / Prisma adapter
|
|
290
|
+
- [x] Ollama local LLM support
|
|
291
|
+
- [x] Real-world validation (102 tables, 65 relations, 78 generated tests)
|
|
292
|
+
- [x] GitHub Actions / GitLab CI integration
|
|
293
|
+
- [x] VS Code extension scaffold
|
|
294
|
+
- [x] Plugin system
|
|
295
|
+
- [x] HTML / JSON / Markdown report generation
|
|
263
296
|
- [ ] NestJS controller parser
|
|
264
297
|
- [ ] Visual dashboard (opencroc.com)
|
|
265
|
-
- [ ]
|
|
266
|
-
- [ ] VS Code extension
|
|
267
|
-
- [ ] Ollama local LLM support
|
|
298
|
+
- [ ] Drizzle ORM adapter
|
|
268
299
|
|
|
269
300
|
## Documentation
|
|
270
301
|
|
package/README.ja.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/opencroc"><img src="https://img.shields.io/npm/v/opencroc?color=green" alt="npm version" /></a>
|
|
13
|
+
<a href="https://github.com/opencroc/opencroc/actions/workflows/ci.yml"><img src="https://github.com/opencroc/opencroc/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
|
|
13
14
|
<a href="https://github.com/opencroc/opencroc/blob/main/LICENSE"><img src="https://img.shields.io/github/license/opencroc/opencroc" alt="MIT License" /></a>
|
|
14
15
|
<a href="https://opencroc.com"><img src="https://img.shields.io/badge/docs-opencroc.com-blue" alt="Documentation" /></a>
|
|
15
16
|
</p>
|
|
@@ -179,6 +180,32 @@ Test Failure
|
|
|
179
180
|
-> Commit or Rollback
|
|
180
181
|
```
|
|
181
182
|
|
|
183
|
+
## 実プロジェクト検証
|
|
184
|
+
|
|
185
|
+
OpenCroc は**本番規模の RBAC システム**(マルチテナント企業権限管理)で検証済みです。100+ の Sequelize モデル、75+ の Express コントローラー、モデルファイル内埋め込みアソシエーションを含みます:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
$ npx tsx examples/rbac-system/smoke-test.ts
|
|
189
|
+
|
|
190
|
+
Modules : 5 (default, aigc, data-platform, integration, workflow)
|
|
191
|
+
ER Diagrams : 5
|
|
192
|
+
[default] 102 tables, 65 relations
|
|
193
|
+
[aigc] 6 tables, 0 relations
|
|
194
|
+
[data-platform] 4 tables, 0 relations
|
|
195
|
+
[integration] 14 tables, 0 relations
|
|
196
|
+
[workflow] 2 tables, 0 relations
|
|
197
|
+
Chain Plans : 5
|
|
198
|
+
[aigc] 78 chains, 150 steps
|
|
199
|
+
Generated Files: 78
|
|
200
|
+
Duration : 1153ms
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
主な結果:
|
|
204
|
+
- フラットモデルレイアウトから **102 テーブル** と **65 の外部キー関係** を正確に抽出
|
|
205
|
+
- 専用の association ファイル不要 — モデルファイル内の**埋め込みアソシエーション**(`.belongsTo()` / `.hasMany()`)を検出
|
|
206
|
+
- 5 モジュールで **78 テストファイル** を約1秒で生成
|
|
207
|
+
- フラット(`models/*.ts`)とネスト(`models/module/*.ts`)の両ディレクトリ構造に対応
|
|
208
|
+
|
|
182
209
|
## 設定例
|
|
183
210
|
|
|
184
211
|
```typescript
|
|
@@ -233,10 +260,10 @@ export default defineConfig({
|
|
|
233
260
|
|
|
234
261
|
| レイヤー | 対応済み | 予定 |
|
|
235
262
|
|---|---|---|
|
|
236
|
-
| **ORM** | Sequelize
|
|
263
|
+
| **ORM** | Sequelize, TypeORM, Prisma | Drizzle |
|
|
237
264
|
| **Framework** | Express | NestJS, Fastify, Koa |
|
|
238
265
|
| **Test Runner** | Playwright | — |
|
|
239
|
-
| **LLM** | OpenAI, ZhiPu (GLM)
|
|
266
|
+
| **LLM** | OpenAI, ZhiPu (GLM), Ollama (local) | Anthropic |
|
|
240
267
|
| **Database** | MySQL, PostgreSQL | SQLite, MongoDB |
|
|
241
268
|
|
|
242
269
|
## 比較
|
|
@@ -259,12 +286,16 @@ export default defineConfig({
|
|
|
259
286
|
- [x] Controlled self-healing loop
|
|
260
287
|
- [x] Log-driven completion detection
|
|
261
288
|
- [x] Failure chain attribution + impact analysis
|
|
262
|
-
- [
|
|
289
|
+
- [x] TypeORM / Prisma adapter
|
|
290
|
+
- [x] Ollama local LLM support
|
|
291
|
+
- [x] Real-world validation (102 tables, 65 relations, 78 generated tests)
|
|
292
|
+
- [x] GitHub Actions / GitLab CI integration
|
|
293
|
+
- [x] VS Code extension scaffold
|
|
294
|
+
- [x] Plugin system
|
|
295
|
+
- [x] HTML / JSON / Markdown report generation
|
|
263
296
|
- [ ] NestJS controller parser
|
|
264
297
|
- [ ] Visual dashboard (opencroc.com)
|
|
265
|
-
- [ ]
|
|
266
|
-
- [ ] VS Code extension
|
|
267
|
-
- [ ] Ollama local LLM support
|
|
298
|
+
- [ ] Drizzle ORM adapter
|
|
268
299
|
|
|
269
300
|
## ドキュメント
|
|
270
301
|
|
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/opencroc"><img src="https://img.shields.io/npm/v/opencroc?color=green" alt="npm version" /></a>
|
|
13
|
+
<a href="https://github.com/opencroc/opencroc/actions/workflows/ci.yml"><img src="https://github.com/opencroc/opencroc/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
|
|
13
14
|
<a href="https://github.com/opencroc/opencroc/blob/main/LICENSE"><img src="https://img.shields.io/github/license/opencroc/opencroc" alt="MIT License" /></a>
|
|
14
15
|
<a href="https://opencroc.com"><img src="https://img.shields.io/badge/docs-opencroc.com-blue" alt="Documentation" /></a>
|
|
15
16
|
</p>
|
|
@@ -179,6 +180,32 @@ Test Failure
|
|
|
179
180
|
→ Commit or Rollback
|
|
180
181
|
```
|
|
181
182
|
|
|
183
|
+
## Real-World Validation
|
|
184
|
+
|
|
185
|
+
OpenCroc has been validated against a **production-scale RBAC system** (multi-tenant enterprise permission management) with 100+ Sequelize models, 75+ Express controllers, and embedded associations:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
$ npx tsx examples/rbac-system/smoke-test.ts
|
|
189
|
+
|
|
190
|
+
Modules : 5 (default, aigc, data-platform, integration, workflow)
|
|
191
|
+
ER Diagrams : 5
|
|
192
|
+
[default] 102 tables, 65 relations
|
|
193
|
+
[aigc] 6 tables, 0 relations
|
|
194
|
+
[data-platform] 4 tables, 0 relations
|
|
195
|
+
[integration] 14 tables, 0 relations
|
|
196
|
+
[workflow] 2 tables, 0 relations
|
|
197
|
+
Chain Plans : 5
|
|
198
|
+
[aigc] 78 chains, 150 steps
|
|
199
|
+
Generated Files: 78
|
|
200
|
+
Duration : 1153ms
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Key findings:
|
|
204
|
+
- **102 tables** and **65 foreign key relations** correctly extracted from flat model layout
|
|
205
|
+
- **Embedded associations** (`.belongsTo()` / `.hasMany()` inside model files) detected without dedicated association files
|
|
206
|
+
- **78 test files** generated across 5 modules in just over 1 second
|
|
207
|
+
- Handles both flat (`models/*.ts`) and nested (`models/module/*.ts`) directory structures
|
|
208
|
+
|
|
182
209
|
## Configuration
|
|
183
210
|
|
|
184
211
|
```typescript
|
|
@@ -233,10 +260,10 @@ export default defineConfig({
|
|
|
233
260
|
|
|
234
261
|
| Layer | Supported | Planned |
|
|
235
262
|
|---|---|---|
|
|
236
|
-
| **ORM** | Sequelize
|
|
263
|
+
| **ORM** | Sequelize, TypeORM, Prisma | Drizzle |
|
|
237
264
|
| **Framework** | Express | NestJS, Fastify, Koa |
|
|
238
265
|
| **Test Runner** | Playwright | — |
|
|
239
|
-
| **LLM** | OpenAI, ZhiPu (GLM)
|
|
266
|
+
| **LLM** | OpenAI, ZhiPu (GLM), Ollama (local) | Anthropic |
|
|
240
267
|
| **Database** | MySQL, PostgreSQL | SQLite, MongoDB |
|
|
241
268
|
|
|
242
269
|
## Comparison
|
|
@@ -259,12 +286,16 @@ export default defineConfig({
|
|
|
259
286
|
- [x] Controlled self-healing loop
|
|
260
287
|
- [x] Log-driven completion detection
|
|
261
288
|
- [x] Failure chain attribution + impact analysis
|
|
262
|
-
- [
|
|
289
|
+
- [x] TypeORM / Prisma adapter
|
|
290
|
+
- [x] Ollama local LLM support
|
|
291
|
+
- [x] Real-world validation (102 tables, 65 relations, 78 generated tests)
|
|
292
|
+
- [x] GitHub Actions / GitLab CI integration
|
|
293
|
+
- [x] VS Code extension scaffold
|
|
294
|
+
- [x] Plugin system
|
|
295
|
+
- [x] HTML / JSON / Markdown report generation
|
|
263
296
|
- [ ] NestJS controller parser
|
|
264
297
|
- [ ] Visual dashboard (opencroc.com)
|
|
265
|
-
- [ ]
|
|
266
|
-
- [ ] VS Code extension
|
|
267
|
-
- [ ] Ollama local LLM support
|
|
298
|
+
- [ ] Drizzle ORM adapter
|
|
268
299
|
|
|
269
300
|
## Documentation
|
|
270
301
|
|
package/README.zh-CN.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/opencroc"><img src="https://img.shields.io/npm/v/opencroc?color=green" alt="npm version" /></a>
|
|
13
|
+
<a href="https://github.com/opencroc/opencroc/actions/workflows/ci.yml"><img src="https://github.com/opencroc/opencroc/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
|
|
13
14
|
<a href="https://github.com/opencroc/opencroc/blob/main/LICENSE"><img src="https://img.shields.io/github/license/opencroc/opencroc" alt="MIT License" /></a>
|
|
14
15
|
<a href="https://opencroc.com"><img src="https://img.shields.io/badge/docs-opencroc.com-blue" alt="Documentation" /></a>
|
|
15
16
|
</p>
|
|
@@ -179,6 +180,32 @@ Test Failure
|
|
|
179
180
|
-> Commit or Rollback
|
|
180
181
|
```
|
|
181
182
|
|
|
183
|
+
## 真实项目验证
|
|
184
|
+
|
|
185
|
+
OpenCroc 已在一套**生产级 RBAC 系统**(多租户企业权限管理)上完成验证,涵盖 100+ Sequelize 模型、75+ Express 控制器、以及模型文件内嵌的关联声明:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
$ npx tsx examples/rbac-system/smoke-test.ts
|
|
189
|
+
|
|
190
|
+
Modules : 5 (default, aigc, data-platform, integration, workflow)
|
|
191
|
+
ER Diagrams : 5
|
|
192
|
+
[default] 102 tables, 65 relations
|
|
193
|
+
[aigc] 6 tables, 0 relations
|
|
194
|
+
[data-platform] 4 tables, 0 relations
|
|
195
|
+
[integration] 14 tables, 0 relations
|
|
196
|
+
[workflow] 2 tables, 0 relations
|
|
197
|
+
Chain Plans : 5
|
|
198
|
+
[aigc] 78 chains, 150 steps
|
|
199
|
+
Generated Files: 78
|
|
200
|
+
Duration : 1153ms
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
关键发现:
|
|
204
|
+
- 从扁平模型布局中正确提取了 **102 张表** 和 **65 条外键关系**
|
|
205
|
+
- 无需独立 association 文件,直接检测模型文件中的**嵌入式关联**(`.belongsTo()` / `.hasMany()`)
|
|
206
|
+
- 5 个模块共生成 **78 个测试文件**,耗时仅 1 秒出头
|
|
207
|
+
- 同时兼容扁平(`models/*.ts`)和嵌套(`models/module/*.ts`)目录结构
|
|
208
|
+
|
|
182
209
|
## 配置示例
|
|
183
210
|
|
|
184
211
|
```typescript
|
|
@@ -233,10 +260,10 @@ export default defineConfig({
|
|
|
233
260
|
|
|
234
261
|
| 层级 | 已支持 | 规划中 |
|
|
235
262
|
|---|---|---|
|
|
236
|
-
| **ORM** | Sequelize
|
|
263
|
+
| **ORM** | Sequelize, TypeORM, Prisma | Drizzle |
|
|
237
264
|
| **Framework** | Express | NestJS, Fastify, Koa |
|
|
238
265
|
| **Test Runner** | Playwright | — |
|
|
239
|
-
| **LLM** | OpenAI, ZhiPu (GLM)
|
|
266
|
+
| **LLM** | OpenAI, ZhiPu (GLM), Ollama (local) | Anthropic |
|
|
240
267
|
| **Database** | MySQL, PostgreSQL | SQLite, MongoDB |
|
|
241
268
|
|
|
242
269
|
## 对比
|
|
@@ -259,12 +286,16 @@ export default defineConfig({
|
|
|
259
286
|
- [x] Controlled self-healing loop
|
|
260
287
|
- [x] Log-driven completion detection
|
|
261
288
|
- [x] Failure chain attribution + impact analysis
|
|
262
|
-
- [
|
|
289
|
+
- [x] TypeORM / Prisma adapter
|
|
290
|
+
- [x] Ollama local LLM support
|
|
291
|
+
- [x] Real-world validation (102 tables, 65 relations, 78 generated tests)
|
|
292
|
+
- [x] GitHub Actions / GitLab CI integration
|
|
293
|
+
- [x] VS Code extension scaffold
|
|
294
|
+
- [x] Plugin system
|
|
295
|
+
- [x] HTML / JSON / Markdown report generation
|
|
263
296
|
- [ ] NestJS controller parser
|
|
264
297
|
- [ ] Visual dashboard (opencroc.com)
|
|
265
|
-
- [ ]
|
|
266
|
-
- [ ] VS Code extension
|
|
267
|
-
- [ ] Ollama local LLM support
|
|
298
|
+
- [ ] Drizzle ORM adapter
|
|
268
299
|
|
|
269
300
|
## 文档
|
|
270
301
|
|