@shipsite.dev/cli 0.2.15 → 0.2.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/workspace/generators/layout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,wBAAgB,cAAc,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CA6G1D"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/workspace/generators/layout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,wBAAgB,cAAc,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CA0H1D"}
@@ -1,7 +1,6 @@
1
1
  import { join } from 'path';
2
2
  import { writeFileSync } from 'fs';
3
3
  export function generateLayout(ctx) {
4
- // Build icons metadata from config
5
4
  const favicon = ctx.config.favicon;
6
5
  let iconsBlock = '';
7
6
  if (favicon) {
@@ -11,14 +10,26 @@ export function generateLayout(ctx) {
11
10
  apple: '/apple-touch-icon.png',
12
11
  },`;
13
12
  }
14
- // Root layout owns <html>, <body>, ThemeProvider, metadata
15
- // Reads locale from [locale] param via Next.js layout params
13
+ const defaultLocale = ctx.config.i18n?.defaultLocale || 'en';
14
+ // Root layout static shell with default lang for /_not-found and other
15
+ // non-locale routes. The [locale] layout overrides <html> for real pages.
16
+ writeFileSync(join(ctx.srcDir, 'app', 'layout.tsx'), `import '../styles/globals.css';
17
+
18
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
19
+ return (
20
+ <html lang="${defaultLocale}" suppressHydrationWarning>
21
+ <body>{children}</body>
22
+ </html>
23
+ );
24
+ }
25
+ `);
26
+ // Locale layout — owns <html lang={locale}>, <body>, providers, header/footer.
16
27
  writeFileSync(join(ctx.srcDir, 'app', '[locale]', 'layout.tsx'), `import { notFound } from 'next/navigation';
17
28
  import { routing } from '../../i18n/routing';
18
29
  import { ShipSiteProvider } from '@shipsite.dev/components/context';
19
30
  import { ThemeProvider } from '@shipsite.dev/components/theme';
20
31
  import { Header, Footer } from '@shipsite.dev/components';
21
- import { generateNavLinks, generateAlternatePathMap, getConfig, getSiteUrl, getLocalizedField } from '@shipsite.dev/core';
32
+ import { generateNavLinks, generateAlternatePathMap, getConfig, getSiteUrl } from '@shipsite.dev/core';
22
33
  import '../../styles/globals.css';
23
34
  import type { Metadata, Viewport } from 'next';
24
35
 
@@ -102,7 +113,5 @@ export default async function LocaleLayout({ children, params }: LayoutProps) {
102
113
  );
103
114
  }
104
115
  `);
105
- // Remove any stale root layout — not needed, [locale]/layout.tsx is the root
106
- // Next.js treats the deepest layout with <html> as the root layout
107
116
  }
108
117
  //# sourceMappingURL=layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/workspace/generators/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAGnC,MAAM,UAAU,cAAc,CAAC,GAAqB;IAClD,mCAAmC;IACnC,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;IACnC,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,OAAO,EAAE,CAAC;QACZ,UAAU,GAAG;;aAEJ,OAAO;;KAEf,CAAC;IACJ,CAAC;IAED,6DAA6D;IAC7D,6DAA6D;IAC7D,aAAa,CACX,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,CAAC,EACjD;;;;;;;;;;;;;;;;;qEAiBiE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuE9E,CACE,CAAC;IAEF,6EAA6E;IAC7E,mEAAmE;AACrE,CAAC"}
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/workspace/generators/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAGnC,MAAM,UAAU,cAAc,CAAC,GAAqB;IAClD,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;IACnC,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,OAAO,EAAE,CAAC;QACZ,UAAU,GAAG;;aAEJ,OAAO;;KAEf,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,IAAI,IAAI,CAAC;IAE7D,yEAAyE;IACzE,0EAA0E;IAC1E,aAAa,CACX,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,EACrC;;;;kBAIc,aAAa;;;;;CAK9B,CACE,CAAC;IAEF,+EAA+E;IAC/E,aAAa,CACX,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,CAAC,EACjD;;;;;;;;;;;;;;;;;qEAiBiE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuE9E,CACE,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipsite.dev/cli",
3
- "version": "0.2.15",
3
+ "version": "0.2.18",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shipsite/shipsite",