@shipsite.dev/cli 0.2.14 → 0.2.15
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/dist/workspace/generators/ai-config.d.ts +3 -0
- package/dist/workspace/generators/ai-config.d.ts.map +1 -0
- package/dist/workspace/generators/ai-config.js +198 -0
- package/dist/workspace/generators/ai-config.js.map +1 -0
- package/dist/workspace/generators/layout.d.ts.map +1 -1
- package/dist/workspace/generators/layout.js +22 -3
- package/dist/workspace/generators/layout.js.map +1 -1
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +2 -0
- package/dist/workspace/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-config.d.ts","sourceRoot":"","sources":["../../../src/workspace/generators/ai-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAkNpD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAe5D"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { join, dirname } from 'path';
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
3
|
+
const BEGIN_MARKER = '<!-- BEGIN SHIPSITE AUTO-GENERATED - DO NOT EDIT THIS SECTION -->';
|
|
4
|
+
const END_MARKER = '<!-- END SHIPSITE AUTO-GENERATED -->';
|
|
5
|
+
function resolveComponentsJson(rootDir) {
|
|
6
|
+
let searchDir = rootDir;
|
|
7
|
+
for (let i = 0; i < 10; i++) {
|
|
8
|
+
const candidate = join(searchDir, 'node_modules', '@shipsite.dev', 'components', 'components.json');
|
|
9
|
+
if (existsSync(candidate)) {
|
|
10
|
+
return JSON.parse(readFileSync(candidate, 'utf-8'));
|
|
11
|
+
}
|
|
12
|
+
const parent = dirname(searchDir);
|
|
13
|
+
if (parent === searchDir)
|
|
14
|
+
break;
|
|
15
|
+
searchDir = parent;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
function formatComponentCatalog(components) {
|
|
20
|
+
const grouped = {};
|
|
21
|
+
for (const c of components) {
|
|
22
|
+
const cat = c.category.charAt(0).toUpperCase() + c.category.slice(1);
|
|
23
|
+
(grouped[cat] ??= []).push(c);
|
|
24
|
+
}
|
|
25
|
+
const lines = [];
|
|
26
|
+
for (const [category, comps] of Object.entries(grouped)) {
|
|
27
|
+
lines.push(`### ${category}`);
|
|
28
|
+
for (const c of comps) {
|
|
29
|
+
lines.push(`- **${c.name}** — ${c.description}`);
|
|
30
|
+
}
|
|
31
|
+
lines.push('');
|
|
32
|
+
}
|
|
33
|
+
return lines.join('\n');
|
|
34
|
+
}
|
|
35
|
+
function buildSharedContent(ctx, components) {
|
|
36
|
+
const config = ctx.config;
|
|
37
|
+
const siteName = config.name || 'ShipSite Project';
|
|
38
|
+
const locales = config.i18n?.locales || ['en'];
|
|
39
|
+
const defaultLocale = config.i18n?.defaultLocale || 'en';
|
|
40
|
+
const componentCatalog = components ? formatComponentCatalog(components.components) : '_Components not found — run `npm install` first._';
|
|
41
|
+
return `# ${siteName} — ShipSite Project
|
|
42
|
+
|
|
43
|
+
## Tech Stack
|
|
44
|
+
|
|
45
|
+
- **Framework:** Next.js (App Router)
|
|
46
|
+
- **Content:** MDX files in \`content/\` — processed by content-collections
|
|
47
|
+
- **Styling:** Tailwind CSS v4 + shadcn/ui design tokens
|
|
48
|
+
- **i18n:** next-intl (locales: ${locales.join(', ')} — default: ${defaultLocale})
|
|
49
|
+
- **Components:** \`@shipsite.dev/components\` — pre-built marketing, blog & legal components
|
|
50
|
+
|
|
51
|
+
## Project Structure
|
|
52
|
+
|
|
53
|
+
\`\`\`
|
|
54
|
+
shipsite.json # Site configuration (pages, nav, footer, colors, i18n)
|
|
55
|
+
# Navigation & footer labels accept string | { locale: "text" } for i18n
|
|
56
|
+
content/ # MDX content files, one folder per page
|
|
57
|
+
{page-name}/
|
|
58
|
+
{locale}.mdx # Content file per locale
|
|
59
|
+
components/ # Custom components (auto-available in MDX)
|
|
60
|
+
public/ # Static assets (images, fonts, favicons)
|
|
61
|
+
.shipsite/ # Generated workspace (do NOT edit)
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
## Content Conventions
|
|
65
|
+
|
|
66
|
+
- Each page is an MDX file at \`content/{page-name}/{locale}.mdx\`
|
|
67
|
+
- Markdown is automatically styled — no need to import prose wrappers
|
|
68
|
+
- ShipSite components are globally available in MDX — no imports needed
|
|
69
|
+
- Images go in \`public/images/\` and are referenced as \`/images/filename.ext\`
|
|
70
|
+
- Custom components in \`components/\` are also auto-available in MDX
|
|
71
|
+
|
|
72
|
+
## Frontmatter by Page Type
|
|
73
|
+
|
|
74
|
+
### Landing / Page (\`type: "landing"\` or \`type: "page"\`)
|
|
75
|
+
\`\`\`yaml
|
|
76
|
+
---
|
|
77
|
+
title: "Page Title — Site Name"
|
|
78
|
+
description: "Meta description for SEO."
|
|
79
|
+
---
|
|
80
|
+
\`\`\`
|
|
81
|
+
Then use marketing components directly:
|
|
82
|
+
\`\`\`mdx
|
|
83
|
+
<Hero title="..." description="..." primaryCta={{ label: "...", href: "..." }} />
|
|
84
|
+
<Features title="...">
|
|
85
|
+
<Feature title="..." description="..." />
|
|
86
|
+
</Features>
|
|
87
|
+
\`\`\`
|
|
88
|
+
|
|
89
|
+
### Blog Article (\`type: "blog-article"\`)
|
|
90
|
+
\`\`\`yaml
|
|
91
|
+
---
|
|
92
|
+
title: "Article Title"
|
|
93
|
+
description: "Meta description."
|
|
94
|
+
excerpt: "Short preview text for blog index cards."
|
|
95
|
+
date: "YYYY-MM-DD"
|
|
96
|
+
readingTime: 3
|
|
97
|
+
author: default
|
|
98
|
+
---
|
|
99
|
+
\`\`\`
|
|
100
|
+
Wrap content in \`<BlogArticle>\`:
|
|
101
|
+
\`\`\`mdx
|
|
102
|
+
<BlogArticle>
|
|
103
|
+
|
|
104
|
+
## Section Heading
|
|
105
|
+
|
|
106
|
+
Paragraph content with **bold** and [links](/path).
|
|
107
|
+
|
|
108
|
+
</BlogArticle>
|
|
109
|
+
\`\`\`
|
|
110
|
+
|
|
111
|
+
### Blog Index (\`type: "blog-index"\`)
|
|
112
|
+
\`\`\`yaml
|
|
113
|
+
---
|
|
114
|
+
title: "Blog — Site Name"
|
|
115
|
+
description: "Meta description."
|
|
116
|
+
---
|
|
117
|
+
\`\`\`
|
|
118
|
+
\`\`\`mdx
|
|
119
|
+
<BlogIndex title="Blog" description="Latest posts." />
|
|
120
|
+
\`\`\`
|
|
121
|
+
|
|
122
|
+
### Legal / Content (\`type: "legal"\`)
|
|
123
|
+
\`\`\`yaml
|
|
124
|
+
---
|
|
125
|
+
title: "Privacy Policy"
|
|
126
|
+
description: "How we handle your data."
|
|
127
|
+
---
|
|
128
|
+
\`\`\`
|
|
129
|
+
\`\`\`mdx
|
|
130
|
+
<ContentPage title="Privacy Policy" lastUpdated="YYYY-MM-DD">
|
|
131
|
+
<ContentSection title="1. Section">Content here.</ContentSection>
|
|
132
|
+
</ContentPage>
|
|
133
|
+
\`\`\`
|
|
134
|
+
|
|
135
|
+
## Available Components
|
|
136
|
+
|
|
137
|
+
${componentCatalog}
|
|
138
|
+
|
|
139
|
+
## Key Rules
|
|
140
|
+
|
|
141
|
+
1. **Never edit files inside \`.shipsite/\`** — they are auto-generated and will be overwritten.
|
|
142
|
+
2. **Don't import ShipSite components** — they are globally registered in MDX.
|
|
143
|
+
3. **Page structure is defined in \`shipsite.json\`** — to add a page, add an entry to the \`pages\` array and create the content folder.
|
|
144
|
+
4. **One MDX file per locale per page** — e.g. \`content/landing/en.mdx\`, \`content/landing/de.mdx\`.
|
|
145
|
+
5. **Use the component catalog above** to pick the right component for each section.
|
|
146
|
+
`;
|
|
147
|
+
}
|
|
148
|
+
function writeWithPreservedContent(filePath, autoContent) {
|
|
149
|
+
let userContent = '';
|
|
150
|
+
if (existsSync(filePath)) {
|
|
151
|
+
const existing = readFileSync(filePath, 'utf-8');
|
|
152
|
+
const endIdx = existing.indexOf(END_MARKER);
|
|
153
|
+
if (endIdx !== -1) {
|
|
154
|
+
userContent = existing.slice(endIdx + END_MARKER.length);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const dir = dirname(filePath);
|
|
158
|
+
if (!existsSync(dir)) {
|
|
159
|
+
mkdirSync(dir, { recursive: true });
|
|
160
|
+
}
|
|
161
|
+
const output = `${BEGIN_MARKER}\n${autoContent}\n${END_MARKER}${userContent || '\n'}`;
|
|
162
|
+
writeFileSync(filePath, output);
|
|
163
|
+
}
|
|
164
|
+
function writeCursorRules(filePath, content) {
|
|
165
|
+
let userContent = '';
|
|
166
|
+
if (existsSync(filePath)) {
|
|
167
|
+
const existing = readFileSync(filePath, 'utf-8');
|
|
168
|
+
const endIdx = existing.indexOf(END_MARKER);
|
|
169
|
+
if (endIdx !== -1) {
|
|
170
|
+
userContent = existing.slice(endIdx + END_MARKER.length);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const dir = dirname(filePath);
|
|
174
|
+
if (!existsSync(dir)) {
|
|
175
|
+
mkdirSync(dir, { recursive: true });
|
|
176
|
+
}
|
|
177
|
+
const frontmatter = `---
|
|
178
|
+
description: ShipSite project conventions, components, and content structure
|
|
179
|
+
globs: "**/*.mdx,**/*.tsx,shipsite.json"
|
|
180
|
+
alwaysApply: true
|
|
181
|
+
---
|
|
182
|
+
`;
|
|
183
|
+
const output = `${frontmatter}${BEGIN_MARKER}\n${content}\n${END_MARKER}${userContent || '\n'}`;
|
|
184
|
+
writeFileSync(filePath, output);
|
|
185
|
+
}
|
|
186
|
+
export function generateAiConfig(ctx) {
|
|
187
|
+
const components = resolveComponentsJson(ctx.rootDir);
|
|
188
|
+
const content = buildSharedContent(ctx, components);
|
|
189
|
+
// Claude Code
|
|
190
|
+
writeWithPreservedContent(join(ctx.rootDir, 'CLAUDE.md'), content);
|
|
191
|
+
// Cursor
|
|
192
|
+
writeCursorRules(join(ctx.rootDir, '.cursor', 'rules', 'shipsite.mdc'), content);
|
|
193
|
+
// GitHub Copilot
|
|
194
|
+
writeWithPreservedContent(join(ctx.rootDir, '.github', 'copilot-instructions.md'), content);
|
|
195
|
+
// Windsurf
|
|
196
|
+
writeWithPreservedContent(join(ctx.rootDir, '.windsurf', 'rules', 'shipsite.md'), content);
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=ai-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-config.js","sourceRoot":"","sources":["../../../src/workspace/generators/ai-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAaxE,MAAM,YAAY,GAAG,mEAAmE,CAAC;AACzF,MAAM,UAAU,GAAG,sCAAsC,CAAC;AAE1D,SAAS,qBAAqB,CAAC,OAAe;IAC5C,IAAI,SAAS,GAAG,OAAO,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;QACpG,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAClC,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM;QAChC,SAAS,GAAG,MAAM,CAAC;IACrB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,sBAAsB,CAAC,U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GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC;AAC7F,CAAC"}
|
|
@@ -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,
|
|
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"}
|
|
@@ -18,7 +18,7 @@ import { routing } from '../../i18n/routing';
|
|
|
18
18
|
import { ShipSiteProvider } from '@shipsite.dev/components/context';
|
|
19
19
|
import { ThemeProvider } from '@shipsite.dev/components/theme';
|
|
20
20
|
import { Header, Footer } from '@shipsite.dev/components';
|
|
21
|
-
import { generateNavLinks, generateAlternatePathMap, getConfig, getSiteUrl } from '@shipsite.dev/core';
|
|
21
|
+
import { generateNavLinks, generateAlternatePathMap, getConfig, getSiteUrl, getLocalizedField } from '@shipsite.dev/core';
|
|
22
22
|
import '../../styles/globals.css';
|
|
23
23
|
import type { Metadata, Viewport } from 'next';
|
|
24
24
|
|
|
@@ -50,6 +50,25 @@ export default async function LocaleLayout({ children, params }: LayoutProps) {
|
|
|
50
50
|
const navLinks = generateNavLinks(locale);
|
|
51
51
|
const alternatePathMap = generateAlternatePathMap();
|
|
52
52
|
|
|
53
|
+
const t = (v: string | Record<string, string>) =>
|
|
54
|
+
typeof v === 'string' ? v : (v[locale] || v.en || '');
|
|
55
|
+
|
|
56
|
+
const rawNav = config.navigation || { items: [] };
|
|
57
|
+
const navigation = {
|
|
58
|
+
items: rawNav.items.map((i: any) => ({ label: t(i.label), href: i.href })),
|
|
59
|
+
cta: rawNav.cta ? { label: t(rawNav.cta.label), href: rawNav.cta.href } : undefined,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const rawFooter = config.footer || {};
|
|
63
|
+
const footer = {
|
|
64
|
+
columns: rawFooter.columns?.map((c: any) => ({
|
|
65
|
+
title: t(c.title),
|
|
66
|
+
links: c.links.map((l: any) => ({ label: t(l.label), href: l.href })),
|
|
67
|
+
})),
|
|
68
|
+
social: rawFooter.social,
|
|
69
|
+
copyright: rawFooter.copyright ? t(rawFooter.copyright) : undefined,
|
|
70
|
+
};
|
|
71
|
+
|
|
53
72
|
return (
|
|
54
73
|
<html lang={locale} suppressHydrationWarning>
|
|
55
74
|
<body>
|
|
@@ -65,8 +84,8 @@ export default async function LocaleLayout({ children, params }: LayoutProps) {
|
|
|
65
84
|
background: config.colors?.background || '#ffffff',
|
|
66
85
|
text: config.colors?.text || '#1f2a37',
|
|
67
86
|
},
|
|
68
|
-
navigation
|
|
69
|
-
footer
|
|
87
|
+
navigation,
|
|
88
|
+
footer,
|
|
70
89
|
navLinks,
|
|
71
90
|
alternatePathMap,
|
|
72
91
|
locale,
|
|
@@ -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
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAgBA,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAA;CAAE,GAAG,IAAI,CAmCrG;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB9F"}
|
package/dist/workspace/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { generateLayout } from './generators/layout.js';
|
|
|
11
11
|
import { generatePage } from './generators/page.js';
|
|
12
12
|
import { generateSitemapAndRobots } from './generators/sitemap-robots.js';
|
|
13
13
|
import { generateProjectFiles } from './generators/project-files.js';
|
|
14
|
+
import { generateAiConfig } from './generators/ai-config.js';
|
|
14
15
|
export function generateWorkspace({ rootDir, mode }) {
|
|
15
16
|
const config = JSON.parse(readFileSync(join(rootDir, 'shipsite.json'), 'utf-8'));
|
|
16
17
|
// Derive i18n config from pages if not explicitly set
|
|
@@ -36,6 +37,7 @@ export function generateWorkspace({ rootDir, mode }) {
|
|
|
36
37
|
generatePage(ctx);
|
|
37
38
|
generateSitemapAndRobots(ctx);
|
|
38
39
|
generateProjectFiles(ctx);
|
|
40
|
+
generateAiConfig(ctx);
|
|
39
41
|
console.log(' Generated .shipsite workspace');
|
|
40
42
|
}
|
|
41
43
|
export async function prepareWorkspace(rootDir, mode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAs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