@playcademy/vite-plugin 0.1.38 → 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/README.md CHANGED
@@ -132,14 +132,25 @@ export default defineConfig({
132
132
 
133
133
  ## Plugin Options
134
134
 
135
+ ### Top-Level Options
136
+
137
+ | Option | Type | Default | Description |
138
+ | ------------ | ---------------------------- | ------------ | -------------------------------------------- |
139
+ | `configPath` | `string` | `undefined` | Path to playcademy.config.js (auto-detected) |
140
+ | `mode` | `'platform' \| 'standalone'` | `'platform'` | Plugin operation mode |
141
+
142
+ **Mode Options:**
143
+
144
+ - `'platform'`: Full Playcademy experience with sandbox server, backend bundling, and shell wrapper (recommended)
145
+ - `'standalone'`: Backend bundling only, no platform features
146
+
135
147
  ### Export Options (`export`)
136
148
 
137
- Configuration for manifest generation and build output:
149
+ Configuration for build output:
138
150
 
139
- | Option | Type | Default | Description |
140
- | ---------- | --------- | ------- | ---------------------------------------------- |
141
- | `platform` | `string` | `'web'` | Platform identifier (e.g., 'web', 'godot@4.3') |
142
- | `autoZip` | `boolean` | `true` | Create deployment zip archive |
151
+ | Option | Type | Default | Description |
152
+ | --------- | --------- | ------- | ----------------------------- |
153
+ | `autoZip` | `boolean` | `true` | Create deployment zip archive |
143
154
 
144
155
  ### Sandbox Options (`sandbox`)
145
156
 
@@ -164,15 +175,32 @@ Configuration for the development sandbox server:
164
175
  | `enabled` | `boolean` | `false` | Enable WebSocket server |
165
176
  | `port` | `number` | API port + 1 | Custom port for WebSocket server |
166
177
 
178
+ ### Display Options (`display`)
179
+
180
+ Configuration for visual elements during development:
181
+
182
+ | Option | Type | Default | Description |
183
+ | ----------- | --------- | ------- | --------------------------------------- |
184
+ | `hideBadge` | `boolean` | `false` | Hide the Playcademy badge in the corner |
185
+
167
186
  ### TimeBack Options (`timeback`)
168
187
 
169
- Configuration for TimeBack integration testing during local development:
188
+ Configuration for TimeBack integration testing during local development. Set to `false` to explicitly disable TimeBack even if configured in playcademy.config.
189
+
190
+ | Option | Type | Default | Description |
191
+ | -------------- | --------------------------------------------------------------------- | ----------------------- | ------------------------------------------------- |
192
+ | `id` | `string` | auto-generated mock ID | TimeBack student ID |
193
+ | `role` | `'student' \| 'parent' \| 'teacher' \| 'administrator' \| 'guardian'` | `'student'` | User role for testing different permission levels |
194
+ | `organization` | `'mock' \| object` | `'mock'` | Organization (school/district) configuration |
195
+ | `courses` | `Record<string, 'mock' \| string \| null>` | all courses from config | Course enrollment overrides |
170
196
 
171
- | Option | Type | Default | Description |
172
- | ------------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- |
173
- | `timebackId` | `'mock' \| string` | `'mock'` | TimeBack student ID (defaults to mock when courses configured) |
174
- | `courses` | `Record<string, 'mock' \| string>` | `undefined` | Course enrollments mapping (`'Subject:Grade'`) |
175
- | `role` | `'student' \| 'parent' \| 'teacher' \| 'administrator'` | `'student'` | User role for testing different permission levels |
197
+ #### Organization Object Properties
198
+
199
+ | Property | Type | Default | Description |
200
+ | -------- | ---------------------------------------------------------------------------- | ---------------------- | ---------------------- |
201
+ | `id` | `string` | `'PLAYCADEMY'` | Organization sourcedId |
202
+ | `name` | `string` | `'Playcademy Studios'` | Organization name |
203
+ | `type` | `'school' \| 'district' \| 'department' \| 'local' \| 'state' \| 'national'` | `'department'` | Organization type |
176
204
 
177
205
  #### TimeBack Configuration Example
178
206
 
@@ -181,13 +209,43 @@ export default defineConfig({
181
209
  plugins: [
182
210
  playcademy({
183
211
  timeback: {
184
- // timebackId defaults to 'mock' when courses are configured
212
+ // All courses from playcademy.config.js enrolled by default with mock IDs
213
+ role: 'student', // Test as student (default)
214
+ },
215
+ }),
216
+ ],
217
+ })
218
+
219
+ // Override specific courses
220
+ export default defineConfig({
221
+ plugins: [
222
+ playcademy({
223
+ timeback: {
185
224
  courses: {
186
225
  'FastMath:3': 'mock', // Mock enrollment for grade 3
187
- 'FastMath:4': 'mock', // Mock enrollment for grade 4
226
+ 'FastMath:4': null, // Exclude from enrollment (test partial)
188
227
  'Science:5': 'real-course-id-123', // Real TimeBack course
189
228
  },
190
- role: 'student', // Test as student (default)
229
+ },
230
+ }),
231
+ ],
232
+ })
233
+
234
+ // Full real TimeBack integration
235
+ export default defineConfig({
236
+ plugins: [
237
+ playcademy({
238
+ timeback: {
239
+ id: 'real-student-sourced-id',
240
+ organization: {
241
+ id: 'real-org-id',
242
+ name: 'Springfield Elementary',
243
+ type: 'school',
244
+ },
245
+ courses: {
246
+ 'FastMath:3': 'real-course-id-g3',
247
+ 'FastMath:4': 'real-course-id-g4',
248
+ },
191
249
  },
192
250
  }),
193
251
  ],
@@ -202,9 +260,10 @@ During development, the plugin provides keyboard shortcuts in the terminal:
202
260
  | --- | -------------------------------------------------------- |
203
261
  | `m` | Toggle between platform and standalone modes |
204
262
  | `d` | Recreate sandbox database (resets to fresh seeded state) |
263
+ | `p` | Cycle platform user role (player → developer → admin) |
205
264
  | `t` | Cycle TimeBack role (student → parent → teacher → admin) |
206
265
 
207
- The `t` hotkey automatically reloads your browser when the role changes, making it easy to test different user permission levels without modifying configuration.
266
+ > **Note:** Some configuration changes require recreating the sandbox database to take effect. Press `d` after changing options like `timeback.id`, `timeback.organization`, or `timeback.courses` in your vite.config.ts.
208
267
 
209
268
  ## Build Output
210
269
 
@@ -448,7 +507,7 @@ export default defineConfig({
448
507
  plugins: [
449
508
  playcademy({
450
509
  timeback: {
451
- timebackId: 'mock',
510
+ // id defaults to auto-generated mock ID
452
511
  courses: {
453
512
  'FastMath:3': 'mock',
454
513
  'FastMath:4': 'mock',
@@ -460,7 +519,7 @@ export default defineConfig({
460
519
  })
461
520
  ```
462
521
 
463
- During development, press `t` in the terminal to cycle through roles (student → parent → teacher → administrator) and test different permission levels. The browser reloads automatically.
522
+ During development, press `t` in the terminal to cycle through roles (student → parent → teacher → administrator → guardian) and test different permission levels. The browser reloads automatically.
464
523
 
465
524
  ## Troubleshooting
466
525