@contractspec/example.learning-journey-platform-tour 1.57.0 → 1.58.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.
Files changed (67) hide show
  1. package/.turbo/turbo-build.log +46 -50
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +14 -0
  4. package/dist/browser/docs/index.js +37 -0
  5. package/dist/browser/docs/platform-tour.docblock.js +37 -0
  6. package/dist/browser/example.js +34 -0
  7. package/dist/browser/handlers/demo.handlers.js +130 -0
  8. package/dist/browser/index.js +415 -0
  9. package/dist/browser/learning-journey-platform-tour.feature.js +47 -0
  10. package/dist/browser/operations/index.js +221 -0
  11. package/dist/browser/presentations/index.js +268 -0
  12. package/dist/browser/tests/operations.test-spec.js +34 -0
  13. package/dist/browser/track.js +107 -0
  14. package/dist/docs/index.d.ts +2 -1
  15. package/dist/docs/index.d.ts.map +1 -0
  16. package/dist/docs/index.js +38 -1
  17. package/dist/docs/platform-tour.docblock.d.ts +2 -1
  18. package/dist/docs/platform-tour.docblock.d.ts.map +1 -0
  19. package/dist/docs/platform-tour.docblock.js +22 -26
  20. package/dist/example.d.ts +2 -6
  21. package/dist/example.d.ts.map +1 -1
  22. package/dist/example.js +33 -43
  23. package/dist/handlers/demo.handlers.d.ts +13 -19
  24. package/dist/handlers/demo.handlers.d.ts.map +1 -1
  25. package/dist/handlers/demo.handlers.js +128 -24
  26. package/dist/index.d.ts +8 -7
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +416 -9
  29. package/dist/learning-journey-platform-tour.feature.d.ts +1 -6
  30. package/dist/learning-journey-platform-tour.feature.d.ts.map +1 -1
  31. package/dist/learning-journey-platform-tour.feature.js +46 -73
  32. package/dist/node/docs/index.js +37 -0
  33. package/dist/node/docs/platform-tour.docblock.js +37 -0
  34. package/dist/node/example.js +34 -0
  35. package/dist/node/handlers/demo.handlers.js +130 -0
  36. package/dist/node/index.js +415 -0
  37. package/dist/node/learning-journey-platform-tour.feature.js +47 -0
  38. package/dist/node/operations/index.js +221 -0
  39. package/dist/node/presentations/index.js +268 -0
  40. package/dist/node/tests/operations.test-spec.js +34 -0
  41. package/dist/node/track.js +107 -0
  42. package/dist/operations/index.d.ts +229 -236
  43. package/dist/operations/index.d.ts.map +1 -1
  44. package/dist/operations/index.js +213 -167
  45. package/dist/operations/index.test.d.ts +2 -0
  46. package/dist/operations/index.test.d.ts.map +1 -0
  47. package/dist/presentations/index.d.ts +3 -8
  48. package/dist/presentations/index.d.ts.map +1 -1
  49. package/dist/presentations/index.js +266 -52
  50. package/dist/tests/operations.test-spec.d.ts +1 -6
  51. package/dist/tests/operations.test-spec.d.ts.map +1 -1
  52. package/dist/tests/operations.test-spec.js +33 -34
  53. package/dist/track.d.ts +3 -7
  54. package/dist/track.d.ts.map +1 -1
  55. package/dist/track.js +107 -105
  56. package/package.json +118 -34
  57. package/tsdown.config.js +1 -2
  58. package/.turbo/turbo-build$colon$bundle.log +0 -50
  59. package/dist/docs/platform-tour.docblock.js.map +0 -1
  60. package/dist/example.js.map +0 -1
  61. package/dist/handlers/demo.handlers.js.map +0 -1
  62. package/dist/learning-journey-platform-tour.feature.js.map +0 -1
  63. package/dist/operations/index.js.map +0 -1
  64. package/dist/presentations/index.js.map +0 -1
  65. package/dist/tests/operations.test-spec.js.map +0 -1
  66. package/dist/track.js.map +0 -1
  67. package/tsconfig.tsbuildinfo +0 -1
