create-qwik 2.0.0-beta.9 → 2.0.0-rc.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.
@@ -27,7 +27,7 @@ build
27
27
  .vscode
28
28
  .rollup.cache
29
29
  tsconfig.tsbuildinfo
30
- vite.config.mts
30
+ vite.config.ts
31
31
  *.spec.tsx
32
32
  *.spec.ts
33
33
  .netlify
@@ -0,0 +1,9 @@
1
+ {
2
+ "servers": {
3
+ "qwik": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@qwik.dev/mcp", "${workspaceFolder}"]
7
+ }
8
+ }
9
+ }
@@ -7,6 +7,7 @@
7
7
  # Development
8
8
  node_modules
9
9
  .env
10
+ .planning
10
11
  *.local
11
12
 
12
13
  # Cache
@@ -28,6 +29,7 @@ lerna-debug.log*
28
29
  .vscode/*
29
30
  !.vscode/launch.json
30
31
  !.vscode/*.code-snippets
32
+ !.vscode/mcp.json
31
33
 
32
34
  .idea
33
35
  .DS_Store
@@ -16,18 +16,18 @@
16
16
  "qwik": "qwik"
17
17
  },
18
18
  "devDependencies": {
19
- "@qwik.dev/core": "^2.0.0-beta.9",
20
- "@qwik.dev/router": "^2.0.0-beta.9",
19
+ "@qwik.dev/core": "^2.0.0-rc.0",
20
+ "@qwik.dev/router": "^2.0.0-rc.0",
21
21
  "@eslint/js": "latest",
22
- "@types/node": "24.2.1",
23
- "typescript-eslint": "8.39.1",
24
- "eslint": "9.33.0",
25
- "eslint-plugin-qwik": "^2.0.0-beta.9",
26
- "globals": "16.3.0",
27
- "prettier": "3.6.2",
28
- "typescript": "5.8.3",
22
+ "@types/node": "25.6.0",
23
+ "typescript-eslint": "8.56.1",
24
+ "eslint": "10.0.3",
25
+ "eslint-plugin-qwik": "^2.0.0-rc.0",
26
+ "globals": "17.0.0",
27
+ "prettier": "3.7.4",
28
+ "typescript": "5.9.3",
29
29
  "typescript-plugin-css-modules": "latest",
30
- "vite": "7.1.0",
30
+ "vite": "8.2.1",
31
31
  "vite-tsconfig-paths": "^4.2.1"
32
32
  },
33
33
  "engines": {
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "allowJs": true,
4
- "target": "ES2017",
5
- "module": "ES2022",
4
+ "target": "es2020",
5
+ "module": "esnext",
6
6
  "lib": ["es2022", "DOM", "WebWorker", "DOM.Iterable"],
7
7
  "jsx": "react-jsx",
8
8
  "jsxImportSource": "@qwik.dev/core",
@@ -79,24 +79,11 @@ function errorOnDuplicatesPkgDeps(
79
79
  (dep) => dependencies[dep],
80
80
  );
81
81
 
82
- // include any known qwik packages
83
- const qwikPkg = Object.keys(dependencies).filter((value) =>
84
- /qwik/i.test(value),
85
- );
86
-
87
- // any errors for missing "qwik-router-config"
88
- // [PLUGIN_ERROR]: Invalid module "@qwik-router-config" is not a valid package
89
- msg = `Move qwik packages ${qwikPkg.join(", ")} to devDependencies`;
90
-
91
- if (qwikPkg.length > 0) {
92
- throw new Error(msg);
93
- }
94
-
95
82
  // Format the error message with the duplicates list.
96
83
  // The `join` function is used to represent the elements of the 'duplicateDeps' array as a comma-separated string.
97
84
  msg = `
98
85
  Warning: The dependency "${duplicateDeps.join(", ")}" is listed in both "devDependencies" and "dependencies".
99
- Please move the duplicated dependencies to "devDependencies" only and remove it from "dependencies"
86
+ Please keep each dependency in only one of them
100
87
  `;
101
88
 
102
89
  // Throw an error with the constructed message.
@@ -0,0 +1,9 @@
1
+ {
2
+ "servers": {
3
+ "qwik": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@qwik.dev/mcp", "${workspaceFolder}"]
7
+ }
8
+ }
9
+ }
@@ -45,3 +45,11 @@ The production build should generate the production build of your component libr
45
45
  ```
46
46
  npm run build
47
47
  ```
48
+
49
+ ## sideEffects: false
50
+
51
+ This package is configured with "sideEffects": false in its package.json.<br/>
52
+ This tells bundlers that the module [has no side effects](https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free) when imported.<br/>
53
+ Consequently, to maintain the integrity of tree-shaking optimizations, please ensure your code truly contains no side effects (such as modifying global variables or the DOM upon import).<br/>
54
+ If your module does introduce side effects, remove "sideEffects": false or specify the specific files with side effects.<br/>
55
+ Be sure to only remove it from the specific file where the global is being set. Finally, verify that your build continues to function as expected after making any adjustments to the sideEffects setting.
@@ -10,7 +10,7 @@ node_modules
10
10
  # Cache
11
11
  .cache
12
12
  .mf
13
- .vscode
13
+ .vscode/*
14
14
  .rollup.cache
15
15
  tsconfig.tsbuildinfo
16
16
 
@@ -25,6 +25,7 @@ lerna-debug.log*
25
25
 
26
26
  # Editor
27
27
  !.vscode/extensions.json
28
+ !.vscode/mcp.json
28
29
  .idea
29
30
  .DS_Store
30
31
  *.suo
@@ -5,23 +5,22 @@
5
5
  "private": false,
6
6
  "main": "./lib/index.qwik.mjs",
7
7
  "qwik": "./lib/index.qwik.mjs",
8
- "types": "./lib-types/index.d.ts",
8
+ "types": "./lib/index.d.ts",
9
9
  "type": "module",
10
10
  "exports": {
11
11
  ".": {
12
+ "types": "./lib/index.d.ts",
12
13
  "import": "./lib/index.qwik.mjs",
13
- "require": "./lib/index.qwik.cjs",
14
- "types": "./lib-types/index.d.ts"
14
+ "require": "./lib/index.qwik.cjs"
15
15
  }
16
16
  },
17
17
  "files": [
18
- "lib",
19
- "lib-types"
18
+ "lib"
20
19
  ],
21
20
  "scripts": {
22
21
  "build": "qwik build",
23
22
  "build.lib": "vite build --mode lib",
24
- "build.types": "tsc --emitDeclarationOnly",
23
+ "build.types": "tsc -p tsconfig.types.json --emitDeclarationOnly --incremental false",
25
24
  "dev": "vite --mode ssr",
26
25
  "dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
27
26
  "fmt": "prettier --write .",
@@ -32,18 +31,28 @@
32
31
  "qwik": "qwik",
33
32
  "release": "np"
34
33
  },
34
+ "peerDependencies": {
35
+ "@qwik.dev/core": "^2.0.0-rc.0",
36
+ "@qwik.dev/router": "^2.0.0-rc.0"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "@qwik.dev/router": {
40
+ "optional": true
41
+ }
42
+ },
35
43
  "devDependencies": {
36
- "@qwik.dev/core": "2.0.0-beta.9",
44
+ "@qwik.dev/core": "2.0.0-rc.0",
45
+ "@qwik.dev/router": "latest",
37
46
  "@eslint/js": "latest",
38
- "@types/node": "24.2.1",
39
- "typescript-eslint": "8.39.1",
40
- "eslint": "9.33.0",
41
- "eslint-plugin-qwik": "2.0.0-beta.9",
42
- "globals": "16.3.0",
47
+ "@types/node": "25.6.0",
48
+ "typescript-eslint": "8.56.1",
49
+ "eslint": "10.0.3",
50
+ "eslint-plugin-qwik": "2.0.0-rc.0",
51
+ "globals": "17.0.0",
43
52
  "np": "^8.0.4",
44
- "prettier": "3.6.2",
45
- "typescript": "5.8.3",
46
- "vite": "7.1.0",
53
+ "prettier": "3.7.4",
54
+ "typescript": "5.9.3",
55
+ "vite": "8.2.1",
47
56
  "vite-tsconfig-paths": "^4.2.1"
48
57
  },
49
58
  "__qwik__": {
@@ -52,5 +61,6 @@
52
61
  "docs": [
53
62
  "https://qwik.dev/docs/getting-started/"
54
63
  ]
55
- }
64
+ },
65
+ "sideEffects": false
56
66
  }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * SSR renderer function, used by Qwik Router.
5
+ *
6
+ * Note that this is the only place the Qwik renderer is called.
7
+ * On the client, containers resume and do not call render.
8
+ */
9
+ import { createRenderer } from "@qwik.dev/router";
10
+ import Root from "./root";
11
+
12
+ export default createRenderer((opts) => {
13
+ return {
14
+ jsx: <Root />,
15
+ options: {
16
+ ...opts,
17
+ // Use container attributes to set attributes on the html tag.
18
+ containerAttributes: {
19
+ lang: "en-us",
20
+ ...opts.containerAttributes,
21
+ },
22
+ serverData: {
23
+ ...opts.serverData,
24
+ // These are the default values for the document head and are overridden by the `head` exports
25
+ // documentHead: {
26
+ // title: "My App",
27
+ // },
28
+ },
29
+ },
30
+ };
31
+ });
@@ -0,0 +1,33 @@
1
+ /**
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * Globally applied styles. No matter which components are in the page or matching route,
5
+ * the styles in here will be applied to the Document, without any sort of CSS scoping.
6
+ *
7
+ */
8
+ html {
9
+ -webkit-text-size-adjust: 100%;
10
+ -moz-tab-size: 4;
11
+ -o-tab-size: 4;
12
+ tab-size: 4;
13
+ font-family:
14
+ ui-sans-serif,
15
+ system-ui,
16
+ -apple-system,
17
+ BlinkMacSystemFont,
18
+ "Segoe UI",
19
+ Roboto,
20
+ "Helvetica Neue",
21
+ Arial,
22
+ "Noto Sans",
23
+ sans-serif,
24
+ "Apple Color Emoji",
25
+ "Segoe UI Emoji",
26
+ "Segoe UI Symbol",
27
+ "Noto Color Emoji";
28
+ }
29
+
30
+ body {
31
+ padding: 0;
32
+ line-height: inherit;
33
+ }
@@ -1,23 +1,35 @@
1
- import { Counter } from "./components/counter/counter";
2
- import { Logo } from "./components/logo/logo";
1
+ import { component$ } from "@qwik.dev/core";
2
+ import {
3
+ DocumentHeadTags,
4
+ RouterOutlet,
5
+ useLocation,
6
+ useQwikRouter,
7
+ } from "@qwik.dev/router";
8
+
9
+ import "./global.css";
10
+
11
+ export default component$(() => {
12
+ useQwikRouter();
13
+ const { url } = useLocation();
14
+
15
+ /**
16
+ * This is the root of a QwikRouter site. It contains the document's `<head>` and `<body>`. You can adjust them as you see fit.
17
+ */
3
18
 
4
- export default () => {
5
19
  return (
6
20
  <>
7
21
  <head>
8
22
  <meta charset="utf-8" />
9
- <title>Qwik Library Starter</title>
23
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
24
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
25
+
26
+ <DocumentHeadTags />
27
+
28
+ <link rel="canonical" href={url.href} />
10
29
  </head>
11
30
  <body>
12
- <h1>Qwik Library Starter</h1>
13
- <p>
14
- This is a Qwik library starter. Make your components and export them
15
- from `src/index.ts`. This playground app will not be bundled with your
16
- library.
17
- </p>
18
- <Logo />
19
- <Counter />
31
+ <RouterOutlet />
20
32
  </body>
21
33
  </>
22
34
  );
23
- };
35
+ });
@@ -0,0 +1,19 @@
1
+ import { component$ } from "@qwik.dev/core";
2
+ import { Logo } from "../components/logo/logo";
3
+ import { Counter } from "../components/counter/counter";
4
+
5
+ export default component$(() => {
6
+ return (
7
+ <>
8
+ <h1>Qwik Library Starter</h1>
9
+ <p>
10
+ This is a playground meant for testing your library. Make your
11
+ components and export them from `src/index.ts`. This playground app will
12
+ not be bundled with your library. You can use the Router like a normal
13
+ Qwik app with the Qwik Router.
14
+ </p>
15
+ <Logo />
16
+ <Counter />
17
+ </>
18
+ );
19
+ });
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "allowJs": true,
4
- "target": "ES2017",
5
- "module": "ES2020",
4
+ "target": "es2020",
5
+ "module": "esnext",
6
6
  "lib": ["es2020", "DOM"],
