@contractspec/example.learning-journey-platform-tour 3.7.6 → 3.7.7

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.
@@ -1,55 +1,55 @@
1
1
  import {
2
- definePresentation,
3
- StabilityEnum,
4
- type PresentationSpecMeta,
2
+ definePresentation,
3
+ type PresentationSpecMeta,
4
+ StabilityEnum,
5
5
  } from '@contractspec/lib.contracts-spec';
6
6
  import { PlatformTourTrackModel } from '../operations';
7
7
 
8
8
  const baseMeta: Pick<
9
- PresentationSpecMeta,
10
- 'domain' | 'owners' | 'tags' | 'title' | 'stability' | 'goal' | 'context'
9
+ PresentationSpecMeta,
10
+ 'domain' | 'owners' | 'tags' | 'title' | 'stability' | 'goal' | 'context'
11
11
  > = {
12
- domain: 'learning-journey',
13
- title: 'Platform Tour',
14
- owners: ['@examples.learning-journey.platform-tour'],
15
- tags: ['learning', 'platform', 'tour'],
16
- stability: StabilityEnum.Experimental,
17
- goal: 'Visualize platform tour progress',
18
- context: 'Used in platform tour dashboard and widgets',
12
+ domain: 'learning-journey',
13
+ title: 'Platform Tour',
14
+ owners: ['@examples.learning-journey.platform-tour'],
15
+ tags: ['learning', 'platform', 'tour'],
16
+ stability: StabilityEnum.Experimental,
17
+ goal: 'Visualize platform tour progress',
18
+ context: 'Used in platform tour dashboard and widgets',
19
19
  };
20
20
 
21
21
  export const PlatformTourTrackPresentation = definePresentation({
22
- meta: {
23
- key: 'learning.journey.platform.track',
24
- version: '1.0.0',
25
- description: 'Platform primitives tour track detail',
26
- ...baseMeta,
27
- },
28
- source: {
29
- type: 'component',
30
- framework: 'react',
31
- componentKey: 'LearningTrackDetail',
32
- props: PlatformTourTrackModel,
33
- },
34
- targets: ['react', 'markdown', 'application/json'],
22
+ meta: {
23
+ key: 'learning.journey.platform.track',
24
+ version: '1.0.0',
25
+ description: 'Platform primitives tour track detail',
26
+ ...baseMeta,
27
+ },
28
+ source: {
29
+ type: 'component',
30
+ framework: 'react',
31
+ componentKey: 'LearningTrackDetail',
32
+ props: PlatformTourTrackModel,
33
+ },
34
+ targets: ['react', 'markdown', 'application/json'],
35
35
  });
36
36
 
37
37
  export const PlatformTourWidgetPresentation = definePresentation({
38
- meta: {
39
- key: 'learning.journey.platform.widget',
40
- version: '1.0.0',
41
- description: 'Compact widget for platform tour progress',
42
- ...baseMeta,
43
- },
44
- source: {
45
- type: 'component',
46
- framework: 'react',
47
- componentKey: 'LearningTrackProgressWidget',
48
- },
49
- targets: ['react'],
38
+ meta: {
39
+ key: 'learning.journey.platform.widget',
40
+ version: '1.0.0',
41
+ description: 'Compact widget for platform tour progress',
42
+ ...baseMeta,
43
+ },
44
+ source: {
45
+ type: 'component',
46
+ framework: 'react',
47
+ componentKey: 'LearningTrackProgressWidget',
48
+ },
49
+ targets: ['react'],
50
50
  });
51
51
 
52
52
  export const platformTourPresentations = [
53
- PlatformTourTrackPresentation,
54
- PlatformTourWidgetPresentation,
53
+ PlatformTourTrackPresentation,
54
+ PlatformTourWidgetPresentation,
55
55
  ];
@@ -1,31 +1,31 @@
1
1
  import { defineTestSpec } from '@contractspec/lib.contracts-spec/tests';
2
2
 