@@ -1,51 +1,47 @@
1
- $ bun build:types && bun build:bundle
2
- $ tsc --noEmit
3
- $ tsdown
4
- ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
5
- ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/learning-journey-platform-tour/tsdown.config.js
6
- ℹ entry: src/example.ts, src/index.ts, src/learning-journey-platform-tour.feature.ts, src/track.ts, src/docs/index.ts, src/docs/platform-tour.docblock.ts, src/handlers/demo.handlers.ts, src/operations/index.ts, src/presentations/index.ts, src/tests/operations.test-spec.ts
7
- ℹ target: esnext
8
- ℹ tsconfig: tsconfig.json
9
- ℹ Build start
10
- ℹ dist/operations/index.js 4.26 kB │ gzip: 1.08 kB
11
- ℹ dist/track.js 2.85 kB │ gzip: 0.91 kB
12
- ℹ dist/learning-journey-platform-tour.feature.js 1.81 kB │ gzip: 0.62 kB
13
- ℹ dist/docs/platform-tour.docblock.js 1.57 kB │ gzip: 0.81 kB
14
- ℹ dist/presentations/index.js 1.49 kB │ gzip: 0.58 kB
15
- ℹ dist/example.js 1.03 kB │ gzip: 0.51 kB
16
- ℹ dist/index.js 0.99 kB │ gzip: 0.30 kB
17
- ℹ dist/tests/operations.test-spec.js 0.90 kB │ gzip: 0.42 kB
18
- ℹ dist/handlers/demo.handlers.js 0.83 kB │ gzip: 0.42 kB
19
- ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
20
- ℹ dist/operations/index.js.map 6.35 kB │ gzip: 1.59 kB
21
- ℹ dist/track.js.map 4.47 kB │ gzip: 1.24 kB
22
- ℹ dist/learning-journey-platform-tour.feature.js.map 2.86 kB │ gzip: 1.02 kB
23
- ℹ dist/presentations/index.js.map 2.18 kB │ gzip: 0.87 kB
24
- ℹ dist/docs/platform-tour.docblock.js.map 2.01 kB │ gzip: 0.97 kB
25
- ℹ dist/handlers/demo.handlers.js.map 1.65 kB │ gzip: 0.72 kB
26
- ℹ dist/example.js.map 1.51 kB │ gzip: 0.71 kB
27
- ℹ dist/tests/operations.test-spec.js.map 1.44 kB │ gzip: 0.61 kB
28
- ℹ dist/operations/index.d.ts.map 0.52 kB │ gzip: 0.24 kB
29
- ℹ dist/handlers/demo.handlers.d.ts.map 0.51 kB │ gzip: 0.27 kB
30
- ℹ dist/presentations/index.d.ts.map 0.22 kB │ gzip: 0.17 kB
31
- ℹ dist/learning-journey-platform-tour.feature.d.ts.map 0.20 kB │ gzip: 0.16 kB
32
- ℹ dist/tests/operations.test-spec.d.ts.map 0.16 kB │ gzip: 0.14 kB
33
- ℹ dist/track.d.ts.map 0.14 kB │ gzip: 0.13 kB
34
- ℹ dist/example.d.ts.map 0.13 kB │ gzip: 0.13 kB
35
- ℹ dist/operations/index.d.ts 8.79 kB │ gzip: 0.93 kB
36
- ℹ dist/handlers/demo.handlers.d.ts 1.00 kB │ gzip: 0.43 kB
37
- ℹ dist/index.d.ts 0.99 kB │ gzip: 0.29 kB
38
- ℹ dist/presentations/index.d.ts 0.54 kB │ gzip: 0.22 kB
39
- ℹ dist/learning-journey-platform-tour.feature.d.ts 0.49 kB │ gzip: 0.26 kB
40
- ℹ dist/track.d.ts 0.37 kB │ gzip: 0.20 kB
41
- ℹ dist/tests/operations.test-spec.d.ts 0.28 kB │ gzip: 0.18 kB
42
- ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
43
- ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
44
- ℹ dist/docs/platform-tour.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
45
- ℹ 35 files, total: 52.83 kB
46
- [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugins. Here is a breakdown:
47
- - rolldown-plugin-dts:generate (58%)
48
- - tsdown:external (37%)
49
- See https://rolldown.rs/options/checks#plugintimings for more details.
1
+ $ contractspec-bun-build prebuild
2
+ $ bun run prebuild && bun run build:bundle && bun run build:types
3
+ $ contractspec-bun-build prebuild
4
+ $ contractspec-bun-build transpile
5
+ [contractspec-bun-build] transpile target=bun root=src entries=10
6
+ Bundled 10 modules in 47ms
50
7
 
51
- ✔ Build complete in 26592ms
8
+ docs/index.js 1.60 KB (entry point)
9
+ tests/operations.test-spec.js 0.90 KB (entry point)
10
+ ./index.js 13.39 KB (entry point)
11
+ docs/platform-tour.docblock.js 1.60 KB (entry point)
12
+ ./example.js 1.0 KB (entry point)
13
+ handlers/demo.handlers.js 3.71 KB (entry point)
14
+ ./learning-journey-platform-tour.feature.js 1.51 KB (entry point)
15
+ presentations/index.js 8.43 KB (entry point)
16
+ operations/index.js 7.14 KB (entry point)
17
+ ./track.js 3.1 KB (entry point)
18
+
19
+ [contractspec-bun-build] transpile target=node root=src entries=10
20
+ Bundled 10 modules in 14ms
21
+
22
+ docs/index.js 1.57 KB (entry point)
23
+ tests/operations.test-spec.js 0.89 KB (entry point)
24
+ ./index.js 13.36 KB (entry point)
25
+ docs/platform-tour.docblock.js 1.57 KB (entry point)
26
+ ./example.js 1.0 KB (entry point)
27
+ handlers/demo.handlers.js 3.71 KB (entry point)
28
+ ./learning-journey-platform-tour.feature.js 1.50 KB (entry point)
29
+ presentations/index.js 8.42 KB (entry point)
30
+ operations/index.js 7.13 KB (entry point)
31
+ ./track.js 3.1 KB (entry point)
32
+
33
+ [contractspec-bun-build] transpile target=browser root=src entries=10
34
+ Bundled 10 modules in 33ms
35
+
36
+ docs/index.js 1.57 KB (entry point)
37
+ tests/operations.test-spec.js 0.89 KB (entry point)
38
+ ./index.js 13.36 KB (entry point)
39
+ docs/platform-tour.docblock.js 1.57 KB (entry point)
40
+ ./example.js 1.0 KB (entry point)
41
+ handlers/demo.handlers.js 3.71 KB (entry point)
42
+ ./learning-journey-platform-tour.feature.js 1.50 KB (entry point)
43
+ presentations/index.js 8.42 KB (entry point)
44
+ operations/index.js 7.13 KB (entry point)
45
+ ./track.js 3.1 KB (entry point)
46
+
47
+ $ contractspec-bun-build types
@@ -0,0 +1 @@
1
+ $ contractspec-bun-build prebuild
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @contractspec/example.learning-journey-platform-tour
2
2
 
3
+ ## 1.58.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d1f0fd0: chore: Migrate non-app package builds from tsdown to shared Bun tooling, add `@contractspec/tool.bun`, and standardize `prebuild`/`build`/`typecheck` with platform-aware exports and `tsc` declaration emission into `dist`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [d1f0fd0]
12
+ - Updated dependencies [4355a9e]
13
+ - @contractspec/module.learning-journey@1.58.0
14
+ - @contractspec/lib.contracts@1.58.0
15
+ - @contractspec/lib.schema@1.58.0
16
+
3
17
  ## 1.57.0
4
18
 
5
19
  ### Minor Changes
@@ -0,0 +1,37 @@
1
+ // src/docs/platform-tour.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var platformTourDocBlocks = [
4
+ {
5
+ id: "docs.learning-journey.platform-tour",
6
+ title: "Learning Journey — Platform Primitives Tour",
7
+ summary: "Cross-module tour that touches identity, audit, notifications, jobs, feature flags, files, and metering.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/learning-journey/platform-tour",
11
+ tags: ["learning", "platform", "onboarding"],
12
+ body: `## Track
13
+ - **Key**: \`platform_primitives_tour\`
14
+ - **Persona**: platform developer exploring primitives
15
+ - **Goal**: Touch each cross-cutting module once, event-driven completion
16
+
17
+ ## Steps & Events
18
+ 1) \`identity_rbac\` → \`org.member.added\`
19
+ 2) \`event_bus_audit\` → \`audit_log.created\`
20
+ 3) \`notifications\` → \`notification.sent\`
21
+ 4) \`jobs_scheduler\` → \`job.completed\`
22
+ 5) \`feature_flags\` → \`flag.toggled\`
23
+ 6) \`files_attachments\` → \`attachment.attached\`
24
+ 7) \`usage_metering\` → \`usage.recorded\`
25
+
26
+ XP: 20 per step, 20 bonus XP upon completion.
27
+
28
+ ## Wiring
29
+ - Tracks export from \`@contractspec/example.learning-journey-platform-tour/track\`.
30
+ - Use onboarding API to surface progress:
31
+ - \`learning.onboarding.listTracks\`
32
+ - \`learning.onboarding.getProgress\`
33
+ - \`learning.onboarding.recordEvent\` wired from each module's event bus handlers.
34
+ - Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering.`
35
+ }
36
+ ];
37
+ registerDocBlocks(platformTourDocBlocks);
@@ -0,0 +1,37 @@
1
+ // src/docs/platform-tour.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var platformTourDocBlocks = [
4
+ {
5
+ id: "docs.learning-journey.platform-tour",
6
+ title: "Learning Journey — Platform Primitives Tour",
7
+ summary: "Cross-module tour that touches identity, audit, notifications, jobs, feature flags, files, and metering.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/learning-journey/platform-tour",
11
+ tags: ["learning", "platform", "onboarding"],
12
+ body: `## Track
13
+ - **Key**: \`platform_primitives_tour\`
14
+ - **Persona**: platform developer exploring primitives
15
+ - **Goal**: Touch each cross-cutting module once, event-driven completion
16
+
17
+ ## Steps & Events
18
+ 1) \`identity_rbac\` → \`org.member.added\`
19
+ 2) \`event_bus_audit\` → \`audit_log.created\`
20
+ 3) \`notifications\` → \`notification.sent\`
21
+ 4) \`jobs_scheduler\` → \`job.completed\`
22
+ 5) \`feature_flags\` → \`flag.toggled\`
23
+ 6) \`files_attachments\` → \`attachment.attached\`
24
+ 7) \`usage_metering\` → \`usage.recorded\`
25
+
26
+ XP: 20 per step, 20 bonus XP upon completion.
27
+
28
+ ## Wiring
29
+ - Tracks export from \`@contractspec/example.learning-journey-platform-tour/track\`.
30
+ - Use onboarding API to surface progress:
31
+ - \`learning.onboarding.listTracks\`
32
+ - \`learning.onboarding.getProgress\`
33
+ - \`learning.onboarding.recordEvent\` wired from each module's event bus handlers.
34
+ - Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering.`
35
+ }
36
+ ];
37
+ registerDocBlocks(platformTourDocBlocks);
@@ -0,0 +1,34 @@
1
+ // src/example.ts
2
+ import { defineExample } from "@contractspec/lib.contracts";
3
+ var example = defineExample({
4
+ meta: {
5
+ key: "learning-journey-platform-tour",
6
+ version: "1.0.0",
7
+ title: "Learning Journey — Platform Tour",
8
+ description: "Learning journey track + contracts + presentations for a platform tour.",
9
+ kind: "template",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["learning", "journey", "platform-tour"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.examples.platform-tour",
17
+ goalDocId: "docs.examples.platform-tour.goal",
18
+ usageDocId: "docs.examples.platform-tour.usage"
19
+ },
20
+ entrypoints: {
21
+ packageName: "@contractspec/example.learning-journey-platform-tour",
22
+ docs: "./docs"
23
+ },
24
+ surfaces: {
25
+ templates: true,
26
+ sandbox: { enabled: true, modes: ["markdown", "playground"] },
27
+ studio: { enabled: true, installable: true },
28
+ mcp: { enabled: true }
29
+ }
30
+ });
31
+ var example_default = example;
32
+ export {
33
+ example_default as default
34
+ };
@@ -0,0 +1,130 @@
1
+ // src/track.ts
2
+ var platformPrimitivesTourTrack = {
3
+ id: "platform_primitives_tour",
4
+ productId: "contractspec-platform",
5
+ name: "Platform Primitives Tour",
6
+ description: "Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",
7
+ targetUserSegment: "platform_developer",
8
+ targetRole: "developer",
9
+ totalXp: 140,
10
+ completionRewards: { xpBonus: 20, badgeKey: "platform_primitives" },
11
+ steps: [
12
+ {
13
+ id: "identity_rbac",
14
+ title: "Create org and member",
15
+ description: "Create an org and add at least one member.",
16
+ order: 1,
17
+ completion: {
18
+ eventName: "org.member.added",
19
+ sourceModule: "@contractspec/lib.identity-rbac"
20
+ },
21
+ xpReward: 20,
22
+ metadata: { surface: "identity" }
23
+ },
24
+ {
25
+ id: "event_bus_audit",
26
+ title: "Emit an auditable event",
27
+ description: "Emit an event that lands in the audit log.",
28
+ order: 2,
29
+ completion: {
30
+ eventName: "audit_log.created",
31
+ sourceModule: "@contractspec/module.audit-trail"
32
+ },
33
+ xpReward: 20,
34
+ metadata: { surface: "bus+audit" }
35
+ },
36
+ {
37
+ id: "notifications",
38
+ title: "Send a notification",
39
+ description: "Send yourself a notification and verify delivery.",
40
+ order: 3,
41
+ completion: {
42
+ eventName: "notification.sent",
43
+ sourceModule: "@contractspec/module.notifications"
44
+ },
45
+ xpReward: 20,
46
+ metadata: { surface: "notifications" }
47
+ },
48
+ {
49
+ id: "jobs_scheduler",
50
+ title: "Schedule and run a job",
51
+ description: "Schedule a background job and let it run once.",
52
+ order: 4,
53
+ completion: {
54
+ eventName: "job.completed",
55
+ sourceModule: "@contractspec/lib.jobs"
56
+ },
57
+ xpReward: 20,
58
+ metadata: { surface: "jobs" }
59
+ },
60
+ {
61
+ id: "feature_flags",
62
+ title: "Create and toggle a feature flag",
63
+ description: "Create a feature flag and toggle it at least once.",
64
+ order: 5,
65
+ completion: {
66
+ eventName: "flag.toggled",
67
+ sourceModule: "@contractspec/lib.feature-flags"
68
+ },
69
+ xpReward: 20,
70
+ metadata: { surface: "feature-flags" }
71
+ },
72
+ {
73
+ id: "files_attachments",
74
+ title: "Attach a file",
75
+ description: "Upload and attach a file to any entity.",
76
+ order: 6,
77
+ completion: {
78
+ eventName: "attachment.attached",
79
+ sourceModule: "@contractspec/lib.files"
80
+ },
81
+ xpReward: 20,
82
+ metadata: { surface: "files" }
83
+ },
84
+ {
85
+ id: "usage_metering",
86
+ title: "Record usage",
87
+ description: "Emit a usage metric (regeneration, agent run, or similar).",
88
+ order: 7,
89
+ completion: {
90
+ eventName: "usage.recorded",
91
+ sourceModule: "@contractspec/lib.metering"
92
+ },
93
+ xpReward: 20,
94
+ metadata: { surface: "metering" }
95
+ }
96
+ ],
97
+ metadata: {
98
+ surfacedIn: ["studio/learning", "platform/dev-center"]
99
+ }
100
+ };
101
+ var platformLearningTracks = [
102
+ platformPrimitivesTourTrack
103
+ ];
104
+
105
+ // src/handlers/demo.handlers.ts
106
+ var platformTourEvents = [
107
+ "org.member.added",
108
+ "audit_log.created",
109
+ "notification.sent",
110
+ "job.completed",
111
+ "flag.toggled",
112
+ "attachment.attached",
113
+ "usage.recorded"
114
+ ];
115
+ var emitPlatformTourEvent = (eventName, { learnerId, occurredAt = new Date, payload }, record) => {
116
+ const event = {
117
+ learnerId,
118
+ name: eventName,
119
+ occurredAt,
120
+ payload,
121
+ trackId: platformPrimitivesTourTrack.id
122
+ };
123
+ return record ? record(event) : event;
124
+ };
125
+ var emitAllPlatformTourEvents = (params, record) => platformTourEvents.map((name) => emitPlatformTourEvent(name, params, record));
126
+ export {
127
+ platformTourEvents,
128
+ emitPlatformTourEvent,
129
+ emitAllPlatformTourEvents
130
+ };