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.
Files changed (73) hide show
  1. package/README.md +7 -19
  2. package/create-qwik.cjs +3 -0
  3. package/index.cjs +125 -0
  4. package/package.json +11 -7
  5. package/starters/apps/base/.prettierignore +6 -0
  6. package/starters/apps/base/README.md +6 -16
  7. package/starters/apps/base/gitignore +4 -6
  8. package/starters/apps/base/package.json +15 -18
  9. package/starters/apps/base/public/favicon.ico +0 -0
  10. package/starters/apps/base/public/favicons/android-chrome-192x192.png +0 -0
  11. package/starters/apps/base/public/favicons/apple-touch-icon.png +0 -0
  12. package/starters/apps/base/public/favicons/favicon-16x16.png +0 -0
  13. package/starters/apps/base/public/favicons/favicon-32x32.png +0 -0
  14. package/starters/apps/base/public/favicons/favicon.svg +13 -0
  15. package/starters/apps/base/src/entry.preview.tsx +6 -0
  16. package/starters/apps/base/src/entry.ssr.tsx +7 -5
  17. package/starters/apps/base/tsconfig.json +5 -4
  18. package/starters/apps/base/vite.config.ts +1 -6
  19. package/starters/apps/blank/dist/q-manifest.json +105 -0
  20. package/starters/apps/blank/package.json +1 -16
  21. package/starters/apps/blank/src/entry.preview.tsx +18 -0
  22. package/starters/apps/blank/src/root.tsx +2 -2
  23. package/starters/apps/{qwik-city → library}/tsconfig.json +1 -4
  24. package/starters/apps/library/vite.config.ts +1 -6
  25. package/starters/apps/qwik-city/{public → dist}/favicons/android-chrome-192x192.png +0 -0
  26. package/starters/apps/qwik-city/{public → dist}/favicons/android-chrome-256x256.png +0 -0
  27. package/starters/apps/qwik-city/{public → dist}/favicons/apple-touch-icon.png +0 -0
  28. package/starters/apps/qwik-city/{public → dist}/favicons/favicon.svg +0 -0
  29. package/starters/apps/qwik-city/{public → dist}/logos/qwik-logo.svg +0 -0
  30. package/starters/apps/qwik-city/{public → dist}/logos/qwik.svg +0 -0
  31. package/starters/apps/qwik-city/dist/q-manifest.json +904 -0
  32. package/starters/apps/qwik-city/dist/service-worker.js +167 -0
  33. package/starters/apps/qwik-city/package.json +2 -13
  34. package/starters/apps/qwik-city/src/components/menu/menu.tsx +4 -4
  35. package/starters/apps/{perf.prod → qwik-city}/src/entry.ssr.tsx +7 -5
  36. package/starters/apps/qwik-city/src/root.tsx +4 -4
  37. package/starters/apps/qwik-city/src/routes/service-worker.ts +10 -0
  38. package/starters/apps/qwik-city/vite.config.ts +1 -8
  39. package/create-qwik +0 -107
  40. package/index.js +0 -22
  41. package/starters/apps/blank/src/entry.express.tsx +0 -59
  42. package/starters/apps/perf.prod/package.json +0 -22
  43. package/starters/apps/perf.prod/src/components/app/app.tsx +0 -189
  44. package/starters/apps/perf.prod/src/entry.express.tsx +0 -59
  45. package/starters/apps/perf.prod/src/global.css +0 -3
  46. package/starters/apps/perf.prod/src/root.tsx +0 -18
  47. package/starters/apps/qwik-city/public/_headers +0 -2
  48. package/starters/apps/qwik-city/public/favicon.ico +0 -0
  49. package/starters/features/prettier/.prettierignore +0 -23
  50. package/starters/features/prettier/package.json +0 -10
  51. package/starters/features/react/package.json +0 -26
  52. package/starters/features/react/src/entry.ssr.tsx +0 -11
  53. package/starters/features/react/src/react/app.tsx +0 -14
  54. package/starters/features/tailwindcss/package.json +0 -8
  55. package/starters/features/tailwindcss/postcss.config.cjs +0 -6
  56. package/starters/features/tailwindcss/src/global.css +0 -3
  57. package/starters/features/tailwindcss/tailwind.config.cjs +0 -7
  58. package/starters/servers/cloudflare-pages/.node-version +0 -1
  59. package/starters/servers/cloudflare-pages/README.md +0 -17
  60. package/starters/servers/cloudflare-pages/functions/[[path]].ts +0 -5
  61. package/starters/servers/cloudflare-pages/package.json +0 -18
  62. package/starters/servers/cloudflare-pages/public/_headers +0 -2
  63. package/starters/servers/cloudflare-pages/src/entry.cloudflare.tsx +0 -4
  64. package/starters/servers/express/README.md +0 -9
  65. package/starters/servers/express/package.json +0 -11
  66. package/starters/servers/express/src/entry.express.tsx +0 -31
  67. package/starters/servers/netlify-edge/.node-version +0 -1
  68. package/starters/servers/netlify-edge/README.md +0 -39
  69. package/starters/servers/netlify-edge/netlify.toml +0 -10
  70. package/starters/servers/netlify-edge/package.json +0 -19
  71. package/starters/servers/netlify-edge/public/_headers +0 -2
  72. package/starters/servers/netlify-edge/src/entry.netlify.ts +0 -6
  73. package/starters/servers/netlify-edge/tsconfig.json +0 -17
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "create-qwik",
3
- "version": "0.0.108",
4
- "description": "Interactive CLI and API for generating Qwik projects.",
5
- "bin": "create-qwik",
6
- "main": "index.js",
3
+ "version": "0.0.109-0",
4
+ "description": "Interactive CLI for create Qwik projects and adding features.",
5
+ "bin": "./create-qwik.cjs",
6
+ "main": "./index.cjs",
7
7
  "files": [
8
- "create-qwik",
8
+ "create-qwik.cjs",
9
+ "index.cjs",
9
10
  "starters/"
10
11
  ],
