Skip to content

Commit

Permalink
chore: merge main (QwikDev#6457)
Browse files Browse the repository at this point in the history
* chore: merge main

* fix integration/unit tests

* fix lint

* fix(api): pin api generator

it was giving weird errors in newer versions

* disable signals test

---------

Co-authored-by: Varixo <[email protected]>
  • Loading branch information
wmertens and Varixo authored Jun 7, 2024
1 parent ae82eda commit 078621b
Show file tree
Hide file tree
Showing 57 changed files with 3,491 additions and 3,465 deletions.
4 changes: 2 additions & 2 deletions contributing/TRIAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ flowchart TD
maj --YES--> P4[P4: urgent]
maj --NO--> P3[P3: important]
unusable --NO--> workarounds{Are there\nworkarounds for\nthe bug?}
workarounds --NO--> P2[P2: minor bug]
workarounds --NO--> P2[P2: minor]
workarounds --YES--> P1[P1: nice to have / fix]
```

Expand Down Expand Up @@ -74,7 +74,7 @@ flowchart TD
discussion --YES--> close3[Tag with\n 'STATUS-2: requires discussion'\nand 'WAITING FOR: team'\nor 'WAITING FOR: user']
discussion --NO--> implement{Should it be\nimplemented by core?}
implement --NO--> community{Should it be implemented\nby the community?}
community --YES--> incubate[Close and tag with\n'STATUS-3: incubation']
community --YES--> incubate[Close and tag with either\n'STATUS-3: incubation'\nor 'STATUS-2: waiting for community PR'\nand 'COMMUNITY: PR is welcomed']
community --NO--> wontfix[Close and tag with\n'STATUS-3: won't be worked on']
implement --YES--> doimplement["1. Tag with 'STATUS-2: team is working on this'\n2. Add related feature label if\napplicable (e.g. 'COMP: runtime')\n3. Add version \nlabels (e.g. 'VERSION: upcoming major')"]
```
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@
"@clack/prompts": "^0.7.0",
"@eslint/eslintrc": "^3.0.2",
"@mdx-js/mdx": "^3.0.1",
"@microsoft/api-documenter": "^7.24.2",
"@microsoft/api-extractor": "^7.43.1",
"@microsoft/api-documenter": "7.24.2",
"@microsoft/api-extractor": "7.43.1",
"@napi-rs/cli": "^2.18.2",
"@napi-rs/triples": "^1.2.0",
"@node-rs/helper": "^1.6.0",
"@octokit/action": "6.1.0",
"@playwright/test": "1.40.0",
"@types/brotli": "^1.3.4",
"@types/bun": "^1.1.1",
"@types/bun": "^1.1.3",
"@types/cross-spawn": "^6.0.6",
"@types/eslint": "^8.56.10",
"@types/express": "^4.17.21",
"@types/node": "^20.12.8",
"@types/node": "^20.14.1",
"@types/path-browserify": "^1.0.2",
"@types/prompts": "^2.4.9",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/semver": "^7.5.8",
"@types/which-pm-runs": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^7.8.0",
Expand Down Expand Up @@ -132,7 +132,7 @@
"vitest": "^1.6.0",
"watchlist": "0.3.1",
"which-pm-runs": "1.1.0",
"zod": "^3.23.6"
"zod": "^3.23.8"
},
"engines": {
"node": ">=16.8.0 <18.0.0 || >=18.11",
Expand All @@ -145,6 +145,7 @@
"overrides": {
"typescript": "5.4.5",
"vfile": "^6.0.1",
"sharp": ">=0.33",
"@supabase/realtime-js": "2.8.4"
},
"patchedDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion packages/create-qwik/src/helpers/jokes.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,8 @@
"Knock knock. \n Who's there? \n Opportunity.",
"That is impossible. Opportunity doesn’t come knocking twice!"
],
["Knock knock. \n Who's there? \n Hatch. \n Hatch who?", "Bless you!"]
["Knock knock. \n Who's there? \n Hatch. \n Hatch who?", "Bless you!"],
["Man said: I changed my Mind, Machine replied: I changed my CPU"],
["Man said: I dreamed of God, Machine replied: I dreamed of Rust"],
["Person: give me just a second, Programmer: give me just a 100 milliseconds"]
]
4 changes: 2 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"@docsearch/css": "^3.5.2",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@modular-forms/qwik": "^0.23.1",
"@modular-forms/qwik": "^0.24.0",
"@mui/material": "^5.15.14",
"@mui/system": "^5.15.14",
"@mui/x-data-grid": "^6.19.6",
"@supabase/supabase-js": "^2.39.8",
"@types/prismjs": "^1.26.3",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@unpic/core": "^0.0.42",
"@unpic/qwik": "^0.0.38",
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions packages/docs/scripts/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"size": "large",
"tags": "site,healthcare,services,webrtc,websocket"
},
{
"href": "https://ohayo-dev-design.com/",
"tags": "web, dev, agency"
},
{
"href": "https://linkfang-portfolio.vercel.app/",
"tags": "portfolio"
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/src/components/docsearch/result.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Slot, component$, useContext, useSignal, useStore, useTask$ } from '@builder.io/qwik';
import { QwikGPT } from '../qwik-gpt';
// import { QwikGPT } from '../qwik-gpt';
import { SearchContext } from './context';
import { AiResultOpenContext, type DocSearchState } from './doc-search';
import { Snippet } from './snippet';
Expand Down Expand Up @@ -134,7 +134,7 @@ export const AIButton = component$(({ state }: { state: DocSearchState }) => {
}
}}
>
<div class="ai-button">
{/* <div class="ai-button">
<button
onClick$={() => {
gpt.value = state.query;
Expand All @@ -157,7 +157,7 @@ export const AIButton = component$(({ state }: { state: DocSearchState }) => {
<QwikGPT query={gpt.value}></QwikGPT>
</div>
)}
</div>
</div> */}
</li>
)}
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/components/docsearch/search-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const SearchBox = component$((props: SearchBoxProps) => {
enterKeyHint={props.state.activeItemId ? 'go' : 'search'}
spellcheck={false}
autoFocus={props.autoFocus}
placeholder="Search docs or ask a question"
placeholder="Search docs"
type="search"
ref={props.inputRef as any}
onInput$={(event) => {
Expand Down
95 changes: 91 additions & 4 deletions packages/docs/src/components/footer/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,98 @@
import { component$ } from '@builder.io/qwik';
import BuilderContentComp from '../../components/builder-content';
import { BUILDER_FOOTER_MODEL, BUILDER_PUBLIC_API_KEY } from '../../constants';
import { QwikLogo } from '~/components/svgs/qwik-logo';
import { DiscordLogo } from '~/components/svgs/discord-logo';
import { GithubLogo } from '~/components/svgs/github-logo';
import { TwitterLogo } from '~/components/svgs/twitter-logo';

const baseUrl = 'https://qwik.dev';
const linkColumns = [
[
{ title: 'Docs', href: `${baseUrl}/docs/` },
{ title: 'Qwik City', href: `${baseUrl}/docs/qwikcity/` },
{ title: 'Ecosystem', href: `${baseUrl}/ecosystem/` },
{ title: 'Playground', href: `${baseUrl}/playground/` },
],
[
{ title: 'Integrations', href: `${baseUrl}/ecosystem/#integrations` },
{ title: 'Deployments', href: `${baseUrl}/ecosystem/#deployments` },
{ title: 'Media', href: `${baseUrl}/ecosystem/#videos` },
{ title: 'Showcase', href: `${baseUrl}/showcase/` },
],
[
{ title: 'Tutorial', href: `${baseUrl}/ecosystem/#courses` },
{ title: 'Presentations', href: `${baseUrl}/ecosystem/#presentations` },
{ title: 'Community', href: `${baseUrl}/ecosystem/#community` },
],
];

export const Footer = component$(() => {
return (
<footer class="container mx-auto">
<BuilderContentComp apiKey={BUILDER_PUBLIC_API_KEY} model={BUILDER_FOOTER_MODEL} tag="div" />
<footer class="mb-12 mt-10">
<div class="flex justify-center my-12">
<div class="flex flex-grow justify-center flex-wrap max-w-screen-xl flex-col sm:flex-row gap-y-4">
<div class="flex-1 sm:flex-[2] flex sm:justify-center sm:block mb-4 sm:mb-0">
<QwikLogo width={170} height={54} />
</div>
<div class="flex flex-1 sm:flex-[3] max-w-screen-sm flex-wrap gap-y-8 gap-x-20 text-xs sm:px-4">
<FooterLinks />
</div>
</div>
</div>
<div class="flex justify-center">
<div class="max-w-screen-xl w-full">
<div class="italic text-xs">
<p>
Made with <span class="not-italic">❤️</span> by
</p>
<p class="text-xl sm:text-2xl">
The <strong>Qwik</strong> Team
</p>
</div>
<div class="border border-b-0 border-current mt-2"></div>
<div class="flex justify-between items-end">
<p class="text-xs">MIT License © 2024</p>
<FooterSocialLinks />
</div>
</div>
</div>
</footer>
);
});

export const FooterLinks = component$(() => {
return (
<>
{linkColumns.map((column, colIndex) => (
<div key={colIndex} class="flex flex-col gap-4 flex-1">
{column.map((link, linkIndex) => (
<a key={linkIndex} class="hover:text-interactive-blue z-[10]" href={link.href}>
{link.title}
</a>
))}
</div>
))}
</>
);
});

export const FooterSocialLinks = component$(() => {
const socialLinks = [
{ href: 'https://qwik.dev/chat', title: 'Discord', Logo: DiscordLogo },
{ href: 'https://github.com/QwikDev/qwik', title: 'GitHub', Logo: GithubLogo },
{ href: 'https://twitter.com/QwikDev', title: 'Twitter', Logo: TwitterLogo },
];

return (
<div class="flex gap-4 mt-4">
{socialLinks.map(({ title, href, Logo }) => (
<li key={title} class="list-none">
<a href={href} target="_blank" title={title}>
<span>
<Logo width={22} height={22} />
</span>
</a>
</li>
))}
</div>
);
});
17 changes: 0 additions & 17 deletions packages/docs/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {
setPreference,
ThemeToggle,
} from '../theme-toggle/theme-toggle';
import BuilderContentComp from '../../components/builder-content';
import { BUILDER_TOP_BAR_MODEL, BUILDER_PUBLIC_API_KEY } from '../../constants';

export const Header = component$(() => {
useStyles$(styles);
Expand All @@ -31,23 +29,8 @@ export const Header = component$(() => {
});
});

const hasBuilderBar = !(
pathname.startsWith('/examples') ||
pathname.startsWith('/tutorial') ||
pathname.startsWith('/playground')
);

return (
<>
{hasBuilderBar && (
<div class="builder-bar">
<BuilderContentComp
apiKey={BUILDER_PUBLIC_API_KEY}
model={BUILDER_TOP_BAR_MODEL}
tag="div"
/>
</div>
)}
<header
class={{
'header-container': true,
Expand Down
64 changes: 32 additions & 32 deletions packages/docs/src/components/qwik-gpt/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { component$, useComputed$, useSignal, useTask$ } from '@builder.io/qwik';
import { qwikGPT, rateResponse } from './search';
import { component$, useComputed$, useSignal } from '@builder.io/qwik';
// import { qwikGPT, rateResponse } from './search';
import { CodeBlock } from '../code-block/code-block';
import { isBrowser } from '@builder.io/qwik/build';
// import { isBrowser } from '@builder.io/qwik/build';
import snarkdown from 'snarkdown';

const snarkdownEnhanced = (md: string) => {
Expand All @@ -18,9 +18,9 @@ const snarkdownEnhanced = (md: string) => {

export const QwikGPT = component$((props: { query: string }) => {
const message = useSignal('');
const done = useSignal(false);
const id = useSignal<string>();
const rated = useSignal(false);
// const done = useSignal(false);
// const id = useSignal<string>();
// const rated = useSignal(false);

const process = useComputed$(() => {
const rawLines = message.value.split('\n');
Expand Down Expand Up @@ -70,30 +70,30 @@ export const QwikGPT = component$((props: { query: string }) => {
return lines;
});

useTask$(({ track }) => {
const query = track(() => props.query);
if (isBrowser) {
message.value = '';
done.value = false;
rated.value = false;
id.value = undefined;
if (props.query !== '') {
const run = async () => {
done.value = false;
const response = await qwikGPT(query);
for await (const value of response) {
if (typeof value === 'string') {
message.value += value;
} else if (value.type === 'id') {
id.value = value.content;
}
}
done.value = true;
};
run();
}
}
});
// useTask$(({ track }) => {
// const query = track(() => props.query);
// if (isBrowser) {
// message.value = '';
// done.value = false;
// rated.value = false;
// id.value = undefined;
// if (props.query !== '') {
// const run = async () => {
// done.value = false;
// const response = await qwikGPT(query);
// for await (const value of response) {
// if (typeof value === 'string') {
// message.value += value;
// } else if (value.type === 'id') {
// id.value = value.content;
// }
// }
// done.value = true;
// };
// run();
// }
// }
// });

if (message.value === '' && props.query !== '') {
return (
Expand All @@ -114,7 +114,7 @@ export const QwikGPT = component$((props: { query: string }) => {
);
})}
</div>
{done.value && (
{/* {done.value && (
<div class="ai-rate">
{rated.value ? (
<>Thank you very much!</>
Expand Down Expand Up @@ -142,7 +142,7 @@ export const QwikGPT = component$((props: { query: string }) => {
</>
)}
</div>
)}
)} */}
</>
);
});
Loading

0 comments on commit 078621b

Please sign in to comment.