@seta-labs/nuxt-foundation 0.5.1 → 0.6.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/app/apps.ts
CHANGED
|
@@ -6,11 +6,11 @@ import type { IconName } from '../design-system/vue/icons';
|
|
|
6
6
|
// new tab without the shell. URLs are production only: there is no staging and
|
|
7
7
|
// the other apps do not run locally.
|
|
8
8
|
export const foundationApps = [
|
|
9
|
-
{ id: 'agency', name: 'Agency', kind: 'app', url: 'https://agency.setalabs.
|
|
10
|
-
{ id: 'proxy', name: 'Proxy', kind: 'app', url: 'https://proxy.setalabs.
|
|
11
|
-
{ id: 'geo', name: 'Geo', kind: 'app', url: 'https://geo.setalabs.
|
|
12
|
-
{ id: 'immo', name: 'Immo', kind: 'app', url: 'https://immo.setalabs.
|
|
13
|
-
{ id: 'infra', name: 'Infra', kind: 'tool', url: 'https://argocd.setalabs.
|
|
9
|
+
{ id: 'agency', name: 'Agency', kind: 'app', url: 'https://agency.setalabs.app' },
|
|
10
|
+
{ id: 'proxy', name: 'Proxy', kind: 'app', url: 'https://proxy.setalabs.app' },
|
|
11
|
+
{ id: 'geo', name: 'Geo', kind: 'app', url: 'https://geo.setalabs.app' },
|
|
12
|
+
{ id: 'immo', name: 'Immo', kind: 'app', url: 'https://immo.setalabs.app' },
|
|
13
|
+
{ id: 'infra', name: 'Infra', kind: 'tool', url: 'https://argocd.setalabs.app' },
|
|
14
14
|
] as const satisfies readonly FoundationAppEntry[];
|
|
15
15
|
|
|
16
16
|
export type FoundationAppKind = 'app' | 'tool';
|
package/app/assets/shell.css
CHANGED
|
@@ -101,6 +101,14 @@ body {
|
|
|
101
101
|
font-weight: 400;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/* Release of the app on screen; the shell's own version is in the status bar. */
|
|
105
|
+
.sf-shell__versione {
|
|
106
|
+
color: var(--muted);
|
|
107
|
+
font-size: 12px;
|
|
108
|
+
font-weight: 400;
|
|
109
|
+
font-variant-numeric: tabular-nums;
|
|
110
|
+
}
|
|
111
|
+
|
|
104
112
|
.sf-shell__corpo {
|
|
105
113
|
display: flex;
|
|
106
114
|
min-height: 0;
|
|
@@ -3,6 +3,7 @@ defineProps<{ menuOpen: boolean }>();
|
|
|
3
3
|
defineEmits<{ toggleMenu: [] }>();
|
|
4
4
|
|
|
5
5
|
const app = useFoundationApp();
|
|
6
|
+
const { foundationAppVersion } = useRuntimeConfig().public;
|
|
6
7
|
const hasNav = useFoundationNav().length > 0;
|
|
7
8
|
const dev = import.meta.dev;
|
|
8
9
|
</script>
|
|
@@ -21,6 +22,9 @@ const dev = import.meta.dev;
|
|
|
21
22
|
<NuxtLink to="/" class="sf-barra__app" data-tour="app">
|
|
22
23
|
<SfTessera :app="app.id" :size="32" />
|
|
23
24
|
{{ app.name }}
|
|
25
|
+
<span v-if="foundationAppVersion" class="sf-shell__versione"
|
|
26
|
+
>v{{ foundationAppVersion }}</span
|
|
27
|
+
>
|
|
24
28
|
</NuxtLink>
|
|
25
29
|
</template>
|
|
26
30
|
<span class="sf-barra__spazio" />
|
package/nuxt.config.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
2
3
|
import { fileURLToPath } from 'node:url';
|
|
3
4
|
|
|
4
5
|
const here = (path: string): string => fileURLToPath(new URL(path, import.meta.url));
|
|
@@ -8,9 +9,27 @@ const favicon = `data:image/svg+xml,${encodeURIComponent(
|
|
|
8
9
|
readFileSync(here('./design-system/assets/Marchio/favicon.svg'), 'utf8'),
|
|
9
10
|
)}`;
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Release version of the host app: the first `package.json` among `dirs` with
|
|
14
|
+
* a real version. Monorepo apps keep their own package at 0.0.0 and bump the
|
|
15
|
+
* workspace root on release, so the root comes first.
|
|
16
|
+
*/
|
|
17
|
+
function hostVersion(dirs: string[]): string {
|
|
18
|
+
for (const dir of dirs) {
|
|
19
|
+
const file = join(dir, 'package.json');
|
|
20
|
+
const version = existsSync(file)
|
|
21
|
+
? (JSON.parse(readFileSync(file, 'utf8')) as { version?: string }).version
|
|
22
|
+
: undefined;
|
|
23
|
+
if (version && version !== '0.0.0') return version;
|
|
24
|
+
}
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
|
|
11
28
|
// The layer: design system (tokens + sf- CSS + Vue primitives) and the shell.
|
|
12
29
|
// The host app sets `runtimeConfig.public.foundationApp` to its registry id;
|
|
13
|
-
// NUXT_PUBLIC_FOUNDATION_APP overrides it at runtime.
|
|
30
|
+
// NUXT_PUBLIC_FOUNDATION_APP overrides it at runtime. `foundationAppVersion`
|
|
31
|
+
// is read from the host's package.json at build time (the bar shows it next to
|
|
32
|
+
// the app name); a host value or NUXT_PUBLIC_FOUNDATION_APP_VERSION wins.
|
|
14
33
|
export default defineNuxtConfig({
|
|
15
34
|
app: {
|
|
16
35
|
head: {
|
|
@@ -21,6 +40,15 @@ export default defineNuxtConfig({
|
|
|
21
40
|
{ path: here('./design-system/vue'), pathPrefix: false },
|
|
22
41
|
{ path: here('./app/components'), pathPrefix: false },
|
|
23
42
|
],
|
|
43
|
+
modules: [
|
|
44
|
+
(_, nuxt) => {
|
|
45
|
+
const config = nuxt.options.runtimeConfig.public;
|
|
46
|
+
config.foundationAppVersion ||= hostVersion([
|
|
47
|
+
nuxt.options.workspaceDir,
|
|
48
|
+
nuxt.options.rootDir,
|
|
49
|
+
]);
|
|
50
|
+
},
|
|
51
|
+
],
|
|
24
52
|
css: [
|
|
25
53
|
here('./design-system/tokens.css'),
|
|
26
54
|
here('./design-system/components/bundle.css'),
|
|
@@ -29,6 +57,7 @@ export default defineNuxtConfig({
|
|
|
29
57
|
runtimeConfig: {
|
|
30
58
|
public: {
|
|
31
59
|
foundationApp: '',
|
|
60
|
+
foundationAppVersion: '',
|
|
32
61
|
foundationVersion: version,
|
|
33
62
|
},
|
|
34
63
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seta-labs/nuxt-foundation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Seta Foundation: the Nuxt layer every internal Seta panel extends — design system mirror (tokens, sf- components, icons, brand) plus the shared shell (bar, app launcher, side menu, status bar)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|