create-qwik 0.0.108 → 0.0.109-0
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 +7 -19
- package/create-qwik.cjs +3 -0
- package/index.cjs +125 -0
- package/package.json +11 -7
- package/starters/apps/base/.prettierignore +6 -0
- package/starters/apps/base/README.md +6 -16
- package/starters/apps/base/gitignore +4 -6
- package/starters/apps/base/package.json +15 -18
- package/starters/apps/base/public/favicon.ico +0 -0
- package/starters/apps/base/public/favicons/android-chrome-192x192.png +0 -0
- package/starters/apps/base/public/favicons/apple-touch-icon.png +0 -0
- package/starters/apps/base/public/favicons/favicon-16x16.png +0 -0
- package/starters/apps/base/public/favicons/favicon-32x32.png +0 -0
- package/starters/apps/base/public/favicons/favicon.svg +13 -0
- package/starters/apps/base/src/entry.preview.tsx +6 -0
- package/starters/apps/base/src/entry.ssr.tsx +7 -5
- package/starters/apps/base/tsconfig.json +5 -4
- package/starters/apps/base/vite.config.ts +1 -6
- package/starters/apps/blank/dist/q-manifest.json +105 -0
- package/starters/apps/blank/package.json +1 -16
- package/starters/apps/blank/src/entry.preview.tsx +18 -0
- package/starters/apps/blank/src/root.tsx +2 -2
- package/starters/apps/{qwik-city → library}/tsconfig.json +1 -4
- package/starters/apps/library/vite.config.ts +1 -6
- package/starters/apps/qwik-city/{public → dist}/favicons/android-chrome-192x192.png +0 -0
- package/starters/apps/qwik-city/{public → dist}/favicons/android-chrome-256x256.png +0 -0
- package/starters/apps/qwik-city/{public → dist}/favicons/apple-touch-icon.png +0 -0
- package/starters/apps/qwik-city/{public → dist}/favicons/favicon.svg +0 -0
- package/starters/apps/qwik-city/{public → dist}/logos/qwik-logo.svg +0 -0
- package/starters/apps/qwik-city/{public → dist}/logos/qwik.svg +0 -0
- package/starters/apps/qwik-city/dist/q-manifest.json +904 -0
- package/starters/apps/qwik-city/dist/service-worker.js +167 -0
- package/starters/apps/qwik-city/package.json +2 -13
- package/starters/apps/qwik-city/src/components/menu/menu.tsx +4 -4
- package/starters/apps/{perf.prod → qwik-city}/src/entry.ssr.tsx +7 -5
- package/starters/apps/qwik-city/src/root.tsx +4 -4
- package/starters/apps/qwik-city/src/routes/service-worker.ts +10 -0
- package/starters/apps/qwik-city/vite.config.ts +1 -8
- package/create-qwik +0 -107
- package/index.js +0 -22
- package/starters/apps/blank/src/entry.express.tsx +0 -59
- package/starters/apps/perf.prod/package.json +0 -22
- package/starters/apps/perf.prod/src/components/app/app.tsx +0 -189
- package/starters/apps/perf.prod/src/entry.express.tsx +0 -59
- package/starters/apps/perf.prod/src/global.css +0 -3
- package/starters/apps/perf.prod/src/root.tsx +0 -18
- package/starters/apps/qwik-city/public/_headers +0 -2
- package/starters/apps/qwik-city/public/favicon.ico +0 -0
- package/starters/features/prettier/.prettierignore +0 -23
- package/starters/features/prettier/package.json +0 -10
- package/starters/features/react/package.json +0 -26
- package/starters/features/react/src/entry.ssr.tsx +0 -11
- package/starters/features/react/src/react/app.tsx +0 -14
- package/starters/features/tailwindcss/package.json +0 -8
- package/starters/features/tailwindcss/postcss.config.cjs +0 -6
- package/starters/features/tailwindcss/src/global.css +0 -3
- package/starters/features/tailwindcss/tailwind.config.cjs +0 -7
- package/starters/servers/cloudflare-pages/.node-version +0 -1
- package/starters/servers/cloudflare-pages/README.md +0 -17
- package/starters/servers/cloudflare-pages/functions/[[path]].ts +0 -5
- package/starters/servers/cloudflare-pages/package.json +0 -18
- package/starters/servers/cloudflare-pages/public/_headers +0 -2
- package/starters/servers/cloudflare-pages/src/entry.cloudflare.tsx +0 -4
- package/starters/servers/express/README.md +0 -9
- package/starters/servers/express/package.json +0 -11
- package/starters/servers/express/src/entry.express.tsx +0 -31
- package/starters/servers/netlify-edge/.node-version +0 -1
- package/starters/servers/netlify-edge/README.md +0 -39
- package/starters/servers/netlify-edge/netlify.toml +0 -10
- package/starters/servers/netlify-edge/package.json +0 -19
- package/starters/servers/netlify-edge/public/_headers +0 -2
- package/starters/servers/netlify-edge/src/entry.netlify.ts +0 -6
- package/starters/servers/netlify-edge/tsconfig.json +0 -17
package/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* create-qwik 0.0.108-dev20220906124741
|
|
4
|
-
* Copyright Builder.io, Inc. All Rights Reserved.
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
|
|
7
|
-
*/
|
|
8
|
-
"use strict";var V=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var K=(e,t)=>{for(var r in t)V(e,r,{get:t[r],enumerable:!0})},W=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of q(t))!U.call(e,n)&&n!==r&&V(e,n,{get:()=>t[n],enumerable:!(s=L(t,n))||s.enumerable});return e};var v=e=>W(V({},"__esModule",{value:!0}),e);var H={};K(H,{generateStarter:()=>x,getStarters:()=>O});module.exports=v(H);var h=require("fs"),F=require("path");var f=require("fs"),T=require("path");function S(e,t,r){let s=(0,f.readdirSync)(e);for(let n of s){let o=n==="gitignore"?".gitignore":n,i=(0,T.join)(e,n),c=(0,T.join)(t,o),u=(0,f.statSync)(i);if(u.isDirectory())(0,f.mkdirSync)(c,{recursive:!0}),S(i,c,r);else if(u.isFile())if(r.length>0&&[".json",".toml",".md",".html","vite.config.ts"].some(m=>i.endsWith(m))){let m=(0,f.readFileSync)(i,"utf8");for(let I of r)m=m.replace(I[0],I[1]);(0,f.writeFileSync)(c,m)}else(0,f.copyFileSync)(i,c)}}function l(e){let t=(0,T.join)(e,"package.json");return JSON.parse((0,f.readFileSync)(t,"utf-8"))}function R(e,t){let r=(0,T.join)(e,"package.json");(0,f.writeFileSync)(r,JSON.stringify(t,null,2)+`
|
|
9
|
-
`)}function C(e){return e.toLocaleLowerCase().split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function J(e){return e.toLocaleLowerCase().replace(/ /g,"-")}function w(e,t){["scripts","dependencies","devDependencies"].forEach(s=>{B(e,t,s)})}function B(e,t,r){if(t[r]){e[r]?Object.assign(e[r],{...t[r]}):e[r]={...t[r]};let s={},n=Object.keys(e[r]).sort();for(let o of n)s[o]=e[r][o];e[r]=s}}async function x(e){if(!N(e.projectName))throw new Error("Missing project name");if(!N(e.appId))throw new Error("Missing starter id");if(!N(e.outDir))throw new Error("Missing outDir");(0,h.existsSync)(e.outDir)||(0,h.mkdirSync)(e.outDir,{recursive:!0});let t={projectName:e.projectName,appId:e.appId,serverId:e.serverId,outDir:e.outDir},r=await O(),s=r.apps.find(i=>i.id===e.appId),n=r.servers.find(i=>i.id===e.serverId),o=r.features.filter(i=>e.featureIds.includes(i.id));if(s)A(r,t,s,n,o);else throw new Error(`Invalid starter id "${e.appId}".`);return t}function A(e,t,r,s,n){var j,G;let o=[[/\bqwik-project-name\b/g,t.projectName]],i=e.apps.find(d=>d.id==="base");if(!i)throw new Error("Unable to find base app.");let c={VITE_IMPORTS:[],VITE_CONFIG:[],VITE_QWIK:[],VITE_PLUGINS:[]};if(s){let a=(j=l(s.dir).__qwik__)==null?void 0:j.vite;a!=null&&a.VITE_IMPORTS&&c.VITE_IMPORTS.push(a.VITE_IMPORTS),a!=null&&a.VITE_CONFIG&&c.VITE_CONFIG.push(a.VITE_CONFIG),a!=null&&a.VITE_QWIK&&c.VITE_QWIK.push(a.VITE_QWIK),a!=null&&a.VITE_PLUGINS&&c.VITE_PLUGINS.push(a.VITE_PLUGINS)}for(let d of n){S(d.dir,t.outDir,o);let p=(G=l(d.dir).__qwik__)==null?void 0:G.vite;p!=null&&p.VITE_IMPORTS&&c.VITE_IMPORTS.push(p.VITE_IMPORTS),p!=null&&p.VITE_CONFIG&&c.VITE_CONFIG.push(p.VITE_CONFIG),p!=null&&p.VITE_QWIK&&c.VITE_QWIK.push(p.VITE_QWIK),p!=null&&p.VITE_PLUGINS&&c.VITE_PLUGINS.push(p.VITE_PLUGINS)}o.push([/\/\* VITE_IMPORTS \*\//g,c.VITE_IMPORTS.join(`
|
|
10
|
-
`)]),o.push([/\/\* VITE_CONFIG \*\//g,c.VITE_CONFIG.join(`
|
|
11
|
-
`)]),o.push([/\/\* VITE_QWIK \*\//g,c.VITE_QWIK.join(`
|
|
12
|
-
`)]),o.push([/\/\* VITE_PLUGINS \*\//g,c.VITE_PLUGINS.join(`
|
|
13
|
-
`)]),S(i.dir,t.outDir,o),S(r.dir,t.outDir,o);let u=l(i.dir),_=l(r.dir);w(u,_);let m=["version","private","main","module","qwik","types","exports","files"];for(let d of m)_[d]!==void 0&&(u[d]=_[d]);let I=i.readme.trim()+`
|
|
14
|
-
|
|
15
|
-
`,g=[r.description,"Vite.js tooling."];if(s){S(s.dir,t.outDir,o);let d=l(s.dir);w(u,d),d.description&&g.push(d.description),s.readme&&(I+=s.readme.trim()+`
|
|
16
|
-
|
|
17
|
-
`)}for(let d of n){S(d.dir,t.outDir,o);let a=l(d.dir);w(u,a),a.description&&g.push(a.description),d.readme&&(I+=d.readme.trim()+`
|
|
18
|
-
|
|
19
|
-
`)}u.name=J(t.projectName),u.description=g.join(" ").trim();let D=(0,F.join)(t.outDir,"README.md"),M=g.map(d=>`- ${d}`).join(`
|
|
20
|
-
`).trim(),b=[`# Qwik ${t.projectName} \u26A1\uFE0F`,"",M,"",I.trim(),"","--------------------","","## Related","","- [Qwik Docs](https://qwik.builder.io/)","- [Qwik Github](https://github.com/BuilderIO/qwik)","- [@QwikDev](https://twitter.com/QwikDev)","- [Discord](https://qwik.builder.io/chat)","- [Vite](https://vitejs.dev/)","- [Partytown](https://partytown.builder.io/)","- [Mitosis](https://github.com/BuilderIO/mitosis)","- [Builder.io](https://www.builder.io/)"].join(`
|
|
21
|
-
`);(0,h.writeFileSync)(D,b.trim()+`
|
|
22
|
-
`);let Q=$(u);R(t.outDir,Q)}function $(e){e={...e};let t={name:e.name,version:e.version,description:e.description,scripts:e.scripts,dependencies:e.dependencies,devDependencies:e.devDependencies};Object.keys(t).forEach(s=>{delete e[s]}),delete e.__qwik__;let r=Object.keys(e).sort();for(let s of r)t[s]=e[s];return t}function N(e){return typeof e=="string"&&e.trim().length>0}var E=require("fs"),y=require("path");var k=null;async function O(){return k==null&&(k=z((0,y.join)(__dirname,"starters"))),k}function z(e){return{apps:P(e,"apps"),servers:P(e,"servers"),features:P(e,"features")}}function P(e,t){let r=(0,y.join)(e,t);return(0,E.readdirSync)(r).filter(n=>(0,E.statSync)((0,y.join)(r,n)).isDirectory()).map(n=>{var _,m,I,g;let o=(0,y.join)(r,n),i=l(o),c=null;try{c=(0,E.readFileSync)((0,y.join)(o,"README.md"),"utf-8")}catch{}return{id:n,name:C(n),description:i.description??"",readme:c,dir:o,selectServer:((_=i==null?void 0:i.__qwik__)==null?void 0:_.selectServer)??!1,priority:((m=i==null?void 0:i.__qwik__)==null?void 0:m.priority)??0,featureOptions:((I=i==null?void 0:i.__qwik__)==null?void 0:I.featureOptions)??[],featureEnabled:((g=i==null?void 0:i.__qwik__)==null?void 0:g.featureEnabled)??[]}}).sort((n,o)=>n.priority>o.priority?-1:n.priority<o.priority?1:n.name<o.name?-1:n.name>o.name?1:0)}0&&(module.exports={generateStarter,getStarters});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import express from 'express';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import render from './entry.ssr';
|
|
5
|
-
|
|
6
|
-
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Create an express server
|
|
10
|
-
* https://expressjs.com/
|
|
11
|
-
*/
|
|
12
|
-
const app = express();
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Serve static client build files,
|
|
16
|
-
* hashed filenames, immutable cache-control
|
|
17
|
-
*/
|
|
18
|
-
app.use(
|
|
19
|
-
'/build',
|
|
20
|
-
express.static(join(__dirname, '..', 'dist', 'build'), {
|
|
21
|
-
immutable: true,
|
|
22
|
-
maxAge: '1y',
|
|
23
|
-
})
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Serve static public files at the root
|
|
28
|
-
*/
|
|
29
|
-
app.use(express.static(join(__dirname, '..', 'dist'), { index: false }));
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Server-Side Render Qwik application
|
|
33
|
-
*/
|
|
34
|
-
app.get('/*', async (req, res, next) => {
|
|
35
|
-
try {
|
|
36
|
-
// Render the Root component to a string
|
|
37
|
-
const result = await render({
|
|
38
|
-
stream: res,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// respond with SSR'd HTML
|
|
42
|
-
if ('html' in result) {
|
|
43
|
-
res.send((result as any).html);
|
|
44
|
-
} else {
|
|
45
|
-
res.end();
|
|
46
|
-
}
|
|
47
|
-
} catch (e) {
|
|
48
|
-
// Error while server-side rendering
|
|
49
|
-
next(e);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Start the express server
|
|
55
|
-
*/
|
|
56
|
-
app.listen(8080, () => {
|
|
57
|
-
/* eslint-disable */
|
|
58
|
-
console.log(`http://localhost:8080/`);
|
|
59
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "Blank Qwik starter app.",
|
|
3
|
-
"scripts": {
|
|
4
|
-
"build.ssr": "vite build --ssr src/entry.express.tsx",
|
|
5
|
-
"serve": "node server/entry.express"
|
|
6
|
-
},
|
|
7
|
-
"devDependencies": {
|
|
8
|
-
"@types/express": "4.17.13",
|
|
9
|
-
"express": "4.17.3"
|
|
10
|
-
},
|
|
11
|
-
"type": "module",
|
|
12
|
-
"__qwik__": {
|
|
13
|
-
"priority": 0,
|
|
14
|
-
"featureOptions": [
|
|
15
|
-
"prettier",
|
|
16
|
-
"tailwindcss"
|
|
17
|
-
],
|
|
18
|
-
"featureEnabled": [
|
|
19
|
-
"prettier"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { component$, useStore } from '@builder.io/qwik';
|
|
2
|
-
|
|
3
|
-
let idCounter = 1;
|
|
4
|
-
const adjectives = [
|
|
5
|
-
'pretty',
|
|
6
|
-
'large',
|
|
7
|
-
'big',
|
|
8
|
-
'small',
|
|
9
|
-
'tall',
|
|
10
|
-
'short',
|
|
11
|
-
'long',
|
|
12
|
-
'handsome',
|
|
13
|
-
'plain',
|
|
14
|
-
'quaint',
|
|
15
|
-
'clean',
|
|
16
|
-
'elegant',
|
|
17
|
-
'easy',
|
|
18
|
-
'angry',
|
|
19
|
-
'crazy',
|
|
20
|
-
'helpful',
|
|
21
|
-
'mushy',
|
|
22
|
-
'odd',
|
|
23
|
-
'unsightly',
|
|
24
|
-
'adorable',
|
|
25
|
-
'important',
|
|
26
|
-
'inexpensive',
|
|
27
|
-
'cheap',
|
|
28
|
-
'expensive',
|
|
29
|
-
'fancy',
|
|
30
|
-
],
|
|
31
|
-
colours = [
|
|
32
|
-
'red',
|
|
33
|
-
'yellow',
|
|
34
|
-
'blue',
|
|
35
|
-
'green',
|
|
36
|
-
'pink',
|
|
37
|
-
'brown',
|
|
38
|
-
'purple',
|
|
39
|
-
'brown',
|
|
40
|
-
'white',
|
|
41
|
-
'black',
|
|
42
|
-
'orange',
|
|
43
|
-
],
|
|
44
|
-
nouns = [
|
|
45
|
-
'table',
|
|
46
|
-
'chair',
|
|
47
|
-
'house',
|
|
48
|
-
'bbq',
|
|
49
|
-
'desk',
|
|
50
|
-
'car',
|
|
51
|
-
'pony',
|
|
52
|
-
'cookie',
|
|
53
|
-
'sandwich',
|
|
54
|
-
'burger',
|
|
55
|
-
'pizza',
|
|
56
|
-
'mouse',
|
|
57
|
-
'keyboard',
|
|
58
|
-
];
|
|
59
|
-
|
|
60
|
-
function _random(max: number) {
|
|
61
|
-
return Math.round(Math.random() * 1000) % max;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function buildData(count: number) {
|
|
65
|
-
const data = new Array(count);
|
|
66
|
-
for (let i = 0; i < count; i++) {
|
|
67
|
-
data[i] = {
|
|
68
|
-
id: idCounter++,
|
|
69
|
-
label: `${adjectives[_random(adjectives.length)]} ${colours[_random(colours.length)]} ${
|
|
70
|
-
nouns[_random(nouns.length)]
|
|
71
|
-
}`,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
return data;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
type BenchState = {
|
|
78
|
-
data: Array<{ id: number; label: string }>;
|
|
79
|
-
selected: number | null;
|
|
80
|
-
};
|
|
81
|
-
export const App = component$(() => {
|
|
82
|
-
const state = useStore<BenchState>({ data: [], selected: null });
|
|
83
|
-
return (
|
|
84
|
-
<div class="container">
|
|
85
|
-
<div class="jumbotron">
|
|
86
|
-
<div class="row">
|
|
87
|
-
<div class="col-md-6">
|
|
88
|
-
<h1>Qwik Keyed</h1>
|
|
89
|
-
</div>
|
|
90
|
-
<div class="col-md-6">
|
|
91
|
-
<div class="row">
|
|
92
|
-
<div class="col-sm-6 smallpad">
|
|
93
|
-
<button
|
|
94
|
-
id="run"
|
|
95
|
-
class="btn btn-primary btn-block"
|
|
96
|
-
type="button"
|
|
97
|
-
onClick$={() => (state.data = buildData(1000))}
|
|
98
|
-
>
|
|
99
|
-
Create 1,000 rows
|
|
100
|
-
</button>
|
|
101
|
-
<button
|
|
102
|
-
id="runlots"
|
|
103
|
-
class="btn btn-primary btn-block"
|
|
104
|
-
type="button"
|
|
105
|
-
onClick$={() => (state.data = buildData(10000))}
|
|
106
|
-
>
|
|
107
|
-
Create 10,000 rows
|
|
108
|
-
</button>
|
|
109
|
-
<button
|
|
110
|
-
id="add"
|
|
111
|
-
class="btn btn-primary btn-block"
|
|
112
|
-
type="button"
|
|
113
|
-
onClick$={() => (state.data = state.data.concat(buildData(1000)))}
|
|
114
|
-
>
|
|
115
|
-
Append 1,000 rows
|
|
116
|
-
</button>
|
|
117
|
-
<button
|
|
118
|
-
id="update"
|
|
119
|
-
class="btn btn-primary btn-block"
|
|
120
|
-
type="button"
|
|
121
|
-
onClick$={() => {
|
|
122
|
-
for (let i = 0, d = state.data, len = d.length; i < len; i += 10) {
|
|
123
|
-
d[i].label += ' !!!';
|
|
124
|
-
}
|
|
125
|
-
}}
|
|
126
|
-
>
|
|
127
|
-
Update every 10th row
|
|
128
|
-
</button>
|
|
129
|
-
<button
|
|
130
|
-
id="clear"
|
|
131
|
-
class="btn btn-primary btn-block"
|
|
132
|
-
type="button"
|
|
133
|
-
onClick$={() => (state.data = [])}
|
|
134
|
-
>
|
|
135
|
-
Clear
|
|
136
|
-
</button>
|
|
137
|
-
<button
|
|
138
|
-
id="swaprows"
|
|
139
|
-
class="btn btn-primary btn-block"
|
|
140
|
-
type="button"
|
|
141
|
-
onClick$={() => {
|
|
142
|
-
const d = state.data.slice();
|
|
143
|
-
if (d.length > 998) {
|
|
144
|
-
const tmp = d[1];
|
|
145
|
-
d[1] = d[998];
|
|
146
|
-
d[998] = tmp;
|
|
147
|
-
state.data = d;
|
|
148
|
-
}
|
|
149
|
-
}}
|
|
150
|
-
>
|
|
151
|
-
Swap Rows
|
|
152
|
-
</button>
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
<table class="table table-hover table-striped test-data">
|
|
159
|
-
<tbody>
|
|
160
|
-
{state.data.map(({ id, label }) => {
|
|
161
|
-
return (
|
|
162
|
-
<tr key={id} class={id === state.selected ? 'danger' : ''}>
|
|
163
|
-
<td class="col-md-1">{id}</td>
|
|
164
|
-
<td class="col-md-4">
|
|
165
|
-
<a onClick$={() => alert(label)}>{label}</a>
|
|
166
|
-
</td>
|
|
167
|
-
<td class="col-md-1">
|
|
168
|
-
<a
|
|
169
|
-
// onClick$={() => {
|
|
170
|
-
// const d = state.data;
|
|
171
|
-
// d.splice(
|
|
172
|
-
// d.findIndex((d) => d.id === id),
|
|
173
|
-
// 1
|
|
174
|
-
// );
|
|
175
|
-
// }}
|
|
176
|
-
>
|
|
177
|
-
<span class="glyphicon glyphicon-remove" ariaHidden="true" />
|
|
178
|
-
</a>
|
|
179
|
-
</td>
|
|
180
|
-
<td class="col-md-6" />
|
|
181
|
-
</tr>
|
|
182
|
-
);
|
|
183
|
-
})}
|
|
184
|
-
</tbody>
|
|
185
|
-
</table>
|
|
186
|
-
<span class="preloadicon glyphicon glyphicon-remove" ariaHidden="true" />
|
|
187
|
-
</div>
|
|
188
|
-
);
|
|
189
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import express from 'express';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import render from './entry.ssr';
|
|
5
|
-
|
|
6
|
-
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Create an express server
|
|
10
|
-
* https://expressjs.com/
|
|
11
|
-
*/
|
|
12
|
-
const app = express();
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Serve static client build files,
|
|
16
|
-
* hashed filenames, immutable cache-control
|
|
17
|
-
*/
|
|
18
|
-
app.use(
|
|
19
|
-
'/build',
|
|
20
|
-
express.static(join(__dirname, '..', 'dist', 'build'), {
|
|
21
|
-
immutable: true,
|
|
22
|
-
maxAge: '1y',
|
|
23
|
-
})
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Serve static public files at the root
|
|
28
|
-
*/
|
|
29
|
-
app.use(express.static(join(__dirname, '..', 'dist'), { index: false }));
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Server-Side Render Qwik application
|
|
33
|
-
*/
|
|
34
|
-
app.get('/*', async (req, res, next) => {
|
|
35
|
-
try {
|
|
36
|
-
// Render the Root component to a string
|
|
37
|
-
const result = await render({
|
|
38
|
-
stream: res,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// respond with SSR'd HTML
|
|
42
|
-
if ('html' in result) {
|
|
43
|
-
res.send((result as any).html);
|
|
44
|
-
} else {
|
|
45
|
-
res.end();
|
|
46
|
-
}
|
|
47
|
-
} catch (e) {
|
|
48
|
-
// Error while server-side rendering
|
|
49
|
-
next(e);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Start the express server
|
|
55
|
-
*/
|
|
56
|
-
app.listen(8080, () => {
|
|
57
|
-
/* eslint-disable */
|
|
58
|
-
console.log(`http://localhost:8080/`);
|
|
59
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { App } from './components/app/app';
|
|
2
|
-
|
|
3
|
-
import './global.css';
|
|
4
|
-
|
|
5
|
-
export default () => {
|
|
6
|
-
return (
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charSet="utf-8" />
|
|
10
|
-
<title>Qwik Blank App</title>
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<App />
|
|
15
|
-
</body>
|
|
16
|
-
</html>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
Binary file
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
**/*.log
|
|
2
|
-
**/.DS_Store
|
|
3
|
-
*.
|
|
4
|
-
.vscode/settings.json
|
|
5
|
-
.history
|
|
6
|
-
.yarn
|
|
7
|
-
dist
|
|
8
|
-
dist-dev
|
|
9
|
-
etc
|
|
10
|
-
external
|
|
11
|
-
node_modules
|
|
12
|
-
temp
|
|
13
|
-
tsc-out
|
|
14
|
-
tsdoc-metadata.json
|
|
15
|
-
target
|
|
16
|
-
output
|
|
17
|
-
rollup.config.js
|
|
18
|
-
build
|
|
19
|
-
.cache
|
|
20
|
-
.vscode
|
|
21
|
-
.rollup.cache
|
|
22
|
-
dist
|
|
23
|
-
tsconfig.tsbuildinfo
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "Use React components into your Qwik app",
|
|
3
|
-
"scripts": {
|
|
4
|
-
"fmt": "prettier --write .",
|
|
5
|
-
"fmt.check": "prettier --check ."
|
|
6
|
-
},
|
|
7
|
-
"devDependencies": {
|
|
8
|
-
"@builder.io/qwik-react": "0.0.100",
|
|
9
|
-
"@emotion/react": "11.9.3",
|
|
10
|
-
"@emotion/server": "11.4.0",
|
|
11
|
-
"@emotion/styled": "11.9.3",
|
|
12
|
-
"@mui/material": "5.8.6",
|
|
13
|
-
"@types/react": "18.0.14",
|
|
14
|
-
"@types/react-dom": "18.0.5",
|
|
15
|
-
"react": "18.2.0",
|
|
16
|
-
"react-dom": "18.2.0"
|
|
17
|
-
},
|
|
18
|
-
"__qwik__": {
|
|
19
|
-
"priority": -1,
|
|
20
|
-
"vite": {
|
|
21
|
-
"VITE_IMPORTS": "import { qwikReact } from '@builder.io/qwik-react';",
|
|
22
|
-
"VITE_CONFIG": "",
|
|
23
|
-
"VITE_PLUGINS": "qwikReact(),"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RenderOptions } from '@builder.io/qwik/server';
|
|
2
|
-
import { renderToString } from '@builder.io/qwik-react';
|
|
3
|
-
import { manifest } from '@qwik-client-manifest';
|
|
4
|
-
import Root from './root';
|
|
5
|
-
|
|
6
|
-
export default function (opts: RenderOptions) {
|
|
7
|
-
return renderToString(<Root />, {
|
|
8
|
-
manifest,
|
|
9
|
-
...opts,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource react */
|
|
2
|
-
|
|
3
|
-
import { qwikify$ } from '@builder.io/qwik-react';
|
|
4
|
-
import { Button } from '@mui/material';
|
|
5
|
-
|
|
6
|
-
export function ReactCmp() {
|
|
7
|
-
return (
|
|
8
|
-
<>
|
|
9
|
-
<Button>Button</Button>
|
|
10
|
-
</>
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const ReactRoot = /*#__PURE__*/ qwikify$(ReactCmp);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
16
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
## Cloudflare Pages
|
|
2
|
-
|
|
3
|
-
Cloudflare's [wrangler](https://github.com/cloudflare/wrangler) CLI can be used to preview a production build locally. To start a local server, run:
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
npm run serve
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Then visit [http://localhost:8787/](http://localhost:8787/)
|
|
10
|
-
|
|
11
|
-
### Deployments
|
|
12
|
-
|
|
13
|
-
[Cloudflare Pages](https://pages.cloudflare.com/) are deployable through their [Git provider integrations](https://developers.cloudflare.com/pages/platform/git-integration/).
|
|
14
|
-
|
|
15
|
-
If you don't already have an account, then [create a Cloudflare account here](https://dash.cloudflare.com/sign-up/pages). Next go to your dashboard and follow the [Cloudflare Pages deployment guide](https://developers.cloudflare.com/pages/framework-guides/deploy-anything/).
|
|
16
|
-
|
|
17
|
-
Within the projects "Settings" for "Build and deployments", the "Build command" should be `npm run build`, and the "Build output directory" should be set to `dist`.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "Cloudflare Pages.",
|
|
3
|
-
"scripts": {
|
|
4
|
-
"build.ssr": "vite build --ssr src/entry.cloudflare.tsx",
|
|
5
|
-
"serve": "wrangler pages dev ./dist"
|
|
6
|
-
},
|
|
7
|
-
"devDependencies": {
|
|
8
|
-
"wrangler": "beta"
|
|
9
|
-
},
|
|
10
|
-
"__qwik__": {
|
|
11
|
-
"priority": -1,
|
|
12
|
-
"vite": {
|
|
13
|
-
"VITE_IMPORTS": "",
|
|
14
|
-
"VITE_CONFIG": "ssr: {target: 'webworker', noExternal: true},",
|
|
15
|
-
"VITE_PLUGINS": ""
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
## Express Server
|
|
2
|
-
|
|
3
|
-
This app has a minimal [Express server](https://expressjs.com/) implementation. After running a full build, you can preview the build using the command:
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
npm run serve
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Then visit [http://localhost:8080/](http://localhost:8080/)
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { qwikCity } from '@builder.io/qwik-city/middleware/express';
|
|
2
|
-
import express from 'express';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import render from './entry.ssr';
|
|
6
|
-
|
|
7
|
-
// directories where the static assets are located
|
|
8
|
-
const distDir = join(fileURLToPath(import.meta.url), '..', '..', 'dist');
|
|
9
|
-
const buildDir = join(distDir, 'build');
|
|
10
|
-
|
|
11
|
-
// create the Qwik City express middleware
|
|
12
|
-
const { router, notFound } = qwikCity(render);
|
|
13
|
-
|
|
14
|
-
// create the express server
|
|
15
|
-
const app = express();
|
|
16
|
-
|
|
17
|
-
// static asset handlers
|
|
18
|
-
app.use(`/build`, express.static(buildDir, { immutable: true, maxAge: '1y' }));
|
|
19
|
-
app.use(express.static(distDir, { redirect: false }));
|
|
20
|
-
|
|
21
|
-
// use Qwik City's page and endpoint handler
|
|
22
|
-
app.use(router);
|
|
23
|
-
|
|
24
|
-
// use Qwik City's 404 handler
|
|
25
|
-
app.use(notFound);
|
|
26
|
-
|
|
27
|
-
// start the express server
|
|
28
|
-
app.listen(8080, () => {
|
|
29
|
-
/* eslint-disable */
|
|
30
|
-
console.log(`http://localhost:8080/`);
|
|
31
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
16
|