create-qwik 2.0.0-alpha.9 → 2.0.0-beta.10

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 (32) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs +105 -116
  3. package/dist/starters/apps/base/eslint.config.js +73 -0
  4. package/dist/starters/apps/base/package.json +12 -11
  5. package/dist/starters/apps/base/src/entry.preview.tsx +1 -3
  6. package/dist/starters/apps/base/src/entry.ssr.tsx +23 -25
  7. package/dist/starters/apps/base/tsconfig.json +4 -3
  8. package/dist/starters/apps/base/vite.config.mts +1 -1
  9. package/dist/starters/apps/empty/src/root.tsx +17 -19
  10. package/dist/starters/apps/library/README.md +9 -1
  11. package/dist/starters/apps/library/eslint.config.js +68 -0
  12. package/dist/starters/apps/library/package.json +12 -11
  13. package/dist/starters/apps/library/src/root.tsx +7 -1
  14. package/dist/starters/apps/library/tsconfig.json +1 -1
  15. package/dist/starters/apps/library/vite.config.mts +4 -3
  16. package/dist/starters/apps/playground/src/root.tsx +17 -19
  17. package/dist/starters/apps/playground/src/routes/layout.tsx +1 -13
  18. package/package.json +3 -4
  19. package/dist/starters/apps/base/.eslintignore +0 -38
  20. package/dist/starters/apps/base/.eslintrc.cjs +0 -42
  21. package/dist/starters/apps/base/src/entry.dev.tsx +0 -17
  22. package/dist/starters/apps/base/src/routes/service-worker.ts +0 -17
  23. package/dist/starters/apps/empty/public/manifest.json +0 -9
  24. package/dist/starters/apps/empty/src/components/router-head/router-head.tsx +0 -32
  25. package/dist/starters/apps/empty/src/routes/layout.tsx +0 -17
  26. package/dist/starters/apps/empty/src/routes/service-worker.ts +0 -18
  27. package/dist/starters/apps/library/.eslintignore +0 -31
  28. package/dist/starters/apps/library/.eslintrc.cjs +0 -40
  29. package/dist/starters/apps/library/src/entry.dev.tsx +0 -17
  30. package/dist/starters/apps/library/src/entry.ssr.tsx +0 -25
  31. package/dist/starters/apps/playground/src/components/router-head/router-head.tsx +0 -37
  32. package/dist/starters/apps/playground/src/routes/service-worker.ts +0 -18
