@apimatic/cli 2.0.0-beta.2 → 2.0.0-beta.4

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.
Files changed (109) hide show
  1. package/README.md +22 -9
  2. package/lib/actions/plugin/generate.d.ts +0 -2
  3. package/lib/actions/plugin/generate.js +5 -8
  4. package/lib/actions/plugin/generate.js.map +1 -1
  5. package/lib/actions/plugin/record-metadata.js +1 -1
  6. package/lib/actions/plugin/record-metadata.js.map +1 -1
  7. package/lib/actions/portal/serve.js +4 -3
  8. package/lib/actions/portal/serve.js.map +1 -1
  9. package/lib/actions/sdk/generate.js +16 -3
  10. package/lib/actions/sdk/generate.js.map +1 -1
  11. package/lib/actions/sdk/publish.js +6 -2
  12. package/lib/actions/sdk/publish.js.map +1 -1
  13. package/lib/commands/quickstart.d.ts +1 -1
  14. package/lib/commands/quickstart.js +1 -1
  15. package/lib/commands/quickstart.js.map +1 -1
  16. package/lib/commands/sdk/generate.d.ts +1 -1
  17. package/lib/commands/sdk/generate.js +4 -2
  18. package/lib/commands/sdk/generate.js.map +1 -1
  19. package/lib/infrastructure/service-error.js +15 -15
  20. package/lib/infrastructure/service-error.js.map +1 -1
  21. package/lib/infrastructure/services/portal-artifacts-service.js +6 -5
  22. package/lib/infrastructure/services/portal-artifacts-service.js.map +1 -1
  23. package/lib/infrastructure/zip-service.d.ts +6 -2
  24. package/lib/infrastructure/zip-service.js +42 -24
  25. package/lib/infrastructure/zip-service.js.map +1 -1
  26. package/lib/prompts/plugin/generate.d.ts +3 -3
  27. package/lib/prompts/plugin/generate.js +19 -11
  28. package/lib/prompts/plugin/generate.js.map +1 -1
  29. package/lib/prompts/plugin/record-metadata.d.ts +1 -1
  30. package/lib/prompts/plugin/record-metadata.js +2 -2
  31. package/lib/prompts/portal/serve.js +1 -1
  32. package/lib/prompts/portal/serve.js.map +1 -1
  33. package/lib/prompts/portal/source.d.ts +4 -2
  34. package/lib/prompts/portal/source.js +42 -8
  35. package/lib/prompts/portal/source.js.map +1 -1
  36. package/lib/prompts/publishing/links.d.ts +1 -1
  37. package/lib/prompts/publishing/links.js +1 -1
  38. package/lib/prompts/publishing/links.js.map +1 -1
  39. package/lib/prompts/quickstart.js +1 -2
  40. package/lib/prompts/quickstart.js.map +1 -1
  41. package/lib/prompts/sdk/generate.d.ts +5 -0
  42. package/lib/prompts/sdk/generate.js +10 -0
  43. package/lib/prompts/sdk/generate.js.map +1 -1
  44. package/lib/prompts/sdk/publish.d.ts +3 -0
  45. package/lib/prompts/sdk/publish.js +3 -0
  46. package/lib/prompts/sdk/publish.js.map +1 -1
  47. package/lib/types/apimatic-config-context.d.ts +1 -1
  48. package/lib/types/apimatic-config-context.js +1 -1
  49. package/lib/types/apimatic-config-context.js.map +1 -1
  50. package/lib/types/file/file-problem.d.ts +4 -0
  51. package/lib/types/file/file-problem.js +2 -0
  52. package/lib/types/file/file-problem.js.map +1 -0
  53. package/lib/types/plugin/generation-problem.d.ts +10 -0
  54. package/lib/types/plugin/generation-problem.js +2 -0
  55. package/lib/types/plugin/generation-problem.js.map +1 -0
  56. package/lib/types/plugin-config-context.js +2 -1
  57. package/lib/types/plugin-config-context.js.map +1 -1
  58. package/lib/types/plugin-context.d.ts +3 -1
  59. package/lib/types/plugin-context.js +2 -1
  60. package/lib/types/plugin-context.js.map +1 -1
  61. package/lib/types/portal/content-notices.d.ts +11 -3
  62. package/lib/types/portal/content-tree.d.ts +4 -2
  63. package/lib/types/portal/content-tree.js +42 -12
  64. package/lib/types/portal/content-tree.js.map +1 -1
  65. package/lib/types/portal/generated-pages.d.ts +6 -6
  66. package/lib/types/portal/generated-pages.js +3 -3
  67. package/lib/types/portal/generated-pages.js.map +1 -1
  68. package/lib/types/portal/portal-navigation.d.ts +83 -12
  69. package/lib/types/portal/portal-navigation.js +276 -100
  70. package/lib/types/portal/portal-navigation.js.map +1 -1
  71. package/lib/types/portal/preview-content.js +15 -2
  72. package/lib/types/portal/preview-content.js.map +1 -1
  73. package/lib/types/portal-context.d.ts +1 -0
  74. package/lib/types/portal-context.js +17 -12
  75. package/lib/types/portal-context.js.map +1 -1
  76. package/lib/types/portal-source-context.js +7 -4
  77. package/lib/types/portal-source-context.js.map +1 -1
  78. package/lib/types/project-context.d.ts +2 -1
  79. package/lib/types/project-context.js +2 -2
  80. package/lib/types/project-context.js.map +1 -1
  81. package/lib/types/sdk/generate.d.ts +1 -4
  82. package/lib/types/sdk/generate.js +6 -6
  83. package/lib/types/sdk/generate.js.map +1 -1
  84. package/lib/types/sdk-context.d.ts +7 -2
  85. package/lib/types/sdk-context.js +8 -6
  86. package/lib/types/sdk-context.js.map +1 -1
  87. package/lib/types/spec-context.d.ts +3 -1
  88. package/lib/types/spec-context.js +5 -4
  89. package/lib/types/spec-context.js.map +1 -1
  90. package/lib/types/temp-context.d.ts +5 -3
  91. package/lib/types/temp-context.js +7 -7
  92. package/lib/types/temp-context.js.map +1 -1
  93. package/oclif.manifest.json +166 -166
  94. package/package.json +8 -7
  95. package/portal-template/dependency-directories.ts +54 -0
  96. package/portal-template/src/components/api-page.tsx +2 -6
  97. package/portal-template/src/components/example-layout.tsx +7 -7
  98. package/portal-template/src/components/markdown-copy-button.tsx +60 -0
  99. package/portal-template/src/components/usage-tabs.tsx +16 -36
  100. package/portal-template/src/lib/copy-markdown.ts +12 -0
  101. package/portal-template/src/lib/media-adapters.ts +3 -3
  102. package/portal-template/src/lib/navigation-schema.ts +13 -0
  103. package/portal-template/src/lib/navigation.ts +60 -117
  104. package/portal-template/src/lib/request-examples.ts +12 -28
  105. package/portal-template/src/lib/source.ts +3 -2
  106. package/portal-template/src/lib/tabs.ts +3 -2
  107. package/portal-template/src/routes/$.tsx +4 -9
  108. package/portal-template/vite.config.ts +13 -0
  109. package/portal-template/src/components/code-block.tsx +0 -9
