Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: ⚡ change starter
  • Loading branch information
leifermendez committed Jun 26, 2023
commit caaf3100e3651bca39ae539ca5c6701d5d147c9a
6 changes: 6 additions & 0 deletions packages/create-vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ const FRAMEWORKS: Framework[] = [
display: 'TypeScript',
color: lightBlue,
},
{
name: 'custom-qwik-city',
display: 'QwikCity ↗',
color: lightBlue,
customCommand: 'npm create qwik@latest TARGET_DIR',
},
],
},
{
Expand Down
7 changes: 0 additions & 7 deletions packages/create-vite/template-qwik-ts/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,3 @@ build
dist
tsconfig.tsbuildinfo
vite.config.ts
*.spec.tsx
*.spec.ts
.netlify
pnpm-lock.yaml
package-lock.json
yarn.lock
server
1 change: 0 additions & 1 deletion packages/create-vite/template-qwik-ts/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ module.exports = {
'no-case-declarations': 'off',
'no-console': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/consistent-type-imports': 'warn',
},
}
34 changes: 1 addition & 33 deletions packages/create-vite/template-qwik-ts/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
# Files Prettier should not format
**/*.log
**/.DS_Store
*.
.vscode/settings.json
.history
.yarn
bazel-*
bazel-bin
bazel-out
bazel-qwik
bazel-testlogs
dist
dist-dev
lib
lib-types
etc
external
node_modules
temp
tsc-out
tsdoc-metadata.json
target
output
rollup.config.js
build
.cache
.vscode
.rollup.cache
dist
tsconfig.tsbuildinfo
vite.config.ts
*.spec.tsx
*.spec.ts
.netlify
pnpm-lock.yaml
package-lock.json
yarn.lock
server
4 changes: 0 additions & 4 deletions packages/create-vite/template-qwik-ts/.vscode/extensions.json

This file was deleted.

48 changes: 15 additions & 33 deletions packages/create-vite/template-qwik-ts/README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,47 @@
# Qwik City App ⚡️
# Qwik Library ⚡️

