create-vite-extra 0.1.1 → 0.1.3

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 (53) hide show
  1. package/README.md +7 -2
  2. package/index.js +26 -3
  3. package/package.json +1 -1
  4. package/template-deno-lit/README.md +30 -0
  5. package/template-deno-lit/deno.json +8 -0
  6. package/template-deno-lit/index.html +16 -0
  7. package/template-deno-lit/public/vite.svg +1 -0
  8. package/template-deno-lit/src/assets/lit.svg +1 -0
  9. package/template-deno-lit/src/index.css +31 -0
  10. package/template-deno-lit/src/my-element.js +129 -0
  11. package/template-deno-lit/vite.config.mjs +16 -0
  12. package/template-deno-preact/README.md +30 -0
  13. package/template-deno-preact/deno.json +8 -0
  14. package/template-deno-preact/index.html +13 -0
  15. package/template-deno-preact/public/vite.svg +1 -0
  16. package/template-deno-preact/src/app.css +25 -0
  17. package/template-deno-preact/src/app.jsx +32 -0
  18. package/template-deno-preact/src/assets/preact.svg +1 -0
  19. package/template-deno-preact/src/index.css +70 -0
  20. package/template-deno-preact/src/main.jsx +5 -0
  21. package/template-deno-preact/vite.config.mjs +10 -0
  22. package/template-deno-react/README.md +30 -0
  23. package/template-deno-react/deno.json +8 -0
  24. package/template-deno-react/index.html +13 -0
  25. package/template-deno-react/public/vite.svg +1 -0
  26. package/template-deno-react/src/App.css +41 -0
  27. package/template-deno-react/src/App.jsx +34 -0
  28. package/template-deno-react/src/assets/react.svg +1 -0
  29. package/template-deno-react/src/index.css +70 -0
  30. package/template-deno-react/src/main.jsx +10 -0
  31. package/template-deno-react/vite.config.mjs +10 -0
  32. package/template-deno-svelte/.vscode/extensions.json +3 -0
  33. package/template-deno-svelte/README.md +30 -0
  34. package/template-deno-svelte/deno.json +8 -0
  35. package/template-deno-svelte/index.html +13 -0
  36. package/template-deno-svelte/jsconfig.json +34 -0
  37. package/template-deno-svelte/public/vite.svg +1 -0
  38. package/template-deno-svelte/src/App.svelte +45 -0
  39. package/template-deno-svelte/src/app.css +81 -0
  40. package/template-deno-svelte/src/assets/svelte.svg +1 -0
  41. package/template-deno-svelte/src/lib/Counter.svelte +10 -0
  42. package/template-deno-svelte/src/main.js +8 -0
  43. package/template-deno-svelte/src/vite-env.d.ts +2 -0
  44. package/template-deno-svelte/vite.config.mjs +9 -0
  45. package/template-deno-vanilla/counter.js +9 -0
  46. package/template-deno-vanilla/deno.json +8 -0
  47. package/template-deno-vanilla/index.html +13 -0
  48. package/template-deno-vanilla/javascript.svg +1 -0
  49. package/template-deno-vanilla/main.js +23 -0
  50. package/template-deno-vanilla/public/vite.svg +1 -0
  51. package/template-deno-vanilla/style.css +97 -0
  52. package/template-deno-vue/README.md +11 -22
  53. package/template-deno-vue/deno.json +1 -1
package/README.md CHANGED
@@ -59,10 +59,15 @@ Currently supported template presets include:
59
59
  - `ssr-preact-ts`
60
60
  - `ssr-svelte`
61
61
  - `ssr-svelte-ts`
62
- - `ssr-transform`
62
+ - `deno-vanilla`
63
+ - `deno-vue`
64
+ - `deno-react`
65
+ - `deno-preact`
66
+ - `deno-lit`
67
+ - `deno-svelte`
63
68
  - `library`
64
69
  - `library-ts`
65
- - `deno-vue`
70
+ - `ssr-transform`
66
71
 
67
72
  You can use `.` for the project name to scaffold in the current directory.
68
73
 
package/index.js CHANGED
@@ -105,9 +105,29 @@ const FRAMEWORKS = [
105
105
  ]
106
106
  },
