create-contextkit 0.1.1 → 0.2.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.
package/dist/index.js CHANGED
@@ -55,11 +55,6 @@ function main() {
55
55
  fs.mkdirSync(projectDir, { recursive: true });
56
56
  const createdFiles = [];
57
57
  copyDir(templatesDir, projectDir, createdFiles, projectDir, projectName, displayName);
58
- const emptyDirs = ["context/entities", "context/terms"];
59
- for (const dir of emptyDirs) {
60
- const dirPath = path.join(projectDir, dir);
61
- fs.mkdirSync(dirPath, { recursive: true });
62
- }
63
58
  for (const file of createdFiles) {
64
59
  console.log(` Created ${file}`);
65
60
  }
@@ -68,5 +63,6 @@ function main() {
68
63
  console.log(` cd ${projectName}`);
69
64
  console.log(" pnpm add -D @runcontext/cli");
70
65
  console.log(" npx context lint");
66
+ console.log(" npx context tier");
71
67
  }
72
68
  main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-contextkit",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Scaffold a new ContextKit project",
5
5
  "license": "MIT",
6
6
  "author": "Eric Kittelson",
@@ -19,6 +19,7 @@
19
19
  "clean": "rm -rf dist"
20
20
  },
21
21
  "devDependencies": {
22
+ "@types/node": "^25.3.3",
22
23
  "tsup": "^8.4.0",
23
24
  "typescript": "^5.7.0"
24
25
  }
@@ -0,0 +1,5 @@
1
+ id: revenue
2
+ definition: "Total value of completed orders before refunds"
3
+ synonyms: [sales, order revenue]
4
+ owner: example-team
5
+ tags: [finance]
@@ -0,0 +1,23 @@
1
+ model: example-model
2
+ owner: example-team
3
+ trust: endorsed
4
+ security: internal
5
+ tags: [orders, revenue]
6
+
7
+ datasets:
8
+ orders:
9
+ grain: "One row per order"
10
+ refresh: daily
11
+ table_type: fact
12
+
13
+ fields:
14
+ orders.amount:
15
+ semantic_role: metric
16
+ default_aggregation: SUM
17
+ additive: true
18
+ orders.order_id:
19
+ semantic_role: identifier
20
+ orders.customer_id:
21
+ semantic_role: identifier
22
+ orders.order_date:
23
+ semantic_role: date
@@ -0,0 +1,12 @@
1
+ model: example-model
2
+
3
+ upstream:
4
+ - source: source-system.raw-data
5
+ type: pipeline
6
+ refresh: daily
7
+ notes: Raw data ingested daily via ETL pipeline
8
+
9
+ downstream:
10
+ - target: analytics-dashboard
11
+ type: dashboard
12
+ notes: Executive KPI dashboard
@@ -0,0 +1,51 @@
1
+ version: "1.0"
2
+
3
+ semantic_model:
4
+ - name: example-model
5
+ description: Example orders analytics model
6
+ ai_context:
7
+ instructions: "Use for order and revenue analysis"
8
+ synonyms: ["orders model"]
9
+
10
+ datasets:
11
+ - name: orders
12
+ source: warehouse.public.orders
13
+ primary_key: [order_id]
14
+ description: "Orders fact table"
15
+ fields:
16
+ - name: order_id
17
+ expression:
18
+ dialects:
19
+ - dialect: ANSI_SQL
20
+ expression: order_id
21
+ description: Unique order identifier
22
+ - name: customer_id
23
+ expression:
24
+ dialects:
25
+ - dialect: ANSI_SQL
26
+ expression: customer_id
27
+ description: Foreign key to customers
28
+ dimension:
29
+ is_time: false
30
+ - name: amount
31
+ expression:
32
+ dialects:
33
+ - dialect: ANSI_SQL
34
+ expression: amount
35
+ description: Order amount in USD
36
+ - name: order_date
37
+ expression:
38
+ dialects:
39
+ - dialect: ANSI_SQL
40
+ expression: order_date
41
+ description: Date the order was placed
42
+ dimension:
43
+ is_time: true
44
+
45
+ metrics:
46
+ - name: total_revenue
47
+ expression:
48
+ dialects:
49
+ - dialect: ANSI_SQL
50
+ expression: "SUM(orders.amount)"
51
+ description: Total revenue across all orders
@@ -1,3 +1,4 @@
1
1
  id: example-team
2
2
  display_name: Example Team
3
3
  email: team@example.com
4
+ description: "Responsible for data and analytics"
@@ -0,0 +1,19 @@
1
+ model: example-model
2
+
3
+ golden_queries:
4
+ - question: "What is total revenue?"
5
+ sql: |
6
+ SELECT SUM(amount) AS total_revenue
7
+ FROM orders
8
+ dialect: ANSI_SQL
9
+ tags: [revenue]
10
+
11
+ business_rules:
12
+ - name: positive-amounts
13
+ definition: "Only include orders with positive amounts in revenue calculations"
14
+ enforcement:
15
+ - "Filter to amount > 0 when calculating revenue"
16
+ avoid:
17
+ - "Do not include negative or zero amounts in revenue totals"
18
+ tables: [orders]
19
+ applied_always: true
@@ -1,4 +1,3 @@
1
- project:
2
- id: {{PROJECT_NAME}}
3
- displayName: "{{PROJECT_DISPLAY_NAME}}"
4
- version: "0.1.0"
1
+ context_dir: context
2
+ output_dir: dist
3
+ minimum_tier: bronze
@@ -1,5 +0,0 @@
1
- id: example-concept
2
- definition: An example concept to get you started.
3
- owner: example-team
4
- status: draft
5
- tags: [example]
@@ -1,8 +0,0 @@
1
- id: example-policy
2
- description: An example policy.
3
- rules:
4
- - priority: 100
5
- when:
6
- tags_any: [sensitive]
7
- then:
8
- require_role: admin
@@ -1,4 +0,0 @@
1
- id: example-product
2
- description: An example product to get you started.
3
- owner: example-team
4
- tags: [example]