11
12
  "author": "Builder.io Team",
@@ -13,7 +14,9 @@
13
14
  "keywords": [
14
15
  "qwik",
15
16
  "generator",
16
- "builder.io"
17
+ "builder.io",
18
+ "starters",
19
+ "template"
17
20
  ],
18
21
  "homepage": "https://qwik.builder.io/",
19
22
  "repository": {
@@ -27,10 +30,11 @@
27
30
  "devDependencies": {
28
31
  "@types/prompts": "2.0.14",
29
32
  "kleur": "4.1.5",
33
+ "ora": "^6.1.2",
30
34
  "prompts": "2.4.2"
31
35
  },
32
36
  "engines": {
33
- "node": ">=14",
37
+ "node": ">=14.18",
34
38
  "npm": ">=6.0.0"
35
39
  }
36
40
  }
@@ -0,0 +1,6 @@
1
+ # Files Prettier should not format
2
+ **/*.log
3
+ **/.DS_Store
4
+ *.
5
+ dist
6
+ node_modules
@@ -1,24 +1,14 @@
1
- ## Development Builds
1
+ ## Development Build
2
2
 
3
- ### Client only
4
-
5
- During development, the index.html is not a result of server-side rendering, but rather the Qwik app is built using client-side JavaScript only. This is ideal for development with Vite and its ability to reload modules quickly and on-demand. However, this mode is only for development and does not showcase "how" Qwik works since JavaScript is required to execute, and Vite imports many development modules for the app to work.
3
+ Server-side rendered index.html, with client-side modules prefetched and loaded by the browser.
6
4
 
7
5
  ```
8
6
  npm run dev
9
7
  ```
10
8
 
11
- ### Server-side Rendering (SSR) and Client
12
-
13
- Server-side rendered index.html, with client-side modules prefetched and loaded by the browser. This can be used to test out server-side rendered content during development, but will be slower than the client-only development builds.
14
-
15
- ```
16
- npm run dev.ssr
17
- ```
18
-
19
9
  ## Production Builds
20
10
 
21
- A production build should generate the client and server modules by running both client and server build commands.
11
+ The production build should generate the client and server modules by running both client and server build commands. Additionally, the build command will use Typescript run a type check on the source.
22
12
 
23
13
  ```
24
14
  npm run build
@@ -32,10 +22,10 @@ Production build that creates only the client-side modules that are dynamically
32
22
  npm run build.client
33
23
  ```
34
24
 
35
- ### Server Modules
25
+ ### Preview
36
26
 
37
- Production build that creates the server-side render (SSR) module that is used by the server to render the HTML.
27
+ The preview command is intended for previewing the build locally and not meant as a production server.
38
28
 
39
29
  ```
40
- npm run build.ssr
30
+ npm run preview
41
31
  ```
@@ -1,9 +1,7 @@
1
1
  # Build
2
- build
3
- dist
4
- lib
5
- server
6
- functions/**/*.js
2
+ /dist
3
+ /lib
4
+ /server
7
5
 
8
6
  # Development
