@contractspec/example.learning-journey-studio-onboarding 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.
- package/.turbo/turbo-build.log +46 -50
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +14 -0
- package/dist/browser/docs/index.js +35 -0
- package/dist/browser/docs/studio-onboarding.docblock.js +35 -0
- package/dist/browser/example.js +32 -0
- package/dist/browser/handlers/demo.handlers.js +107 -0
- package/dist/browser/index.js +393 -0
- package/dist/browser/learning-journey-studio-onboarding.feature.js +50 -0
- package/dist/browser/operations/index.js +201 -0
- package/dist/browser/presentations/index.js +250 -0
- package/dist/browser/tests/operations.test-spec.js +34 -0
- package/dist/browser/track.js +87 -0
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +36 -1
- package/dist/docs/studio-onboarding.docblock.d.ts +2 -1
- package/dist/docs/studio-onboarding.docblock.d.ts.map +1 -0
- package/dist/docs/studio-onboarding.docblock.js +21 -25
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +31 -39
- package/dist/handlers/demo.handlers.d.ts +12 -17
- package/dist/handlers/demo.handlers.d.ts.map +1 -1
- package/dist/handlers/demo.handlers.js +105 -21
- package/dist/index.d.ts +8 -7
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +394 -9
- package/dist/learning-journey-studio-onboarding.feature.d.ts +1 -6
- package/dist/learning-journey-studio-onboarding.feature.d.ts.map +1 -1
- package/dist/learning-journey-studio-onboarding.feature.js +49 -73
- package/dist/node/docs/index.js +35 -0
- package/dist/node/docs/studio-onboarding.docblock.js +35 -0
- package/dist/node/example.js +32 -0
- package/dist/node/handlers/demo.handlers.js +107 -0
- package/dist/node/index.js +393 -0
- package/dist/node/learning-journey-studio-onboarding.feature.js +50 -0
- package/dist/node/operations/index.js +201 -0
- package/dist/node/presentations/index.js +250 -0
- package/dist/node/tests/operations.test-spec.js +34 -0
- package/dist/node/track.js +87 -0
- package/dist/operations/index.d.ts +229 -236
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +193 -167
- package/dist/operations/index.test.d.ts +2 -0
- package/dist/operations/index.test.d.ts.map +1 -0
- package/dist/presentations/index.d.ts +3 -8
- package/dist/presentations/index.d.ts.map +1 -1
- package/dist/presentations/index.js +248 -54
- package/dist/tests/operations.test-spec.d.ts +1 -6
- package/dist/tests/operations.test-spec.d.ts.map +1 -1
- package/dist/tests/operations.test-spec.js +33 -34
- package/dist/track.d.ts +3 -7
- package/dist/track.d.ts.map +1 -1
- package/dist/track.js +87 -90
- package/package.json +118 -34
- package/tsdown.config.js +1 -2
- package/.turbo/turbo-build$colon$bundle.log +0 -50
- package/dist/docs/studio-onboarding.docblock.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/demo.handlers.js.map +0 -1
- package/dist/learning-journey-studio-onboarding.feature.js.map +0 -1
- package/dist/operations/index.js.map +0 -1
- package/dist/presentations/index.js.map +0 -1
- package/dist/tests/operations.test-spec.js.map +0 -1
- package/dist/track.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
package/dist/operations/index.js
CHANGED
|
@@ -1,176 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/track.ts
|
|
3
|
+
var studioGettingStartedTrack = {
|
|
4
|
+
id: "studio_getting_started",
|
|
5
|
+
productId: "contractspec-studio",
|
|
6
|
+
name: "Studio Getting Started",
|
|
7
|
+
description: "First 30 minutes in Studio: create a project, edit the spec, deploy/regenerate, and try key modules.",
|
|
8
|
+
targetUserSegment: "new_studio_user",
|
|
9
|
+
targetRole: "developer",
|
|
10
|
+
totalXp: 110,
|
|
11
|
+
streakRule: { hoursWindow: 48, bonusXp: 25 },
|
|
12
|
+
completionRewards: { xpBonus: 25, badgeKey: "studio_first_30m" },
|
|
13
|
+
steps: [
|
|
14
|
+
{
|
|
15
|
+
id: "choose_template",
|
|
16
|
+
title: "Choose a template",
|
|
17
|
+
description: "Create your first Studio project (starter template).",
|
|
18
|
+
order: 1,
|
|
19
|
+
completion: {
|
|
20
|
+
eventName: "studio.template.instantiated",
|
|
21
|
+
sourceModule: "@contractspec/bundle.studio"
|
|
22
|
+
},
|
|
23
|
+
xpReward: 20,
|
|
24
|
+
metadata: { surface: "projects" }
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "edit_spec",
|
|
28
|
+
title: "Edit the spec",
|
|
29
|
+
description: "Change the spec (not generated code) and save.",
|
|
30
|
+
instructions: "Open spec editor, tweak a contract or presentation, save.",
|
|
31
|
+
order: 2,
|
|
32
|
+
completion: {
|
|
33
|
+
eventName: "spec.changed",
|
|
34
|
+
sourceModule: "@contractspec/bundle.studio"
|
|
35
|
+
},
|
|
36
|
+
xpReward: 20,
|
|
37
|
+
metadata: { surface: "spec-editor" }
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "regenerate_app",
|
|
41
|
+
title: "Regenerate the app",
|
|
42
|
+
description: "Regenerate artifacts from the updated spec.",
|
|
43
|
+
order: 3,
|
|
44
|
+
completion: {
|
|
45
|
+
eventName: "regeneration.completed",
|
|
46
|
+
sourceModule: "@contractspec/lib.contracts/regenerator"
|
|
47
|
+
},
|
|
48
|
+
xpReward: 20,
|
|
49
|
+
metadata: { surface: "regenerator" }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "open_canvas",
|
|
53
|
+
title: "Open the canvas",
|
|
54
|
+
description: "Visit the canvas module for your project.",
|
|
55
|
+
order: 4,
|
|
56
|
+
completion: {
|
|
57
|
+
eventName: "module.navigated",
|
|
58
|
+
sourceModule: "@contractspec/bundle.studio",
|
|
59
|
+
payloadFilter: { moduleId: "canvas" }
|
|
60
|
+
},
|
|
61
|
+
xpReward: 20,
|
|
62
|
+
metadata: { surface: "canvas" }
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "try_evolution_mode",
|
|
66
|
+
title: "Try evolution mode",
|
|
67
|
+
description: "Request a change via Evolution, then regenerate.",
|
|
68
|
+
order: 5,
|
|
69
|
+
completion: {
|
|
70
|
+
eventName: "studio.evolution.applied",
|
|
71
|
+
sourceModule: "@contractspec/lib.evolution"
|
|
72
|
+
},
|
|
73
|
+
xpReward: 30,
|
|
74
|
+
metadata: { surface: "evolution" }
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
metadata: {
|
|
78
|
+
persona: "first_run",
|
|
79
|
+
surfacedIn: ["studio/home", "studio/sidebar/learning"]
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var studioLearningTracks = [
|
|
83
|
+
studioGettingStartedTrack
|
|
84
|
+
];
|
|
4
85
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
25
|
-
isOptional: false
|
|
26
|
-
},
|
|
27
|
-
sourceModule: {
|
|
28
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
29
|
-
isOptional: true
|
|
30
|
-
},
|
|
31
|
-
xpReward: {
|
|
32
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
33
|
-
isOptional: true
|
|
34
|
-
},
|
|
35
|
-
order: {
|
|
36
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
37
|
-
isOptional: true
|
|
38
|
-
}
|
|
39
|
-
}
|
|
86
|
+
// src/operations/index.ts
|
|
87
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
88
|
+
import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
|
|
89
|
+
var OWNERS = ["examples.learning-journey.studio-onboarding"];
|
|
90
|
+
var StepModel = defineSchemaModel({
|
|
91
|
+
name: "StudioOnboardingStep",
|
|
92
|
+
description: "Step metadata for Studio onboarding journey",
|
|
93
|
+
fields: {
|
|
94
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
95
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
96
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
97
|
+
completionEvent: {
|
|
98
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
99
|
+
isOptional: false
|
|
100
|
+
},
|
|
101
|
+
sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
102
|
+
xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
103
|
+
order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true }
|
|
104
|
+
}
|
|
40
105
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
completionBadgeKey: {
|
|
66
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
67
|
-
isOptional: true
|
|
68
|
-
},
|
|
69
|
-
streakHoursWindow: {
|
|
70
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
71
|
-
isOptional: true
|
|
72
|
-
},
|
|
73
|
-
streakBonusXp: {
|
|
74
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
75
|
-
isOptional: true
|
|
76
|
-
},
|
|
77
|
-
steps: {
|
|
78
|
-
type: StepModel,
|
|
79
|
-
isArray: true,
|
|
80
|
-
isOptional: false
|
|
81
|
-
}
|
|
82
|
-
}
|
|
106
|
+
var StudioOnboardingTrackModel = defineSchemaModel({
|
|
107
|
+
name: "StudioOnboardingTrack",
|
|
108
|
+
description: "Studio onboarding track definition",
|
|
109
|
+
fields: {
|
|
110
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
111
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
112
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
113
|
+
totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
114
|
+
completionXpBonus: {
|
|
115
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
116
|
+
isOptional: true
|
|
117
|
+
},
|
|
118
|
+
completionBadgeKey: {
|
|
119
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
120
|
+
isOptional: true
|
|
121
|
+
},
|
|
122
|
+
streakHoursWindow: {
|
|
123
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
124
|
+
isOptional: true
|
|
125
|
+
},
|
|
126
|
+
streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
127
|
+
steps: { type: StepModel, isArray: true, isOptional: false }
|
|
128
|
+
}
|
|
83
129
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} }
|
|
130
|
+
var TrackResponseModel = defineSchemaModel({
|
|
131
|
+
name: "StudioOnboardingTrackResponse",
|
|
132
|
+
description: "Response wrapper for studio onboarding track",
|
|
133
|
+
fields: {
|
|
134
|
+
track: { type: StudioOnboardingTrackModel, isOptional: false }
|
|
135
|
+
}
|
|
91
136
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
102
|
-
isOptional: false
|
|
103
|
-
},
|
|
104
|
-
payload: {
|
|
105
|
-
type: ScalarTypeEnum.JSON(),
|
|
106
|
-
isOptional: true
|
|
107
|
-
},
|
|
108
|
-
occurredAt: {
|
|
109
|
-
type: ScalarTypeEnum.DateTime(),
|
|
110
|
-
isOptional: true
|
|
111
|
-
}
|
|
112
|
-
}
|
|
137
|
+
var RecordDemoEventInput = defineSchemaModel({
|
|
138
|
+
name: "StudioOnboardingRecordEventInput",
|
|
139
|
+
description: "Emit a demo event to advance Studio onboarding steps",
|
|
140
|
+
fields: {
|
|
141
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
142
|
+
eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
143
|
+
payload: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
144
|
+
occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
145
|
+
}
|
|
113
146
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
} }
|
|
147
|
+
var SuccessModel = defineSchemaModel({
|
|
148
|
+
name: "StudioOnboardingSuccess",
|
|
149
|
+
description: "Generic success response",
|
|
150
|
+
fields: {
|
|
151
|
+
success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
152
|
+
}
|
|
121
153
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}),
|
|
143
|
-
output: TrackResponseModel
|
|
144
|
-
},
|
|
145
|
-
policy: { auth: "user" }
|
|
154
|
+
var GetStudioOnboardingTrack = defineQuery({
|
|
155
|
+
meta: {
|
|
156
|
+
key: "learningJourney.studioOnboarding.getTrack",
|
|
157
|
+
version: "1.0.0",
|
|
158
|
+
stability: "experimental",
|
|
159
|
+
owners: [...OWNERS],
|
|
160
|
+
tags: ["learning", "onboarding", "studio"],
|
|
161
|
+
description: "Fetch the Studio onboarding track definition.",
|
|
162
|
+
goal: "Expose track metadata to UIs and templates.",
|
|
163
|
+
context: "Called by Studio/Playground to render journey steps."
|
|
164
|
+
},
|
|
165
|
+
io: {
|
|
166
|
+
input: defineSchemaModel({
|
|
167
|
+
name: "StudioOnboardingTrackInput",
|
|
168
|
+
description: "Track input",
|
|
169
|
+
fields: {}
|
|
170
|
+
}),
|
|
171
|
+
output: TrackResponseModel
|
|
172
|
+
},
|
|
173
|
+
policy: { auth: "user" }
|
|
146
174
|
});
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
input: RecordDemoEventInput,
|
|
164
|
-
output: SuccessModel
|
|
165
|
-
},
|
|
166
|
-
policy: { auth: "user" }
|
|
175
|
+
var RecordStudioOnboardingEvent = defineCommand({
|
|
176
|
+
meta: {
|
|
177
|
+
key: "learningJourney.studioOnboarding.recordEvent",
|
|
178
|
+
version: "1.0.0",
|
|
179
|
+
stability: "experimental",
|
|
180
|
+
owners: [...OWNERS],
|
|
181
|
+
tags: ["learning", "onboarding", "studio"],
|
|
182
|
+
description: "Record an event to advance Studio onboarding progress.",
|
|
183
|
+
goal: "Advance steps via domain events in demo/sandbox contexts.",
|
|
184
|
+
context: "Called by handlers or demo scripts to emit step completion events."
|
|
185
|
+
},
|
|
186
|
+
io: {
|
|
187
|
+
input: RecordDemoEventInput,
|
|
188
|
+
output: SuccessModel
|
|
189
|
+
},
|
|
190
|
+
policy: { auth: "user" }
|
|
167
191
|
});
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
192
|
+
var studioOnboardingContracts = {
|
|
193
|
+
GetStudioOnboardingTrack,
|
|
194
|
+
RecordStudioOnboardingEvent,
|
|
195
|
+
track: studioGettingStartedTrack
|
|
196
|
+
};
|
|
197
|
+
export {
|
|
198
|
+
studioOnboardingContracts,
|
|
199
|
+
StudioOnboardingTrackModel,
|
|
200
|
+
RecordStudioOnboardingEvent,
|
|
201
|
+
GetStudioOnboardingTrack
|
|
172
202
|
};
|
|
173
|
-
|
|
174
|
-
//#endregion
|
|
175
|
-
export { GetStudioOnboardingTrack, RecordStudioOnboardingEvent, StudioOnboardingTrackModel, studioOnboardingContracts };
|
|
176
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/operations/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const StudioOnboardingTrackPresentation: _contractspec_lib_contracts0.PresentationSpec;
|
|
5
|
-
declare const StudioOnboardingWidgetPresentation: _contractspec_lib_contracts0.PresentationSpec;
|
|
6
|
-
declare const studioOnboardingPresentations: _contractspec_lib_contracts0.PresentationSpec[];
|
|
7
|
-
//#endregion
|
|
8
|
-
export { StudioOnboardingTrackPresentation, StudioOnboardingWidgetPresentation, studioOnboardingPresentations };
|
|
1
|
+
export declare const StudioOnboardingTrackPresentation: import("@contractspec/lib.contracts").PresentationSpec;
|
|
2
|
+
export declare const StudioOnboardingWidgetPresentation: import("@contractspec/lib.contracts").PresentationSpec;
|
|
3
|
+
export declare const studioOnboardingPresentations: import("@contractspec/lib.contracts").PresentationSpec[];
|
|
9
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presentations/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iCAAiC,wDAgB5C,CAAC;AAEH,eAAO,MAAM,kCAAkC,wDAe7C,CAAC;AAEH,eAAO,MAAM,6BAA6B,0DAGzC,CAAC"}
|