create-qwik 2.0.0-beta.9 → 2.0.0-rc.2
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/create-qwik.mjs +3 -0
- package/dist/index.mjs +193 -0
- package/dist/starters/apps/base/.prettierignore +1 -1
- package/dist/starters/apps/base/.vscode/mcp.json +9 -0
- package/dist/starters/apps/base/gitignore +2 -0
- package/dist/starters/apps/base/package.json +10 -10
- package/dist/starters/apps/base/tsconfig.json +2 -2
- package/dist/starters/apps/base/{vite.config.mts → vite.config.ts} +1 -14
- package/dist/starters/apps/library/.vscode/mcp.json +9 -0
- package/dist/starters/apps/library/README.md +8 -0
- package/dist/starters/apps/library/gitignore +2 -1
- package/dist/starters/apps/library/package.json +26 -16
- package/dist/starters/apps/library/src/entry.ssr.tsx +31 -0
- package/dist/starters/apps/library/src/global.css +33 -0
- package/dist/starters/apps/library/src/root.tsx +25 -13
- package/dist/starters/apps/library/src/routes/index.tsx +19 -0
- package/dist/starters/apps/library/tsconfig.json +3 -3
- package/dist/starters/apps/library/tsconfig.types.json +15 -0
- package/dist/starters/apps/library/{vite.config.mts → vite.config.ts} +5 -3
- package/dist/starters/apps/playground/src/components/starter/header/header.tsx +1 -4
- package/dist/starters/apps/playground/src/routes/demo/flower/index.tsx +0 -1
- package/package.json +12 -6
- package/create-qwik.cjs +0 -3
- package/dist/index.cjs +0 -186
- package/dist/starters/apps/base/src/entry.dev.tsx +0 -17
|
@@ -16,18 +16,18 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@qwik.dev/core": "^2.0.0-
|
|
20
|
-
"@qwik.dev/router": "^2.0.0-
|
|
19
|
+
"@qwik.dev/core": "^2.0.0-rc.2",
|
|
20
|
+
"@qwik.dev/router": "^2.0.0-rc.2",
|
|
21
21
|
"@eslint/js": "latest",
|
|
22
|
-
"@types/node": "
|
|
23
|
-
"typescript-eslint": "8.
|
|
24
|
-
"eslint": "
|
|
25
|
-
"eslint-plugin-qwik": "^2.0.0-
|
|
26
|
-
"globals": "
|
|
27
|
-
"prettier": "3.
|
|
28
|
-
"typescript": "5.
|
|
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.2",
|
|
26
|
+
"globals": "17.0.0",
|
|
27
|
+
"prettier": "3.7.4",
|
|
28
|
+
"typescript": "5.9.3",
|
|
29
29
|
"typescript-plugin-css-modules": "latest",
|
|
30
|
-
"vite": "
|
|
30
|
+
"vite": "8.2.1",
|
|
31
31
|
"vite-tsconfig-paths": "^4.2.1"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
@@ -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
|
|
86
|
+
Please keep each dependency in only one of them
|
|
100
87
|
`;
|
|
101
88
|
|
|
102
89
|
// Throw an error with the constructed message.
|
|
@@ -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.
|
|
@@ -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
|
|
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.2",
|
|
36
|
+
"@qwik.dev/router": "^2.0.0-rc.2"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"@qwik.dev/router": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
35
43
|
"devDependencies": {
|
|
36
|
-
"@qwik.dev/core": "2.0.0-
|
|
44
|
+
"@qwik.dev/core": "2.0.0-rc.2",
|
|
45
|
+
"@qwik.dev/router": "latest",
|
|
37
46
|
"@eslint/js": "latest",
|
|
38
|
-
"@types/node": "
|
|
39
|
-
"typescript-eslint": "8.
|
|
40
|
-
"eslint": "
|
|
41
|
-
"eslint-plugin-qwik": "2.0.0-
|
|
42
|
-
"globals": "
|
|
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.2",
|
|
51
|
+
"globals": "17.0.0",
|
|
43
52
|
"np": "^8.0.4",
|
|
44
|
-
"prettier": "3.
|
|
45
|
-
"typescript": "5.
|
|
46
|
-
"vite": "
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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": "
|
|
5
|
-
"module": "
|
|
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
|
|
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
|
-
|
|
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
|
});
|
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-
|
|
4
|
+
"version": "2.0.0-rc.2",
|
|
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.
|
|
10
|
-
"@types/yargs": "17.0.
|
|
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.
|
|
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.
|
|
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