@nextsparkjs/core 0.1.0-beta.17 → 0.1.0-beta.18
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/dist/styles/classes.json +1 -1
- package/dist/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +6 -1
- package/dist/templates/app/dashboard/(main)/[entity]/page.tsx +7 -1
- package/package.json +1 -1
- package/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +6 -1
- package/templates/app/dashboard/(main)/[entity]/page.tsx +7 -1
package/dist/styles/classes.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { notFound, redirect } from 'next/navigation'
|
|
2
|
-
import { getEntity, getEntityRegistry, getChildEntities } from '@nextsparkjs/core/lib/entities/queries'
|
|
2
|
+
import { getEntity, getEntityRegistry, getChildEntities, setEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
|
|
3
3
|
import { EntityDetailWrapper } from '@nextsparkjs/core/components/entities/wrappers/EntityDetailWrapper'
|
|
4
4
|
import type { Metadata } from 'next'
|
|
5
5
|
import { TemplateService } from '@nextsparkjs/core/lib/services/template.service'
|
|
6
6
|
import type { EntityConfig, ChildEntityDefinition } from '@nextsparkjs/core/lib/entities/types'
|
|
7
|
+
// Import registry directly - webpack resolves @nextsparkjs/registries alias at compile time
|
|
8
|
+
import { ENTITY_REGISTRY, ENTITY_METADATA } from '@nextsparkjs/registries/entity-registry'
|
|
9
|
+
|
|
10
|
+
// Initialize registry at module load time (before any component renders)
|
|
11
|
+
setEntityRegistry(ENTITY_REGISTRY, ENTITY_METADATA)
|
|
7
12
|
|
|
8
13
|
// Type guard to check if entity is a full EntityConfig
|
|
9
14
|
function isEntityConfig(entity: EntityConfig | ChildEntityDefinition): entity is EntityConfig {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { notFound } from 'next/navigation'
|
|
2
|
-
import { getEntity, getEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
|
|
2
|
+
import { getEntity, getEntityRegistry, setEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
|
|
3
3
|
import { EntityListWrapper } from '@nextsparkjs/core/components/entities/wrappers/EntityListWrapper'
|
|
4
4
|
import type { Metadata } from 'next'
|
|
5
5
|
import { getTemplateOrDefault } from '@nextsparkjs/core/lib/template-resolver'
|
|
6
6
|
import type { EntityConfig, ChildEntityDefinition } from '@nextsparkjs/core/lib/entities/types'
|
|
7
|
+
// Import registry directly - webpack resolves @nextsparkjs/registries alias at compile time
|
|
8
|
+
import { ENTITY_REGISTRY, ENTITY_METADATA } from '@nextsparkjs/registries/entity-registry'
|
|
9
|
+
|
|
10
|
+
// Initialize registry at module load time (before any component renders)
|
|
11
|
+
// This ensures the registry is available even if this page loads before the layout
|
|
12
|
+
setEntityRegistry(ENTITY_REGISTRY, ENTITY_METADATA)
|
|
7
13
|
|
|
8
14
|
// Type guard to check if entity is a full EntityConfig
|
|
9
15
|
function isEntityConfig(entity: EntityConfig | ChildEntityDefinition): entity is EntityConfig {
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { notFound, redirect } from 'next/navigation'
|
|
2
|
-
import { getEntity, getEntityRegistry, getChildEntities } from '@nextsparkjs/core/lib/entities/queries'
|
|
2
|
+
import { getEntity, getEntityRegistry, getChildEntities, setEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
|
|
3
3
|
import { EntityDetailWrapper } from '@nextsparkjs/core/components/entities/wrappers/EntityDetailWrapper'
|
|
4
4
|
import type { Metadata } from 'next'
|
|
5
5
|
import { TemplateService } from '@nextsparkjs/core/lib/services/template.service'
|
|
6
6
|
import type { EntityConfig, ChildEntityDefinition } from '@nextsparkjs/core/lib/entities/types'
|
|
7
|
+
// Import registry directly - webpack resolves @nextsparkjs/registries alias at compile time
|
|
8
|
+
import { ENTITY_REGISTRY, ENTITY_METADATA } from '@nextsparkjs/registries/entity-registry'
|
|
9
|
+
|
|
10
|
+
// Initialize registry at module load time (before any component renders)
|
|
11
|
+
setEntityRegistry(ENTITY_REGISTRY, ENTITY_METADATA)
|
|
7
12
|
|
|
8
13
|
// Type guard to check if entity is a full EntityConfig
|
|
9
14
|
function isEntityConfig(entity: EntityConfig | ChildEntityDefinition): entity is EntityConfig {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { notFound } from 'next/navigation'
|
|
2
|
-
import { getEntity, getEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
|
|
2
|
+
import { getEntity, getEntityRegistry, setEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
|
|
3
3
|
import { EntityListWrapper } from '@nextsparkjs/core/components/entities/wrappers/EntityListWrapper'
|
|
4
4
|
import type { Metadata } from 'next'
|
|
5
5
|
import { getTemplateOrDefault } from '@nextsparkjs/core/lib/template-resolver'
|
|
6
6
|
import type { EntityConfig, ChildEntityDefinition } from '@nextsparkjs/core/lib/entities/types'
|
|
7
|
+
// Import registry directly - webpack resolves @nextsparkjs/registries alias at compile time
|
|
8
|
+
import { ENTITY_REGISTRY, ENTITY_METADATA } from '@nextsparkjs/registries/entity-registry'
|
|
9
|
+
|
|
10
|
+
// Initialize registry at module load time (before any component renders)
|
|
11
|
+
// This ensures the registry is available even if this page loads before the layout
|
|
12
|
+
setEntityRegistry(ENTITY_REGISTRY, ENTITY_METADATA)
|
|
7
13
|
|
|
8
14
|
// Type guard to check if entity is a full EntityConfig
|
|
9
15
|
function isEntityConfig(entity: EntityConfig | ChildEntityDefinition): entity is EntityConfig {
|