@analogjs/platform 3.0.0-beta.10 → 3.0.0-beta.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@analogjs/platform",
3
- "version": "3.0.0-beta.10",
3
+ "version": "3.0.0-beta.11",
4
4
  "description": "The fullstack meta-framework for Angular",
5
5
  "type": "module",
6
6
  "author": "Brandon Roberts <robertsbt@gmail.com>",
@@ -31,7 +31,7 @@
31
31
  "url": "https://github.com/sponsors/brandonroberts"
32
32
  },
33
33
  "dependencies": {
34
- "@analogjs/vite-plugin-angular": "3.0.0-beta.10",
34
+ "@analogjs/vite-plugin-angular": "3.0.0-beta.11",
35
35
  "es-toolkit": "^1.45.1",
36
36
  "front-matter": "^4.0.2",
37
37
  "magic-string": "^0.30.21",
@@ -45,6 +45,9 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@babel/core": "^8.0.0",
48
+ "@nx/angular": "24.0.0",
49
+ "@nx/devkit": "24.0.0",
50
+ "@nx/vite": "24.0.0",
48
51
  "h3": "^2.0.1-rc.31",
49
52
  "nitro": "3.0.260903-beta"
50
53
  },
@@ -36,7 +36,10 @@ function contentPlugin({ highlighter, markedOptions, shikiOptions, prismOptions
36
36
  contentRootDirs = [vite.normalizePath(`${root}/src/content`), ...(options?.additionalContentDirs || []).map(normalizeContentDir)];
37
37
  };
38
38
  const discoverContentFilesList = () => {
39
- contentFilesListCache ??= globSync(contentRootDirs.map((dir) => `${dir}/**/*.md`), { dot: true });
39
+ contentFilesListCache ??= globSync(contentRootDirs.map((dir) => `${dir}/**/*.md`), {
40
+ dot: true,
41
+ cwd: workspaceRoot
42
+ });
40
43
  return contentFilesListCache;
41
44
  };
42
45
  const resolveContentModulePath = (module) => vite.normalizePath(module.startsWith("/") ? module : `${workspaceRoot}/${module}`);
@@ -1 +1 @@
1
- {"version":3,"file":"content-plugin.js","names":[],"sources":["../../../src/lib/content-plugin.ts"],"sourcesContent":["import * as vite from 'vite';\nimport { readFileSync } from 'node:fs';\nimport { relative, resolve } from 'node:path';\nimport { globSync } from 'tinyglobby';\n\nimport type { WithShikiHighlighterOptions } from './content/shiki/options.js';\nimport type { MarkedContentHighlighter } from './content/marked/marked-content-highlighter.js';\nimport type { WithPrismHighlighterOptions } from './content/prism/options.js';\nimport type { WithMarkedOptions } from './content/marked/index.js';\nimport type { Options } from './options.js';\nimport { getBundleOptionsKey } from './utils/rolldown.js';\n\ninterface Content {\n code: string;\n attributes: string;\n}\n\n// Serializes parsed frontmatter as a JS expression, keeping YAML timestamps as Dates.\nfunction toModuleValue(value: unknown): string {\n if (value instanceof Date) {\n return `new Date(${JSON.stringify(value.toISOString())})`;\n }\n if (Array.isArray(value)) {\n return `[${value.map(toModuleValue).join(',')}]`;\n }\n if (value && typeof value === 'object') {\n return `{${Object.entries(value)\n .map(([key, entry]) => `${JSON.stringify(key)}:${toModuleValue(entry)}`)\n .join(',')}}`;\n }\n return JSON.stringify(value) ?? 'undefined';\n}\n\nexport type ContentPluginOptions = {\n highlighter?: 'shiki' | 'prism';\n markedOptions?: WithMarkedOptions;\n shikiOptions?: WithShikiHighlighterOptions;\n prismOptions?: WithPrismHighlighterOptions;\n};\n\n/**\n * Content plugin that provides markdown and content file processing for Analog.\n *\n * IMPORTANT: This plugin uses tinyglobby for file discovery.\n * Key pitfall with { dot: true }:\n * - Returns relative paths from cwd (e.g., \"apps/blog-app/src/content/...\")\n * - These paths CANNOT be used directly in ES module imports\n * - Relative paths without ./ or ../ are treated as package names\n * - Must convert to absolute paths for imports to work correctly\n */\nexport function contentPlugin(\n {\n highlighter,\n markedOptions,\n shikiOptions,\n prismOptions,\n }: ContentPluginOptions = {},\n options?: Options,\n): vite.Plugin[] {\n const cache = new Map<string, Content>();\n // The content list placeholder can be transformed several times during serve.\n // Caching the discovered markdown paths keeps those repeat passes cheap.\n let contentFilesListCache: string[] | undefined;\n\n let markedHighlighter: MarkedContentHighlighter;\n const workspaceRoot = vite.normalizePath(\n options?.workspaceRoot ?? process.env['NX_WORKSPACE_ROOT'] ?? process.cwd(),\n );\n let config: vite.UserConfig;\n let root: string;\n // Keep discovery and invalidation aligned by deriving both from the same\n // normalized content roots. That way external content dirs participate in\n // cache busting exactly the same way they participate in glob discovery.\n // Initialized once in the `config` hook after `root` is resolved — all\n // inputs (`root`, `workspaceRoot`, `options`) are stable after that point.\n let contentRootDirs: string[];\n const normalizeContentDir = (dir: string) => {\n const normalized = vite.normalizePath(\n dir.startsWith('/')\n ? `${workspaceRoot}${dir}`\n : resolve(workspaceRoot, dir),\n );\n return normalized.endsWith('/') ? normalized.slice(0, -1) : normalized;\n };\n const initContentRootDirs = () => {\n contentRootDirs = [\n vite.normalizePath(`${root}/src/content`),\n ...(options?.additionalContentDirs || []).map(normalizeContentDir),\n ];\n };\n const discoverContentFilesList = () => {\n contentFilesListCache ??= globSync(\n contentRootDirs.map((dir) => `${dir}/**/*.md`),\n { dot: true },\n );\n\n return contentFilesListCache;\n };\n const resolveContentModulePath = (module: string) =>\n vite.normalizePath(\n module.startsWith('/') ? module : `${workspaceRoot}/${module}`,\n );\n const getContentModuleKey = (module: string) => {\n const absolutePath = resolveContentModulePath(module);\n const relativeToRoot = vite.normalizePath(relative(root, absolutePath));\n // `startsWith(root)` is not safe here because sibling directories such as\n // `/apps/my-app-tools` also start with `/apps/my-app`. A relative path only\n // represents in-app content when it stays within `root`.\n const isInApp =\n !relativeToRoot.startsWith('..') && !relativeToRoot.startsWith('/');\n\n // Both branches prepend `/` so generated keys are always absolute-\n // looking (`/src/content/...` for in-app, `/libs/shared/...` for\n // workspace-external). Downstream consumers like content-files-token\n // rely on the leading `/` for slug extraction regexes.\n return isInApp\n ? `/${relativeToRoot}`\n : `/${vite.normalizePath(relative(workspaceRoot, absolutePath))}`;\n };\n\n const contentDiscoveryPlugins: vite.Plugin[] = [\n {\n name: 'analog-content-glob-routes',\n config(_config) {\n config = _config;\n root = vite.normalizePath(\n resolve(workspaceRoot, config.root || '.') || '.',\n );\n initContentRootDirs();\n },\n // Vite 8 / Rolldown \"filtered transform\" — the `filter.code` string\n // tells the bundler to skip this handler entirely for modules whose\n // source does not contain the substring, avoiding unnecessary JS→Rust\n // round-trips. The inner `code.includes()` guard is kept for Vite 7\n // compat where filters are not evaluated by the bundler.\n transform: {\n filter: {\n code: 'ANALOG_CONTENT_FILE_LIST',\n },\n handler(code) {\n if (code.includes('ANALOG_CONTENT_FILE_LIST')) {\n const contentFilesList = discoverContentFilesList();\n\n const eagerImports: string[] = [];\n\n contentFilesList.forEach((module, index) => {\n // CRITICAL: tinyglobby returns relative paths like \"apps/blog-app/src/content/file.md\"\n // These MUST be converted to absolute paths for ES module imports\n // Otherwise Node.js treats \"apps\" as a package name and throws \"Cannot find package 'apps'\"\n const absolutePath = resolveContentModulePath(module);\n eagerImports.push(\n `import { default as analog_module_${index} } from \"${absolutePath}?analog-content-list=true\";`,\n );\n });\n\n // Match just the assignment (not the declaration) so the rewrite\n // works whether the source uses `const`, `let`, `var`, or\n // `export const` — including the post-Rolldown `var X = {};`\n // form — without destroying the declaration that keeps the\n // module binding exported.\n let result = code.replace(\n /ANALOG_CONTENT_FILE_LIST\\s*=\\s*\\{\\s*\\}/,\n `ANALOG_CONTENT_FILE_LIST = {${contentFilesList.map(\n (module, index) =>\n `\"${getContentModuleKey(module)}\": analog_module_${index}`,\n )}}`,\n );\n\n if (!code.includes('analog_module_')) {\n result = `${eagerImports.join('\\n')}\\n${result}`;\n }\n\n return {\n code: result,\n map: { mappings: '' },\n };\n }\n\n return;\n },\n },\n },\n {\n name: 'analogjs-invalidate-content-dirs',\n configureServer(server) {\n function invalidateContent(path: string) {\n const normalizedPath = vite.normalizePath(path);\n const isContentPath = contentRootDirs.some(\n (dir) =>\n normalizedPath === dir || normalizedPath.startsWith(`${dir}/`),\n );\n\n if (isContentPath) {\n // The file set only changes on add/remove because this watcher is\n // intentionally scoped to those events. Clear the list cache so the\n // next transform sees the updated directory contents.\n contentFilesListCache = undefined;\n server.moduleGraph.fileToModulesMap.forEach((mods) => {\n mods.forEach((mod) => {\n if (\n mod.id?.includes('analogjs') &&\n mod.id?.includes('content')\n ) {\n server.moduleGraph.invalidateModule(mod);\n\n mod.importers.forEach((imp) => {\n server.moduleGraph.invalidateModule(imp);\n });\n }\n });\n });\n\n server.ws.send('analog:debug-full-reload', {\n plugin: 'platform:content-plugin',\n reason: 'content-file-set-changed',\n path: normalizedPath,\n });\n server.ws.send({\n type: 'full-reload',\n });\n }\n }\n\n server.watcher.on('add', invalidateContent);\n server.watcher.on('unlink', invalidateContent);\n },\n },\n ];\n\n if (!highlighter) {\n return [\n {\n name: 'analogjs-external-content',\n config() {\n const bundleOptionsKey = getBundleOptionsKey();\n return {\n build: {\n [bundleOptionsKey]: {\n external: ['@analogjs/content'],\n },\n },\n };\n },\n },\n {\n name: 'analogjs-exclude-content-import',\n transform: {\n filter: {\n code: '@analogjs/content',\n },\n handler(code) {\n /**\n * Remove the package so it doesn't get\n * referenced when building for serverless\n * functions.\n */\n if (code.includes(`import('@analogjs/content')`)) {\n return {\n code: code.replace(\n `import('@analogjs/content')`,\n 'Promise.resolve({})',\n ),\n };\n }\n\n return;\n },\n },\n },\n ...contentDiscoveryPlugins,\n ];\n }\n\n return [\n {\n name: 'analogjs-content-frontmatter',\n // Filter by module ID so only `?analog-content-list=true` virtual\n // imports enter the handler. Returns `moduleSideEffects: false` so\n // Rolldown can tree-shake unused content list entries.\n transform: {\n filter: {\n id: /analog-content-list=true/,\n },\n async handler(code, id) {\n const cachedContent = cache.get(id);\n // There's no reason to run `readFileSync` and frontmatter parsing if the\n // `transform` hook is called with the same code. In such cases, we can simply\n // return the cached attributes, which is faster than repeatedly reading files\n // synchronously during the build process.\n if (cachedContent?.code === code) {\n return {\n code: `export default ${cachedContent.attributes}`,\n moduleSideEffects: false,\n };\n }\n\n const fm: any = await import('front-matter');\n // The `default` property will be available in CommonJS environment, for instance,\n // when running unit tests. It's safe to retrieve `default` first, since we still\n // fallback to the original implementation.\n const frontmatter = fm.default || fm;\n const fileContents = readFileSync(id.split('?')[0], 'utf8');\n const { attributes } = frontmatter(fileContents);\n const content = {\n code,\n attributes: JSON.stringify(attributes),\n };\n cache.set(id, content);\n\n return {\n code: `export default ${content.attributes}`,\n moduleSideEffects: false,\n };\n },\n },\n },\n {\n name: 'analogjs-content-file',\n enforce: 'post',\n async load(id) {\n if (!id.includes('analog-content-file=true')) {\n return;\n }\n\n if (!markedHighlighter) {\n if (highlighter === 'shiki') {\n const { getShikiHighlighter } =\n await import('./content/shiki/index.js');\n markedHighlighter = getShikiHighlighter(shikiOptions);\n } else {\n const { getPrismHighlighter } =\n await import('./content/prism/index.js');\n markedHighlighter = getPrismHighlighter();\n\n const langs = [\n 'bash',\n 'css',\n 'javascript',\n 'json',\n 'markup',\n 'typescript',\n ];\n\n if (\n Array.isArray(prismOptions?.additionalLangs) &&\n prismOptions?.additionalLangs?.length > 0\n ) {\n langs.push(...prismOptions.additionalLangs);\n }\n\n const loadLanguages = await import('prismjs/components/index.js');\n\n (\n loadLanguages as unknown as { default: (...args: any[]) => any }\n ).default(langs);\n }\n }\n\n const fm: any = await import('front-matter');\n // The `default` property will be available in CommonJS environment, for instance,\n // when running unit tests. It's safe to retrieve `default` first, since we still\n // fallback to the original implementation.\n const frontmatterFn = fm.default || fm;\n const fileContents = readFileSync(id.split('?')[0], 'utf8');\n const { body, attributes } = frontmatterFn(fileContents);\n\n // parse markdown and highlight\n const { getMarkedSetup } = await import('./content/marked/index.js');\n const markedSetupService = getMarkedSetup(\n { mangle: true, ...(markedOptions || {}) },\n markedHighlighter,\n );\n const mdContent = (await markedSetupService\n .getMarkedInstance()\n .parse(body)) as unknown as string;\n\n return `export default ${JSON.stringify(mdContent)};\\nexport const metadata = ${toModuleValue(attributes)};`;\n },\n },\n ...contentDiscoveryPlugins,\n ];\n}\n"],"mappings":";;;;;;AAkBA,SAAS,cAAc,OAAwB;CAC7C,IAAI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;KAErB,OAAO;MACL,MAAM,kBAAkB,QAAQ;MAChC,mBAAmB;KACrB;IACF;GACF;EACF;EACA;GACE,MAAM;GACN,SAAS;GACT,MAAM,KAAK,IAAI;IACb,IAAI,CAAC,GAAG,SAAS,0BAA0B,GACzC;IAGF,IAAI,CAAC,mBAAmB;KACtB,IAAI,gBAAgB,SAAS;MAC3B,MAAM,EAAE,wBACN,MAAM,OAAO;MACf,oBAAoB,oBAAoB,YAAY;KACtD,OAAO;MACL,MAAM,EAAE,wBACN,MAAM,OAAO;MACf,oBAAoB,oBAAoB;MAExC,MAAM,QAAQ;OACZ;OACA;OACA;OACA;OACA;OACA;MACF;MAEA,IACE,MAAM,QAAQ,cAAc,eAAe,KAC3C,cAAc,iBAAiB,SAAS,GAExC,MAAM,KAAK,GAAG,aAAa,eAAe;MAK5C,CAAA,MAF4B,OAAO,+BAAA,CAIjC,QAAQ,KAAK;KACjB;IACF;IAEA,MAAM,KAAU,MAAM,OAAO;IAM7B,MAAM,EAAE,MAAM,gBAFQ,GAAG,WAAW,GAAA,CACf,aAAa,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,MACT,CAAY;IAGvD,MAAM,EAAE,mBAAmB,MAAM,OAAO;IAKxC,MAAM,YAAa,MAJQ,eACzB;KAAE,QAAQ;KAAM,GAAI,iBAAiB,CAAC;IAAG,GACzC,iBAEuB,CAAA,CACtB,kBAAkB,CAAC,CACnB,MAAM,IAAI;IAEb,OAAO,kBAAkB,KAAK,UAAU,SAAS,EAAE,6BAA6B,cAAc,UAAU,EAAE;GAC5G;EACF;EACA,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"content-plugin.js","names":[],"sources":["../../../src/lib/content-plugin.ts"],"sourcesContent":["import * as vite from 'vite';\nimport { readFileSync } from 'node:fs';\nimport { relative, resolve } from 'node:path';\nimport { globSync } from 'tinyglobby';\n\nimport type { WithShikiHighlighterOptions } from './content/shiki/options.js';\nimport type { MarkedContentHighlighter } from './content/marked/marked-content-highlighter.js';\nimport type { WithPrismHighlighterOptions } from './content/prism/options.js';\nimport type { WithMarkedOptions } from './content/marked/index.js';\nimport type { Options } from './options.js';\nimport { getBundleOptionsKey } from './utils/rolldown.js';\n\ninterface Content {\n code: string;\n attributes: string;\n}\n\n// Serializes parsed frontmatter as a JS expression, keeping YAML timestamps as Dates.\nfunction toModuleValue(value: unknown): string {\n if (value instanceof Date) {\n return `new Date(${JSON.stringify(value.toISOString())})`;\n }\n if (Array.isArray(value)) {\n return `[${value.map(toModuleValue).join(',')}]`;\n }\n if (value && typeof value === 'object') {\n return `{${Object.entries(value)\n .map(([key, entry]) => `${JSON.stringify(key)}:${toModuleValue(entry)}`)\n .join(',')}}`;\n }\n return JSON.stringify(value) ?? 'undefined';\n}\n\nexport type ContentPluginOptions = {\n highlighter?: 'shiki' | 'prism';\n markedOptions?: WithMarkedOptions;\n shikiOptions?: WithShikiHighlighterOptions;\n prismOptions?: WithPrismHighlighterOptions;\n};\n\n/**\n * Content plugin that provides markdown and content file processing for Analog.\n *\n * IMPORTANT: This plugin uses tinyglobby for file discovery.\n * Key pitfall with { dot: true }:\n * - Returns relative paths from cwd (e.g., \"apps/blog-app/src/content/...\")\n * - These paths CANNOT be used directly in ES module imports\n * - Relative paths without ./ or ../ are treated as package names\n * - Must convert to absolute paths for imports to work correctly\n */\nexport function contentPlugin(\n {\n highlighter,\n markedOptions,\n shikiOptions,\n prismOptions,\n }: ContentPluginOptions = {},\n options?: Options,\n): vite.Plugin[] {\n const cache = new Map<string, Content>();\n // The content list placeholder can be transformed several times during serve.\n // Caching the discovered markdown paths keeps those repeat passes cheap.\n let contentFilesListCache: string[] | undefined;\n\n let markedHighlighter: MarkedContentHighlighter;\n const workspaceRoot = vite.normalizePath(\n options?.workspaceRoot ?? process.env['NX_WORKSPACE_ROOT'] ?? process.cwd(),\n );\n let config: vite.UserConfig;\n let root: string;\n // Keep discovery and invalidation aligned by deriving both from the same\n // normalized content roots. That way external content dirs participate in\n // cache busting exactly the same way they participate in glob discovery.\n // Initialized once in the `config` hook after `root` is resolved — all\n // inputs (`root`, `workspaceRoot`, `options`) are stable after that point.\n let contentRootDirs: string[];\n const normalizeContentDir = (dir: string) => {\n const normalized = vite.normalizePath(\n dir.startsWith('/')\n ? `${workspaceRoot}${dir}`\n : resolve(workspaceRoot, dir),\n );\n return normalized.endsWith('/') ? normalized.slice(0, -1) : normalized;\n };\n const initContentRootDirs = () => {\n contentRootDirs = [\n vite.normalizePath(`${root}/src/content`),\n ...(options?.additionalContentDirs || []).map(normalizeContentDir),\n ];\n };\n const discoverContentFilesList = () => {\n contentFilesListCache ??= globSync(\n contentRootDirs.map((dir) => `${dir}/**/*.md`),\n { dot: true, cwd: workspaceRoot },\n );\n\n return contentFilesListCache;\n };\n const resolveContentModulePath = (module: string) =>\n vite.normalizePath(\n module.startsWith('/') ? module : `${workspaceRoot}/${module}`,\n );\n const getContentModuleKey = (module: string) => {\n const absolutePath = resolveContentModulePath(module);\n const relativeToRoot = vite.normalizePath(relative(root, absolutePath));\n // `startsWith(root)` is not safe here because sibling directories such as\n // `/apps/my-app-tools` also start with `/apps/my-app`. A relative path only\n // represents in-app content when it stays within `root`.\n const isInApp =\n !relativeToRoot.startsWith('..') && !relativeToRoot.startsWith('/');\n\n // Both branches prepend `/` so generated keys are always absolute-\n // looking (`/src/content/...` for in-app, `/libs/shared/...` for\n // workspace-external). Downstream consumers like content-files-token\n // rely on the leading `/` for slug extraction regexes.\n return isInApp\n ? `/${relativeToRoot}`\n : `/${vite.normalizePath(relative(workspaceRoot, absolutePath))}`;\n };\n\n const contentDiscoveryPlugins: vite.Plugin[] = [\n {\n name: 'analog-content-glob-routes',\n config(_config) {\n config = _config;\n root = vite.normalizePath(\n resolve(workspaceRoot, config.root || '.') || '.',\n );\n initContentRootDirs();\n },\n // Vite 8 / Rolldown \"filtered transform\" — the `filter.code` string\n // tells the bundler to skip this handler entirely for modules whose\n // source does not contain the substring, avoiding unnecessary JS→Rust\n // round-trips. The inner `code.includes()` guard is kept for Vite 7\n // compat where filters are not evaluated by the bundler.\n transform: {\n filter: {\n code: 'ANALOG_CONTENT_FILE_LIST',\n },\n handler(code) {\n if (code.includes('ANALOG_CONTENT_FILE_LIST')) {\n const contentFilesList = discoverContentFilesList();\n\n const eagerImports: string[] = [];\n\n contentFilesList.forEach((module, index) => {\n // CRITICAL: tinyglobby returns relative paths like \"apps/blog-app/src/content/file.md\"\n // These MUST be converted to absolute paths for ES module imports\n // Otherwise Node.js treats \"apps\" as a package name and throws \"Cannot find package 'apps'\"\n const absolutePath = resolveContentModulePath(module);\n eagerImports.push(\n `import { default as analog_module_${index} } from \"${absolutePath}?analog-content-list=true\";`,\n );\n });\n\n // Match just the assignment (not the declaration) so the rewrite\n // works whether the source uses `const`, `let`, `var`, or\n // `export const` — including the post-Rolldown `var X = {};`\n // form — without destroying the declaration that keeps the\n // module binding exported.\n let result = code.replace(\n /ANALOG_CONTENT_FILE_LIST\\s*=\\s*\\{\\s*\\}/,\n `ANALOG_CONTENT_FILE_LIST = {${contentFilesList.map(\n (module, index) =>\n `\"${getContentModuleKey(module)}\": analog_module_${index}`,\n )}}`,\n );\n\n if (!code.includes('analog_module_')) {\n result = `${eagerImports.join('\\n')}\\n${result}`;\n }\n\n return {\n code: result,\n map: { mappings: '' },\n };\n }\n\n return;\n },\n },\n },\n {\n name: 'analogjs-invalidate-content-dirs',\n configureServer(server) {\n function invalidateContent(path: string) {\n const normalizedPath = vite.normalizePath(path);\n const isContentPath = contentRootDirs.some(\n (dir) =>\n normalizedPath === dir || normalizedPath.startsWith(`${dir}/`),\n );\n\n if (isContentPath) {\n // The file set only changes on add/remove because this watcher is\n // intentionally scoped to those events. Clear the list cache so the\n // next transform sees the updated directory contents.\n contentFilesListCache = undefined;\n server.moduleGraph.fileToModulesMap.forEach((mods) => {\n mods.forEach((mod) => {\n if (\n mod.id?.includes('analogjs') &&\n mod.id?.includes('content')\n ) {\n server.moduleGraph.invalidateModule(mod);\n\n mod.importers.forEach((imp) => {\n server.moduleGraph.invalidateModule(imp);\n });\n }\n });\n });\n\n server.ws.send('analog:debug-full-reload', {\n plugin: 'platform:content-plugin',\n reason: 'content-file-set-changed',\n path: normalizedPath,\n });\n server.ws.send({\n type: 'full-reload',\n });\n }\n }\n\n server.watcher.on('add', invalidateContent);\n server.watcher.on('unlink', invalidateContent);\n },\n },\n ];\n\n if (!highlighter) {\n return [\n {\n name: 'analogjs-external-content',\n config() {\n const bundleOptionsKey = getBundleOptionsKey();\n return {\n build: {\n [bundleOptionsKey]: {\n external: ['@analogjs/content'],\n },\n },\n };\n },\n },\n {\n name: 'analogjs-exclude-content-import',\n transform: {\n filter: {\n code: '@analogjs/content',\n },\n handler(code) {\n /**\n * Remove the package so it doesn't get\n * referenced when building for serverless\n * functions.\n */\n if (code.includes(`import('@analogjs/content')`)) {\n return {\n code: code.replace(\n `import('@analogjs/content')`,\n 'Promise.resolve({})',\n ),\n };\n }\n\n return;\n },\n },\n },\n ...contentDiscoveryPlugins,\n ];\n }\n\n return [\n {\n name: 'analogjs-content-frontmatter',\n // Filter by module ID so only `?analog-content-list=true` virtual\n // imports enter the handler. Returns `moduleSideEffects: false` so\n // Rolldown can tree-shake unused content list entries.\n transform: {\n filter: {\n id: /analog-content-list=true/,\n },\n async handler(code, id) {\n const cachedContent = cache.get(id);\n // There's no reason to run `readFileSync` and frontmatter parsing if the\n // `transform` hook is called with the same code. In such cases, we can simply\n // return the cached attributes, which is faster than repeatedly reading files\n // synchronously during the build process.\n if (cachedContent?.code === code) {\n return {\n code: `export default ${cachedContent.attributes}`,\n moduleSideEffects: false,\n };\n }\n\n const fm: any = await import('front-matter');\n // The `default` property will be available in CommonJS environment, for instance,\n // when running unit tests. It's safe to retrieve `default` first, since we still\n // fallback to the original implementation.\n const frontmatter = fm.default || fm;\n const fileContents = readFileSync(id.split('?')[0], 'utf8');\n const { attributes } = frontmatter(fileContents);\n const content = {\n code,\n attributes: JSON.stringify(attributes),\n };\n cache.set(id, content);\n\n return {\n code: `export default ${content.attributes}`,\n moduleSideEffects: false,\n };\n },\n },\n },\n {\n name: 'analogjs-content-file',\n enforce: 'post',\n async load(id) {\n if (!id.includes('analog-content-file=true')) {\n return;\n }\n\n if (!markedHighlighter) {\n if (highlighter === 'shiki') {\n const { getShikiHighlighter } =\n await import('./content/shiki/index.js');\n markedHighlighter = getShikiHighlighter(shikiOptions);\n } else {\n const { getPrismHighlighter } =\n await import('./content/prism/index.js');\n markedHighlighter = getPrismHighlighter();\n\n const langs = [\n 'bash',\n 'css',\n 'javascript',\n 'json',\n 'markup',\n 'typescript',\n ];\n\n if (\n Array.isArray(prismOptions?.additionalLangs) &&\n prismOptions?.additionalLangs?.length > 0\n ) {\n langs.push(...prismOptions.additionalLangs);\n }\n\n const loadLanguages = await import('prismjs/components/index.js');\n\n (\n loadLanguages as unknown as { default: (...args: any[]) => any }\n ).default(langs);\n }\n }\n\n const fm: any = await import('front-matter');\n // The `default` property will be available in CommonJS environment, for instance,\n // when running unit tests. It's safe to retrieve `default` first, since we still\n // fallback to the original implementation.\n const frontmatterFn = fm.default || fm;\n const fileContents = readFileSync(id.split('?')[0], 'utf8');\n const { body, attributes } = frontmatterFn(fileContents);\n\n // parse markdown and highlight\n const { getMarkedSetup } = await import('./content/marked/index.js');\n const markedSetupService = getMarkedSetup(\n { mangle: true, ...(markedOptions || {}) },\n markedHighlighter,\n );\n const mdContent = (await markedSetupService\n .getMarkedInstance()\n .parse(body)) as unknown as string;\n\n return `export default ${JSON.stringify(mdContent)};\\nexport const metadata = ${toModuleValue(attributes)};`;\n },\n },\n ...contentDiscoveryPlugins,\n ];\n}\n"],"mappings":";;;;;;AAkBA,SAAS,cAAc,OAAwB;CAC7C,IAAI,iBAAiB,MACnB,OAAO,YAAY,KAAK,UAAU,MAAM,YAAY,CAAC,EAAE;CAEzD,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,IAAI,MAAM,IAAI,aAAa,CAAC,CAAC,KAAK,GAAG,EAAE;CAEhD,IAAI,SAAS,O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GF,IAAI,CAAC,mBAAmB;KACtB,IAAI,gBAAgB,SAAS;MAC3B,MAAM,EAAE,wBACN,MAAM,OAAO;MACf,oBAAoB,oBAAoB,YAAY;KACtD,OAAO;MACL,MAAM,EAAE,wBACN,MAAM,OAAO;MACf,oBAAoB,oBAAoB;MAExC,MAAM,QAAQ;OACZ;OACA;OACA;OACA;OACA;OACA;MACF;MAEA,IACE,MAAM,QAAQ,cAAc,eAAe,KAC3C,cAAc,iBAAiB,SAAS,GAExC,MAAM,KAAK,GAAG,aAAa,eAAe;MAK5C,CAAA,MAF4B,OAAO,+BAAA,CAIjC,QAAQ,KAAK;KACjB;IACF;IAEA,MAAM,KAAU,MAAM,OAAO;IAM7B,MAAM,EAAE,MAAM,gBAFQ,GAAG,WAAW,GAAA,CACf,aAAa,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,MACT,CAAY;IAGvD,MAAM,EAAE,mBAAmB,MAAM,OAAO;IAKxC,MAAM,YAAa,MAJQ,eACzB;KAAE,QAAQ;KAAM,GAAI,iBAAiB,CAAC;IAAG,GACzC,iBAEuB,CAAA,CACtB,kBAAkB,CAAC,CACnB,MAAM,IAAI;IAEb,OAAO,kBAAkB,KAAK,UAAU,SAAS,EAAE,6BAA6B,cAAc,UAAU,EAAE;GAC5G;EACF;EACA,GAAG;CACL;AACF"}
@@ -1,9 +1,10 @@
1
1
  import { convertNxGenerator } from "@nx/devkit";
2
+ import generator from "./generator";
2
3
  /**
3
4
  * Angular CLI schematic wrapper for the Analog application generator.
4
5
  * Referenced by `generators.json#schematics.application.factory` so that
5
6
  * `ng generate @analogjs/platform:application` resolves through the
6
7
  * Angular schematics engine (which uses named exports, not default).
7
8
  */
8
- export declare const applicationSchematic: ReturnType<typeof convertNxGenerator>;
9
+ export declare function applicationSchematic(options: Parameters<typeof generator>[1]): ReturnType<ReturnType<typeof convertNxGenerator>>;
9
10
  export default applicationSchematic;
@@ -3,6 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_src_generators_app_generator = require("./generator.js");
6
+ let _nx_devkit = require("@nx/devkit");
6
7
  //#region packages/nx-plugin/src/generators/app/compat.ts
7
8
  /**
8
9
  * Angular CLI schematic wrapper for the Analog application generator.
@@ -10,7 +11,9 @@ const require_src_generators_app_generator = require("./generator.js");
10
11
  * `ng generate @analogjs/platform:application` resolves through the
11
12
  * Angular schematics engine (which uses named exports, not default).
12
13
  */
13
- var applicationSchematic = (0, require("@nx/devkit").convertNxGenerator)(require_src_generators_app_generator);
14
+ function applicationSchematic(options) {
15
+ return (0, _nx_devkit.convertNxGenerator)(require_src_generators_app_generator)(options);
16
+ }
14
17
  //#endregion
15
18
  exports.applicationSchematic = applicationSchematic;
16
19
  exports.default = applicationSchematic;
@@ -1 +1 @@
1
- {"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/app/compat.ts"],"sourcesContent":["import { convertNxGenerator } from '@nx/devkit';\nimport generator from './generator';\n\n/**\n * Angular CLI schematic wrapper for the Analog application generator.\n * Referenced by `generators.json#schematics.application.factory` so that\n * `ng generate @analogjs/platform:application` resolves through the\n * Angular schematics engine (which uses named exports, not default).\n */\nexport const applicationSchematic: ReturnType<typeof convertNxGenerator> =\n convertNxGenerator(generator) as ReturnType<typeof convertNxGenerator>;\nexport default applicationSchematic;\n"],"mappings":";;;;;;;;;;;;AASA,IAAa,wBAAA,uBACX,CAAA,CAAA,mBAAA,CAAmB,oCAAS"}
1
+ {"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/app/compat.ts"],"sourcesContent":["import { convertNxGenerator } from '@nx/devkit';\nimport generator from './generator';\n\n/**\n * Angular CLI schematic wrapper for the Analog application generator.\n * Referenced by `generators.json#schematics.application.factory` so that\n * `ng generate @analogjs/platform:application` resolves through the\n * Angular schematics engine (which uses named exports, not default).\n */\nexport function applicationSchematic(\n options: Parameters<typeof generator>[1],\n): ReturnType<ReturnType<typeof convertNxGenerator>> {\n return convertNxGenerator(generator)(options);\n}\nexport default applicationSchematic;\n"],"mappings":";;;;;;;;;;;;;AASA,SAAgB,qBACd,SACmD;CACnD,QAAA,GAAO,WAAA,mBAAA,CAAmB,oCAAS,CAAC,CAAC,OAAO;AAC9C"}
@@ -1,9 +1,10 @@
1
1
  import { convertNxGenerator } from "@nx/devkit";
