create-qwik 0.22.0-dev20230316094845 → 0.22.0-dev20230316161536
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/index.cjs +2 -2
- package/package.json +1 -1
- package/starters/apps/base/package.json +2 -2
- package/starters/apps/basic/src/components/router-head/router-head.tsx +3 -3
- package/starters/apps/basic/src/components/{footer/footer.css → starter/footer/footer.module.css} +3 -3
- package/starters/apps/basic/src/components/starter/footer/footer.tsx +17 -0
- package/starters/apps/basic/src/components/{header/header.css → starter/header/header.module.css} +6 -6
- package/starters/apps/basic/src/components/{header → starter/header}/header.tsx +4 -6
- package/starters/apps/basic/src/components/starter/hero/hero.tsx +65 -0
- package/starters/apps/basic/src/components/starter/infobox/infobox.tsx +13 -0
- package/starters/apps/basic/src/components/starter/{starter.css → next-steps/next-steps.module.css} +2 -2
- package/starters/apps/basic/src/components/starter/{starter.tsx → next-steps/next-steps.tsx} +6 -36
- package/starters/apps/basic/src/global.css +5 -0
- package/starters/apps/basic/src/root.tsx +0 -2
- package/starters/apps/basic/src/routes/{flower → demo/flower}/flower.css +1 -1
- package/starters/apps/basic/src/routes/{todolist → demo/todolist}/index.tsx +6 -7
- package/starters/apps/basic/src/routes/index.tsx +7 -6
- package/starters/apps/basic/src/routes/layout.tsx +3 -4
- package/starters/apps/basic/src/components/footer/footer.tsx +0 -16
- package/starters/apps/basic/src/components/hero/hero.tsx +0 -55
- package/starters/apps/basic/src/components/infobox/infobox.tsx +0 -14
- /package/starters/apps/basic/src/components/{counter → starter/counter}/counter.css +0 -0
- /package/starters/apps/basic/src/components/{counter → starter/counter}/counter.tsx +0 -0
- /package/starters/apps/basic/src/components/{hero/hero.css → starter/hero/hero.module.css} +0 -0
- /package/starters/apps/basic/src/components/{icons → starter/icons}/qwik.tsx +0 -0
- /package/starters/apps/basic/src/components/{infobox/infobox.css → starter/infobox/infobox.module.css} +0 -0
- /package/starters/apps/basic/src/routes/{flower → demo/flower}/index.tsx +0 -0
- /package/starters/apps/basic/src/routes/{todolist/todolist.css → demo/todolist/todolist.module.css} +0 -0
package/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* create-qwik 0.22.0-
|
|
3
|
+
* create-qwik 0.22.0-dev20230316161536
|
|
4
4
|
* Copyright Builder.io, Inc. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
|
|
@@ -88,4 +88,4 @@ ${N("\u251C"+"\u2500".repeat(r+2)+"\u256F")}
|
|
|
88
88
|
`).trim()+`
|
|
89
89
|
`,type:"modify"})}catch{D.files.push({path:t,content:r,type:"create"})}}async function Hu(D,e){let r=(await V()).find(n=>n.id===e.integration);if(!r)throw new Error(`Unable to find integration "${e.integration}"`);let s={files:[],installedDeps:{}};e.installDeps&&(s.installedDeps={...r.pkgJson.dependencies,...r.pkgJson.devDependencies}),await Ku(s,e,r.dir,e.rootDir);let i=async n=>{let c=Object.keys(s.installedDeps).length>0,a=ou();n&&a.start(`Updating app${c?" and installing dependencies":""}...`);let p=!0;try{let l=new Set(s.files.map(C=>(0,Me.dirname)(C.path)));for(let C of Array.from(l))try{Yu.default.mkdirSync(C,{recursive:!0})}catch{}let F=Promise.all(s.files.map(async C=>{await Yu.default.promises.writeFile(C.path,C.content)}));if(e.installDeps&&Object.keys(s.installedDeps).length>0){let{install:C}=Uu(D,e.rootDir);p=await C}if(await F,n&&a.stop("App updated"),!p){let C=`${uu(` ${D} install failed `)}
|
|
90
90
|
You might need to run "${b(`${D} install`)}" manually inside the root of the project.`;j.error(C)}}catch(l){n&&a.stop("App updated"),L(String(l))}};return{rootDir:e.rootDir,integration:r,updates:s,commit:i}}async function Zu(D,e){rr()?e=process.cwd():(e=Xu(e),Z.default.existsSync(e)&&L(`Directory "${e}" already exists. Please either remove this directory, or choose another location.`));let t=M(),s=await Q({starterId:D,outDir:e});return Qu(t,s,!1),s}function Qu(D,e,t){let r=process.cwd()===e.outDir,s=(0,_.relative)(process.cwd(),e.outDir),i=[];r?i.push(`\u{1F984} ${Du(" Success! ")}`):i.push(`\u{1F984} ${Du(" Success! ")} ${b("Project created in")} ${aD(A(s))} ${b("directory")}`),i.push(""),i.push(`\u{1F430} ${b("Next steps:")}`),r||i.push(` cd ${s}`),t||i.push(` ${D} install`),i.push(` ${D} start`),i.push("");let u=D!=="npm"?`${D} qwik add`:"npm run qwik add";return i.push(`\u{1F90D} ${b("Integrations? Add Netlify, Cloudflare, Tailwind...")}`),i.push(` ${u}`),i.push(""),i.push(GD(e.docs)),i.push(`\u{1F440} ${b("Presentations, Podcasts and Videos:")}`),i.push(" https://qwik.builder.io/media/"),i.push(""),i.join(`
|
|
91
|
-
`)}async function Q(D){let e=M();if(!Ne(D.starterId))throw new Error("Missing starter id");if(!Ne(D.outDir))throw new Error("Missing outDir");if(!(0,_.isAbsolute)(D.outDir))throw new Error("outDir must be an absolute path");Z.default.existsSync(D.outDir)||Z.default.mkdirSync(D.outDir,{recursive:!0});let t={starterId:D.starterId,outDir:D.outDir,docs:[]},r=(await V()).filter(i=>i.type==="app");if(D.starterId==="library"){let i=r.find(u=>u.id==="library");if(!i)throw new Error("Unable to find base app");await Re(e,t,i)}else{let i=r.find(n=>n.id==="base");if(!i)throw new Error("Unable to find base app");let u=r.find(n=>n.id===D.starterId);if(!u)throw new Error(`Invalid starter id "${D.starterId}". It can only be one of${r.map(n=>` "${n.id}"`)}.`);await Re(e,t,i,u)}return t}async function Re(D,e,t,r){e.docs.push(...t.docs);let s=r??t,i=WD({...t.pkgJson,name:`my-${s.pkgJson.name}`,description:s.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await ND(e.outDir,i);let u=(0,_.join)(e.outDir,"README.md");await Z.default.promises.writeFile(u,""),await(await Hu(D,{rootDir:e.outDir,integration:t.id,installDeps:!1})).commit(!1),r&&(e.docs.push(...r.docs),await(await Hu(D,{rootDir:e.outDir,integration:r.id,installDeps:!1})).commit(!1))}function Ne(D){return typeof D=="string"&&D.trim().length>0}function Xu(D){return(0,_.resolve)(process.cwd(),D)}function rr(){return sr()}function sr(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var uD=$(require("fs")),qe=require("path");async function DD(){OD(`Let's create a ${CD(" Qwik App ")} \u2728 (v0.22.0-
|
|
91
|
+
`)}async function Q(D){let e=M();if(!Ne(D.starterId))throw new Error("Missing starter id");if(!Ne(D.outDir))throw new Error("Missing outDir");if(!(0,_.isAbsolute)(D.outDir))throw new Error("outDir must be an absolute path");Z.default.existsSync(D.outDir)||Z.default.mkdirSync(D.outDir,{recursive:!0});let t={starterId:D.starterId,outDir:D.outDir,docs:[]},r=(await V()).filter(i=>i.type==="app");if(D.starterId==="library"){let i=r.find(u=>u.id==="library");if(!i)throw new Error("Unable to find base app");await Re(e,t,i)}else{let i=r.find(n=>n.id==="base");if(!i)throw new Error("Unable to find base app");let u=r.find(n=>n.id===D.starterId);if(!u)throw new Error(`Invalid starter id "${D.starterId}". It can only be one of${r.map(n=>` "${n.id}"`)}.`);await Re(e,t,i,u)}return t}async function Re(D,e,t,r){e.docs.push(...t.docs);let s=r??t,i=WD({...t.pkgJson,name:`my-${s.pkgJson.name}`,description:s.pkgJson.description,scripts:void 0,dependencies:void 0,devDependencies:void 0});await ND(e.outDir,i);let u=(0,_.join)(e.outDir,"README.md");await Z.default.promises.writeFile(u,""),await(await Hu(D,{rootDir:e.outDir,integration:t.id,installDeps:!1})).commit(!1),r&&(e.docs.push(...r.docs),await(await Hu(D,{rootDir:e.outDir,integration:r.id,installDeps:!1})).commit(!1))}function Ne(D){return typeof D=="string"&&D.trim().length>0}function Xu(D){return(0,_.resolve)(process.cwd(),D)}function rr(){return sr()}function sr(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var uD=$(require("fs")),qe=require("path");async function DD(){OD(`Let's create a ${CD(" Qwik App ")} \u2728 (v0.22.0-dev20230316161536)`),await qD(500);let D="./qwik-app",e=await jD({message:"Where would you like to create your new project?",placeholder:D,validate(y){if(y.trim()==="."||y.trim()==="./")return"Please don't use '.' or './' and let qwik create the directory for you."}})||D;P(e)&&(H("Operation cancelled."),process.exit(0));let t=M(),s=(await V()).filter(y=>y.type==="app"),i=s.find(y=>y.id==="base"),u=s.filter(y=>y.id!==i.id),n=Pe(t,i),c=Xu(e.trim()),a=null;if(uD.default.existsSync(c)){let y=await ju({message:`Directory "./${(0,qe.relative)(process.cwd(),c)}" already exists. What would you like to do?`,options:[{value:"exit",label:"Do not overwrite this directory and exit"},{value:"replace",label:"Overwrite and replace this directory"}]});(P(y)||y==="exit")&&(H("Operation cancelled."),process.exit(0)),y==="replace"&&(a=uD.default.promises.rm(c,{recursive:!0}))}let p=await ju({message:"Select a starter",options:u.map(y=>{var eD;return{label:y.name,value:y.id,hint:(eD=y.pkgJson)==null?void 0:eD.description}})});P(p)&&(H("Operation cancelled."),process.exit(0));let l=p,F=await ID({message:`Would you like to install ${t} dependencies?`,initialValue:!0});P(F)&&(H("Operation cancelled."),process.exit(0)),a&&await a;let C=F,B={starterId:l,outDir:c},I=ou();I.start("Creating App");let U=await Q(B);I.stop("Created App \u{1F430}");let pu=!1;return C&&(I.start("Installing dependencies"),pu=await n.complete(C,U.outDir),I.stop(`${pu?"Installed":"Failed to install"} dependencies \u{1F4CB}`)),JD(Qu(t,U,pu),"Result"),Iu("Happy coding! \u{1F407}"),U}async function ir(){console.clear(),VD(),nr();try{let D=process.argv.slice(2);D.length>=2?await Zu(D[0],D[1]):await DD()}catch(D){L(D.message||D)}}function nr(){let D=process.version,[e,t]=D.replace("v","").split(".");Number(e)<16?(console.error(T(`Qwik requires Node.js 16.8 or higher. You are currently running Node.js ${D}.`)),process.exit(1)):Number(e)===16?Number(t)<8&&console.warn(lD(`Node.js 16.8 or higher is recommended. You are currently running Node.js ${D}.`)):Number(e)===18&&Number(t)<11&&console.error(T(`Node.js 18.11 or higher is REQUIRED. From Node 18.0.0 to 18.11.0, there is a bug preventing correct behaviour of Qwik. You are currently running Node.js ${D}. https://github.com/BuilderIO/qwik/issues/3035`))}0&&(module.exports={createApp,runCli,runCreateCli,runCreateInteractiveCli});
|
package/package.json
CHANGED
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@builder.io/qwik": "0.22.0-
|
|
19
|
+
"@builder.io/qwik": "0.22.0-dev20230316161536",
|
|
20
20
|
"@builder.io/qwik-city": "0.6.1",
|
|
21
21
|
"@types/eslint": "8.21.2",
|
|
22
22
|
"@types/node": "^18.15.3",
|
|
23
23
|
"@types/node-fetch": "latest",
|
|
24
24
|
"@typescript-eslint/eslint-plugin": "5.55.0",
|
|
25
25
|
"@typescript-eslint/parser": "5.55.0",
|
|
26
|
-
"eslint-plugin-qwik": "0.22.0-
|
|
26
|
+
"eslint-plugin-qwik": "0.22.0-dev20230316161536",
|
|
27
27
|
"eslint": "8.36.0",
|
|
28
28
|
"node-fetch": "3.3.0",
|
|
29
29
|
"undici": "5.21.0",
|
|
@@ -17,15 +17,15 @@ export const RouterHead = component$(() => {
|
|
|
17
17
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
18
18
|
|
|
19
19
|
{head.meta.map((m) => (
|
|
20
|
-
<meta {...m} />
|
|
20
|
+
<meta key={m.key} {...m} />
|
|
21
21
|
))}
|
|
22
22
|
|
|
23
23
|
{head.links.map((l) => (
|
|
24
|
-
<link {...l} />
|
|
24
|
+
<link key={l.key} {...l} />
|
|
25
25
|
))}
|
|
26
26
|
|
|
27
27
|
{head.styles.map((s) => (
|
|
28
|
-
<style {...s.props} dangerouslySetInnerHTML={s.style} />
|
|
28
|
+
<style key={s.key} {...s.props} dangerouslySetInnerHTML={s.style} />
|
|
29
29
|
))}
|
|
30
30
|
</>
|
|
31
31
|
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { component$ } from '@builder.io/qwik';
|
|
2
|
+
import { useServerTimeLoader } from '~/routes/layout';
|
|
3
|
+
import styles from './footer.module.css';
|
|
4
|
+
|
|
5
|
+
export default component$(() => {
|
|
6
|
+
const serverTime = useServerTimeLoader();
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<footer>
|
|
10
|
+
<a href="https://www.builder.io/" target="_blank" class={styles.anchor}>
|
|
11
|
+
Made with ♡ by Builder.io
|
|
12
|
+
<span class={styles.spacer}>|</span>
|
|
13
|
+
<span>{serverTime.value.date}</span>
|
|
14
|
+
</a>
|
|
15
|
+
</footer>
|
|
16
|
+
);
|
|
17
|
+
});
|
package/starters/apps/basic/src/components/{header/header.css → starter/header/header.module.css}
RENAMED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
header {
|
|
1
|
+
.header {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
padding: 20px 70px 0;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
header .logo a {
|
|
7
|
+
.header .logo a {
|
|
8
8
|
display: inline-block;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
header ul {
|
|
11
|
+
.header ul {
|
|
12
12
|
margin: 0;
|
|
13
13
|
list-style: none;
|
|
14
14
|
flex: 1;
|
|
15
15
|
text-align: right;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
header li {
|
|
18
|
+
.header li {
|
|
19
19
|
display: inline-block;
|
|
20
20
|
margin: 0;
|
|
21
21
|
padding: 0;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
header li a {
|
|
24
|
+
.header li a {
|
|
25
25
|
color: white;
|
|
26
26
|
display: inline-block;
|
|
27
27
|
padding: 0 1em;
|
|
28
28
|
text-decoration: none;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
header li a:hover {
|
|
31
|
+
.header li a:hover {
|
|
32
32
|
color: var(--qwik-dark-purple);
|
|
33
33
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { component
|
|
1
|
+
import { component$ } from '@builder.io/qwik';
|
|
2
2
|
import { QwikLogo } from '../icons/qwik';
|
|
3
|
-
import styles from './header.css
|
|
3
|
+
import styles from './header.module.css';
|
|
4
4
|
|
|
5
5
|
export default component$(() => {
|
|
6
|
-
useStylesScoped$(styles);
|
|
7
|
-
|
|
8
6
|
return (
|
|
9
|
-
<header>
|
|
10
|
-
<div class=
|
|
7
|
+
<header class={styles.header}>
|
|
8
|
+
<div class={styles.logo}>
|
|
11
9
|
<a href="/" title="qwik">
|
|
12
10
|
<QwikLogo />
|
|
13
11
|
</a>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { component$ } from '@builder.io/qwik';
|
|
2
|
+
import styles from './hero.module.css';
|
|
3
|
+
|
|
4
|
+
export default component$(() => {
|
|
5
|
+
return (
|
|
6
|
+
<div class={styles.hero}>
|
|
7
|
+
<h1>Welcome to qwik</h1>
|
|
8
|
+
<button
|
|
9
|
+
onClick$={async () => {
|
|
10
|
+
const defaults = {
|
|
11
|
+
spread: 360,
|
|
12
|
+
ticks: 70,
|
|
13
|
+
gravity: 0,
|
|
14
|
+
decay: 0.95,
|
|
15
|
+
startVelocity: 30,
|
|
16
|
+
colors: ['006ce9', 'ac7ff4', '18b6f6', '713fc2', 'ffffff'],
|
|
17
|
+
origin: {
|
|
18
|
+
x: 0.5,
|
|
19
|
+
y: 0.245,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function loadConfetti() {
|
|
24
|
+
return new Promise<(opts: any) => void>((resolve, reject) => {
|
|
25
|
+
if ((globalThis as any).confetti) {
|
|
26
|
+
return resolve((globalThis as any).confetti as any);
|
|
27
|
+
}
|
|
28
|
+
const script = document.createElement('script');
|
|
29
|
+
script.src =
|
|
30
|
+
'https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js';
|
|
31
|
+
script.onload = () => resolve((globalThis as any).confetti as any);
|
|
32
|
+
script.onerror = reject;
|
|
33
|
+
document.head.appendChild(script);
|
|
34
|
+
script.remove();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const confetti = await loadConfetti();
|
|
39
|
+
|
|
40
|
+
function shoot() {
|
|
41
|
+
confetti({
|
|
42
|
+
...defaults,
|
|
43
|
+
particleCount: 80,
|
|
44
|
+
scalar: 1.2,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
confetti({
|
|
48
|
+
...defaults,
|
|
49
|
+
particleCount: 60,
|
|
50
|
+
scalar: 0.75,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
setTimeout(shoot, 0);
|
|
55
|
+
setTimeout(shoot, 100);
|
|
56
|
+
setTimeout(shoot, 200);
|
|
57
|
+
setTimeout(shoot, 300);
|
|
58
|
+
setTimeout(shoot, 400);
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
Time to celebrate 🎉
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
});
|
package/starters/apps/basic/src/components/starter/{starter.css → next-steps/next-steps.module.css}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.gettingstarted {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
justify-content: center;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
line-height: 1.5;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.
|
|
10
|
+
.gettingstarted .hint {
|
|
11
11
|
margin-top: 10px;
|
|
12
12
|
font-size: 0.8rem;
|
|
13
13
|
}
|
package/starters/apps/basic/src/components/starter/{starter.tsx → next-steps/next-steps.tsx}
RENAMED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
$,
|
|
4
|
-
useOnWindow,
|
|
5
|
-
useSignal,
|
|
6
|
-
useStylesScoped$,
|
|
7
|
-
useTask$,
|
|
8
|
-
} from '@builder.io/qwik';
|
|
9
|
-
import { isBrowser } from '@builder.io/qwik/build';
|
|
10
|
-
import styles from './starter.css?inline';
|
|
11
|
-
import { useLocation } from '@builder.io/qwik-city';
|
|
1
|
+
import { component$, $, useOnWindow, useSignal } from '@builder.io/qwik';
|
|
2
|
+
import styles from './next-steps.module.css';
|
|
12
3
|
|
|
13
4
|
export const GETTING_STARTED_STEPS = [
|
|
14
5
|
{
|
|
@@ -29,7 +20,7 @@ export const GETTING_STARTED_STEPS = [
|
|
|
29
20
|
},
|
|
30
21
|
{
|
|
31
22
|
message: 'Time to have a look at <b>Forms</b>',
|
|
32
|
-
hint: 'Open <a href="/todolist" target="_blank">the TODO list App</a> and add some items to the list. Try the same with disabled JavaScript 🐰',
|
|
23
|
+
hint: 'Open <a href="/demo/todolist" target="_blank">the TODO list App</a> and add some items to the list. Try the same with disabled JavaScript 🐰',
|
|
33
24
|
},
|
|
34
25
|
{
|
|
35
26
|
message: '<b>Congratulations!</b> You are now familiar with the basics! 🎉',
|
|
@@ -38,28 +29,7 @@ export const GETTING_STARTED_STEPS = [
|
|
|
38
29
|
];
|
|
39
30
|
|
|
40
31
|
export default component$(() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const loc = useLocation();
|
|
44
|
-
let stepParam = loc.url.searchParams.has('step')
|
|
45
|
-
? parseInt(loc.url.searchParams.get('step') || '0') - 1
|
|
46
|
-
: 0;
|
|
47
|
-
|
|
48
|
-
if (stepParam < 0 || stepParam >= GETTING_STARTED_STEPS.length) {
|
|
49
|
-
stepParam = 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const gettingStartedStep = useSignal(stepParam);
|
|
53
|
-
|
|
54
|
-
useTask$(({ track }) => {
|
|
55
|
-
track(() => gettingStartedStep.value);
|
|
56
|
-
if (isBrowser) {
|
|
57
|
-
// pushState to update the URL
|
|
58
|
-
const url = new URL(window.location.href);
|
|
59
|
-
url.searchParams.set('step', gettingStartedStep.value + 1 + '');
|
|
60
|
-
window.history.pushState({}, '', url);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
32
|
+
const gettingStartedStep = useSignal(0);
|
|
63
33
|
|
|
64
34
|
useOnWindow(
|
|
65
35
|
'keydown',
|
|
@@ -72,10 +42,10 @@ export default component$(() => {
|
|
|
72
42
|
|
|
73
43
|
return (
|
|
74
44
|
<>
|
|
75
|
-
<div class=
|
|
45
|
+
<div class={styles.gettingstarted}>
|
|
76
46
|
<div dangerouslySetInnerHTML={GETTING_STARTED_STEPS[gettingStartedStep.value].message} />
|
|
77
47
|
<span
|
|
78
|
-
class=
|
|
48
|
+
class={styles.hint}
|
|
79
49
|
dangerouslySetInnerHTML={GETTING_STARTED_STEPS[gettingStartedStep.value].hint}
|
|
80
50
|
/>
|
|
81
51
|
</div>
|
|
@@ -17,8 +17,6 @@ export default component$(() => {
|
|
|
17
17
|
<head>
|
|
18
18
|
<meta charSet="utf-8" />
|
|
19
19
|
<link rel="manifest" href="/manifest.json" />
|
|
20
|
-
{/* REMOVE THIS LINE BELOW IF YOUR APP DOES NOT LIKE CONFETTI 🤓 */}
|
|
21
|
-
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js"></script>
|
|
22
20
|
<RouterHead />
|
|
23
21
|
</head>
|
|
24
22
|
<body lang="en">
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { component
|
|
1
|
+
import { component$ } from '@builder.io/qwik';
|
|
2
2
|
import {
|
|
3
3
|
type DocumentHead,
|
|
4
4
|
routeLoader$,
|
|
5
|
-
|
|
5
|
+
routeAction$,
|
|
6
6
|
zod$,
|
|
7
7
|
z,
|
|
8
8
|
Form,
|
|
9
9
|
} from '@builder.io/qwik-city';
|
|
10
|
-
import
|
|
10
|
+
import styles from './todolist.module.css';
|
|
11
11
|
|
|
12
12
|
interface ListItem {
|
|
13
13
|
text: string;
|
|
@@ -19,7 +19,7 @@ export const useListLoader = routeLoader$(() => {
|
|
|
19
19
|
return list;
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
export const useAddToListAction =
|
|
22
|
+
export const useAddToListAction = routeAction$(
|
|
23
23
|
(item) => {
|
|
24
24
|
list.push(item);
|
|
25
25
|
return {
|
|
@@ -32,7 +32,6 @@ export const useAddToListAction = globalAction$(
|
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
export default component$(() => {
|
|
35
|
-
useStylesScoped$(style);
|
|
36
35
|
const list = useListLoader();
|
|
37
36
|
const action = useAddToListAction();
|
|
38
37
|
|
|
@@ -47,7 +46,7 @@ export default component$(() => {
|
|
|
47
46
|
<div class="section bright">
|
|
48
47
|
<div class="container center mh-300">
|
|
49
48
|
{(list.value.length && (
|
|
50
|
-
<ul class=
|
|
49
|
+
<ul class={styles.list}>
|
|
51
50
|
{list.value.map((item, index) => (
|
|
52
51
|
<li key={`items-${index}`}>{item.text}</li>
|
|
53
52
|
))}
|
|
@@ -62,7 +61,7 @@ export default component$(() => {
|
|
|
62
61
|
<input type="text" name="text" required /> <button type="submit">Add item</button>
|
|
63
62
|
</Form>
|
|
64
63
|
|
|
65
|
-
<p class=
|
|
64
|
+
<p class={styles.hint}>PS: This little app works even when JavaScript is disabled.</p>
|
|
66
65
|
</div>
|
|
67
66
|
</div>
|
|
68
67
|
</>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { component$ } from '@builder.io/qwik';
|
|
2
2
|
import type { DocumentHead } from '@builder.io/qwik-city';
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
|
|
4
|
+
import Counter from '~/components/starter/counter/counter';
|
|
5
|
+
import Hero from '~/components/starter/hero/hero';
|
|
6
|
+
import Infobox from '~/components/starter/infobox/infobox';
|
|
7
|
+
import Starter from '~/components/starter/next-steps/next-steps';
|
|
7
8
|
|
|
8
9
|
export default component$(() => {
|
|
9
10
|
return (
|
|
@@ -61,8 +62,8 @@ export default component$(() => {
|
|
|
61
62
|
Example Apps
|
|
62
63
|
</div>
|
|
63
64
|
<p>
|
|
64
|
-
Have a look at the <a href="/flower">
|
|
65
|
-
<a href="/todolist">Todo App</a>.
|
|
65
|
+
Have a look at the <a href="/demo/flower">Flower App</a> or the{' '}
|
|
66
|
+
<a href="/demo/todolist">Todo App</a>.
|
|
66
67
|
</p>
|
|
67
68
|
</Infobox>
|
|
68
69
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { component$, Slot } from '@builder.io/qwik';
|
|
2
2
|
import { routeLoader$ } from '@builder.io/qwik-city';
|
|
3
3
|
|
|
4
|
-
import Header from '
|
|
5
|
-
import Footer from '~/components/footer/footer';
|
|
4
|
+
import Header from '~/components/starter/header/header';
|
|
5
|
+
import Footer from '~/components/starter/footer/footer';
|
|
6
6
|
|
|
7
7
|
export const useServerTimeLoader = routeLoader$(() => {
|
|
8
8
|
return {
|
|
@@ -11,7 +11,6 @@ export const useServerTimeLoader = routeLoader$(() => {
|
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export default component$(() => {
|
|
14
|
-
const serverTime = useServerTimeLoader();
|
|
15
14
|
return (
|
|
16
15
|
<div class="page">
|
|
17
16
|
<main>
|
|
@@ -20,7 +19,7 @@ export default component$(() => {
|
|
|
20
19
|
</main>
|
|
21
20
|
<div class="section dark">
|
|
22
21
|
<div class="container">
|
|
23
|
-
<Footer
|
|
22
|
+
<Footer />
|
|
24
23
|
</div>
|
|
25
24
|
</div>
|
|
26
25
|
</div>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type Signal, component$, useStylesScoped$ } from '@builder.io/qwik';
|
|
2
|
-
import styles from './footer.css?inline';
|
|
3
|
-
|
|
4
|
-
export default component$(({ serverTime }: { serverTime: Signal<{ date: string }> }) => {
|
|
5
|
-
useStylesScoped$(styles);
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<footer>
|
|
9
|
-
<a href="https://www.builder.io/" target="_blank">
|
|
10
|
-
Made with ♡ by Builder.io
|
|
11
|
-
<span class="spacer">|</span>
|
|
12
|
-
<span>{serverTime.value.date}</span>
|
|
13
|
-
</a>
|
|
14
|
-
</footer>
|
|
15
|
-
);
|
|
16
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { component$, $, useStylesScoped$ } from '@builder.io/qwik';
|
|
2
|
-
import styles from './hero.css?inline';
|
|
3
|
-
|
|
4
|
-
export default component$(() => {
|
|
5
|
-
useStylesScoped$(styles);
|
|
6
|
-
return (
|
|
7
|
-
<div class="hero">
|
|
8
|
-
<h1>Welcome to qwik</h1>
|
|
9
|
-
<button
|
|
10
|
-
onClick$={() => {
|
|
11
|
-
party();
|
|
12
|
-
}}
|
|
13
|
-
>
|
|
14
|
-
Time to celebrate 🎉
|
|
15
|
-
</button>
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export const party = $(() => {
|
|
21
|
-
const defaults = {
|
|
22
|
-
spread: 360,
|
|
23
|
-
ticks: 70,
|
|
24
|
-
gravity: 0,
|
|
25
|
-
decay: 0.95,
|
|
26
|
-
startVelocity: 30,
|
|
27
|
-
colors: ['006ce9', 'ac7ff4', '18b6f6', '713fc2', 'ffffff'],
|
|
28
|
-
origin: {
|
|
29
|
-
x: 0.5,
|
|
30
|
-
y: 0.245,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
function shoot() {
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
confetti({
|
|
37
|
-
...defaults,
|
|
38
|
-
particleCount: 80,
|
|
39
|
-
scalar: 1.2,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
confetti({
|
|
44
|
-
...defaults,
|
|
45
|
-
particleCount: 60,
|
|
46
|
-
scalar: 0.75,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
setTimeout(shoot, 0);
|
|
51
|
-
setTimeout(shoot, 100);
|
|
52
|
-
setTimeout(shoot, 200);
|
|
53
|
-
setTimeout(shoot, 300);
|
|
54
|
-
setTimeout(shoot, 400);
|
|
55
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Slot, component$, useStylesScoped$ } from '@builder.io/qwik';
|
|
2
|
-
import styles from './infobox.css?inline';
|
|
3
|
-
|
|
4
|
-
export default component$(() => {
|
|
5
|
-
useStylesScoped$(styles);
|
|
6
|
-
return (
|
|
7
|
-
<div class="infobox">
|
|
8
|
-
<h3>
|
|
9
|
-
<Slot name="title" />
|
|
10
|
-
</h3>
|
|
11
|
-
<Slot />
|
|
12
|
-
</div>
|
|
13
|
-
);
|
|
14
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/starters/apps/basic/src/routes/{todolist/todolist.css → demo/todolist/todolist.module.css}
RENAMED
|
File without changes
|