Skip to content

Commit 8842def

Browse files
committed
Merge branch 'main' into copilot/add-github-workflows
2 parents a4c23f7 + eb3ad4e commit 8842def

297 files changed

Lines changed: 21873 additions & 5402 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
"@objectql/sdk",
1313
"@objectql/server",
1414
"@objectql/types",
15-
"@objectql/platform-node",
16-
"@objectql/starter-basic",
17-
"@objectql/starter-express-api",
18-
"@objectql/starter-enterprise"
15+
"@objectql/platform-node"
1916
]
2017
],
2118
"linked": [],
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Configuration for GitHub Dependency Review Action
2+
# This config lowers the OpenSSF Scorecard threshold to prevent false positives
3+
# Many widely-used packages have low scores but are safe and maintained
4+
5+
# OpenSSF Scorecard threshold
6+
# Default is 3.0, but many popular packages score below this
7+
# Examples: xmlbuilder (1.9), yallist (2.8), core-util-is (1.7)
8+
fail_on_scorecard: 1.5
9+
10+
# Still fail on actual vulnerabilities
11+
fail_on_severity: moderate

.github/workflows/dependency-review.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ jobs:
2323
fail-on-severity: moderate
2424
# Warn about deprecated packages
2525
warn-on-deprecated: true
26-
# Comment on the PR with the review results
27-
comment-summary-in-pr: on-failure
26+
# Use config file to set OpenSSF Scorecard threshold
27+
config-file: './.github/dependency-review-config.yml'
28+
# Don't auto-comment on PR to avoid hitting GitHub's 64KB comment size limit
29+
# Users can view the full report in the Actions tab or download the artifact

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ docs/.vitepress/dist
1515
*.db
1616

1717
# Example tutorials CHANGELOG (auto-generated, not tracked)
18-
examples/tutorials/*/CHANGELOG.md
18+
examples/tutorials/*/CHANGELOG.md
19+
# Generated Types
20+
generated/

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"recommendations": [
3-
"redhat.vscode-yaml"
3+
"redhat.vscode-yaml",
4+
"objectstack-ai.vscode-objectql"
45
]
56
}

.vscode/launch.json

