@egen-civitas/esm-extensions 1.0.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/mock.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { vi } from 'vitest';
2
+ import { getGlobalStore } from '@egen-civitas/esm-state/mock';
3
+ import { type WorkspaceGroupRegistration, type WorkspaceRegistration } from '.';
4
+
5
+ export const attach = vi.fn();
6
+ export const detach = vi.fn();
7
+ export const detachAll = vi.fn();
8
+
9
+ export const switchTo = vi.fn();
10
+
11
+ export const getExtensionStore = () => getGlobalStore('extensions', { slots: {} });
12
+
13
+ export const getExtensionInternalStore = () =>
14
+ getGlobalStore('extensions-internal', {
15
+ slots: {},
16
+ extensions: {},
17
+ });
18
+
19
+ const mockExtensionRegistry = {};
20
+
21
+ export const getExtensionRegistration = vi.fn((name) => {
22
+ return mockExtensionRegistry[name];
23
+ });
24
+
25
+ export const registerExtension = vi.fn((ext) => {
26
+ mockExtensionRegistry[ext.name] = ext;
27
+ });
28
+
29
+ export function clearMockExtensionRegistry() {
30
+ Object.keys(mockExtensionRegistry).forEach((key) => {
31
+ delete mockExtensionRegistry[key];
32
+ });
33
+ }
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@egen-civitas/esm-extensions",
3
+ "version": "1.0.0",
4
+ "license": "MPL-2.0",
5
+ "description": "Coordinates extensions and extension points in the Egen Frontend",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "files": [
9
+ "dist",
10
+ "mock.ts",
11
+ "mock-jest.ts"
12
+ ],
13
+ "module": "dist/index.js",
14
+ "types": "dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "./src/public": {
21
+ "types": "./dist/public.d.ts",
22
+ "default": "./dist/public.js"
23
+ },
24
+ "./mock": {
25
+ "import": "./mock.ts",
26
+ "require": "./mock-jest.ts"
27
+ }
28
+ },
29
+ "source": true,
30
+ "scripts": {
31
+ "test": "cross-env TZ=UTC vitest run --passWithNoTests",
32
+ "test:watch": "cross-env TZ=UTC vitest watch --passWithNoTests",
33
+ "coverage": "cross-env TZ=UTC vitest run --coverage --passWithNoTests",
34
+ "build": "rimraf dist && concurrently \"swc --strip-leading-paths src -d dist\" \"tsc --project tsconfig.build.json\"",
35
+ "build:development": "rimraf dist && concurrently \"swc --strip-leading-paths src -d dist\" \"tsc --project tsconfig.build.json\"",
36
+ "typescript": "tsc --project tsconfig.build.json",
37
+ "lint": "eslint src --ext ts,tsx"
38
+ },
39
+ "keywords": [
40
+ "egen",
41
+ "microfrontends"
42
+ ],
43
+ "directories": {
44
+ "lib": "dist",
45
+ "src": "src"
46
+ },
47
+ "browserslist": [
48
+ "extends browserslist-config-egen"
49
+ ],
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/egen-civitas/egen-esm-core.git"
53
+ },
54
+ "bugs": {
55
+ "url": "https://github.com/egen-civitas/egen-esm-core/issues"
56
+ },
57
+ "homepage": "https://github.com/egen-civitas/egen-esm-core#readme",
58
+ "publishConfig": {
59
+ "access": "public"
60
+ },
61
+ "dependencies": {
62
+ "lodash-es": "^4.17.21"
63
+ },
64
+ "peerDependencies": {
65
+ "@egen-civitas/esm-api": "^1.0.0",
66
+ "@egen-civitas/esm-config": "^1.0.0",
67
+ "@egen-civitas/esm-expression-evaluator": "^1.0.0",
68
+ "@egen-civitas/esm-feature-flags": "^1.0.0",
69
+ "@egen-civitas/esm-globals": "^1.0.0",
70
+ "@egen-civitas/esm-state": "^1.0.0",
71
+ "@egen-civitas/esm-translations": "^1.0.0",
72
+ "@egen-civitas/esm-utils": "^1.0.0",
73
+ "single-spa": "6.x"
74
+ },
75
+ "devDependencies": {
76
+ "@egen-civitas/esm-api": "^1.0.0",
77
+ "@egen-civitas/esm-config": "^1.0.0",
78
+ "@egen-civitas/esm-expression-evaluator": "^1.0.0",
79
+ "@egen-civitas/esm-feature-flags": "^1.0.0",
80
+ "@egen-civitas/esm-globals": "^1.0.0",
81
+ "@egen-civitas/esm-state": "^1.0.0",
82
+ "@egen-civitas/esm-translations": "^1.0.0",
83
+ "@egen-civitas/esm-utils": "^1.0.0",
84
+ "@swc/cli": "0.8.1",
85
+ "@swc/core": "1.15.21",
86
+ "@vitest/coverage-v8": "^4.1.2",
87
+ "concurrently": "^9.2.1",
88
+ "cross-env": "^10.1.0",
89
+ "happy-dom": "^20.6.0",
90
+ "i18next": "^25.5.3",
91
+ "react": "^18.3.1",
92
+ "rimraf": "^6.1.3",
93
+ "single-spa": "^6.0.3",
94
+ "vitest": "^4.1.2"
95
+ }
96
+ }