2
+ import setupAnalogGenerator from "./generator";
2
3
  /**
3
4
  * Angular CLI schematic wrapper for the Analog init/migrate generator.
4
5
  * Referenced by `generators.json#schematics.init.factory` so that
5
6
  * `ng generate @analogjs/platform:migrate` resolves through the
6
7
  * Angular schematics engine.
7
8
  */
8
- export declare const initSchematic: ReturnType<typeof convertNxGenerator>;
9
+ export declare function initSchematic(options: Parameters<typeof setupAnalogGenerator>[1]): ReturnType<ReturnType<typeof convertNxGenerator>>;
9
10
  export default initSchematic;
@@ -3,6 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_src_generators_init_generator = require("./generator.js");
6
+ let _nx_devkit = require("@nx/devkit");
6
7
  //#region packages/nx-plugin/src/generators/init/compat.ts
7
8
  /**
8
9
  * Angular CLI schematic wrapper for the Analog init/migrate generator.
@@ -10,7 +11,9 @@ const require_src_generators_init_generator = require("./generator.js");
10
11
  * `ng generate @analogjs/platform:migrate` resolves through the
11
12
  * Angular schematics engine.
12
13
  */
13
- var initSchematic = (0, require("@nx/devkit").convertNxGenerator)(require_src_generators_init_generator);
14
+ function initSchematic(options) {
15
+ return (0, _nx_devkit.convertNxGenerator)(require_src_generators_init_generator)(options);
16
+ }
14
17
  //#endregion