3
3
  export const GetTrackTest = defineTestSpec({
4
- meta: {
5
- key: 'learningJourney.platformTour.getTrack.test',
6
- version: '1.0.0',
7
- stability: 'experimental',
8
- owners: ['@example.learning-journey-platform-tour'],
9
- description: 'Test for getting platform tour track',
10
- tags: ['test'],
11
- },
12
- target: {
13
- type: 'operation',
14
- operation: {
15
- key: 'learningJourney.platformTour.getTrack',
16
- version: '1.0.0',
17
- },
18
- },
19
- scenarios: [
20
- {
21
- key: 'success',
22
- when: { operation: { key: 'learningJourney.platformTour.getTrack' } },
23
- then: [{ type: 'expectOutput', match: {} }],
24
- },
25
- {
26
- key: 'error',
27
- when: { operation: { key: 'learningJourney.platformTour.getTrack' } },
28
- then: [{ type: 'expectError' }],
29
- },
30
- ],
4
+ meta: {
5
+ key: 'learningJourney.platformTour.getTrack.test',
6
+ version: '1.0.0',
7
+ stability: 'experimental',
8
+ owners: ['@example.learning-journey-platform-tour'],
9
+ description: 'Test for getting platform tour track',
10
+ tags: ['test'],
11
+ },
12
+ target: {
13
+ type: 'operation',
14
+ operation: {
15
+ key: 'learningJourney.platformTour.getTrack',
16
+ version: '1.0.0',
17
+ },
18
+ },
19
+ scenarios: [
20
+ {
21
+ key: 'success',
22
+ when: { operation: { key: 'learningJourney.platformTour.getTrack' } },
23
+ then: [{ type: 'expectOutput', match: {} }],
24
+ },
25
+ {
26
+ key: 'error',
27
+ when: { operation: { key: 'learningJourney.platformTour.getTrack' } },
28
+ then: [{ type: 'expectError' }],
29
+ },
30
+ ],
31
31
  });
package/src/track.ts CHANGED
@@ -1,106 +1,106 @@
1
1
  import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
2
 
3
3
  export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
4
- id: 'platform_primitives_tour',
5
- productId: 'contractspec-platform',
6
- name: 'Platform Primitives Tour',
7
- description:
8
- 'Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.',
9
- targetUserSegment: 'platform_developer',
10
- targetRole: 'developer',
11
- totalXp: 140,
12
- completionRewards: { xpBonus: 20, badgeKey: 'platform_primitives' },
13
- steps: [
14
- {
15
- id: 'identity_rbac',
16
- title: 'Create org and member',
17
- description: 'Create an org and add at least one member.',
18
- order: 1,
19
- completion: {
20
- eventName: 'org.member.added',
21
- sourceModule: '@contractspec/lib.identity-rbac',
22
- },
23
- xpReward: 20,
24
- metadata: { surface: 'identity' },
25
- },
26
- {
27
- id: 'event_bus_audit',
28
- title: 'Emit an auditable event',
29
- description: 'Emit an event that lands in the audit log.',
30
- order: 2,
31
- completion: {
32
- eventName: 'audit_log.created',
33
- sourceModule: '@contractspec/module.audit-trail',
34
- },
35
- xpReward: 20,
36
- metadata: { surface: 'bus+audit' },
37
- },
38
- {
39
- id: 'notifications',
40
- title: 'Send a notification',
41
- description: 'Send yourself a notification and verify delivery.',
42
- order: 3,
43
- completion: {
44
- eventName: 'notification.sent',
45
- sourceModule: '@contractspec/module.notifications',
46
- },
47
- xpReward: 20,
48
- metadata: { surface: 'notifications' },
49
- },
50
- {
51
- id: 'jobs_scheduler',
52
- title: 'Schedule and run a job',
53
- description: 'Schedule a background job and let it run once.',
54
- order: 4,
55
- completion: {
56
- eventName: 'job.completed',
57
- sourceModule: '@contractspec/lib.jobs',
58
- },
59
- xpReward: 20,
60
- metadata: { surface: 'jobs' },
61
- },
62
- {
63
- id: 'feature_flags',
64
- title: 'Create and toggle a feature flag',
65
- description: 'Create a feature flag and toggle it at least once.',
66
- order: 5,
67
- completion: {
68
- eventName: 'flag.toggled',
69
- sourceModule: '@contractspec/lib.feature-flags',
70
- },
71
- xpReward: 20,
72
- metadata: { surface: 'feature-flags' },
73
- },
74
- {
75
- id: 'files_attachments',
76
- title: 'Attach a file',
77
- description: 'Upload and attach a file to any entity.',
78
- order: 6,
79
- completion: {
80
- eventName: 'attachment.attached',
81
- sourceModule: '@contractspec/lib.files',
82
- },
83
- xpReward: 20,
84
- metadata: { surface: 'files' },
85
- },
86
- {
87
- id: 'usage_metering',
88
- title: 'Record usage',
89
- description: 'Emit a usage metric (regeneration, agent run, or similar).',
90
- order: 7,
91
- completion: {
92
- eventName: 'usage.recorded',
93
- sourceModule: '@contractspec/lib.metering',
94
- },
95
- xpReward: 20,
96
- metadata: { surface: 'metering' },
97
- },
98
- ],
99
- metadata: {
100
- surfacedIn: ['studio/learning', 'platform/dev-center'],
101
- },
4
+ id: 'platform_primitives_tour',
5
+ productId: 'contractspec-platform',
6
+ name: 'Platform Primitives Tour',
7
+ description:
8
+ 'Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.',
9
+ targetUserSegment: 'platform_developer',
10
+ targetRole: 'developer',
11
+ totalXp: 140,
12
+ completionRewards: { xpBonus: 20, badgeKey: 'platform_primitives' },
13
+ steps: [
14
+ {
15
+ id: 'identity_rbac',
16
+ title: 'Create org and member',
17
+ description: 'Create an org and add at least one member.',
18
+ order: 1,
19
+ completion: {
20
+ eventName: 'org.member.added',
21
+ sourceModule: '@contractspec/lib.identity-rbac',
22
+ },
23
+ xpReward: 20,
24
+ metadata: { surface: 'identity' },
25
+ },
26
+ {
27
+ id: 'event_bus_audit',
28
+ title: 'Emit an auditable event',
29
+ description: 'Emit an event that lands in the audit log.',
30
+ order: 2,
31
+ completion: {
32
+ eventName: 'audit_log.created',
33
+ sourceModule: '@contractspec/module.audit-trail',
34
+ },
35
+ xpReward: 20,
36
+ metadata: { surface: 'bus+audit' },
37
+ },
38
+ {
39
+ id: 'notifications',
40
+ title: 'Send a notification',
41
+ description: 'Send yourself a notification and verify delivery.',
42
+ order: 3,
43
+ completion: {
44
+ eventName: 'notification.sent',
45
+ sourceModule: '@contractspec/module.notifications',
46
+ },
47
+ xpReward: 20,
48
+ metadata: { surface: 'notifications' },
49
+ },
50
+ {
51
+ id: 'jobs_scheduler',
52
+ title: 'Schedule and run a job',
53
+ description: 'Schedule a background job and let it run once.',
54
+ order: 4,
55
+ completion: {
56
+ eventName: 'job.completed',
57
+ sourceModule: '@contractspec/lib.jobs',
58
+ },
59
+ xpReward: 20,
60
+ metadata: { surface: 'jobs' },
61
+ },
62
+ {
63
+ id: 'feature_flags',
64
+ title: 'Create and toggle a feature flag',
65
+ description: 'Create a feature flag and toggle it at least once.',
66
+ order: 5,
67
+ completion: {
68
+ eventName: 'flag.toggled',
69
+ sourceModule: '@contractspec/lib.feature-flags',
70
+ },
71
+ xpReward: 20,
72
+ metadata: { surface: 'feature-flags' },
73
+ },
74
+ {
75
+ id: 'files_attachments',
76
+ title: 'Attach a file',
77
+ description: 'Upload and attach a file to any entity.',
78
+ order: 6,
79
+ completion: {
80
+ eventName: 'attachment.attached',
81
+ sourceModule: '@contractspec/lib.files',
82
+ },
83
+ xpReward: 20,
84
+ metadata: { surface: 'files' },
85
+ },
86
+ {
87
+ id: 'usage_metering',
88
+ title: 'Record usage',
89
+ description: 'Emit a usage metric (regeneration, agent run, or similar).',
90
+ order: 7,
91
+ completion: {
92
+ eventName: 'usage.recorded',
93
+ sourceModule: '@contractspec/lib.metering',
94
+ },
95
+ xpReward: 20,
96
+ metadata: { surface: 'metering' },
97
+ },
98
+ ],
99
+ metadata: {
100
+ surfacedIn: ['studio/learning', 'platform/dev-center'],
101
+ },
102
102
  };
