@pilotiq/pilotiq 0.7.0 → 0.7.2

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,8 +1,8 @@
1
1
 
2
- > @pilotiq/pilotiq@0.7.0 build /home/runner/work/pilotiq/pilotiq/packages/pilotiq
2
+ > @pilotiq/pilotiq@0.7.2 build /home/runner/work/pilotiq/pilotiq/packages/pilotiq
3
3
  > tsc -p tsconfig.build.json && pnpm run copy-assets
4
4
 
5
5
 
6
- > @pilotiq/pilotiq@0.7.0 copy-assets /home/runner/work/pilotiq/pilotiq/packages/pilotiq
6
+ > @pilotiq/pilotiq@0.7.2 copy-assets /home/runner/work/pilotiq/pilotiq/packages/pilotiq
7
7
  > mkdir -p dist/styles && cp -R src/styles/*.css dist/styles/
8
8
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @pilotiq/pilotiq
2
2
 
3
+ ## 0.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - f18898f: Tighten auto-generated page-stub emissions so consumers' `tsc --noEmit` passes under `noUncheckedIndexedAccess` + `exactOptionalPropertyTypes`:
8
+
9
+ - All 10 depth-1 and 4 depth-2 route stubs now emit `basePath: parts[0]!` (was `parts[0]`, typed as `string | undefined`, which Vike's `RouteSync.routeParams: Record<string, string>` rejects).
10
+ - `_clusterOffset.ts` emits `slugs.includes(parts[1]!)` for the same reason.
11
+ - `+Layout.tsx` passes `currentPath={currentPath ?? ''}` to `<AppShell>` so `exactOptionalPropertyTypes` accepts the prop.
12
+
13
+ The non-null assertions are safe — each route guards on `parts.length` before reaching the return; `_clusterOffset` checks `parts.length < 2` before reading `parts[1]`. Pure emission tightening — no runtime behavior change.
14
+
15
+ ## 0.7.1
16
+
17
+ ### Patch Changes
18
+
19
+ - 229f290: Emit `parts[0]!` for the `basePath` field in every auto-generated route stub. Under consumers' `noUncheckedIndexedAccess` tsconfig, the previous `basePath: parts[0]` typed as `string | undefined`, which Vike's `RouteSync.routeParams: Record<string, string>` rejects. The non-null assertion is safe because each route guards on `parts.length` before reaching the return.
20
+
3
21
  ## 0.7.0
4
22
 
5
23
  ### Minor Changes
package/dist/vite.js CHANGED
@@ -133,7 +133,7 @@ export const route: RouteSync = (pageContext) => {
133
133
  const parts = pageContext.urlPathname.split('/').filter(Boolean)
134
134
  if (parts.length !== 1) return false
135
135
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
136
- return { routeParams: { basePath: parts[0] } }
136
+ return { routeParams: { basePath: parts[0]! } }
137
137
  }
138
138
  `);
139
139
  writeIfChanged(path.join(outDir, 'dashboard', '+data.ts'), dataStub);
@@ -181,7 +181,7 @@ export const route: RouteSync = (pageContext) => {
181
181
  // Don't match built-in slugs (theme editor, etc.)
182
182
  if (parts[1 + off] === 'theme') return false
183
183
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
184
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]! } }
184
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]! } }
185
185
  }
186
186
  `);
187
187
  writeIfChanged(path.join(outDir, 'slug', '+data.ts'), dataStub);
@@ -206,7 +206,7 @@ export const route: RouteSync = (pageContext) => {
206
206
  const off = clusterOffset(parts)
207
207
  if (parts.length !== 3 + off || parts[2 + off] !== 'create') return false
208
208
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
209
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]! } }
209
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]! } }
210
210
  }
211
211
  `);
212
212
  writeIfChanged(path.join(outDir, 'resource-create', '+data.ts'), dataStub);
@@ -221,7 +221,7 @@ export const route: RouteSync = (pageContext) => {
221
221
  const off = clusterOffset(parts)
222
222
  if (parts.length !== 4 + off || parts[3 + off] !== 'edit') return false
223
223
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
224
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]! } }
224
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]! } }
225
225
  }
226
226
  `);
227
227
  writeIfChanged(path.join(outDir, 'resource-edit', '+data.ts'), dataStub);
@@ -253,7 +253,7 @@ export const route: RouteSync = (pageContext) => {
253
253
  if (parts[2 + off] === 'create') return false
254
254
  if (parts[1 + off] === 'theme') return false
255
255
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
256
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]! } }
256
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]! } }
257
257
  }
258
258
  `);
259
259
  writeIfChanged(path.join(outDir, 'resource-view', '+data.ts'), dataStub);
@@ -280,7 +280,7 @@ export const route: RouteSync = (pageContext) => {
280
280
  if (parts.length !== 4 + off) return false
281
281
  if (parts[3 + off] === 'edit') return false
282
282
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
283
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]! } }
283
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]! } }
284
284
  }
285
285
  `);
286
286
  writeIfChanged(path.join(outDir, 'relation-list', '+data.ts'), dataStub);
@@ -295,7 +295,7 @@ export const route: RouteSync = (pageContext) => {
295
295
  const off = clusterOffset(parts)
296
296
  if (parts.length !== 5 + off || parts[4 + off] !== 'create') return false
297
297
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
298
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]! } }
298
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]! } }
299
299
  }
300
300
  `);
301
301
  writeIfChanged(path.join(outDir, 'relation-create', '+data.ts'), dataStub);
@@ -311,7 +311,7 @@ export const route: RouteSync = (pageContext) => {
311
311
  if (parts.length !== 5 + off) return false
312
312
  if (parts[4 + off] === 'create') return false
313
313
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
314
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]!, childId: parts[4 + off]! } }
314
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]!, childId: parts[4 + off]! } }
315
315
  }
316
316
  `);
317
317
  writeIfChanged(path.join(outDir, 'relation-view', '+data.ts'), dataStub);
@@ -326,7 +326,7 @@ export const route: RouteSync = (pageContext) => {
326
326
  const off = clusterOffset(parts)
327
327
  if (parts.length !== 6 + off || parts[5 + off] !== 'edit') return false
328
328
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
329
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]!, childId: parts[4 + off]! } }
329
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]!, childId: parts[4 + off]! } }
330
330
  }
331
331
  `);
332
332
  writeIfChanged(path.join(outDir, 'relation-edit', '+data.ts'), dataStub);
@@ -355,7 +355,7 @@ export const route: RouteSync = (pageContext) => {
355
355
  if (parts[5 + off] === 'edit') return false
356
356
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
357
357
  return { routeParams: {
358
- basePath: parts[0],
358
+ basePath: parts[0]!,
359
359
  slug: parts[1 + off]!,
360
360
  id: parts[2 + off]!,
361
361
  relationship: parts[3 + off]!,
@@ -377,7 +377,7 @@ export const route: RouteSync = (pageContext) => {
377
377
  if (parts.length !== 7 + off || parts[6 + off] !== 'create') return false
378
378
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
379
379
  return { routeParams: {
380
- basePath: parts[0],
380
+ basePath: parts[0]!,
381
381
  slug: parts[1 + off]!,
382
382
  id: parts[2 + off]!,
383
383
  relationship: parts[3 + off]!,
@@ -400,7 +400,7 @@ export const route: RouteSync = (pageContext) => {
400
400
  if (parts[6 + off] === 'create') return false
401
401
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
402
402
  return { routeParams: {
403
- basePath: parts[0],
403
+ basePath: parts[0]!,
404
404
  slug: parts[1 + off]!,
405
405
  id: parts[2 + off]!,
406
406
  relationship: parts[3 + off]!,
@@ -423,7 +423,7 @@ export const route: RouteSync = (pageContext) => {
423
423
  if (parts.length !== 8 + off || parts[7 + off] !== 'edit') return false
424
424
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
425
425
  return { routeParams: {
426
- basePath: parts[0],
426
+ basePath: parts[0]!,
427
427
  slug: parts[1 + off]!,
428
428
  id: parts[2 + off]!,
429
429
  relationship: parts[3 + off]!,
@@ -449,7 +449,7 @@ export const route: RouteSync = (pageContext) => {
449
449
  // Only match if themeEditor is enabled
450
450
  if (!panel.getConfig().themeEditor) return false
451
451
  }
452
- return { routeParams: { basePath: parts[0] } }
452
+ return { routeParams: { basePath: parts[0]! } }
453
453
  }
454
454
  `);
455
455
  writeIfChanged(path.join(outDir, 'theme', '+data.ts'), dataStub);
@@ -534,7 +534,7 @@ import { clusterSlugsByBasePath } from './_components.js'
534
534
  export function clusterOffset(parts: string[]): number {
535
535
  if (parts.length < 2) return 0
536
536
  const slugs = clusterSlugsByBasePath['/' + parts[0]]
537
- return slugs && slugs.includes(parts[1]) ? 1 : 0
537
+ return slugs && slugs.includes(parts[1]!) ? 1 : 0
538
538
  }
539
539
  `);
540
540
  const lines = [
@@ -636,7 +636,7 @@ export default function PilotiqLayout({ children }: { children: ReactNode }) {
636
636
  <NavigateProvider navigate={navigate}>
637
637
  <ThemeProvider theme={panel.theme}>
638
638
  {themeCss && <style dangerouslySetInnerHTML={{ __html: themeCss }} />}
639
- <AppShell panel={panel} basePath={basePath} layout={layout} notifications={notifications} currentPath={currentPath} componentRegistry={componentRegistry as any} rightPanelRegistry={rightPanelRegistry as any} layoutProviderRegistry={layoutProviderRegistry as any}>
639
+ <AppShell panel={panel} basePath={basePath} layout={layout} notifications={notifications} currentPath={currentPath ?? ''} componentRegistry={componentRegistry as any} rightPanelRegistry={rightPanelRegistry as any} layoutProviderRegistry={layoutProviderRegistry as any}>
640
640
  {children}
641
641
  </AppShell>
642
642
  </ThemeProvider>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotiq/pilotiq",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "View-based admin panel for RudderJS",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/vite.ts CHANGED
@@ -157,7 +157,7 @@ export const route: RouteSync = (pageContext) => {
157
157
  const parts = pageContext.urlPathname.split('/').filter(Boolean)
158
158
  if (parts.length !== 1) return false
159
159
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
160
- return { routeParams: { basePath: parts[0] } }
160
+ return { routeParams: { basePath: parts[0]! } }
161
161
  }
162
162
  `)
163
163
  writeIfChanged(path.join(outDir, 'dashboard', '+data.ts'), dataStub)
@@ -206,7 +206,7 @@ export const route: RouteSync = (pageContext) => {
206
206
  // Don't match built-in slugs (theme editor, etc.)
207
207
  if (parts[1 + off] === 'theme') return false
208
208
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
209
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]! } }
209
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]! } }
210
210
  }
211
211
  `)
212
212
  writeIfChanged(path.join(outDir, 'slug', '+data.ts'), dataStub)
@@ -232,7 +232,7 @@ export const route: RouteSync = (pageContext) => {
232
232
  const off = clusterOffset(parts)
233
233
  if (parts.length !== 3 + off || parts[2 + off] !== 'create') return false
234
234
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
235
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]! } }
235
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]! } }
236
236
  }
237
237
  `)
238
238
  writeIfChanged(path.join(outDir, 'resource-create', '+data.ts'), dataStub)
@@ -248,7 +248,7 @@ export const route: RouteSync = (pageContext) => {
248
248
  const off = clusterOffset(parts)
249
249
  if (parts.length !== 4 + off || parts[3 + off] !== 'edit') return false
250
250
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
251
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]! } }
251
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]! } }
252
252
  }
253
253
  `)
254
254
  writeIfChanged(path.join(outDir, 'resource-edit', '+data.ts'), dataStub)
@@ -282,7 +282,7 @@ export const route: RouteSync = (pageContext) => {
282
282
  if (parts[2 + off] === 'create') return false
283
283
  if (parts[1 + off] === 'theme') return false
284
284
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
285
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]! } }
285
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]! } }
286
286
  }
287
287
  `)
288
288
  writeIfChanged(path.join(outDir, 'resource-view', '+data.ts'), dataStub)
@@ -311,7 +311,7 @@ export const route: RouteSync = (pageContext) => {
311
311
  if (parts.length !== 4 + off) return false
312
312
  if (parts[3 + off] === 'edit') return false
313
313
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
314
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]! } }
314
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]! } }
315
315
  }
316
316
  `)
317
317
  writeIfChanged(path.join(outDir, 'relation-list', '+data.ts'), dataStub)
@@ -327,7 +327,7 @@ export const route: RouteSync = (pageContext) => {
327
327
  const off = clusterOffset(parts)
328
328
  if (parts.length !== 5 + off || parts[4 + off] !== 'create') return false
329
329
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
330
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]! } }
330
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]! } }
331
331
  }
332
332
  `)
333
333
  writeIfChanged(path.join(outDir, 'relation-create', '+data.ts'), dataStub)
@@ -344,7 +344,7 @@ export const route: RouteSync = (pageContext) => {
344
344
  if (parts.length !== 5 + off) return false
345
345
  if (parts[4 + off] === 'create') return false
346
346
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
347
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]!, childId: parts[4 + off]! } }
347
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]!, childId: parts[4 + off]! } }
348
348
  }
349
349
  `)
350
350
  writeIfChanged(path.join(outDir, 'relation-view', '+data.ts'), dataStub)
@@ -360,7 +360,7 @@ export const route: RouteSync = (pageContext) => {
360
360
  const off = clusterOffset(parts)
361
361
  if (parts.length !== 6 + off || parts[5 + off] !== 'edit') return false
362
362
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
363
- return { routeParams: { basePath: parts[0], slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]!, childId: parts[4 + off]! } }
363
+ return { routeParams: { basePath: parts[0]!, slug: parts[1 + off]!, id: parts[2 + off]!, relationship: parts[3 + off]!, childId: parts[4 + off]! } }
364
364
  }
365
365
  `)
366
366
  writeIfChanged(path.join(outDir, 'relation-edit', '+data.ts'), dataStub)
@@ -390,7 +390,7 @@ export const route: RouteSync = (pageContext) => {
390
390
  if (parts[5 + off] === 'edit') return false
391
391
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
392
392
  return { routeParams: {
393
- basePath: parts[0],
393
+ basePath: parts[0]!,
394
394
  slug: parts[1 + off]!,
395
395
  id: parts[2 + off]!,
396
396
  relationship: parts[3 + off]!,
@@ -413,7 +413,7 @@ export const route: RouteSync = (pageContext) => {
413
413
  if (parts.length !== 7 + off || parts[6 + off] !== 'create') return false
414
414
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
415
415
  return { routeParams: {
416
- basePath: parts[0],
416
+ basePath: parts[0]!,
417
417
  slug: parts[1 + off]!,
418
418
  id: parts[2 + off]!,
419
419
  relationship: parts[3 + off]!,
@@ -437,7 +437,7 @@ export const route: RouteSync = (pageContext) => {
437
437
  if (parts[6 + off] === 'create') return false
438
438
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
439
439
  return { routeParams: {
440
- basePath: parts[0],
440
+ basePath: parts[0]!,
441
441
  slug: parts[1 + off]!,
442
442
  id: parts[2 + off]!,
443
443
  relationship: parts[3 + off]!,
@@ -461,7 +461,7 @@ export const route: RouteSync = (pageContext) => {
461
461
  if (parts.length !== 8 + off || parts[7 + off] !== 'edit') return false
462
462
  if (import.meta.env.SSR && !PilotiqRegistry.findByPath('/' + parts[0])) return false
463
463
  return { routeParams: {
464
- basePath: parts[0],
464
+ basePath: parts[0]!,
465
465
  slug: parts[1 + off]!,
466
466
  id: parts[2 + off]!,
467
467
  relationship: parts[3 + off]!,
@@ -488,7 +488,7 @@ export const route: RouteSync = (pageContext) => {
488
488
  // Only match if themeEditor is enabled
489
489
  if (!panel.getConfig().themeEditor) return false
490
490
  }
491
- return { routeParams: { basePath: parts[0] } }
491
+ return { routeParams: { basePath: parts[0]! } }
492
492
  }
493
493
  `)
494
494
  writeIfChanged(path.join(outDir, 'theme', '+data.ts'), dataStub)
@@ -592,7 +592,7 @@ import { clusterSlugsByBasePath } from './_components.js'
592
592
  export function clusterOffset(parts: string[]): number {
593
593
  if (parts.length < 2) return 0
594
594
  const slugs = clusterSlugsByBasePath['/' + parts[0]]
595
- return slugs && slugs.includes(parts[1]) ? 1 : 0
595
+ return slugs && slugs.includes(parts[1]!) ? 1 : 0
596
596
  }
597
597
  `)
598
598
 
@@ -698,7 +698,7 @@ export default function PilotiqLayout({ children }: { children: ReactNode }) {
698
698
  <NavigateProvider navigate={navigate}>
699
699
  <ThemeProvider theme={panel.theme}>
700
700
  {themeCss && <style dangerouslySetInnerHTML={{ __html: themeCss }} />}
701
- <AppShell panel={panel} basePath={basePath} layout={layout} notifications={notifications} currentPath={currentPath} componentRegistry={componentRegistry as any} rightPanelRegistry={rightPanelRegistry as any} layoutProviderRegistry={layoutProviderRegistry as any}>
701
+ <AppShell panel={panel} basePath={basePath} layout={layout} notifications={notifications} currentPath={currentPath ?? ''} componentRegistry={componentRegistry as any} rightPanelRegistry={rightPanelRegistry as any} layoutProviderRegistry={layoutProviderRegistry as any}>
702
702
  {children}
703
703
  </AppShell>
704
704
  </ThemeProvider>