@linagora/linid-im-front-corelib 0.0.5 → 0.0.7
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 +3 -3
- package/dist/core-lib.es.js +923 -852
- package/dist/core-lib.umd.js +9 -9
- package/dist/package.json +19 -14
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/services/httpClientService.d.ts +13 -0
- package/dist/types/src/services/linIdConfigurationService.d.ts +21 -0
- package/dist/types/src/stores/linIdConfigurationStore.d.ts +79 -0
- package/dist/types/src/types/linidConfiguration.d.ts +42 -0
- package/package.json +18 -13
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -83
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -90
- package/.github/ISSUE_TEMPLATE/question.yml +0 -31
- package/.github/ISSUE_TEMPLATE/security.yml +0 -69
- package/.github/actions/setup-node-pnpm/action.yml +0 -29
- package/.github/workflows/pull-request.yml +0 -147
- package/.github/workflows/release.yml +0 -90
- package/.prettierignore +0 -7
- package/.prettierrc.json +0 -5
- package/.vscode/extensions.json +0 -3
- package/.vscode/settings.json +0 -9
- package/CHANGELOG.md +0 -40
- package/CONTRIBUTING.md +0 -269
- package/COPYRIGHT +0 -23
- package/docs/components-plugin-zones.md +0 -168
- package/docs/helpers.md +0 -188
- package/docs/module-lifecycle.md +0 -717
- package/docs/types-and-interfaces.md +0 -92
- package/eslint.config.js +0 -136
- package/src/components/LinidZoneRenderer.vue +0 -77
- package/src/index.ts +0 -51
- package/src/lifecycle/skeleton.ts +0 -147
- package/src/services/federationService.ts +0 -44
- package/src/stores/linidZoneStore.ts +0 -62
- package/src/types/linidZone.ts +0 -48
- package/src/types/module.ts +0 -96
- package/src/types/moduleLifecycle.ts +0 -154
- package/tests/unit/components/LinidZoneRenderer.spec.js +0 -135
- package/tests/unit/lifecycle/skeleton.spec.js +0 -138
- package/tests/unit/services/federationService.spec.js +0 -146
- package/tests/unit/stores/linidZoneStore.spec.js +0 -94
- package/tsconfig.json +0 -14
- package/tsconfig.lib.json +0 -20
- package/tsconfig.node.json +0 -9
- package/tsconfig.spec.json +0 -16
- package/vite.config.ts +0 -37
- package/vitest.config.ts +0 -19
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { createPinia, setActivePinia } from 'pinia';
|
|
2
|
-
import { useLinidZoneStore } from 'src/stores/linidZoneStore';
|
|
3
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
4
|
-
|
|
5
|
-
describe('Test store: linidZoneStore', () => {
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
setActivePinia(createPinia());
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
describe('Test initial state', () => {
|
|
11
|
-
it('should initialize with empty zones', () => {
|
|
12
|
-
const store = useLinidZoneStore();
|
|
13
|
-
|
|
14
|
-
expect(store.zones).toEqual({});
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
describe('Test function: register', () => {
|
|
19
|
-
it('should register an entry in a new zone', () => {
|
|
20
|
-
const store = useLinidZoneStore();
|
|
21
|
-
const entry = {
|
|
22
|
-
plugin: 'test-plugin/TestComponent',
|
|
23
|
-
props: {},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
store.register('list-page.sidebar', entry);
|
|
27
|
-
|
|
28
|
-
expect(store.zones['list-page.sidebar']).toBeDefined();
|
|
29
|
-
expect(store.zones['list-page.sidebar']).toHaveLength(1);
|
|
30
|
-
expect(store.zones['list-page.sidebar'][0]).toEqual(entry);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should register multiple entries in the same zone', () => {
|
|
34
|
-
const store = useLinidZoneStore();
|
|
35
|
-
const entry1 = {
|
|
36
|
-
plugin: 'plugin-1/Component1',
|
|
37
|
-
props: {},
|
|
38
|
-
};
|
|
39
|
-
const entry2 = {
|
|
40
|
-
plugin: 'plugin-2/Component2',
|
|
41
|
-
props: { value: 42 },
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
store.register('list-page.sidebar', entry1);
|
|
45
|
-
store.register('list-page.sidebar', entry2);
|
|
46
|
-
|
|
47
|
-
expect(store.zones['list-page.sidebar']).toHaveLength(2);
|
|
48
|
-
expect(store.zones['list-page.sidebar'][0]).toEqual(entry1);
|
|
49
|
-
expect(store.zones['list-page.sidebar'][1]).toEqual(entry2);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should register entries in different zones independently', () => {
|
|
53
|
-
const store = useLinidZoneStore();
|
|
54
|
-
const headerEntry = {
|
|
55
|
-
plugin: 'header-plugin/HeaderComponent',
|
|
56
|
-
props: {},
|
|
57
|
-
};
|
|
58
|
-
const footerEntry = {
|
|
59
|
-
plugin: 'footer-plugin/FooterComponent',
|
|
60
|
-
props: {},
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
store.register('list-page.header', headerEntry);
|
|
64
|
-
store.register('list-page.footer', footerEntry);
|
|
65
|
-
|
|
66
|
-
expect(store.zones['list-page.header']).toHaveLength(1);
|
|
67
|
-
expect(store.zones['list-page.footer']).toHaveLength(1);
|
|
68
|
-
expect(store.zones['list-page.header'][0]).toEqual(headerEntry);
|
|
69
|
-
expect(store.zones['list-page.footer'][0]).toEqual(footerEntry);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should handle entries with complex props', () => {
|
|
73
|
-
const store = useLinidZoneStore();
|
|
74
|
-
const entry = {
|
|
75
|
-
plugin: 'complex-plugin/ComplexComponent',
|
|
76
|
-
props: {
|
|
77
|
-
title: 'Test Title',
|
|
78
|
-
count: 123,
|
|
79
|
-
enabled: true,
|
|
80
|
-
config: {
|
|
81
|
-
nested: {
|
|
82
|
-
value: 'deep',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
items: ['a', 'b', 'c'],
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
store.register('list-page.body', entry);
|
|
90
|
-
|
|
91
|
-
expect(store.zones['list-page.body'][0].props).toEqual(entry.props);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
});
|
package/tsconfig.json
DELETED
package/tsconfig.lib.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"composite": true,
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"lib": ["ESNext", "DOM"],
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"types": ["node", "vite/client", "vue"],
|
|
14
|
-
"declaration": true,
|
|
15
|
-
"declarationDir": "dist/types",
|
|
16
|
-
"outDir": "dist"
|
|
17
|
-
},
|
|
18
|
-
"include": ["src"],
|
|
19
|
-
"exclude": ["vite.config.ts", "tests", "vitest.config.ts"]
|
|
20
|
-
}
|
package/tsconfig.node.json
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"composite": true,
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"outDir": "./out-tsc/vitest",
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"module": "esnext",
|
|
8
|
-
"moduleResolution": "bundler"
|
|
9
|
-
},
|
|
10
|
-
"include": ["tests", "src"],
|
|
11
|
-
"references": [
|
|
12
|
-
{
|
|
13
|
-
"path": "./tsconfig.lib.json"
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import vue from '@vitejs/plugin-vue';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { defineConfig } from 'vite';
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
plugins: [
|
|
8
|
-
vue(),
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
name: 'copy-package-json',
|
|
12
|
-
closeBundle() {
|
|
13
|
-
const src = path.resolve(__dirname, 'package.json');
|
|
14
|
-
const dest = path.resolve(__dirname, 'dist', 'package.json');
|
|
15
|
-
if (fs.existsSync(src)) {
|
|
16
|
-
fs.copyFileSync(src, dest);
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
|
|
22
|
-
build: {
|
|
23
|
-
lib: {
|
|
24
|
-
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
25
|
-
name: 'CoreLib',
|
|
26
|
-
fileName: (format) => `core-lib.${format}.js`,
|
|
27
|
-
},
|
|
28
|
-
rollupOptions: {
|
|
29
|
-
external: ['vue'],
|
|
30
|
-
output: {
|
|
31
|
-
globals: {
|
|
32
|
-
vue: 'Vue',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
});
|
package/vitest.config.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import vue from '@vitejs/plugin-vue';
|
|
2
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
3
|
-
import { defineConfig } from 'vitest/config';
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
test: {
|
|
7
|
-
environment: 'happy-dom',
|
|
8
|
-
globals: true,
|
|
9
|
-
include: ['tests/unit/**/*.{test,spec}.js'],
|
|
10
|
-
coverage: {
|
|
11
|
-
provider: 'v8',
|
|
12
|
-
reporter: ['text', 'html', 'lcov'],
|
|
13
|
-
reportsDirectory: './coverage',
|
|
14
|
-
include: ['src/**/*.{ts,js,vue}'],
|
|
15
|
-
exclude: ['**/tests/**', 'src/types/**', 'src/index.ts'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
plugins: [vue(), tsconfigPaths()],
|
|
19
|
-
});
|