103
103
 
104
104
  export const platformLearningTracks: LearningJourneyTrackSpec[] = [
105
- platformPrimitivesTourTrack,
105
+ platformPrimitivesTourTrack,
106
106
  ];
package/tsconfig.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "extends": "@contractspec/tool.typescript/react-library.json",
3
- "include": ["src"],
4
- "exclude": ["node_modules"],
5
- "compilerOptions": {
6
- "rootDir": "src",
7
- "outDir": "dist"
8
- }
2
+ "extends": "@contractspec/tool.typescript/react-library.json",
3
+ "include": ["src"],
4
+ "exclude": ["node_modules"],
5
+ "compilerOptions": {
6
+ "rootDir": "src",
7
+ "outDir": "dist"
8
+ }
9
9
  }
package/tsdown.config.js CHANGED
@@ -1,16 +1,10 @@
1
- import { defineConfig, moduleLibrary, withDevExports } from '@contractspec/tool.bun';
1
+ import {
2
+ defineConfig,
3
+ moduleLibrary,
4
+ withDevExports,
5
+ } from '@contractspec/tool.bun';
2
6
 
3
7
  export default defineConfig(() => ({
4
- ...moduleLibrary,
5
- ...withDevExports,
8
+ ...moduleLibrary,
9
+ ...withDevExports,
6
10
  }));
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-