Lines changed: 0 additions & 53 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "Run Studio: Basic Script",
5+
"label": "Run Dev Server",
66
"type": "shell",
7-
"command": "node",
7+
"command": "pnpm",
88
"args": [
9-
"packages/cli/dist/index.js",
10-
"studio",
11-
"--dir",
12-
"examples/starters/basic-script"
9+
"objectql",
10+
"dev"
1311
],
1412
"group": "test",
1513
"presentation": {

README.md

Lines changed: 104 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -45,69 +45,54 @@ ObjectQL is organized as a Monorepo to ensure modularity and universal compatibi
4545

4646
## ⚡ Quick Start
4747

48-
### 1. Installation
48+
### 1. Create a New Project
49+
50+
The fastest way to start is using the CLI to scaffold a new project.
4951

5052
```bash
51-
# Install core and a driver (e.g., Postgres or SQLite)
52-
npm install @objectql/core @objectql/driver-sql sqlite3
53+
# Generate a new project
54+
npm create @objectql@latest my-app
55+
56+
# Choose 'starter' for a complete example or 'hello-world' for minimal setup
5357
```
5458

55-
### 2. The Universal Script
59+
### 2. Install VS Code Extension (Critical 🚨)
5660

57-
ObjectQL can run in a single file without complex configuration.
61+
For the best experience, install the official extension. It provides **Intelligent IntelliSense** and **Real-time Validation** for your YAML models.
5862

59-
```typescript
60-
import { ObjectQL } from '@objectql/core';
61-
import { SqlDriver } from '@objectql/driver-sql';
62-
63-
async function main() {
64-
// 1. Initialize Driver (In-Memory SQLite)
65-
const driver = new SqlDriver({
66-
client: 'sqlite3',
67-
connection: { filename: ':memory:' },
68-
useNullAsDefault: true
69-
});
70-
71-
// 2. Initialize Engine
72-
const app = new ObjectQL({
73-
datasources: { default: driver }
74-
});
75-
76-
// 3. Define Schema (The "Object")
77-
// In a real app, this would be loaded from a .yml file
78-
app.registerObject({
79-
name: "users",
80-
fields: {
81-
name: { type: "text", required: true },
82-
email: { type: "email", unique: true },
83-
role: {
84-
type: "select",
85-
options: ["admin", "user"],
86-
defaultValue: "user"
87-
}
88-
}
89-
});
90-
91-
await app.init();
92-
93-
// 4. Enjoy Type-Safe(ish) CRUD
94-
const ctx = app.createContext({ isSystem: true });
95-
const repo = ctx.object('users');
96-
97-
// Create
98-
await repo.create({ name: 'Alice', email: 'alice@example.com' });
99-
100-
// Find
101-
const users = await repo.find({
102-
filters: [['role', '=', 'user']]
103-
});
104-
105-
console.log(users);
106-
}
63+
* Search for **"ObjectQL"** in the VS Code Marketplace.
64+
* Or open your new project, and VS Code will recommend it automatically via `.vscode/extensions.json`.
65+
66+
### 3. Define Metadata (The "Object")
67+
68+
ObjectQL uses **YAML** as the source of truth. Create a file `src/objects/story.object.yml`:
69+
70+
```yaml
71+
name: story
72+
label: User Story
73+
fields:
74+
title:
75+
type: text
76+
required: true
77+
status:
78+
type: select
79+
options: [draft, active, done]
80+
default: draft
81+
points:
82+
type: number
83+
scale: 0
84+
default: 1
85+
```
86+
87+
### 4. Run & Play
10788
108-
main();
89+
Start the development server. ObjectQL will automatically load your YAML files and generate the database schema.
90+
91+
```bash
92+
npm run dev
10993
```
11094

95+
11196
---
11297

11398
## 🔌 The Driver Ecosystem
@@ -210,6 +195,33 @@ ObjectQL supports three distinct query interfaces, each optimized for different
210195

211196
---
212197

198+
## 🛠️ Developer Tools
199+
200+
### VSCode Extension
201+
202+
Enhance your ObjectQL development experience with our official VSCode extension.
203+
204+
**Features:**
205+
- 🎯 Intelligent IntelliSense for `.object.yml`, `.validation.yml`, `.permission.yml`, `.app.yml`
206+
- ✅ Real-time JSON Schema validation with inline errors
207+
- 📝 30+ code snippets for objects, fields, validations, hooks, and actions
208+
- ⚡ Quick commands to create new ObjectQL files from templates
209+
- 🎨 Custom file icons and syntax highlighting
210+
- 🔍 Context-aware auto-completion
211+
212+
**Installation:**
213+
```bash
214+
cd packages/tools/vscode-objectql
215+
npm install
216+
npm run compile
217+
npm run package
218+
# Then install the generated .vsix file in VS Code
219+
```
220+
221+
See [`packages/tools/vscode-objectql/README.md`](./packages/tools/vscode-objectql/README.md) for detailed documentation.
222+
223+
---
224+
213225
## 🛠️ Validation & Logic
214226

215227
ObjectQL includes a powerful validation engine that runs universally.
@@ -247,6 +259,44 @@ For a complete status report on ObjectQL's implementation against the documented
247259

248260
---
249261

262+
## 🛠️ Development & Contributing
263+
264+
If you fork or clone the repository to contribute or run examples from source:
265+
266+
1. **Setup Workspace**
267+
```bash
268+
git clone https://github.com/objectql/objectql.git
269+
cd objectql
270+
npm install -g pnpm
271+
pnpm install
272+
```
273+
274+
2. **Build Packages**
275+
You must build the core libraries before running examples, as they rely on local workspace builds.
276+
```bash
277+
pnpm build
278+
```
279+
280+
3. **Run Examples**
281+
282+
These examples run as **scripts** to demonstrate the ObjectQL Core Engine capabilities (Validation, CRUD, Logic Hooks). They use an in-memory SQLite database.
283+
284+
**Starter (Project Tracker):**
285+
```bash
286+
# Starts the API Server (http://localhost:3000)
287+
pnpm --filter @objectql/example-project-tracker start
288+
289+
# Note: Sample data (projects.data.yml) is automatically loaded on startup
290+
```
291+
292+
**Enterprise ERP:**
293+
```bash
294+
pnpm --filter @objectql/example-enterprise-erp start
295+
# Output: Plugin initialization, Employee creation logs, Audit trails
296+
```
297+
298+
---
299+
250300
## ⚖️ License
251301

252302
ObjectQL is open-source software licensed under the [MIT License](https://www.google.com/search?q=LICENSE).

docs/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@ curl -X POST http://localhost:3000/api/objectql \
8686
### Auto-Generated Specs
8787

8888
For automated tool ingestion, use the following endpoints:
89-
- **OpenAPI / Swagger**: `/api/docs/swagger.json`
89+
- **OpenAPI / Swagger**: `/openapi.json` (Used by `/docs` UI)
9090
- **GraphQL Schema**: `/api/graphql/schema`

0 commit comments

Comments
 (0)