9
7
  node_modules
@@ -36,4 +34,4 @@ lerna-debug.log*
36
34
 
37
35
  # Yarn
38
36
  .yarn/*
39
- !.yarn/releases
37
+ !.yarn/releases
@@ -1,35 +1,32 @@
1
1
  {
2
2
  "name": "qwik-project-name",
3
- "description": "",
4
- "license": "",
5
3
  "scripts": {
6
- "build": "npm run typecheck && npm run build.client && npm run build.ssr",
4
+ "build": "qwik build",
7
5
  "build.client": "vite build",
8
- "build.ssr": "vite build --ssr src/entry.ssr.tsx",
9
- "dev": "npm run dev.ssr",
10
- "dev.client": "vite",
11
- "dev.ssr": "node --inspect node_modules/vite/bin/vite.js --mode ssr",
12
- "dev.debug": "node --inspect-brk node_modules/vite/bin/vite.js --force --mode ssr",
13
- "start": "npm run dev",
6
+ "build.preview": "vite build --ssr src/entry.preview.tsx",
7
+ "dev": "vite --mode ssr",
8
+ "fmt": "prettier --write .",
9
+ "fmt.check": "prettier --check .",
14
10
  "lint": "eslint \"src/**/*.ts*\"",
15
- "typecheck": "tsc --incremental --noEmit"
11
+ "preview": "qwik build preview && vite preview",
12
+ "start": "vite --mode ssr",
13
+ "typecheck": "tsc --incremental --noEmit",
14
+ "qwik": "qwik"
16
15
  },
17
16
  "devDependencies": {
18
17
  "@builder.io/qwik": "0.0.108",
18
+ "@builder.io/qwik-city": "0.0.110-0",
19
19
  "@types/eslint": "8.4.6",
20
20
  "@types/node": "latest",
21
21
  "@typescript-eslint/eslint-plugin": "5.34.0",
22
22
  "@typescript-eslint/parser": "5.34.0",
23
- "eslint-plugin-qwik": "0.0.108",
23
+ "eslint-plugin-qwik": "latest",
24
24
  "eslint": "8.22.0",
25
25
  "node-fetch": "3.2.10",
26
+ "prettier": "2.7.1",
26
27
  "typescript": "4.7.4",
27
- "vite": "3.0.9"
28
+ "vite": "3.0.9",
29
+ "vite-tsconfig-paths": "3.5.0"
28
30
  },
29
- "type": "module",
30
- "homepage": "https://qwik.builder.io/",
31
- "private": true,
32
- "engines": {
33
- "node": "^14.18.0 || >=16.0.0"
34
- }
31
+ "private": true
35
32
  }
@@ -0,0 +1,13 @@
1
+ <svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_645_1322)">
3
+ <circle cx="250" cy="250" r="250" fill="white"/>
4
+ <path d="M367.865 418.452L306.699 357.271L305.765 357.405V356.734L175.687 227.529L207.739 196.402L188.908 87.7251L99.5631 199.085C84.3384 214.515 81.5338 239.604 92.4849 258.12L148.309 351.233C156.856 365.589 172.348 374.176 189.042 374.042L216.687 373.773L367.865 418.452Z" fill="#18B6F6"/>
5
+ <path d="M401.247 196.938L388.961 174.129L382.55 162.457L380.013 157.895L379.746 158.163L346.091 99.5314C337.677 84.7728 321.918 75.6493 304.824 75.7834L275.309 76.5884L187.3 76.8568C170.606 76.9909 155.381 85.8461 146.968 100.202L93.4141 207.001L189.17 87.4562L314.707 226.187L292.404 248.861L305.759 357.404L305.892 357.136V357.404H305.625L305.892 357.672L316.309 367.869L366.925 417.646C369.062 419.658 372.534 417.243 371.065 414.694L339.814 352.842L394.303 251.545L396.039 249.532C396.707 248.727 397.374 247.922 397.909 247.117C408.592 232.493 410.062 212.904 401.247 196.938Z" fill="#AC7EF4"/>
6
+ <path d="M315.106 225.651L189.168 87.5908L207.064 195.731L175.012 226.992L305.49 357.27L293.738 249.13L315.106 225.651Z" fill="white"/>
7
+ </g>
8
+ <defs>
9
+ <clipPath id="clip0_645_1322">
10
+ <rect width="500" height="500" fill="white"/>
11
+ </clipPath>
12
+ </defs>
13
+ </svg>
@@ -0,0 +1,6 @@
1
+ import { qwikCity } from '@builder.io/qwik-city/middleware/node';
2
+ import render from './entry.ssr';
3
+
4
+ // Create the Qwik City ssr preview middleware
5
+ // Imported by vite preview
6
+ export default qwikCity(render);
@@ -2,14 +2,16 @@ import { renderToStream, RenderToStreamOptions } from '@builder.io/qwik/server';
2
2
  import { manifest } from '@qwik-client-manifest';