107
107
  {
108
- name: 'ssr-transform',
108
+ name: 'deno-vanilla',
109
+ color: yellow
110
+ },
111
+ {
112
+ name: 'deno-vue',
113
+ color: green
114
+ },
115
+ {
116
+ name: 'deno-react',
117
+ color: cyan
118
+ },
119
+ {
120
+ name: 'deno-preact',
121
+ color: magenta
122
+ },
123
+ {
124
+ name: 'deno-lit',
109
125
  color: lightRed
110
126
  },
127
+ {
128
+ name: 'deno-svelte',
129
+ color: red
130
+ },
111
131
  {
112
132
  name: 'library',
113
133
  color: lightMagenta,
@@ -125,8 +145,8 @@ const FRAMEWORKS = [
125
145
  ]
126
146
  },
127
147
  {
128
- name: 'deno-vue',
129
- color: green
148
+ name: 'ssr-transform',
149
+ color: lightRed
130
150
  }
131
151
  ]
132
152
 
@@ -139,6 +159,8 @@ const renameFiles = {
139
159
  }
140
160
 
141
161
  async function init() {
162
+ /** @type {string} */
163
+ // @ts-ignore
142
164
  let targetDir = formatTargetDir(argv._[0])
143
165
  let template = argv.template || argv.t
144
166
 
@@ -171,6 +193,7 @@ async function init() {
171
193
  ` is not empty. Remove existing files and continue?`
172
194
  },
173
195
  {
196
+ // @ts-ignore
174
197
  type: (_, { overwrite } = {}) => {
175
198
  if (overwrite === false) {
176
199
  throw new Error(red('✖') + ' Operation cancelled')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vite-extra",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Bjorn Lu",
@@ -0,0 +1,30 @@
1
+ # Vite + Vue + Lit
2
+
3
+ ## Running
4
+
5
+ You need to have Deno v1.25.4 or later intalled to run this repo.
6
+
7
+ Start a dev server:
8
+
9
+ ```
10
+ $ deno task dev
11
+ ```
12
+
13
+ ## Deploy
14
+
15
+ Build production assets:
16
+
17
+ ```
18
+ $ deno task build
19
+ ```
20
+
21
+ ## Notes
22
+
23
+ - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
24
+
25
+ ## Papercuts
26
+
27
+ Currently there's a "papercut" for Deno users:
28
+
29
+ - peer dependencies need to be referenced in `vite.config.js` - in this example
30
+ it is `lit` package that needs to be referenced
@@ -0,0 +1,8 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --unstable --node-modules-dir npm:vite",
4
+ "build": "deno run -A --unstable --node-modules-dir npm:vite build",
5
+ "preview": "deno run -A --unstable --node-modules-dir npm:vite preview",
6
+ "serve": "deno run --allow-net --allow-read https://deno.land/std@0.157.0/http/file_server.ts dist/"
7
+ }
8
+ }
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Lit</title>
8
+ <link rel="stylesheet" href="./src/index.css" />
9
+ <script type="module" src="/src/my-element.js"></script>
10
+ </head>
11
+ <body>
12
+ <my-element>
13
+ <h1>Vite + Lit</h1>
14
+ </my-element>
15
+ </body>
16
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="25.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 320"><path fill="#00E8FF" d="m64 192l25.926-44.727l38.233-19.114l63.974 63.974l10.833 61.754L192 320l-64-64l-38.074-25.615z"></path><path fill="#283198" d="M128 256V128l64-64v128l-64 64ZM0 256l64 64l9.202-60.602L64 192l-37.542 23.71L0 256Z"></path><path fill="#324FFF" d="M64 192V64l64-64v128l-64 64Zm128 128V192l64-64v128l-64 64ZM0 256V128l64 64l-64 64Z"></path><path fill="#0FF" d="M64 320V192l64 64z"></path></svg>
@@ -0,0 +1,31 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+
7
+ color-scheme: light dark;
8
+ color: rgba(255, 255, 255, 0.87);
9
+ background-color: #242424;
10
+
11
+ font-synthesis: none;
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ -webkit-text-size-adjust: 100%;
16
+ }
17
+
18
+ body {
19
+ margin: 0;
20
+ display: flex;
21
+ place-items: center;
22
+ min-width: 320px;
23
+ min-height: 100vh;
24
+ }
25
+
26
+ @media (prefers-color-scheme: light) {
27
+ :root {
28
+ color: #213547;
29
+ background-color: #ffffff;
30
+ }
31
+ }
@@ -0,0 +1,129 @@
1
+ import { LitElement, css, html } from 'lit'
2
+ import litLogo from './assets/lit.svg'
3
+
4
+ /**
5
+ * An example element.
6
+ *
7
+ * @slot - This element has a slot
8
+ * @csspart button - The button
9
+ */
10
+ export class MyElement extends LitElement {
11
+ static get properties() {
12
+ return {
13
+ /**
14
+ * Copy for the read the docs hint.
15
+ */
16
+ docsHint: { type: String },
17
+
18
+ /**
19
+ * The number of times the button has been clicked.
20
+ */
21
+ count: { type: Number }
22
+ }
23
+ }
24
+
25
+ constructor() {
26
+ super()
27
+ this.docsHint = 'Click on the Vite and Lit logos to learn more'
28
+ this.count = 0
29
+ }
30
+
31
+ render() {
32
+ return html`
33
+ <div>
34
+ <a href="https://vitejs.dev" target="_blank">
35
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
36
+ </a>
37
+ <a href="https://lit.dev" target="_blank">
38
+ <img src=${litLogo} class="logo lit" alt="Lit logo" />
39
+ </a>
40
+ </div>
41
+ <slot></slot>
42
+ <div class="card">
43
+ <button @click=${this._onClick} part="button">
44
+ count is ${this.count}
45
+ </button>
46
+ </div>
47
+ <p class="read-the-docs">${this.docsHint}</p>
48
+ `
49
+ }
50
+
51
+ _onClick() {
52
+ this.count++
53
+ }
54
+
55
+ static get styles() {
56
+ return css`
57
+ :host {
58
+ max-width: 1280px;
59
+ margin: 0 auto;
60
+ padding: 2rem;
61
+ text-align: center;
62
+ }
63
+
64
+ .logo {
65
+ height: 6em;
66
+ padding: 1.5em;
67
+ will-change: filter;
68
+ }
69
+ .logo:hover {
70
+ filter: drop-shadow(0 0 2em #646cffaa);
71
+ }
72
+ .logo.lit:hover {
73
+ filter: drop-shadow(0 0 2em #325cffaa);
74
+ }
75
+
76
+ .card {
77
+ padding: 2em;
78
+ }
79
+
80
+ .read-the-docs {
81
+ color: #888;
82
+ }
83
+
84
+ a {
85
+ font-weight: 500;
86
+ color: #646cff;
87
+ text-decoration: inherit;
88
+ }
89
+ a:hover {
90
+ color: #535bf2;
91
+ }
92
+
93
+ h1 {
94
+ font-size: 3.2em;
95
+ line-height: 1.1;
96
+ }
97
+
98
+ button {
99
+ border-radius: 8px;
100
+ border: 1px solid transparent;
101
+ padding: 0.6em 1.2em;
102
+ font-size: 1em;
103
+ font-weight: 500;
104
+ font-family: inherit;
105
+ background-color: #1a1a1a;
106
+ cursor: pointer;
107
+ transition: border-color 0.25s;
108
+ }
109
+ button:hover {
110
+ border-color: #646cff;
111
+ }
112
+ button:focus,
113
+ button:focus-visible {
114
+ outline: 4px auto -webkit-focus-ring-color;
115
+ }
116
+
117
+ @media (prefers-color-scheme: light) {
118
+ a:hover {
119
+ color: #747bff;
120
+ }
121
+ button {
122
+ background-color: #f9f9f9;
123
+ }
124
+ }
125
+ `
126
+ }
127
+ }
128
+
129
+ window.customElements.define('my-element', MyElement)
@@ -0,0 +1,16 @@
1
+ import { defineConfig } from 'npm:vite'
2
+
3
+ import "npm:lit";
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig({
7
+ build: {
8
+ lib: {
9
+ entry: 'src/my-element.js',
10
+ formats: ['es']
11
+ },
12
+ rollupOptions: {
13
+ external: /^lit/
14
+ }
15
+ }
16
+ })
@@ -0,0 +1,30 @@
1
+ # Vite + Vue + Preact
2
+
3
+ ## Running
4
+
5
+ You need to have Deno v1.25.4 or later intalled to run this repo.
6
+
7
+ Start a dev server:
8
+
9
+ ```
10
+ $ deno task dev
11
+ ```
12
+
13
+ ## Deploy
14
+
15
+ Build production assets:
16
+
17
+ ```
18
+ $ deno task build
19
+ ```
20
+
21
+ ## Notes
22
+
23
+ - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
24
+
25
+ ## Papercuts
26
+
27
+ Currently there's a "papercut" for Deno users:
28
+
29
+ - peer dependencies need to be referenced in `vite.config.js` - in this example
30
+ it is `preact` and `preact/hooks` packages that need to be referenced
@@ -0,0 +1,8 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --unstable --node-modules-dir npm:vite",
4
+ "build": "deno run -A --unstable --node-modules-dir npm:vite build",
5
+ "preview": "deno run -A --unstable --node-modules-dir npm:vite preview",
6
+ "serve": "deno run --allow-net --allow-read https://deno.land/std@0.157.0/http/file_server.ts dist/"
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Preact</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.jsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,25 @@
1
+ #app {
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
+ }
7
+
8
+ .logo {
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ }
12
+ .logo:hover {
13
+ filter: drop-shadow(0 0 2em #646cffaa);
14
+ }
15
+ .logo.preact:hover {
16
+ filter: drop-shadow(0 0 2em #673ab8aa);
17
+ }
18
+
19
+ .card {
20
+ padding: 2em;
21
+ }
22
+
23
+ .read-the-docs {
24
+ color: #888;
25
+ }
@@ -0,0 +1,32 @@
1
+ import { useState } from 'preact/hooks'
2
+ import preactLogo from './assets/preact.svg'
3
+ import './app.css'
4
+
5
+ export function App() {
6
+ const [count, setCount] = useState(0)
7
+
8
+ return (
9
+ <>
10
+ <div>
11
+ <a href="https://vitejs.dev" target="_blank">
12
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
13
+ </a>
14
+ <a href="https://preactjs.com" target="_blank">
15
+ <img src={preactLogo} class="logo preact" alt="Preact logo" />
16
+ </a>
17
+ </div>
18
+ <h1>Vite + Preact</h1>
19
+ <div class="card">
20
+ <button onClick={() => setCount((count) => count + 1)}>
21
+ count is {count}
22
+ </button>
23
+ <p>
24
+ Edit <code>src/app.jsx</code> and save to test HMR
25
+ </p>
26
+ </div>
27
+ <p class="read-the-docs">
28
+ Click on the Vite and Preact logos to learn more
29
+ </p>
30
+ </>
31
+ )
32
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="27.68" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 296"><path fill="#673AB8" d="m128 0l128 73.9v147.8l-128 73.9L0 221.7V73.9z"></path><path fill="#FFF" d="M34.865 220.478c17.016 21.78 71.095 5.185 122.15-34.704c51.055-39.888 80.24-88.345 63.224-110.126c-17.017-21.78-71.095-5.184-122.15 34.704c-51.055 39.89-80.24 88.346-63.224 110.126Zm7.27-5.68c-5.644-7.222-3.178-21.402 7.573-39.253c11.322-18.797 30.541-39.548 54.06-57.923c23.52-18.375 48.303-32.004 69.281-38.442c19.922-6.113 34.277-5.075 39.92 2.148c5.644 7.223 3.178 21.403-7.573 39.254c-11.322 18.797-30.541 39.547-54.06 57.923c-23.52 18.375-48.304 32.004-69.281 38.441c-19.922 6.114-34.277 5.076-39.92-2.147Z"></path><path fill="#FFF" d="M220.239 220.478c17.017-21.78-12.169-70.237-63.224-110.126C105.96 70.464 51.88 53.868 34.865 75.648c-17.017 21.78 12.169 70.238 63.224 110.126c51.055 39.889 105.133 56.485 122.15 34.704Zm-7.27-5.68c-5.643 7.224-19.998 8.262-39.92 2.148c-20.978-6.437-45.761-20.066-69.28-38.441c-23.52-18.376-42.74-39.126-54.06-57.923c-10.752-17.851-13.218-32.03-7.575-39.254c5.644-7.223 19.999-8.261 39.92-2.148c20.978 6.438 45.762 20.067 69.281 38.442c23.52 18.375 42.739 39.126 54.06 57.923c10.752 17.85 13.218 32.03 7.574 39.254Z"></path><path fill="#FFF" d="M127.552 167.667c10.827 0 19.603-8.777 19.603-19.604c0-10.826-8.776-19.603-19.603-19.603c-10.827 0-19.604 8.777-19.604 19.603c0 10.827 8.777 19.604 19.604 19.604Z"></path></svg>
@@ -0,0 +1,70 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+
7
+ color-scheme: light dark;
8
+ color: rgba(255, 255, 255, 0.87);
9
+ background-color: #242424;
10
+
11
+ font-synthesis: none;
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ -webkit-text-size-adjust: 100%;
16
+ }
17
+
18
+ a {
19
+ font-weight: 500;
20
+ color: #646cff;
21
+ text-decoration: inherit;
22
+ }
23
+ a:hover {
24
+ color: #535bf2;
25
+ }
26
+
27
+ body {
28
+ margin: 0;
29
+ display: flex;
30
+ place-items: center;
31
+ min-width: 320px;
32
+ min-height: 100vh;
33
+ }
34
+
35
+ h1 {
36
+ font-size: 3.2em;
37
+ line-height: 1.1;
38
+ }
39
+
40
+ button {
41
+ border-radius: 8px;
42
+ border: 1px solid transparent;
43
+ padding: 0.6em 1.2em;
44
+ font-size: 1em;
45
+ font-weight: 500;
46
+ font-family: inherit;
47
+ background-color: #1a1a1a;
48
+ cursor: pointer;
49
+ transition: border-color 0.25s;
50
+ }
51
+ button:hover {
52
+ border-color: #646cff;
53
+ }
54
+ button:focus,
55
+ button:focus-visible {
56
+ outline: 4px auto -webkit-focus-ring-color;
57
+ }
58
+
59
+ @media (prefers-color-scheme: light) {
60
+ :root {
61
+ color: #213547;
62
+ background-color: #ffffff;
63
+ }
64
+ a:hover {
65
+ color: #747bff;
66
+ }
67
+ button {
68
+ background-color: #f9f9f9;
69
+ }
70
+ }
@@ -0,0 +1,5 @@
1
+ import { render } from 'preact'
2
+ import { App } from './app'
3
+ import './index.css'
4
+
5
+ render(<App />, document.getElementById('app'))
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'npm:vite'
2
+ import preact from 'npm:@preact/preset-vite'
3
+
4
+ import "npm:preact";
5
+ import "npm:preact/hooks";
6
+
7
+ // https://vitejs.dev/config/
8
+ export default defineConfig({
9
+ plugins: [preact()]
10
+ })
@@ -0,0 +1,30 @@
1
+ # Vite + Vue + React
2
+
3
+ ## Running
4
+
5
+ You need to have Deno v1.25.4 or later intalled to run this repo.
6
+
7
+ Start a dev server:
8
+
9
+ ```
10
+ $ deno task dev
11
+ ```
12
+
13
+ ## Deploy
14
+
15
+ Build production assets:
16
+
17
+ ```
18
+ $ deno task build
19
+ ```
20
+
21
+ ## Notes
22
+
23
+ - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
24
+
25
+ ## Papercuts
26
+
27
+ Currently there's a "papercut" for Deno users:
28
+
29
+ - peer dependencies need to be referenced in `vite.config.js` - in this example
30
+ it is `react` and `react-dom` packages that need to be referenced
@@ -0,0 +1,8 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --unstable --node-modules-dir npm:vite",
4
+ "build": "deno run -A --unstable --node-modules-dir npm:vite build",
5
+ "preview": "deno run -A --unstable --node-modules-dir npm:vite preview",
6
+ "serve": "deno run --allow-net --allow-read https://deno.land/std@0.157.0/http/file_server.ts dist/"
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + React</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.jsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,41 @@
1
+ #root {
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
+ }
7
+
8
+ .logo {
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ will-change: filter;
12
+ }
13
+ .logo:hover {
14
+ filter: drop-shadow(0 0 2em #646cffaa);
15
+ }
16
+ .logo.react:hover {
17
+ filter: drop-shadow(0 0 2em #61dafbaa);
18
+ }
19
+
20
+ @keyframes logo-spin {
21
+ from {
22
+ transform: rotate(0deg);
23
+ }
24
+ to {
25
+ transform: rotate(360deg);
26
+ }
27
+ }
28
+
29
+ @media (prefers-reduced-motion: no-preference) {
30
+ a:nth-of-type(2) .logo {
31
+ animation: logo-spin infinite 20s linear;
32
+ }
33
+ }
34
+
35
+ .card {
36
+ padding: 2em;
37
+ }
38
+
39
+ .read-the-docs {
40
+ color: #888;
41
+ }