@@ -1,9 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/web-manifest-combined.json",
3
- "name": "qwik-project-name",
4
- "short_name": "Welcome to Qwik",
5
- "start_url": ".",
6
- "display": "standalone",
7
- "background_color": "#fff",
8
- "description": "A Qwik project app."
9
- }
@@ -1,32 +0,0 @@
1
- import { useDocumentHead, useLocation } from "@qwik.dev/router";
2
- import { component$ } from "@qwik.dev/core";
3
-
4
- /**
5
- * The RouterHead component is placed inside of the document `<head>` element.
6
- */
7
- export const RouterHead = component$(() => {
8
- const head = useDocumentHead();
9
- const loc = useLocation();
10
-
11
- return (
12
- <>
13
- <title>{head.title}</title>
14
-
15
- <link rel="canonical" href={loc.url.href} />
16
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
17
- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
18
-
19
- {head.meta.map((m) => (
20
- <meta key={m.key} {...m} />
21
- ))}
22
-
23
- {head.links.map((l) => (
24
- <link key={l.key} {...l} />
25
- ))}
26
-
27
- {head.styles.map((s) => (
28
- <style key={s.key} {...s.props} dangerouslySetInnerHTML={s.style} />
29
- ))}
30
- </>
31
- );
32
- });
@@ -1,17 +0,0 @@
1
- import type { RequestHandler } from "@qwik.dev/router";
2
- import { component$, Slot } from "@qwik.dev/core";
3
-
4
- export const onGet: RequestHandler = async ({ cacheControl }) => {
5
- // Control caching for this request for best performance and to reduce hosting costs:
6
- // https://qwik.dev/docs/caching/
7
- cacheControl({
8
- // Always serve a cached response by default, up to a week stale
9
- staleWhileRevalidate: 60 * 60 * 24 * 7,
10
- // Max once every 5 seconds, revalidate on the server to get a fresh version of this page
11
- maxAge: 5,
12
- });
13
- };
14
-
15
- export default component$(() => {
16
- return <Slot />;
17
- });
@@ -1,18 +0,0 @@
1
- /*
2
- * WHAT IS THIS FILE?
3
- *
4
- * The service-worker.ts file is used to have state of the art prefetching.
5
- * https://qwik.dev/docs/advanced/speculative-module-fetching/
6
- *
7
- * Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.
8
- * You can also use this file to add more functionality that runs in the service worker.
9
- */
10
- import { setupServiceWorker } from "@qwik.dev/router/service-worker";
11
-
12
- setupServiceWorker();
13
-
14
- addEventListener("install", () => self.skipWaiting());
15
-
16
- addEventListener("activate", () => self.clients.claim());
17
-
18
- declare const self: ServiceWorkerGlobalScope;
@@ -1,31 +0,0 @@
1
- **/*.log
2
- **/.DS_Store
3
- *.
4
- .vscode/settings.json
5
- .history
6
- .yarn
7
- bazel-*
8
- bazel-bin
9
- bazel-out
10
- bazel-qwik
11
- bazel-testlogs
12
- dist
13
- dist-dev
14
- lib
15
- lib-types
16
- etc
17
- external
18
- node_modules
19
- temp
20
- tsc-out
21
- tsdoc-metadata.json
22
- target
23
- output
24
- rollup.config.js
25
- build
26
- .cache
27
- .vscode
28
- .rollup.cache
29
- dist
30
- tsconfig.tsbuildinfo
31
- vite.config.mts
@@ -1,40 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- browser: true,
5
- es2021: true,
6
- node: true,
7
- },
8
- extends: [
9
- "eslint:recommended",
10
- "plugin:@typescript-eslint/recommended",
11
- "plugin:qwik/recommended",
12
- ],
13
- parser: "@typescript-eslint/parser",
14
- parserOptions: {
15
- tsconfigRootDir: __dirname,
16
- project: ["./tsconfig.json"],
17
- ecmaVersion: 2021,
18
- sourceType: "module",
19
- ecmaFeatures: {
20
- jsx: true,
21
- },
22
- },
23
- plugins: ["@typescript-eslint"],
24
- rules: {
25
- "@typescript-eslint/no-explicit-any": "off",
26
- "@typescript-eslint/explicit-module-boundary-types": "off",
27
- "@typescript-eslint/no-inferrable-types": "off",
28
- "@typescript-eslint/no-non-null-assertion": "off",
29
- "@typescript-eslint/no-empty-interface": "off",
30
- "@typescript-eslint/no-namespace": "off",
31
- "@typescript-eslint/no-empty-function": "off",
32
- "@typescript-eslint/no-this-alias": "off",
33
- "@typescript-eslint/ban-types": "off",
34
- "@typescript-eslint/ban-ts-comment": "off",
35
- "prefer-spread": "off",
36
- "no-case-declarations": "off",
37
- "no-console": "off",
38
- "@typescript-eslint/no-unused-vars": ["error"],
39
- },
40
- };
@@ -1,17 +0,0 @@
1
- /*
2
- * WHAT IS THIS FILE?
3
- *
4
- * Development entry point using only client-side modules:
5
- * - Do not use this mode in production!
6
- * - No SSR
7
- * - No portion of the application is pre-rendered on the server.
8
- * - All of the application is running eagerly in the browser.
9
- * - More code is transferred to the browser than in SSR mode.
10
- * - Optimizer/Serialization/Deserialization code is not exercised!
11
- */
12
- import { render, type RenderOptions } from "@qwik.dev/core";
13
- import Root from "./root";
14
-
15
- export default function (opts: RenderOptions) {
16
- return render(document, <Root />, opts);
17
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * WHAT IS THIS FILE?
3
- *
4
- * SSR entry point, in all cases the application is rendered outside the browser, this
5
- * entry point will be the common one.
6
- *
7
- * - Server (express, cloudflare...)
8
- * - npm run start
9
- * - npm run preview
10
- * - npm run build
11
- *
12
- */
13
- import { manifest } from "@qwik-client-manifest";
14
- import {
15
- renderToStream,
16
- type RenderToStreamOptions,
17
- } from "@qwik.dev/core/server";
18
- import Root from "./root";
19
-
20
- export default function (opts: RenderToStreamOptions) {
21
- return renderToStream(<Root />, {
22
- manifest,
23
- ...opts,
24
- });
25
- }
@@ -1,37 +0,0 @@
1
- import { useDocumentHead, useLocation } from "@qwik.dev/router";
2
-
3
- import { component$ } from "@qwik.dev/core";
4
-
5
- /**
6
- * The RouterHead component is placed inside of the document `<head>` element.
7
- */
8
- export const RouterHead = component$(() => {
9
- const head = useDocumentHead();
10
- const loc = useLocation();
11
-
12
- return (
13
- <>
14
- <title>{head.title}</title>
15
-
16
- <link rel="canonical" href={loc.url.href} />
17
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
18
- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
19
-
20
- {head.meta.map((m) => (
21
- <meta key={m.key} {...m} />
22
- ))}
23
-
24
- {head.links.map((l) => (
25
- <link key={l.key} {...l} />
26
- ))}
27
-
28
- {head.styles.map((s) => (
29
- <style key={s.key} {...s.props} dangerouslySetInnerHTML={s.style} />
30
- ))}
31
-
32
- {head.scripts.map((s) => (
33
- <script key={s.key} {...s.props} dangerouslySetInnerHTML={s.script} />
34
- ))}
35
- </>
36
- );
37
- });
@@ -1,18 +0,0 @@
1
- /*
2
- * WHAT IS THIS FILE?
3
- *
4
- * The service-worker.ts file is used to have state of the art prefetching.
5
- * https://qwik.dev/docs/advanced/speculative-module-fetching/
6
- *
7
- * Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.
8
- * You can also use this file to add more functionality that runs in the service worker.
9
- */
10
- import { setupServiceWorker } from "@qwik.dev/router/service-worker";
11
-
12
- setupServiceWorker();
13
-
14
- addEventListener("install", () => self.skipWaiting());
15
-
16
- addEventListener("activate", () => self.clients.claim());
17
-
18
- declare const self: ServiceWorkerGlobalScope;