@egen-civitas/egen 3.0.1 → 3.2.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/CHANGELOG.md +18 -0
- package/README.md +31 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +106 -0
- package/dist/commands/check-app.d.ts +31 -0
- package/dist/commands/check-app.d.ts.map +1 -0
- package/dist/commands/check-app.js +366 -0
- package/dist/commands/cli-actions.d.ts +26 -0
- package/dist/commands/cli-actions.d.ts.map +1 -0
- package/dist/commands/cli-actions.js +51 -0
- package/dist/commands/create.d.ts +27 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +63 -0
- package/dist/commands/develop.d.ts.map +1 -1
- package/dist/commands/develop.js +73 -3
- package/dist/commands/manifest.d.ts +16 -0
- package/dist/commands/manifest.d.ts.map +1 -0
- package/dist/commands/manifest.js +54 -0
- package/package.json +9 -4
- package/templates/react-embedded/README.md +14 -0
- package/templates/react-embedded/_gitignore +3 -0
- package/templates/react-embedded/index.html +12 -0
- package/templates/react-embedded/package.json +27 -0
- package/templates/react-embedded/public/egen-config.json +15 -0
- package/templates/react-embedded/src/App.tsx +14 -0
- package/templates/react-embedded/src/egen.test.ts +9 -0
- package/templates/react-embedded/src/egen.ts +12 -0
- package/templates/react-embedded/src/main.tsx +13 -0
- package/templates/react-embedded/tsconfig.json +14 -0
- package/templates/react-embedded/vite.config.ts +4 -0
- package/templates/vanilla-embedded/README.md +13 -0
- package/templates/vanilla-embedded/_gitignore +3 -0
- package/templates/vanilla-embedded/package.json +15 -0
- package/templates/vanilla-embedded/public/egen-config.json +15 -0
- package/templates/vanilla-embedded/public/index.html +19 -0
- package/templates/vanilla-embedded/public/main.js +15 -0
- package/templates/vanilla-embedded/scripts/vendor.mjs +10 -0
- package/templates/vue-embedded/README.md +14 -0
- package/templates/vue-embedded/_gitignore +3 -0
- package/templates/vue-embedded/index.html +12 -0
- package/templates/vue-embedded/package.json +25 -0
- package/templates/vue-embedded/public/egen-config.json +15 -0
- package/templates/vue-embedded/src/App.vue +18 -0
- package/templates/vue-embedded/src/egen.test.ts +9 -0
- package/templates/vue-embedded/src/egen.ts +12 -0
- package/templates/vue-embedded/src/env.d.ts +1 -0
- package/templates/vue-embedded/src/main.ts +6 -0
- package/templates/vue-embedded/tsconfig.json +13 -0
- package/templates/vue-embedded/vite.config.ts +4 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifestVersion": 2,
|
|
3
|
+
"name": "__NAME__",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"title": "__TITLE__",
|
|
6
|
+
"description": "Application intégrée au Shell EGEN.",
|
|
7
|
+
"url": "https://__NAME__.example.org",
|
|
8
|
+
"route": "__NAME__",
|
|
9
|
+
"technology": "vue",
|
|
10
|
+
"integration": "embedded",
|
|
11
|
+
"sdk": { "range": "^__SDK_VERSION__" },
|
|
12
|
+
"navigation": { "mode": "history", "sensitiveParams": ["token", "access_token"] },
|
|
13
|
+
"locales": ["fr", "en"],
|
|
14
|
+
"capabilities": { "tenant": {}, "locale": {}, "navigation": {}, "lifecycle": {}, "notifications": {} }
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useEgen, useEgenLocale, useEgenNotify } from '@egen-civitas/sdk/vue';
|
|
3
|
+
|
|
4
|
+
const egen = useEgen();
|
|
5
|
+
const locale = useEgenLocale();
|
|
6
|
+
const { notify } = useEgenNotify();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<main :lang="locale">
|
|
11
|
+
<h1>__TITLE__</h1>
|
|
12
|
+
<p v-if="!egen">Connexion au Shell…</p>
|
|
13
|
+
<template v-else>
|
|
14
|
+
<p>Mode : {{ egen.mode }}</p>
|
|
15
|
+
<button @click="notify({ kind: 'success', title: 'Enregistré' })">Enregistrer</button>
|
|
16
|
+
</template>
|
|
17
|
+
</main>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { connect } from '@egen-civitas/sdk';
|
|
2
|
+
import { expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
it("fonctionne sans Shell : l'app passe en mode autonome", async () => {
|
|
5
|
+
const app = await connect({ moduleName: '__NAME__', mode: 'standalone', capabilities: ['locale'], standalone: { locale: 'fr' } });
|
|
6
|
+
expect(app.mode).toBe('standalone');
|
|
7
|
+
await expect(app.locale.get()).resolves.toBe('fr');
|
|
8
|
+
app.close();
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ConnectOptions } from '@egen-civitas/sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Connexion à EGEN. `hostOrigins` : origines EXACTES du Shell (jamais `*`). Hors Shell (page ouverte seule), l'app passe
|
|
5
|
+
* automatiquement en mode autonome : le même code fonctionne avec ou sans EGEN.
|
|
6
|
+
*/
|
|
7
|
+
export const egenOptions: ConnectOptions = {
|
|
8
|
+
moduleName: '__NAME__',
|
|
9
|
+
hostOrigins: [import.meta.env.VITE_EGEN_SHELL_ORIGIN ?? 'http://localhost:8081'],
|
|
10
|
+
capabilities: ['tenant', 'locale', 'navigation', 'lifecycle', 'notifications'],
|
|
11
|
+
required: ['navigation'],
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"types": ["vite/client"]
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/**/*.ts", "src/**/*.vue"]
|
|
13
|
+
}
|