@apimatic/cli 2.0.0-beta.4 → 2.0.0-beta.5
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/README.md +15 -64
- package/apimatic.schema.json +2 -2
- package/lib/actions/action-result.d.ts +4 -2
- package/lib/actions/action-result.js +8 -3
- package/lib/actions/action-result.js.map +1 -1
- package/lib/actions/api/transform.d.ts +7 -6
- package/lib/actions/api/transform.js +12 -13
- package/lib/actions/api/transform.js.map +1 -1
- package/lib/actions/api/validate.d.ts +4 -5
- package/lib/actions/api/validate.js +30 -32
- package/lib/actions/api/validate.js.map +1 -1
- package/lib/actions/portal/generate.js +3 -3
- package/lib/actions/portal/generate.js.map +1 -1
- package/lib/actions/quickstart.d.ts +1 -9
- package/lib/actions/quickstart.js +122 -102
- package/lib/actions/quickstart.js.map +1 -1
- package/lib/commands/api/transform.d.ts +1 -1
- package/lib/commands/api/transform.js +2 -2
- package/lib/commands/api/transform.js.map +1 -1
- package/lib/commands/api/validate.d.ts +3 -3
- package/lib/commands/api/validate.js +28 -17
- package/lib/commands/api/validate.js.map +1 -1
- package/lib/commands/plugin/generate.d.ts +1 -1
- package/lib/commands/portal/generate.d.ts +2 -2
- package/lib/commands/portal/generate.js +1 -1
- package/lib/commands/portal/generate.js.map +1 -1
- package/lib/commands/portal/serve.d.ts +2 -2
- package/lib/commands/portal/serve.js +1 -1
- package/lib/commands/sdk/generate.d.ts +1 -1
- package/lib/infrastructure/file-service.d.ts +3 -0
- package/lib/infrastructure/file-service.js +24 -0
- package/lib/infrastructure/file-service.js.map +1 -1
- package/lib/infrastructure/portal-dev-server-service.js +2 -1
- package/lib/infrastructure/portal-dev-server-service.js.map +1 -1
- package/lib/infrastructure/portal-project-service.d.ts +1 -0
- package/lib/infrastructure/portal-project-service.js +7 -3
- package/lib/infrastructure/portal-project-service.js.map +1 -1
- package/lib/infrastructure/services/file-download-service.d.ts +4 -4
- package/lib/infrastructure/services/file-download-service.js +14 -14
- package/lib/infrastructure/services/file-download-service.js.map +1 -1
- package/lib/prompts/api/transform.d.ts +0 -2
- package/lib/prompts/api/transform.js +0 -3
- package/lib/prompts/api/transform.js.map +1 -1
- package/lib/prompts/api/validate.d.ts +2 -2
- package/lib/prompts/api/validate.js +35 -3
- package/lib/prompts/api/validate.js.map +1 -1
- package/lib/prompts/format.d.ts +1 -1
- package/lib/prompts/format.js.map +1 -1
- package/lib/prompts/portal/generate.d.ts +2 -1
- package/lib/prompts/portal/generate.js +22 -6
- package/lib/prompts/portal/generate.js.map +1 -1
- package/lib/prompts/portal/prepare-project.js +5 -0
- package/lib/prompts/portal/prepare-project.js.map +1 -1
- package/lib/prompts/portal/serve.js +4 -3
- package/lib/prompts/portal/serve.js.map +1 -1
- package/lib/prompts/portal/source.d.ts +2 -5
- package/lib/prompts/portal/source.js +7 -17
- package/lib/prompts/portal/source.js.map +1 -1
- package/lib/prompts/quickstart.d.ts +14 -13
- package/lib/prompts/quickstart.js +43 -27
- package/lib/prompts/quickstart.js.map +1 -1
- package/lib/types/apimatic-config/document.d.ts +2 -0
- package/lib/types/apimatic-config/document.js +4 -0
- package/lib/types/apimatic-config/document.js.map +1 -1
- package/lib/types/file/resource-input.d.ts +7 -5
- package/lib/types/file/resource-input.js +16 -15
- package/lib/types/file/resource-input.js.map +1 -1
- package/lib/types/flags-provider.d.ts +6 -1
- package/lib/types/flags-provider.js +22 -12
- package/lib/types/flags-provider.js.map +1 -1
- package/lib/types/plugin-config-context.d.ts +3 -0
- package/lib/types/plugin-config-context.js +33 -12
- package/lib/types/plugin-config-context.js.map +1 -1
- package/lib/types/portal/config/site-address.d.ts +16 -0
- package/lib/types/portal/config/site-address.js +67 -0
- package/lib/types/portal/config/site-address.js.map +1 -0
- package/lib/types/portal/config/site-config.d.ts +3 -5
- package/lib/types/portal/config/site-config.js +10 -33
- package/lib/types/portal/config/site-config.js.map +1 -1
- package/lib/types/portal/config/static-asset.d.ts +2 -2
- package/lib/types/portal/config/static-asset.js +2 -2
- package/lib/types/portal/config/static-asset.js.map +1 -1
- package/lib/types/portal/content-tree.d.ts +11 -4
- package/lib/types/portal/content-tree.js +19 -4
- package/lib/types/portal/content-tree.js.map +1 -1
- package/lib/types/portal/page.js +16 -1
- package/lib/types/portal/page.js.map +1 -1
- package/lib/types/portal/portal-config.d.ts +6 -3
- package/lib/types/portal/portal-config.js +8 -4
- package/lib/types/portal/portal-config.js.map +1 -1
- package/lib/types/portal/portal-languages.d.ts +2 -0
- package/lib/types/portal/portal-languages.js +5 -1
- package/lib/types/portal/portal-languages.js.map +1 -1
- package/lib/types/portal/portal-source.d.ts +9 -3
- package/lib/types/portal-source-context.d.ts +7 -8
- package/lib/types/portal-source-context.js +51 -26
- package/lib/types/portal-source-context.js.map +1 -1
- package/lib/types/project-context.d.ts +18 -0
- package/lib/types/project-context.js +18 -1
- package/lib/types/project-context.js.map +1 -1
- package/lib/types/resource-context.d.ts +25 -10
- package/lib/types/resource-context.js +40 -23
- package/lib/types/resource-context.js.map +1 -1
- package/oclif.manifest.json +88 -70
- package/package.json +1 -1
- package/portal-template/dependency-directories.ts +31 -40
- package/portal-template/downloads.ts +6 -3
- package/portal-template/portal-config.ts +2 -0
- package/portal-template/prerender-pages.ts +8 -2
- package/portal-template/src/components/api-markdown.tsx +32 -0
- package/portal-template/src/components/api-page.tsx +8 -1
- package/portal-template/src/components/authorization-failure.tsx +63 -0
- package/portal-template/src/components/markdown-copy-button.tsx +2 -2
- package/portal-template/src/components/plugin-install.tsx +6 -5
- package/portal-template/src/components/sdk-actions.tsx +3 -2
- package/portal-template/src/components/sdk-cards.tsx +2 -1
- package/portal-template/src/components/search.tsx +9 -2
- package/portal-template/src/lib/base-path.ts +14 -0
- package/portal-template/src/lib/code-titles.ts +8 -0
- package/portal-template/src/lib/copy-markdown.ts +4 -2
- package/portal-template/src/lib/install-command.ts +5 -5
- package/portal-template/src/lib/layout.shared.tsx +5 -3
- package/portal-template/src/lib/llms.server.ts +29 -5
- package/portal-template/src/lib/oauth-callback.ts +63 -0
- package/portal-template/src/lib/portal-types.ts +3 -3
- package/portal-template/src/lib/rehype-code-titles.ts +3 -5
- package/portal-template/src/lib/remark-image-references.ts +35 -0
- package/portal-template/src/lib/search-content.ts +28 -0
- package/portal-template/src/lib/search-options.ts +7 -0
- package/portal-template/src/lib/source.server.ts +2 -0
- package/portal-template/src/router.tsx +3 -1
- package/portal-template/src/routes/$.tsx +3 -2
- package/portal-template/src/routes/__root.tsx +8 -1
- package/portal-template/src/routes/api/search[.]json.ts +23 -2
- package/portal-template/src/routes/oauth.callback.tsx +54 -0
- package/portal-template/static-functions-base.ts +41 -0
- package/portal-template/vite.config.ts +14 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
2
|
import react from '@vitejs/plugin-react';
|
|
3
3
|
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
|
|
4
|
-
import { defineConfig } from 'vite';
|
|
4
|
+
import { defineConfig, searchForWorkspaceRoot } from 'vite';
|
|
5
5
|
import tailwindcss from '@tailwindcss/vite';
|
|
6
6
|
import { fumadocsMdx } from 'fumadocs-mdx/vite';
|
|
7
7
|
import { dependencyDirectories } from './dependency-directories.ts';
|
|
@@ -10,22 +10,31 @@ import { generatedPagesReload } from './generated-pages-reload.ts';
|
|
|
10
10
|
import { readBuildPaths, readPortalIdentity } from './portal-config.ts';
|
|
11
11
|
import { prerenderPages } from './prerender-pages.ts';
|
|
12
12
|
import { specReload } from './spec-reload.ts';
|
|
13
|
+
import { remarkImageReferences } from './src/lib/remark-image-references.ts';
|
|
14
|
+
import { staticFunctionsBase } from './static-functions-base.ts';
|
|
13
15
|
|
|
14
16
|
export default defineConfig(async () => {
|
|
15
17
|
const [paths, identity] = await Promise.all([readBuildPaths(), readPortalIdentity()]);
|
|
16
18
|
const pages = await prerenderPages(paths, identity.siteUrl);
|
|
17
19
|
const publicDir: string | false = paths.staticDir ?? false;
|
|
18
|
-
const
|
|
20
|
+
const portalProjectDirectory = fileURLToPath(new URL('.', import.meta.url));
|
|
19
21
|
|
|
20
22
|
return {
|
|
23
|
+
// TanStack Start derives the router's basepath and every asset URL from it.
|
|
24
|
+
base: paths.base,
|
|
21
25
|
publicDir,
|
|
22
26
|
plugins: [
|
|
23
27
|
generatedPagesReload(),
|
|
24
28
|
downloads(paths.downloadsDir),
|
|
29
|
+
staticFunctionsBase(),
|
|
25
30
|
// `/images/logo.png` is read from the static directory, and a remote image is never fetched for its size.
|
|
26
31
|
fumadocsMdx({
|
|
27
32
|
globalOptions: {
|
|
28
|
-
mdxOptions: {
|
|
33
|
+
mdxOptions: {
|
|
34
|
+
remarkImageOptions: { publicDir: publicDir || undefined, external: false },
|
|
35
|
+
// A function, so it runs ahead of the preset's own plugins, `remarkImage` among them.
|
|
36
|
+
remarkPlugins: (plugins) => [remarkImageReferences, ...plugins]
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
}),
|
|
31
40
|
specReload(paths.specs),
|
|
@@ -57,13 +66,11 @@ export default defineConfig(async () => {
|
|
|
57
66
|
// listens on `::1` alone, a connect that stalls under load falls back to 127.0.0.1 and is
|
|
58
67
|
// refused, failing the build; binding IPv4 leaves the fetch a single address to reach.
|
|
59
68
|
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
69
|
server: {
|
|
63
70
|
fs: {
|
|
64
71
|
allow: [
|
|
65
|
-
|
|
66
|
-
...dependencyDirectories(
|
|
72
|
+
searchForWorkspaceRoot(portalProjectDirectory),
|
|
73
|
+
...dependencyDirectories(portalProjectDirectory),
|
|
67
74
|
...(paths.staticDir === null ? [] : [paths.staticDir])
|
|
68
75
|
]
|
|
69
76
|
}
|