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 +1 -5
- package/package.json +2 -1
- package/templates/minimal/context/glossary/example-term.term.yaml +5 -0
- package/templates/minimal/context/governance/example-model.governance.yaml +23 -0
- package/templates/minimal/context/lineage/example-model.lineage.yaml +12 -0
- package/templates/minimal/context/models/example-model.osi.yaml +51 -0
- package/templates/minimal/context/owners/example-team.owner.yaml +1 -0
- package/templates/minimal/context/rules/example-model.rules.yaml +19 -0
- package/templates/minimal/contextkit.config.yaml.template +3 -4
- package/templates/minimal/context/concepts/example-concept.ctx.yaml +0 -5
- package/templates/minimal/context/policies/example-policy.policy.yaml +0 -8
- package/templates/minimal/context/products/example-product.ctx.yaml +0 -4
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.
|
|
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,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,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
|
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
version: "0.1.0"
|
|
1
|
+
context_dir: context
|
|
2
|
+
output_dir: dist
|
|
3
|
+
minimum_tier: bronze
|