@@ -4,6 +4,7 @@ import { tanstackStart } from '@tanstack/react-start/plugin/vite';
4
4
  import { defineConfig } from 'vite';
5
5
  import tailwindcss from '@tailwindcss/vite';
6
6
  import { fumadocsMdx } from 'fumadocs-mdx/vite';
7
+ import { dependencyDirectories } from './dependency-directories.ts';
7
8
  import { downloads } from './downloads.ts';
8
9
  import { generatedPagesReload } from './generated-pages-reload.ts';
9
10
  import { readBuildPaths, readPortalIdentity } from './portal-config.ts';
@@ -14,6 +15,7 @@ export default defineConfig(async () => {
14
15
  const [paths, identity] = await Promise.all([readBuildPaths(), readPortalIdentity()]);
15
16
  const pages = await prerenderPages(paths, identity.siteUrl);
16
17
  const publicDir: string | false = paths.staticDir ?? false;
18
+ const projectDirectory = fileURLToPath(new URL('.', import.meta.url));
17
19
 
18
20
  return {
19
21
  publicDir,
@@ -55,6 +57,17 @@ export default defineConfig(async () => {
55
57
  // listens on `::1` alone, a connect that stalls under load falls back to 127.0.0.1 and is
56
58
  // refused, failing the build; binding IPv4 leaves the fetch a single address to reach.
57
59
  preview: { host: '127.0.0.1' },
60
+ // Spelled out because the default, the project alone, misses the CLI installation the
61
+ // dependencies are linked from, and the static directory pages import images from.
62
+ server: {
63
+ fs: {
64
+ allow: [
65
+ projectDirectory,
66
+ ...dependencyDirectories(projectDirectory),
67
+ ...(paths.staticDir === null ? [] : [paths.staticDir])
68
+ ]
69
+ }
70
+ },
58
71
  resolve: {
59
72
  tsconfigPaths: true,
60
73
  alias: [
@@ -1,9 +0,0 @@
1
- import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock.core';
2
- import { useRenderContext } from 'fumadocs-openapi/ui';
3
-
4
- // Fumadocs passes `JSON.stringify(example.value)`, which is undefined for an example with no `value`.
5
- export function CodeBlock({ lang, code }: Readonly<{ lang: string; code: string | undefined }>) {
6
- const { shiki, shikiOptions } = useRenderContext();
7
- if (code === undefined) return null;
8
- return <DynamicCodeBlock lang={lang} code={code} highlighter={() => shiki.getOrInit()} options={shikiOptions} />;
9
- }