Skip to content

Commit

Permalink
Merge pull request #4 from QwikDev/build/v2-signals
Browse files Browse the repository at this point in the history
Build/v2 signals
  • Loading branch information
JerryWu1234 authored Aug 10, 2024
2 parents 6a6b609 + d6542fa commit 142475d
Show file tree
Hide file tree
Showing 240 changed files with 6,999 additions and 5,277 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ body:
id: system-info
attributes:
label: System Info
description: Output of `npx envinfo --system --npmPackages '{vite,undici,typescript,@builder.io/*}' --binaries --browsers`
description: Output of `npx envinfo --system --npmPackages '{vite,typescript,@builder.io/*}' --binaries --browsers`
render: shell
placeholder: System, Binaries, Browsers
validations:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ jobs:
build-qwik: ${{ steps.cache-qwik.outputs.cache-hit != 'true' }}
build-rust: ${{ steps.cache-rust.outputs.cache-hit != 'true' }}
build-others: ${{ steps.cache-others.outputs.cache-hit != 'true' }}
# TEMP v2: disable docs build until we have v2 deps building (qwik-ui, qwik-sdk)
# build-docs: ${{ steps.cache-docs.outputs.cache-hit != 'true' }}
build-docs: false
build-docs: ${{ steps.cache-docs.outputs.cache-hit != 'true' }}
# TEMP v2: disable insights build
# build-insights: ${{ steps.cache-insights.outputs.cache-hit != 'true' }}
build-insights: false
Expand Down Expand Up @@ -510,6 +508,15 @@ jobs:
- name: Build Qwik Docs
run: pnpm run build.packages.docs

- name: Cloudflare Pages Deployment
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: 'qwik-docs'
directory: packages/docs/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

############ RELEASE ############
release:
name: Release
Expand Down
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
27 changes: 9 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@
],
"pinVersion": "1.40.0"
}
],
"semverGroups": [
{
"label": "Undici should always be * until we remove it",
"range": "*",
"dependencies": [
"undici"
]
}
]
}
},
Expand Down Expand Up @@ -68,22 +59,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 @@ -123,7 +114,6 @@
"terser": "^5.31.0",
"tsm": "^2.3.0",
"typescript": "5.4.5",
"undici": "*",
"vfile": "^6.0.1",
"vite": "^5.2.11",
"vite-imagetools": "^6.2.9",
Expand All @@ -132,10 +122,10 @@
"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",
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": ">=9.0.5"
Expand All @@ -145,6 +135,7 @@
"overrides": {
"typescript": "5.4.5",
"vfile": "^6.0.1",
"sharp": ">=0.33",
"@supabase/realtime-js": "2.8.4"
},
"patchedDependencies": {
Expand Down Expand Up @@ -200,10 +191,10 @@
"start": "concurrently \"npm:build.watch\" \"npm:tsc.watch\" -n build,tsc -c green,cyan",
"test": "pnpm build.full && pnpm test.unit && pnpm test.e2e",
"test.e2e": "pnpm test.e2e.chromium && pnpm test.e2e.webkit",
"test.e2e.cli": "tsm scripts/e2e-cli.ts",
"test.e2e.chromium": "playwright test starters --browser=chromium --config starters/playwright.config.ts",
"test.e2e.chromium.debug": "PWDEBUG=1 playwright test starters --browser=chromium --config starters/playwright.config.ts",
"test.e2e.city": "playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts",
"test.e2e.cli": "tsm scripts/e2e-cli.ts",
"test.e2e.firefox": "playwright test starters --browser=firefox --config starters/playwright.config.ts",
"test.e2e.webkit": "playwright test starters --browser=webkit --config starters/playwright.config.ts",
"test.rust": "make test",
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"]
]
3 changes: 2 additions & 1 deletion packages/docs/check-qwik-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import fs from 'fs';
import path from 'path';
import { spawnSync } from 'child_process';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(new URL(import.meta.url).pathname);
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const qwikPkgDir = path.join(__dirname, '..', 'qwik', 'dist');