15
18
  exports.default = initSchematic;
16
19
  exports.initSchematic = initSchematic;
@@ -1 +1 @@
1
- {"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/init/compat.ts"],"sourcesContent":["import { convertNxGenerator } from '@nx/devkit';\n\nimport setupAnalogGenerator from './generator';\n\n/**\n * Angular CLI schematic wrapper for the Analog init/migrate generator.\n * Referenced by `generators.json#schematics.init.factory` so that\n * `ng generate @analogjs/platform:migrate` resolves through the\n * Angular schematics engine.\n */\nexport const initSchematic: ReturnType<typeof convertNxGenerator> =\n convertNxGenerator(setupAnalogGenerator) as ReturnType<\n typeof convertNxGenerator\n >;\nexport default initSchematic;\n"],"mappings":";;;;;;;;;;;;AAUA,IAAa,iBAAA,uBACX,CAAA,CAAA,mBAAA,CAAmB,qCAAoB"}
1
+ {"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/init/compat.ts"],"sourcesContent":["import { convertNxGenerator } from '@nx/devkit';\n\nimport setupAnalogGenerator from './generator';\n\n/**\n * Angular CLI schematic wrapper for the Analog init/migrate generator.\n * Referenced by `generators.json#schematics.init.factory` so that\n * `ng generate @analogjs/platform:migrate` resolves through the\n * Angular schematics engine.\n */\nexport function initSchematic(\n options: Parameters<typeof setupAnalogGenerator>[1],\n): ReturnType<ReturnType<typeof convertNxGenerator>> {\n return convertNxGenerator(setupAnalogGenerator)(options);\n}\nexport default initSchematic;\n"],"mappings":";;;;;;;;;;;;;AAUA,SAAgB,cACd,SACmD;CACnD,QAAA,GAAO,WAAA,mBAAA,CAAmB,qCAAoB,CAAC,CAAC,OAAO;AACzD"}
@@ -1,9 +1,10 @@
1
1
  import { convertNxGenerator } from "@nx/devkit";
