@nextsparkjs/core 0.1.0-beta.24 → 0.1.0-beta.25
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/contents/themes/starter/tests/jest/jest.config.cjs +7 -3
- package/package.json +1 -1
- package/templates/contents/themes/starter/tests/jest/jest.config.cjs +7 -3
- package/tests/jest/__mocks__/@nextsparkjs/registries/permissions-registry.ts +26 -0
package/dist/styles/classes.json
CHANGED
|
@@ -36,10 +36,14 @@ module.exports = {
|
|
|
36
36
|
testEnvironment: 'jsdom',
|
|
37
37
|
|
|
38
38
|
// Module resolution for npm mode
|
|
39
|
+
// Explicitly resolve @nextsparkjs/core subpaths to dist directory
|
|
40
|
+
// Jest doesn't respect package.json exports, so we map directly to dist files
|
|
39
41
|
moduleNameMapper: {
|
|
40
|
-
|
|
41
|
-
'^@nextsparkjs/core/(.*)$': '
|
|
42
|
-
'^@nextsparkjs/core$': '
|
|
42
|
+
'^@nextsparkjs/core/lib/(.*)$': '<rootDir>/node_modules/@nextsparkjs/core/dist/lib/$1',
|
|
43
|
+
'^@nextsparkjs/core/hooks/(.*)$': '<rootDir>/node_modules/@nextsparkjs/core/dist/hooks/$1',
|
|
44
|
+
'^@nextsparkjs/core/components/(.*)$': '<rootDir>/node_modules/@nextsparkjs/core/dist/components/$1',
|
|
45
|
+
'^@nextsparkjs/core/(.*)$': '<rootDir>/node_modules/@nextsparkjs/core/dist/$1',
|
|
46
|
+
'^@nextsparkjs/core$': '<rootDir>/node_modules/@nextsparkjs/core/dist/index.js',
|
|
43
47
|
'^@/contents/(.*)$': '<rootDir>/contents/$1',
|
|
44
48
|
'^@/entities/(.*)$': '<rootDir>/contents/entities/$1',
|
|
45
49
|
'^@/plugins/(.*)$': '<rootDir>/contents/plugins/$1',
|
package/package.json
CHANGED
|
@@ -36,10 +36,14 @@ module.exports = {
|
|
|
36
36
|
testEnvironment: 'jsdom',
|
|
37
37
|
|
|
38
38
|
// Module resolution for npm mode
|
|
39
|
+
// Explicitly resolve @nextsparkjs/core subpaths to dist directory
|
|
40
|
+
// Jest doesn't respect package.json exports, so we map directly to dist files
|
|
39
41
|
moduleNameMapper: {
|
|
40
|
-
|
|
41
|
-
'^@nextsparkjs/core/(.*)$': '
|
|
42
|
-
'^@nextsparkjs/core$': '
|
|
42
|
+
'^@nextsparkjs/core/lib/(.*)$': '<rootDir>/node_modules/@nextsparkjs/core/dist/lib/$1',
|
|
43
|
+
'^@nextsparkjs/core/hooks/(.*)$': '<rootDir>/node_modules/@nextsparkjs/core/dist/hooks/$1',
|
|
44
|
+
'^@nextsparkjs/core/components/(.*)$': '<rootDir>/node_modules/@nextsparkjs/core/dist/components/$1',
|
|
45
|
+
'^@nextsparkjs/core/(.*)$': '<rootDir>/node_modules/@nextsparkjs/core/dist/$1',
|
|
46
|
+
'^@nextsparkjs/core$': '<rootDir>/node_modules/@nextsparkjs/core/dist/index.js',
|
|
43
47
|
'^@/contents/(.*)$': '<rootDir>/contents/$1',
|
|
44
48
|
'^@/entities/(.*)$': '<rootDir>/contents/entities/$1',
|
|
45
49
|
'^@/plugins/(.*)$': '<rootDir>/contents/plugins/$1',
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock for @nextsparkjs/registries/permissions-registry
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const AVAILABLE_ROLES = ['member', 'superadmin', 'developer'] as const
|
|
6
|
+
export const ROLE_HIERARCHY = {
|
|
7
|
+
member: 1,
|
|
8
|
+
superadmin: 99,
|
|
9
|
+
developer: 100,
|
|
10
|
+
}
|
|
11
|
+
export const ROLE_DISPLAY_NAMES = {
|
|
12
|
+
member: 'common.userRoles.member',
|
|
13
|
+
superadmin: 'common.userRoles.superadmin',
|
|
14
|
+
developer: 'common.userRoles.developer',
|
|
15
|
+
}
|
|
16
|
+
export const ROLE_DESCRIPTIONS = {
|
|
17
|
+
member: 'Regular user with team-based permissions',
|
|
18
|
+
superadmin: 'Full system access (product owners only)',
|
|
19
|
+
developer: 'Ultimate access (platform developers only)',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const TEAM_PERMISSIONS_BY_ROLE = {
|
|
23
|
+
member: ['view', 'edit'],
|
|
24
|
+
superadmin: ['view', 'edit', 'delete', 'admin'],
|
|
25
|
+
developer: ['view', 'edit', 'delete', 'admin', 'dev'],
|
|
26
|
+
}
|