3
3
  import Root from './root';
4
4
 
5
- /**
6
- * Server-Side Render method to be called by a server.
7
- */
8
5
  export default function (opts: RenderToStreamOptions) {
9
- // Render the Root component to a string
10
- // Pass in the manifest that was generated from the client build
11
6
  return renderToStream(<Root />, {
12
7
  manifest,
13
8
  ...opts,
9
+ prefetchStrategy: {
10
+ implementation: {
11
+ linkInsert: null,
12
+ workerFetchInsert: null,
13
+ prefetchEvent: 'always',
14
+ },
15
+ },
14
16
  });
15
17
  }
@@ -3,19 +3,20 @@
3
3
  "allowJs": true,
4
4
  "target": "ES2017",
5
5
  "module": "ES2020",
6
- "lib": ["es2020", "DOM"],
6
+ "lib": ["es2020", "DOM", "WebWorker"],
7
7
  "jsx": "react-jsx",
8
8
  "jsxImportSource": "@builder.io/qwik",
9
9
  "strict": true,
10
- "declaration": true,
11
- "declarationDir": "lib/types",
12
10
  "resolveJsonModule": true,
13
11
  "moduleResolution": "node",
14
12
  "esModuleInterop": true,
15
13
  "skipLibCheck": true,
16
14
  "incremental": true,
17
15
  "isolatedModules": true,
18
- "types": ["vite/client"]
16
+ "types": ["node", "vite/client"],
17
+ "paths": {
18
+ "~/*": ["./src/*"]
19
+ }
19
20
  },
20
21
  "include": ["src"]
21
22
  }
@@ -1,13 +1,8 @@
1
1
  import { defineConfig } from 'vite';
2
2
  import { qwikVite } from '@builder.io/qwik/optimizer';
3
- /* VITE_IMPORTS */
4
3
 
5
4
  export default defineConfig(() => {
6
5
  return {
7
- /* VITE_CONFIG */
8
- plugins: [
9
- qwikVite(/* VITE_QWIK */),
10
- /* VITE_PLUGINS */
11
- ],
6
+ plugins: [qwikVite()],
12
7
  };
13
8
  });