2
+ import analogPageGenerator from "./generator";
2
3
  /**
3
4
  * Angular CLI schematic wrapper for the Analog page generator.
4
5
  * Referenced by `generators.json#schematics.page.factory` so that
5
6
  * `ng generate @analogjs/platform:page` resolves through the
6
7
  * Angular schematics engine.
7
8
  */
8
- export declare const pageSchematic: ReturnType<typeof convertNxGenerator>;
9
+ export declare function pageSchematic(options: Parameters<typeof analogPageGenerator>[1]): ReturnType<ReturnType<typeof convertNxGenerator>>;
9
10
  export default pageSchematic;
@@ -3,6 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_src_generators_page_generator = require("./generator.js");
6
+ let _nx_devkit = require("@nx/devkit");
6
7
  //#region packages/nx-plugin/src/generators/page/compat.ts
7
8
  /**
8
9
  * Angular CLI schematic wrapper for the Analog page generator.
@@ -10,7 +11,9 @@ const require_src_generators_page_generator = require("./generator.js");
10
11
  * `ng generate @analogjs/platform:page` resolves through the
11
12
  * Angular schematics engine.
12
13
  */
13
- var pageSchematic = (0, require("@nx/devkit").convertNxGenerator)(require_src_generators_page_generator);
14
+ function pageSchematic(options) {
15
+ return (0, _nx_devkit.convertNxGenerator)(require_src_generators_page_generator)(options);
16
+ }
14
17
  //#endregion