if (!fs.existsSync(path.join(qwikPkgDir, 'core.d.ts'))) {
Expand Down
1 change: 0 additions & 1 deletion packages/docs/contributors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-console */
import { fetch } from 'undici';
import fs from 'node:fs';
import path from 'node:path';
import url from 'node:url';
Expand Down
11 changes: 3 additions & 8 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,16 @@
"@builder.io/qwik-city": "workspace:^",
"@builder.io/qwik-labs": "workspace:^",
"@builder.io/qwik-react": "workspace:^",
"@builder.io/sdk-qwik": "^0.14.21",
"@docsearch/css": "^3.5.2",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@modular-forms/qwik": "^0.23.1",
"@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",
"algoliasearch": "4.16.0",
"autoprefixer": "^10.4.19",
"fflate": "^0.8.2",
Expand All @@ -36,7 +32,7 @@
"prism-themes": "1.9.0",
"prismjs": "1.29.0",
"puppeteer": "^22.6.0",
"qwik-image": "^0.0.10",
"qwik-image": "0.0.14-alpha",
"react": "18.3.1",
"react-dom": "18.3.1",
"rehype-pretty-code": "^0.11.0",
Expand All @@ -47,14 +43,13 @@
"terser": "^5.31.0",
"tsm": "^2.3.0",
"typescript": "5.4.5",
"undici": "*",
"valibot": "^0.29.0",
"vite": "^5.2.11",
"vite-plugin-inspect": "^0.8.4",
"wrangler": "^3.53.1"
},
"engines": {
"node": ">=18.11",
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": ">=8.6.12"
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
1 change: 0 additions & 1 deletion packages/docs/scripts/showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ async function captureMultipleScreenshots() {
}

async function getPagespeedData(url) {
const { fetch } = await import('undici');
const requestURL = `https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${encodeURIComponent(
url
)}&key=AIzaSyApBC9gblaCzWrtEBgHnZkd_B37OF49BfM&category=PERFORMANCE&strategy=MOBILE`;
Expand Down
49 changes: 10 additions & 39 deletions packages/docs/src/components/builder-content/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { component$, Resource, useResource$ } from '@builder.io/qwik';
import { useLocation } from '@builder.io/qwik-city';
import { getBuilderSearchParams, fetchOneEntry, Content } from '@builder.io/sdk-qwik';
import { QWIK_MODEL } from '../../constants';

export default component$<{
Expand All @@ -17,52 +16,24 @@ export default component$<{
? query.get(name)
: (query as unknown as Record<string, string>)[name];

const render = queryGet('render');
const contentId = props.model === QWIK_MODEL ? queryGet('content') : undefined;
const isSDK = render === 'sdk';
cache('immutable');
if (isSDK) {
return getCachedValue(
{
model: props.model!,
apiKey: props.apiKey!,
options: getBuilderSearchParams(query),
userAttributes: {
urlPath: location.url.pathname,
site: 'qwik.dev',
},
...(contentId && {
query: {
id: contentId,
},
}),
},
fetchOneEntry
);
} else {
return getCachedValue(
{
apiKey: props.apiKey,
model: props.model,
urlPath: location.url.pathname,
contentId: contentId,
},
getBuilderContent
);
}
return getCachedValue(
{
apiKey: props.apiKey,
model: props.model,
urlPath: location.url.pathname,
contentId: contentId,
},
getBuilderContent
);
});

return (
<Resource
value={builderContentRsrc}
onPending={() => <div>Loading...</div>}
onResolved={(content) =>
content.html ? (
<props.tag class="builder" dangerouslySetInnerHTML={content.html} />
) : (
<Content model={props.model} content={content} apiKey={props.apiKey} />
)
}
onResolved={(content) => <props.tag class="builder" dangerouslySetInnerHTML={content.html} />}
/>
);
});
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
3 changes: 2 additions & 1 deletion packages/docs/src/components/docsearch/results-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const ResultsScreen = component$((props: { state: DocSearchState }) => {
<ul role="listbox" aria-labelledby="docsearch-label" id="docsearch-list">
{collection.items.map((item, index) => {
return (
<Result state={props.state} item={item} key={item.objectID}>
// TODO: the key should be {item.objectID}, but for now in v2 there is a bug
<Result state={props.state} item={item} key={item.__autocomplete_id}>
{item.__docsearch_parent && (
<svg q:slot="start-action" class="DocSearch-Hit-Tree" viewBox="0 0 24 54">
<g
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
Loading

0 comments on commit 142475d

Please sign in to comment.