@@ -0,0 +1,105 @@
1
+ {
2
+ "symbols": {
3
+ "App_component_div_ol_li_input_onInput_oPPkAujMiqs": {
4
+ "origin": "components/app/app.tsx",
5
+ "displayName": "App_component_div_ol_li_input_onInput",
6
+ "canonicalFilename": "app_component_div_ol_li_input_oninput_oppkaujmiqs",
7
+ "hash": "oPPkAujMiqs",
8
+ "ctxKind": "event",
9
+ "ctxName": "onInput$",
10
+ "captures": true,
11
+ "parent": "App_component_jn5XSz7NZ88"
12
+ },
13
+ "Logo_component_XH6xhie7rRc": {
14
+ "origin": "components/logo/logo.tsx",
15
+ "displayName": "Logo_component",
16
+ "canonicalFilename": "logo_component_xh6xhie7rrc",
17
+ "hash": "XH6xhie7rRc",
18
+ "ctxKind": "function",
19
+ "ctxName": "component$",
20
+ "captures": false,
21
+ "parent": null
22
+ },
23
+ "App_component_jn5XSz7NZ88": {
24
+ "origin": "components/app/app.tsx",
25
+ "displayName": "App_component",
26
+ "canonicalFilename": "app_component_jn5xsz7nz88",
27
+ "hash": "jn5XSz7NZ88",
28
+ "ctxKind": "function",
29
+ "ctxName": "component$",
30
+ "captures": false,
31
+ "parent": null
32
+ }
33
+ },
34
+ "mapping": {
35
+ "App_component_div_ol_li_input_onInput_oPPkAujMiqs": "entry_hooks.js",
36
+ "Logo_component_XH6xhie7rRc": "entry_hooks.js",
37
+ "App_component_jn5XSz7NZ88": "entry_hooks.js"
38
+ },
39
+ "bundles": {
40
+ "entry_hooks.js": {
41
+ "size": 4337,
42
+ "imports": [
43
+ "root2.js"
44
+ ],
45
+ "origins": [
46
+ "src/app_component_div_ol_li_input_oninput_oppkaujmiqs.js",
47
+ "src/app_component_jn5xsz7nz88.js",
48
+ "src/components/logo/logo.js",
49
+ "src/entry_hooks.js",
50
+ "src/logo_component_xh6xhie7rrc.js"
51
+ ],
52
+ "symbols": [
53
+ "App_component_div_ol_li_input_onInput_oPPkAujMiqs",
54
+ "App_component_jn5XSz7NZ88",
55
+ "Logo_component_XH6xhie7rRc"
56
+ ]
57
+ },
58
+ "root.js": {
59
+ "size": 59,
60
+ "imports": [
61
+ "root2.js"
62
+ ]
63
+ },
64
+ "root2.js": {
65
+ "size": 120082,
66
+ "dynamicImports": [
67
+ "entry_hooks.js"
68
+ ],
69
+ "origins": [
70
+ "../../\u0000vite/preload-helper",
71
+ "../../../packages/qwik/dist/core.mjs",
72
+ "src/components/app/app.js",
73
+ "src/global.css",
74
+ "src/root.js"
75
+ ]
76
+ }
77
+ },
78
+ "injections": [
79
+ {
80
+ "tag": "link",
81
+ "location": "head",
82
+ "attributes": {
83
+ "rel": "stylesheet",
84
+ "href": "/build/root.css"
85
+ }
86
+ }
87
+ ],
88
+ "version": "1",
89
+ "options": {
90
+ "target": "client",
91
+ "buildMode": "development",
92
+ "forceFullBuild": true,
93
+ "entryStrategy": {
94
+ "type": "single"
95
+ }
96
+ },
97
+ "platform": {
98
+ "qwik": "0.0.108-dev20220913044450",
99
+ "vite": "",
100
+ "rollup": "2.77.3",
101
+ "env": "node",
102
+ "os": "darwin",
103
+ "node": "16.16.0"
104
+ }
105
+ }
@@ -1,22 +1,7 @@
1
1
  {
2
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
3
  "type": "module",
12
4
  "__qwik__": {
13
- "priority": 0,
14
- "featureOptions": [
15
- "prettier",
16
- "tailwindcss"
17
- ],
18
- "featureEnabled": [
19
- "prettier"
20
- ]
5
+ "priority": 0
21
6
  }
22
7
  }
@@ -0,0 +1,18 @@
1
+ import type { IncomingMessage, ServerResponse } from 'http';
2
+ import render from './entry.ssr';
3
+
4
+ // Create the Qwik ssr preview middleware
5
+ // Imported by vite preview
6
+ export default async function (req: IncomingMessage, res: ServerResponse, next: (e?: any) => void) {
7
+ try {
8
+ await render({
9
+ stream: res,
10
+ envData: {
11
+ url: `http://${req.headers.host}${req.url}`,
12
+ },
13
+ });
14
+ res.end();
15
+ } catch (e) {
16
+ next(e);
17
+ }
18
+ }
@@ -2,7 +2,7 @@ import { App } from './components/app/app';
2
2
 
3
3
  import './global.css';
4
4
 
5
- export default () => {
5
+ export default function () {
6
6
  return (
7
7
  <html>
8
8
  <head>
@@ -15,4 +15,4 @@ export default () => {
15
15
  </body>
16
16
  </html>
17
17
  );
18
- };
18
+ }
@@ -15,10 +15,7 @@
15
15
  "skipLibCheck": true,
16
16
  "incremental": true,
17
17
  "isolatedModules": true,
18
- "types": ["vite/client"],
19
- "paths": {
20
- "~/*": ["./src/*"]
21
- }
18
+ "types": ["vite/client"]
22
19
  },
23
20
  "include": ["src"]
24
21
  }
@@ -1,10 +1,8 @@
1
1
  import { defineConfig } from 'vite';
2
2
  import { qwikVite } from '@builder.io/qwik/optimizer';
3
- /* VITE_IMPORTS */
4
3
 
5
4
  export default defineConfig(() => {
6
5
  return {
7
- /* VITE_CONFIG */
8
6
  build: {
9
7
  target: 'es2020',
10
8
  lib: {
@@ -13,9 +11,6 @@ export default defineConfig(() => {
13
11
  fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,
14
12
  },
15
13
  },
16
- plugins: [
17
- qwikVite(/* VITE_QWIK */),
18
- /* VITE_PLUGINS */
19
- ],
14
+ plugins: [qwikVite()],
20
15
  };
21
16
  });