15
18
  exports.default = pageSchematic;
16
19
  exports.pageSchematic = pageSchematic;
@@ -1 +1 @@
1
- {"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/page/compat.ts"],"sourcesContent":["import { convertNxGenerator } from '@nx/devkit';\n\nimport analogPageGenerator from './generator';\n\n/**\n * Angular CLI schematic wrapper for the Analog page generator.\n * Referenced by `generators.json#schematics.page.factory` so that\n * `ng generate @analogjs/platform:page` resolves through the\n * Angular schematics engine.\n */\nexport const pageSchematic: ReturnType<typeof convertNxGenerator> =\n convertNxGenerator(analogPageGenerator) as ReturnType<\n typeof convertNxGenerator\n >;\nexport default pageSchematic;\n"],"mappings":";;;;;;;;;;;;AAUA,IAAa,iBAAA,uBACX,CAAA,CAAA,mBAAA,CAAmB,qCAAmB"}
1
+ {"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/page/compat.ts"],"sourcesContent":["import { convertNxGenerator } from '@nx/devkit';\n\nimport analogPageGenerator from './generator';\n\n/**\n * Angular CLI schematic wrapper for the Analog page generator.\n * Referenced by `generators.json#schematics.page.factory` so that\n * `ng generate @analogjs/platform:page` resolves through the\n * Angular schematics engine.\n */\nexport function pageSchematic(\n options: Parameters<typeof analogPageGenerator>[1],\n): ReturnType<ReturnType<typeof convertNxGenerator>> {\n return convertNxGenerator(analogPageGenerator)(options);\n}\nexport default pageSchematic;\n"],"mappings":";;;;;;;;;;;;;AAUA,SAAgB,cACd,SACmD;CACnD,QAAA,GAAO,WAAA,mBAAA,CAAmB,qCAAmB,CAAC,CAAC,OAAO;AACxD"}
@@ -68,6 +68,10 @@ exports[`preset generator > should match project.json 1`] = `
68
68
  },
69
69
  "serve-static": {
70
70
  "continuous": true,
71
+ "readyWhen": {
72
+ "signal": true
73
+ },
74
+ "dependsOn": ["build"],
71
75
  "executor": "@nx/web:file-server",
72
76
  "options": {
73
77
  "buildTarget": "my-app:build",
@@ -1,13 +1,13 @@
1
- export declare const ANALOG_JS_ROUTER = "^3.0.0-beta.10";
2
- export declare const ANALOG_JS_CONTENT = "^3.0.0-beta.10";
1
+ export declare const ANALOG_JS_ROUTER = "^3.0.0-beta.11";
2
+ export declare const ANALOG_JS_CONTENT = "^3.0.0-beta.11";
3
3
  export declare const MARKED = "^18.0.0";
4
4
  export declare const MARKED_GFM_HEADING_ID = "^4.1.1";
5
5
  export declare const MARKED_HIGHLIGHT = "^2.2.1";
6
6
  export declare const MARKED_MANGLE = "^1.1.10";
7
7
  export declare const PRISMJS = "^1.29.0";
8
- export declare const ANALOG_JS_PLATFORM = "^3.0.0-beta.10";
9
- export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-beta.10";
10
- export declare const ANALOG_JS_VITEST_ANGULAR = "^3.0.0-beta.10";
8
+ export declare const ANALOG_JS_PLATFORM = "^3.0.0-beta.11";
9
+ export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-beta.11";
10
+ export declare const ANALOG_JS_VITEST_ANGULAR = "^3.0.0-beta.11";
11
11
  export declare const JSDOM = "^22.0.0";
12
12
  export declare const VITE_TSCONFIG_PATHS = "^4.2.0";
13
13
  export declare const VITE = "^8.0.0";
@@ -1,14 +1,14 @@
1
1
  //#region packages/nx-plugin/src/utils/versions/versions.ts
2
- var ANALOG_JS_ROUTER = "^3.0.0-beta.10";
3
- var ANALOG_JS_CONTENT = "^3.0.0-beta.10";
2
+ var ANALOG_JS_ROUTER = "^3.0.0-beta.11";
3
+ var ANALOG_JS_CONTENT = "^3.0.0-beta.11";
4
4
  var MARKED = "^18.0.0";
5
5
  var MARKED_GFM_HEADING_ID = "^4.1.1";
6
6
  var MARKED_HIGHLIGHT = "^2.2.1";
7
7
  var MARKED_MANGLE = "^1.1.10";
8
8
  var PRISMJS = "^1.29.0";
9
- var ANALOG_JS_PLATFORM = "^3.0.0-beta.10";
10
- var ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-beta.10";
11
- var ANALOG_JS_VITEST_ANGULAR = "^3.0.0-beta.10";
9
+ var ANALOG_JS_PLATFORM = "^3.0.0-beta.11";
10
+ var ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-beta.11";
11
+ var ANALOG_JS_VITEST_ANGULAR = "^3.0.0-beta.11";
12
12
  var JSDOM = "^22.0.0";
13
13
  var VITE_TSCONFIG_PATHS = "^4.2.0";
14
14
  var VITE = "^8.0.0";
@@ -1 +1 @@
1
- {"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../../nx-plugin/src/utils/versions/versions.ts"],"sourcesContent":["// dependencies\nexport const ANALOG_JS_ROUTER = '^3.0.0-beta.10';\nexport const ANALOG_JS_CONTENT = '^3.0.0-beta.10';\nexport const MARKED = '^18.0.0';\nexport const MARKED_GFM_HEADING_ID = '^4.1.1';\nexport const MARKED_HIGHLIGHT = '^2.2.1';\nexport const MARKED_MANGLE = '^1.1.10';\nexport const PRISMJS = '^1.29.0';\n\n// devDependencies\nexport const ANALOG_JS_PLATFORM = '^3.0.0-beta.10';\nexport const ANALOG_JS_VITE_PLUGIN_ANGULAR = '^3.0.0-beta.10';\nexport const ANALOG_JS_VITEST_ANGULAR = '^3.0.0-beta.10';\nexport const JSDOM = '^22.0.0';\nexport const VITE_TSCONFIG_PATHS = '^4.2.0';\nexport const VITE = '^8.0.0';\nexport const VITEST = '^5.0.0';\nexport const NX = '^23.2.0';\n"],"mappings":";AACA,IAAa,mBAAmB;AAChC,IAAa,oBAAoB;AACjC,IAAa,SAAS;AACtB,IAAa,wBAAwB;AACrC,IAAa,mBAAmB;AAChC,IAAa,gBAAgB;AAC7B,IAAa,UAAU;AAGvB,IAAa,qBAAqB;AAClC,IAAa,gCAAgC;AAC7C,IAAa,2BAA2B;AACxC,IAAa,QAAQ;AACrB,IAAa,sBAAsB;AACnC,IAAa,OAAO;AACpB,IAAa,SAAS;AACtB,IAAa,KAAK"}
1
+ {"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../../nx-plugin/src/utils/versions/versions.ts"],"sourcesContent":["// dependencies\nexport const ANALOG_JS_ROUTER = '^3.0.0-beta.11';\nexport const ANALOG_JS_CONTENT = '^3.0.0-beta.11';\nexport const MARKED = '^18.0.0';\nexport const MARKED_GFM_HEADING_ID = '^4.1.1';\nexport const MARKED_HIGHLIGHT = '^2.2.1';\nexport const MARKED_MANGLE = '^1.1.10';\nexport const PRISMJS = '^1.29.0';\n\n// devDependencies\nexport const ANALOG_JS_PLATFORM = '^3.0.0-beta.11';\nexport const ANALOG_JS_VITE_PLUGIN_ANGULAR = '^3.0.0-beta.11';\nexport const ANALOG_JS_VITEST_ANGULAR = '^3.0.0-beta.11';\nexport const JSDOM = '^22.0.0';\nexport const VITE_TSCONFIG_PATHS = '^4.2.0';\nexport const VITE = '^8.0.0';\nexport const VITEST = '^5.0.0';\nexport const NX = '^23.2.0';\n"],"mappings":";AACA,IAAa,mBAAmB;AAChC,IAAa,oBAAoB;AACjC,IAAa,SAAS;AACtB,IAAa,wBAAwB;AACrC,IAAa,mBAAmB;AAChC,IAAa,gBAAgB;AAC7B,IAAa,UAAU;AAGvB,IAAa,qBAAqB;AAClC,IAAa,gCAAgC;AAC7C,IAAa,2BAA2B;AACxC,IAAa,QAAQ;AACrB,IAAa,sBAAsB;AACnC,IAAa,OAAO;AACpB,IAAa,SAAS;AACtB,IAAa,KAAK"}