7
7
  "jsx": "react-jsx",
8
8
  "jsxImportSource": "@qwik.dev/core",
9
9
  "strict": true,
10
10
  "declaration": true,
11
- "declarationDir": "lib-types",
11
+ "declarationDir": "lib",
12
12
  "resolveJsonModule": true,
13
13
  "moduleResolution": "Bundler",
14
14
  "esModuleInterop": true,
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "emitDeclarationOnly": true,
6
+ "declarationDir": "lib",
7
+ "noEmit": false
8
+ },
9
+ "exclude": [
10
+ "src/routes/**",
11
+ "src/root.tsx",
12
+ "src/entry.ssr.tsx",
13
+ "src/entry.dev.tsx"
14
+ ]
15
+ }
@@ -1,7 +1,8 @@
1
1
  import { qwikVite } from "@qwik.dev/core/optimizer";
2
+ import { qwikRouter } from "@qwik.dev/router/vite";
2
3
  import { defineConfig } from "vite";
3
- import tsconfigPaths from "vite-tsconfig-paths";
4
4
  import pkg from "./package.json";
5
+ import tsconfigPaths from "vite-tsconfig-paths";
5
6
 
6
7
  const { dependencies = {}, peerDependencies = {} } = pkg as any;
7
8
  const makeRegex = (dep) => new RegExp(`^${dep}(/.*)?$`);