- [Qwik Docs](https://qwik.builder.io/)
- [Discord](https://qwik.builder.io/chat)
- [Qwik GitHub](https://github.com/BuilderIO/qwik)
- [Qwik on GitHub](https://github.com/BuilderIO/qwik)
- [@QwikDev](https://twitter.com/QwikDev)
- [Vite](https://vitejs.dev/)
- [Partytown](https://partytown.builder.io/)
- [Mitosis](https://github.com/BuilderIO/mitosis)
- [Builder.io](https://www.builder.io/)

---

## Project Structure

This project is using Qwik with [QwikCity](https://qwik.builder.io/qwikcity/overview/). QwikCity is just an extra set of tools on top of Qwik to make it easier to build a full site, including directory-based routing, layouts, and more.

Inside your project, you'll see the following directory structure:
Inside your project, you'll see the following directories and files:

```
├── public/
│ └── ...
└── src/
├── components/
│ └── ...
└── routes/
└── ...
└── index.ts
```

- `src/routes`: Provides the directory based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.builder.io/qwikcity/routing/overview/) for more info.

- `src/components`: Recommended directory for components.

- `public`: Any static assets, like images, can be placed in the public directory. Please see the [Vite public directory](https://vitejs.dev/guide/assets.html#the-public-directory) for more info.

## Add Integrations and deployment

Use the `npm run qwik add` command to add additional integrations. Some examples of integrations include: Cloudflare, Netlify or Express server, and the [Static Site Generator (SSG)](https://qwik.builder.io/qwikcity/guides/static-site-generation/).

```shell
npm run qwik add # or `yarn qwik add`
```
- `index.ts`: The entry point of your component library, make sure all the public components are exported from this file.

## Development

Development mode uses [Vite's development server](https://vitejs.dev/). During development, the `dev` command will server-side render (SSR) the output.
Development mode uses [Vite's development server](https://vitejs.dev/). For Qwik during development, the `dev` command will also server-side render (SSR) the output. The client-side development modules are loaded by the browser.

```shell
npm start # or `yarn start`
```

> Note: during dev mode, Vite may request a significant number of `.js` files. This does not represent a Qwik production build.

## Preview

The preview command will create a production build of the client modules, a production build of `src/entry.preview.tsx`, and run a local server. The preview server is only for convenience to locally preview a production build, and it should not be used as a production server.

```shell
npm run preview # or `yarn preview`
pnpm dev
```

> Note: during dev mode, Vite will request many JS files, which does not represent a Qwik production build.

## Production

The production build will generate client and server modules by running both client and server build commands. Additionally, the build command will use Typescript to run a type check on the source code.
The production build should generate the production build of your component library in (./lib) and the typescript type definitions in (./lib-types).

```shell
npm run build # or `yarn build`
```
pnpm build
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

# Development
node_modules
*.local

# Cache
.cache
.mf
.vscode
.rollup.cache
tsconfig.tsbuildinfo

Expand All @@ -24,7 +24,6 @@ pnpm-debug.log*
lerna-debug.log*

# Editor
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
Expand Down
25 changes: 12 additions & 13 deletions packages/create-vite/template-qwik-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
{
"name": "my-qwik-empty-starter",
"description": "App with Routing built-in ready to create your app",
"name": "my-qwik-library-name",
"version": "0.0.1",
"description": "Create a reusable Qwik component library",
"engines": {
"node": ">=15.0.0"
},
"private": true,
"private": false,
"type": "module",
"scripts": {
"build": "qwik build",
"build.client": "vite build",
"build.preview": "vite build --ssr src/entry.preview.tsx",
"build.types": "tsc --incremental --noEmit",
"deploy": "echo 'Run \"npm run qwik add\" to install a server adapter'",
"build.lib": "vite build --mode lib",
"build.types": "tsc --emitDeclarationOnly",
"dev": "vite --mode ssr",
"dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
"fmt": "prettier --write .",
"fmt.check": "prettier --check .",
"lint": "eslint \"src/**/*.ts*\"",
"preview": "qwik build preview && vite preview --open",
"release": "np",
"start": "vite --open --mode ssr",
"qwik": "qwik"
},
"devDependencies": {
"@builder.io/qwik": "^1.1.5",
"@builder.io/qwik-city": "^1.1.5",
"@builder.io/qwik": "1.1.5",
"@types/eslint": "8.40.0",
"@types/node": "^20.2.5",
"@typescript-eslint/eslint-plugin": "5.59.8",
"@typescript-eslint/parser": "5.59.8",
"eslint": "8.41.0",
"eslint-plugin-qwik": "^1.1.5",
"eslint-plugin-qwik": "latest",
"np": "7.6.1",
"prettier": "2.8.8",
"typescript": "5.0.4",
"undici": "5.22.1",
"vite": "4.3.9",
"vite-tsconfig-paths": "4.2.0"
"vite": "4.3.9"
}
}
1 change: 0 additions & 1 deletion packages/create-vite/template-qwik-ts/public/favicon.svg

This file was deleted.

9 changes: 0 additions & 9 deletions packages/create-vite/template-qwik-ts/public/manifest.json

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { component$, useSignal } from '@builder.io/qwik'
import type { DocumentHead } from '@builder.io/qwik-city'

import qwiklogo from '~/assets/qwik.svg'
import viteLogo from '~/assets/vite.svg'
import qwiklogo from '../../assets/qwik.svg'
import viteLogo from '../../assets/vite.svg'

export default component$(() => {
export const App = component$(() => {
const count = useSignal(0)

return (
<>
<div id="root">
<div id="container">
<div>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} class="logo" alt="Vite logo" />
Expand All @@ -34,13 +33,3 @@ export default component$(() => {
</>
)
})

export const head: DocumentHead = {
title: 'Vite + Qwik + TS',
meta: [
{
name: 'description',
content: 'Qwik site description',
},
],
}

This file was deleted.

20 changes: 0 additions & 20 deletions packages/create-vite/template-qwik-ts/src/entry.preview.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions packages/create-vite/template-qwik-ts/src/entry.ssr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,5 @@ export default function (opts: RenderToStreamOptions) {
return renderToStream(<Root />, {
manifest,
...opts,
// Use container attributes to set attributes on the html tag.
containerAttributes: {
lang: 'en-us',
...opts.containerAttributes,
},
})
}
Loading