Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use types from @types/bun package #5942

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@octokit/action": "6.0.7",
"@playwright/test": "^1.42.1",
"@types/brotli": "^1.3.4",
"@types/bun": "^1.0.8",
"@types/cross-spawn": "^6.0.6",
"@types/eslint": "^8.56.5",
"@types/express": "^4.17.21",
Expand Down
10 changes: 5 additions & 5 deletions packages/docs/src/routes/api/qwik-city/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,18 +384,18 @@
"mdFile": "qwik-city.linkprops.md"
},
{
"name": "Loader",
"id": "loader",
"name": "Loader_2",
"id": "loader_2",
"hierarchy": [
{
"name": "Loader",
"id": "loader"
"name": "Loader_2",
"id": "loader_2"
}
],
"kind": "TypeAlias",
"content": "```typescript\nexport type Loader<RETURN> = {\n (): LoaderSignal<RETURN>;\n};\n```\n**References:** [LoaderSignal](#loadersignal)",
"editUrl": "https://github.com/BuilderIO/qwik/tree/main/packages/qwik-city/runtime/src/types.ts",
"mdFile": "qwik-city.loader.md"
"mdFile": "qwik-city.loader_2.md"
},
{
"name": "LoaderSignal",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/routes/api/qwik-city/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export interface LinkProps extends AnchorAttributes

[Edit this section](https://github.com/BuilderIO/qwik/tree/main/packages/qwik-city/runtime/src/link-component.tsx)

## Loader
## Loader_2

```typescript
export type Loader<RETURN> = {
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/routes/api/qwik/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@
}
],
"kind": "Function",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nLoad the prefetch graph for the container.\n\nEach Qwik container needs to include its own prefetch graph.\n\n\n```typescript\nPrefetchGraph: (opts?: {\n base?: string;\n manifestHash?: string;\n manifestURL?: string;\n}) => import(\"@builder.io/qwik/jsx-runtime\").JSXNode<\"script\">\n```\n\n\n| Parameter | Type | Description |\n| --- | --- | --- |\n| opts | { base?: string; manifestHash?: string; manifestURL?: string; } | <p>_(Optional)_ Options for the loading prefetch graph.</p><p>- <code>base</code> - Base of the graph. For a default installation this will default to <code>/build/</code>. But if more than one MFE is installed on the page, then each MFE needs to have its own base. - <code>manifestHash</code> - Hash of the manifest file to load. If not provided the hash will be extracted from the container attribute <code>q:manifest-hash</code> and assume the default build file <code>${base}/q-bundle-graph-${manifestHash}.json</code>. - <code>manifestURL</code> - URL of the manifest file to load if non-standard bundle graph location name.</p> |\n\n**Returns:**\n\nimport(\"@builder.io/qwik/jsx-runtime\").JSXNode&lt;\"script\"&gt;",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nLoad the prefetch graph for the container.\n\nEach Qwik container needs to include its own prefetch graph.\n\n\n```typescript\nPrefetchGraph: (opts?: {\n base?: string;\n manifestHash?: string;\n manifestURL?: string;\n}) => import(\"@builder.io/qwik/jsx-runtime\").JSXNode<\"script\">\n```\n\n\n| Parameter | Type | Description |\n| --- | --- | --- |\n| opts | { base?: string; manifestHash?: string; manifestURL?: string; } | <p>_(Optional)_ Options for the loading prefetch graph.</p><p>- <code>base</code> - Base of the graph. For a default installation this will default to <code>/build/</code>. But if more than one MFE is installed on the page, then each MFE needs to have its own base. - <code>manifestHash</code> - Hash of the manifest file to load. If not provided the hash will be extracted from the container attribute <code>q:manifest-hash</code> and assume the default build file <code>${base}/q-bundle-graph-${manifestHash}.json</code>. - <code>manifestURL</code> - URL of the manifest file to load if non-standard bundle graph location name.</p> |\n\n**Returns:**\n\nimport(\"@builder.io/qwik/jsx-runtime\").[JSXNode](#jsxnode)<!-- -->&lt;\"script\"&gt;",
"editUrl": "https://github.com/BuilderIO/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts",
"mdFile": "qwik.prefetchgraph.md"
},
Expand All @@ -1718,7 +1718,7 @@
}
],
"kind": "Function",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nInstall a service worker which will prefetch the bundles.\n\nThere can only be one service worker per page. Because there can be many separate Qwik Containers on the page each container needs to load its prefetch graph using `PrefetchGraph` component.\n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n}) => import(\"@builder.io/qwik/jsx-runtime\").JSXNode<\"script\">\n```\n\n\n| Parameter | Type | Description |\n| --- | --- | --- |\n| opts | { base?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; } | <p>Options for the prefetch service worker.</p><p>- <code>base</code> - Base URL for the service worker. - <code>path</code> - Path to the service worker.</p> |\n\n**Returns:**\n\nimport(\"@builder.io/qwik/jsx-runtime\").JSXNode&lt;\"script\"&gt;",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nInstall a service worker which will prefetch the bundles.\n\nThere can only be one service worker per page. Because there can be many separate Qwik Containers on the page each container needs to load its prefetch graph using `PrefetchGraph` component.\n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n}) => import(\"@builder.io/qwik/jsx-runtime\").JSXNode<\"script\">\n```\n\n\n| Parameter | Type | Description |\n| --- | --- | --- |\n| opts | { base?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; } | <p>Options for the prefetch service worker.</p><p>- <code>base</code> - Base URL for the service worker. - <code>path</code> - Path to the service worker.</p> |\n\n**Returns:**\n\nimport(\"@builder.io/qwik/jsx-runtime\").[JSXNode](#jsxnode)<!-- -->&lt;\"script\"&gt;",
"editUrl": "https://github.com/BuilderIO/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts",
"mdFile": "qwik.prefetchserviceworker.md"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/routes/api/qwik/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ PrefetchGraph: (opts?: {

**Returns:**

import("@builder.io/qwik/jsx-runtime").JSXNode&lt;"script"&gt;
import("@builder.io/qwik/jsx-runtime").[JSXNode](#jsxnode)&lt;"script"&gt;

[Edit this section](https://github.com/BuilderIO/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts)

Expand All @@ -1842,7 +1842,7 @@ PrefetchServiceWorker: (opts: {

**Returns:**

import("@builder.io/qwik/jsx-runtime").JSXNode&lt;"script"&gt;
import("@builder.io/qwik/jsx-runtime").[JSXNode](#jsxnode)&lt;"script"&gt;

[Edit this section](https://github.com/BuilderIO/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts)

Expand Down
6 changes: 3 additions & 3 deletions packages/qwik-city/middleware/request-handler/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { Action } from '@builder.io/qwik-city';
import type { _deserializeData } from '@builder.io/qwik';
import type { EnvGetter as EnvGetter_2 } from '@builder.io/qwik-city/middleware/request-handler';
import type { FailReturn } from '@builder.io/qwik-city';
import type { Loader } from '@builder.io/qwik-city';
import type { Loader as Loader_2 } from '@builder.io/qwik-city';
import type { QwikCityPlan } from '@builder.io/qwik-city';
import type { QwikIntrinsicElements } from '@builder.io/qwik';
import type { Render } from '@builder.io/qwik/server';
Expand Down Expand Up @@ -161,15 +161,15 @@ export function requestHandler<T = unknown>(serverRequestEv: ServerRequestEvent<
// @public (undocumented)
export interface ResolveSyncValue {
// (undocumented)
<T>(loader: Loader<T>): Awaited<T> extends () => any ? never : Awaited<T>;
<T>(loader: Loader_2<T>): Awaited<T> extends () => any ? never : Awaited<T>;
// (undocumented)
<T>(action: Action<T>): Awaited<T> | undefined;
}

// @public (undocumented)
export interface ResolveValue {
// (undocumented)
<T>(loader: Loader<T>): Awaited<T> extends () => any ? never : Promise<T>;
<T>(loader: Loader_2<T>): Awaited<T> extends () => any ? never : Promise<T>;
// (undocumented)
<T>(action: Action<T>): Promise<T | undefined>;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/qwik-city/runtime/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ export interface LinkProps extends AnchorAttributes {
}

// @public (undocumented)
export type Loader<RETURN> = {
type Loader_2<RETURN> = {
(): LoaderSignal<RETURN>;
};
export { Loader_2 as Loader }

// @public (undocumented)
export type LoaderSignal<TYPE> = TYPE extends () => ValueOrPromise<infer VALIDATOR> ? ReadonlySignal<ValueOrPromise<VALIDATOR>> : ReadonlySignal<TYPE>;
Expand Down
17 changes: 16 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions starters/adapters/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"- bun run serve: runs the production server locally"
]
}
},
"devDependencies": {
"@types/bun": "*"
}
}
4 changes: 1 addition & 3 deletions starters/adapters/bun/src/entry.bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const { router, notFound, staticFile } = createQwikCity({
// Allow for dynamic port
const port = Number(Bun.env.PORT ?? 3000);

/* eslint-disable */
// eslint-disable-next-line no-console
console.log(`Server started: http://localhost:${port}/`);

Bun.serve({
Expand All @@ -44,5 +44,3 @@ Bun.serve({
},
port,
});

declare const Bun: any;
Loading