@objectql/cli 4.0.0 → 4.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectql/cli",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Command-line interface for ObjectQL - Code generation, migrations, REPL, and AI-powered development tools",
5
5
  "keywords": [
6
6
  "objectql",
@@ -34,11 +34,11 @@
34
34
  "ts-node": "^10.9.1",
35
35
  "openai": "^4.28.0",
36
36
  "dotenv": "^16.4.5",
37
- "@objectql/types": "4.0.0",
38
- "@objectql/core": "4.0.0",
39
- "@objectql/server": "4.0.0",
40
- "@objectql/driver-sql": "4.0.0",
41
- "@objectql/platform-node": "4.0.0"
37
+ "@objectql/types": "4.0.2",
38
+ "@objectql/core": "4.0.2",
39
+ "@objectql/server": "4.0.2",
40
+ "@objectql/driver-sql": "4.0.2",
41
+ "@objectql/platform-node": "4.0.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "typescript": "^5.0.0",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsc && pnpm run copy-templates",
50
- "copy-templates": "rm -rf templates && mkdir -p templates && cp -r ../../../examples/quickstart/hello-world templates/ && cp -r ../../../examples/showcase/project-tracker templates/starter && rm -rf templates/*/node_modules templates/*/dist",
50
+ "copy-templates": "rm -rf templates && mkdir -p templates && cp -r ../../../examples/quickstart/hello-world templates/ && cp -r ../../../examples/showcase/project-tracker templates/starter && rm -rf templates/*/node_modules templates/*/dist templates/*/__tests__",
51
51
  "watch": "tsc -w",
52
52
  "test": "jest"
53
53
  }
@@ -1,5 +1,21 @@
1
1
  # @example/hello-world
2
2
 
3
+ ## 4.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @objectql/core@4.0.2
9
+ - @objectql/driver-sql@4.0.2
10
+
11
+ ## 4.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+ - @objectql/core@4.0.1
17
+ - @objectql/driver-sql@4.0.1
18
+
3
19
  ## 3.0.1
4
20
 
5
21
  ### Patch Changes
@@ -1,11 +1,51 @@
1
1
  # Hello ObjectQL
2
2
 
3
- This is the simplest possible example of **ObjectQL**.
3
+ This is the simplest possible example of **ObjectQL** following the **latest ObjectStack specification** (v4.0+).
4
4
 
5
- It demonstrates:
6
- 1. **Zero Config:** No YAML files or server setup required.
7
- 2. **In-Memory SQL:** Uses SQLite in memory, so no database installation is needed.
8
- 3. **Inline Schema:** Defines the data model directly in code.
5
+ ## What it demonstrates
6
+
7
+ 1. **Zero Config:** No YAML files or server setup required
8
+ 2. **In-Memory SQL:** Uses SQLite in memory, so no database installation is needed
9
+ 3. **Inline Schema:** Defines the data model directly in code using programmatic API
10
+ 4. **Latest Spec Compliance:**
11
+ - Label/value format for select options
12
+ - Explicit field labels for AI-friendly metadata
13
+ - Proper field type declarations
14
+
15
+ ## Key Concepts
16
+
17
+ ### Metadata Definition Approaches
18
+
19
+ **Programmatic (This Example):**
20
+ ```typescript
21
+ app.registerObject({
22
+ name: 'deal', // Required when using code
23
+ fields: {
24
+ stage: {
25
+ type: 'select',
26
+ options: [
27
+ { label: 'New', value: 'new' }, // ✅ Latest spec format
28
+ { label: 'Negotiation', value: 'negotiation' }
29
+ ]
30
+ }
31
+ }
32
+ });
33
+ ```
34
+
35
+ **YAML-based (Recommended for Production):**
36
+ ```yaml
37
+ # File: deal.object.yml
38
+ # NO 'name:' field needed - inferred from filename! ✅
39
+ label: Deal
40
+ fields:
41
+ stage:
42
+ type: select
43
+ options:
44
+ - label: New
45
+ value: new
46
+ - label: Negotiation
47
+ value: negotiation
48
+ ```
9
49
 
10
50
  ## How to Run
11
51
 
@@ -16,14 +56,37 @@ Since you are in the monorepo, simply run:
16
56
  pnpm install
17
57
 
18
58
  # Run the script
19
- cd examples/starters/hello-world
59
+ cd examples/quickstart/hello-world
20
60
  pnpm start
21
61
  ```
22
62
 
23
63
  ## What you see
24
64
 
25
65
  The script will:
26
- 1. Initialize the ObjectQL engine.
27
- 2. Create a `deal` object definition on the fly.
28
- 3. Insert a record into the in-memory SQLite database.
29
- 4. Query it back and print the result.
66
+ 1. Initialize the ObjectQL engine with an in-memory SQLite driver
67
+ 2. Create a `deal` object definition programmatically
68
+ 3. Insert a record into the database
69
+ 4. Query it back and print the result
70
+
71
+ ## Expected Output
72
+
73
+ ```
74
+ 🚀 Starting ObjectQL Hello World...
75
+ Creating a new Deal...
76
+ ✅ Deals found in database: [
77
+ {
78
+ _id: '...',
79
+ title: 'Enterprise Contract',
80
+ amount: 50000,
81
+ stage: 'new',
82
+ created_at: '...',
83
+ updated_at: '...'
84
+ }
85
+ ]
86
+ ```
87
+
88
+ ## Next Steps
89
+
90
+ - See [Project Tracker Example](../../showcase/project-tracker/) for YAML-based metadata
91
+ - Read the [Metadata Standard Spec](https://protocol.objectstack.ai) from @objectstack/spec
92
+ - Explore the [ObjectQL Documentation](../../../content/docs/)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectql/example-hello-world",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "private": true,
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,14 +26,26 @@ async function main() {
26
26
  }
27
27
  });
28
28
 
29
- // 3. Define Metadata Inline
29
+ // 3. Define Metadata Inline (Following Latest ObjectStack Specification)
30
+ // Note: When using registerObject(), the 'name' is required in code
31
+ // When using YAML files, the name is inferred from filename (e.g., deal.object.yml)
30
32
  app.registerObject({
31
- name: 'deal',
33
+ name: 'deal', // Required for programmatic registration
34
+ label: 'Deal', // Human-readable label
32
35
  fields: {
33
- title: { type: 'text', required: true },
34
- amount: { type: 'currency' },
36
+ title: {
37
+ type: 'text',
38
+ required: true,
39
+ label: 'Deal Title'
40
+ },
41
+ amount: {
42
+ type: 'currency',
43
+ label: 'Deal Amount'
44
+ },
35
45
  stage: {
36
- type: 'select',
46
+ type: 'select',
47
+ label: 'Deal Stage',
48
+ // Options use label/value format (ObjectStack spec v4.0+)
37
49
  options: [
38
50
  { label: 'New', value: 'new' },
39
51
  { label: 'Negotiation', value: 'negotiation' },
@@ -1,5 +1,25 @@
1
1
  # @objectql/starter-basic
2
2
 
3
+ ## 4.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @objectql/core@4.0.2
9
+ - @objectql/driver-sql@4.0.2
10
+ - @objectql/platform-node@4.0.2
11
+ - @objectql/types@4.0.2
12
+
13
+ ## 4.0.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+ - @objectql/core@4.0.1
19
+ - @objectql/driver-sql@4.0.1
20
+ - @objectql/platform-node@4.0.1
21
+ - @objectql/types@4.0.1
22
+
3
23
  ## 3.0.1
4
24
 
5
25
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectql/example-project-tracker",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "ObjectQL Basic Example Project",
5
5
  "private": true,
6
6
  "keywords": [