@@ -10,6 +11,7 @@ const excludeAll = (obj) => Object.keys(obj).map(makeRegex);
10
11
  export default defineConfig(() => {
11
12
  return {
12
13
  build: {
14
+ outDir: "lib",
13
15
  target: "es2020",
14
16
  lib: {
15
17
  entry: "./src/index",
@@ -18,7 +20,7 @@ export default defineConfig(() => {
18
20
  fileName: (format, entryName) =>
19
21
  `${entryName}.qwik.${format === "es" ? "mjs" : "cjs"}`,
20
22
  },
21
- rollupOptions: {
23
+ rolldownOptions: {
22
24
  output: {
23
25
  preserveModules: true,
24
26
  preserveModulesRoot: "src",
@@ -31,6 +33,6 @@ export default defineConfig(() => {
31
33
  ],
32
34
  },
33
35
  },
34
- plugins: [qwikVite(), tsconfigPaths({ root: "." })],
36
+ plugins: [qwikVite(), qwikRouter(), tsconfigPaths({ root: "." })],
35
37
  };
36
38
  });
@@ -13,10 +13,7 @@ export default component$(() => {
13
13
  </div>
14
14
  <ul>
15
15
  <li>
16
- <a
17
- href="https://qwik.dev/docs/components/overview/"
18
- target="_blank"
19
- >
16
+ <a href="https://qwik.dev/docs/core/overview/" target="_blank">
20
17
  Docs
21
18
  </a>
22
19
  </li>
@@ -16,7 +16,6 @@ export default component$(() => {
16
16
  number: 20,
17
17
  });
18
18
 
19
- // eslint-disable-next-line qwik/no-use-visible-task
20
19
  useVisibleTask$(({ cleanup }) => {
21
20
  const timeout = setTimeout(() => (state.count = 1), 500);
22
21
  cleanup(() => clearTimeout(timeout));
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "create-qwik",
3
3
  "description": "Interactive CLI for create Qwik projects and adding features.",
4
- "version": "2.0.0-beta.9",
4
+ "version": "2.0.0-rc.0",
5
5
  "author": "Qwik Team",
6
- "bin": "./create-qwik.cjs",
7
6
  "bugs": "https://github.com/QwikDev/qwik/issues",
7
+ "dependencies": {
8
+ "execa": "9.6.1"
9
+ },
8
10
  "devDependencies": {
9
- "@clack/prompts": "0.7.0",
10
- "@types/yargs": "17.0.33",
11
+ "@clack/prompts": "0.11.0",
12
+ "@types/yargs": "17.0.35",
11
13
  "kleur": "4.1.5",
12
14
  "yargs": "17.7.2"
13
15
  },
@@ -20,7 +22,7 @@
20
22
  "engines-annotation": "Mostly required by sharp which needs a Node-API v9 compatible runtime",
21
23
  "files": [
22
24
  "README.md",
23
- "create-qwik.cjs",
25
+ "create-qwik.mjs",
24
26
  "dist"
25
27
  ],
26
28
  "homepage": "https://qwik.dev/",
@@ -31,10 +33,14 @@
31
33
  "template"
32
34
  ],
33
35
  "license": "MIT",
34
- "main": "./dist/index.cjs",
36
+ "main": "./dist/index.mjs",
35
37
  "repository": {
36
38
  "type": "git",
37
39
  "url": "https://github.com/QwikDev/qwik.git",
38
40
  "directory": "packages/create-qwik"
41
+ },
42
+ "type": "module",
43
+ "bin": {
44
+ "create-qwik": "./create-qwik.mjs"
39
45
  }
40
46
  }
package/create-qwik.cjs DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- const createQwik = require('./dist/index.cjs');
3
- createQwik.runCli();